diff options
author | sjg <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2014-08-19 06:50:54 +0000 |
commit | d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2 (patch) | |
tree | b04f4bd7cd887f50e7d98af35f46b9834ff86c80 /tools | |
parent | 3c8e37b1d04827f33c0c9a7594bd1b1ef7cdb3d3 (diff) | |
parent | 4fbde208c6460d576f64d6dc3cdc6cab085a4283 (diff) | |
download | FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.zip FreeBSD-src-d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2.tar.gz |
Merge head from 7/28
Diffstat (limited to 'tools')
53 files changed, 689 insertions, 1705 deletions
diff --git a/tools/bsdbox/Makefile b/tools/bsdbox/Makefile index 2e3d6a3..aaf6ab9 100644 --- a/tools/bsdbox/Makefile +++ b/tools/bsdbox/Makefile @@ -57,7 +57,7 @@ CRUNCH_SRCDIRS+= bin # statically - and that ends very badly. CRUNCH_SHLIBS+= -lc -lutil -lcrypt CRUNCH_LIBS+= -lkvm -lmemstat -lnetgraph -CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcap +CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcapw ################################################################### # Programs from standard /sbin @@ -70,7 +70,7 @@ CRUNCH_LIBS+= -lcrypt -ledit -ll -ltermcap # CRUNCH_SRCDIRS+= sbin -CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec +CRUNCH_LIBS+= -lalias -lcam -lcursesw -ldevstat -lipsec # Don't forget this - ifconfig, etc -adrian CRUNCH_LIBS+= -lgeom -lbsdxml -ljail -lkiconv -lmd -lsbuf -lufs diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index d787cb9..75fde37 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -488,41 +488,41 @@ OLD_FILES+=usr/bin/clang++ OLD_FILES+=usr/bin/clang-cpp OLD_FILES+=usr/bin/clang-tblgen OLD_FILES+=usr/bin/tblgen -OLD_FILES+=usr/include/clang/3.4/__wmmintrin_aes.h -OLD_FILES+=usr/include/clang/3.4/__wmmintrin_pclmul.h -OLD_FILES+=usr/include/clang/3.4/altivec.h -OLD_FILES+=usr/include/clang/3.4/ammintrin.h -OLD_FILES+=usr/include/clang/3.4/arm_neon.h -OLD_FILES+=usr/include/clang/3.4/avx2intrin.h -OLD_FILES+=usr/include/clang/3.4/avxintrin.h -OLD_FILES+=usr/include/clang/3.4/bmi2intrin.h -OLD_FILES+=usr/include/clang/3.4/bmiintrin.h -OLD_FILES+=usr/include/clang/3.4/cpuid.h -OLD_FILES+=usr/include/clang/3.4/emmintrin.h -OLD_FILES+=usr/include/clang/3.4/f16cintrin.h -OLD_FILES+=usr/include/clang/3.4/fma4intrin.h -OLD_FILES+=usr/include/clang/3.4/fmaintrin.h -OLD_FILES+=usr/include/clang/3.4/immintrin.h -OLD_FILES+=usr/include/clang/3.4/lzcntintrin.h -OLD_FILES+=usr/include/clang/3.4/mm3dnow.h -OLD_FILES+=usr/include/clang/3.4/mm_malloc.h -OLD_FILES+=usr/include/clang/3.4/mmintrin.h -OLD_FILES+=usr/include/clang/3.4/module.map -OLD_FILES+=usr/include/clang/3.4/nmmintrin.h -OLD_FILES+=usr/include/clang/3.4/pmmintrin.h -OLD_FILES+=usr/include/clang/3.4/popcntintrin.h -OLD_FILES+=usr/include/clang/3.4/prfchwintrin.h -OLD_FILES+=usr/include/clang/3.4/rdseedintrin.h -OLD_FILES+=usr/include/clang/3.4/rtmintrin.h -OLD_FILES+=usr/include/clang/3.4/shaintrin.h -OLD_FILES+=usr/include/clang/3.4/smmintrin.h -OLD_FILES+=usr/include/clang/3.4/tbmintrin.h -OLD_FILES+=usr/include/clang/3.4/tmmintrin.h -OLD_FILES+=usr/include/clang/3.4/wmmintrin.h -OLD_FILES+=usr/include/clang/3.4/x86intrin.h -OLD_FILES+=usr/include/clang/3.4/xmmintrin.h -OLD_FILES+=usr/include/clang/3.4/xopintrin.h -OLD_DIRS+=usr/include/clang/3.4 +OLD_FILES+=usr/include/clang/3.4.1/__wmmintrin_aes.h +OLD_FILES+=usr/include/clang/3.4.1/__wmmintrin_pclmul.h +OLD_FILES+=usr/include/clang/3.4.1/altivec.h +OLD_FILES+=usr/include/clang/3.4.1/ammintrin.h +OLD_FILES+=usr/include/clang/3.4.1/arm_neon.h +OLD_FILES+=usr/include/clang/3.4.1/avx2intrin.h +OLD_FILES+=usr/include/clang/3.4.1/avxintrin.h +OLD_FILES+=usr/include/clang/3.4.1/bmi2intrin.h +OLD_FILES+=usr/include/clang/3.4.1/bmiintrin.h +OLD_FILES+=usr/include/clang/3.4.1/cpuid.h +OLD_FILES+=usr/include/clang/3.4.1/emmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/f16cintrin.h +OLD_FILES+=usr/include/clang/3.4.1/fma4intrin.h +OLD_FILES+=usr/include/clang/3.4.1/fmaintrin.h +OLD_FILES+=usr/include/clang/3.4.1/immintrin.h +OLD_FILES+=usr/include/clang/3.4.1/lzcntintrin.h +OLD_FILES+=usr/include/clang/3.4.1/mm3dnow.h +OLD_FILES+=usr/include/clang/3.4.1/mm_malloc.h +OLD_FILES+=usr/include/clang/3.4.1/mmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/module.map +OLD_FILES+=usr/include/clang/3.4.1/nmmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/pmmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/popcntintrin.h +OLD_FILES+=usr/include/clang/3.4.1/prfchwintrin.h +OLD_FILES+=usr/include/clang/3.4.1/rdseedintrin.h +OLD_FILES+=usr/include/clang/3.4.1/rtmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/shaintrin.h +OLD_FILES+=usr/include/clang/3.4.1/smmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/tbmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/tmmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/wmmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/x86intrin.h +OLD_FILES+=usr/include/clang/3.4.1/xmmintrin.h +OLD_FILES+=usr/include/clang/3.4.1/xopintrin.h +OLD_DIRS+=usr/include/clang/3.4.1 OLD_DIRS+=usr/include/clang OLD_FILES+=usr/share/doc/llvm/clang/LICENSE.TXT OLD_DIRS+=usr/share/doc/llvm/clang @@ -1283,8 +1283,6 @@ OLD_FILES+=usr/include/gcc/4.2/pmmintrin.h OLD_FILES+=usr/include/gcc/4.2/tmmintrin.h OLD_FILES+=usr/include/gcc/4.2/wmmintrin.h OLD_FILES+=usr/include/gcc/4.2/xmmintrin.h -.elif ${TARGET_ARCH} == "ia64" -OLD_FILES+=usr/include/gcc/4.2/ia64intrin.h .elif ${TARGET_ARCH} == "arm" OLD_FILES+=usr/include/gcc/4.2/mmintrin.h .elif ${TARGET_ARCH} == "powerpc" || ${TARGET_ARCH} == "powerpc64" @@ -1833,6 +1831,9 @@ OLD_DIRS+=usr/share/tmac .endif .if ${MK_GSSAPI} == no +OLD_FILES+=usr/include/gssapi/gssapi.h +OLD_DIRS+=usr/include/gssapi +OLD_FILES+=usr/include/gssapi.h OLD_FILES+=usr/lib/libgssapi.a OLD_FILES+=usr/lib/libgssapi.so OLD_LIBS+=usr/lib/libgssapi.so.10 @@ -1976,9 +1977,39 @@ OLD_FILES+=usr/share/man/man8/traceroute6.8.gz OLD_FILES+=rescue/ping6 .endif -#.if ${MK_INFO} == no -# to be filled in -#.endif +.if ${MK_INFO} == no +OLD_FILES+=usr/bin/info +OLD_FILES+=usr/bin/infokey +OLD_FILES+=usr/bin/install-info +OLD_FILES+=usr/bin/makeinfo +OLD_FILES+=usr/bin/texindex +OLD_FILES+=usr/share/info/am-utils.info.gz +OLD_FILES+=usr/share/info/as-utils.info.gz +OLD_FILES+=usr/share/info/binutils.info.gz +OLD_FILES+=usr/share/info/com_err.info.gz +OLD_FILES+=usr/share/info/diff.info.gz +OLD_FILES+=usr/share/info/gdb.info.gz +OLD_FILES+=usr/share/info/gdbint.info.gz +OLD_FILES+=usr/share/info/gperf.info.gz +OLD_FILES+=usr/share/info/grep.info.gz +OLD_FILES+=usr/share/info/groff.info.gz +OLD_FILES+=usr/share/info/heimdal.info.gz +OLD_FILES+=usr/share/info/history.info.gz +OLD_FILES+=usr/share/info/info-stnd.info.gz +OLD_FILES+=usr/share/info/info.info.gz +OLD_FILES+=usr/share/info/ld.info.gz +OLD_FILES+=usr/share/info/regex.info.gz +OLD_FILES+=usr/share/info/rluserman.info.gz +OLD_FILES+=usr/share/info/stabs.info.gz +OLD_FILES+=usr/share/info/texinfo.info.gz +OLD_FILES+=usr/share/man/man1/info.1.gz +OLD_FILES+=usr/share/man/man1/infokey.1.gz +OLD_FILES+=usr/share/man/man1/install-info.1.gz +OLD_FILES+=usr/share/man/man1/makeinfo.1.gz +OLD_FILES+=usr/share/man/man1/texindex.1.gz +OLD_FILES+=usr/share/man/man5/info.5.gz +OLD_FILES+=usr/share/man/man5/texinfo.5.gz +.endif .if ${MK_IPFILTER} == no OLD_FILES+=etc/periodic/security/510.ipfdenied @@ -3357,9 +3388,10 @@ OLD_FILES+=var/yp/Makefile OLD_FILES+=var/yp/Makefile.dist .endif -#.if ${MK_NLS} == no +.if ${MK_NLS} == no +OLD_FILES+=usr/tests/bin/sh/builtins/locale1.0 # to be filled in -#.endif +.endif .if ${MK_NTP} == no OLD_FILES+=etc/ntp.conf @@ -3699,7 +3731,6 @@ OLD_FILES+=usr/lib/libpcap_p.a OLD_FILES+=usr/lib/libpmc_p.a OLD_FILES+=usr/lib/libpthread_p.a OLD_FILES+=usr/lib/libradius_p.a -OLD_FILES+=usr/lib/libreadline_p.a OLD_FILES+=usr/lib/libroken_p.a OLD_FILES+=usr/lib/librpcsvc_p.a OLD_FILES+=usr/lib/librt_p.a @@ -4103,7 +4134,51 @@ OLD_FILES+=usr/share/man/man8/telnetd.8.gz .endif .if ${MK_TESTS} == yes +OLD_FILES+=usr/bin/atf-sh +OLD_LIBS+=usr/lib/libatf-c++.a +OLD_LIBS+=usr/lib/libatf-c++.so OLD_LIBS+=usr/lib/libatf-c++.so.1 +OLD_LIBS+=usr/lib/libatf-c++.so.2 +OLD_LIBS+=usr/lib/libatf-c++_p.a +OLD_LIBS+=usr/lib/libatf-c.a +OLD_LIBS+=usr/lib/libatf-c.so +OLD_LIBS+=usr/lib/libatf-c.so.1 +OLD_LIBS+=usr/lib/libatf-c_p.a +OLD_LIBS+=usr/lib/private/libatf-c.so.1 +OLD_LIBS+=usr/lib/private/libatf-c++.so.2 +.if ${TARGET_ARCH} == "amd64" || ${TARGET_ARCH} == "powerpc64" +OLD_LIBS+=usr/lib32/libatf-c++.a +OLD_LIBS+=usr/lib32/libatf-c++.so +OLD_LIBS+=usr/lib32/libatf-c++.so.1 +OLD_LIBS+=usr/lib32/libatf-c++.so.2 +OLD_LIBS+=usr/lib32/libatf-c++_p.a +OLD_LIBS+=usr/lib32/libatf-c.a +OLD_LIBS+=usr/lib32/libatf-c.so +OLD_LIBS+=usr/lib32/libatf-c.so.1 +OLD_LIBS+=usr/lib32/libatf-c_p.a +OLD_LIBS+=usr/lib32/private/libatf-c.so.1 +OLD_LIBS+=usr/lib32/private/libatf-c++.so.2 +.endif +OLD_FILES+=usr/libdata/pkgconfig/atf-c++.pc +OLD_FILES+=usr/libdata/pkgconfig/atf-c.pc +OLD_FILES+=usr/libdata/pkgconfig/atf-sh.pc +OLD_FILES+=usr/share/aclocal/atf-c++.m4 +OLD_FILES+=usr/share/aclocal/atf-c.m4 +OLD_FILES+=usr/share/aclocal/atf-common.m4 +OLD_FILES+=usr/share/aclocal/atf-sh.m4 +OLD_DIRS+=usr/share/aclocal +OLD_FILES+=usr/tests/bin/chown/units_basics +OLD_FILES+=usr/tests/usr.bin/atf/Kyuafile +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/Kyuafile +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/atf_check_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/config_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/integration_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/misc_helpers +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/normalize_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/tc_test +OLD_FILES+=usr/tests/usr.bin/atf/atf-sh/tp_test +OLD_DIRS+=usr/tests/usr.bin/atf/atf-sh +OLD_DIRS+=usr/tests/usr.bin/atf OLD_FILES+=usr/tests/lib/atf/libatf-c/test_helpers_test OLD_FILES+=usr/tests/lib/atf/test-programs/fork_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/application_test @@ -4117,6 +4192,7 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c++/fs_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/parser_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/process_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/sanity_test +OLD_FILES+=usr/tests/lib/atf/libatf-c++/pkg_config_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/text_test OLD_FILES+=usr/tests/lib/atf/libatf-c++/ui_test OLD_FILES+=usr/tests/lib/atf/libatf-c/dynstr_test @@ -4124,12 +4200,13 @@ OLD_FILES+=usr/tests/lib/atf/libatf-c/env_test OLD_FILES+=usr/tests/lib/atf/libatf-c/fs_test OLD_FILES+=usr/tests/lib/atf/libatf-c/list_test OLD_FILES+=usr/tests/lib/atf/libatf-c/map_test +OLD_FILES+=usr/tests/lib/atf/libatf-c/pkg_config_test OLD_FILES+=usr/tests/lib/atf/libatf-c/process_helpers OLD_FILES+=usr/tests/lib/atf/libatf-c/process_test OLD_FILES+=usr/tests/lib/atf/libatf-c/sanity_test OLD_FILES+=usr/tests/lib/atf/libatf-c/text_test OLD_FILES+=usr/tests/lib/atf/libatf-c/user_test -.if ${MK_MAKE} == yes && ${MK_BMAKE} == yes +.if ${MK_MAKE} == yes OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/legacy_test OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Kyuafile OLD_FILES+=usr/tests/usr.bin/make/archives/fmt_44bsd/Makefile.test @@ -4644,6 +4721,7 @@ OLD_FILES+=usr/bin/svnliterdump OLD_FILES+=usr/bin/svnliteserve OLD_FILES+=usr/bin/svnlitesync OLD_FILES+=usr/bin/svnliteversion +OLD_FILES+=usr/share/man/man1/svnlite.1.gz .endif .if ${MK_SVN} == no diff --git a/tools/build/options/WITHOUT_BINUTILS b/tools/build/options/WITHOUT_BINUTILS index 5270bd7..dd95162 100644 --- a/tools/build/options/WITHOUT_BINUTILS +++ b/tools/build/options/WITHOUT_BINUTILS @@ -3,5 +3,3 @@ Set to not build or install binutils (as, c++-filt, gconv, ld, nm, objcopy, objdump, readelf, size and strip) as part of the normal system build. The resulting system cannot build programs from source. - - diff --git a/tools/build/options/WITHOUT_DOCCOMPRESS b/tools/build/options/WITHOUT_DOCCOMPRESS new file mode 100644 index 0000000..ba08df7 --- /dev/null +++ b/tools/build/options/WITHOUT_DOCCOMPRESS @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not to install compressed system documentation. +Only the uncompressed version will be installed. diff --git a/tools/build/options/WITHOUT_GNU_GREP_COMPAT b/tools/build/options/WITHOUT_GNU_GREP_COMPAT new file mode 100644 index 0000000..8f0e2a0 --- /dev/null +++ b/tools/build/options/WITHOUT_GNU_GREP_COMPAT @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set this option to omit the gnu extentions to grep from being included in +BSD grep. diff --git a/tools/build/options/WITHOUT_MANCOMPRESS b/tools/build/options/WITHOUT_MANCOMPRESS new file mode 100644 index 0000000..75db313 --- /dev/null +++ b/tools/build/options/WITHOUT_MANCOMPRESS @@ -0,0 +1,3 @@ +.\" $FreeBSD$ +Set to not to install compressed man pages. +Only the uncompressed versions will be installed. diff --git a/tools/build/options/WITHOUT_NCURSESW b/tools/build/options/WITHOUT_NCURSESW deleted file mode 100644 index 0fdf78b6..0000000 --- a/tools/build/options/WITHOUT_NCURSESW +++ /dev/null @@ -1,4 +0,0 @@ -.\" $FreeBSD$ -Set to not build or depend on the -.Nm libncursesw -library. diff --git a/tools/build/options/WITHOUT_SYSCALL_COMPAT b/tools/build/options/WITHOUT_SYSCALL_COMPAT new file mode 100644 index 0000000..a20adcb --- /dev/null +++ b/tools/build/options/WITHOUT_SYSCALL_COMPAT @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Do not include some compatible syscall wrappers in libc. diff --git a/tools/build/options/WITHOUT_TESTS b/tools/build/options/WITHOUT_TESTS index 05aeeb8..4d58f9a 100644 --- a/tools/build/options/WITHOUT_TESTS +++ b/tools/build/options/WITHOUT_TESTS @@ -1,2 +1,9 @@ .\" $FreeBSD$ -Set to not build any test programs nor install them in /usr/tests. +Set to not build nor install the +.Fx +Test Suite in +.Pa /usr/tests/ . +See +.Xr tests 7 +for more details. +This also disables the build of all test-related dependencies, including ATF. diff --git a/tools/build/options/WITHOUT_VT b/tools/build/options/WITHOUT_VT new file mode 100644 index 0000000..ea01349 --- /dev/null +++ b/tools/build/options/WITHOUT_VT @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr vt 4 +support files (fonts and keymaps). diff --git a/tools/build/options/WITHOUT_WARNS b/tools/build/options/WITHOUT_WARNS new file mode 100644 index 0000000..185a279 --- /dev/null +++ b/tools/build/options/WITHOUT_WARNS @@ -0,0 +1,5 @@ +.\" $FreeBSD$ +Set this to not add warning flags to the compiler invocations. +Useful as a temporary workaround when code enters the tree +which triggers warnings in environments that differ from the +original develoepr. diff --git a/tools/build/options/WITH_FMAKE b/tools/build/options/WITH_FMAKE new file mode 100644 index 0000000..72ae456 --- /dev/null +++ b/tools/build/options/WITH_FMAKE @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Causes the old FreeBSD +.Xr make 1 +program to be built and installed as fmake. diff --git a/tools/build/options/WITH_INFO b/tools/build/options/WITH_INFO new file mode 100644 index 0000000..01c8291 --- /dev/null +++ b/tools/build/options/WITH_INFO @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to make or install +.Xr info 5 +files. diff --git a/tools/build/options/WITH_PIE b/tools/build/options/WITH_PIE new file mode 100644 index 0000000..509da18 --- /dev/null +++ b/tools/build/options/WITH_PIE @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Enable building of Position-Independent Executables (PIEs). diff --git a/tools/build/options/WITH_TESTS b/tools/build/options/WITH_TESTS deleted file mode 100644 index 9575461..0000000 --- a/tools/build/options/WITH_TESTS +++ /dev/null @@ -1,7 +0,0 @@ -.\" $FreeBSD$ -Set to install the -.Fx -Test Suite. -See -.Xr tests 7 -for more details. diff --git a/tools/ifnet/convert_drvapi.sh b/tools/ifnet/convert_drvapi.sh new file mode 100755 index 0000000..dd30c7a --- /dev/null +++ b/tools/ifnet/convert_drvapi.sh @@ -0,0 +1,302 @@ +#!/bin/sh +# +# Copyright (c) 2014 Juniper Networks, Inc. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must 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 ``AS IS'' AND ANY EXPRESS OR +# IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# $FreeBSD$ +# + +# +# Convert a NIC driver to use the procdural API. +# It doesn't take care of all the # cases yet, +# but still does about 95% of work. +# +# Author: Sreekanth Rupavatharam +# + +if [ $# -lt 1 ] +then + echo " $0 <driver source (e.g., if_em.c)>"; + exit 1; +fi + +# XXX - This needs to change if the data structure uses different name +__ifp__="ifp"; + +file=$1 + +rotateCursor() { + case $toggle + in + 1) + printf " \\ " + printf "\b\b" + toggle="2" + ;; + + 2) + printf " | " + printf "\b\b\b" + toggle="3" + ;; + + 3) + printf " / " + printf "\b\b\b" + toggle="4" + ;; + + *) + printf " - " + printf "\b\b\b" + toggle="1" + ;; + esac +} + +handle_set() { +# Handle the case where $__ifp__->if_blah = XX; + line=$1 + set=`echo $line| grep "$__ifp__->.* = "` + if [ ! -z "$set" ] + then + word=`echo $line | awk -F "if_" ' { print $2 }' | awk -F" =" '{ print $1 }'` + value=`echo $line | awk -F "=" '{ print $2 }' | sed -e 's/;//g'` + new=`echo if_set$word"\($__ifp__,"$value");"` + new=`echo $new | sed -e 's/&/\\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0 + fi + return 1 +} + +handle_inc() { + line=$1 + inc=`echo $line | grep "$__ifp__->.*++\|++$__ifp__->.*"` + if [ ! -z "$inc" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk -F"\+" '{ print $1}'` + value=' 1'; + old=`echo $line|sed -e 's/^[ ]*//'` + new=`echo if_inc$word"\($__ifp__,"$value");"` + new=`echo $new | sed -e 's/&/\\\&/'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; +} + +handle_add() { + line=$1 + add=`echo $line|grep "$__ifp__->.*+= "` + if [ ! -z "$add" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk '{ print $1}'` + value=`echo $line | awk -F"=" '{ print $2}' | sed -e 's/;//g'` + new=`echo if_inc$word"\($__ifp__,$value);"` + new=`echo $new | sed -e 's/&/\\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0 + fi + return 1; + +} + +handle_or() { + line=$1 + or=`echo $line|grep "$__ifp__->.*|= "` + if [ ! -z "$or" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk '{ print $1}'` + value=`echo $line | awk -F"=" '{ print $2}' | sed -e 's/;//g'` + new=`echo if_set${word}bit"($__ifp__,$value, 0);"` + new=`echo $new | sed -e 's/&/\\\&/'` + #line=`echo $line|sed -e 's/&/\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; + +} + +handle_and() { + line=$1 + or=`echo $line|grep "$__ifp__->.*&= "` + if [ ! -z "$or" ] + then + word=`echo $line | awk -F"if_" '{ print $2 }'|awk '{ print $1}'` + value=`echo $line | awk -F"=" '{ print $2}' | sed -e 's/;//g'` + value=`echo $value | sed -e's/~//g'` + new=`echo if_set${word}bit"\($__ifp__, 0,$value);"` + new=`echo $new | sed -e 's/&/\\\&/'` + old=`echo $line|sed -e 's/^[ ]*//'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; + +} + +handle_toggle() { + line=$1 + if [ ! -z `echo $line | grep "\^="` ] + then + line=`echo $line | sed -e 's/'"$__ifp__"'->if_\(.*\) ^=\(.*\);/if_toggle\1('"$__ifp__"',\2);/g'` + return 0; + fi + return 1 + +} + +# XXX - this needs updating +handle_misc() { + line=$1 + get=`echo $line | grep "if_capabilities\|if_flags\|if_softc\|if_capenable\|if_mtu\|if_drv_flags"` + if [ ! -z "$get" ] + then + word=`echo $line |awk -F"$__ifp__->if_" '{ print $2 }' | \ + sed -e's/[^a-zA-Z0-9_]/\@/'|awk -F"\@" '{ print $1}'` + old=`echo "$__ifp__->if_"${word}` + new=`echo "if_get"${word}"($__ifp__)"` + new=`echo $new | sed -e 's/&/\\\&/'` + line=`echo $line| sed -e's/'$old'/'$new'/g'` + return 0; + fi + return 1; + +} + +replace_str () +{ + line=$1 + orig=$2 + new=$3 + line=`echo $line | sed -e 's/'"$orig"'\(.*\)/'"$new"'\1/g'` + return 0; +} + +# Handle special cases which do not fall under regular patterns +handle_special () +{ + line=$1 + replace_str $line "(\*$__ifp__->if_input)" "if_input" + replace_str $line "if_setinit" "if_setinitfn" + replace_str $line "if_setioctl" "if_setioctlfn" + replace_str $line "if_getdrv_flags" "if_getdrvflags" + replace_str $line "if_setdrv_flagsbit" "if_setdrvflagbits" + replace_str $line "if_setstart" "if_setstartfn" + replace_str $line "if_sethwassistbit" "if_sethwassistbits" + replace_str $line "ifmedia_init" "ifmedia_init_drv" + replace_str $line "IFQ_DRV_IS_EMPTY(&$__ifp__->if_snd)" "if_sendq_empty($__ifp__)" + replace_str $line "IFQ_DRV_PREPEND(&$__ifp__->if_snd" "if_sendq_prepend($__ifp__" + replace_str $line "IFQ_SET_READY(&ifp->if_snd)" "if_setsendqready($__ifp__)" + line=`echo $line | sed -e 's/IFQ_SET_MAXLEN(&'$__ifp__'->if_snd, \(.*\))/if_setsendqlen('$__ifp__', \1)/g'` + line=`echo $line | sed -e 's/IFQ_DRV_DEQUEUE(&'$__ifp__'->if_snd, \(.*\))/\1 = if_dequeue('$__ifp__')/g'` + return 0 +} + +if [ -e $file.tmp ] +then + rm $file.tmp +fi +IFS= +echo -n "Conversion for $file started, please wait: " +FAIL_PAT="XXX - DRVAPI" +count=0 +cat $1 | while read -r line +do +count=`expr $count + 1` +rotateCursor +pat=`echo $line | grep "$__ifp__->"` +while [ "$pat" != "" ] +do + pat=`echo $line | grep "$__ifp__->"` + if [ ! -z `echo $pat | grep "$FAIL_PAT"` ] + then + break; + fi + + handle_set $line + + if [ $? != 0 ] + then + handle_inc $line + fi + + if [ $? != 0 ] + then + handle_add $line + fi + + if [ $? != 0 ] + then + handle_or $line + fi + + if [ $? != 0 ] + then + handle_and $line + fi + + if [ $? != 0 ] + then + handle_toggle $line + fi + + if [ $? != 0 ] + then + handle_misc $line + fi + + if [ $? != 0 ] + then + handle_special $line + fi + + if [ ! -z `echo $line | grep "$__ifp__->"` ] + then + line=`echo $line | sed -e 's:$: \/* '${FAIL_PAT}' *\/:g'` + fi +done + line=`echo "$line" | sed -e 's:VLAN_CAPABILITIES('$__ifp__'):if_vlancap('$__ifp__'):g'` + # Replace the ifnet * with if_t + if [ ! -z `echo $line | grep "struct ifnet"` ] + then + line=`echo $line | sed -e 's/struct ifnet[ \t]*\*/if_t /g'` + fi + echo "$line" >> $file.tmp +done +echo "" +count=`grep $FAIL_PAT $file.tmp | wc -l` +if [ $count -gt 0 ] +then + echo "$count lines could not be converted to DRVAPI" + echo "Look for /* $FAIL_PAT */ in the converted file" +fi +echo "original $file has been moved to $file.orig" +mv $file $file.orig +mv $file.tmp $file diff --git a/tools/regression/README b/tools/regression/README index 87e4ab3..a2de372 100644 --- a/tools/regression/README +++ b/tools/regression/README @@ -77,7 +77,6 @@ this file. acct Exercise the integer to float conversion used in acct(5) geom Some tests and an out-of-kernel simulator for the GEOM code -ia64 ia64 specific regression tests nfsmmap Some tests to exercise some tricky cases in NFS and mmap p1003_1b Exercise 1003.1B scheduler pipe Pipe code regression test diff --git a/tools/regression/file/flock/flock.c b/tools/regression/file/flock/flock.c index c411853..fd426b0 100644 --- a/tools/regression/file/flock/flock.c +++ b/tools/regression/file/flock/flock.c @@ -27,6 +27,7 @@ * $FreeBSD$ */ +#include <sys/file.h> #include <sys/time.h> #ifdef __FreeBSD__ #include <sys/mount.h> @@ -39,6 +40,7 @@ #include <fcntl.h> #include <pthread.h> #include <signal.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -51,9 +53,13 @@ #include <sys/cdefs.h> #else #ifndef __unused +#ifdef __GNUC__ +#define __unused __attribute__((__unused__)) +#else #define __unused #endif #endif +#endif int verbose = 0; @@ -1329,7 +1335,6 @@ test15(int fd, __unused int argc, const __unused char **argv) */ int pid; int pfd[2]; - int fd2; struct flock fl; char ch; int res; @@ -1366,7 +1371,7 @@ test15(int fd, __unused int argc, const __unused char **argv) if (read(pfd[0], &ch, 1) != 1) err(1, "reading from pipe (child)"); - fd2 = dup(fd); + (void)dup(fd); if (flock(fd, LOCK_SH) < 0) err(1, "flock shared"); diff --git a/tools/regression/filemon/Makefile b/tools/regression/filemon/Makefile index 6ee88f4..3911d33 100644 --- a/tools/regression/filemon/Makefile +++ b/tools/regression/filemon/Makefile @@ -1,6 +1,6 @@ # $FreeBSD$ -.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" +.if ${MACHINE_ARCH} == "amd64" BI_BITS= .endif diff --git a/tools/regression/ia64/emulated/brl.t b/tools/regression/ia64/emulated/brl.t deleted file mode 100644 index c47989c..0000000 --- a/tools/regression/ia64/emulated/brl.t +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env perl -w -# -# Copyright (c) 2006 Marcel Moolenaar -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must 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 ``AS IS'' AND ANY EXPRESS OR -# IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ - -my $srcdir = `dirname $0`; -chomp $srcdir; - -my @types = ("Call", "Cond"); -my @preds = ("False", "True"); -my %variant_mapping = ( - "Call" => "", - "Cond" => "Backward Forward" -); - -sub run ($$$$) { - local ($nr, $type, $pred, $var) = @_; - local $test = "${type}_${pred}_${var}"; - local $tmpfile = "/tmp/" . $$ . "_$test"; - local $st; - - $st = system("cc -o $tmpfile -DTYPE=$type -DPRED=$pred -DVAR=$var -Wall -O1 -g $srcdir/test.c"); - if ($st != 0) { - print "not ok $nr $test # compiling $test\n"; - } - else { - $st = system($tmpfile); - if ($st == 0) { - print "ok $nr $test\n"; - } - elsif ($st == 256) { - print "not ok $nr $test # invalid combination\n"; - } - elsif ($st == 512) { - print "not ok $nr $test # long branch failure\n"; - } - else { - print "not ok $nr $test # signalled (exit status $st)\n"; - return; # Preserve the executable - } - } - unlink $tmpfile; -} - -# -# We can only test the long brach emulation on the Merced processor. -# Check for that and skip these tests if it's not... -# -$_ = `sysctl -n hw.model`; -if (! /^Merced$/) { - print "1..0 # SKIP This test can only be run on the Merced\n"; - exit 0; -} - -# -# Get the total number of tests we're going to perform. -# -my $count = 0; -foreach $type (@types) { - my @variants = split(/ /, $variant_mapping{$type}); - $count += @preds * @variants; -} - -print "1..$count\n"; - -my $nr=0; -foreach $type (@types) { - my @variants = split(/ /, $variant_mapping{$type}); - foreach $pred (@preds) { - foreach $var (@variants) { - run ++$nr, $type, $pred, $var; - } - } -} - -exit 0; diff --git a/tools/regression/ia64/emulated/test.c b/tools/regression/ia64/emulated/test.c deleted file mode 100644 index 35d4b05..0000000 --- a/tools/regression/ia64/emulated/test.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2006 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must 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 ``AS IS'' AND ANY EXPRESS OR - * IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <sys/mman.h> -#include <stdio.h> -#include <string.h> - -/* Supported long branch types */ -#define Call 1 -#define Cond 2 - -/* Supported predicates */ -#define False 1 -#define True 2 - -/* Supported variations */ -#define Backward 1 -#define Forward 2 - -#if TYPE == 0 || PRED == 0 || VAR == 0 -#error Define TYPE, PRED and/or VAR -#endif - -union bundle { - unsigned char bytes[16]; - long double _align; -}; - -/* - * Machine code of a bundle containing a long branch. The predicate of the - * long branch is the result of the compare in the first slot. - * The assembly of the bundle is: - * { .mlx - * cmp.eq p0,p15= <PREDICATE>,r0 - * (p15) brl.few <TARGET> ;; - * } - * the predicate is written to bit 18:1 - * The branch target is written to bits 100:20, 48:39 and 123:1 - */ -unsigned char mc_brl_cond[16] = { - 0x05, 0x00, 0x00, 0x00, 0x0f, 0x39, - 0x00, 0x00, 0x00, 0x00, 0x80, 0x07, - 0x00, 0x00, 0x00, 0xc0 -}; - -/* - * Machine code of the epilogue of a typical function returning an integer. - * The assembly of the epilogue is: - * { .mib - * nop.m 0 - * addl r8 = <RETVAL>, r0 - * br.ret.sptk.few b0 ;; - * } - * The return value is written to bits 59:7, 73:9, 68:5, and 82:1. - */ -unsigned char mc_epilogue[16] = { - 0x11, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x80, 0x00, 0x00, 0x00, 0x48, 0x80, - 0x00, 0x00, 0x84, 0x00 -}; - -void -mc_patch(union bundle *b, unsigned long val, int start, int len) -{ - unsigned long mask; - int bit, byte, run; - - byte = start >> 3; - bit = start & 7; - while (len) { - run = ((len > (8 - bit)) ? (8 - bit) : len); - mask = (1UL << run) - 1UL; - b->bytes[byte] |= (val & mask) << bit; - val >>= run; - len -= run; - byte++; - bit = 0; - } -} - -void -assemble_brl_cond(union bundle *b, int pred, unsigned long tgt) -{ - unsigned long iprel; - - iprel = tgt - (unsigned long)b; - memcpy(b->bytes, mc_brl_cond, sizeof(mc_brl_cond)); - mc_patch(b, pred ? 1 : 0, 18, 1); - mc_patch(b, iprel >> 4, 100, 20); - mc_patch(b, iprel >> 24, 48, 39); - mc_patch(b, iprel >> 63, 123, 1); -} - -void -assemble_epilogue(union bundle *b, int retval) -{ - memcpy(b->bytes, mc_epilogue, sizeof(mc_epilogue)); - mc_patch(b, retval, 59, 7); - mc_patch(b, retval >> 7, 73, 9); - mc_patch(b, retval >> 16, 68, 5); - mc_patch(b, retval >> 21, 82, 1); -} - -int -doit(void *addr) -{ - asm("mov b6 = %0; br.sptk b6;;" :: "r"(addr)); - return 1; -} - -int -test_cond(int pred, union bundle *src, union bundle *dst) -{ - assemble_epilogue(dst, pred ? 0 : 2); - assemble_brl_cond(src, pred ? 1 : 0, (unsigned long)dst); - assemble_epilogue(src + 1, !pred ? 0 : 2); - return doit(src); -} - -int -main() -{ - static union bundle blob_low[2]; - union bundle *blob_high; - void *addr; - - addr = (void *)0x7FFFFFFF00000000L; - blob_high = mmap(addr, 32, PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_ANON, -1, 0L); - if (blob_high != addr) - printf("NOTICE: blob_high is at %p, not at %p\n", blob_high, - addr); - -#if TYPE == Call - return (test_call(blob_high, blob_low)); -#elif TYPE == Cond - #if VAR == Forward - return (test_cond(PRED - 1, blob_low, blob_high)); - #elif VAR == Backward - return (test_cond(PRED - 1, blob_high, blob_low)); - #else - return (1); - #endif -#else - return (1); -#endif -} diff --git a/tools/regression/ia64/unaligned/test.c b/tools/regression/ia64/unaligned/test.c deleted file mode 100644 index 869c864..0000000 --- a/tools/regression/ia64/unaligned/test.c +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Copyright (c) 2005 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must 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 ``AS IS'' AND ANY EXPRESS OR - * IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD$ - */ - -#include <machine/float.h> -#include <string.h> - -/* Memory accesses. */ -#define Load 0x01 -#define Store 0x02 - -/* Data type. */ -#define Integer 0x11 -#define FloatingPoint 0x12 - -/* Data size. */ -#define Small 0x21 -#define Medium 0x22 -#define Large 0x23 - -/* Post increment. */ -#define NoPostInc 0x31 -#define MinConstPostInc 0x32 -#define PlusConstPostInc 0x33 -#define ScratchRegPostInc 0x34 -#define PreservedRegPostInc 0x35 - -#if ACCESS == 0 || TYPE == 0 || SIZE == 0 || POSTINC == 0 -#error define ACCESS, TYPE, SIZE and/or POSTINC -#endif - -#if TYPE == Integer -# define REG "r8" -# if SIZE == Small -# define DATA_TYPE short -# define DATA_VALUE 0x1234 -# define LD "ld2" -# define ST "st2" -# elif SIZE == Medium -# define DATA_TYPE int -# define DATA_VALUE 0x12345678 -# define LD "ld4" -# define ST "st4" -# elif SIZE == Large -# define DATA_TYPE long -# define DATA_VALUE 0x1234567890ABCDEF -# define LD "ld8" -# define ST "st8" -# endif -#elif TYPE == FloatingPoint -# define REG "f6" -# if SIZE == Small -# define DATA_TYPE float -# define DATA_VALUE FLT_MIN -# define LD "ldfs" -# define ST "stfs" -# elif SIZE == Medium -# define DATA_TYPE double -# define DATA_VALUE DBL_MIN -# define LD "ldfd" -# define ST "stfd" -# elif SIZE == Large -# define DATA_TYPE long double -# define DATA_VALUE LDBL_MIN -# define LD "ldfe" -# define ST "stfe" -# endif -#endif - -struct { - DATA_TYPE aligned; - char _; - char misaligned[sizeof(DATA_TYPE)]; -} data; - -DATA_TYPE *aligned = &data.aligned; -DATA_TYPE *misaligned = (DATA_TYPE *)data.misaligned; -DATA_TYPE value = DATA_VALUE; - -void -block_copy(void *dst, void *src, size_t sz) -{ - - memcpy(dst, src, sz); -} - -int -main() -{ - - /* Set PSR.ac. */ - asm volatile("sum 8"); - -#if ACCESS == Load - /* - * LOAD - */ - block_copy(misaligned, &value, sizeof(DATA_TYPE)); - -# if POSTINC == NoPostInc - /* Misaligned load. */ - *aligned = *misaligned; -# elif POSTINC == MinConstPostInc - asm volatile( - "ld8 r2=%0;;" - LD " " REG "=[r2],%2;;" - "st8 %0=r2;" ST " %1=" REG ";;" - : "=m"(misaligned), "=m"(*aligned) - : "i"(-sizeof(DATA_TYPE)) - : REG, "r2", "memory"); -# elif POSTINC == PlusConstPostInc - asm volatile( - "ld8 r2=%0;;" - LD " " REG "=[r2],%2;;" - "st8 %0=r2;" ST " %1=" REG ";;" - : "=m"(misaligned), "=m"(*aligned) - : "i"(sizeof(DATA_TYPE)) - : REG, "r2", "memory"); -# elif POSTINC == ScratchRegPostInc - asm volatile( - "ld8 r2=%0; mov r3=%2;;" - LD " " REG "=[r2],r3;;" - "st8 %0=r2;" ST " %1=" REG ";;" - : "=m"(misaligned), "=m"(*aligned) - : "i"(sizeof(DATA_TYPE)) - : REG, "r2", "r3", "memory"); -# elif POSTINC == PreservedRegPostInc - asm volatile( - "ld8 r2=%0; mov r4=%2;;" - LD " " REG "=[r2],r4;;" - "st8 %0=r2;" ST " %1=" REG ";;" - : "=m"(misaligned), "=m"(*aligned) - : "i"(sizeof(DATA_TYPE)) - : REG, "r2", "r4", "memory"); -# endif - -#elif ACCESS == Store - /* - * STORE - */ - -# if POSTINC == NoPostInc - /* Misaligned store. */ - *misaligned = value; -# elif POSTINC == MinConstPostInc - asm volatile( - "ld8 r2=%0;" LD " " REG "=%1;;" - ST " [r2]=" REG ",%2;;" - "st8 %0=r2;;" - : "=m"(misaligned) - : "m"(value), "i"(-sizeof(DATA_TYPE)) - : REG, "r2", "memory"); -# elif POSTINC == PlusConstPostInc - asm volatile( - "ld8 r2=%0;" LD " " REG "=%1;;" - ST " [r2]=" REG ",%2;;" - "st8 %0=r2;;" - : "=m"(misaligned) - : "m"(value), "i"(sizeof(DATA_TYPE)) - : REG, "r2", "memory"); -# elif POSTINC == ScratchRegPostInc || POSTINC == PreservedRegPostInc - return (1); -# endif - - block_copy(aligned, data.misaligned, sizeof(DATA_TYPE)); -#endif - - if (*aligned != value) - return (2); - -#if POSTINC == NoPostInc - return (0); -#elif POSTINC == MinConstPostInc - return (((char *)misaligned == data.misaligned - sizeof(DATA_TYPE)) - ? 0 : 4); -#else - return (((char *)misaligned == data.misaligned + sizeof(DATA_TYPE)) - ? 0 : 4); -#endif -} diff --git a/tools/regression/ia64/unaligned/unaligned.t b/tools/regression/ia64/unaligned/unaligned.t deleted file mode 100644 index 5d061bd..0000000 --- a/tools/regression/ia64/unaligned/unaligned.t +++ /dev/null @@ -1,99 +0,0 @@ -#!/usr/bin/env perl -w -# -# Copyright (c) 2005 Marcel Moolenaar -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must 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 ``AS IS'' AND ANY EXPRESS OR -# IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ - -my $srcdir = `dirname $0`; -chomp $srcdir; - -my @accesses = ("Load", "Store"); -my @types = ("Integer", "FloatingPoint"); -my @sizes = ("Small", "Medium", "Large"); -my @postincs = ("NoPostInc", "MinConstPostInc", "PlusConstPostInc", - "ScratchRegPostInc", "PreservedRegPostInc"); - -sub run ($$$$$) { - local ($nr, $access, $type, $size, $postinc) = @_; - local $test = "${access}_${type}_${size}_${postinc}"; - local $tmpfile = "/tmp/" . $$ . "_$test"; - local $st; - - $st = system("cc -o $tmpfile -DACCESS=$access -DTYPE=$type -DSIZE=$size -DPOSTINC=$postinc -Wall -O -g $srcdir/test.c"); - if ($st != 0) { - print "not ok $nr $test # compiling $test\n"; - } - else { - $st = system($tmpfile); - if ($st == 0) { - print "ok $nr $test\n"; - } - elsif ($st == 256) { - print "not ok $nr $test # invalid combination\n"; - } - elsif ($st == 512) { - print "not ok $nr $test # value mismatch\n"; - } - elsif ($st == 1024) { - print "not ok $nr $test # post increment mismatch\n"; - } - else { - print "not ok $nr $test # signalled (exit status $st)\n"; - return; # Preserve the executable - } - } - unlink $tmpfile; -} - -system("sysctl debug.unaligned_test=1"); -if (`sysctl -n debug.unaligned_test` != "1") { - print "1..0 # SKIP The debug.unaligned_test sysctl could not be set\n"; - exit 0; -} - -my $count = @accesses * @types * @sizes * @postincs; - -# There's no register based post inc. for stores. -$count -= 12; - -print "1..$count\n"; - -my $nr=0; -foreach $access (@accesses) { - foreach $postinc (@postincs) { - $_ = "$access $postinc"; - if (! /Store.+RegPostInc/) { - foreach $type (@types) { - foreach $size (@sizes) { - run ++$nr, $access, $type, $size, $postinc; - } - } - } - } -} - -system("sysctl debug.unaligned_test=0"); - -exit 0; diff --git a/tools/regression/lib/libc/stdio/test-fmemopen.c b/tools/regression/lib/libc/stdio/test-fmemopen.c index 2788279..9f63664 100644 --- a/tools/regression/lib/libc/stdio/test-fmemopen.c +++ b/tools/regression/lib/libc/stdio/test-fmemopen.c @@ -138,6 +138,13 @@ test_autoalloc() /* Close the FILE *. */ rc = fclose(fp); assert(rc == 0); + + /* Open a FILE * using a wrong mode */ + fp = fmemopen(NULL, 512, "r"); + assert(fp == NULL); + + fp = fmemopen(NULL, 512, "w"); + assert(fp == NULL); } void @@ -241,6 +248,44 @@ test_binary() assert(rc == 0); } +void +test_append_binary_pos() +{ + /* + * For compatibility with other implementations (glibc), we set the + * position to 0 when opening an automatically allocated binary stream + * for appending. + */ + + FILE *fp; + + fp = fmemopen(NULL, 16, "ab+"); + assert(ftell(fp) == 0L); + fclose(fp); + + /* + * Make sure that a pre-allocated buffer behaves correctly. + */ + char buf[] = "Hello"; + fp = fmemopen(buf, sizeof(buf), "ab+"); + assert(ftell(fp) == strlen(buf)); + fclose(fp); +} + +void +test_size_0() +{ + /* + * POSIX mandates that we return EINVAL if size is 0. + */ + + FILE *fp; + + fp = fmemopen(NULL, 0, "r+"); + assert(fp == NULL); + assert(errno == EINVAL); +} + int main(void) { @@ -248,5 +293,7 @@ main(void) test_preexisting(); test_data_length(); test_binary(); + test_append_binary_pos(); + test_size_0(); return (0); } diff --git a/tools/regression/net80211/ccmp/test_ccmp.c b/tools/regression/net80211/ccmp/test_ccmp.c index d78be95..058e728 100644 --- a/tools/regression/net80211/ccmp/test_ccmp.c +++ b/tools/regression/net80211/ccmp/test_ccmp.c @@ -680,7 +680,7 @@ runtest(struct ieee80211com *ic, struct ciphertest *t) printf("FAIL: decap botch; data does not compare\n"); printtest(t); cmpfail(mtod(m, const void *), m->m_pkthdr.len, - t->plaintext, sizeof(t->plaintext)); + t->plaintext, t_plaintext_len); goto bad; } m_freem(m); diff --git a/tools/regression/net80211/wep/test_wep.c b/tools/regression/net80211/wep/test_wep.c index b498195..ba6cd46 100644 --- a/tools/regression/net80211/wep/test_wep.c +++ b/tools/regression/net80211/wep/test_wep.c @@ -242,7 +242,7 @@ runtest(struct ieee80211com *ic, struct ciphertest *t) } else if (memcmp(mtod(m, const void *), t->plaintext, t->plaintext_len)) { printf("FAIL: decap botch; data does not compare\n"); cmpfail(mtod(m, const void *), m->m_pkthdr.len, - t->plaintext, sizeof(t->plaintext)); + t->plaintext, t->plaintext_len); goto bad; } diff --git a/tools/test/dtrace/Makefile b/tools/test/dtrace/Makefile index bf3e787..012a116 100644 --- a/tools/test/dtrace/Makefile +++ b/tools/test/dtrace/Makefile @@ -188,7 +188,6 @@ NOTWORK+= \ # Tests that just don't complete (even to fail) at the moment... NOTWORK+= \ - ${TESTSRCDIR}/tst/common/dtraceUtil/tst.ZeroModuleProbes.d.ksh \ ${TESTSRCDIR}/tst/common/printa/tst.many.d \ ${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupgtype.d \ ${TESTSRCDIR}/tst/common/scalars/err.D_OP_INCOMPAT.dupltype.d \ @@ -338,7 +337,7 @@ listprgs : .for _f in ${ALL_TESTCFILES} ${_f:T:S/c$/exe/} : ${_f} - gcc -o ${.TARGET} ${_f} -lrt + ${CC} -o ${.TARGET} ${_f} -lrt .endfor .for _f in ${ALL_TESTEXEFILES} diff --git a/tools/test/netfibs/reflect.c b/tools/test/netfibs/reflect.c index 3790617..47c7846 100644 --- a/tools/test/netfibs/reflect.c +++ b/tools/test/netfibs/reflect.c @@ -94,7 +94,7 @@ reflect_conn(int s, char *buf, size_t buflen, ssize_t l, struct sockaddr *sa, fprintf(stderr, "<< %s: %s\n", testcase, buf); if (reflectfib != (u_int)-1) - l = snprintf(buf, sizeof(buf), "FIB %u\n", reflectfib); + l = snprintf(buf, buflen, "FIB %u\n", reflectfib); /* If debug is on, log. */ if (debug > 0) { diff --git a/tools/tools/README b/tools/tools/README index ef05ee0..44d13bd 100644 --- a/tools/tools/README +++ b/tools/tools/README @@ -55,7 +55,6 @@ pciid Generate src/share/misc/pci_vendors. pciroms A tool for dumping PCI ROM images. WARNING: alpha quality. pirtool A tool for dumping the $PIR table on i386 machines at runtime. portsinfo Generate list of new ports for last two weeks. -prstats Generate statistics about the PR database. recoverdisk Copy as much data as possible from a defective disk. scsi-defects Get at the primary or grown defect list of a SCSI disk. sysdoc Build a manual page with available sysctls for a specific diff --git a/tools/tools/cxgbetool/cxgbetool.c b/tools/tools/cxgbetool/cxgbetool.c index ab6fee5..729ad9f 100644 --- a/tools/tools/cxgbetool/cxgbetool.c +++ b/tools/tools/cxgbetool/cxgbetool.c @@ -95,7 +95,7 @@ usage(FILE *fp) "\ti2c <port> <devaddr> <addr> [<len>] read from i2c device\n" "\tloadfw <fw-image.bin> install firmware\n" "\tmemdump <addr> <len> dump a memory range\n" - "\tmodinfo <port> optics/cable information\n" + "\tmodinfo <port> [raw] optics/cable information\n" "\treg <address>[=<val>] read/write register\n" "\treg64 <address>[=<val>] read/write 64 bit register\n" "\tregdump [<module>] ... dump registers\n" @@ -1873,6 +1873,41 @@ tracer_cmd(int argc, const char *argv[]) } static int +modinfo_raw(int port_id) +{ + uint8_t offset; + struct t4_i2c_data i2cd; + int rc; + + for (offset = 0; offset < 96; offset += sizeof(i2cd.data)) { + bzero(&i2cd, sizeof(i2cd)); + i2cd.port_id = port_id; + i2cd.dev_addr = 0xa0; + i2cd.offset = offset; + i2cd.len = sizeof(i2cd.data); + rc = doit(CHELSIO_T4_GET_I2C, &i2cd); + if (rc != 0) + return (rc); + printf("%02x: %02x %02x %02x %02x %02x %02x %02x %02x", + offset, i2cd.data[0], i2cd.data[1], i2cd.data[2], + i2cd.data[3], i2cd.data[4], i2cd.data[5], i2cd.data[6], + i2cd.data[7]); + + printf(" %c%c%c%c %c%c%c%c\n", + isprint(i2cd.data[0]) ? i2cd.data[0] : '.', + isprint(i2cd.data[1]) ? i2cd.data[1] : '.', + isprint(i2cd.data[2]) ? i2cd.data[2] : '.', + isprint(i2cd.data[3]) ? i2cd.data[3] : '.', + isprint(i2cd.data[4]) ? i2cd.data[4] : '.', + isprint(i2cd.data[5]) ? i2cd.data[5] : '.', + isprint(i2cd.data[6]) ? i2cd.data[6] : '.', + isprint(i2cd.data[7]) ? i2cd.data[7] : '.'); + } + + return (0); +} + +static int modinfo(int argc, const char *argv[]) { long port; @@ -1881,17 +1916,31 @@ modinfo(int argc, const char *argv[]) int rc, i; uint16_t temp, vcc, tx_bias, tx_power, rx_power; - if (argc != 1) { + if (argc < 1) { warnx("must supply a port"); return (EINVAL); } + if (argc > 2) { + warnx("too many arguments"); + return (EINVAL); + } + p = str_to_number(argv[0], &port, NULL); if (*p || port > UCHAR_MAX) { warnx("invalid port id \"%s\"", argv[0]); return (EINVAL); } + if (argc == 2) { + if (!strcmp(argv[1], "raw")) + return (modinfo_raw(port)); + else { + warnx("second argument can only be \"raw\""); + return (EINVAL); + } + } + bzero(&i2cd, sizeof(i2cd)); i2cd.len = 1; i2cd.port_id = port; diff --git a/tools/tools/ether_reflect/ether_reflect.1 b/tools/tools/ether_reflect/ether_reflect.1 index 45ee27a..e6539b1 100644 --- a/tools/tools/ether_reflect/ether_reflect.1 +++ b/tools/tools/ether_reflect/ether_reflect.1 @@ -103,6 +103,7 @@ program first appeared in .Sh AUTHORS This manual page was written by -.An George V. Neville-Neil Aq gnn@FreeBSD.org . +.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org . .Sh BUGS -Should be reported to the author or to net@FreeBSD.org. +Should be reported to the author or to +.Aq Mt net@FreeBSD.org . diff --git a/tools/tools/fixwhite/fixwhite.1 b/tools/tools/fixwhite/fixwhite.1 index ccf5ece..3ad088d 100644 --- a/tools/tools/fixwhite/fixwhite.1 +++ b/tools/tools/fixwhite/fixwhite.1 @@ -45,4 +45,4 @@ If the whitespace at the beginning of a sentence is exactly a multiple of eight spaces, the whitespace is replaced by tabs. Also, spaces preceeding tabs will be merged into the tab character. .Sh AUTHORS -.An Ed Schouten Aq ed@FreeBSD.org +.An Ed Schouten Aq Mt ed@FreeBSD.org diff --git a/tools/tools/gdb_regofs/ia64.c b/tools/tools/gdb_regofs/ia64.c deleted file mode 100644 index 59e0055..0000000 --- a/tools/tools/gdb_regofs/ia64.c +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2004 Marcel Moolenaar - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must 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 ``AS IS'' AND ANY EXPRESS OR - * IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <stddef.h> -#include <machine/reg.h> - -#define PRESERVED(x) offsetof(struct reg, r_preserved) \ - + offsetof(struct _callee_saved, x) -#define SCRATCH(x) offsetof(struct reg, r_scratch) \ - + offsetof(struct _caller_saved, x) -#define SPECIAL(x) offsetof(struct reg, r_special) \ - + offsetof(struct _special, x) - -#define HIGH_FP(x) offsetof(struct fpreg, fpr_high) \ - + offsetof(struct _high_fp, x) -#define PRESERVED_FP(x) offsetof(struct fpreg, fpr_preserved) \ - + offsetof(struct _callee_saved_fp, x) -#define SCRATCH_FP(x) offsetof(struct fpreg, fpr_scratch) \ - + offsetof(struct _caller_saved_fp, x) - -static int regofs[] = { - /* - * General registers (0-127) - */ - -1, /* gr0 */ - SPECIAL(gp), - SCRATCH(gr2), SCRATCH(gr3), - PRESERVED(gr4), PRESERVED(gr5), PRESERVED(gr6), PRESERVED(gr7), - SCRATCH(gr8), SCRATCH(gr9), SCRATCH(gr10), SCRATCH(gr11), - SPECIAL(sp), SPECIAL(tp), - SCRATCH(gr14), SCRATCH(gr15), SCRATCH(gr16), SCRATCH(gr17), - SCRATCH(gr18), SCRATCH(gr19), SCRATCH(gr20), SCRATCH(gr21), - SCRATCH(gr22), SCRATCH(gr23), SCRATCH(gr24), SCRATCH(gr25), - SCRATCH(gr26), SCRATCH(gr27), SCRATCH(gr28), SCRATCH(gr29), - SCRATCH(gr30), SCRATCH(gr31), - /* - * gr32 through gr127 are not directly available as they are - * stacked registers. - */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr32-gr39 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr40-gr47 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr48-gr55 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr56-gr63 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr64-gr71 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr72-gr79 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr80-gr87 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr88-gr95 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr96-gr103 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr104-gr111 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr112-gr119 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* gr120-gr127 */ - /* - * Floating-point registers (128-255) - */ - -1, /* fr0: constant 0.0 */ - -1, /* fr1: constant 1.0 */ - PRESERVED_FP(fr2), PRESERVED_FP(fr3), - PRESERVED_FP(fr4), PRESERVED_FP(fr5), - SCRATCH_FP(fr6), SCRATCH_FP(fr7), - SCRATCH_FP(fr8), SCRATCH_FP(fr9), - SCRATCH_FP(fr10), SCRATCH_FP(fr11), - SCRATCH_FP(fr12), SCRATCH_FP(fr13), - SCRATCH_FP(fr14), SCRATCH_FP(fr15), - PRESERVED_FP(fr16), PRESERVED_FP(fr17), - PRESERVED_FP(fr18), PRESERVED_FP(fr19), - PRESERVED_FP(fr20), PRESERVED_FP(fr21), - PRESERVED_FP(fr22), PRESERVED_FP(fr23), - PRESERVED_FP(fr24), PRESERVED_FP(fr25), - PRESERVED_FP(fr26), PRESERVED_FP(fr27), - PRESERVED_FP(fr28), PRESERVED_FP(fr29), - PRESERVED_FP(fr30), PRESERVED_FP(fr31), - HIGH_FP(fr32), HIGH_FP(fr33), HIGH_FP(fr34), HIGH_FP(fr35), - HIGH_FP(fr36), HIGH_FP(fr37), HIGH_FP(fr38), HIGH_FP(fr39), - HIGH_FP(fr40), HIGH_FP(fr41), HIGH_FP(fr42), HIGH_FP(fr43), - HIGH_FP(fr44), HIGH_FP(fr45), HIGH_FP(fr46), HIGH_FP(fr47), - HIGH_FP(fr48), HIGH_FP(fr49), HIGH_FP(fr50), HIGH_FP(fr51), - HIGH_FP(fr52), HIGH_FP(fr53), HIGH_FP(fr54), HIGH_FP(fr55), - HIGH_FP(fr56), HIGH_FP(fr57), HIGH_FP(fr58), HIGH_FP(fr59), - HIGH_FP(fr60), HIGH_FP(fr61), HIGH_FP(fr62), HIGH_FP(fr63), - HIGH_FP(fr64), HIGH_FP(fr65), HIGH_FP(fr66), HIGH_FP(fr67), - HIGH_FP(fr68), HIGH_FP(fr69), HIGH_FP(fr70), HIGH_FP(fr71), - HIGH_FP(fr72), HIGH_FP(fr73), HIGH_FP(fr74), HIGH_FP(fr75), - HIGH_FP(fr76), HIGH_FP(fr77), HIGH_FP(fr78), HIGH_FP(fr79), - HIGH_FP(fr80), HIGH_FP(fr81), HIGH_FP(fr82), HIGH_FP(fr83), - HIGH_FP(fr84), HIGH_FP(fr85), HIGH_FP(fr86), HIGH_FP(fr87), - HIGH_FP(fr88), HIGH_FP(fr89), HIGH_FP(fr90), HIGH_FP(fr91), - HIGH_FP(fr92), HIGH_FP(fr93), HIGH_FP(fr94), HIGH_FP(fr95), - HIGH_FP(fr96), HIGH_FP(fr97), HIGH_FP(fr98), HIGH_FP(fr99), - HIGH_FP(fr100), HIGH_FP(fr101), HIGH_FP(fr102), HIGH_FP(fr103), - HIGH_FP(fr104), HIGH_FP(fr105), HIGH_FP(fr106), HIGH_FP(fr107), - HIGH_FP(fr108), HIGH_FP(fr109), HIGH_FP(fr110), HIGH_FP(fr111), - HIGH_FP(fr112), HIGH_FP(fr113), HIGH_FP(fr114), HIGH_FP(fr115), - HIGH_FP(fr116), HIGH_FP(fr117), HIGH_FP(fr118), HIGH_FP(fr119), - HIGH_FP(fr120), HIGH_FP(fr121), HIGH_FP(fr122), HIGH_FP(fr123), - HIGH_FP(fr124), HIGH_FP(fr125), HIGH_FP(fr126), HIGH_FP(fr127), - /* - * Predicate registers (256-319) - * These are not individually available. Predicates are - * in the pr register. - */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr0-pr7 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr8-pr15 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr16-pr23 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr24-pr31 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr32-pr39 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr40-pr47 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr48-pr55 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* pr56-pr63 */ - /* - * Branch registers (320-327) - */ - SPECIAL(rp), - PRESERVED(br1), PRESERVED(br2), PRESERVED(br3), PRESERVED(br4), - PRESERVED(br5), - SCRATCH(br6), SCRATCH(br7), - /* - * Misc other registers (328-333) - */ - -1, -1, - SPECIAL(pr), - SPECIAL(iip), - SPECIAL(psr), - SPECIAL(cfm), - /* - * Application registers (334-461) - */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar.k0-ar.k7 */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar8-ar15 (reserved) */ - SPECIAL(rsc), /* ar.rsc */ - SPECIAL(ndirty), /* ar.bsp !!YEDI!! */ - SPECIAL(bspstore), /* ar.bspstore */ - SPECIAL(rnat), /* ar.rnat */ - -1, /* ar20 (reserved) */ - -1, /* ar.fcr */ - -1, -1, /* ar22-ar23 (reserved) */ - -1, /* ar.eflag */ - SCRATCH(csd), /* ar.csd */ - SCRATCH(ssd), /* ar.ssd */ - -1, /* ar.cflg */ - -1, /* ar.fsr */ - -1, /* ar.fir */ - -1, /* ar.fdr */ - -1, /* ar31 (reserved) */ - SCRATCH(ccv), /* ar.ccv */ - -1, -1, -1, /* ar33-ar35 (reserved) */ - SPECIAL(unat), /* ar.unat */ - -1, -1, -1, /* ar37-ar39 (reserved) */ - SPECIAL(fpsr), /* ar.fpsr */ - -1, -1, -1, /* ar41-ar43 (reserved) */ - -1, /* ar.itc */ - -1, -1, -1, /* ar45-ar47 (reserved) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar48-ar55 (ignored) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar56-ar63 (ignored) */ - SPECIAL(pfs), /* ar.pfs */ - PRESERVED(lc), /* ar.lc */ - -1, /* ar.ec */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar67-ar74 (reserved) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar75-ar82 (reserved) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar83-ar90 (reserved) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar91-ar98 (reserved) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar99-ar106 (reserved) */ - -1, -1, -1, -1, -1, /* ar107-ar111 (reserved) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar112-ar119 (ignored) */ - -1, -1, -1, -1, -1, -1, -1, -1, /* ar120-ar127 (ignored) */ -}; - -int -main() -{ - int elem, nelems; - - nelems = sizeof(regofs)/sizeof(regofs[0]); - printf("static int reg_offset[%d] = {", nelems); - for (elem = 0; elem < nelems; elem++) { - if ((elem & 7) == 0) - printf("\n "); - printf("%4d", regofs[elem]); - if (elem < nelems - 1) - putchar(','); - if ((elem & 7) != 7) - putchar(' '); - else - printf("\t/* Regs %d-%d. */", elem - 7, elem); - } - printf("\n};"); - return (0); -} diff --git a/tools/tools/makeroot/makeroot.sh b/tools/tools/makeroot/makeroot.sh index 75b8259..1ef376b 100755 --- a/tools/tools/makeroot/makeroot.sh +++ b/tools/tools/makeroot/makeroot.sh @@ -160,7 +160,7 @@ if [ -n "${FILELIST}" ]; then while [ -n "${path}" ]; do echo ".${path}" path="${path%/*}" - done + done done) | sort -u ${BSDROOT}/METALOG - | \ awk ' !/ type=/ { file = $1 } @@ -199,7 +199,7 @@ done # /etc/rcorder.start allows the startup order to be stable even if # not all startup scripts are installed. In theory it should be -# unnecessicary, but dependencies in rc.d appear to be under recorded. +# unnecessary, but dependencies in rc.d appear to be under recorded. # This is a hack local to beri/cheribsd. # echo /etc/rc.d/FIRST > ${tmpdir}/rcorder.start diff --git a/tools/tools/mcgrab/mcgrab.1 b/tools/tools/mcgrab/mcgrab.1 index 1b83f50..2c6bfa6 100644 --- a/tools/tools/mcgrab/mcgrab.1 +++ b/tools/tools/mcgrab/mcgrab.1 @@ -77,7 +77,7 @@ program first appeared in .Sh AUTHORS This manual page was written by -.An George V. Neville-Neil Aq gnn@FreeBSD.org . +.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org . .Sh BUGS Should be reported to the author or to -.Aq net@FreeBSD.org . +.Aq Mt net@FreeBSD.org . diff --git a/tools/tools/mctest/mctest.1 b/tools/tools/mctest/mctest.1 index c64a5f8..3cec879 100644 --- a/tools/tools/mctest/mctest.1 +++ b/tools/tools/mctest/mctest.1 @@ -115,7 +115,7 @@ program first appeared in .Sh AUTHORS This manual page was written by -.An George V. Neville-Neil Aq gnn@FreeBSD.org . +.An George V. Neville-Neil Aq Mt gnn@FreeBSD.org . .Sh BUGS Should be reported to the author or to -.Aq net@FreeBSD.org . +.Aq Mt net@FreeBSD.org . diff --git a/tools/tools/nanobsd/nanobsd.sh b/tools/tools/nanobsd/nanobsd.sh index 274132c..600d112 100644 --- a/tools/tools/nanobsd/nanobsd.sh +++ b/tools/tools/nanobsd/nanobsd.sh @@ -79,7 +79,8 @@ CONF_WORLD=' ' # Kernel config file to use NANO_KERNEL=GENERIC -# Kernel modules to build; default is none +# Kernel modules to install. If empty, no modules are installed. +# Use "default" to install all built modules. NANO_MODULES= # Customize commands. @@ -321,13 +322,19 @@ install_kernel ( ) ( kernconf=${NANO_KERNEL} fi + # Install all built modules if NANO_MODULES=default, + # else install only listed modules (none if NANO_MODULES is empty). + if [ "${NANO_MODULES}" != "default" ]; then + modules_override_arg="MODULES_OVERRIDE='${NANO_MODULES}'" + fi + cd ${NANO_SRC} eval "TARGET_ARCH=${NANO_ARCH} ${NANO_MAKE} installkernel \ DESTDIR='${NANO_WORLDDIR}' \ SRCCONF='${SRCCONF}' \ __MAKE_CONF='${NANO_MAKE_CONF_INSTALL}' \ ${kernconfdir_arg} KERNCONF=${kernconf} \ - MODULES_OVERRIDE='${NANO_MODULES}'" + ${modules_override_arg}" ) > ${NANO_OBJ}/_.ik 2>&1 ) @@ -925,6 +932,10 @@ do shift ;; -c) + # Make config file path available to the config file + # itself so that it can access additional files relative + # to its own location. + NANO_CONFIG=$2 . "$2" shift shift diff --git a/tools/tools/nanobsd/rescue/R32 b/tools/tools/nanobsd/rescue/R32 new file mode 100644 index 0000000..3c15ebe --- /dev/null +++ b/tools/tools/nanobsd/rescue/R32 @@ -0,0 +1,14 @@ +# +# R32 -- Generic kernel configuration file with modifications for rescue. +# +# $FreeBSD$ + +include GENERIC + +ident R32 + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions MALLOC_DEBUG_MAXZONES diff --git a/tools/tools/nanobsd/rescue/R64 b/tools/tools/nanobsd/rescue/R64 new file mode 100644 index 0000000..17900e2 --- /dev/null +++ b/tools/tools/nanobsd/rescue/R64 @@ -0,0 +1,14 @@ +# +# R64 -- Generic kernel configuration file with modifications for rescue. +# +# $FreeBSD$ + +include GENERIC + +ident R64 + +nooptions INVARIANTS +nooptions INVARIANT_SUPPORT +nooptions WITNESS +nooptions WITNESS_SKIPSPIN +nooptions MALLOC_DEBUG_MAXZONES diff --git a/tools/tools/nanobsd/rescue/build.sh b/tools/tools/nanobsd/rescue/build.sh index 525b7ba..4c109ff 100755 --- a/tools/tools/nanobsd/rescue/build.sh +++ b/tools/tools/nanobsd/rescue/build.sh @@ -3,6 +3,8 @@ # $FreeBSD$ # +today=`date '+%Y%m%d'` + if [ -z "${1}" -o \! -f "${1}" ]; then echo "Usage: $0 cfg_file [-bhiknw]" echo "-i : skip image build" @@ -15,4 +17,26 @@ fi CFG="${1}" shift; +if [ \! -d /usr/obj/Rescue ]; then + mkdir -p /usr/obj/Rescue +fi + sh ../nanobsd.sh $* -c ${CFG} + +F32="/usr/obj/Rescue/rescue_${today}_x32" +D32="/usr/obj/nanobsd.rescue_i386" +if [ -f "${D32}/_.disk.full" ]; then + mv "${D32}/_.disk.full" "${F32}.img" +fi +if [ -f "${D32}/_.disk.iso" ]; then + mv "${D32}/_.disk.iso" "${F32}.iso" +fi + +F64="/usr/obj/Rescue/rescue_${today}_x64" +D64="/usr/obj/nanobsd.rescue_amd64" +if [ -f "${D64}/_.disk.full" ]; then + mv "${D64}/_.disk.full" "${F64}.img" +fi +if [ -f "${D64}/_.disk.iso" ]; then + mv "${D64}/_.disk.iso" "${F64}.iso" +fi diff --git a/tools/tools/nanobsd/rescue/common b/tools/tools/nanobsd/rescue/common index d78a1ca..c432440 100644 --- a/tools/tools/nanobsd/rescue/common +++ b/tools/tools/nanobsd/rescue/common @@ -3,7 +3,7 @@ # NANO_TOOLS=`pwd` NANO_PACKAGE_DIR=`pwd`/Pkg -NANO_RAM_TMPVARSIZE=20480 +NANO_RAM_TMPVARSIZE=40960 NANO_PMAKE="make -j 8" NANO_LABEL="rescue" NANO_RAM_TMPVARSIZE=40960 @@ -68,6 +68,7 @@ cust_etc_cfg () ( echo "#ifconfig_fxp0=\"AUTO\"" >> etc/rc.conf echo "#sshd_enable=\"YES\"" >> etc/rc.conf echo "/dev/ufs/${NANO_LABEL}s1a / ufs ro,noatime 0 0" > etc/fstab + echo "/dev/${NANO_DRIVE}s3 /cfg ufs rw,noauto 2 2" >> etc/fstab echo "tmpfs /boot/zfs tmpfs rw,size=1048576,mode=777 0 0" >> etc/fstab echo "ports:/usr/ports /usr/ports nfs rw,noauto,noatime,bg,soft,intr,nfsv3 0 0" >> etc/fstab # echo "/dev/ad1s1a /scratch ufs rw,noauto,noatime 0 0" >> etc/fstab @@ -100,9 +101,9 @@ last_orders () ( touch conf/default/etc/.keepme touch conf/default/var/.keepme cd .. - mkisofs -quiet -r -J -no-emul-boot \ - -V ${NANO_LABEL} \ - -b boot/cdboot -o _.disk.iso _.w/ + makefs -t cd9660 -o rockridge \ + -o label="${NANO_LABEL}" -o publisher="RMX" \ + -o bootimage="i386;_.w/boot/cdboot" -o no-emul-boot _.disk.iso _.w/ ) ) diff --git a/tools/tools/nanobsd/rescue/merge.sh b/tools/tools/nanobsd/rescue/merge.sh index 6761c94..afb6637 100755 --- a/tools/tools/nanobsd/rescue/merge.sh +++ b/tools/tools/nanobsd/rescue/merge.sh @@ -1,18 +1,28 @@ #!/bin/sh # $FreeBSD$ -D1="/usr/obj/nanobsd.rescue_i386" -D2="/usr/obj/nanobsd.rescue_amd64" +today=`date '+%Y%m%d'` -MD=`mdconfig -a -t vnode -f ${D1}/_.disk.full` +I32="/usr/obj/Rescue/rescue_${today}_x32.img" +I64="/usr/obj/Rescue/rescue_${today}_x64.img" +IAL="/usr/obj/Rescue/rescue_${today}_xal.img" +D64="/usr/obj/nanobsd.rescue_amd64" +MNT="/usr/obj/Rescue/_mnt" -dd if=${D2}/_.disk.image of=/dev/${MD}s2 bs=128k +if [ \! -d "$MNT" ]; then + mkdir "$MNT" +fi + +dd if=${I32} of=${IAL} bs=128k +MD=`mdconfig -a -t vnode -f ${IAL}` + +dd if=${D64}/_.disk.image of=/dev/${MD}s2 bs=128k tunefs -L rescues2a /dev/${MD}s2a -mount /dev/${MD}s2a ${D1}/_.mnt +mount /dev/${MD}s2a ${MNT} -sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/conf/base/etc/fstab -sed -i "" -e 's/rescues1/rescues2/' ${D1}/_.mnt/etc/fstab +sed -i "" -e 's/rescues1/rescues2/' ${MNT}/conf/base/etc/fstab +sed -i "" -e 's/rescues1/rescues2/' ${MNT}/etc/fstab -umount ${D1}/_.mnt +umount ${MNT} mdconfig -d -u ${MD} diff --git a/tools/tools/nanobsd/rescue/rescue_amd64.conf b/tools/tools/nanobsd/rescue/rescue_amd64.conf index 8a183ee..a82325f 100644 --- a/tools/tools/nanobsd/rescue/rescue_amd64.conf +++ b/tools/tools/nanobsd/rescue/rescue_amd64.conf @@ -1,7 +1,7 @@ # # $FreeBSD$ # -NANO_KERNEL=GENERIC +NANO_KERNEL=R64 NANO_ARCH=amd64 TARGET_ARCH=amd64; export TARGET_ARCH #TARGET_CPUTYPE=amd64; export TARGET_CPUTYPE diff --git a/tools/tools/nanobsd/rescue/rescue_i386.conf b/tools/tools/nanobsd/rescue/rescue_i386.conf index 5e91453..97b51d4 100644 --- a/tools/tools/nanobsd/rescue/rescue_i386.conf +++ b/tools/tools/nanobsd/rescue/rescue_i386.conf @@ -1,7 +1,7 @@ # # $FreeBSD$ # -NANO_KERNEL=GENERIC +NANO_KERNEL=R32 NANO_ARCH=i386 TARGET_ARCH=i386; export TARGET_ARCH #TARGET_CPUTYPE=i386; export TARGET_CPUTYPE diff --git a/tools/tools/net80211/stumbler/Makefile b/tools/tools/net80211/stumbler/Makefile index c3970b2..e7ea87c 100644 --- a/tools/tools/net80211/stumbler/Makefile +++ b/tools/tools/net80211/stumbler/Makefile @@ -2,8 +2,8 @@ PROG= stumbler BINDIR= /usr/local/bin -DPADD= ${LIBPCAP} ${LIBNCURSES} -LDADD= -lpcap -lncurses +DPADD= ${LIBPCAP} ${LIBNCURSESW} +LDADD= -lpcap -lncursesw CFLAGS=-g MAN= diff --git a/tools/tools/prstats/prstats.pl b/tools/tools/prstats/prstats.pl deleted file mode 100644 index c31241e..0000000 --- a/tools/tools/prstats/prstats.pl +++ /dev/null @@ -1,357 +0,0 @@ -#!/usr/bin/perl -w -#- -# Copyright (c) 2001 Dag-Erling Coïdan Smørgrav -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer -# in this position and unchanged. -# 2. Redistributions in binary form must reproduce 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 ``AS IS'' AND ANY EXPRESS OR -# IMPLIED 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 BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# -# $FreeBSD$ -# - -use strict; -use Data::Dumper; -use Fcntl; -use POSIX qw(isatty mktime strftime tzset); -use vars qw($TTY $NOW %MONTH %PR @EVENTS @COUNT @AGE); -use vars qw(%STATE %CATEGORY %OWNER %CLOSER); - -%MONTH = ( - 'Jan' => 1, - 'Feb' => 2, - 'Mar' => 3, - 'Apr' => 4, - 'May' => 5, - 'Jun' => 6, - 'Jul' => 7, - 'Aug' => 8, - 'Sep' => 9, - 'Oct' => 10, - 'Nov' => 11, - 'Dec' => 12, -); - -@AGE = ( - [ 0, 7, 0 ], # Less than one week - [ 7, 30, 0 ], # One week to one month - [ 30, 90, 0 ], # One to three months - [ 90, 365, 0 ], # Three months to a year - [ 365, 1095, 0 ], # One to three years - [ 1095, 999999, 0 ], # More than three years -); - -sub GNATS_DIR { "/home/gnats" } -sub GNATS_TZ { "America/Los_Angeles" } -sub DATFILE { "/tmp/prstats.dat.$$" } -sub GNUPLOT { "|/usr/local/bin/gnuplot /dev/stdin" } -sub TIMEFMT { "%Y-%m-%d/%H:%M:%S" } - -sub parse_date($) { - my $date = shift; # Date to parse - - my $year; - my $month; - my $day; - my $hour; - my $minute; - my $second; - - $date =~ s/\s+/ /g; - $date =~ s/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\w*\s*//; - if ($date =~ m/^(\w{3}) (\d\d?) (\d\d):(\d\d):(\d\d) [A-Z ]*(\d{4})$/) { - ($month, $day, $hour, $minute, $second, $year) = - ($1, $2, $3, $4, $5, $6); - } else { - die("Unrecognized date format: $date\n"); - } - defined($month = $MONTH{$month}) - or die("Invalid month: $month\n"); - return mktime($second, $minute, $hour, $day, $month - 1, $year - 1900); -} - -sub scan_pr($) { - my $fn = shift; # File name - - local *FILE; # File handle - my $pr = {}; # PR hash - my $age; # PR age - - sysopen(FILE, $fn, O_RDONLY) - or die("$fn: open(): $!\n"); - while (<FILE>) { - if (m/^>([A-Za-z-]+):\s+(.*?)\s*$/o || - m/^(Category|Responsible|State-Changed-[A-Za-z-]+):\s+(.*?)\s*$/o) { - $pr->{lc($1)} = $2; - } - } - - exists($PR{$pr->{'number'}}) - and die("$fn: PR $pr->{'number'} already exists\n"); - - if ($TTY) { - print(" "x40, "\r", scalar(keys(%PR)), - " $pr->{'category'}/$pr->{'number'} "); - } - - foreach ('arrival-date', 'closed-date', 'last-modified', - 'state-changed-when') { - if (defined($pr->{$_}) && length($pr->{$_})) { - $pr->{$_} = parse_date($pr->{$_}); - } - } - - $pr->{'_created'} = $pr->{'arrival-date'}; - if ($pr->{'state'} eq 'closed') { - $pr->{'_closed'} = $pr->{'closed-date'} || $pr->{'state-changed-when'}; - $pr->{'_closed_by'} = $pr->{'state-changed-by'}; - if (!defined($pr->{'_closed_by'})) { - warn("PR $pr->{'category'}/$pr->{'number'} is incomplete\n"); - return; - } - ++$CLOSER{$pr->{'_closed_by'}}; - } else { - $age = $pr->{'arrival-date'} / 86400; - foreach (@AGE) { - if ($age >= $_->[0] && $age < $_->[1]) { - ++$_->[2]; - last; - } - } - ++$CATEGORY{$pr->{'category'}}; - ++$OWNER{$pr->{'responsible'}}; - } - ++$STATE{$pr->{'state'}}; - - $PR{$pr->{'number'}} = { - 'category' => $pr->{'category'}, - #'number' => $pr->{'number'}, - 'responsible' => $pr->{'responsible'}, - 'created' => $pr->{'created'}, - 'closed' => $pr->{'closed'}, - 'closer' => $pr->{'_closed_by'}, - }; - push(@EVENTS, [ $pr->{'_created'}, +1 ]); - push(@EVENTS, [ $pr->{'_closed'}, -1 ]) - if defined($pr->{'_closed'}); -} - -sub scan_recurse($); -sub scan_recurse($) { - my $dn = shift; # Directory name - - local *DIR; # Directory handle - my $entry; # Entry - - opendir(DIR, $dn) - or die("$dn: opendir(): $!\n"); - while ($entry = readdir(DIR)) { - next if ($entry eq '.' || $entry eq '..'); - if (-d "$dn/$entry") { - scan_recurse("$dn/$entry"); - } elsif ($entry =~ m/^\d+$/) { - eval { - scan_pr("$dn/$entry"); - }; - } - } - closedir(DIR); -} - -sub count_prs() { - - my $pr; # Iterator - my @events; # Creations or closures - my $event; # Iterator - my $count; # PR count - - if ($TTY) { - print(int(@EVENTS), " events\n"); - } - @COUNT = ( [ 0, 0 ] ); - foreach $event (sort({ $a->[0] <=> $b->[0] } @EVENTS)) { - if ($event->[0] == $COUNT[-1]->[0]) { - $COUNT[-1]->[1] += $event->[1]; - } else { - push(@COUNT, [ $event->[0], $COUNT[-1]->[1] + $event->[1] ]); - } - } - if (@COUNT > 1) { - $COUNT[0]->[0] = $COUNT[1]->[0] - 1; - unshift(@COUNT, [ 0, 0 ]); - } -} - -sub gnuplot(@) { - my @commands = @_; # Commands - - my $pid; # Child PID - local *PIPE; # Pipe - - open(PIPE, &GNUPLOT) - or die("fork(): $!\n"); - print(PIPE join("\n", @commands, "")); - close(PIPE); - if ($? & 0x7f) { - die("gnuplot caught a signal " . ($? & 0x7f) . "\n"); - } elsif ($?) { - die("gunplot returned exit code " . ($? >> 8) . "\n"); - } -} - -sub write_dat_file($) { - my $fn = shift; # File name - - local *FILE; # File handle - my $datum; # Iterator - - sysopen(FILE, $fn, O_RDWR|O_CREAT|O_TRUNC, 0640) - or die("$fn: open(): $!\n"); - foreach $datum (@COUNT) { - print(FILE strftime(&TIMEFMT, localtime($datum->[0])), - " ", $datum->[1], - " ", $COUNT[-1]->[1], - "\n"); - } - close(FILE); -} - -sub graph_open_prs($$$$$) { - my $datfn = shift; # Data file name - my $fn = shift; # File name - my $start = shift; # Starting date - my $end = shift; # Ending date - my $title = shift; # Title - - my $tickfmt; # Tick format - my $timefmt; # Time format - - if ($end - $start > 86400 * 30) { - $tickfmt = "%Y-%m-%d"; - } else { - $tickfmt = "%m-%d"; - } - $start = strftime(&TIMEFMT, localtime($start)); - $end = strftime(&TIMEFMT, localtime($end)); - $timefmt = &TIMEFMT; - gnuplot(" -set term png small color -set xdata time -set timefmt '$timefmt' -set data style line -set grid -set output '$fn' -set format x '$tickfmt' -set xrange ['$start':'$end'] -set yrange [0:*] -set title '$title' -plot '$datfn' using 1:2 title 'Open PRs' -"); -} - -sub pr_stat_summary() { - - my $n; # Loop counter - - # Overall stats - printf("Total PRs in database: %d\n", scalar(keys(%PR))); - printf("Open PRs: %d\n", scalar(keys(%PR)) - $STATE{'closed'}); - print("\n"); - - # Category ranking - print("Number of PRs in each category:\n"); - foreach (sort({ $CATEGORY{$b} <=> $CATEGORY{$a} } keys(%CATEGORY))) { - printf("%12s: %d\n", $_, $CATEGORY{$_}); - } - print("\n"); - - # State ranking - print("Number of PRs in each state:\n"); - foreach (sort({ $STATE{$b} <=> $STATE{$a} } keys(%STATE))) { - printf("%12s: %d\n", $_, $STATE{$_}); - } - print("\n"); - - # Closer ranking - print("Top ten PR busters:\n"); - $n = 0; - foreach (sort({ $CLOSER{$b} <=> $CLOSER{$a} } keys(%CLOSER))) { - printf(" %2d. %s (%d)\n", ++$n, $_, $CLOSER{$_}); - last if ($n == 10); - } - print("\n"); - - # Owner ranking - print("Top ten owners of open PRs:\n"); - $n = 0; - foreach (sort({ $OWNER{$b} <=> $OWNER{$a} } keys(%OWNER))) { - next if (m/^freebsd-(bugs|doc|ports)$/); - printf(" %2d. %s (%d)\n", ++$n, $_, $OWNER{$_}); - last if ($n == 10); - } - print("\n"); - -} - -MAIN:{ - $| = 1; - $TTY = isatty(*STDOUT); - - # Perl lacks strptime(), and its mktime() doesn't accept a - # timezone argument, so we set our local timezone to that of the - # FreeBSD cluster and use localtime() instead. - $ENV{'TZ'} = &GNATS_TZ; - tzset(); - $NOW = time(); - - # Read and count PRs - if (@ARGV) { - foreach (@ARGV) { - scan_recurse(join('/', &GNATS_DIR, $_)); - } - } else { - scan_recurse(&GNATS_DIR); - } - if ($TTY) { - print("\r", scalar(keys(%PR)), " problem reports scanned\n"); - } - - # Generate graphs - if (0) { - count_prs(); - write_dat_file(&DATFILE); - graph_open_prs(&DATFILE, "week.png", $NOW - (86400 * 7) + 1, $NOW, - "Open FreeBSD problem reports (week view)"); - graph_open_prs(&DATFILE, "month.png", $NOW - (86400 * 30) + 1, $NOW, - "Open FreeBSD problem reports (month view)"); - graph_open_prs(&DATFILE, "year.png", $NOW - (86400 * 365) + 1, $NOW, - "Open FreeBSD problem reports (year view)"); - graph_open_prs(&DATFILE, "ever.png", $COUNT[1]->[0], $NOW, - "Open FreeBSD problem reports (project history)"); - graph_open_prs(&DATFILE, "drive.png", mktime(0, 0, 0, 29, 4, 101), $NOW, - "Open FreeBSD problem reports (drive progress)"); - unlink(&DATFILE); - } - - # Print summary - pr_stat_summary(); -} diff --git a/tools/tools/sysbuild/README b/tools/tools/sysbuild/README index 3b280d1..a1fa5f4 100644 --- a/tools/tools/sysbuild/README +++ b/tools/tools/sysbuild/README @@ -65,9 +65,8 @@ Next, install ports and sources: cd /freebsd mkdir ports src packages - # Or use svn if you prefer - csup -h cvsup.???.freebsd.org /usr/share/examples/cvsup/ports-supfile - csup -h cvsup.???.freebsd.org /usr/share/examples/cvsup/stable-supfile + svn co https://svn0.us-east.FreeBSD.org/base/stable/10 src + svn co https://svn0.us-east.FreeBSD.org/ports/head ports And we should be ready to try a shot: diff --git a/tools/tools/sysdoc/sysdoc.sh b/tools/tools/sysdoc/sysdoc.sh index b07c53d..872eabd 100644 --- a/tools/tools/sysdoc/sysdoc.sh +++ b/tools/tools/sysdoc/sysdoc.sh @@ -59,12 +59,12 @@ implementation, see the respecting manual pages. This manual page is automatically generated by a set of scripts written by .An -nosplit -.An Tom Rhodes Aq trhodes@FreeBSD.org , +.An Tom Rhodes Aq Mt trhodes@FreeBSD.org , with significant contributions from -.An Giorgos Keramidas Aq keramida@FreeBSD.org , -.An Ruslan Ermilov Aq ru@FreeBSD.org , +.An Giorgos Keramidas Aq Mt keramida@FreeBSD.org , +.An Ruslan Ermilov Aq Mt ru@FreeBSD.org , and -.An Marc Silver Aq marcs@draenor.org . +.An Marc Silver Aq Mt marcs@draenor.org . .Sh BUGS Sometimes .Fx diff --git a/tools/tools/vimage/vimage.8 b/tools/tools/vimage/vimage.8 index e9a24c4..306bf83 100644 --- a/tools/tools/vimage/vimage.8 +++ b/tools/tools/vimage/vimage.8 @@ -188,8 +188,8 @@ of the main FreeBSD tree. As a result of a project sponsored by the FreeBSD Foundation and Stiching NLNet, integrated virtualized network stack first appeared in FreeBSD 8.0. +.Sh AUTHORS +.An Marko Zec Aq Mt zec@fer.hr .Sh BUGS Deletion of vimages / vnets is known to leak kernel memory and fail at stopping various timers, hence may lead to system crashes. -.Sh AUTHOR -.An "Marko Zec" Aq zec@fer.hr diff --git a/tools/tools/vt/fontcvt/Makefile b/tools/tools/vt/fontcvt/Makefile deleted file mode 100644 index 06692d0..0000000 --- a/tools/tools/vt/fontcvt/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -PROG= fontcvt -MAN1= - -WARNS?= 6 - -.include <bsd.prog.mk> diff --git a/tools/tools/vt/fontcvt/fontcvt.c b/tools/tools/vt/fontcvt/fontcvt.c deleted file mode 100644 index 74a7c40..0000000 --- a/tools/tools/vt/fontcvt/fontcvt.c +++ /dev/null @@ -1,444 +0,0 @@ -/*- - * Copyright (c) 2009 The FreeBSD Foundation - * All rights reserved. - * - * This software was developed by Ed Schouten under sponsorship from the - * FreeBSD Foundation. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must 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. - */ - -#include <sys/cdefs.h> -__FBSDID("$FreeBSD$"); - -#include <sys/endian.h> -#include <sys/param.h> -#include <sys/queue.h> - -#include <assert.h> -#include <stdint.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#define VFNT_MAPS 4 -#define VFNT_MAP_NORMAL 0 -#define VFNT_MAP_BOLD 2 - -static unsigned int width, wbytes, height; - -struct glyph { - TAILQ_ENTRY(glyph) g_list; - uint8_t *g_data; - unsigned int g_index; -}; - -TAILQ_HEAD(glyph_list, glyph); -static struct glyph_list glyphs[VFNT_MAPS] = { - TAILQ_HEAD_INITIALIZER(glyphs[0]), - TAILQ_HEAD_INITIALIZER(glyphs[1]), - TAILQ_HEAD_INITIALIZER(glyphs[2]), - TAILQ_HEAD_INITIALIZER(glyphs[3]), -}; -static unsigned int glyph_total, glyph_count[4], glyph_unique, glyph_dupe; - -struct mapping { - TAILQ_ENTRY(mapping) m_list; - unsigned int m_char; - unsigned int m_length; - struct glyph *m_glyph; -}; - -TAILQ_HEAD(mapping_list, mapping); -static struct mapping_list maps[VFNT_MAPS] = { - TAILQ_HEAD_INITIALIZER(maps[0]), - TAILQ_HEAD_INITIALIZER(maps[1]), - TAILQ_HEAD_INITIALIZER(maps[2]), - TAILQ_HEAD_INITIALIZER(maps[3]), -}; -static unsigned int mapping_total, map_count[4], map_folded_count[4], - mapping_unique, mapping_dupe; - -static void -usage(void) -{ - - fprintf(stderr, -"usage: fontcvt width height normal.bdf bold.bdf out.fnt\n"); - exit(1); -} - -static int -add_mapping(struct glyph *gl, unsigned int c, unsigned int map_idx) -{ - struct mapping *mp; - struct mapping_list *ml; - - mapping_total++; - - if (map_idx >= VFNT_MAP_BOLD) { - int found = 0; - unsigned normal_map_idx = map_idx - VFNT_MAP_BOLD; - - TAILQ_FOREACH(mp, &maps[normal_map_idx], m_list) { - if (mp->m_char < c) - continue; - else if (mp->m_char > c) - break; - found = 1; - - /* - * No mapping is needed if it's equal to the - * normal mapping. - */ - if (mp->m_glyph == gl) { - mapping_dupe++; - return (0); - } - } - - if (!found) { - fprintf(stderr, - "Character %u not in normal font!\n", c); - return (1); - } - } - - mp = malloc(sizeof *mp); - mp->m_char = c; - mp->m_glyph = gl; - mp->m_length = 0; - - ml = &maps[map_idx]; - if (TAILQ_LAST(ml, mapping_list) != NULL && - TAILQ_LAST(ml, mapping_list)->m_char >= c) { - fprintf(stderr, "Bad ordering at character %u\n", c); - return (1); - } - TAILQ_INSERT_TAIL(ml, mp, m_list); - - map_count[map_idx]++; - mapping_unique++; - - return (0); -} - -static struct glyph * -add_glyph(const uint8_t *bytes, unsigned int map_idx, int fallback) -{ - struct glyph *gl; - unsigned int i; - - glyph_total++; - glyph_count[map_idx]++; - - for (i = 0; i < VFNT_MAPS; i++) { - TAILQ_FOREACH(gl, &glyphs[i], g_list) { - if (memcmp(gl->g_data, bytes, wbytes * height) == 0) { - glyph_dupe++; - return (gl); - } - } - } - - gl = malloc(sizeof *gl); - gl->g_data = malloc(wbytes * height); - memcpy(gl->g_data, bytes, wbytes * height); - if (fallback) - TAILQ_INSERT_HEAD(&glyphs[map_idx], gl, g_list); - else - TAILQ_INSERT_TAIL(&glyphs[map_idx], gl, g_list); - - glyph_unique++; - return (gl); -} - -static int -parse_bitmap_line(uint8_t *left, uint8_t *right, unsigned int line, - unsigned int dwidth) -{ - uint8_t *p; - unsigned int i, subline; - - if (dwidth != width && dwidth != width * 2) { - fprintf(stderr, - "Unsupported width %u!\n", dwidth); - return (1); - } - - /* Move pixel data right to simplify splitting double characters. */ - line >>= (howmany(dwidth, 8) * 8) - dwidth; - - for (i = dwidth / width; i > 0; i--) { - p = (i == 2) ? right : left; - - subline = line & ((1 << width) - 1); - subline <<= (howmany(width, 8) * 8) - width; - - if (wbytes == 1) { - *p = subline; - } else if (wbytes == 2) { - *p++ = subline >> 8; - *p = subline; - } else { - fprintf(stderr, - "Unsupported wbytes %u!\n", wbytes); - return (1); - } - - line >>= width; - } - - return (0); -} - -static int -parse_bdf(const char *filename, unsigned int map_idx) -{ - FILE *fp; - char *ln; - size_t length; - uint8_t bytes[wbytes * height], bytes_r[wbytes * height]; - unsigned int curchar = 0, dwidth = 0, i, line; - struct glyph *gl; - - fp = fopen(filename, "r"); - if (fp == NULL) { - perror(filename); - return (1); - } - - while ((ln = fgetln(fp, &length)) != NULL) { - ln[length - 1] = '\0'; - - if (strncmp(ln, "ENCODING ", 9) == 0) { - curchar = atoi(ln + 9); - } - - if (strncmp(ln, "DWIDTH ", 7) == 0) { - dwidth = atoi(ln + 7); - } - - if (strcmp(ln, "BITMAP") == 0) { - for (i = 0; i < height; i++) { - if ((ln = fgetln(fp, &length)) == NULL) { - fprintf(stderr, "Unexpected EOF!\n"); - return (1); - } - ln[length - 1] = '\0'; - sscanf(ln, "%x", &line); - if (parse_bitmap_line(bytes + i * wbytes, - bytes_r + i * wbytes, line, dwidth) != 0) - return (1); - } - - /* Prevent adding two glyphs for 0xFFFD */ - if (curchar == 0xFFFD) { - if (map_idx < VFNT_MAP_BOLD) - gl = add_glyph(bytes, 0, 1); - } else if (curchar >= 0x20) { - gl = add_glyph(bytes, map_idx, 0); - if (add_mapping(gl, curchar, map_idx) != 0) - return (1); - if (dwidth == width * 2) { - gl = add_glyph(bytes_r, map_idx + 1, 0); - if (add_mapping(gl, curchar, - map_idx + 1) != 0) - return (1); - } - } - } - } - - return (0); -} - -static void -number_glyphs(void) -{ - struct glyph *gl; - unsigned int i, idx = 0; - - for (i = 0; i < VFNT_MAPS; i++) - TAILQ_FOREACH(gl, &glyphs[i], g_list) - gl->g_index = idx++; -} - -static void -write_glyphs(FILE *fp) -{ - struct glyph *gl; - unsigned int i; - - for (i = 0; i < VFNT_MAPS; i++) { - TAILQ_FOREACH(gl, &glyphs[i], g_list) - fwrite(gl->g_data, wbytes * height, 1, fp); - } -} - -static void -fold_mappings(unsigned int map_idx) -{ - struct mapping_list *ml = &maps[map_idx]; - struct mapping *mn, *mp, *mbase; - - mp = mbase = TAILQ_FIRST(ml); - for (mp = mbase = TAILQ_FIRST(ml); mp != NULL; mp = mn) { - mn = TAILQ_NEXT(mp, m_list); - if (mn != NULL && mn->m_char == mp->m_char + 1 && - mn->m_glyph->g_index == mp->m_glyph->g_index + 1) - continue; - mbase->m_length = mp->m_char - mbase->m_char + 1; - mbase = mp = mn; - map_folded_count[map_idx]++; - } -} - -struct file_mapping { - uint32_t source; - uint16_t destination; - uint16_t length; -} __packed; - -static void -write_mappings(FILE *fp, unsigned int map_idx) -{ - struct mapping_list *ml = &maps[map_idx]; - struct mapping *mp; - struct file_mapping fm; - unsigned int i = 0, j = 0; - - TAILQ_FOREACH(mp, ml, m_list) { - j++; - if (mp->m_length > 0) { - i += mp->m_length; - fm.source = htobe32(mp->m_char); - fm.destination = htobe16(mp->m_glyph->g_index); - fm.length = htobe16(mp->m_length - 1); - fwrite(&fm, sizeof fm, 1, fp); - } - } - assert(i == j); -} - -struct file_header { - uint8_t magic[8]; - uint8_t width; - uint8_t height; - uint16_t pad; - uint32_t glyph_count; - uint32_t map_count[4]; -} __packed; - -static int -write_fnt(const char *filename) -{ - FILE *fp; - struct file_header fh = { - .magic = "VFNT0002", - }; - - fp = fopen(filename, "wb"); - if (fp == NULL) { - perror(filename); - return (1); - } - - fh.width = width; - fh.height = height; - fh.glyph_count = htobe32(glyph_unique); - fh.map_count[0] = htobe32(map_folded_count[0]); - fh.map_count[1] = htobe32(map_folded_count[1]); - fh.map_count[2] = htobe32(map_folded_count[2]); - fh.map_count[3] = htobe32(map_folded_count[3]); - fwrite(&fh, sizeof fh, 1, fp); - - write_glyphs(fp); - write_mappings(fp, VFNT_MAP_NORMAL); - write_mappings(fp, 1); - write_mappings(fp, VFNT_MAP_BOLD); - write_mappings(fp, 3); - - return (0); -} - -int -main(int argc, char *argv[]) -{ - - assert(sizeof(struct file_header) == 32); - assert(sizeof(struct file_mapping) == 8); - - if (argc != 6) - usage(); - - width = atoi(argv[1]); - wbytes = howmany(width, 8); - height = atoi(argv[2]); - - if (parse_bdf(argv[3], VFNT_MAP_NORMAL) != 0) - return (1); - if (parse_bdf(argv[4], VFNT_MAP_BOLD) != 0) - return (1); - number_glyphs(); - fold_mappings(0); - fold_mappings(1); - fold_mappings(2); - fold_mappings(3); - if (write_fnt(argv[5]) != 0) - return (1); - - printf( -"Statistics:\n" -"- glyph_total: %5u\n" -"- glyph_normal: %5u\n" -"- glyph_normal_right: %5u\n" -"- glyph_bold: %5u\n" -"- glyph_bold_right: %5u\n" -"- glyph_unique: %5u\n" -"- glyph_dupe: %5u\n" -"- mapping_total: %5u\n" -"- mapping_normal: %5u\n" -"- mapping_normal_folded: %5u\n" -"- mapping_normal_right: %5u\n" -"- mapping_normal_right_folded: %5u\n" -"- mapping_bold: %5u\n" -"- mapping_bold_folded: %5u\n" -"- mapping_bold_right: %5u\n" -"- mapping_bold_right_folded: %5u\n" -"- mapping_unique: %5u\n" -"- mapping_dupe: %5u\n", - glyph_total, - glyph_count[0], - glyph_count[1], - glyph_count[2], - glyph_count[3], - glyph_unique, glyph_dupe, - mapping_total, - map_count[0], map_folded_count[0], - map_count[1], map_folded_count[1], - map_count[2], map_folded_count[2], - map_count[3], map_folded_count[3], - mapping_unique, mapping_dupe); - - return (0); -} diff --git a/tools/tools/vt/fontcvt/terminus.sh b/tools/tools/vt/fontcvt/terminus.sh index 260ee07..d186e3e 100644 --- a/tools/tools/vt/fontcvt/terminus.sh +++ b/tools/tools/vt/fontcvt/terminus.sh @@ -1,10 +1,12 @@ #!/bin/sh +# $FreeBSD$ + for i in 6:12 8:14 8:16 10:18 10:20 11:22 12:24 14:28 16:32 do C=`echo $i | cut -f 1 -d :` R=`echo $i | cut -f 2 -d :` - ./fontcvt \ - $C $R \ + ./vtfontcvt \ + -w $C -h $R \ ~/terminus-font-4.36/ter-u${R}n.bdf \ ~/terminus-font-4.36/ter-u${R}b.bdf \ terminus-u${R}.vfnt diff --git a/tools/tools/vt/mkkfont/mkkfont.c b/tools/tools/vt/mkkfont/mkkfont.c index 7700e9c..67335695 100644 --- a/tools/tools/vt/mkkfont/mkkfont.c +++ b/tools/tools/vt/mkkfont/mkkfont.c @@ -139,7 +139,7 @@ print_info(struct file_header *fh) else printf("\t\t\t\t NULL,\n"); } - printf("\t\t\t\t }\n"); + printf("\t\t\t\t },\n"); printf("\t.vf_map_count\t\t= { %u, %u, %u, %u },\n", be32toh(fh->map_count[0]), be32toh(fh->map_count[1]), |