summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bin/rmail/Makefile4
-rw-r--r--bin/sh/mknodes.c18
-rw-r--r--bin/sh/nodes.c.pat66
-rw-r--r--cddl/lib/libavl/Makefile.depend1
-rw-r--r--cddl/lib/libctf/Makefile.depend1
-rw-r--r--cddl/lib/libdtrace/Makefile.depend1
-rw-r--r--cddl/lib/libnvpair/Makefile.depend1
-rw-r--r--cddl/lib/libumem/Makefile.depend1
-rw-r--r--cddl/lib/libuutil/Makefile.depend1
-rw-r--r--cddl/lib/libzfs/Makefile.depend1
-rw-r--r--cddl/lib/libzfs_core/Makefile.depend1
-rw-r--r--cddl/lib/libzpool/Makefile.depend1
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/aggs/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/arrays/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/assocs/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/begin/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/buffering/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/cg/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/clauses/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/cpc/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/decls/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/drops/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/end/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/enum/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/error/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/exit/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/funcs/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/grammar/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/include/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/inline/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/io/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/ip/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/java_api/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/json/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/lexer/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/mdb/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/mib/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/misc/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/nfs/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/operators/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/pid/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/pointers/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/pragma/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/predicates/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/print/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/printa/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/printf/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/privs/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/probes/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/proc/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/providers/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/raise/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/rates/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/safety/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/scalars/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/sched/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/scripting/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/sdt/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/speculation/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/stability/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/stack/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/stop/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/strlen/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/struct/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/syscall/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/trace/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/translators/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/typedef/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/types/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/uctf/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/union/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/usdt/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/ustack/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/vars/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/common/version/Makefile2
-rw-r--r--cddl/usr.sbin/dtrace/tests/dtrace.test.mk (renamed from cddl/usr.sbin/dtrace/tests/Makefile.inc1)0
-rwxr-xr-xcddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh2
-rw-r--r--contrib/bmake/parse.c4
-rw-r--r--crypto/openssh/sshd_config3
-rw-r--r--gnu/lib/libdialog/Makefile.depend1
-rw-r--r--gnu/lib/libgcc/Makefile.depend1
-rw-r--r--gnu/lib/libgomp/Makefile.depend1
-rw-r--r--gnu/lib/libreadline/readline/Makefile5
-rw-r--r--gnu/lib/libregex/Makefile.depend1
-rw-r--r--gnu/lib/libstdc++/Makefile6
-rw-r--r--gnu/lib/libstdc++/Makefile.depend1
-rw-r--r--gnu/lib/libsupc++/Makefile2
-rw-r--r--gnu/lib/libsupc++/Makefile.depend1
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile4
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile4
-rw-r--r--include/Makefile10
-rwxr-xr-xinclude/mk-osreldate.sh2
-rw-r--r--kerberos5/lib/libasn1/Makefile.depend1
-rw-r--r--kerberos5/lib/libgssapi_krb5/Makefile.depend1
-rw-r--r--kerberos5/lib/libgssapi_ntlm/Makefile.depend1
-rw-r--r--kerberos5/lib/libgssapi_spnego/Makefile.depend1
-rw-r--r--kerberos5/lib/libhdb/Makefile.depend1
-rw-r--r--kerberos5/lib/libheimbase/Makefile.depend1
-rw-r--r--kerberos5/lib/libheimipcc/Makefile.depend1
-rw-r--r--kerberos5/lib/libheimipcs/Makefile.depend1
-rw-r--r--kerberos5/lib/libheimntlm/Makefile.depend1
-rw-r--r--kerberos5/lib/libhx509/Makefile.depend1
-rw-r--r--kerberos5/lib/libkadm5clnt/Makefile.depend1
-rw-r--r--kerberos5/lib/libkadm5srv/Makefile.depend1
-rw-r--r--kerberos5/lib/libkafs5/Makefile.depend1
-rw-r--r--kerberos5/lib/libkdc/Makefile.depend1
-rw-r--r--kerberos5/lib/libkrb5/Makefile.depend1
-rw-r--r--kerberos5/lib/libroken/Makefile.depend1
-rw-r--r--kerberos5/lib/libwind/Makefile.depend1
-rw-r--r--lib/atf/libatf-c++/Makefile.depend1
-rw-r--r--lib/atf/libatf-c/Makefile.depend1
-rw-r--r--lib/clang/clang.build.mk1
-rw-r--r--lib/libalias/libalias/Makefile.depend1
-rw-r--r--lib/libarchive/Makefile.depend1
-rw-r--r--lib/libarchive/tests/Makefile4
-rw-r--r--lib/libauditd/Makefile.depend1
-rw-r--r--lib/libbegemot/Makefile.depend1
-rw-r--r--lib/libblocksruntime/Makefile.depend1
-rw-r--r--lib/libbluetooth/Makefile.depend1
-rw-r--r--lib/libbsm/Makefile.depend1
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile.depend1
-rw-r--r--lib/libbz2/Makefile.depend1
-rw-r--r--lib/libc++/Makefile4
-rw-r--r--lib/libc/gdtoa/Makefile.inc4
-rw-r--r--lib/libc/gen/Makefile.inc4
-rw-r--r--lib/libc/locale/Makefile.inc1
-rw-r--r--lib/libc/stdio/Makefile.inc2
-rw-r--r--lib/libc/stdlib/jemalloc/Makefile.inc8
-rw-r--r--lib/libc/tests/rpc/Makefile4
-rw-r--r--lib/libcalendar/Makefile.depend1
-rw-r--r--lib/libcam/Makefile.depend1
-rw-r--r--lib/libcapsicum/Makefile.depend1
-rw-r--r--lib/libcom_err/Makefile.depend1
-rw-r--r--lib/libcrypt/Makefile3
-rw-r--r--lib/libcrypt/Makefile.depend1
-rw-r--r--lib/libcuse/Makefile.depend1
-rw-r--r--lib/libcxxrt/Makefile.depend1
-rw-r--r--lib/libdevinfo/Makefile.depend1
-rw-r--r--lib/libdevstat/Makefile.depend1
-rw-r--r--lib/libdpv/Makefile.depend1
-rw-r--r--lib/libdwarf/Makefile6
-rw-r--r--lib/libdwarf/Makefile.depend1
-rw-r--r--lib/libedit/Makefile.depend1
-rw-r--r--lib/libelf/Makefile6
-rw-r--r--lib/libelf/Makefile.depend1
-rw-r--r--lib/libexecinfo/Makefile.depend1
-rw-r--r--lib/libexpat/Makefile.depend1
-rw-r--r--lib/libfetch/Makefile.depend1
-rw-r--r--lib/libfigpar/Makefile.depend1
-rw-r--r--lib/libgeom/Makefile.depend1
-rw-r--r--lib/libgpio/Makefile.depend1
-rw-r--r--lib/libgssapi/Makefile.depend1
-rw-r--r--lib/libiconv_modules/BIG5/Makefile.depend1
-rw-r--r--lib/libiconv_modules/DECHanyu/Makefile.depend1
-rw-r--r--lib/libiconv_modules/EUC/Makefile.depend1
-rw-r--r--lib/libiconv_modules/EUCTW/Makefile.depend1
-rw-r--r--lib/libiconv_modules/GBK2K/Makefile.depend1
-rw-r--r--lib/libiconv_modules/HZ/Makefile.depend1
-rw-r--r--lib/libiconv_modules/ISO2022/Makefile.depend1
-rw-r--r--lib/libiconv_modules/JOHAB/Makefile.depend1
-rw-r--r--lib/libiconv_modules/MSKanji/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UES/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UTF1632/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UTF7/Makefile.depend1
-rw-r--r--lib/libiconv_modules/UTF8/Makefile.depend1
-rw-r--r--lib/libiconv_modules/VIQR/Makefile.depend1
-rw-r--r--lib/libiconv_modules/ZW/Makefile.depend1
-rw-r--r--lib/libiconv_modules/iconv_none/Makefile.depend1
-rw-r--r--lib/libiconv_modules/iconv_std/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_646/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_none/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_parallel/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_serial/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_std/Makefile.depend1
-rw-r--r--lib/libiconv_modules/mapper_zone/Makefile.depend1
-rw-r--r--lib/libipsec/Makefile.depend1
-rw-r--r--lib/libjail/Makefile.depend1
-rw-r--r--lib/libkiconv/Makefile.depend1
-rw-r--r--lib/libkvm/Makefile.depend1
-rw-r--r--lib/libldns/Makefile.depend1
-rw-r--r--lib/liblzma/Makefile.depend2
-rw-r--r--lib/libmagic/Makefile.depend1
-rw-r--r--lib/libmd/Makefile.depend1
-rw-r--r--lib/libmd/Makefile.depend.host35
-rw-r--r--lib/libmemstat/Makefile.depend1
-rw-r--r--lib/libmilter/Makefile4
-rw-r--r--lib/libmilter/Makefile.depend1
-rw-r--r--lib/libmp/Makefile.depend1
-rw-r--r--lib/libmt/Makefile.depend1
-rw-r--r--lib/libnetgraph/Makefile.depend1
-rw-r--r--lib/libngatm/Makefile.depend1
-rw-r--r--lib/libnv/Makefile.depend1
-rw-r--r--lib/libopie/Makefile.depend1
-rw-r--r--lib/libpam/libpam/Makefile.depend1
-rw-r--r--lib/libpcap/Makefile5
-rw-r--r--lib/libpcap/Makefile.depend1
-rw-r--r--lib/libpmc/Makefile.depend1
-rw-r--r--lib/libproc/Makefile3
-rw-r--r--lib/libproc/Makefile.depend2
-rw-r--r--lib/libprocstat/Makefile.depend1
-rw-r--r--lib/libradius/Makefile.depend1
-rw-r--r--lib/librpcsec_gss/Makefile.depend1
-rw-r--r--lib/librpcsvc/Makefile.depend1
-rw-r--r--lib/librt/Makefile.depend1
-rw-r--r--lib/librtld_db/Makefile2
-rw-r--r--lib/librtld_db/Makefile.depend2
-rw-r--r--lib/libsbuf/Makefile.depend1
-rw-r--r--lib/libsdp/Makefile.depend1
-rw-r--r--lib/libsm/Makefile4
-rw-r--r--lib/libsmb/Makefile.depend1
-rw-r--r--lib/libsmdb/Makefile4
-rw-r--r--lib/libsmutil/Makefile4
-rw-r--r--lib/libsqlite3/Makefile.depend1
-rw-r--r--lib/libstdbuf/Makefile.depend1
-rw-r--r--lib/libstdthreads/Makefile.depend1
-rw-r--r--lib/libthr/Makefile.depend1
-rw-r--r--lib/libthread_db/Makefile.depend1
-rw-r--r--lib/libucl/Makefile.depend1
-rw-r--r--lib/libufs/Makefile.depend1
-rw-r--r--lib/libugidfw/Makefile.depend1
-rw-r--r--lib/libulog/Makefile.depend1
-rw-r--r--lib/libunbound/Makefile.depend1
-rw-r--r--lib/libusb/Makefile.depend1
-rw-r--r--lib/libusbhid/Makefile.depend1
-rw-r--r--lib/libutil/Makefile.depend1
-rw-r--r--lib/libvgl/Makefile.depend1
-rw-r--r--lib/libvmmapi/Makefile.depend1
-rw-r--r--lib/libwrap/Makefile.depend1
-rw-r--r--lib/libxo/Makefile.depend1
-rw-r--r--lib/libypclnt/Makefile.depend1
-rw-r--r--lib/libz/Makefile.depend1
-rw-r--r--lib/msun/Makefile.depend1
-rw-r--r--lib/ncurses/form/Makefile.depend1
-rw-r--r--lib/ncurses/formw/Makefile.depend1
-rw-r--r--lib/ncurses/menu/Makefile.depend1
-rw-r--r--lib/ncurses/menuw/Makefile.depend1
-rw-r--r--lib/ncurses/ncurses/Makefile.depend1
-rw-r--r--lib/ncurses/ncursesw/Makefile.depend1
-rw-r--r--lib/ncurses/panel/Makefile.depend1
-rw-r--r--lib/ncurses/panelw/Makefile.depend1
-rw-r--r--libexec/mail.local/Makefile4
-rw-r--r--libexec/smrsh/Makefile4
-rw-r--r--release/tools/arm.subr2
-rw-r--r--sbin/ipf/ipf/Makefile2
-rw-r--r--sbin/ipf/ipftest/Makefile1
-rw-r--r--sbin/ipf/ipmon/Makefile2
-rw-r--r--sbin/ipf/ipnat/Makefile2
-rw-r--r--sbin/ipf/ippool/Makefile2
-rw-r--r--secure/lib/libcrypto/Makefile.depend1
-rw-r--r--secure/lib/libssh/Makefile.depend1
-rw-r--r--secure/lib/libssl/Makefile.depend1
-rw-r--r--share/colldef/Makefile.depend1
-rw-r--r--share/ctypedef/Makefile.depend (renamed from usr.bin/xinstall/Makefile.depend.host)3
-rwxr-xr-xshare/dtrace/retval42
-rw-r--r--share/man/man4/aue.43
-rw-r--r--share/man/man4/axe.43
-rw-r--r--share/man/man4/axge.43
-rw-r--r--share/man/man4/cdce.44
-rw-r--r--share/man/man4/cue.44
-rw-r--r--share/man/man4/ipheth.44
-rw-r--r--share/man/man4/kue.44
-rw-r--r--share/man/man4/mos.43
-rw-r--r--share/man/man4/rue.43
-rw-r--r--share/man/man4/smsc.43
-rw-r--r--share/man/man4/udav.43
-rw-r--r--share/man/man4/urndis.44
-rw-r--r--share/mk/bsd.libnames.mk2
-rw-r--r--share/mk/bsd.own.mk13
-rw-r--r--share/mk/bsd.progs.mk5
-rw-r--r--share/mk/local.dirdeps.mk21
-rw-r--r--share/mk/local.gendirdeps.mk11
-rw-r--r--share/mk/local.init.mk15
-rw-r--r--share/mk/local.meta.sys.mk7
-rw-r--r--share/mk/local.sys.mk1
-rw-r--r--share/mk/meta.autodep.mk7
-rw-r--r--share/mk/src.libnames.mk67
-rw-r--r--share/mk/sys.mk10
-rw-r--r--share/monetdef/Makefile.depend11
-rw-r--r--share/msgdef/Makefile.depend11
-rw-r--r--share/numericdef/Makefile.depend11
-rw-r--r--share/timedef/Makefile.depend11
-rw-r--r--sys/arm/arm/pmap-v6-new.c27
-rw-r--r--sys/arm/include/sf_buf.h4
-rw-r--r--sys/arm64/arm64/pmap.c27
-rw-r--r--sys/arm64/include/vmparam.h12
-rw-r--r--sys/boot/i386/boot2/Makefile4
-rw-r--r--sys/conf/NOTES2
-rw-r--r--sys/conf/files8
-rw-r--r--sys/conf/newvers.sh6
-rw-r--r--sys/conf/options1
-rw-r--r--sys/dev/ath/if_ath_rx.c10
-rw-r--r--sys/dev/isp/isp.c2
-rw-r--r--sys/dev/isp/isp_target.c2
-rw-r--r--sys/dev/isp/ispmbox.h2
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw.c137
-rw-r--r--sys/dev/ntb/ntb_hw/ntb_hw.h4
-rw-r--r--sys/dev/usb/wlan/if_urtwn.c245
-rw-r--r--sys/dev/usb/wlan/if_urtwnreg.h2
-rw-r--r--sys/dev/usb/wlan/if_urtwnvar.h9
-rw-r--r--sys/kern/kern_hhook.c3
-rw-r--r--sys/kern/vfs_subr.c316
-rw-r--r--sys/modules/Makefile2
-rw-r--r--sys/modules/if_enc/Makefile11
-rw-r--r--sys/net/if.c4
-rw-r--r--sys/net/if_enc.c428
-rw-r--r--sys/net/if_enc.h9
-rw-r--r--sys/net/if_var.h8
-rw-r--r--sys/net80211/ieee80211_ht.c4
-rw-r--r--sys/netinet/in_pcb.c11
-rw-r--r--sys/netinet/ip_input.c30
-rw-r--r--sys/netinet6/ip6_input.c30
-rw-r--r--sys/netipsec/ipsec.c30
-rw-r--r--sys/netipsec/ipsec.h17
-rw-r--r--sys/netipsec/ipsec_input.c74
-rw-r--r--sys/netipsec/ipsec_output.c61
-rw-r--r--sys/ofed/include/rdma/ib_pma.h19
-rw-r--r--sys/powerpc/aim/slb.c10
-rw-r--r--sys/powerpc/include/atomic.h35
-rw-r--r--sys/sys/hhook.h2
-rw-r--r--sys/x86/x86/identcpu.c2
-rw-r--r--targets/pseudo/bootstrap-tools/Makefile15
-rw-r--r--targets/pseudo/hosttools/Makefile.depend3
-rw-r--r--targets/pseudo/stage/Makefile4
-rw-r--r--targets/pseudo/toolchain/Makefile.depend36
-rw-r--r--targets/pseudo/userland/share/Makefile.depend1
-rw-r--r--tests/sys/kern/acct/Makefile1
-rw-r--r--tools/tools/README1
-rw-r--r--tools/tools/indent_wrapper/Makefile9
-rw-r--r--tools/tools/indent_wrapper/indent_wrapper.c746
-rw-r--r--usr.bin/awk/Makefile2
-rw-r--r--usr.bin/calendar/calendars/calendar.freebsd1
-rw-r--r--usr.bin/cpio/tests/Makefile3
-rw-r--r--usr.bin/cxxfilt/Makefile.depend20
-rw-r--r--usr.bin/kdump/Makefile3
-rw-r--r--usr.bin/localedef/Makefile.depend39
-rw-r--r--usr.bin/netstat/Makefile3
-rw-r--r--usr.bin/netstat/inet.c35
-rw-r--r--usr.bin/netstat/main.c2
-rw-r--r--usr.bin/readelf/Makefile14
-rw-r--r--usr.bin/svn/svn/Makefile2
-rw-r--r--usr.bin/tar/tests/Makefile2
-rw-r--r--usr.bin/vacation/Makefile4
-rw-r--r--usr.sbin/acpi/iasl/Makefile6
-rw-r--r--usr.sbin/amd/include/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend1
-rw-r--r--usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend1
-rw-r--r--usr.sbin/editmap/Makefile4
-rw-r--r--usr.sbin/mailstats/Makefile4
-rw-r--r--usr.sbin/makemap/Makefile4
-rw-r--r--usr.sbin/praliases/Makefile4
-rw-r--r--usr.sbin/sendmail/Makefile4
-rw-r--r--usr.sbin/syslogd/syslogd.c26
380 files changed, 2377 insertions, 1102 deletions
diff --git a/bin/rmail/Makefile b/bin/rmail/Makefile
index a74898f..421a6ff 100644
--- a/bin/rmail/Makefile
+++ b/bin/rmail/Makefile
@@ -29,7 +29,7 @@ LDFLAGS+=${SENDMAIL_LDFLAGS}
# following:
# CFLAGS+= -DQUEUE_ONLY
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/bin/sh/mknodes.c b/bin/sh/mknodes.c
index cb88301..81f42a2 100644
--- a/bin/sh/mknodes.c
+++ b/bin/sh/mknodes.c
@@ -296,10 +296,10 @@ outfunc(FILE *cfile, int calcsize)
else
fputs(" return NULL;\n", cfile);
if (calcsize)
- fputs(" funcblocksize += nodesize[n->type];\n", cfile);
+ fputs(" result->blocksize += nodesize[n->type];\n", cfile);
else {
- fputs(" new = funcblock;\n", cfile);
- fputs(" funcblock = (char *)funcblock + nodesize[n->type];\n", cfile);
+ fputs(" new = state->block;\n", cfile);
+ fputs(" state->block = (char *)state->block + nodesize[n->type];\n", cfile);
}
fputs(" switch (n->type) {\n", cfile);
for (sp = str ; sp < &str[nstr] ; sp++) {
@@ -313,33 +313,33 @@ outfunc(FILE *cfile, int calcsize)
case T_NODE:
if (calcsize) {
indent(12, cfile);
- fprintf(cfile, "calcsize(n->%s.%s);\n",
+ fprintf(cfile, "calcsize(n->%s.%s, result);\n",
sp->tag, fp->name);
} else {
indent(12, cfile);
- fprintf(cfile, "new->%s.%s = copynode(n->%s.%s);\n",
+ fprintf(cfile, "new->%s.%s = copynode(n->%s.%s, state);\n",
sp->tag, fp->name, sp->tag, fp->name);
}
break;
case T_NODELIST:
if (calcsize) {
indent(12, cfile);
- fprintf(cfile, "sizenodelist(n->%s.%s);\n",
+ fprintf(cfile, "sizenodelist(n->%s.%s, result);\n",
sp->tag, fp->name);
} else {
indent(12, cfile);
- fprintf(cfile, "new->%s.%s = copynodelist(n->%s.%s);\n",
+ fprintf(cfile, "new->%s.%s = copynodelist(n->%s.%s, state);\n",
sp->tag, fp->name, sp->tag, fp->name);
}
break;
case T_STRING:
if (calcsize) {
indent(12, cfile);
- fprintf(cfile, "funcstringsize += strlen(n->%s.%s) + 1;\n",
+ fprintf(cfile, "result->stringsize += strlen(n->%s.%s) + 1;\n",
sp->tag, fp->name);
} else {
indent(12, cfile);
- fprintf(cfile, "new->%s.%s = nodesavestr(n->%s.%s);\n",
+ fprintf(cfile, "new->%s.%s = nodesavestr(n->%s.%s, state);\n",
sp->tag, fp->name, sp->tag, fp->name);
}
break;
diff --git a/bin/sh/nodes.c.pat b/bin/sh/nodes.c.pat
index e99e3ab..cefe730 100644
--- a/bin/sh/nodes.c.pat
+++ b/bin/sh/nodes.c.pat
@@ -46,19 +46,24 @@
#include "mystring.h"
-static int funcblocksize; /* size of structures in function */
-static int funcstringsize; /* size of strings in node */
-static pointer funcblock; /* block to allocate function from */
-static char *funcstring; /* block to allocate strings from */
+struct nodesize {
+ int blocksize; /* size of structures in function */
+ int stringsize; /* size of strings in node */
+};
+
+struct nodecopystate {
+ pointer block; /* block to allocate function from */
+ char *string; /* block to allocate strings from */
+};
%SIZES
-static void calcsize(union node *);
-static void sizenodelist(struct nodelist *);
-static union node *copynode(union node *);
-static struct nodelist *copynodelist(struct nodelist *);
-static char *nodesavestr(const char *);
+static void calcsize(union node *, struct nodesize *);
+static void sizenodelist(struct nodelist *, struct nodesize *);
+static union node *copynode(union node *, struct nodecopystate *);
+static struct nodelist *copynodelist(struct nodelist *, struct nodecopystate *);
+static char *nodesavestr(const char *, struct nodecopystate *);
struct funcdef {
@@ -73,18 +78,20 @@ struct funcdef {
struct funcdef *
copyfunc(union node *n)
{
+ struct nodesize sz;
+ struct nodecopystate st;
struct funcdef *fn;
if (n == NULL)
return NULL;
- funcblocksize = offsetof(struct funcdef, n);
- funcstringsize = 0;
- calcsize(n);
- fn = ckmalloc(funcblocksize + funcstringsize);
+ sz.blocksize = offsetof(struct funcdef, n);
+ sz.stringsize = 0;
+ calcsize(n, &sz);
+ fn = ckmalloc(sz.blocksize + sz.stringsize);
fn->refcount = 1;
- funcblock = (char *)fn + offsetof(struct funcdef, n);
- funcstring = (char *)fn + funcblocksize;
- copynode(n);
+ st.block = (char *)fn + offsetof(struct funcdef, n);
+ st.string = (char *)fn + sz.blocksize;
+ copynode(n, &st);
return fn;
}
@@ -97,7 +104,7 @@ getfuncnode(struct funcdef *fn)
static void
-calcsize(union node *n)
+calcsize(union node *n, struct nodesize *result)
{
%CALCSIZE
}
@@ -105,11 +112,11 @@ calcsize(union node *n)
static void
-sizenodelist(struct nodelist *lp)
+sizenodelist(struct nodelist *lp, struct nodesize *result)
{
while (lp) {
- funcblocksize += ALIGN(sizeof(struct nodelist));
- calcsize(lp->n);
+ result->blocksize += ALIGN(sizeof(struct nodelist));
+ calcsize(lp->n, result);
lp = lp->next;
}
}
@@ -117,7 +124,7 @@ sizenodelist(struct nodelist *lp)
static union node *
-copynode(union node *n)
+copynode(union node *n, struct nodecopystate *state)
{
union node *new;
@@ -127,16 +134,17 @@ copynode(union node *n)
static struct nodelist *
-copynodelist(struct nodelist *lp)
+copynodelist(struct nodelist *lp, struct nodecopystate *state)
{
struct nodelist *start;
struct nodelist **lpp;
lpp = &start;
while (lp) {
- *lpp = funcblock;
- funcblock = (char *)funcblock + ALIGN(sizeof(struct nodelist));
- (*lpp)->n = copynode(lp->n);
+ *lpp = state->block;
+ state->block = (char *)state->block +
+ ALIGN(sizeof(struct nodelist));
+ (*lpp)->n = copynode(lp->n, state);
lp = lp->next;
lpp = &(*lpp)->next;
}
@@ -147,15 +155,15 @@ copynodelist(struct nodelist *lp)
static char *
-nodesavestr(const char *s)
+nodesavestr(const char *s, struct nodecopystate *state)
{
const char *p = s;
- char *q = funcstring;
- char *rtn = funcstring;
+ char *q = state->string;
+ char *rtn = state->string;
while ((*q++ = *p++) != '\0')
continue;
- funcstring = q;
+ state->string = q;
return rtn;
}
diff --git a/cddl/lib/libavl/Makefile.depend b/cddl/lib/libavl/Makefile.depend
index 3699b06..9cb890b 100644
--- a/cddl/lib/libavl/Makefile.depend
+++ b/cddl/lib/libavl/Makefile.depend
@@ -8,7 +8,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libctf/Makefile.depend b/cddl/lib/libctf/Makefile.depend
index 4b536f7..ff9d795 100644
--- a/cddl/lib/libctf/Makefile.depend
+++ b/cddl/lib/libctf/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libelf \
lib/libz \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libdtrace/Makefile.depend b/cddl/lib/libdtrace/Makefile.depend
index 124d5c7..50ab52c 100644
--- a/cddl/lib/libdtrace/Makefile.depend
+++ b/cddl/lib/libdtrace/Makefile.depend
@@ -15,7 +15,6 @@ DIRDEPS = \
lib/libproc \
lib/librtld_db \
lib/libthr \
- usr.bin/xinstall.host \
usr.bin/yacc.host \
diff --git a/cddl/lib/libnvpair/Makefile.depend b/cddl/lib/libnvpair/Makefile.depend
index 3dce64a..c9f9d52 100644
--- a/cddl/lib/libnvpair/Makefile.depend
+++ b/cddl/lib/libnvpair/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libumem/Makefile.depend b/cddl/lib/libumem/Makefile.depend
index 3699b06..9cb890b 100644
--- a/cddl/lib/libumem/Makefile.depend
+++ b/cddl/lib/libumem/Makefile.depend
@@ -8,7 +8,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libuutil/Makefile.depend b/cddl/lib/libuutil/Makefile.depend
index dde2d60..3646e2e 100644
--- a/cddl/lib/libuutil/Makefile.depend
+++ b/cddl/lib/libuutil/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libzfs/Makefile.depend b/cddl/lib/libzfs/Makefile.depend
index 8c2b34b..be130df 100644
--- a/cddl/lib/libzfs/Makefile.depend
+++ b/cddl/lib/libzfs/Makefile.depend
@@ -20,7 +20,6 @@ DIRDEPS = \
lib/libthr \
lib/libutil \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libzfs_core/Makefile.depend b/cddl/lib/libzfs_core/Makefile.depend
index 9e7fae2..86e045f 100644
--- a/cddl/lib/libzfs_core/Makefile.depend
+++ b/cddl/lib/libzfs_core/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/lib/libzpool/Makefile.depend b/cddl/lib/libzpool/Makefile.depend
index cb67e22..c91de43 100644
--- a/cddl/lib/libzpool/Makefile.depend
+++ b/cddl/lib/libzpool/Makefile.depend
@@ -16,7 +16,6 @@ DIRDEPS = \
lib/libthr \
lib/libz \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile b/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile
index d8a5ef0..2458192 100644
--- a/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/aggs/Makefile
@@ -186,4 +186,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile b/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile
index 7f1fa96..f8f74f2 100644
--- a/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/arithmetic/Makefile
@@ -29,4 +29,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile b/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile
index 608388f..0e1cfe1 100644
--- a/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/arrays/Makefile
@@ -26,4 +26,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile b/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile
index 5d20b61..800dd88 100644
--- a/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/assocs/Makefile
@@ -29,4 +29,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/begin/Makefile b/cddl/usr.sbin/dtrace/tests/common/begin/Makefile
index 4437db9..1572a84 100644
--- a/cddl/usr.sbin/dtrace/tests/common/begin/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/begin/Makefile
@@ -19,4 +19,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile b/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile
index 838ad68..39c199b 100644
--- a/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/bitfields/Makefile
@@ -23,4 +23,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile b/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile
index 7fe869b..f5b09bf 100644
--- a/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/buffering/Makefile
@@ -34,4 +34,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile b/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile
index b955be5..a367572 100644
--- a/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/builtinvar/Makefile
@@ -45,4 +45,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/cg/Makefile b/cddl/usr.sbin/dtrace/tests/common/cg/Makefile
index 5550a8e..c6c2551 100644
--- a/cddl/usr.sbin/dtrace/tests/common/cg/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/cg/Makefile
@@ -15,4 +15,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile b/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile
index 5d582f3..ff6d01c 100644
--- a/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/clauses/Makefile
@@ -23,4 +23,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile b/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile
index ad23c5a1..c86b69a 100644
--- a/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/cpc/Makefile
@@ -24,4 +24,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/decls/Makefile b/cddl/usr.sbin/dtrace/tests/common/decls/Makefile
index 21544d9..ea5950f 100644
--- a/cddl/usr.sbin/dtrace/tests/common/decls/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/decls/Makefile
@@ -27,4 +27,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile b/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile
index 6212862..3e6ca3d 100644
--- a/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/docsExamples/Makefile
@@ -29,4 +29,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/drops/Makefile b/cddl/usr.sbin/dtrace/tests/common/drops/Makefile
index 248c201..10b1eb5 100644
--- a/cddl/usr.sbin/dtrace/tests/common/drops/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/drops/Makefile
@@ -21,4 +21,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile b/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile
index 60e6599..1ce004b 100644
--- a/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/dtraceUtil/Makefile
@@ -115,4 +115,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/end/Makefile b/cddl/usr.sbin/dtrace/tests/common/end/Makefile
index 120a0dd..951fed3 100644
--- a/cddl/usr.sbin/dtrace/tests/common/end/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/end/Makefile
@@ -18,4 +18,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/enum/Makefile b/cddl/usr.sbin/dtrace/tests/common/enum/Makefile
index ee6ab1a..3408586 100644
--- a/cddl/usr.sbin/dtrace/tests/common/enum/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/enum/Makefile
@@ -18,4 +18,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/error/Makefile b/cddl/usr.sbin/dtrace/tests/common/error/Makefile
index 999e28c..e2f8bf9 100644
--- a/cddl/usr.sbin/dtrace/tests/common/error/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/error/Makefile
@@ -18,4 +18,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/exit/Makefile b/cddl/usr.sbin/dtrace/tests/common/exit/Makefile
index d5aa843..1129e0e 100644
--- a/cddl/usr.sbin/dtrace/tests/common/exit/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/exit/Makefile
@@ -16,4 +16,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile
index a84c38d..9097def 100644
--- a/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/fbtprovider/Makefile
@@ -23,4 +23,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile b/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile
index 4a76912..b5a3035 100644
--- a/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/funcs/Makefile
@@ -110,4 +110,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile b/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile
index e1854ae..af5b19b 100644
--- a/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/grammar/Makefile
@@ -17,4 +17,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/include/Makefile b/cddl/usr.sbin/dtrace/tests/common/include/Makefile
index b5002e9..a081ac1 100644
--- a/cddl/usr.sbin/dtrace/tests/common/include/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/include/Makefile
@@ -14,4 +14,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/inline/Makefile b/cddl/usr.sbin/dtrace/tests/common/inline/Makefile
index 7f848fd..db5fa63 100644
--- a/cddl/usr.sbin/dtrace/tests/common/inline/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/inline/Makefile
@@ -25,4 +25,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/io/Makefile b/cddl/usr.sbin/dtrace/tests/common/io/Makefile
index ad62351..15a37f1 100644
--- a/cddl/usr.sbin/dtrace/tests/common/io/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/io/Makefile
@@ -15,4 +15,4 @@ CFILES= \
tst.fds.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/ip/Makefile b/cddl/usr.sbin/dtrace/tests/common/ip/Makefile
index 369068a..0aa648b 100644
--- a/cddl/usr.sbin/dtrace/tests/common/ip/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/ip/Makefile
@@ -33,4 +33,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile b/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile
index 4ef225a..6778902 100644
--- a/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/java_api/Makefile
@@ -41,4 +41,4 @@ CFILES= \
tst.ProbeData.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/json/Makefile b/cddl/usr.sbin/dtrace/tests/common/json/Makefile
index 160fcae..b380f0f 100644
--- a/cddl/usr.sbin/dtrace/tests/common/json/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/json/Makefile
@@ -20,4 +20,4 @@ CFILES= \
tst.usdt.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile b/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile
index 39063e4..5832493 100644
--- a/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/lexer/Makefile
@@ -27,4 +27,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile
index 1f33e8a..cf9bbc9 100644
--- a/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/llquantize/Makefile
@@ -47,4 +47,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile b/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile
index 24a3f88..8102c7b 100644
--- a/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/mdb/Makefile
@@ -14,4 +14,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/mib/Makefile b/cddl/usr.sbin/dtrace/tests/common/mib/Makefile
index ef3a05d..862ddfc 100644
--- a/cddl/usr.sbin/dtrace/tests/common/mib/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/mib/Makefile
@@ -16,4 +16,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/misc/Makefile b/cddl/usr.sbin/dtrace/tests/common/misc/Makefile
index 31de20b..2e2e017 100644
--- a/cddl/usr.sbin/dtrace/tests/common/misc/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/misc/Makefile
@@ -27,4 +27,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile b/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile
index e21c90a..22ae12a 100644
--- a/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/multiaggs/Makefile
@@ -31,4 +31,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile b/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile
index 446c35e..4c76583 100644
--- a/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/nfs/Makefile
@@ -16,4 +16,4 @@ CFILES= \
tst.call3.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile b/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile
index 375aecb..204742f 100644
--- a/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/offsetof/Makefile
@@ -25,4 +25,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/operators/Makefile b/cddl/usr.sbin/dtrace/tests/common/operators/Makefile
index 08bbfe6..08fdf26 100644
--- a/cddl/usr.sbin/dtrace/tests/common/operators/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/operators/Makefile
@@ -15,4 +15,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/pid/Makefile b/cddl/usr.sbin/dtrace/tests/common/pid/Makefile
index faa5ac8..5228ae3 100644
--- a/cddl/usr.sbin/dtrace/tests/common/pid/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/pid/Makefile
@@ -66,4 +66,4 @@ CFILES= \
tst.weak2.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile b/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile
index 0f36f34..a376358 100644
--- a/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/plockstat/Makefile
@@ -16,4 +16,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile b/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile
index 2953c54..37e1383 100644
--- a/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/pointers/Makefile
@@ -45,4 +45,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile b/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile
index 86010ac..a595111 100644
--- a/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/pragma/Makefile
@@ -27,4 +27,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile b/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile
index 67cfabe..267f417 100644
--- a/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/predicates/Makefile
@@ -22,4 +22,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile b/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile
index 8108375..3685edf 100644
--- a/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/preprocessor/Makefile
@@ -50,4 +50,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/print/Makefile b/cddl/usr.sbin/dtrace/tests/common/print/Makefile
index 4360794..60d80ad 100644
--- a/cddl/usr.sbin/dtrace/tests/common/print/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/print/Makefile
@@ -29,4 +29,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/printa/Makefile b/cddl/usr.sbin/dtrace/tests/common/printa/Makefile
index c972db3..2404aa9 100644
--- a/cddl/usr.sbin/dtrace/tests/common/printa/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/printa/Makefile
@@ -37,4 +37,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/printf/Makefile b/cddl/usr.sbin/dtrace/tests/common/printf/Makefile
index d4658b1..bda4ecf 100644
--- a/cddl/usr.sbin/dtrace/tests/common/printf/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/printf/Makefile
@@ -65,4 +65,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/privs/Makefile b/cddl/usr.sbin/dtrace/tests/common/privs/Makefile
index 02cd83b..858c53d 100644
--- a/cddl/usr.sbin/dtrace/tests/common/privs/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/privs/Makefile
@@ -21,4 +21,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/probes/Makefile b/cddl/usr.sbin/dtrace/tests/common/probes/Makefile
index 463290b..219973a 100644
--- a/cddl/usr.sbin/dtrace/tests/common/probes/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/probes/Makefile
@@ -33,4 +33,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
index 5ab672b..596474c 100644
--- a/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/proc/Makefile
@@ -27,4 +27,4 @@ CFILES= \
LDADD.tst.sigwait.exe+= -lrt
DPADD.tst.sigwait.exe+= ${LIBRT}
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile b/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile
index cb6ad9f..5065fe3 100644
--- a/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/profile-n/Makefile
@@ -50,4 +50,4 @@ CFILES= \
tst.ufuncsort.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/providers/Makefile b/cddl/usr.sbin/dtrace/tests/common/providers/Makefile
index 763d60b..650818c 100644
--- a/cddl/usr.sbin/dtrace/tests/common/providers/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/providers/Makefile
@@ -41,4 +41,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/raise/Makefile b/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
index f84ac52..2914199 100644
--- a/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/raise/Makefile
@@ -18,4 +18,4 @@ CFILES= \
tst.raise3.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/rates/Makefile b/cddl/usr.sbin/dtrace/tests/common/rates/Makefile
index a3f54f5..6371e74 100644
--- a/cddl/usr.sbin/dtrace/tests/common/rates/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/rates/Makefile
@@ -18,4 +18,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/safety/Makefile b/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
index 0e88ea3..1760f82 100644
--- a/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/safety/Makefile
@@ -51,4 +51,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile b/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile
index 2f471a6..ece7045 100644
--- a/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/scalars/Makefile
@@ -34,4 +34,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/sched/Makefile b/cddl/usr.sbin/dtrace/tests/common/sched/Makefile
index adf8c98..5cdca4e 100644
--- a/cddl/usr.sbin/dtrace/tests/common/sched/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/sched/Makefile
@@ -16,4 +16,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile b/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile
index 0bb10cf..9e52a5d 100644
--- a/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/scripting/Makefile
@@ -46,4 +46,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile b/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile
index 598cc69..c52c9c9 100644
--- a/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/sdt/Makefile
@@ -14,4 +14,4 @@ CFILES= \
tst.sdtargs.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile b/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile
index 6b146b0..df0d68b 100644
--- a/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/sizeof/Makefile
@@ -28,4 +28,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile b/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile
index f17ded9..c7193c2 100644
--- a/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/speculation/Makefile
@@ -72,4 +72,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/stability/Makefile b/cddl/usr.sbin/dtrace/tests/common/stability/Makefile
index 8fb9afa..939bf65 100644
--- a/cddl/usr.sbin/dtrace/tests/common/stability/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/stability/Makefile
@@ -14,4 +14,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/stack/Makefile b/cddl/usr.sbin/dtrace/tests/common/stack/Makefile
index ca01f42..5a01e94 100644
--- a/cddl/usr.sbin/dtrace/tests/common/stack/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/stack/Makefile
@@ -19,4 +19,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile b/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile
index 8e94963..4b8f342 100644
--- a/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/stackdepth/Makefile
@@ -14,4 +14,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/stop/Makefile b/cddl/usr.sbin/dtrace/tests/common/stop/Makefile
index a03d9aa..56fa9da 100644
--- a/cddl/usr.sbin/dtrace/tests/common/stop/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/stop/Makefile
@@ -16,4 +16,4 @@ CFILES= \
tst.stop2.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile b/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile
index 0fec541..af1e7d0 100644
--- a/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/strlen/Makefile
@@ -14,4 +14,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile b/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile
index 8af2d41..e614138 100644
--- a/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/strtoll/Makefile
@@ -17,4 +17,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/struct/Makefile b/cddl/usr.sbin/dtrace/tests/common/struct/Makefile
index fb039f2..0b3ce40 100644
--- a/cddl/usr.sbin/dtrace/tests/common/struct/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/struct/Makefile
@@ -28,4 +28,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile b/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile
index 035fdf0..795aeeb 100644
--- a/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/syscall/Makefile
@@ -15,4 +15,4 @@ CFILES= \
tst.args.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile b/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile
index 496360e..1d612c5 100644
--- a/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/sysevent/Makefile
@@ -16,4 +16,4 @@ CFILES= \
tst.post_chan.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile b/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile
index d843b9a..af494f9 100644
--- a/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/tick-n/Makefile
@@ -35,4 +35,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/trace/Makefile b/cddl/usr.sbin/dtrace/tests/common/trace/Makefile
index e1500f2..6f5e12e 100644
--- a/cddl/usr.sbin/dtrace/tests/common/trace/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/trace/Makefile
@@ -21,4 +21,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile b/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile
index 5ba7b6f..67afa84 100644
--- a/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/tracemem/Makefile
@@ -23,4 +23,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/translators/Makefile b/cddl/usr.sbin/dtrace/tests/common/translators/Makefile
index 4d57edf..3722bf7 100644
--- a/cddl/usr.sbin/dtrace/tests/common/translators/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/translators/Makefile
@@ -48,4 +48,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile b/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile
index 477fd74..dbc1f52 100644
--- a/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/typedef/Makefile
@@ -18,4 +18,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/types/Makefile b/cddl/usr.sbin/dtrace/tests/common/types/Makefile
index 1a3d326..7c65283 100644
--- a/cddl/usr.sbin/dtrace/tests/common/types/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/types/Makefile
@@ -66,4 +66,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile b/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile
index 493d550..2746072 100644
--- a/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/uctf/Makefile
@@ -38,4 +38,4 @@ CFILES= \
WITH_CTF=YES
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/union/Makefile b/cddl/usr.sbin/dtrace/tests/common/union/Makefile
index 69e0ca8..bf3a283 100644
--- a/cddl/usr.sbin/dtrace/tests/common/union/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/union/Makefile
@@ -24,4 +24,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile b/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile
index f6fa49b..717d0c6 100644
--- a/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/usdt/Makefile
@@ -62,4 +62,4 @@ CFILES= \
tst.forker.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile b/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile
index 960c407..5acdf6d 100644
--- a/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/ustack/Makefile
@@ -17,4 +17,4 @@ CFILES= \
tst.spin.c \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/vars/Makefile b/cddl/usr.sbin/dtrace/tests/common/vars/Makefile
index 5b47557..a08a3ce 100644
--- a/cddl/usr.sbin/dtrace/tests/common/vars/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/vars/Makefile
@@ -20,4 +20,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/common/version/Makefile b/cddl/usr.sbin/dtrace/tests/common/version/Makefile
index 0491cea..6c9da25 100644
--- a/cddl/usr.sbin/dtrace/tests/common/version/Makefile
+++ b/cddl/usr.sbin/dtrace/tests/common/version/Makefile
@@ -14,4 +14,4 @@ CFILES= \
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
diff --git a/cddl/usr.sbin/dtrace/tests/Makefile.inc1 b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
index 0c528ef..0c528ef 100644
--- a/cddl/usr.sbin/dtrace/tests/Makefile.inc1
+++ b/cddl/usr.sbin/dtrace/tests/dtrace.test.mk
diff --git a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
index bf0e181..ec3ad24 100755
--- a/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
+++ b/cddl/usr.sbin/dtrace/tests/tools/genmakefiles.sh
@@ -63,7 +63,7 @@ CFILES= \\
$tcfiles
$special
-.include "../../Makefile.inc1"
+.include "../../dtrace.test.mk"
__EOF__
mv -f $makefile ${ORIGINDIR}/../common/${basedir}/Makefile
diff --git a/contrib/bmake/parse.c b/contrib/bmake/parse.c
index 1718470..71735cb 100644
--- a/contrib/bmake/parse.c
+++ b/contrib/bmake/parse.c
@@ -2390,15 +2390,19 @@ static void
ParseTrackInput(const char *name)
{
char *old;
+ char *ep;
char *fp = NULL;
size_t name_len = strlen(name);
old = Var_Value(MAKE_MAKEFILES, VAR_GLOBAL, &fp);
if (old) {
+ ep = old + strlen(old) - name_len;
/* does it contain name? */
for (; old != NULL; old = strchr(old, ' ')) {
if (*old == ' ')
old++;
+ if (old >= ep)
+ break; /* cannot contain name */
if (memcmp(old, name, name_len) == 0
&& (old[name_len] == 0 || old[name_len] == ' '))
goto cleanup;
diff --git a/crypto/openssh/sshd_config b/crypto/openssh/sshd_config
index d5588e2..9a4b9c2 100644
--- a/crypto/openssh/sshd_config
+++ b/crypto/openssh/sshd_config
@@ -137,9 +137,6 @@ Subsystem sftp /usr/libexec/sftp-server
# TCP receive socket buffer polling for HPN. Disable on non autotuning kernels.
#TcpRcvBufPoll yes
-# Allow the use of the NONE cipher.
-#NoneEnabled no
-
# Example of overriding settings on a per-user basis
#Match User anoncvs
# X11Forwarding no
diff --git a/gnu/lib/libdialog/Makefile.depend b/gnu/lib/libdialog/Makefile.depend
index 1c00d92..8b0f9a7 100644
--- a/gnu/lib/libdialog/Makefile.depend
+++ b/gnu/lib/libdialog/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/msun \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/lib/libgcc/Makefile.depend b/gnu/lib/libgcc/Makefile.depend
index 6dd413b..ce72494 100644
--- a/gnu/lib/libgcc/Makefile.depend
+++ b/gnu/lib/libgcc/Makefile.depend
@@ -7,7 +7,6 @@ DIRDEPS = \
include/xlocale \
lib/${CSU_DIR} \
lib/libc \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/lib/libgomp/Makefile.depend b/gnu/lib/libgomp/Makefile.depend
index d8c89db..fd53a3f 100644
--- a/gnu/lib/libgomp/Makefile.depend
+++ b/gnu/lib/libgomp/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/lib/libreadline/readline/Makefile b/gnu/lib/libreadline/readline/Makefile
index a16d216..17c84ae 100644
--- a/gnu/lib/libreadline/readline/Makefile
+++ b/gnu/lib/libreadline/readline/Makefile
@@ -16,12 +16,11 @@ INSTALLED_HEADERS= readline.h chardefs.h keymaps.h history.h tilde.h \
CFLAGS+= -I${.OBJDIR}/..
SRCDIR= ${.CURDIR}/../../../../contrib/libreadline
-beforebuild: ${INSTALLED_HEADERS}
CLEANFILES+= ${INSTALLED_HEADERS}
-DPSRCS+= ${INSTALLED_HEADERS}
+SRCS+= ${INSTALLED_HEADERS}
.for _h in ${INSTALLED_HEADERS}
-${_h}: ${SRCDIR}/${_h}
+${_h}: ${SRCDIR}/${_h} .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
.endfor
diff --git a/gnu/lib/libregex/Makefile.depend b/gnu/lib/libregex/Makefile.depend
index 1eb05a0..2defba8 100644
--- a/gnu/lib/libregex/Makefile.depend
+++ b/gnu/lib/libregex/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile
index d55b67e..27f3236 100644
--- a/gnu/lib/libstdc++/Makefile
+++ b/gnu/lib/libstdc++/Makefile
@@ -88,7 +88,7 @@ ATOMICITY_H= ${SRCDIR}/config/cpu/generic/atomicity_builtins/atomicity.h
.endif
.endif
-atomicity.cc: ${ATOMICITY_H}
+atomicity.cc: ${ATOMICITY_H} .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
CLEANFILES+= atomicity.cc
@@ -599,7 +599,7 @@ unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
unwind.h: ${GCCDIR}/unwind-generic.h
.endif
-unwind.h:
+unwind.h: .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
SRCS+= unwind.h
@@ -624,7 +624,7 @@ CLEANFILES+= c++config.h
VERSION_MAP= libstdc++.map
-${VERSION_MAP}: ${SRCDIR}/config/abi/pre/gnu.ver
+${VERSION_MAP}: ${SRCDIR}/config/abi/pre/gnu.ver .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
CLEANFILES+= ${VERSION_MAP}
diff --git a/gnu/lib/libstdc++/Makefile.depend b/gnu/lib/libstdc++/Makefile.depend
index 760b9b8..0e1a73c 100644
--- a/gnu/lib/libstdc++/Makefile.depend
+++ b/gnu/lib/libstdc++/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/lib/libsupc++/Makefile b/gnu/lib/libsupc++/Makefile
index 0531a73..b78e9d8 100644
--- a/gnu/lib/libsupc++/Makefile
+++ b/gnu/lib/libsupc++/Makefile
@@ -38,7 +38,7 @@ unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
unwind.h: ${GCCDIR}/unwind-generic.h
.endif
-unwind.h:
+unwind.h: .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
SRCS+= unwind.h
diff --git a/gnu/lib/libsupc++/Makefile.depend b/gnu/lib/libsupc++/Makefile.depend
index 2ffe3c4..5584517 100644
--- a/gnu/lib/libsupc++/Makefile.depend
+++ b/gnu/lib/libsupc++/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/gnu/usr.bin/binutils/ld/Makefile b/gnu/usr.bin/binutils/ld/Makefile
index 2b293ec..40dd7e2 100644
--- a/gnu/usr.bin/binutils/ld/Makefile
+++ b/gnu/usr.bin/binutils/ld/Makefile
@@ -67,8 +67,8 @@ ldemul-list.h:
echo "${EMXFR}" > ${.TARGET}
echo "#define EMULATION_LIST ${EMLST} 0" >> ${.TARGET}
-stringify.sed:
- ln -sf ${SRCDIR}/ld/emultempl/astring.sed ${.TARGET}
+stringify.sed: ${SRCDIR}/ld/emultempl/astring.sed .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
GENDIRDEPS_FILTER.host+= Nusr.bin/yacc
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile
index f451171..f645453 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile
+++ b/gnu/usr.bin/cc/cc_tools/Makefile
@@ -346,7 +346,7 @@ gstdint.h:
GENSRCS+= gstdint.h
# Linked headers
-gthr-default.h: ${GCCDIR}/gthr-posix.h
+gthr-default.h: ${GCCDIR}/gthr-posix.h .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
GENSRCS+= gthr-default.h
@@ -357,7 +357,7 @@ unwind.h: ${GCCDIR}/config/arm/unwind-arm.h
unwind.h: ${GCCDIR}/unwind-generic.h
.endif
-unwind.h:
+unwind.h: .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
GENSRCS+= unwind.h
diff --git a/include/Makefile b/include/Makefile
index d59900f..332b661 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -5,7 +5,7 @@
.include <src.opts.mk>
-CLEANFILES= osreldate.h version vers.c
+CLEANFILES= osreldate.h version
SUBDIR= arpa protocols rpcsvc rpc xlocale
SUBDIR_PARALLEL=
INCS= a.out.h ar.h assert.h bitstring.h complex.h cpio.h _ctype.h ctype.h \
@@ -104,12 +104,8 @@ NEWVERS_SH= ${SYSDIR}/conf/newvers.sh
PARAM_H= ${SYSDIR}/sys/param.h
MK_OSRELDATE_SH= ${.CURDIR}/mk-osreldate.sh
-osreldate.h vers.c: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
- env ECHO="${ECHO}" \
- MAKE="${MAKE}" \
- NEWVERS_SH=${NEWVERS_SH} \
- PARAM_H=${PARAM_H} \
- SYSDIR=${SYSDIR} \
+osreldate.h: ${NEWVERS_SH} ${PARAM_H} ${MK_OSRELDATE_SH}
+ env NEWVERS_SH=${NEWVERS_SH} PARAMFILE=${PARAM_H} SYSDIR=${SYSDIR} \
sh ${MK_OSRELDATE_SH}
.for i in ${LHDRS}
diff --git a/include/mk-osreldate.sh b/include/mk-osreldate.sh
index ed8311c..e9c6772 100755
--- a/include/mk-osreldate.sh
+++ b/include/mk-osreldate.sh
@@ -35,8 +35,8 @@ trap "rm -f $tmpfile" EXIT
${ECHO} creating osreldate.h from newvers.sh
-export PARAMFILE="${PARAM_H:=$CURDIR/../sys/sys/param.h}"
set +e
+VARS_ONLY=1
. "${NEWVERS_SH:=$CURDIR/../sys/conf/newvers.sh}" || exit 1
set -e
cat > $tmpfile <<EOF
diff --git a/kerberos5/lib/libasn1/Makefile.depend b/kerberos5/lib/libasn1/Makefile.depend
index 2b73dcd..b944759 100644
--- a/kerberos5/lib/libasn1/Makefile.depend
+++ b/kerberos5/lib/libasn1/Makefile.depend
@@ -12,7 +12,6 @@ DIRDEPS = \
lib/libc \
lib/libcom_err \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libgssapi_krb5/Makefile.depend b/kerberos5/lib/libgssapi_krb5/Makefile.depend
index f265a8d..e37825c 100644
--- a/kerberos5/lib/libgssapi_krb5/Makefile.depend
+++ b/kerberos5/lib/libgssapi_krb5/Makefile.depend
@@ -20,7 +20,6 @@ DIRDEPS = \
lib/libgssapi \
lib/libthr \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libgssapi_ntlm/Makefile.depend b/kerberos5/lib/libgssapi_ntlm/Makefile.depend
index ded534a..db48cf0 100644
--- a/kerberos5/lib/libgssapi_ntlm/Makefile.depend
+++ b/kerberos5/lib/libgssapi_ntlm/Makefile.depend
@@ -17,7 +17,6 @@ DIRDEPS = \
lib/libgssapi \
lib/libthr \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libgssapi_spnego/Makefile.depend b/kerberos5/lib/libgssapi_spnego/Makefile.depend
index ba78e76..43eaf3d 100644
--- a/kerberos5/lib/libgssapi_spnego/Makefile.depend
+++ b/kerberos5/lib/libgssapi_spnego/Makefile.depend
@@ -15,7 +15,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libgssapi \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libhdb/Makefile.depend b/kerberos5/lib/libhdb/Makefile.depend
index 04a35d3..38020be 100644
--- a/kerberos5/lib/libhdb/Makefile.depend
+++ b/kerberos5/lib/libhdb/Makefile.depend
@@ -20,7 +20,6 @@ DIRDEPS = \
lib/libsqlite3 \
lib/libthr \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libheimbase/Makefile.depend b/kerberos5/lib/libheimbase/Makefile.depend
index 0a2f351..7b92dbd 100644
--- a/kerberos5/lib/libheimbase/Makefile.depend
+++ b/kerberos5/lib/libheimbase/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libheimipcc/Makefile.depend b/kerberos5/lib/libheimipcc/Makefile.depend
index f59f10f..78a2d56 100644
--- a/kerberos5/lib/libheimipcc/Makefile.depend
+++ b/kerberos5/lib/libheimipcc/Makefile.depend
@@ -14,7 +14,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libheimipcs/Makefile.depend b/kerberos5/lib/libheimipcs/Makefile.depend
index a9a0d8d..38b9ffd 100644
--- a/kerberos5/lib/libheimipcs/Makefile.depend
+++ b/kerberos5/lib/libheimipcs/Makefile.depend
@@ -15,7 +15,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libheimntlm/Makefile.depend b/kerberos5/lib/libheimntlm/Makefile.depend
index 7959ad5..ff20bce 100644
--- a/kerberos5/lib/libheimntlm/Makefile.depend
+++ b/kerberos5/lib/libheimntlm/Makefile.depend
@@ -16,7 +16,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libthr \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libhx509/Makefile.depend b/kerberos5/lib/libhx509/Makefile.depend
index d737a69..c422d17 100644
--- a/kerberos5/lib/libhx509/Makefile.depend
+++ b/kerberos5/lib/libhx509/Makefile.depend
@@ -15,7 +15,6 @@ DIRDEPS = \
lib/libcom_err \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
usr.bin/yacc.host \
diff --git a/kerberos5/lib/libkadm5clnt/Makefile.depend b/kerberos5/lib/libkadm5clnt/Makefile.depend
index 2988689..8b5c57d 100644
--- a/kerberos5/lib/libkadm5clnt/Makefile.depend
+++ b/kerberos5/lib/libkadm5clnt/Makefile.depend
@@ -16,7 +16,6 @@ DIRDEPS = \
lib/libcom_err \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libkadm5srv/Makefile.depend b/kerberos5/lib/libkadm5srv/Makefile.depend
index 15a0788..bf42cd8 100644
--- a/kerberos5/lib/libkadm5srv/Makefile.depend
+++ b/kerberos5/lib/libkadm5srv/Makefile.depend
@@ -16,7 +16,6 @@ DIRDEPS = \
lib/libcom_err \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libkafs5/Makefile.depend b/kerberos5/lib/libkafs5/Makefile.depend
index 8f9723c..e8bb93c 100644
--- a/kerberos5/lib/libkafs5/Makefile.depend
+++ b/kerberos5/lib/libkafs5/Makefile.depend
@@ -15,7 +15,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libthr \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libkdc/Makefile.depend b/kerberos5/lib/libkdc/Makefile.depend
index 0f4b829..2f174fa 100644
--- a/kerberos5/lib/libkdc/Makefile.depend
+++ b/kerberos5/lib/libkdc/Makefile.depend
@@ -22,7 +22,6 @@ DIRDEPS = \
lib/libthr \
lib/libutil \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libkrb5/Makefile.depend b/kerberos5/lib/libkrb5/Makefile.depend
index edf6cf8..0adc7b6 100644
--- a/kerberos5/lib/libkrb5/Makefile.depend
+++ b/kerberos5/lib/libkrb5/Makefile.depend
@@ -19,7 +19,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libcrypt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libroken/Makefile.depend b/kerberos5/lib/libroken/Makefile.depend
index 102ac86..e280c94 100644
--- a/kerberos5/lib/libroken/Makefile.depend
+++ b/kerberos5/lib/libroken/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libcrypt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/kerberos5/lib/libwind/Makefile.depend b/kerberos5/lib/libwind/Makefile.depend
index 6ed1a57..87bc4c1 100644
--- a/kerberos5/lib/libwind/Makefile.depend
+++ b/kerberos5/lib/libwind/Makefile.depend
@@ -12,7 +12,6 @@ DIRDEPS = \
lib/libc \
lib/libcom_err \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/atf/libatf-c++/Makefile.depend b/lib/atf/libatf-c++/Makefile.depend
index 5de4727..4cca715 100644
--- a/lib/atf/libatf-c++/Makefile.depend
+++ b/lib/atf/libatf-c++/Makefile.depend
@@ -13,7 +13,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libcxxrt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/atf/libatf-c/Makefile.depend b/lib/atf/libatf-c/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/atf/libatf-c/Makefile.depend
+++ b/lib/atf/libatf-c/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index 0c564a5..735e5b9 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -256,7 +256,6 @@ Checkers.inc.h: ${CLANG_SRCS}/lib/StaticAnalyzer/Checkers/Checkers.td
.endif
SRCS+= ${TGHDRS:C/$/.inc.h/}
-DPSRCS+= ${TGHDRS:C/$/.inc.h/}
CLEANFILES+= ${TGHDRS:C/$/.inc.h/} ${TGHDRS:C/$/.inc.d/}
# if we are not doing explicit 'make depend', there is
diff --git a/lib/libalias/libalias/Makefile.depend b/lib/libalias/libalias/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libalias/libalias/Makefile.depend
+++ b/lib/libalias/libalias/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libarchive/Makefile.depend b/lib/libarchive/Makefile.depend
index b254993..1d68a5a 100644
--- a/lib/libarchive/Makefile.depend
+++ b/lib/libarchive/Makefile.depend
@@ -14,7 +14,6 @@ DIRDEPS = \
lib/liblzma \
lib/libz \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libarchive/tests/Makefile b/lib/libarchive/tests/Makefile
index bf225b6..a7de76b 100644
--- a/lib/libarchive/tests/Makefile
+++ b/lib/libarchive/tests/Makefile
@@ -244,9 +244,7 @@ BROKEN_TESTS+= test_fuzz_rar
SRCS.libarchive_test= \
${TESTS_SRCS} \
main.c \
- read_open_memory.c
-
-DPSRCS.libarchive_test= \
+ read_open_memory.c \
list.h
LIBADD.libarchive_test= archive
diff --git a/lib/libauditd/Makefile.depend b/lib/libauditd/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libauditd/Makefile.depend
+++ b/lib/libauditd/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libbegemot/Makefile.depend b/lib/libbegemot/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libbegemot/Makefile.depend
+++ b/lib/libbegemot/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libblocksruntime/Makefile.depend b/lib/libblocksruntime/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libblocksruntime/Makefile.depend
+++ b/lib/libblocksruntime/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libbluetooth/Makefile.depend b/lib/libbluetooth/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libbluetooth/Makefile.depend
+++ b/lib/libbluetooth/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libbsm/Makefile.depend b/lib/libbsm/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libbsm/Makefile.depend
+++ b/lib/libbsm/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libbsnmp/libbsnmp/Makefile.depend b/lib/libbsnmp/libbsnmp/Makefile.depend
index 5781764..fc0b633 100644
--- a/lib/libbsnmp/libbsnmp/Makefile.depend
+++ b/lib/libbsnmp/libbsnmp/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libbz2/Makefile.depend b/lib/libbz2/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libbz2/Makefile.depend
+++ b/lib/libbz2/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libc++/Makefile b/lib/libc++/Makefile
index baa6faf..d9b0360 100644
--- a/lib/libc++/Makefile
+++ b/lib/libc++/Makefile
@@ -52,8 +52,8 @@ CXXRT_SRCS+= libelftc_dem_gnu3.c\
.for _S in ${CXXRT_SRCS}
STATICOBJS+= cxxrt_${_S:R}.o
-cxxrt_${_S}:
- ln -sf ${LIBCXXRTDIR}/${_S} ${.TARGET}
+cxxrt_${_S}: ${LIBCXXRTDIR}/${_S} .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.endfor
WARNS= 0
diff --git a/lib/libc/gdtoa/Makefile.inc b/lib/libc/gdtoa/Makefile.inc
index c46f898..e25f516 100644
--- a/lib/libc/gdtoa/Makefile.inc
+++ b/lib/libc/gdtoa/Makefile.inc
@@ -15,6 +15,6 @@ CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/gdtoa
.for src in ${GDTOASRCS}
MISRCS+=gdtoa_${src}
CLEANFILES+=gdtoa_${src}
-gdtoa_${src}:
- ln -sf ${LIBC_SRCTOP}/../../contrib/gdtoa/${src} ${.TARGET}
+gdtoa_${src}: ${LIBC_SRCTOP}/../../contrib/gdtoa/${src} .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.endfor
diff --git a/lib/libc/gen/Makefile.inc b/lib/libc/gen/Makefile.inc
index 2232b79..b448461 100644
--- a/lib/libc/gen/Makefile.inc
+++ b/lib/libc/gen/Makefile.inc
@@ -159,8 +159,8 @@ CANCELPOINTS_SRCS=sem.c sem_new.c
.for src in ${CANCELPOINTS_SRCS}
SRCS+=cancelpoints_${src}
CLEANFILES+=cancelpoints_${src}
-cancelpoints_${src}:
- ln -sf ${LIBC_SRCTOP}/gen/${src} ${.TARGET}
+cancelpoints_${src}: ${LIBC_SRCTOP}/gen/${src} .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.endfor
SYM_MAPS+=${LIBC_SRCTOP}/gen/Symbol.map
diff --git a/lib/libc/locale/Makefile.inc b/lib/libc/locale/Makefile.inc
index d28355b..a8daa1f 100644
--- a/lib/libc/locale/Makefile.inc
+++ b/lib/libc/locale/Makefile.inc
@@ -78,6 +78,7 @@ MLINKS+=iswalnum_l.3 iswalpha_l.3 iswalnum_l.3 iswcntrl_l.3 \
iswalnum_l.3 iswspecial_l.3 iswalnum_l.3 nextwctype_l.3 \
iswalnum_l.3 towctrans_l.3 iswalnum_l.3 wctrans_l.3
MLINKS+=isxdigit.3 ishexnumber.3
+MLINKS+=localeconv.3 localeconv_l.3
MLINKS+=mbrtowc.3 mbrtoc16.3 mbrtowc.3 mbrtoc32.3
MLINKS+=mbsrtowcs.3 mbsnrtowcs.3
MLINKS+=wcrtomb.3 c16rtomb.3 wcrtomb.3 c32rtomb.3
diff --git a/lib/libc/stdio/Makefile.inc b/lib/libc/stdio/Makefile.inc
index 9c232ba..9b608c8 100644
--- a/lib/libc/stdio/Makefile.inc
+++ b/lib/libc/stdio/Makefile.inc
@@ -42,7 +42,7 @@ MAN+= fclose.3 ferror.3 fflush.3 fgetln.3 fgets.3 fgetwln.3 fgetws.3 \
stdio.3 tmpnam.3 \
ungetc.3 ungetwc.3 wprintf.3 wscanf.3
-MLINKS+=fclose.3 fcloseall.3
+MLINKS+=fclose.3 fcloseall.3 fclose.3 fdclose.3
MLINKS+=ferror.3 ferror_unlocked.3 \
ferror.3 clearerr.3 ferror.3 clearerr_unlocked.3 \
ferror.3 feof.3 ferror.3 feof_unlocked.3 \
diff --git a/lib/libc/stdlib/jemalloc/Makefile.inc b/lib/libc/stdlib/jemalloc/Makefile.inc
index 46006ee..a04ccf2 100644
--- a/lib/libc/stdlib/jemalloc/Makefile.inc
+++ b/lib/libc/stdlib/jemalloc/Makefile.inc
@@ -14,14 +14,14 @@ CFLAGS+=-I${LIBC_SRCTOP}/../../contrib/jemalloc/include
.for src in ${JEMALLOCSRCS}
MISRCS+=jemalloc_${src}
CLEANFILES+=jemalloc_${src}
-jemalloc_${src}:
- ln -sf ${LIBC_SRCTOP}/../../contrib/jemalloc/src/${src} ${.TARGET}
+jemalloc_${src}: ${LIBC_SRCTOP}/../../contrib/jemalloc/src/${src} .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.endfor
MAN+=jemalloc.3
CLEANFILES+=jemalloc.3
-jemalloc.3:
- ln -sf ${LIBC_SRCTOP}/../../contrib/jemalloc/doc/jemalloc.3 ${.TARGET}
+jemalloc.3: ${LIBC_SRCTOP}/../../contrib/jemalloc/doc/jemalloc.3
+ ln -sf ${.ALLSRC} ${.TARGET}
MLINKS+= \
jemalloc.3 malloc.3 \
diff --git a/lib/libc/tests/rpc/Makefile b/lib/libc/tests/rpc/Makefile
index e6e58e7..f9819d3 100644
--- a/lib/libc/tests/rpc/Makefile
+++ b/lib/libc/tests/rpc/Makefile
@@ -1,6 +1,7 @@
# $FreeBSD$
-SRCS.xdr_test= ${RPCSRC:.x=_xdr.c} t_xdr.c ${RPCSRC:.x=.h}
+SRCS.xdr_test= ${RPCSRC:.x=_xdr.c} t_xdr.c ${RPCSRC:.x=.h} \
+ h_testbits.h
NETBSD_ATF_TESTS_C= rpc_test
NETBSD_ATF_TESTS_C+= xdr_test
@@ -16,7 +17,6 @@ h_testbits_xdr.c: ${RPCSRC} h_testbits.h
CLEANFILES+= ${RPCSRC:.x=.h} ${RPCSRC:.x=.c} h_testbits_xdr.c
CFLAGS+= -I${.OBJDIR}
-DPSRCS+= h_testbits.h
LDADD+= -lrpcsvc -lutil
DPADD+= ${LIBRPCSVC} ${LIBUTIL}
diff --git a/lib/libcalendar/Makefile.depend b/lib/libcalendar/Makefile.depend
index 3699b06..9cb890b 100644
--- a/lib/libcalendar/Makefile.depend
+++ b/lib/libcalendar/Makefile.depend
@@ -8,7 +8,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcam/Makefile.depend b/lib/libcam/Makefile.depend
index 114b842..6002005 100644
--- a/lib/libcam/Makefile.depend
+++ b/lib/libcam/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libsbuf \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcapsicum/Makefile.depend b/lib/libcapsicum/Makefile.depend
index 5016551..4f7989b 100644
--- a/lib/libcapsicum/Makefile.depend
+++ b/lib/libcapsicum/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libnv \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcom_err/Makefile.depend b/lib/libcom_err/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libcom_err/Makefile.depend
+++ b/lib/libcom_err/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index 85bf948..70c4634 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@ -17,7 +17,8 @@ SRCS= crypt.c misc.c \
crypt-sha512.c sha512c.c
MAN= crypt.3
MLINKS= crypt.3 crypt_get_format.3 crypt.3 crypt_set_format.3
-CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil
+CFLAGS+= -I${.CURDIR}/../libmd -I${.CURDIR}/../libutil \
+ -I${.CURDIR}/../../sys/crypto/sha2
# Pull in the strong crypto, if it is present.
.if exists(${.CURDIR}/../../secure/lib/libcrypt) && ${MK_CRYPT} != "no"
diff --git a/lib/libcrypt/Makefile.depend b/lib/libcrypt/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libcrypt/Makefile.depend
+++ b/lib/libcrypt/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcuse/Makefile.depend b/lib/libcuse/Makefile.depend
index 0a2f351..7b92dbd 100644
--- a/lib/libcuse/Makefile.depend
+++ b/lib/libcuse/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libcxxrt/Makefile.depend b/lib/libcxxrt/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libcxxrt/Makefile.depend
+++ b/lib/libcxxrt/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libdevinfo/Makefile.depend b/lib/libdevinfo/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libdevinfo/Makefile.depend
+++ b/lib/libdevinfo/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libdevstat/Makefile.depend b/lib/libdevstat/Makefile.depend
index 96ad505..a1ac545 100644
--- a/lib/libdevstat/Makefile.depend
+++ b/lib/libdevstat/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libkvm \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libdpv/Makefile.depend b/lib/libdpv/Makefile.depend
index 6f24a33..7de4367 100644
--- a/lib/libdpv/Makefile.depend
+++ b/lib/libdpv/Makefile.depend
@@ -14,7 +14,6 @@ DIRDEPS = \
lib/libutil \
lib/msun \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libdwarf/Makefile b/lib/libdwarf/Makefile
index 590aab3..bd98d8f 100644
--- a/lib/libdwarf/Makefile
+++ b/lib/libdwarf/Makefile
@@ -76,7 +76,7 @@ SRCS= \
INCS= dwarf.h libdwarf.h
-#
+# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
# We need to link against the correct version of these files. One
# solution is to include ../../sys in the include path. This causes
# problems when a header file in sys depends on a file in another
@@ -93,9 +93,9 @@ CLEANFILES= ${GENSRCS}
CLEANDIRS= sys
CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common -I${TOP}/libelf
-sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET}
+sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} .NOMETA
mkdir -p ${.OBJDIR}/sys
- ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
+ ln -sf ${.ALLSRC} ${.TARGET}
LIBADD+= elf
diff --git a/lib/libdwarf/Makefile.depend b/lib/libdwarf/Makefile.depend
index 36075d5..ea167ef 100644
--- a/lib/libdwarf/Makefile.depend
+++ b/lib/libdwarf/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libelf \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libedit/Makefile.depend b/lib/libedit/Makefile.depend
index 3c91e80..607ebe0 100644
--- a/lib/libedit/Makefile.depend
+++ b/lib/libedit/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libelf/Makefile b/lib/libelf/Makefile
index c400204..b8aa4df 100644
--- a/lib/libelf/Makefile
+++ b/lib/libelf/Makefile
@@ -65,7 +65,7 @@ SRCS= elf.c \
INCS= libelf.h gelf.h
-#
+# This same hack is in lib/libdwarf/Makefile and usr.bin/readelf/Makefile
# We need to link against the correct version of these files. One
# solution is to include ../../sys in the include path. This causes
# problems when a header file in sys depends on a file in another
@@ -78,9 +78,9 @@ CLEANFILES= ${GENSRCS}
CLEANDIRS= sys
CFLAGS+= -I. -I${SRCDIR} -I${TOP}/common
-sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET}
+sys/elf32.h sys/elf64.h sys/elf_common.h: ${.CURDIR}/../../sys/${.TARGET} .NOMETA
mkdir -p ${.OBJDIR}/sys
- ln -sf ${.CURDIR}/../../sys/${.TARGET} ${.TARGET}
+ ln -sf ${.ALLSRC} ${.TARGET}
SHLIB_MAJOR= 2
diff --git a/lib/libelf/Makefile.depend b/lib/libelf/Makefile.depend
index cc4f1d2..814c094 100644
--- a/lib/libelf/Makefile.depend
+++ b/lib/libelf/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libexecinfo/Makefile.depend b/lib/libexecinfo/Makefile.depend
index 5bc9039..b767569 100644
--- a/lib/libexecinfo/Makefile.depend
+++ b/lib/libexecinfo/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libelf \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libexpat/Makefile.depend b/lib/libexpat/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libexpat/Makefile.depend
+++ b/lib/libexpat/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libfetch/Makefile.depend b/lib/libfetch/Makefile.depend
index 4bcc4bf..3de4148 100644
--- a/lib/libfetch/Makefile.depend
+++ b/lib/libfetch/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
secure/lib/libcrypto \
secure/lib/libssl \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libfigpar/Makefile.depend b/lib/libfigpar/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libfigpar/Makefile.depend
+++ b/lib/libfigpar/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libgeom/Makefile.depend b/lib/libgeom/Makefile.depend
index 9af4728..7f43259 100644
--- a/lib/libgeom/Makefile.depend
+++ b/lib/libgeom/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libexpat \
lib/libsbuf \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libgpio/Makefile.depend b/lib/libgpio/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libgpio/Makefile.depend
+++ b/lib/libgpio/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libgssapi/Makefile.depend b/lib/libgssapi/Makefile.depend
index 7602ef9..08a5fff 100644
--- a/lib/libgssapi/Makefile.depend
+++ b/lib/libgssapi/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/BIG5/Makefile.depend b/lib/libiconv_modules/BIG5/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/BIG5/Makefile.depend
+++ b/lib/libiconv_modules/BIG5/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/DECHanyu/Makefile.depend b/lib/libiconv_modules/DECHanyu/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/DECHanyu/Makefile.depend
+++ b/lib/libiconv_modules/DECHanyu/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/EUC/Makefile.depend b/lib/libiconv_modules/EUC/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/EUC/Makefile.depend
+++ b/lib/libiconv_modules/EUC/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/EUCTW/Makefile.depend b/lib/libiconv_modules/EUCTW/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/EUCTW/Makefile.depend
+++ b/lib/libiconv_modules/EUCTW/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/GBK2K/Makefile.depend b/lib/libiconv_modules/GBK2K/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/GBK2K/Makefile.depend
+++ b/lib/libiconv_modules/GBK2K/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/HZ/Makefile.depend b/lib/libiconv_modules/HZ/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/HZ/Makefile.depend
+++ b/lib/libiconv_modules/HZ/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/ISO2022/Makefile.depend b/lib/libiconv_modules/ISO2022/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/ISO2022/Makefile.depend
+++ b/lib/libiconv_modules/ISO2022/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/JOHAB/Makefile.depend b/lib/libiconv_modules/JOHAB/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/JOHAB/Makefile.depend
+++ b/lib/libiconv_modules/JOHAB/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/MSKanji/Makefile.depend b/lib/libiconv_modules/MSKanji/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/MSKanji/Makefile.depend
+++ b/lib/libiconv_modules/MSKanji/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/UES/Makefile.depend b/lib/libiconv_modules/UES/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/UES/Makefile.depend
+++ b/lib/libiconv_modules/UES/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/UTF1632/Makefile.depend b/lib/libiconv_modules/UTF1632/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/UTF1632/Makefile.depend
+++ b/lib/libiconv_modules/UTF1632/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/UTF7/Makefile.depend b/lib/libiconv_modules/UTF7/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/UTF7/Makefile.depend
+++ b/lib/libiconv_modules/UTF7/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/UTF8/Makefile.depend b/lib/libiconv_modules/UTF8/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/UTF8/Makefile.depend
+++ b/lib/libiconv_modules/UTF8/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/VIQR/Makefile.depend b/lib/libiconv_modules/VIQR/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/VIQR/Makefile.depend
+++ b/lib/libiconv_modules/VIQR/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/ZW/Makefile.depend b/lib/libiconv_modules/ZW/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/ZW/Makefile.depend
+++ b/lib/libiconv_modules/ZW/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/iconv_none/Makefile.depend b/lib/libiconv_modules/iconv_none/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/iconv_none/Makefile.depend
+++ b/lib/libiconv_modules/iconv_none/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/iconv_std/Makefile.depend b/lib/libiconv_modules/iconv_std/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/iconv_std/Makefile.depend
+++ b/lib/libiconv_modules/iconv_std/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/mapper_646/Makefile.depend b/lib/libiconv_modules/mapper_646/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/mapper_646/Makefile.depend
+++ b/lib/libiconv_modules/mapper_646/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/mapper_none/Makefile.depend b/lib/libiconv_modules/mapper_none/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/mapper_none/Makefile.depend
+++ b/lib/libiconv_modules/mapper_none/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/mapper_parallel/Makefile.depend b/lib/libiconv_modules/mapper_parallel/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/mapper_parallel/Makefile.depend
+++ b/lib/libiconv_modules/mapper_parallel/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/mapper_serial/Makefile.depend b/lib/libiconv_modules/mapper_serial/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/mapper_serial/Makefile.depend
+++ b/lib/libiconv_modules/mapper_serial/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/mapper_std/Makefile.depend b/lib/libiconv_modules/mapper_std/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/mapper_std/Makefile.depend
+++ b/lib/libiconv_modules/mapper_std/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libiconv_modules/mapper_zone/Makefile.depend b/lib/libiconv_modules/mapper_zone/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libiconv_modules/mapper_zone/Makefile.depend
+++ b/lib/libiconv_modules/mapper_zone/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libipsec/Makefile.depend b/lib/libipsec/Makefile.depend
index d1ba46b..7583d24 100644
--- a/lib/libipsec/Makefile.depend
+++ b/lib/libipsec/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.bin/yacc.host \
diff --git a/lib/libjail/Makefile.depend b/lib/libjail/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libjail/Makefile.depend
+++ b/lib/libjail/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libkiconv/Makefile.depend b/lib/libkiconv/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libkiconv/Makefile.depend
+++ b/lib/libkiconv/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libkvm/Makefile.depend b/lib/libkvm/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libkvm/Makefile.depend
+++ b/lib/libkvm/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libldns/Makefile.depend b/lib/libldns/Makefile.depend
index f35aa11..b3f22d1 100644
--- a/lib/libldns/Makefile.depend
+++ b/lib/libldns/Makefile.depend
@@ -12,7 +12,6 @@ DIRDEPS = \
lib/libcompiler_rt \
secure/lib/libcrypto \
secure/lib/libssl \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/liblzma/Makefile.depend b/lib/liblzma/Makefile.depend
index 18b76e5..7b92dbd 100644
--- a/lib/liblzma/Makefile.depend
+++ b/lib/liblzma/Makefile.depend
@@ -7,11 +7,9 @@ DIRDEPS = \
include \
include/xlocale \
lib/${CSU_DIR} \
- lib/clang/include.host \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmagic/Makefile.depend b/lib/libmagic/Makefile.depend
index 3842c54..d209adb 100644
--- a/lib/libmagic/Makefile.depend
+++ b/lib/libmagic/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libz \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmd/Makefile.depend b/lib/libmd/Makefile.depend
index c145c03..00038a0 100644
--- a/lib/libmd/Makefile.depend
+++ b/lib/libmd/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmd/Makefile.depend.host b/lib/libmd/Makefile.depend.host
deleted file mode 100644
index 771b816..0000000
--- a/lib/libmd/Makefile.depend.host
+++ /dev/null
@@ -1,35 +0,0 @@
-# $FreeBSD$
-# Autogenerated - do NOT edit!
-
-DIRDEPS = \
- gnu/usr.bin/binutils/ld \
- gnu/usr.bin/binutils/nm \
- usr.bin/xinstall \
-
-
-.include <dirdeps.mk>
-
-.if ${DEP_RELDIR} == ${_DEP_RELDIR}
-# local dependencies - needed for -jN in clean tree
-md4hl.So: md4hl.c
-md4hl.o: md4hl.c
-md4hl.po: md4hl.c
-md5hl.So: md5hl.c
-md5hl.o: md5hl.c
-md5hl.po: md5hl.c
-rmd160hl.So: rmd160hl.c
-rmd160hl.o: rmd160hl.c
-rmd160hl.po: rmd160hl.c
-sha0hl.So: sha0hl.c
-sha0hl.o: sha0hl.c
-sha0hl.po: sha0hl.c
-sha1hl.So: sha1hl.c
-sha1hl.o: sha1hl.c
-sha1hl.po: sha1hl.c
-sha256hl.So: sha256hl.c
-sha256hl.o: sha256hl.c
-sha256hl.po: sha256hl.c
-sha512hl.So: sha512hl.c
-sha512hl.o: sha512hl.c
-sha512hl.po: sha512hl.c
-.endif
diff --git a/lib/libmemstat/Makefile.depend b/lib/libmemstat/Makefile.depend
index 96ad505..a1ac545 100644
--- a/lib/libmemstat/Makefile.depend
+++ b/lib/libmemstat/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libkvm \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmilter/Makefile b/lib/libmilter/Makefile
index ca9838d..81172ec 100644
--- a/lib/libmilter/Makefile
+++ b/lib/libmilter/Makefile
@@ -29,7 +29,7 @@ CLEANFILES+=sm_os.h
WARNS?= 0
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.lib.mk>
diff --git a/lib/libmilter/Makefile.depend b/lib/libmilter/Makefile.depend
index d66a25b..b1db669 100644
--- a/lib/libmilter/Makefile.depend
+++ b/lib/libmilter/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmp/Makefile.depend b/lib/libmp/Makefile.depend
index 5781764..fc0b633 100644
--- a/lib/libmp/Makefile.depend
+++ b/lib/libmp/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libmt/Makefile.depend b/lib/libmt/Makefile.depend
index 9af4728..7f43259 100644
--- a/lib/libmt/Makefile.depend
+++ b/lib/libmt/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libexpat \
lib/libsbuf \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libnetgraph/Makefile.depend b/lib/libnetgraph/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libnetgraph/Makefile.depend
+++ b/lib/libnetgraph/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libngatm/Makefile.depend b/lib/libngatm/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libngatm/Makefile.depend
+++ b/lib/libngatm/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libnv/Makefile.depend b/lib/libnv/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libnv/Makefile.depend
+++ b/lib/libnv/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libopie/Makefile.depend b/lib/libopie/Makefile.depend
index 4ed0db2..6a2d406 100644
--- a/lib/libopie/Makefile.depend
+++ b/lib/libopie/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libmd \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpam/libpam/Makefile.depend b/lib/libpam/libpam/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libpam/libpam/Makefile.depend
+++ b/lib/libpam/libpam/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile
index c36b3ef..cdc0228 100644
--- a/lib/libpcap/Makefile
+++ b/lib/libpcap/Makefile
@@ -126,9 +126,8 @@ version.h: ${PCAP_DISTDIR}/VERSION
@rm -f $@
sed 's/.*/char pcap_version_string[] = "libpcap version &";/' ${PCAP_DISTDIR}/VERSION > $@
-tokdefs.h: grammar.h
- ln -sf grammar.h tokdefs.h
-
+tokdefs.h: grammar.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
#
# Magic to convert the man pages to something non Solarish
diff --git a/lib/libpcap/Makefile.depend b/lib/libpcap/Makefile.depend
index 7426299..7dd09cc 100644
--- a/lib/libpcap/Makefile.depend
+++ b/lib/libpcap/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.bin/yacc.host \
diff --git a/lib/libpmc/Makefile.depend b/lib/libpmc/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libpmc/Makefile.depend
+++ b/lib/libpmc/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile
index 3feddb5..8c4f484 100644
--- a/lib/libproc/Makefile
+++ b/lib/libproc/Makefile
@@ -14,9 +14,6 @@ SRCS= proc_bkpt.c \
INCS= libproc.h
CFLAGS+= -I${.CURDIR}
-# avoid cyclic dependency
-CFLAGS+= -I${.CURDIR:H}/librtld_db
-GENDIRDEPS_FILTER+= Nlib/librtld_db
.if ${MK_CXX} == "no"
CFLAGS+= -DNO_CXA_DEMANGLE
diff --git a/lib/libproc/Makefile.depend b/lib/libproc/Makefile.depend
index feb045f..33b871f 100644
--- a/lib/libproc/Makefile.depend
+++ b/lib/libproc/Makefile.depend
@@ -12,8 +12,8 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/libcxxrt \
lib/libelf \
+ lib/librtld_db \
lib/libutil \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libprocstat/Makefile.depend b/lib/libprocstat/Makefile.depend
index 11ffd8d..433756b 100644
--- a/lib/libprocstat/Makefile.depend
+++ b/lib/libprocstat/Makefile.depend
@@ -13,7 +13,6 @@ DIRDEPS = \
lib/libkvm \
lib/libprocstat/zfs \
lib/libutil \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libradius/Makefile.depend b/lib/libradius/Makefile.depend
index 5d73f97..f318cc1 100644
--- a/lib/libradius/Makefile.depend
+++ b/lib/libradius/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/librpcsec_gss/Makefile.depend b/lib/librpcsec_gss/Makefile.depend
index a352749..506fcea 100644
--- a/lib/librpcsec_gss/Makefile.depend
+++ b/lib/librpcsec_gss/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libgssapi \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/librpcsvc/Makefile.depend b/lib/librpcsvc/Makefile.depend
index e431374..0c8b021 100644
--- a/lib/librpcsvc/Makefile.depend
+++ b/lib/librpcsvc/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/librt/Makefile.depend b/lib/librt/Makefile.depend
index 0a2f351..7b92dbd 100644
--- a/lib/librt/Makefile.depend
+++ b/lib/librt/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/librtld_db/Makefile b/lib/librtld_db/Makefile
index 2815a07..9f9b603 100644
--- a/lib/librtld_db/Makefile
+++ b/lib/librtld_db/Makefile
@@ -10,5 +10,7 @@ SRCS= rtld_db.c
INCS= rtld_db.h
CFLAGS+= -I${.CURDIR}
+# Avoid circular dependency, we only need the libproc.h header here.
+CFLAGS+= -I${.CURDIR:H}/libproc
.include <bsd.lib.mk>
diff --git a/lib/librtld_db/Makefile.depend b/lib/librtld_db/Makefile.depend
index fad79f2..90c66d4 100644
--- a/lib/librtld_db/Makefile.depend
+++ b/lib/librtld_db/Makefile.depend
@@ -10,9 +10,7 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libelf \
- lib/libproc \
lib/libutil \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libsbuf/Makefile.depend b/lib/libsbuf/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libsbuf/Makefile.depend
+++ b/lib/libsbuf/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libsdp/Makefile.depend b/lib/libsdp/Makefile.depend
index 37f8632..179dbbe 100644
--- a/lib/libsdp/Makefile.depend
+++ b/lib/libsdp/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libbluetooth \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libsm/Makefile b/lib/libsm/Makefile
index 20f54c1..1ec2dc1 100644
--- a/lib/libsm/Makefile
+++ b/lib/libsm/Makefile
@@ -36,7 +36,7 @@ CLEANFILES+=sm_os.h
INTERNALLIB=
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.lib.mk>
diff --git a/lib/libsmb/Makefile.depend b/lib/libsmb/Makefile.depend
index 4d66c46..5a8df4c 100644
--- a/lib/libsmb/Makefile.depend
+++ b/lib/libsmb/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libkiconv \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libsmdb/Makefile b/lib/libsmdb/Makefile
index 976282c..f1f5199 100644
--- a/lib/libsmdb/Makefile
+++ b/lib/libsmdb/Makefile
@@ -19,7 +19,7 @@ CLEANFILES+=sm_os.h
INTERNALLIB=
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.lib.mk>
diff --git a/lib/libsmutil/Makefile b/lib/libsmutil/Makefile
index b7e5a69..e7919ea 100644
--- a/lib/libsmutil/Makefile
+++ b/lib/libsmutil/Makefile
@@ -19,7 +19,7 @@ CLEANFILES+=sm_os.h
INTERNALLIB=
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.lib.mk>
diff --git a/lib/libsqlite3/Makefile.depend b/lib/libsqlite3/Makefile.depend
index 0a2f351..7b92dbd 100644
--- a/lib/libsqlite3/Makefile.depend
+++ b/lib/libsqlite3/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libstdbuf/Makefile.depend b/lib/libstdbuf/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libstdbuf/Makefile.depend
+++ b/lib/libstdbuf/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libstdthreads/Makefile.depend b/lib/libstdthreads/Makefile.depend
index 0a2f351..7b92dbd 100644
--- a/lib/libstdthreads/Makefile.depend
+++ b/lib/libstdthreads/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libthr/Makefile.depend b/lib/libthr/Makefile.depend
index 3699b06..9cb890b 100644
--- a/lib/libthr/Makefile.depend
+++ b/lib/libthr/Makefile.depend
@@ -8,7 +8,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libthread_db/Makefile.depend b/lib/libthread_db/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libthread_db/Makefile.depend
+++ b/lib/libthread_db/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libucl/Makefile.depend b/lib/libucl/Makefile.depend
index 3dce64a..c9f9d52 100644
--- a/lib/libucl/Makefile.depend
+++ b/lib/libucl/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libufs/Makefile.depend b/lib/libufs/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libufs/Makefile.depend
+++ b/lib/libufs/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libugidfw/Makefile.depend b/lib/libugidfw/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libugidfw/Makefile.depend
+++ b/lib/libugidfw/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libulog/Makefile.depend b/lib/libulog/Makefile.depend
index 2e2a25e..064e492 100644
--- a/lib/libulog/Makefile.depend
+++ b/lib/libulog/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libmd \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libunbound/Makefile.depend b/lib/libunbound/Makefile.depend
index 9ae472e..aaf8d6d 100644
--- a/lib/libunbound/Makefile.depend
+++ b/lib/libunbound/Makefile.depend
@@ -13,7 +13,6 @@ DIRDEPS = \
lib/libthr \
secure/lib/libcrypto \
secure/lib/libssl \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libusb/Makefile.depend b/lib/libusb/Makefile.depend
index 0a2f351..7b92dbd 100644
--- a/lib/libusb/Makefile.depend
+++ b/lib/libusb/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libthr \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libusbhid/Makefile.depend b/lib/libusbhid/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libusbhid/Makefile.depend
+++ b/lib/libusbhid/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libutil/Makefile.depend b/lib/libutil/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libutil/Makefile.depend
+++ b/lib/libutil/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libvgl/Makefile.depend b/lib/libvgl/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libvgl/Makefile.depend
+++ b/lib/libvgl/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libvmmapi/Makefile.depend b/lib/libvmmapi/Makefile.depend
index e294271..58f9a33 100644
--- a/lib/libvmmapi/Makefile.depend
+++ b/lib/libvmmapi/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libutil \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libwrap/Makefile.depend b/lib/libwrap/Makefile.depend
index 69d1724..54c1f6f 100644
--- a/lib/libwrap/Makefile.depend
+++ b/lib/libwrap/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libxo/Makefile.depend b/lib/libxo/Makefile.depend
index e294271..58f9a33 100644
--- a/lib/libxo/Makefile.depend
+++ b/lib/libxo/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libutil \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libypclnt/Makefile.depend b/lib/libypclnt/Makefile.depend
index 36ab5e3..8ee531b 100644
--- a/lib/libypclnt/Makefile.depend
+++ b/lib/libypclnt/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/libz/Makefile.depend b/lib/libz/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/libz/Makefile.depend
+++ b/lib/libz/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/msun/Makefile.depend b/lib/msun/Makefile.depend
index dde2d60..3646e2e 100644
--- a/lib/msun/Makefile.depend
+++ b/lib/msun/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/form/Makefile.depend b/lib/ncurses/form/Makefile.depend
index e753747..6956fec 100644
--- a/lib/ncurses/form/Makefile.depend
+++ b/lib/ncurses/form/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/ncurses/ncurses \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/formw/Makefile.depend b/lib/ncurses/formw/Makefile.depend
index 1448c10..767a760 100644
--- a/lib/ncurses/formw/Makefile.depend
+++ b/lib/ncurses/formw/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/menu/Makefile.depend b/lib/ncurses/menu/Makefile.depend
index 7dbcb2b..fa2fcb4 100644
--- a/lib/ncurses/menu/Makefile.depend
+++ b/lib/ncurses/menu/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/ncurses/ncurses \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/menuw/Makefile.depend b/lib/ncurses/menuw/Makefile.depend
index 0ffbc9b..6d65e74 100644
--- a/lib/ncurses/menuw/Makefile.depend
+++ b/lib/ncurses/menuw/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/ncurses/Makefile.depend b/lib/ncurses/ncurses/Makefile.depend
index df76371..8ad41a6 100644
--- a/lib/ncurses/ncurses/Makefile.depend
+++ b/lib/ncurses/ncurses/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/ncursesw/Makefile.depend b/lib/ncurses/ncursesw/Makefile.depend
index 443698d..b6ffa95 100644
--- a/lib/ncurses/ncursesw/Makefile.depend
+++ b/lib/ncurses/ncursesw/Makefile.depend
@@ -9,7 +9,6 @@ DIRDEPS = \
lib/${CSU_DIR} \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/panel/Makefile.depend b/lib/ncurses/panel/Makefile.depend
index fa0a8e0..7ed28bc 100644
--- a/lib/ncurses/panel/Makefile.depend
+++ b/lib/ncurses/panel/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libcompiler_rt \
lib/ncurses/ncurses \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/lib/ncurses/panelw/Makefile.depend b/lib/ncurses/panelw/Makefile.depend
index 0db3540..0bb0107 100644
--- a/lib/ncurses/panelw/Makefile.depend
+++ b/lib/ncurses/panelw/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/ncurses/ncursesw \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/libexec/mail.local/Makefile b/libexec/mail.local/Makefile
index 018357c..79844e8 100644
--- a/libexec/mail.local/Makefile
+++ b/libexec/mail.local/Makefile
@@ -23,7 +23,7 @@ DPADD+=${SENDMAIL_DPADD}
LDADD+=${SENDMAIL_LDADD}
LDFLAGS+=${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/libexec/smrsh/Makefile b/libexec/smrsh/Makefile
index 7e82b22..e2e9c3b 100644
--- a/libexec/smrsh/Makefile
+++ b/libexec/smrsh/Makefile
@@ -22,7 +22,7 @@ DPADD+=${SENDMAIL_DPADD}
LDADD+=${SENDMAIL_LDADD}
LDFLAGS+=${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/release/tools/arm.subr b/release/tools/arm.subr
index 51a70d9..2adadd2 100644
--- a/release/tools/arm.subr
+++ b/release/tools/arm.subr
@@ -110,7 +110,7 @@ arm_install_base() {
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab
echo "/dev/msdosfs/MSDOSBOOT /boot/msdos msdosfs rw,noatime 0 0" \
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab
- echo "tmpfs /tmp tmpfs rw,mode=1777,size=30m 0 0" \
+ echo "tmpfs /tmp tmpfs rw,mode=1777,size=30m 0 0" \
>> ${CHROOTDIR}/${DESTDIR}/etc/fstab
local hostname
diff --git a/sbin/ipf/ipf/Makefile b/sbin/ipf/ipf/Makefile
index 3ffd2b2..2ff340f 100644
--- a/sbin/ipf/ipf/Makefile
+++ b/sbin/ipf/ipf/Makefile
@@ -7,8 +7,6 @@ MLINKS= ipf.5 ipf.conf.5 ipf.5 ipf6.conf.5
CFLAGS+= -I. -DIPFILTER_BPF -DHAS_SYS_MD5_H
GENHDRS= ipf_l.h ipf_y.h
-DPSRCS+= ${GENHDRS}
-
CLEANFILES+= ${GENHDRS} ipf_y.c ipf_l.c
ipf_y.c: ipf_y.y
diff --git a/sbin/ipf/ipftest/Makefile b/sbin/ipf/ipftest/Makefile
index 7d8260a..a74599f 100644
--- a/sbin/ipf/ipftest/Makefile
+++ b/sbin/ipf/ipftest/Makefile
@@ -22,7 +22,6 @@ CFLAGS+= -DIPFILTER_LOG -DIPFILTER_COMPILED -DIPFILTER_LOOKUP \
.PATH: ${.CURDIR}/../../../sys/contrib/ipfilter/netinet
GENHDRS= ipnat_l.h ipnat_y.h ippool_l.h ippool_y.h ipf_l.h ipf_y.h
-DPSRCS+= ${GENHDRS}
CLEANFILES+= ${GENHDRS}
CLEANFILES+= ipf_y.c ipf_l.c
diff --git a/sbin/ipf/ipmon/Makefile b/sbin/ipf/ipmon/Makefile
index 3639f87..031f929 100644
--- a/sbin/ipf/ipmon/Makefile
+++ b/sbin/ipf/ipmon/Makefile
@@ -7,8 +7,6 @@ MAN= ipmon.8
CFLAGS+= -DLOGFAC=LOG_LOCAL0 -I.
GENHDRS+= ipmon_l.h ipmon_y.h
-DPSRCS+= ${GENHDRS}
-
CLEANFILES+= ${GENHDRS} ipmon_y.c ipmon_l.c
ipmon_y.c: ipmon_y.y
diff --git a/sbin/ipf/ipnat/Makefile b/sbin/ipf/ipnat/Makefile
index 1c017e1..74be486 100644
--- a/sbin/ipf/ipnat/Makefile
+++ b/sbin/ipf/ipnat/Makefile
@@ -7,8 +7,6 @@ MLINKS= ipnat.5 ipnat.conf.5
CFLAGS+= -I.
GENHDRS= ipnat_l.h ipnat_y.h
-DPSRCS+= ${GENHDRS}
-
CLEANFILES+= ${GENHDRS} ipnat_y.c ipnat_l.c
ipnat_y.c: ipnat_y.y
diff --git a/sbin/ipf/ippool/Makefile b/sbin/ipf/ippool/Makefile
index 6e3f85d..eedebef 100644
--- a/sbin/ipf/ippool/Makefile
+++ b/sbin/ipf/ippool/Makefile
@@ -6,8 +6,6 @@ MAN= ippool.5 ippool.8
CFLAGS+= -I.
GENHDRS= ippool_l.h ippool_y.h
-DPSRCS+= ${GENHDRS}
-
CLEANFILES+= ${GENHDRS} ippool_y.c ippool_l.c
ippool_y.c: ippool_y.y
diff --git a/secure/lib/libcrypto/Makefile.depend b/secure/lib/libcrypto/Makefile.depend
index 723f45e..0742ab2 100644
--- a/secure/lib/libcrypto/Makefile.depend
+++ b/secure/lib/libcrypto/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/msun \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/secure/lib/libssh/Makefile.depend b/secure/lib/libssh/Makefile.depend
index fbf95e5..51e45b4 100644
--- a/secure/lib/libssh/Makefile.depend
+++ b/secure/lib/libssh/Makefile.depend
@@ -17,7 +17,6 @@ DIRDEPS = \
lib/libz \
secure/lib/libcrypto \
secure/lib/libssl \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/secure/lib/libssl/Makefile.depend b/secure/lib/libssl/Makefile.depend
index 5d73f97..f318cc1 100644
--- a/secure/lib/libssl/Makefile.depend
+++ b/secure/lib/libssl/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
secure/lib/libcrypto \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/share/colldef/Makefile.depend b/share/colldef/Makefile.depend
index f80275d..3611e3b 100644
--- a/share/colldef/Makefile.depend
+++ b/share/colldef/Makefile.depend
@@ -2,6 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
+ usr.bin/localedef.host \
.include <dirdeps.mk>
diff --git a/usr.bin/xinstall/Makefile.depend.host b/share/ctypedef/Makefile.depend
index abd0b21..3611e3b 100644
--- a/usr.bin/xinstall/Makefile.depend.host
+++ b/share/ctypedef/Makefile.depend
@@ -2,8 +2,7 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
- gnu/usr.bin/binutils/ld \
- lib/libmd \
+ usr.bin/localedef.host \
.include <dirdeps.mk>
diff --git a/share/dtrace/retval b/share/dtrace/retval
new file mode 100755
index 0000000..b1182f3
--- /dev/null
+++ b/share/dtrace/retval
@@ -0,0 +1,42 @@
+#!/usr/sbin/dtrace -s
+/*-
+ * Copyright (c) 2015 George V. Neville-Neil <gnn@neville-neil.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 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 AUTHORS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (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$
+ *
+ * retval - show the return value of any probe named by the user
+ *
+ * USAGE: retval name
+ *
+ * The name can be a full function name or a wild card name. The
+ * caller is responsible for handling the escaping of wild cards.
+ */
+
+#pragma D option quiet
+
+fbt::$1:return {
+ printf("%s %d\n", probefunc, arg1);
+}
+
diff --git a/share/man/man4/aue.4 b/share/man/man4/aue.4
index cfb5929..043200e 100644
--- a/share/man/man4/aue.4
+++ b/share/man/man4/aue.4
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 7, 2006
+.Dd November 24, 2015
.Dt AUE 4
.Os
.Sh NAME
@@ -45,6 +45,7 @@ kernel configuration file:
.Cd "device ohci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device aue"
.Ed
.Pp
diff --git a/share/man/man4/axe.4 b/share/man/man4/axe.4
index 06241a6..060dcc9 100644
--- a/share/man/man4/axe.4
+++ b/share/man/man4/axe.4
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd June 25, 2013
+.Dd November 24, 2015
.Dt AXE 4
.Os
.Sh NAME
@@ -46,6 +46,7 @@ kernel configuration file:
.Cd "device ohci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device axe"
.Ed
.Pp
diff --git a/share/man/man4/axge.4 b/share/man/man4/axge.4
index d89ea8c..47a10a8 100644
--- a/share/man/man4/axge.4
+++ b/share/man/man4/axge.4
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd November 22, 2013
+.Dd November 24, 2015
.Dt AXGE 4
.Os
.Sh NAME
@@ -47,6 +47,7 @@ kernel configuration file:
.Cd "device ohci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device axge"
.Ed
.Pp
diff --git a/share/man/man4/cdce.4 b/share/man/man4/cdce.4
index fa921b6..4b5b478 100644
--- a/share/man/man4/cdce.4
+++ b/share/man/man4/cdce.4
@@ -28,7 +28,7 @@
.\" $NetBSD: cdce.4,v 1.4 2004/12/08 18:35:56 peter Exp $
.\" $FreeBSD$
.\"
-.Dd September 25, 2014
+.Dd November 24, 2015
.Dt CDCE 4
.Os
.Sh NAME
@@ -42,6 +42,8 @@ kernel configuration file:
.Cd "device uhci"
.Cd "device ohci"
.Cd "device usb"
+.Cd "device miibus"
+.Cd "device uether"
.Cd "device cdce"
.Ed
.Pp
diff --git a/share/man/man4/cue.4 b/share/man/man4/cue.4
index 0ed9e8d..01a2e64 100644
--- a/share/man/man4/cue.4
+++ b/share/man/man4/cue.4
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 16, 2005
+.Dd November 24, 2015
.Dt CUE 4
.Os
.Sh NAME
@@ -44,6 +44,8 @@ kernel configuration file:
.Cd "device uhci"
.Cd "device ohci"
.Cd "device usb"
+.Cd "device miibus"
+.Cd "device uether"
.Cd "device cue"
.Ed
.Pp
diff --git a/share/man/man4/ipheth.4 b/share/man/man4/ipheth.4
index a237524b..b900f8e 100644
--- a/share/man/man4/ipheth.4
+++ b/share/man/man4/ipheth.4
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 30, 2014
+.Dd November 24, 2015
.Dt IPHETH 4
.Os
.Sh NAME
@@ -47,6 +47,8 @@ following lines in your kernel configuration file:
.Cd "device uhci"
.Cd "device ohci"
.Cd "device usb"
+.Cd "device miibus"
+.Cd "device uether"
.Cd "device ipheth"
.Ed
.Sh DESCRIPTION
diff --git a/share/man/man4/kue.4 b/share/man/man4/kue.4
index c535319..022ccef 100644
--- a/share/man/man4/kue.4
+++ b/share/man/man4/kue.4
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 7, 2006
+.Dd November 24, 2015
.Dt KUE 4
.Os
.Sh NAME
@@ -44,6 +44,8 @@ kernel configuration file:
.Cd "device uhci"
.Cd "device ohci"
.Cd "device usb"
+.Cd "device miibus"
+.Cd "device uether"
.Cd "device kue"
.Ed
.Pp
diff --git a/share/man/man4/mos.4 b/share/man/man4/mos.4
index 2656dea..e4ae8c4 100644
--- a/share/man/man4/mos.4
+++ b/share/man/man4/mos.4
@@ -15,7 +15,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 14, 2011
+.Dd November 24, 2015
.Dt MOS 4
.Os
.Sh NAME
@@ -31,6 +31,7 @@ kernel configuration file:
.Cd "device ehci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device mos"
.Ed
.Pp
diff --git a/share/man/man4/rue.4 b/share/man/man4/rue.4
index 7450ccf..ba85ae0 100644
--- a/share/man/man4/rue.4
+++ b/share/man/man4/rue.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 23, 2011
+.Dd November 24, 2015
.Dt RUE 4
.Os
.Sh NAME
@@ -40,6 +40,7 @@ kernel configuration file:
.Cd "device ohci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device rue"
.Ed
.Pp
diff --git a/share/man/man4/smsc.4 b/share/man/man4/smsc.4
index fb37539..dac2864 100644
--- a/share/man/man4/smsc.4
+++ b/share/man/man4/smsc.4
@@ -27,7 +27,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 26, 2014
+.Dd November 24, 2015
.Dt SMSC 4
.Os
.Sh NAME
@@ -48,6 +48,7 @@ following lines in your kernel configuration file:
.Cd "device ohci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device smsc"
.Ed
.Sh DESCRIPTION
diff --git a/share/man/man4/udav.4 b/share/man/man4/udav.4
index 5f6c80c..da527f0 100644
--- a/share/man/man4/udav.4
+++ b/share/man/man4/udav.4
@@ -32,7 +32,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd July 16, 2005
+.Dd November 24, 2015
.Dt UDAV 4
.Os
.Sh NAME
@@ -48,6 +48,7 @@ kernel configuration file:
.Cd "device ohci"
.Cd "device usb"
.Cd "device miibus"
+.Cd "device uether"
.Cd "device udav"
.Ed
.Pp
diff --git a/share/man/man4/urndis.4 b/share/man/man4/urndis.4
index ee367b7..81314ae 100644
--- a/share/man/man4/urndis.4
+++ b/share/man/man4/urndis.4
@@ -29,7 +29,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 2, 2014
+.Dd November 24, 2015
.Dt URNDIS 4
.Os
.Sh NAME
@@ -45,6 +45,8 @@ kernel configuration file:
.Cd "device ohci"
.Cd "device xhci"
.Cd "device usb"
+.Cd "device miibus"
+.Cd "device uether"
.Cd "device urndis"
.Ed
.Pp
diff --git a/share/mk/bsd.libnames.mk b/share/mk/bsd.libnames.mk
index 6d3bbe7..7d7faf1 100644
--- a/share/mk/bsd.libnames.mk
+++ b/share/mk/bsd.libnames.mk
@@ -10,6 +10,8 @@
.sinclude <src.libnames.mk>
+# Src directory locations are also defined in src.libnames.mk.
+
LIBCRT0?= ${DESTDIR}${LIBDIR}/crt0.o
LIBALIAS?= ${DESTDIR}${LIBDIR}/libalias.a
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index cf3bee6..9f33424 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -133,12 +133,23 @@ CTFCONVERT_CMD= @:
.endif
.if ${MK_INSTALL_AS_USER} != "no"
+.if !defined(_uid)
_uid!= id -u
+.export _uid
+.endif
.if ${_uid} != 0
.if !defined(USER)
-USER!= id -un
+# Avoid exporting USER
+.if !defined(_USER)
+_USER!= id -un
+.export _USER
+.endif
+USER= ${_USER}
.endif
+.if !defined(_gid)
_gid!= id -g
+.export _gid
+.endif
.for x in BIN CONF DOC DTB INFO KMOD LIB MAN NLS SHARE
$xOWN= ${USER}
$xGRP= ${_gid}
diff --git a/share/mk/bsd.progs.mk b/share/mk/bsd.progs.mk
index ad5cc18..92a5eea 100644
--- a/share/mk/bsd.progs.mk
+++ b/share/mk/bsd.progs.mk
@@ -102,7 +102,10 @@ _PROGS_ALL_SRCS+= ${s}
.endfor
.endfor
.if !empty(_PROGS_COMMON_SRCS)
-_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:N*.h:R:S/$/.o/g}
+_PROGS_COMMON_OBJS= ${_PROGS_COMMON_SRCS:M*.[dhly]}
+.if !empty(_PROGS_COMMON_SRCS:N*.[dhly])
+_PROGS_COMMON_OBJS+= ${_PROGS_COMMON_SRCS:N*.[dhly]:R:S/$/.o/g}
+.endif
${PROGS}: ${_PROGS_COMMON_OBJS}
.endif
diff --git a/share/mk/local.dirdeps.mk b/share/mk/local.dirdeps.mk
index d83e3e8..53c176e 100644
--- a/share/mk/local.dirdeps.mk
+++ b/share/mk/local.dirdeps.mk
@@ -28,15 +28,20 @@ DIRDEPS_FILTER+= N*.host
.for m in host common
M_dep_qual_fixes += C;($m),[^/.,]*$$;\1;
.endfor
-
#.info M_dep_qual_fixes=${M_dep_qual_fixes}
-# we want to supress these dependencies for host tools
-# but some libs are sadly needed.
-_need_host_libs= \
- lib/libc++ \
- lib/libcxxrt \
- lib/libdwarf \
- lib/libmd \
+
+# Cheat for including src.libnames.mk
+__<bsd.init.mk>__:
+# Pull in _INTERNALLIBS
+.include <src.libnames.mk>
+
+# Host libraries should mostly be excluded from the build so the
+# host version in /usr/lib is used. Internal libraries need to be
+# allowed to be built though since they are never installed.
+_need_host_libs=
+.for lib in ${_INTERNALLIBS}
+_need_host_libs+= ${LIB${lib:tu}DIR:S,^${ROOTOBJDIR}/,,}
+.endfor
N_host_libs:= ${cd ${SRCTOP} && echo lib/lib*:L:sh:${_need_host_libs:${M_ListToSkip}}:${M_ListToSkip}}
DIRDEPS_FILTER.host = \
diff --git a/share/mk/local.gendirdeps.mk b/share/mk/local.gendirdeps.mk
index a790cbc..dc65d16 100644
--- a/share/mk/local.gendirdeps.mk
+++ b/share/mk/local.gendirdeps.mk
@@ -14,6 +14,7 @@ GENDIRDEPS_FILTER+= \
Ntargets/pseudo/stage* \
Ntools/*
+# Exclude toolchain which is handled special.
.if ${RELDIR:Mtargets*} == ""
.if ${RELDIR:Nusr.bin/clang/*:Ngnu/usr.bin/cc/*:Nlib/clang*} != ""
GENDIRDEPS_FILTER.host+= \
@@ -22,7 +23,17 @@ GENDIRDEPS_FILTER.host+= \
.endif
GENDIRDEPS_FILTER+= \
+ Nlib/clang/include.host \
+ Nusr.bin/addr2line.host \
+ Nusr.bin/ar.host \
Nusr.bin/clang/clang.host \
+ Nusr.bin/elfcopy.host \
+ Nusr.bin/elfdump.host \
+ Nusr.bin/nm.host \
+ Nusr.bin/readelf.host \
+ Nusr.bin/size.host \
+ Nusr.bin/strings.host \
+ Nusr.bin/strip.host \
Ngnu/usr.bin/cc* \
Ngnu/usr.bin/binutils*.host \
diff --git a/share/mk/local.init.mk b/share/mk/local.init.mk
index 8954473..f0a7abf 100644
--- a/share/mk/local.init.mk
+++ b/share/mk/local.init.mk
@@ -9,21 +9,20 @@
.endif
.endif
+# XXX: This should be combined with external compiler support in Makefile.inc1
+# and local.meta.sys.mk (CROSS_TARGET_FLAGS)
.if ${MK_SYSROOT} == "yes" && !empty(SYSROOT) && ${MACHINE} != "host"
CFLAGS_LAST+= --sysroot=${SYSROOT}
CXXFLAGS_LAST+= --sysroot=${SYSROOT}
LDADD+= --sysroot=${SYSROOT}
.elif ${MK_STAGING} == "yes"
-CFLAGS+= -nostdinc
-CFLAGS+= -I${STAGE_INCLUDEDIR}
+CFLAGS+= -isystem ${STAGE_INCLUDEDIR}
+# XXX: May be needed for GCC to build with libc++ rather than libstdc++. See Makefile.inc1
+#CXXFLAGS+= -std=gnu++11
+#LDADD+= -L${STAGE_LIBDIR}/libc++
+#CXXFLAGS+= -I${STAGE_INCLUDEDIR}/usr/include/c++/v1
LDADD+= -L${STAGE_LIBDIR}
.endif
-.if ${MACHINE} == "host"
-# we cheat?
-LDADD+= -B/usr/lib
-CFLAGS_LAST+= -I/usr/include
-CXXFLAGS_LAST+= -I/usr/include
-.endif
.if ${MACHINE} == "host"
.if ${.MAKE.DEPENDFILE:E} != "host"
diff --git a/share/mk/local.meta.sys.mk b/share/mk/local.meta.sys.mk
index 5c91450..6df0688 100644
--- a/share/mk/local.meta.sys.mk
+++ b/share/mk/local.meta.sys.mk
@@ -150,6 +150,13 @@ STAGE_OBJTOP:= ${STAGE_ROOT}/${STAGE_MACHINE}
STAGE_COMMON_OBJTOP:= ${STAGE_ROOT}/common
STAGE_HOST_OBJTOP:= ${STAGE_ROOT}/${HOST_TARGET}
+# Use tools/install.sh which can avoid the need for xinstall for simple cases.
+INSTALL?= sh ${SRCTOP}/tools/install.sh
+# This is for stage-install to pickup from the environment.
+REAL_INSTALL:= ${INSTALL}
+.export REAL_INSTALL
+STAGE_INSTALL= sh ${.PARSEDIR:tA}/stage-install.sh OBJDIR=${.OBJDIR:tA}
+
STAGE_LIBDIR= ${STAGE_OBJTOP}${_LIBDIR:U${LIBDIR:U/lib}}
STAGE_INCLUDEDIR= ${STAGE_OBJTOP}${INCLUDEDIR:U/usr/include}
# this is not the same as INCLUDEDIR
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk
index 7022dad..37e1a17 100644
--- a/share/mk/local.sys.mk
+++ b/share/mk/local.sys.mk
@@ -13,6 +13,7 @@ MAKE_PRINT_VAR_ON_ERROR+= \
MAKEOBJDIRPREFIX \
MAKESYSPATH \
MAKE_VERSION\
+ PATH \
SRCTOP \
OBJTOP \
${MAKE_PRINT_VAR_ON_ERROR_XTRAS}
diff --git a/share/mk/meta.autodep.mk b/share/mk/meta.autodep.mk
index 548ba53..aa41c6e 100644
--- a/share/mk/meta.autodep.mk
+++ b/share/mk/meta.autodep.mk
@@ -51,6 +51,9 @@ UPDATE_DEPENDFILE = NO
.endif
_CURDIR ?= ${.CURDIR}
+_OBJDIR ?= ${.OBJDIR}
+_OBJTOP ?= ${OBJTOP}
+_OBJROOT ?= ${OBJROOT:U${_OBJTOP}}
_DEPENDFILE := ${_CURDIR}/${.MAKE.DEPENDFILE:T}
.if ${.MAKE.LEVEL} == 0
@@ -191,9 +194,9 @@ gendirdeps: ${_DEPENDFILE}
# anything which matches ${_OBJROOT}* but not ${_OBJTOP}*
# needs to be qualified in DIRDEPS
# The pseudo machine "host" is used for HOST_TARGET
-DIRDEPS = \
+DIRDEPS += \
${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \
- ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
+ ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:N${STAGE_ROOT:U${_OBJTOP}}/*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u}
.endif
.endif
diff --git a/share/mk/src.libnames.mk b/share/mk/src.libnames.mk
index d78d6e2..bb57578 100644
--- a/share/mk/src.libnames.mk
+++ b/share/mk/src.libnames.mk
@@ -7,6 +7,9 @@
.error src.libnames.mk cannot be included directly.
.endif
+.if !target(__<src.libnames.mk>__)
+__<src.libnames.mk>__:
+
.include <src.opts.mk>
.if ${.OBJDIR:S,${.CURDIR},,} != ${.OBJDIR}
@@ -368,3 +371,67 @@ LIBBSNMPTOOLS?= ${LIBBSNMPTOOLSDIR}/libbsnmptools.a
LIBAMUDIR= ${ROOTOBJDIR}/usr.sbin/amd/libamu
LIBAMU?= ${LIBAMUDIR}/libamu/libamu.a
+# Define a directory for each library. This is useful for adding -L in when
+# not using a --sysroot or for meta mode bootstrapping when there is no
+# Makefile.depend. These are sorted by directory.
+LIBAVLDIR= ${ROOTOBJDIR}/cddl/lib/libavl
+LIBCTFDIR= ${ROOTOBJDIR}/cddl/lib/libctf
+LIBDTRACEDIR= ${ROOTOBJDIR}/cddl/lib/libdtrace
+LIBNVPAIRDIR= ${ROOTOBJDIR}/cddl/lib/libnvpair
+LIBUMEMDIR= ${ROOTOBJDIR}/cddl/lib/libumem
+LIBUUTILDIR= ${ROOTOBJDIR}/cddl/lib/libuutil
+LIBZFSDIR= ${ROOTOBJDIR}/cddl/lib/libzfs
+LIBZFS_COREDIR= ${ROOTOBJDIR}/cddl/lib/libzfs_core
+LIBZPOOLDIR= ${ROOTOBJDIR}/cddl/lib/libzpool
+LIBDIALOGDIR= ${ROOTOBJDIR}/gnu/lib/libdialog
+LIBGCOVDIR= ${ROOTOBJDIR}/gnu/lib/libgcov
+LIBGOMPDIR= ${ROOTOBJDIR}/gnu/lib/libgomp
+LIBGNUREGEXDIR= ${ROOTOBJDIR}/gnu/lib/libregex
+LIBSSPDIR= ${ROOTOBJDIR}/gnu/lib/libssp
+LIBSSP_NONSHAREDDIR= ${ROOTOBJDIR}/gnu/lib/libssp/libssp_nonshared
+LIBSUPCPLUSPLUSDIR= ${ROOTOBJDIR}/gnu/lib/libsupc++
+LIBASN1DIR= ${ROOTOBJDIR}/kerberos5/lib/libasn1
+LIBGSSAPI_KRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_krb5
+LIBGSSAPI_NTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_ntlm
+LIBGSSAPI_SPNEGODIR= ${ROOTOBJDIR}/kerberos5/lib/libgssapi_spnego
+LIBHDBDIR= ${ROOTOBJDIR}/kerberos5/lib/libhdb
+LIBHEIMBASEDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimbase
+LIBHEIMIPCCDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcc
+LIBHEIMIPCSDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimipcs
+LIBHEIMNTLMDIR= ${ROOTOBJDIR}/kerberos5/lib/libheimntlm
+LIBHX509DIR= ${ROOTOBJDIR}/kerberos5/lib/libhx509
+LIBKADM5CLNTDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5clnt
+LIBKADM5SRVDIR= ${ROOTOBJDIR}/kerberos5/lib/libkadm5srv
+LIBKAFS5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkafs5
+LIBKDCDIR= ${ROOTOBJDIR}/kerberos5/lib/libkdc
+LIBKRB5DIR= ${ROOTOBJDIR}/kerberos5/lib/libkrb5
+LIBROKENDIR= ${ROOTOBJDIR}/kerberos5/lib/libroken
+LIBWINDDIR= ${ROOTOBJDIR}/kerberos5/lib/libwind
+LIBALIASDIR= ${ROOTOBJDIR}/lib/libalias/libalias
+LIBBLOCKSRUNTIMEDIR= ${ROOTOBJDIR}/lib/libblocksruntime
+LIBBSNMPDIR= ${ROOTOBJDIR}/lib/libbsnmp/libbsnmp
+LIBBSDXMLDIR= ${ROOTOBJDIR}/lib/libexpat
+LIBKVMDIR= ${ROOTOBJDIR}/lib/libkvm
+LIBPTHREADDIR= ${ROOTOBJDIR}/lib/libthr
+LIBMDIR= ${ROOTOBJDIR}/lib/msun
+LIBFORMDIR= ${ROOTOBJDIR}/lib/ncurses/form
+LIBFORMLIBWDIR= ${ROOTOBJDIR}/lib/ncurses/formw
+LIBMENUDIR= ${ROOTOBJDIR}/lib/ncurses/menu
+LIBMENULIBWDIR= ${ROOTOBJDIR}/lib/ncurses/menuw
+LIBTERMCAPDIR= ${ROOTOBJDIR}/lib/ncurses/ncurses
+LIBTERMCAPWDIR= ${ROOTOBJDIR}/lib/ncurses/ncursesw
+LIBPANELDIR= ${ROOTOBJDIR}/lib/ncurses/panel
+LIBPANELWDIR= ${ROOTOBJDIR}/lib/ncurses/panelw
+LIBCRYPTODIR= ${ROOTOBJDIR}/secure/lib/libcrypto
+LIBSSHDIR= ${ROOTOBJDIR}/secure/lib/libssh
+LIBSSLDIR= ${ROOTOBJDIR}/secure/lib/libssl
+LIBTEKENDIR= ${ROOTOBJDIR}/sys/teken/libteken
+LIBEGACYDIR= ${ROOTOBJDIR}/tools/build
+LIBLNDIR= ${ROOTOBJDIR}/usr.bin/lex/lib
+
+# Default other library directories to lib/libNAME.
+.for lib in ${_LIBRARIES}
+LIB${lib:tu}DIR?= ${ROOTOBJDIR}/lib/lib${lib}
+.endfor
+
+.endif # !target(__<src.libnames.mk>__)
diff --git a/share/mk/sys.mk b/share/mk/sys.mk
index 6b6f847..68d2db3 100644
--- a/share/mk/sys.mk
+++ b/share/mk/sys.mk
@@ -51,11 +51,9 @@ __ENV_ONLY_OPTIONS:= \
.endif
.if ${MK_AUTO_OBJ} == "yes"
# This needs to be done early - before .PATH is computed
-# Don't do this if just running 'make -V' (but do when inspecting .OBJDIR) or
-# 'make showconfig' (during makeman which enables all options when meta mode
-# is not expected)
-.if (${.MAKEFLAGS:M-V} == "" || ${.MAKEFLAGS:M.OBJDIR} != "") && \
- !make(showconfig)
+# Don't do this for 'make showconfig' as it enables all options where meta mode
+# is not expected.
+.if !make(showconfig)
.sinclude <auto.obj.mk>
.endif
.endif
@@ -274,7 +272,7 @@ YFLAGS ?= -d
# non-Posix rule set
-.sh:
+.sh: .NOMETA
cp -fp ${.IMPSRC} ${.TARGET}
chmod a+x ${.TARGET}
diff --git a/share/monetdef/Makefile.depend b/share/monetdef/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/monetdef/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/msgdef/Makefile.depend b/share/msgdef/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/msgdef/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/numericdef/Makefile.depend b/share/numericdef/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/numericdef/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/share/timedef/Makefile.depend b/share/timedef/Makefile.depend
new file mode 100644
index 0000000..f80275d
--- /dev/null
+++ b/share/timedef/Makefile.depend
@@ -0,0 +1,11 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/sys/arm/arm/pmap-v6-new.c b/sys/arm/arm/pmap-v6-new.c
index d553eb4..8b7676e 100644
--- a/sys/arm/arm/pmap-v6-new.c
+++ b/sys/arm/arm/pmap-v6-new.c
@@ -1541,12 +1541,12 @@ pmap_pt2pg_zero(vm_page_t m)
panic("%s: CMAP2 busy", __func__);
pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(pa, PTE2_AP_KRW,
m->md.pat_mode));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR2);
/* Even VM_ALLOC_ZERO request is only advisory. */
if ((m->flags & PG_ZERO) == 0)
pagezero(sysmaps->CADDR2);
pte2_sync_range((pt2_entry_t *)sysmaps->CADDR2, PAGE_SIZE);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
@@ -5470,7 +5470,6 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
struct sysmaps *sysmaps;
vm_memattr_t oma;
vm_paddr_t pa;
- vm_offset_t va;
oma = m->md.pat_mode;
m->md.pat_mode = ma;
@@ -5502,10 +5501,9 @@ pmap_page_set_memattr(vm_page_t m, vm_memattr_t ma)
if (*sysmaps->CMAP2)
panic("%s: CMAP2 busy", __func__);
pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(pa, PTE2_AP_KRW, ma));
- va = (vm_offset_t)sysmaps->CADDR2;
- tlb_flush_local(va);
- dcache_wbinv_poc(va, pa, PAGE_SIZE);
+ dcache_wbinv_poc((vm_offset_t)sysmaps->CADDR2, pa, PAGE_SIZE);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
@@ -5594,9 +5592,9 @@ pmap_zero_page(vm_page_t m)
panic("%s: CMAP2 busy", __func__);
pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
m->md.pat_mode));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR2);
pagezero(sysmaps->CADDR2);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
@@ -5619,12 +5617,12 @@ pmap_zero_page_area(vm_page_t m, int off, int size)
panic("%s: CMAP2 busy", __func__);
pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
m->md.pat_mode));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR2);
if (off == 0 && size == PAGE_SIZE)
pagezero(sysmaps->CADDR2);
else
bzero(sysmaps->CADDR2 + off, size);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
@@ -5644,9 +5642,9 @@ pmap_zero_page_idle(vm_page_t m)
sched_pin();
pte2_store(CMAP3, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
m->md.pat_mode));
- tlb_flush_local((vm_offset_t)CADDR3);
pagezero(CADDR3);
pte2_clear(CMAP3);
+ tlb_flush((vm_offset_t)CADDR3);
sched_unpin();
}
@@ -5670,13 +5668,13 @@ pmap_copy_page(vm_page_t src, vm_page_t dst)
panic("%s: CMAP2 busy", __func__);
pte2_store(sysmaps->CMAP1, PTE2_KERN_NG(VM_PAGE_TO_PHYS(src),
PTE2_AP_KR | PTE2_NM, src->md.pat_mode));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR1);
pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(dst),
PTE2_AP_KRW, dst->md.pat_mode));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR2);
bcopy(sysmaps->CADDR1, sysmaps->CADDR2, PAGE_SIZE);
pte2_clear(sysmaps->CMAP1);
+ tlb_flush((vm_offset_t)sysmaps->CADDR1);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
@@ -5721,7 +5719,9 @@ pmap_copy_pages(vm_page_t ma[], vm_offset_t a_offset, vm_page_t mb[],
xfersize -= cnt;
}
pte2_clear(sysmaps->CMAP1);
+ tlb_flush((vm_offset_t)sysmaps->CADDR1);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
@@ -5740,8 +5740,6 @@ pmap_quick_enter_page(vm_page_t m)
pte2_store(pte2p, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
pmap_page_get_memattr(m)));
- tlb_flush_local(qmap_addr);
-
return (qmap_addr);
}
@@ -5758,6 +5756,7 @@ pmap_quick_remove_page(vm_offset_t addr)
KASSERT(pte2_load(pte2p) != 0, ("%s: PTE2 not in use", __func__));
pte2_clear(pte2p);
+ tlb_flush(qmap_addr);
critical_exit();
}
@@ -6059,9 +6058,9 @@ pmap_dcache_wb_pou(vm_paddr_t pa, vm_size_t size, vm_memattr_t ma)
if (*sysmaps->CMAP3)
panic("%s: CMAP3 busy", __func__);
pte2_store(sysmaps->CMAP3, PTE2_KERN_NG(pa, PTE2_AP_KRW, ma));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR3);
dcache_wb_pou((vm_offset_t)sysmaps->CADDR3 + (pa & PAGE_MASK), size);
pte2_clear(sysmaps->CMAP3);
+ tlb_flush((vm_offset_t)sysmaps->CADDR3);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
@@ -6313,13 +6312,13 @@ pmap_zero_page_check(vm_page_t m)
panic("%s: CMAP2 busy", __func__);
pte2_store(sysmaps->CMAP2, PTE2_KERN_NG(VM_PAGE_TO_PHYS(m), PTE2_AP_KRW,
m->md.pat_mode));
- tlb_flush_local((vm_offset_t)sysmaps->CADDR2);
end = (uint32_t*)(sysmaps->CADDR2 + PAGE_SIZE);
for (p = (uint32_t*)sysmaps->CADDR2; p < end; p++)
if (*p != 0)
panic("%s: page %p not zero, va: %p", __func__, m,
sysmaps->CADDR2);
pte2_clear(sysmaps->CMAP2);
+ tlb_flush((vm_offset_t)sysmaps->CADDR2);
sched_unpin();
mtx_unlock(&sysmaps->lock);
}
diff --git a/sys/arm/include/sf_buf.h b/sys/arm/include/sf_buf.h
index 75d5722..eba8488 100644
--- a/sys/arm/include/sf_buf.h
+++ b/sys/arm/include/sf_buf.h
@@ -44,7 +44,11 @@ static inline int
sf_buf_unmap(struct sf_buf *sf)
{
+#ifdef ARM_NEW_PMAP
+ pmap_qremove(sf->kva, 1);
+#else
pmap_kremove(sf->kva);
+#endif
return (1);
}
#endif /* !_MACHINE_SF_BUF_H_ */
diff --git a/sys/arm64/arm64/pmap.c b/sys/arm64/arm64/pmap.c
index 004b4a7..dcd6e5d 100644
--- a/sys/arm64/arm64/pmap.c
+++ b/sys/arm64/arm64/pmap.c
@@ -215,6 +215,8 @@ struct msgbuf *msgbufp = NULL;
static struct rwlock_padalign pvh_global_lock;
+vm_paddr_t dmap_phys_base; /* The start of the dmap region */
+
/*
* Data for the pv entry allocation mechanism
*/
@@ -446,18 +448,19 @@ pmap_early_vtophys(vm_offset_t l1pt, vm_offset_t va)
}
static void
-pmap_bootstrap_dmap(vm_offset_t l1pt)
+pmap_bootstrap_dmap(vm_offset_t l1pt, vm_paddr_t kernstart)
{
vm_offset_t va;
vm_paddr_t pa;
pd_entry_t *l1;
u_int l1_slot;
+ pa = dmap_phys_base = kernstart & ~L1_OFFSET;
va = DMAP_MIN_ADDRESS;
l1 = (pd_entry_t *)l1pt;
l1_slot = pmap_l1_index(DMAP_MIN_ADDRESS);
- for (pa = 0; va < DMAP_MAX_ADDRESS;
+ for (; va < DMAP_MAX_ADDRESS;
pa += L1_SIZE, va += L1_SIZE, l1_slot++) {
KASSERT(l1_slot < Ln_ENTRIES, ("Invalid L1 index"));
@@ -548,7 +551,8 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen)
pt_entry_t *l2;
vm_offset_t va, freemempos;
vm_offset_t dpcpu, msgbufpv;
- vm_paddr_t pa;
+ vm_paddr_t pa, min_pa;
+ int i;
kern_delta = KERNBASE - kernstart;
physmem = 0;
@@ -566,8 +570,23 @@ pmap_bootstrap(vm_offset_t l1pt, vm_paddr_t kernstart, vm_size_t kernlen)
*/
rw_init(&pvh_global_lock, "pmap pv global");
+ /* Assume the address we were loaded to is a valid physical address */
+ min_pa = KERNBASE - kern_delta;
+
+ /*
+ * Find the minimum physical address. physmap is sorted,
+ * but may contain empty ranges.
+ */
+ for (i = 0; i < (physmap_idx * 2); i += 2) {
+ if (physmap[i] == physmap[i + 1])
+ continue;
+ if (physmap[i] <= min_pa)
+ min_pa = physmap[i];
+ break;
+ }
+
/* Create a direct map region early so we can use it for pa -> va */
- pmap_bootstrap_dmap(l1pt);
+ pmap_bootstrap_dmap(l1pt, min_pa);
va = KERNBASE;
pa = KERNBASE - kern_delta;
diff --git a/sys/arm64/include/vmparam.h b/sys/arm64/include/vmparam.h
index 3c14af8..e3c1d74 100644
--- a/sys/arm64/include/vmparam.h
+++ b/sys/arm64/include/vmparam.h
@@ -160,11 +160,13 @@
#define DMAP_MIN_ADDRESS (0xffffffc000000000UL)
#define DMAP_MAX_ADDRESS (0xffffffdfffffffffUL)
-#define DMAP_MIN_PHYSADDR (0x0000000000000000UL)
-#define DMAP_MAX_PHYSADDR (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS)
+extern vm_paddr_t dmap_phys_base;
+#define DMAP_MIN_PHYSADDR (dmap_phys_base)
+#define DMAP_MAX_PHYSADDR (dmap_phys_base + (DMAP_MAX_ADDRESS - DMAP_MIN_ADDRESS))
/* True if pa is in the dmap range */
-#define PHYS_IN_DMAP(pa) ((pa) <= DMAP_MAX_PHYSADDR)
+#define PHYS_IN_DMAP(pa) ((pa) >= DMAP_MIN_PHYSADDR && \
+ (pa) <= DMAP_MAX_PHYSADDR)
/* True if va is in the dmap range */
#define VIRT_IN_DMAP(va) ((va) >= DMAP_MIN_ADDRESS && \
(va) <= DMAP_MAX_ADDRESS)
@@ -174,7 +176,7 @@
KASSERT(PHYS_IN_DMAP(pa), \
("%s: PA out of range, PA: 0x%lx", __func__, \
(vm_paddr_t)(pa))); \
- (pa) | DMAP_MIN_ADDRESS; \
+ ((pa) - dmap_phys_base) | DMAP_MIN_ADDRESS; \
})
#define DMAP_TO_PHYS(va) \
@@ -182,7 +184,7 @@
KASSERT(VIRT_IN_DMAP(va), \
("%s: VA out of range, VA: 0x%lx", __func__, \
(vm_offset_t)(va))); \
- (va) & ~DMAP_MIN_ADDRESS; \
+ ((va) & ~DMAP_MIN_ADDRESS) + dmap_phys_base; \
})
#define VM_MIN_USER_ADDRESS (0x0000000000000000UL)
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 56f74c1..25de8c4 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -107,8 +107,8 @@ boot2.h: boot1.out
.if ${MACHINE_CPUARCH} == "amd64"
beforedepend boot2.s: machine
CLEANFILES+= machine
-machine:
- ln -sf ${.CURDIR}/../../../i386/include machine
+machine: ${.CURDIR}/../../../i386/include .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.endif
.include <bsd.prog.mk>
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 8f76426..89a9a0a 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -2702,6 +2702,8 @@ device uvisor
# USB serial support for DDI pocket's PHS
device uvscom
#
+# USB ethernet support
+device uether
# ADMtek USB ethernet. Supports the LinkSys USB100TX,
# the Billionton USB100, the Melco LU-ATX, the D-Link DSB-650TX
# and the SMC 2202USB. Also works with the ADMtek AN986 Pegasus
diff --git a/sys/conf/files b/sys/conf/files
index 3dd7613..ea03624 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -2615,9 +2615,9 @@ dev/usb/net/if_udav.c optional udav
dev/usb/net/if_usie.c optional usie
dev/usb/net/if_urndis.c optional urndis
dev/usb/net/ruephy.c optional rue
-dev/usb/net/usb_ethernet.c optional aue | axe | axge | cdce | cue | kue | \
- mos | rue | smsc | udav | ipheth | \
- urndis
+dev/usb/net/usb_ethernet.c optional uether | aue | axe | axge | cdce | \
+ cue | ipheth | kue | mos | rue | \
+ smsc | udav | urndis
dev/usb/net/uhso.c optional uhso
#
# USB WLAN drivers
@@ -3466,7 +3466,7 @@ net/if_dead.c standard
net/if_debug.c optional ddb
net/if_disc.c optional disc
net/if_edsc.c optional edsc
-net/if_enc.c optional enc ipsec inet | enc ipsec inet6
+net/if_enc.c optional enc inet | enc inet6
net/if_epair.c optional epair
net/if_ethersubr.c optional ether
net/if_fddisubr.c optional fddi
diff --git a/sys/conf/newvers.sh b/sys/conf/newvers.sh
index 3ca5bcd..2239ac6 100644
--- a/sys/conf/newvers.sh
+++ b/sys/conf/newvers.sh
@@ -84,6 +84,12 @@ fi
COPYRIGHT="$COPYRIGHT
"
+# VARS_ONLY means no files should be generated, this is just being
+# included.
+if [ -n "$VARS_ONLY" ]; then
+ return 0
+fi
+
LC_ALL=C; export LC_ALL
if [ ! -r version ]
then
diff --git a/sys/conf/options b/sys/conf/options
index 4938dda..aa07e97 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -707,7 +707,6 @@ ISAPNP opt_isa.h
# various 'device presence' options.
DEV_BPF opt_bpf.h
DEV_CARP opt_carp.h
-DEV_ENC opt_enc.h
DEV_MCA opt_mca.h
DEV_NETMAP opt_global.h
DEV_PCI opt_pci.h
diff --git a/sys/dev/ath/if_ath_rx.c b/sys/dev/ath/if_ath_rx.c
index 1e1f414..dbdfb89 100644
--- a/sys/dev/ath/if_ath_rx.c
+++ b/sys/dev/ath/if_ath_rx.c
@@ -172,9 +172,14 @@ ath_calcrxfilter(struct ath_softc *sc)
*
* Otherwise we only really need to hear beacons from
* our own BSSID.
+ *
+ * IBSS? software beacon miss? Just receive all beacons.
+ * We need to hear beacons/probe requests from everyone so
+ * we can merge ibss.
*/
- if (ic->ic_opmode == IEEE80211_M_STA ||
- ic->ic_opmode == IEEE80211_M_IBSS || sc->sc_swbmiss) {
+ if (ic->ic_opmode == IEEE80211_M_IBSS || sc->sc_swbmiss) {
+ rfilt |= HAL_RX_FILTER_BEACON;
+ } else if (ic->ic_opmode == IEEE80211_M_STA) {
if (sc->sc_do_mybeacon && ! sc->sc_scanning) {
rfilt |= HAL_RX_FILTER_MYBEACON;
} else { /* scanning, non-mybeacon chips */
@@ -431,7 +436,6 @@ ath_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m,
sc->sc_syncbeacon = 0;
}
-
/* fall thru... */
case IEEE80211_FC0_SUBTYPE_PROBE_RESP:
if (vap->iv_opmode == IEEE80211_M_IBSS &&
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index 04ef001..7b5b399 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -5646,7 +5646,7 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox)
#endif
break;
case ASYNC_LIP_ERROR:
- case ASYNC_LIP_F8:
+ case ASYNC_LIP_NOS_OLS_RECV:
case ASYNC_LIP_OCCURRED:
case ASYNC_PTPMODE:
/*
diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c
index c604644..c6e48fe 100644
--- a/sys/dev/isp/isp_target.c
+++ b/sys/dev/isp/isp_target.c
@@ -639,7 +639,7 @@ isp_target_async(ispsoftc_t *isp, int bus, int event)
isp_async(isp, ISPASYNC_TARGET_NOTIFY, &notify);
break;
case ASYNC_LIP_ERROR:
- case ASYNC_LIP_F8:
+ case ASYNC_LIP_NOS_OLS_RECV:
case ASYNC_LIP_OCCURRED:
case ASYNC_LOOP_RESET:
isp_prt(isp, ISP_LOGTDEBUG0, "%s: LIP RESET", __func__);
diff --git a/sys/dev/isp/ispmbox.h b/sys/dev/isp/ispmbox.h
index 2978b0c..d724679 100644
--- a/sys/dev/isp/ispmbox.h
+++ b/sys/dev/isp/ispmbox.h
@@ -252,7 +252,7 @@
#define ASYNC_LOOP_RESET 0x8013 /* FC only */
#define ASYNC_PDB_CHANGED 0x8014
#define ASYNC_CHANGE_NOTIFY 0x8015
-#define ASYNC_LIP_F8 0x8016 /* FC only */
+#define ASYNC_LIP_NOS_OLS_RECV 0x8016 /* FC only */
#define ASYNC_LIP_ERROR 0x8017 /* FC only */
#define ASYNC_AUTO_PLOGI_RJT 0x8018
#define ASYNC_SECURITY_UPDATE 0x801B
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.c b/sys/dev/ntb/ntb_hw/ntb_hw.c
index 220d635..f71d9e4 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw.c
+++ b/sys/dev/ntb/ntb_hw/ntb_hw.c
@@ -114,7 +114,7 @@ struct ntb_pci_bar_info {
vm_paddr_t pbase;
caddr_t vbase;
vm_size_t size;
- bool mapped_wc : 1;
+ vm_memattr_t map_mode;
/* Configuration register offsets */
uint32_t psz_off;
@@ -264,11 +264,14 @@ bus_space_write_8(bus_space_tag_t tag, bus_space_handle_t handle,
static int ntb_probe(device_t device);
static int ntb_attach(device_t device);
static int ntb_detach(device_t device);
+static unsigned ntb_user_mw_to_idx(struct ntb_softc *, unsigned uidx);
static inline enum ntb_bar ntb_mw_to_bar(struct ntb_softc *, unsigned mw);
static inline bool bar_is_64bit(struct ntb_softc *, enum ntb_bar);
static inline void bar_get_xlat_params(struct ntb_softc *, enum ntb_bar,
uint32_t *base, uint32_t *xlat, uint32_t *lmt);
static int ntb_map_pci_bars(struct ntb_softc *ntb);
+static int ntb_mw_set_wc_internal(struct ntb_softc *, unsigned idx,
+ vm_memattr_t);
static void print_map_success(struct ntb_softc *, struct ntb_pci_bar_info *,
const char *);
static int map_mmr_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar);
@@ -332,6 +335,14 @@ static unsigned g_ntb_enable_wc = 1;
SYSCTL_UINT(_hw_ntb, OID_AUTO, enable_writecombine, CTLFLAG_RDTUN,
&g_ntb_enable_wc, 0, "Set to 1 to map memory windows write combining");
+static int g_ntb_mw_idx = -1;
+SYSCTL_INT(_hw_ntb, OID_AUTO, b2b_mw_idx, CTLFLAG_RDTUN, &g_ntb_mw_idx,
+ 0, "Use this memory window to access the peer NTB registers. A "
+ "non-negative value starts from the first MW index; a negative value "
+ "starts from the last MW index. The default is -1, i.e., the last "
+ "available memory window. Both sides of the NTB MUST set the same "
+ "value here! (Applies on Xeon platforms with SDOORBELL_LOCKUP errata.)");
+
static struct ntb_hw_info pci_ids[] = {
/* XXX: PS/SS IDs left out until they are supported. */
{ 0x0C4E8086, "BWD Atom Processor S1200 Non-Transparent Bridge B2B",
@@ -579,11 +590,6 @@ ntb_detach(device_t device)
mtx_destroy(&ntb->db_mask_lock);
mtx_destroy(&ntb->ctx_lock);
- /*
- * Redetect total MWs so we unmap properly -- in case we lowered the
- * maximum to work around Xeon errata.
- */
- ntb_detect_max_mw(ntb);
ntb_unmap_pci_bar(ntb);
return (0);
@@ -596,8 +602,7 @@ static inline enum ntb_bar
ntb_mw_to_bar(struct ntb_softc *ntb, unsigned mw)
{
- KASSERT(mw < ntb->mw_count ||
- (mw != B2B_MW_DISABLED && mw == ntb->b2b_mw_idx),
+ KASSERT(mw < ntb->mw_count,
("%s: mw:%u > count:%u", __func__, mw, (unsigned)ntb->mw_count));
KASSERT(ntb->reg->mw_bar[mw] != 0, ("invalid mw"));
@@ -668,11 +673,9 @@ ntb_map_pci_bars(struct ntb_softc *ntb)
ntb->bar_info[NTB_B2B_BAR_1].pbarxlat_off = XEON_PBAR2XLAT_OFFSET;
ntb->bar_info[NTB_B2B_BAR_2].pci_resource_id = PCIR_BAR(4);
- /* XXX Are shared MW B2Bs write-combining? */
- if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP) && !HAS_FEATURE(NTB_SPLIT_BAR))
- rc = map_mmr_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_2]);
- else
- rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_2]);
+ rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_2]);
+ if (rc != 0)
+ goto out;
ntb->bar_info[NTB_B2B_BAR_2].psz_off = XEON_PBAR4SZ_OFFSET;
ntb->bar_info[NTB_B2B_BAR_2].ssz_off = XEON_SBAR4SZ_OFFSET;
ntb->bar_info[NTB_B2B_BAR_2].pbarxlat_off = XEON_PBAR4XLAT_OFFSET;
@@ -681,10 +684,7 @@ ntb_map_pci_bars(struct ntb_softc *ntb)
goto out;
ntb->bar_info[NTB_B2B_BAR_3].pci_resource_id = PCIR_BAR(5);
- if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP))
- rc = map_mmr_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_3]);
- else
- rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_3]);
+ rc = map_memory_window_bar(ntb, &ntb->bar_info[NTB_B2B_BAR_3]);
ntb->bar_info[NTB_B2B_BAR_3].psz_off = XEON_PBAR5SZ_OFFSET;
ntb->bar_info[NTB_B2B_BAR_3].ssz_off = XEON_SBAR5SZ_OFFSET;
ntb->bar_info[NTB_B2B_BAR_3].pbarxlat_off = XEON_PBAR5XLAT_OFFSET;
@@ -719,6 +719,7 @@ map_mmr_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar)
return (ENXIO);
save_bar_parameters(bar);
+ bar->map_mode = VM_MEMATTR_UNCACHEABLE;
print_map_success(ntb, bar, "mmr");
return (0);
}
@@ -727,6 +728,7 @@ static int
map_memory_window_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar)
{
int rc;
+ vm_memattr_t mapmode;
uint8_t bar_size_bits = 0;
bar->pci_resource = bus_alloc_resource_any(ntb->device, SYS_RES_MEMORY,
@@ -772,29 +774,34 @@ map_memory_window_bar(struct ntb_softc *ntb, struct ntb_pci_bar_info *bar)
save_bar_parameters(bar);
}
+ bar->map_mode = VM_MEMATTR_UNCACHEABLE;
print_map_success(ntb, bar, "mw");
- if (g_ntb_enable_wc == 0)
- return (0);
/* Mark bar region as write combining to improve performance. */
- rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size,
- VM_MEMATTR_WRITE_COMBINING);
+ mapmode = VM_MEMATTR_WRITE_COMBINING;
+ if (g_ntb_enable_wc == 0)
+ mapmode = VM_MEMATTR_WRITE_BACK;
+
+ rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, mapmode);
if (rc == 0) {
- bar->mapped_wc = true;
+ bar->map_mode = mapmode;
device_printf(ntb->device,
"Marked BAR%d v:[%p-%p] p:[%p-%p] as "
- "WRITE_COMBINING.\n",
+ "%s.\n",
PCI_RID2BAR(bar->pci_resource_id), bar->vbase,
(char *)bar->vbase + bar->size - 1,
- (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1));
+ (void *)bar->pbase, (void *)(bar->pbase + bar->size - 1),
+ (mapmode == VM_MEMATTR_WRITE_COMBINING) ? "WRITE_COMBINING"
+ : "WRITE_BACK");
} else
device_printf(ntb->device,
"Unable to mark BAR%d v:[%p-%p] p:[%p-%p] as "
- "WRITE_COMBINING: %d\n",
+ "%s: %d\n",
PCI_RID2BAR(bar->pci_resource_id), bar->vbase,
(char *)bar->vbase + bar->size - 1,
(void *)bar->pbase, (void *)(bar->pbase + bar->size - 1),
- rc);
+ (mapmode == VM_MEMATTR_WRITE_COMBINING) ? "WRITE_COMBINING"
+ : "WRITE_BACK", rc);
/* Proceed anyway */
return (0);
}
@@ -1264,14 +1271,18 @@ ntb_xeon_init_dev(struct ntb_softc *ntb)
/*
* There is a Xeon hardware errata related to writes to SDOORBELL or
* B2BDOORBELL in conjunction with inbound access to NTB MMIO space,
- * which may hang the system. To workaround this use the second memory
+ * which may hang the system. To workaround this, use a memory
* window to access the interrupt and scratch pad registers on the
* remote system.
*/
- if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP))
- /* Use the last MW for mapping remote spad */
- ntb->b2b_mw_idx = ntb->mw_count - 1;
- else if (HAS_FEATURE(NTB_B2BDOORBELL_BIT14))
+ if (HAS_FEATURE(NTB_SDOORBELL_LOCKUP)) {
+ ntb->b2b_mw_idx = (ntb->mw_count + g_ntb_mw_idx) %
+ ntb->mw_count;
+ ntb_printf(2, "Setting up b2b mw idx %d means %u\n",
+ g_ntb_mw_idx, ntb->b2b_mw_idx);
+ rc = ntb_mw_set_wc_internal(ntb, ntb->b2b_mw_idx, VM_MEMATTR_UNCACHEABLE);
+ KASSERT(rc == 0, ("shouldn't fail"));
+ } else if (HAS_FEATURE(NTB_B2BDOORBELL_BIT14))
/*
* HW Errata on bit 14 of b2bdoorbell register. Writes will not be
* mirrored to the remote system. Shrink the number of bits by one,
@@ -1481,7 +1492,6 @@ xeon_setup_b2b_mw(struct ntb_softc *ntb, const struct ntb_b2b_addr *addr,
ntb->b2b_off = bar_size >> 1;
else if (bar_size >= XEON_B2B_MIN_SIZE) {
ntb->b2b_off = 0;
- ntb->mw_count--;
} else {
device_printf(ntb->device,
"B2B bar size is too small!\n");
@@ -1999,7 +2009,7 @@ ntb_sysctl_init(struct ntb_softc *ntb)
"A", "Link status");
SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "mw_count", CTLFLAG_RD,
- &ntb->mw_count, 0, "MW count (excl. non-shared B2B register BAR)");
+ &ntb->mw_count, 0, "MW count");
SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "spad_count", CTLFLAG_RD,
&ntb->spad_count, 0, "Scratchpad count");
SYSCTL_ADD_U8(ctx, tree_par, OID_AUTO, "db_count", CTLFLAG_RD,
@@ -2341,6 +2351,16 @@ sysctl_handle_register(SYSCTL_HANDLER_ARGS)
return (EINVAL);
}
+static unsigned
+ntb_user_mw_to_idx(struct ntb_softc *ntb, unsigned uidx)
+{
+
+ if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0 &&
+ uidx >= ntb->b2b_mw_idx)
+ return (uidx + 1);
+ return (uidx);
+}
+
/*
* Public API to the rest of the OS
*/
@@ -2361,10 +2381,18 @@ ntb_get_max_spads(struct ntb_softc *ntb)
return (ntb->spad_count);
}
+/*
+ * ntb_mw_count() - Get the number of memory windows available for KPI
+ * consumers.
+ *
+ * (Excludes any MW wholly reserved for register access.)
+ */
uint8_t
ntb_mw_count(struct ntb_softc *ntb)
{
+ if (ntb->b2b_mw_idx != B2B_MW_DISABLED && ntb->b2b_off == 0)
+ return (ntb->mw_count - 1);
return (ntb->mw_count);
}
@@ -2495,6 +2523,7 @@ ntb_mw_get_range(struct ntb_softc *ntb, unsigned mw_idx, vm_paddr_t *base,
if (mw_idx >= ntb_mw_count(ntb))
return (EINVAL);
+ mw_idx = ntb_user_mw_to_idx(ntb, mw_idx);
bar_num = ntb_mw_to_bar(ntb, mw_idx);
bar = &ntb->bar_info[bar_num];
@@ -2553,6 +2582,7 @@ ntb_mw_set_trans(struct ntb_softc *ntb, unsigned idx, bus_addr_t addr,
if (idx >= ntb_mw_count(ntb))
return (EINVAL);
+ idx = ntb_user_mw_to_idx(ntb, idx);
bar_num = ntb_mw_to_bar(ntb, idx);
bar = &ntb->bar_info[bar_num];
@@ -2650,51 +2680,61 @@ ntb_mw_clear_trans(struct ntb_softc *ntb, unsigned mw_idx)
*
* Returns: Zero on success, setting *wc; otherwise an error number (e.g. if
* idx is an invalid memory window).
+ *
+ * Mode is a VM_MEMATTR_* type.
*/
int
-ntb_mw_get_wc(struct ntb_softc *ntb, unsigned idx, bool *wc)
+ntb_mw_get_wc(struct ntb_softc *ntb, unsigned idx, vm_memattr_t *mode)
{
struct ntb_pci_bar_info *bar;
if (idx >= ntb_mw_count(ntb))
return (EINVAL);
+ idx = ntb_user_mw_to_idx(ntb, idx);
bar = &ntb->bar_info[ntb_mw_to_bar(ntb, idx)];
- *wc = bar->mapped_wc;
+ *mode = bar->map_mode;
return (0);
}
/*
* ntb_mw_set_wc - Set the write-combine status of a memory window
*
- * If 'wc' matches the current status, this does nothing and succeeds.
+ * If 'mode' matches the current status, this does nothing and succeeds. Mode
+ * is a VM_MEMATTR_* type.
*
* Returns: Zero on success, setting the caching attribute on the virtual
* mapping of the BAR; otherwise an error number (e.g. if idx is an invalid
* memory window, or if changing the caching attribute fails).
*/
int
-ntb_mw_set_wc(struct ntb_softc *ntb, unsigned idx, bool wc)
+ntb_mw_set_wc(struct ntb_softc *ntb, unsigned idx, vm_memattr_t mode)
{
- struct ntb_pci_bar_info *bar;
- vm_memattr_t attr;
- int rc;
if (idx >= ntb_mw_count(ntb))
return (EINVAL);
+ idx = ntb_user_mw_to_idx(ntb, idx);
+ return (ntb_mw_set_wc_internal(ntb, idx, mode));
+}
+
+static int
+ntb_mw_set_wc_internal(struct ntb_softc *ntb, unsigned idx, vm_memattr_t mode)
+{
+ struct ntb_pci_bar_info *bar;
+ int rc;
+
bar = &ntb->bar_info[ntb_mw_to_bar(ntb, idx)];
- if (bar->mapped_wc == wc)
+ if (bar->map_mode == mode)
return (0);
- if (wc)
- attr = VM_MEMATTR_WRITE_COMBINING;
- else
- attr = VM_MEMATTR_DEFAULT;
+ if (mode != VM_MEMATTR_UNCACHEABLE && mode != VM_MEMATTR_DEFAULT &&
+ mode != VM_MEMATTR_WRITE_COMBINING)
+ return (EINVAL);
- rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, attr);
+ rc = pmap_change_attr((vm_offset_t)bar->vbase, bar->size, mode);
if (rc == 0)
- bar->mapped_wc = wc;
+ bar->map_mode = mode;
return (rc);
}
@@ -2741,9 +2781,6 @@ ntb_get_peer_db_addr(struct ntb_softc *ntb, vm_size_t *sz_out)
bar = &ntb->bar_info[NTB_CONFIG_BAR];
regoff = ntb->peer_reg->db_bell;
} else {
- KASSERT((HAS_FEATURE(NTB_SPLIT_BAR) && ntb->mw_count == 2) ||
- (!HAS_FEATURE(NTB_SPLIT_BAR) && ntb->mw_count == 1),
- ("mw_count invalid after setup"));
KASSERT(ntb->b2b_mw_idx != B2B_MW_DISABLED,
("invalid b2b idx"));
diff --git a/sys/dev/ntb/ntb_hw/ntb_hw.h b/sys/dev/ntb/ntb_hw/ntb_hw.h
index e10b94a..c35166c 100644
--- a/sys/dev/ntb/ntb_hw/ntb_hw.h
+++ b/sys/dev/ntb/ntb_hw/ntb_hw.h
@@ -82,8 +82,8 @@ int ntb_mw_get_range(struct ntb_softc *, unsigned mw_idx, vm_paddr_t *base,
int ntb_mw_set_trans(struct ntb_softc *, unsigned mw_idx, bus_addr_t, size_t);
int ntb_mw_clear_trans(struct ntb_softc *, unsigned mw_idx);
-int ntb_mw_get_wc(struct ntb_softc *, unsigned mw_idx, bool *wc);
-int ntb_mw_set_wc(struct ntb_softc *, unsigned mw_idx, bool wc);
+int ntb_mw_get_wc(struct ntb_softc *, unsigned mw_idx, vm_memattr_t *mode);
+int ntb_mw_set_wc(struct ntb_softc *, unsigned mw_idx, vm_memattr_t mode);
uint8_t ntb_get_max_spads(struct ntb_softc *ntb);
int ntb_spad_write(struct ntb_softc *ntb, unsigned int idx, uint32_t val);
diff --git a/sys/dev/usb/wlan/if_urtwn.c b/sys/dev/usb/wlan/if_urtwn.c
index 53086df..2fe2fcb 100644
--- a/sys/dev/usb/wlan/if_urtwn.c
+++ b/sys/dev/usb/wlan/if_urtwn.c
@@ -214,12 +214,19 @@ static void urtwn_r88e_rf_write(struct urtwn_softc *, int,
static uint32_t urtwn_rf_read(struct urtwn_softc *, int, uint8_t);
static int urtwn_llt_write(struct urtwn_softc *, uint32_t,
uint32_t);
-static uint8_t urtwn_efuse_read_1(struct urtwn_softc *, uint16_t);
-static void urtwn_efuse_read(struct urtwn_softc *);
+static int urtwn_efuse_read_next(struct urtwn_softc *, uint8_t *);
+static int urtwn_efuse_read_data(struct urtwn_softc *, uint8_t *,
+ uint8_t, uint8_t);
+#ifdef URTWN_DEBUG
+static void urtwn_dump_rom_contents(struct urtwn_softc *,
+ uint8_t *, uint16_t);
+#endif
+static int urtwn_efuse_read(struct urtwn_softc *, uint8_t *,
+ uint16_t);
static void urtwn_efuse_switch_power(struct urtwn_softc *);
static int urtwn_read_chipid(struct urtwn_softc *);
-static void urtwn_read_rom(struct urtwn_softc *);
-static void urtwn_r88e_read_rom(struct urtwn_softc *);
+static int urtwn_read_rom(struct urtwn_softc *);
+static int urtwn_r88e_read_rom(struct urtwn_softc *);
static int urtwn_ra_init(struct urtwn_softc *);
static void urtwn_init_beacon(struct urtwn_softc *,
struct urtwn_vap *);
@@ -431,9 +438,15 @@ urtwn_attach(device_t self)
}
if (sc->chip & URTWN_CHIP_88E)
- urtwn_r88e_read_rom(sc);
+ error = urtwn_r88e_read_rom(sc);
else
- urtwn_read_rom(sc);
+ error = urtwn_read_rom(sc);
+ if (error != 0) {
+ device_printf(sc->sc_dev, "%s: cannot read rom, error %d\n",
+ __func__, error);
+ URTWN_UNLOCK(sc);
+ goto detach;
+ }
device_printf(sc->sc_dev, "MAC/BB RTL%s, RF 6052 %dT%dR\n",
(sc->chip & URTWN_CHIP_92C) ? "8192CU" :
@@ -1224,68 +1237,137 @@ urtwn_llt_write(struct urtwn_softc *sc, uint32_t addr, uint32_t data)
return (ETIMEDOUT);
}
-static uint8_t
-urtwn_efuse_read_1(struct urtwn_softc *sc, uint16_t addr)
+static int
+urtwn_efuse_read_next(struct urtwn_softc *sc, uint8_t *val)
{
uint32_t reg;
int ntries;
+ if (sc->last_rom_addr >= URTWN_EFUSE_MAX_LEN)
+ return (EFAULT);
+
reg = urtwn_read_4(sc, R92C_EFUSE_CTRL);
- reg = RW(reg, R92C_EFUSE_CTRL_ADDR, addr);
+ reg = RW(reg, R92C_EFUSE_CTRL_ADDR, sc->last_rom_addr);
reg &= ~R92C_EFUSE_CTRL_VALID;
+
urtwn_write_4(sc, R92C_EFUSE_CTRL, reg);
/* Wait for read operation to complete. */
for (ntries = 0; ntries < 100; ntries++) {
reg = urtwn_read_4(sc, R92C_EFUSE_CTRL);
if (reg & R92C_EFUSE_CTRL_VALID)
- return (MS(reg, R92C_EFUSE_CTRL_DATA));
+ break;
urtwn_ms_delay(sc);
}
- device_printf(sc->sc_dev,
- "could not read efuse byte at address 0x%x\n", addr);
- return (0xff);
+ if (ntries == 100) {
+ device_printf(sc->sc_dev,
+ "could not read efuse byte at address 0x%x\n",
+ sc->last_rom_addr);
+ return (ETIMEDOUT);
+ }
+
+ *val = MS(reg, R92C_EFUSE_CTRL_DATA);
+ sc->last_rom_addr++;
+
+ return (0);
}
+static int
+urtwn_efuse_read_data(struct urtwn_softc *sc, uint8_t *rom, uint8_t off,
+ uint8_t msk)
+{
+ uint8_t reg;
+ int i, error;
+
+ for (i = 0; i < 4; i++) {
+ if (msk & (1 << i))
+ continue;
+ error = urtwn_efuse_read_next(sc, &reg);
+ if (error != 0)
+ return (error);
+ DPRINTF("rom[0x%03X] == 0x%02X\n", off * 8 + i * 2, reg);
+ rom[off * 8 + i * 2 + 0] = reg;
+
+ error = urtwn_efuse_read_next(sc, &reg);
+ if (error != 0)
+ return (error);
+ DPRINTF("rom[0x%03X] == 0x%02X\n", off * 8 + i * 2 + 1, reg);
+ rom[off * 8 + i * 2 + 1] = reg;
+ }
+
+ return (0);
+}
+
+#ifdef URTWN_DEBUG
static void
-urtwn_efuse_read(struct urtwn_softc *sc)
+urtwn_dump_rom_contents(struct urtwn_softc *sc, uint8_t *rom, uint16_t size)
{
- uint8_t *rom = (uint8_t *)&sc->rom;
- uint16_t addr = 0;
- uint32_t reg;
- uint8_t off, msk;
int i;
+ /* Dump ROM contents. */
+ device_printf(sc->sc_dev, "%s:", __func__);
+ for (i = 0; i < size; i++) {
+ if (i % 32 == 0)
+ printf("\n%03X: ", i);
+ else if (i % 4 == 0)
+ printf(" ");
+
+ printf("%02X", rom[i]);
+ }
+ printf("\n");
+}
+#endif
+
+static int
+urtwn_efuse_read(struct urtwn_softc *sc, uint8_t *rom, uint16_t size)
+{
+#define URTWN_CHK(res) do { \
+ if ((error = res) != 0) \
+ goto end; \
+} while(0)
+ uint8_t msk, off, reg;
+ int error;
+
urtwn_efuse_switch_power(sc);
- memset(&sc->rom, 0xff, sizeof(sc->rom));
- while (addr < 512) {
- reg = urtwn_efuse_read_1(sc, addr);
- if (reg == 0xff)
- break;
- addr++;
- off = reg >> 4;
- msk = reg & 0xf;
- for (i = 0; i < 4; i++) {
- if (msk & (1 << i))
+ /* Read full ROM image. */
+ sc->last_rom_addr = 0;
+ memset(rom, 0xff, size);
+
+ URTWN_CHK(urtwn_efuse_read_next(sc, &reg));
+ while (reg != 0xff) {
+ /* check for extended header */
+ if ((sc->chip & URTWN_CHIP_88E) && (reg & 0x1f) == 0x0f) {
+ off = reg >> 5;
+ URTWN_CHK(urtwn_efuse_read_next(sc, &reg));
+
+ if ((reg & 0x0f) != 0x0f)
+ off = ((reg & 0xf0) >> 1) | off;
+ else
continue;
- rom[off * 8 + i * 2 + 0] =
- urtwn_efuse_read_1(sc, addr);
- addr++;
- rom[off * 8 + i * 2 + 1] =
- urtwn_efuse_read_1(sc, addr);
- addr++;
- }
+ } else
+ off = reg >> 4;
+ msk = reg & 0xf;
+
+ URTWN_CHK(urtwn_efuse_read_data(sc, rom, off, msk));
+ URTWN_CHK(urtwn_efuse_read_next(sc, &reg));
}
+
+end:
+
#ifdef URTWN_DEBUG
- if (urtwn_debug >= 2) {
- /* Dump ROM content. */
- printf("\n");
- for (i = 0; i < sizeof(sc->rom); i++)
- printf("%02x:", rom[i]);
- printf("\n");
- }
+ if (urtwn_debug >= 2)
+ urtwn_dump_rom_contents(sc, rom, size);
#endif
+
urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_OFF);
+
+ if (error != 0) {
+ device_printf(sc->sc_dev, "%s: error while reading ROM\n",
+ __func__);
+ }
+
+ return (error);
+#undef URTWN_CHK
}
static void
@@ -1341,16 +1423,22 @@ urtwn_read_chipid(struct urtwn_softc *sc)
return (0);
}
-static void
+static int
urtwn_read_rom(struct urtwn_softc *sc)
{
- struct r92c_rom *rom = &sc->rom;
+ struct r92c_rom *rom = &sc->rom.r92c_rom;
+ int error;
/* Read full ROM image. */
- urtwn_efuse_read(sc);
+ error = urtwn_efuse_read(sc, (uint8_t *)rom, sizeof(*rom));
+ if (error != 0)
+ return (error);
/* XXX Weird but this is what the vendor driver does. */
- sc->pa_setting = urtwn_efuse_read_1(sc, 0x1fa);
+ sc->last_rom_addr = 0x1fa;
+ error = urtwn_efuse_read_next(sc, &sc->pa_setting);
+ if (error != 0)
+ return (error);
DPRINTF("PA setting=0x%x\n", sc->pa_setting);
sc->board_type = MS(rom->rf_opt1, R92C_ROM_RF1_BOARD_TYPE);
@@ -1362,67 +1450,40 @@ urtwn_read_rom(struct urtwn_softc *sc)
sc->sc_rf_write = urtwn_r92c_rf_write;
sc->sc_power_on = urtwn_r92c_power_on;
sc->sc_dma_init = urtwn_r92c_dma_init;
+
+ return (0);
}
-static void
+static int
urtwn_r88e_read_rom(struct urtwn_softc *sc)
{
- uint8_t *rom = sc->r88e_rom;
- uint16_t addr = 0;
- uint32_t reg;
- uint8_t off, msk, tmp;
- int i;
-
- off = 0;
- urtwn_efuse_switch_power(sc);
-
- /* Read full ROM image. */
- memset(&sc->r88e_rom, 0xff, sizeof(sc->r88e_rom));
- while (addr < 512) {
- reg = urtwn_efuse_read_1(sc, addr);
- if (reg == 0xff)
- break;
- addr++;
- if ((reg & 0x1f) == 0x0f) {
- tmp = (reg & 0xe0) >> 5;
- reg = urtwn_efuse_read_1(sc, addr);
- if ((reg & 0x0f) != 0x0f)
- off = ((reg & 0xf0) >> 1) | tmp;
- addr++;
- } else
- off = reg >> 4;
- msk = reg & 0xf;
- for (i = 0; i < 4; i++) {
- if (msk & (1 << i))
- continue;
- rom[off * 8 + i * 2 + 0] =
- urtwn_efuse_read_1(sc, addr);
- addr++;
- rom[off * 8 + i * 2 + 1] =
- urtwn_efuse_read_1(sc, addr);
- addr++;
- }
- }
+ uint8_t *rom = sc->rom.r88e_rom;
+ uint16_t addr;
+ int error, i;
- urtwn_write_1(sc, R92C_EFUSE_ACCESS, R92C_EFUSE_ACCESS_OFF);
+ error = urtwn_efuse_read(sc, rom, sizeof(sc->rom.r88e_rom));
+ if (error != 0)
+ return (error);
addr = 0x10;
for (i = 0; i < 6; i++)
- sc->cck_tx_pwr[i] = sc->r88e_rom[addr++];
+ sc->cck_tx_pwr[i] = rom[addr++];
for (i = 0; i < 5; i++)
- sc->ht40_tx_pwr[i] = sc->r88e_rom[addr++];
- sc->bw20_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf0) >> 4;
+ sc->ht40_tx_pwr[i] = rom[addr++];
+ sc->bw20_tx_pwr_diff = (rom[addr] & 0xf0) >> 4;
if (sc->bw20_tx_pwr_diff & 0x08)
sc->bw20_tx_pwr_diff |= 0xf0;
- sc->ofdm_tx_pwr_diff = (sc->r88e_rom[addr] & 0xf);
+ sc->ofdm_tx_pwr_diff = (rom[addr] & 0xf);
if (sc->ofdm_tx_pwr_diff & 0x08)
sc->ofdm_tx_pwr_diff |= 0xf0;
- sc->regulatory = MS(sc->r88e_rom[0xc1], R92C_ROM_RF1_REGULATORY);
- IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, &sc->r88e_rom[0xd7]);
+ sc->regulatory = MS(rom[0xc1], R92C_ROM_RF1_REGULATORY);
+ IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, &rom[0xd7]);
sc->sc_rf_write = urtwn_r88e_rf_write;
sc->sc_power_on = urtwn_r88e_power_on;
sc->sc_dma_init = urtwn_r88e_dma_init;
+
+ return (0);
}
/*
@@ -2944,7 +3005,7 @@ urtwn_bb_init(struct urtwn_softc *sc)
urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), 0x69553420);
urtwn_ms_delay(sc);
- crystalcap = sc->r88e_rom[0xb9];
+ crystalcap = sc->rom.r88e_rom[0xb9];
if (crystalcap == 0xff)
crystalcap = 0x20;
crystalcap &= 0x3f;
@@ -3210,7 +3271,7 @@ urtwn_get_txpower(struct urtwn_softc *sc, int chain,
uint16_t power[URTWN_RIDX_COUNT])
{
struct ieee80211com *ic = &sc->sc_ic;
- struct r92c_rom *rom = &sc->rom;
+ struct r92c_rom *rom = &sc->rom.r92c_rom;
uint16_t cckpow, ofdmpow, htpow, diff, max;
const struct urtwn_txpwr *base;
int ridx, chan, group;
diff --git a/sys/dev/usb/wlan/if_urtwnreg.h b/sys/dev/usb/wlan/if_urtwnreg.h
index 4020d2f..b3aaa9c 100644
--- a/sys/dev/usb/wlan/if_urtwnreg.h
+++ b/sys/dev/usb/wlan/if_urtwnreg.h
@@ -938,6 +938,8 @@ struct r92c_rom {
uint8_t curstomer_id;
} __packed;
+#define URTWN_EFUSE_MAX_LEN 512
+
/* Rx MAC descriptor. */
struct r92c_rx_stat {
uint32_t rxdw0;
diff --git a/sys/dev/usb/wlan/if_urtwnvar.h b/sys/dev/usb/wlan/if_urtwnvar.h
index 17d9a66..2fb47f3 100644
--- a/sys/dev/usb/wlan/if_urtwnvar.h
+++ b/sys/dev/usb/wlan/if_urtwnvar.h
@@ -128,6 +128,11 @@ enum {
#define URTWN_EP_QUEUES URTWN_BULK_RX
+union urtwn_rom {
+ struct r92c_rom r92c_rom;
+ uint8_t r88e_rom[URTWN_EFUSE_MAX_LEN];
+};
+
struct urtwn_softc {
struct ieee80211com sc_ic;
struct mbufq sc_snd;
@@ -177,12 +182,12 @@ struct urtwn_softc {
struct urtwn_fw_info fw;
void *fw_virtaddr;
- struct r92c_rom rom;
- uint8_t r88e_rom[512];
+ union urtwn_rom rom;
uint8_t cck_tx_pwr[6];
uint8_t ht40_tx_pwr[5];
int8_t bw20_tx_pwr_diff;
int8_t ofdm_tx_pwr_diff;
+ uint16_t last_rom_addr;
struct callout sc_watchdog_ch;
struct mtx sc_mtx;
diff --git a/sys/kern/kern_hhook.c b/sys/kern/kern_hhook.c
index 321e1a9..12410cb 100644
--- a/sys/kern/kern_hhook.c
+++ b/sys/kern/kern_hhook.c
@@ -101,7 +101,8 @@ hhook_run_hooks(struct hhook_head *hhh, void *ctx_data, struct osd *hosd)
HHH_RLOCK(hhh, &rmpt);
STAILQ_FOREACH(hhk, &hhh->hhh_hooks, hhk_next) {
- if (hhk->hhk_helper->h_flags & HELPER_NEEDS_OSD) {
+ if (hhk->hhk_helper != NULL &&
+ hhk->hhk_helper->h_flags & HELPER_NEEDS_OSD) {
hdata = osd_get(OSD_KHELP, hosd, hhk->hhk_helper->h_id);
if (hdata == NULL)
continue;
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index c2f6c50..9d0a227 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -146,24 +146,38 @@ int vttoif_tab[10] = {
static TAILQ_HEAD(freelst, vnode) vnode_free_list;
/*
- * Free vnode target. Free vnodes may simply be files which have been stat'd
- * but not read. This is somewhat common, and a small cache of such files
- * should be kept to avoid recreation costs.
+ * "Free" vnode target. Free vnodes are rarely completely free, but are
+ * just ones that are cheap to recycle. Usually they are for files which
+ * have been stat'd but not read; these usually have inode and namecache
+ * data attached to them. This target is the preferred minimum size of a
+ * sub-cache consisting mostly of such files. The system balances the size
+ * of this sub-cache with its complement to try to prevent either from
+ * thrashing while the other is relatively inactive. The targets express
+ * a preference for the best balance.
+ *
+ * "Above" this target there are 2 further targets (watermarks) related
+ * to recyling of free vnodes. In the best-operating case, the cache is
+ * exactly full, the free list has size between vlowat and vhiwat above the
+ * free target, and recycling from it and normal use maintains this state.
+ * Sometimes the free list is below vlowat or even empty, but this state
+ * is even better for immediate use provided the cache is not full.
+ * Otherwise, vnlru_proc() runs to reclaim enough vnodes (usually non-free
+ * ones) to reach one of these states. The watermarks are currently hard-
+ * coded as 4% and 9% of the available space higher. These and the default
+ * of 25% for wantfreevnodes are too large if the memory size is large.
+ * E.g., 9% of 75% of MAXVNODES is more than 566000 vnodes to reclaim
+ * whenever vnlru_proc() becomes active.
*/
static u_long wantfreevnodes;
-SYSCTL_ULONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW, &wantfreevnodes, 0, "");
-/* Number of vnodes in the free list. */
+SYSCTL_ULONG(_vfs, OID_AUTO, wantfreevnodes, CTLFLAG_RW,
+ &wantfreevnodes, 0, "Target for minimum number of \"free\" vnodes");
static u_long freevnodes;
-SYSCTL_ULONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD, &freevnodes, 0,
- "Number of vnodes in the free list");
-
-static int vlru_allow_cache_src;
-SYSCTL_INT(_vfs, OID_AUTO, vlru_allow_cache_src, CTLFLAG_RW,
- &vlru_allow_cache_src, 0, "Allow vlru to reclaim source vnode");
+SYSCTL_ULONG(_vfs, OID_AUTO, freevnodes, CTLFLAG_RD,
+ &freevnodes, 0, "Number of \"free\" vnodes");
static u_long recycles_count;
SYSCTL_ULONG(_vfs, OID_AUTO, recycles, CTLFLAG_RD, &recycles_count, 0,
- "Number of vnodes recycled to avoid exceding kern.maxvnodes");
+ "Number of vnodes recycled to meet vnode cache targets");
/*
* Various variables used for debugging the new implementation of
@@ -267,14 +281,13 @@ static int syncer_worklist_len;
static enum { SYNCER_RUNNING, SYNCER_SHUTTING_DOWN, SYNCER_FINAL_DELAY }
syncer_state;
-/*
- * Number of vnodes we want to exist at any one time. This is mostly used
- * to size hash tables in vnode-related code. It is normally not used in
- * getnewvnode(), as wantfreevnodes is normally nonzero.)
- *
- * XXX desiredvnodes is historical cruft and should not exist.
- */
+/* Target for maximum number of vnodes. */
int desiredvnodes;
+static int gapvnodes; /* gap between wanted and desired */
+static int vhiwat; /* enough extras after expansion */
+static int vlowat; /* minimal extras before expansion */
+static int vstir; /* nonzero to stir non-free vnodes */
+static volatile int vsmalltrigger = 8; /* pref to keep if > this many pages */
static int
sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS)
@@ -285,6 +298,8 @@ sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS)
if ((error = sysctl_handle_int(oidp, arg1, arg2, req)) != 0)
return (error);
if (old_desiredvnodes != desiredvnodes) {
+ wantfreevnodes = desiredvnodes / 4;
+ /* XXX locking seems to be incomplete. */
vfs_hash_changesize(desiredvnodes);
cache_changesize(desiredvnodes);
}
@@ -293,9 +308,9 @@ sysctl_update_desiredvnodes(SYSCTL_HANDLER_ARGS)
SYSCTL_PROC(_kern, KERN_MAXVNODES, maxvnodes,
CTLTYPE_INT | CTLFLAG_MPSAFE | CTLFLAG_RW, &desiredvnodes, 0,
- sysctl_update_desiredvnodes, "I", "Maximum number of vnodes");
+ sysctl_update_desiredvnodes, "I", "Target for maximum number of vnodes");
SYSCTL_ULONG(_kern, OID_AUTO, minvnodes, CTLFLAG_RW,
- &wantfreevnodes, 0, "Minimum number of vnodes (legacy)");
+ &wantfreevnodes, 0, "Old name for vfs.wantfreevnodes (legacy)");
static int vnlru_nowhere;
SYSCTL_INT(_debug, OID_AUTO, vnlru_nowhere, CTLFLAG_RW,
&vnlru_nowhere, 0, "Number of times the vnlru process ran without success");
@@ -326,10 +341,10 @@ PCTRIE_DEFINE(BUF, buf, b_lblkno, buf_trie_alloc, buf_trie_free);
*
* Reevaluate the following cap on the number of vnodes after the physical
* memory size exceeds 512GB. In the limit, as the physical memory size
- * grows, the ratio of physical pages to vnodes approaches sixteen to one.
+ * grows, the ratio of the memory size in KB to to vnodes approaches 64:1.
*/
#ifndef MAXVNODES_MAX
-#define MAXVNODES_MAX (512 * (1024 * 1024 * 1024 / (int)PAGE_SIZE / 16))
+#define MAXVNODES_MAX (512 * 1024 * 1024 / 64) /* 8M */
#endif
static void
vntblinit(void *dummy __unused)
@@ -340,15 +355,16 @@ vntblinit(void *dummy __unused)
/*
* Desiredvnodes is a function of the physical memory size and the
* kernel's heap size. Generally speaking, it scales with the
- * physical memory size. The ratio of desiredvnodes to physical pages
- * is one to four until desiredvnodes exceeds 98,304. Thereafter, the
- * marginal ratio of desiredvnodes to physical pages is one to
- * sixteen. However, desiredvnodes is limited by the kernel's heap
+ * physical memory size. The ratio of desiredvnodes to the physical
+ * memory size is 1:16 until desiredvnodes exceeds 98,304.
+ * Thereafter, the
+ * marginal ratio of desiredvnodes to the physical memory size is
+ * 1:64. However, desiredvnodes is limited by the kernel's heap
* size. The memory required by desiredvnodes vnodes and vm objects
- * may not exceed one seventh of the kernel's heap size.
+ * must not exceed 1/7th of the kernel's heap size.
*/
- physvnodes = maxproc + vm_cnt.v_page_count / 16 + 3 * min(98304 * 4,
- vm_cnt.v_page_count) / 16;
+ physvnodes = maxproc + pgtok(vm_cnt.v_page_count) / 64 +
+ 3 * min(98304 * 16, pgtok(vm_cnt.v_page_count)) / 64;
virtvnodes = vm_kmem_size / (7 * (sizeof(struct vm_object) +
sizeof(struct vnode)));
desiredvnodes = min(physvnodes, virtvnodes);
@@ -737,35 +753,41 @@ vattr_null(struct vattr *vap)
* you set kern.maxvnodes to. Do not set kern.maxvnodes too low.
*/
static int
-vlrureclaim(struct mount *mp)
+vlrureclaim(struct mount *mp, int reclaim_nc_src, int trigger)
{
struct vnode *vp;
- int done;
- int trigger;
- int usevnodes;
- int count;
+ int count, done, target;
- /*
- * Calculate the trigger point, don't allow user
- * screwups to blow us up. This prevents us from
- * recycling vnodes with lots of resident pages. We
- * aren't trying to free memory, we are trying to
- * free vnodes.
- */
- usevnodes = desiredvnodes;
- if (usevnodes <= 0)
- usevnodes = 1;
- trigger = vm_cnt.v_page_count * 2 / usevnodes;
done = 0;
vn_start_write(NULL, &mp, V_WAIT);
MNT_ILOCK(mp);
- count = mp->mnt_nvnodelistsize / 10 + 1;
- while (count != 0) {
+ count = mp->mnt_nvnodelistsize;
+ target = count * (int64_t)gapvnodes / imax(desiredvnodes, 1);
+ target = target / 10 + 1;
+ while (count != 0 && done < target) {
vp = TAILQ_FIRST(&mp->mnt_nvnodelist);
while (vp != NULL && vp->v_type == VMARKER)
vp = TAILQ_NEXT(vp, v_nmntvnodes);
if (vp == NULL)
break;
+ /*
+ * XXX LRU is completely broken for non-free vnodes. First
+ * by calling here in mountpoint order, then by moving
+ * unselected vnodes to the end here, and most grossly by
+ * removing the vlruvp() function that was supposed to
+ * maintain the order. (This function was born broken
+ * since syncer problems prevented it doing anything.) The
+ * order is closer to LRC (C = Created).
+ *
+ * LRU reclaiming of vnodes seems to have last worked in
+ * FreeBSD-3 where LRU wasn't mentioned under any spelling.
+ * Then there was no hold count, and inactive vnodes were
+ * simply put on the free list in LRU order. The separate
+ * lists also break LRU. We prefer to reclaim from the
+ * free list for technical reasons. This tends to thrash
+ * the free list to keep very unrecently used held vnodes.
+ * The problem is mitigated by keeping the free list large.
+ */
TAILQ_REMOVE(&mp->mnt_nvnodelist, vp, v_nmntvnodes);
TAILQ_INSERT_TAIL(&mp->mnt_nvnodelist, vp, v_nmntvnodes);
--count;
@@ -774,10 +796,12 @@ vlrureclaim(struct mount *mp)
/*
* If it's been deconstructed already, it's still
* referenced, or it exceeds the trigger, skip it.
+ * Also skip free vnodes. We are trying to make space
+ * to expand the free list, not reduce it.
*/
if (vp->v_usecount ||
- (!vlru_allow_cache_src &&
- !LIST_EMPTY(&(vp)->v_cache_src)) ||
+ (!reclaim_nc_src && !LIST_EMPTY(&vp->v_cache_src)) ||
+ ((vp->v_iflag & VI_FREE) != 0) ||
(vp->v_iflag & VI_DOOMED) != 0 || (vp->v_object != NULL &&
vp->v_object->resident_page_count > trigger)) {
VI_UNLOCK(vp);
@@ -803,8 +827,8 @@ vlrureclaim(struct mount *mp)
* vnode lock before our VOP_LOCK() call fails.
*/
if (vp->v_usecount ||
- (!vlru_allow_cache_src &&
- !LIST_EMPTY(&(vp)->v_cache_src)) ||
+ (!reclaim_nc_src && !LIST_EMPTY(&vp->v_cache_src)) ||
+ (vp->v_iflag & VI_FREE) != 0 ||
(vp->v_object != NULL &&
vp->v_object->resident_page_count > trigger)) {
VOP_UNLOCK(vp, LK_INTERLOCK);
@@ -837,7 +861,7 @@ relock_mnt:
}
/*
- * Attempt to keep the free list at wantfreevnodes length.
+ * Attempt to reduce the free list by the requested amount.
*/
static void
vnlru_free(int count)
@@ -894,6 +918,24 @@ vnlru_free(int count)
mtx_lock(&vnode_free_list_mtx);
}
}
+
+/* XXX some names and initialization are bad for limits and watermarks. */
+static int
+vspace(void)
+{
+ int space;
+
+ gapvnodes = imax(desiredvnodes - wantfreevnodes, 100);
+ vhiwat = gapvnodes / 11; /* 9% -- just under the 10% in vlrureclaim() */
+ vlowat = vhiwat / 2;
+ if (numvnodes > desiredvnodes)
+ return (0);
+ space = desiredvnodes - numvnodes;
+ if (freevnodes > wantfreevnodes)
+ space += freevnodes - wantfreevnodes;
+ return (space);
+}
+
/*
* Attempt to recycle vnodes in a context that is always safe to block.
* Calling vlrurecycle() from the bowels of filesystem code has some
@@ -906,18 +948,36 @@ static void
vnlru_proc(void)
{
struct mount *mp, *nmp;
- int done;
- struct proc *p = vnlruproc;
+ unsigned long ofreevnodes, onumvnodes;
+ int done, force, reclaim_nc_src, trigger, usevnodes;
- EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, p,
+ EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, vnlruproc,
SHUTDOWN_PRI_FIRST);
+ force = 0;
for (;;) {
- kproc_suspend_check(p);
+ kproc_suspend_check(vnlruproc);
mtx_lock(&vnode_free_list_mtx);
- if (freevnodes > wantfreevnodes)
- vnlru_free(freevnodes - wantfreevnodes);
- if (numvnodes <= desiredvnodes * 9 / 10) {
+ /*
+ * If numvnodes is too large (due to desiredvnodes being
+ * adjusted using its sysctl, or emergency growth), first
+ * try to reduce it by discarding from the free list.
+ */
+ if (numvnodes > desiredvnodes && freevnodes > 0)
+ vnlru_free(ulmin(numvnodes - desiredvnodes,
+ freevnodes));
+ /*
+ * Sleep if the vnode cache is in a good state. This is
+ * when it is not over-full and has space for about a 4%
+ * or 9% expansion (by growing its size or inexcessively
+ * reducing its free list). Otherwise, try to reclaim
+ * space for a 10% expansion.
+ */
+ if (vstir && force == 0) {
+ force = 1;
+ vstir = 0;
+ }
+ if (vspace() >= vlowat && force == 0) {
vnlruproc_sig = 0;
wakeup(&vnlruproc_sig);
msleep(vnlruproc, &vnode_free_list_mtx,
@@ -926,30 +986,66 @@ vnlru_proc(void)
}
mtx_unlock(&vnode_free_list_mtx);
done = 0;
+ ofreevnodes = freevnodes;
+ onumvnodes = numvnodes;
+ /*
+ * Calculate parameters for recycling. These are the same
+ * throughout the loop to give some semblance of fairness.
+ * The trigger point is to avoid recycling vnodes with lots
+ * of resident pages. We aren't trying to free memory; we
+ * are trying to recycle or at least free vnodes.
+ */
+ if (numvnodes <= desiredvnodes)
+ usevnodes = numvnodes - freevnodes;
+ else
+ usevnodes = numvnodes;
+ if (usevnodes <= 0)
+ usevnodes = 1;
+ /*
+ * The trigger value is is chosen to give a conservatively
+ * large value to ensure that it alone doesn't prevent
+ * making progress. The value can easily be so large that
+ * it is effectively infinite in some congested and
+ * misconfigured cases, and this is necessary. Normally
+ * it is about 8 to 100 (pages), which is quite large.
+ */
+ trigger = vm_cnt.v_page_count * 2 / usevnodes;
+ if (force < 2)
+ trigger = vsmalltrigger;
+ reclaim_nc_src = force >= 3;
mtx_lock(&mountlist_mtx);
for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) {
if (vfs_busy(mp, MBF_NOWAIT | MBF_MNTLSTLOCK)) {
nmp = TAILQ_NEXT(mp, mnt_list);
continue;
}
- done += vlrureclaim(mp);
+ done += vlrureclaim(mp, reclaim_nc_src, trigger);
mtx_lock(&mountlist_mtx);
nmp = TAILQ_NEXT(mp, mnt_list);
vfs_unbusy(mp);
}
mtx_unlock(&mountlist_mtx);
+ if (onumvnodes > desiredvnodes && numvnodes <= desiredvnodes)
+ uma_reclaim();
if (done == 0) {
-#if 0
- /* These messages are temporary debugging aids */
- if (vnlru_nowhere < 5)
- printf("vnlru process getting nowhere..\n");
- else if (vnlru_nowhere == 5)
- printf("vnlru process messages stopped.\n");
-#endif
+ if (force == 0 || force == 1) {
+ force = 2;
+ continue;
+ }
+ if (force == 2) {
+ force = 3;
+ continue;
+ }
+ force = 0;
vnlru_nowhere++;
tsleep(vnlruproc, PPAUSE, "vlrup", hz * 3);
} else
kern_yield(PRI_USER);
+ /*
+ * After becoming active to expand above low water, keep
+ * active until above high water.
+ */
+ force = vspace() < vhiwat;
}
}
@@ -1023,22 +1119,31 @@ vtryrecycle(struct vnode *vp)
return (0);
}
+static void
+vcheckspace(void)
+{
+
+ if (vspace() < vlowat && vnlruproc_sig == 0) {
+ vnlruproc_sig = 1;
+ wakeup(vnlruproc);
+ }
+}
+
/*
- * Wait for available vnodes.
+ * Wait if necessary for space for a new vnode.
*/
static int
getnewvnode_wait(int suspended)
{
mtx_assert(&vnode_free_list_mtx, MA_OWNED);
- if (numvnodes > desiredvnodes) {
+ if (numvnodes >= desiredvnodes) {
if (suspended) {
/*
- * File system is beeing suspended, we cannot risk a
- * deadlock here, so allocate new vnode anyway.
+ * The file system is being suspended. We cannot
+ * risk a deadlock here, so allow allocation of
+ * another vnode even if this would give too many.
*/
- if (freevnodes > wantfreevnodes)
- vnlru_free(freevnodes - wantfreevnodes);
return (0);
}
if (vnlruproc_sig == 0) {
@@ -1048,18 +1153,34 @@ getnewvnode_wait(int suspended)
msleep(&vnlruproc_sig, &vnode_free_list_mtx, PVFS,
"vlruwk", hz);
}
- return (numvnodes > desiredvnodes ? ENFILE : 0);
+ /* Post-adjust like the pre-adjust in getnewvnode(). */
+ if (numvnodes + 1 > desiredvnodes && freevnodes > 1)
+ vnlru_free(1);
+ return (numvnodes >= desiredvnodes ? ENFILE : 0);
}
+/*
+ * This hack is fragile, and probably not needed any more now that the
+ * watermark handling works.
+ */
void
getnewvnode_reserve(u_int count)
{
struct thread *td;
+ /* Pre-adjust like the pre-adjust in getnewvnode(), with any count. */
+ /* XXX no longer so quick, but this part is not racy. */
+ mtx_lock(&vnode_free_list_mtx);
+ if (numvnodes + count > desiredvnodes && freevnodes > wantfreevnodes)
+ vnlru_free(ulmin(numvnodes + count - desiredvnodes,
+ freevnodes - wantfreevnodes));
+ mtx_unlock(&vnode_free_list_mtx);
+
td = curthread;
/* First try to be quick and racy. */
if (atomic_fetchadd_long(&numvnodes, count) + count <= desiredvnodes) {
td->td_vp_reserv += count;
+ vcheckspace(); /* XXX no longer so quick, but more racy */
return;
} else
atomic_subtract_long(&numvnodes, count);
@@ -1072,9 +1193,18 @@ getnewvnode_reserve(u_int count)
atomic_add_long(&numvnodes, 1);
}
}
+ vcheckspace();
mtx_unlock(&vnode_free_list_mtx);
}
+/*
+ * This hack is fragile, especially if desiredvnodes or wantvnodes are
+ * misconfgured or changed significantly. Reducing desiredvnodes below
+ * the reserved amount should cause bizarre behaviour like reducing it
+ * below the number of active vnodes -- the system will try to reduce
+ * numvnodes to match, but should fail, so the subtraction below should
+ * not overflow.
+ */
void
getnewvnode_drop_reserve(void)
{
@@ -1095,6 +1225,7 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops,
struct vnode *vp;
struct bufobj *bo;
struct thread *td;
+ static int cyclecount;
int error;
CTR3(KTR_VFS, "%s: mp %p with tag %s", __func__, mp, tag);
@@ -1105,19 +1236,37 @@ getnewvnode(const char *tag, struct mount *mp, struct vop_vector *vops,
goto alloc;
}
mtx_lock(&vnode_free_list_mtx);
+ if (numvnodes < desiredvnodes)
+ cyclecount = 0;
+ else if (cyclecount++ >= freevnodes) {
+ cyclecount = 0;
+ vstir = 1;
+ }
/*
- * Lend our context to reclaim vnodes if they've exceeded the max.
+ * Grow the vnode cache if it will not be above its target max
+ * after growing. Otherwise, if the free list is nonempty, try
+ * to reclaim 1 item from it before growing the cache (possibly
+ * above its target max if the reclamation failed or is delayed).
+ * Otherwise, wait for some space. In all cases, schedule
+ * vnlru_proc() if we are getting short of space. The watermarks
+ * should be chosen so that we never wait or even reclaim from
+ * the free list to below its target minimum.
*/
- if (freevnodes > wantfreevnodes)
+ if (numvnodes + 1 <= desiredvnodes)
+ ;
+ else if (freevnodes > 0)
vnlru_free(1);
- error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag &
- MNTK_SUSPEND));
+ else {
+ error = getnewvnode_wait(mp != NULL && (mp->mnt_kern_flag &
+ MNTK_SUSPEND));
#if 0 /* XXX Not all VFS_VGET/ffs_vget callers check returns. */
- if (error != 0) {
- mtx_unlock(&vnode_free_list_mtx);
- return (error);
- }
+ if (error != 0) {
+ mtx_unlock(&vnode_free_list_mtx);
+ return (error);
+ }
#endif
+ }
+ vcheckspace();
atomic_add_long(&numvnodes, 1);
mtx_unlock(&vnode_free_list_mtx);
alloc:
@@ -2517,6 +2666,7 @@ _vdrop(struct vnode *vp, bool locked)
v_actfreelist);
mp->mnt_activevnodelistsize--;
}
+ /* XXX V*AGE hasn't been set since 1997. */
if (vp->v_iflag & VI_AGE) {
TAILQ_INSERT_HEAD(&vnode_free_list, vp,
v_actfreelist);
diff --git a/sys/modules/Makefile b/sys/modules/Makefile
index 30d766a..6ae1e3d 100644
--- a/sys/modules/Makefile
+++ b/sys/modules/Makefile
@@ -142,6 +142,7 @@ SUBDIR= \
if_bridge \
if_disc \
if_edsc \
+ ${_if_enc} \
if_epair \
${_if_gif} \
${_if_gre} \
@@ -429,6 +430,7 @@ SUBDIR+= cuse
defined(ALL_MODULES)
_carp= carp
_toecore= toecore
+_if_enc= if_enc
_if_gif= if_gif
_if_gre= if_gre
.endif
diff --git a/sys/modules/if_enc/Makefile b/sys/modules/if_enc/Makefile
new file mode 100644
index 0000000..5ecdb9e
--- /dev/null
+++ b/sys/modules/if_enc/Makefile
@@ -0,0 +1,11 @@
+# $FreeBSD$
+
+SYSDIR?=${.CURDIR}/../..
+.include "${SYSDIR}/conf/kern.opts.mk"
+
+.PATH: ${SYSDIR}/net
+
+KMOD= if_enc
+SRCS= if_enc.c opt_inet.h opt_inet6.h
+
+.include <bsd.kmod.mk>
diff --git a/sys/net/if.c b/sys/net/if.c
index ba326b7..b88c05e 100644
--- a/sys/net/if.c
+++ b/sys/net/if.c
@@ -183,6 +183,10 @@ static void if_detach_internal(struct ifnet *, int, struct if_clone **);
extern void nd6_setmtu(struct ifnet *);
#endif
+/* ipsec helper hooks */
+VNET_DEFINE(struct hhook_head *, ipsec_hhh_in[HHOOK_IPSEC_COUNT]);
+VNET_DEFINE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]);
+
VNET_DEFINE(int, if_index);
int ifqmaxlen = IFQ_MAXLEN;
VNET_DEFINE(struct ifnethead, ifnet); /* depend on static init XXX */
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index b43b7d2..e3bf5b8 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2006 The FreeBSD Project.
+ * Copyright (c) 2015 Andrey V. Elsukov <ae@FreeBSD.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,10 +30,10 @@
#include "opt_inet.h"
#include "opt_inet6.h"
-#include "opt_enc.h"
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/hhook.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
@@ -44,6 +45,7 @@
#include <sys/sysctl.h>
#include <net/if.h>
+#include <net/if_enc.h>
#include <net/if_var.h>
#include <net/if_clone.h>
#include <net/if_types.h>
@@ -79,56 +81,67 @@ struct enchdr {
u_int32_t spi;
u_int32_t flags;
};
-
-struct ifnet *encif;
-static struct mtx enc_mtx;
-
struct enc_softc {
struct ifnet *sc_ifp;
};
+static VNET_DEFINE(struct enc_softc *, enc_sc);
+#define V_enc_sc VNET(enc_sc)
+static VNET_DEFINE(struct if_clone *, enc_cloner);
+#define V_enc_cloner VNET(enc_cloner)
static int enc_ioctl(struct ifnet *, u_long, caddr_t);
-static int enc_output(struct ifnet *ifp, struct mbuf *m,
- const struct sockaddr *dst, struct route *ro);
+static int enc_output(struct ifnet *, struct mbuf *,
+ const struct sockaddr *, struct route *);
static int enc_clone_create(struct if_clone *, int, caddr_t);
static void enc_clone_destroy(struct ifnet *);
-static struct if_clone *enc_cloner;
-static const char encname[] = "enc";
+static int enc_add_hhooks(struct enc_softc *);
+static void enc_remove_hhooks(struct enc_softc *);
-/*
- * Sysctls.
- */
+static const char encname[] = "enc";
/*
* Before and after are relative to when we are stripping the
* outer IP header.
*/
-static SYSCTL_NODE(_net, OID_AUTO, enc, CTLFLAG_RW, 0, "enc sysctl");
+static VNET_DEFINE(int, filter_mask_in) = IPSEC_ENC_BEFORE;
+static VNET_DEFINE(int, bpf_mask_in) = IPSEC_ENC_BEFORE;
+static VNET_DEFINE(int, filter_mask_out) = IPSEC_ENC_BEFORE;
+static VNET_DEFINE(int, bpf_mask_out) = IPSEC_ENC_BEFORE | IPSEC_ENC_AFTER;
+#define V_filter_mask_in VNET(filter_mask_in)
+#define V_bpf_mask_in VNET(bpf_mask_in)
+#define V_filter_mask_out VNET(filter_mask_out)
+#define V_bpf_mask_out VNET(bpf_mask_out)
+static SYSCTL_NODE(_net, OID_AUTO, enc, CTLFLAG_RW, 0, "enc sysctl");
static SYSCTL_NODE(_net_enc, OID_AUTO, in, CTLFLAG_RW, 0, "enc input sysctl");
-static int ipsec_filter_mask_in = ENC_BEFORE;
-SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW,
- &ipsec_filter_mask_in, 0, "IPsec input firewall filter mask");
-static int ipsec_bpf_mask_in = ENC_BEFORE;
-SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW,
- &ipsec_bpf_mask_in, 0, "IPsec input bpf mask");
-
static SYSCTL_NODE(_net_enc, OID_AUTO, out, CTLFLAG_RW, 0, "enc output sysctl");
-static int ipsec_filter_mask_out = ENC_BEFORE;
-SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_filter_mask, CTLFLAG_RW,
- &ipsec_filter_mask_out, 0, "IPsec output firewall filter mask");
-static int ipsec_bpf_mask_out = ENC_BEFORE|ENC_AFTER;
-SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_bpf_mask, CTLFLAG_RW,
- &ipsec_bpf_mask_out, 0, "IPsec output bpf mask");
+SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_filter_mask,
+ CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(filter_mask_in), 0,
+ "IPsec input firewall filter mask");
+SYSCTL_INT(_net_enc_in, OID_AUTO, ipsec_bpf_mask,
+ CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(bpf_mask_in), 0,
+ "IPsec input bpf mask");
+SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_filter_mask,
+ CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(filter_mask_out), 0,
+ "IPsec output firewall filter mask");
+SYSCTL_INT(_net_enc_out, OID_AUTO, ipsec_bpf_mask,
+ CTLFLAG_RW | CTLFLAG_VNET, &VNET_NAME(bpf_mask_out), 0,
+ "IPsec output bpf mask");
static void
enc_clone_destroy(struct ifnet *ifp)
{
- KASSERT(ifp != encif, ("%s: destroying encif", __func__));
+ struct enc_softc *sc;
+ sc = ifp->if_softc;
+ KASSERT(sc == V_enc_sc, ("sc != ifp->if_softc"));
+
+ enc_remove_hhooks(sc);
bpfdetach(ifp);
if_detach(ifp);
if_free(ifp);
+ free(sc, M_DEVBUF);
+ V_enc_sc = NULL;
}
static int
@@ -137,234 +150,255 @@ enc_clone_create(struct if_clone *ifc, int unit, caddr_t params)
struct ifnet *ifp;
struct enc_softc *sc;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
+ sc = malloc(sizeof(struct enc_softc), M_DEVBUF,
+ M_WAITOK | M_ZERO);
ifp = sc->sc_ifp = if_alloc(IFT_ENC);
if (ifp == NULL) {
free(sc, M_DEVBUF);
return (ENOSPC);
}
-
+ if (V_enc_sc != NULL) {
+ if_free(ifp);
+ free(sc, M_DEVBUF);
+ return (EEXIST);
+ }
+ V_enc_sc = sc;
if_initname(ifp, encname, unit);
ifp->if_mtu = ENCMTU;
ifp->if_ioctl = enc_ioctl;
ifp->if_output = enc_output;
- ifp->if_snd.ifq_maxlen = ifqmaxlen;
ifp->if_softc = sc;
if_attach(ifp);
bpfattach(ifp, DLT_ENC, sizeof(struct enchdr));
-
- mtx_lock(&enc_mtx);
- /* grab a pointer to enc0, ignore the rest */
- if (encif == NULL)
- encif = ifp;
- mtx_unlock(&enc_mtx);
-
- return (0);
-}
-
-static int
-enc_modevent(module_t mod, int type, void *data)
-{
- switch (type) {
- case MOD_LOAD:
- mtx_init(&enc_mtx, "enc mtx", NULL, MTX_DEF);
- enc_cloner = if_clone_simple(encname, enc_clone_create,
- enc_clone_destroy, 1);
- break;
- case MOD_UNLOAD:
- printf("enc module unload - not possible for this module\n");
- return (EINVAL);
- default:
- return (EOPNOTSUPP);
+ if (enc_add_hhooks(sc) != 0) {
+ enc_clone_destroy(ifp);
+ return (ENXIO);
}
return (0);
}
-static moduledata_t enc_mod = {
- "if_enc",
- enc_modevent,
- 0
-};
-
-DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
-
static int
enc_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
struct route *ro)
{
+
m_freem(m);
return (0);
}
-/*
- * Process an ioctl request.
- */
-/* ARGSUSED */
static int
enc_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
{
- int error = 0;
-
- mtx_lock(&enc_mtx);
-
- switch (cmd) {
-
- case SIOCSIFFLAGS:
- if (ifp->if_flags & IFF_UP)
- ifp->if_drv_flags |= IFF_DRV_RUNNING;
- else
- ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
-
- break;
-
- default:
- error = EINVAL;
- }
- mtx_unlock(&enc_mtx);
- return (error);
+ if (cmd != SIOCSIFFLAGS)
+ return (EINVAL);
+ if (ifp->if_flags & IFF_UP)
+ ifp->if_drv_flags |= IFF_DRV_RUNNING;
+ else
+ ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
+ return (0);
}
-int
-ipsec_filter(struct mbuf **mp, int dir, int flags)
+/*
+ * One helper hook function is used by any hook points.
+ * + from hhook_type we can determine the packet direction:
+ * HHOOK_TYPE_IPSEC_IN or HHOOK_TYPE_IPSEC_OUT;
+ * + from hhook_id we can determine address family: AF_INET or AF_INET6;
+ * + udata contains pointer to enc_softc;
+ * + ctx_data contains pointer to struct ipsec_ctx_data.
+ */
+static int
+enc_hhook(int32_t hhook_type, int32_t hhook_id, void *udata, void *ctx_data,
+ void *hdata, struct osd *hosd)
{
- int error, i;
- struct ip *ip;
- struct ifnet *rcvif;
-
- KASSERT(encif != NULL, ("%s: encif is null", __func__));
- KASSERT(flags & (ENC_IN|ENC_OUT),
- ("%s: invalid flags: %04x", __func__, flags));
+ struct enchdr hdr;
+ struct ipsec_ctx_data *ctx;
+ struct enc_softc *sc;
+ struct ifnet *ifp, *rcvif;
+ struct pfil_head *ph;
+ int pdir;
- if ((encif->if_drv_flags & IFF_DRV_RUNNING) == 0)
+ sc = (struct enc_softc *)udata;
+ ifp = sc->sc_ifp;
+ if ((ifp->if_flags & IFF_UP) == 0)
return (0);
- if (flags & ENC_IN) {
- if ((flags & ipsec_filter_mask_in) == 0)
- return (0);
- } else {
- if ((flags & ipsec_filter_mask_out) == 0)
- return (0);
+ ctx = (struct ipsec_ctx_data *)ctx_data;
+ /* XXX: wrong hook point was used by caller? */
+ if (ctx->af != hhook_id)
+ return (EPFNOSUPPORT);
+
+ if (((hhook_type == HHOOK_TYPE_IPSEC_IN &&
+ (ctx->enc & V_bpf_mask_in) != 0) ||
+ (hhook_type == HHOOK_TYPE_IPSEC_OUT &&
+ (ctx->enc & V_bpf_mask_out) != 0)) &&
+ bpf_peers_present(ifp->if_bpf) != 0) {
+ hdr.af = ctx->af;
+ hdr.spi = ctx->sav->spi;
+ hdr.flags = 0;
+ if (ctx->sav->alg_enc != SADB_EALG_NONE)
+ hdr.flags |= M_CONF;
+ if (ctx->sav->alg_auth != SADB_AALG_NONE)
+ hdr.flags |= M_AUTH;
+ bpf_mtap2(ifp->if_bpf, &hdr, sizeof(hdr), *ctx->mp);
}
- /* Skip pfil(9) if no filters are loaded */
- if (1
+ switch (hhook_type) {
+ case HHOOK_TYPE_IPSEC_IN:
+ if (ctx->enc == IPSEC_ENC_BEFORE) {
+ /* Do accounting only once */
+ if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
+ if_inc_counter(ifp, IFCOUNTER_IBYTES,
+ (*ctx->mp)->m_pkthdr.len);
+ }
+ if ((ctx->enc & V_filter_mask_in) == 0)
+ return (0); /* skip pfil processing */
+ pdir = PFIL_IN;
+ break;
+ case HHOOK_TYPE_IPSEC_OUT:
+ if (ctx->enc == IPSEC_ENC_BEFORE) {
+ /* Do accounting only once */
+ if_inc_counter(ifp, IFCOUNTER_OPACKETS, 1);
+ if_inc_counter(ifp, IFCOUNTER_OBYTES,
+ (*ctx->mp)->m_pkthdr.len);
+ }
+ if ((ctx->enc & V_filter_mask_out) == 0)
+ return (0); /* skip pfil processing */
+ pdir = PFIL_OUT;
+ break;
+ default:
+ return (EINVAL);
+ }
+
+ switch (hhook_id) {
#ifdef INET
- && !PFIL_HOOKED(&V_inet_pfil_hook)
+ case AF_INET:
+ ph = &V_inet_pfil_hook;
+ break;
#endif
#ifdef INET6
- && !PFIL_HOOKED(&V_inet6_pfil_hook)
+ case AF_INET6:
+ ph = &V_inet6_pfil_hook;
+ break;
#endif
- ) {
+ default:
+ ph = NULL;
+ }
+ if (ph == NULL || !PFIL_HOOKED(ph))
return (0);
+ /* Make a packet looks like it was received on enc(4) */
+ rcvif = (*ctx->mp)->m_pkthdr.rcvif;
+ (*ctx->mp)->m_pkthdr.rcvif = ifp;
+ if (pfil_run_hooks(ph, ctx->mp, ifp, pdir, NULL) != 0 ||
+ *ctx->mp == NULL) {
+ *ctx->mp = NULL; /* consumed by filter */
+ return (EACCES);
}
+ (*ctx->mp)->m_pkthdr.rcvif = rcvif;
+ return (0);
+}
- i = min((*mp)->m_pkthdr.len, max_protohdr);
- if ((*mp)->m_len < i) {
- *mp = m_pullup(*mp, i);
- if (*mp == NULL) {
- printf("%s: m_pullup failed\n", __func__);
- return (-1);
- }
- }
+static int
+enc_add_hhooks(struct enc_softc *sc)
+{
+ struct hookinfo hki;
+ int error;
- error = 0;
- rcvif = (*mp)->m_pkthdr.rcvif;
- (*mp)->m_pkthdr.rcvif = encif;
- ip = mtod(*mp, struct ip *);
- switch (ip->ip_v) {
+ error = EPFNOSUPPORT;
+ hki.hook_func = enc_hhook;
+ hki.hook_helper = NULL;
+ hki.hook_udata = sc;
#ifdef INET
- case 4:
- error = pfil_run_hooks(&V_inet_pfil_hook, mp,
- encif, dir, NULL);
- break;
+ hki.hook_id = AF_INET;
+ hki.hook_type = HHOOK_TYPE_IPSEC_IN;
+ error = hhook_add_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET],
+ &hki, HHOOK_WAITOK);
+ if (error != 0)
+ return (error);
+ hki.hook_type = HHOOK_TYPE_IPSEC_OUT;
+ error = hhook_add_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET],
+ &hki, HHOOK_WAITOK);
+ if (error != 0)
+ return (error);
#endif
#ifdef INET6
- case 6:
- error = pfil_run_hooks(&V_inet6_pfil_hook, mp,
- encif, dir, NULL);
- break;
-#endif
- default:
- printf("%s: unknown IP version\n", __func__);
- }
-
- /*
- * If the mbuf was consumed by the filter for requeueing (dummynet, etc)
- * then error will be zero but we still want to return an error to our
- * caller so the null mbuf isn't forwarded further.
- */
- if (*mp == NULL && error == 0)
- return (-1); /* Consumed by the filter */
- if (*mp == NULL)
+ hki.hook_id = AF_INET6;
+ hki.hook_type = HHOOK_TYPE_IPSEC_IN;
+ error = hhook_add_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET6],
+ &hki, HHOOK_WAITOK);
+ if (error != 0)
return (error);
+ hki.hook_type = HHOOK_TYPE_IPSEC_OUT;
+ error = hhook_add_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET6],
+ &hki, HHOOK_WAITOK);
if (error != 0)
- goto bad;
-
- (*mp)->m_pkthdr.rcvif = rcvif;
+ return (error);
+#endif
return (error);
+}
-bad:
- m_freem(*mp);
- *mp = NULL;
- return (error);
+static void
+enc_remove_hhooks(struct enc_softc *sc)
+{
+ struct hookinfo hki;
+
+ hki.hook_func = enc_hhook;
+ hki.hook_helper = NULL;
+ hki.hook_udata = sc;
+#ifdef INET
+ hki.hook_id = AF_INET;
+ hki.hook_type = HHOOK_TYPE_IPSEC_IN;
+ hhook_remove_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET], &hki);
+ hki.hook_type = HHOOK_TYPE_IPSEC_OUT;
+ hhook_remove_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET], &hki);
+#endif
+#ifdef INET6
+ hki.hook_id = AF_INET6;
+ hki.hook_type = HHOOK_TYPE_IPSEC_IN;
+ hhook_remove_hook(V_ipsec_hhh_in[HHOOK_IPSEC_INET6], &hki);
+ hki.hook_type = HHOOK_TYPE_IPSEC_OUT;
+ hhook_remove_hook(V_ipsec_hhh_out[HHOOK_IPSEC_INET6], &hki);
+#endif
}
-void
-ipsec_bpf(struct mbuf *m, struct secasvar *sav, int af, int flags)
+static void
+vnet_enc_init(const void *unused __unused)
{
- int mflags;
- struct enchdr hdr;
- KASSERT(encif != NULL, ("%s: encif is null", __func__));
- KASSERT(flags & (ENC_IN|ENC_OUT),
- ("%s: invalid flags: %04x", __func__, flags));
+ V_enc_sc = NULL;
+ V_enc_cloner = if_clone_simple(encname, enc_clone_create,
+ enc_clone_destroy, 1);
+}
+VNET_SYSINIT(vnet_enc_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
+ vnet_enc_init, NULL);
- if ((encif->if_drv_flags & IFF_DRV_RUNNING) == 0)
- return;
+static void
+vnet_enc_uninit(const void *unused __unused)
+{
- if (flags & ENC_IN) {
- if ((flags & ipsec_bpf_mask_in) == 0)
- return;
- } else {
- if ((flags & ipsec_bpf_mask_out) == 0)
- return;
- }
+ if_clone_detach(V_enc_cloner);
+}
+VNET_SYSUNINIT(vnet_enc_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY,
+ vnet_enc_uninit, NULL);
- if (bpf_peers_present(encif->if_bpf)) {
- mflags = 0;
- hdr.spi = 0;
- if (!sav) {
- struct m_tag *mtag;
- mtag = m_tag_find(m, PACKET_TAG_IPSEC_IN_DONE, NULL);
- if (mtag != NULL) {
- struct tdb_ident *tdbi;
- tdbi = (struct tdb_ident *) (mtag + 1);
- if (tdbi->alg_enc != SADB_EALG_NONE)
- mflags |= M_CONF;
- if (tdbi->alg_auth != SADB_AALG_NONE)
- mflags |= M_AUTH;
- hdr.spi = tdbi->spi;
- }
- } else {
- if (sav->alg_enc != SADB_EALG_NONE)
- mflags |= M_CONF;
- if (sav->alg_auth != SADB_AALG_NONE)
- mflags |= M_AUTH;
- hdr.spi = sav->spi;
- }
+static int
+enc_modevent(module_t mod, int type, void *data)
+{
- /*
- * 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).
- */
- hdr.af = af;
- /* hdr.spi already set above */
- hdr.flags = mflags;
-
- bpf_mtap2(encif->if_bpf, &hdr, sizeof(hdr), m);
+ switch (type) {
+ case MOD_LOAD:
+ case MOD_UNLOAD:
+ break;
+ default:
+ return (EOPNOTSUPP);
}
+ return (0);
}
+
+static moduledata_t enc_mod = {
+ "if_enc",
+ enc_modevent,
+ 0
+};
+
+DECLARE_MODULE(if_enc, enc_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY);
diff --git a/sys/net/if_enc.h b/sys/net/if_enc.h
index 59a55fc..941ed12 100644
--- a/sys/net/if_enc.h
+++ b/sys/net/if_enc.h
@@ -30,6 +30,13 @@
#ifndef _NET_IF_ENC_H
#define _NET_IF_ENC_H
-extern struct ifnet *encif;
+struct ipsec_ctx_data {
+ struct mbuf **mp;
+ struct secasvar *sav;
+ uint8_t af;
+#define IPSEC_ENC_BEFORE 0x01
+#define IPSEC_ENC_AFTER 0x02
+ uint8_t enc;
+};
#endif /* _NET_IF_ENC_H */
diff --git a/sys/net/if_var.h b/sys/net/if_var.h
index 9dfc459..5911cec 100644
--- a/sys/net/if_var.h
+++ b/sys/net/if_var.h
@@ -93,6 +93,14 @@ TAILQ_HEAD(ifgrouphead, ifg_group);
#ifdef _KERNEL
VNET_DECLARE(struct pfil_head, link_pfil_hook); /* packet filter hooks */
#define V_link_pfil_hook VNET(link_pfil_hook)
+
+#define HHOOK_IPSEC_INET 0
+#define HHOOK_IPSEC_INET6 1
+#define HHOOK_IPSEC_COUNT 2
+VNET_DECLARE(struct hhook_head *, ipsec_hhh_in[HHOOK_IPSEC_COUNT]);
+VNET_DECLARE(struct hhook_head *, ipsec_hhh_out[HHOOK_IPSEC_COUNT]);
+#define V_ipsec_hhh_in VNET(ipsec_hhh_in)
+#define V_ipsec_hhh_out VNET(ipsec_hhh_out)
#endif /* _KERNEL */
typedef enum {
diff --git a/sys/net80211/ieee80211_ht.c b/sys/net80211/ieee80211_ht.c
index a850a33..e6fe16e 100644
--- a/sys/net80211/ieee80211_ht.c
+++ b/sys/net80211/ieee80211_ht.c
@@ -2174,9 +2174,9 @@ ieee80211_ampdu_enable(struct ieee80211_node *ni,
return 0;
}
IEEE80211_NOTE(vap, IEEE80211_MSG_11N, ni,
- "enable AMPDU on tid %d (%s), avgpps %d pkts %d",
+ "enable AMPDU on tid %d (%s), avgpps %d pkts %d attempt %d",
tap->txa_tid, ieee80211_wme_acnames[TID_TO_WME_AC(tap->txa_tid)],
- tap->txa_avgpps, tap->txa_pkts);
+ tap->txa_avgpps, tap->txa_pkts, tap->txa_attempts);
return 1;
}
diff --git a/sys/netinet/in_pcb.c b/sys/netinet/in_pcb.c
index 31a41bd..9454426 100644
--- a/sys/netinet/in_pcb.c
+++ b/sys/netinet/in_pcb.c
@@ -1220,8 +1220,17 @@ in_pcbrele_wlocked(struct inpcb *inp)
INP_WLOCK_ASSERT(inp);
- if (refcount_release(&inp->inp_refcount) == 0)
+ if (refcount_release(&inp->inp_refcount) == 0) {
+ /*
+ * If the inpcb has been freed, let the caller know, even if
+ * this isn't the last reference.
+ */
+ if (inp->inp_flags2 & INP_FREED) {
+ INP_WUNLOCK(inp);
+ return (1);
+ }
return (0);
+ }
KASSERT(inp->inp_socket == NULL, ("%s: inp_socket != NULL", __func__));
diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c
index 4998b14..edcafd5 100644
--- a/sys/netinet/ip_input.c
+++ b/sys/netinet/ip_input.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/hhook.h>
#include <sys/mbuf.h>
#include <sys/malloc.h>
#include <sys/domain.h>
@@ -318,6 +319,17 @@ ip_init(void)
printf("%s: WARNING: unable to register pfil hook, "
"error %d\n", __func__, i);
+ if (hhook_head_register(HHOOK_TYPE_IPSEC_IN, AF_INET,
+ &V_ipsec_hhh_in[HHOOK_IPSEC_INET],
+ HHOOK_WAITOK | HHOOK_HEADISINVNET) != 0)
+ printf("%s: WARNING: unable to register input helper hook\n",
+ __func__);
+ if (hhook_head_register(HHOOK_TYPE_IPSEC_OUT, AF_INET,
+ &V_ipsec_hhh_out[HHOOK_IPSEC_INET],
+ HHOOK_WAITOK | HHOOK_HEADISINVNET) != 0)
+ printf("%s: WARNING: unable to register output helper hook\n",
+ __func__);
+
/* Skip initialization of globals for non-default instances. */
if (!IS_DEFAULT_VNET(curvnet))
return;
@@ -352,12 +364,24 @@ ip_init(void)
void
ip_destroy(void)
{
- int i;
+ int error;
- if ((i = pfil_head_unregister(&V_inet_pfil_hook)) != 0)
+ if ((error = pfil_head_unregister(&V_inet_pfil_hook)) != 0)
printf("%s: WARNING: unable to unregister pfil hook, "
- "error %d\n", __func__, i);
+ "error %d\n", __func__, error);
+ error = hhook_head_deregister(V_ipsec_hhh_in[HHOOK_IPSEC_INET]);
+ if (error != 0) {
+ printf("%s: WARNING: unable to deregister input helper hook "
+ "type HHOOK_TYPE_IPSEC_IN, id HHOOK_IPSEC_INET: "
+ "error %d returned\n", __func__, error);
+ }
+ error = hhook_head_deregister(V_ipsec_hhh_out[HHOOK_IPSEC_INET]);
+ if (error != 0) {
+ printf("%s: WARNING: unable to deregister output helper hook "
+ "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET: "
+ "error %d returned\n", __func__, error);
+ }
/* Cleanup in_ifaddr hash table; should be empty. */
hashdestroy(V_in_ifaddrhashtbl, M_IFADDR, V_in_ifaddrhmask);
diff --git a/sys/netinet6/ip6_input.c b/sys/netinet6/ip6_input.c
index 577dc48..e6c16a9 100644
--- a/sys/netinet6/ip6_input.c
+++ b/sys/netinet6/ip6_input.c
@@ -72,6 +72,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/hhook.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
@@ -201,6 +202,17 @@ ip6_init(void)
printf("%s: WARNING: unable to register pfil hook, "
"error %d\n", __func__, i);
+ if (hhook_head_register(HHOOK_TYPE_IPSEC_IN, AF_INET6,
+ &V_ipsec_hhh_in[HHOOK_IPSEC_INET6],
+ HHOOK_WAITOK | HHOOK_HEADISINVNET) != 0)
+ printf("%s: WARNING: unable to register input helper hook\n",
+ __func__);
+ if (hhook_head_register(HHOOK_TYPE_IPSEC_OUT, AF_INET6,
+ &V_ipsec_hhh_out[HHOOK_IPSEC_INET6],
+ HHOOK_WAITOK | HHOOK_HEADISINVNET) != 0)
+ printf("%s: WARNING: unable to register output helper hook\n",
+ __func__);
+
scope6_init();
addrsel_policy_init();
nd6_init();
@@ -300,11 +312,23 @@ ip6proto_unregister(short ip6proto)
void
ip6_destroy()
{
- int i;
+ int error;
- if ((i = pfil_head_unregister(&V_inet6_pfil_hook)) != 0)
+ if ((error = pfil_head_unregister(&V_inet6_pfil_hook)) != 0)
printf("%s: WARNING: unable to unregister pfil hook, "
- "error %d\n", __func__, i);
+ "error %d\n", __func__, error);
+ error = hhook_head_deregister(V_ipsec_hhh_in[HHOOK_IPSEC_INET6]);
+ if (error != 0) {
+ printf("%s: WARNING: unable to deregister input helper hook "
+ "type HHOOK_TYPE_IPSEC_IN, id HHOOK_IPSEC_INET6: "
+ "error %d returned\n", __func__, error);
+ }
+ error = hhook_head_deregister(V_ipsec_hhh_out[HHOOK_IPSEC_INET6]);
+ if (error != 0) {
+ printf("%s: WARNING: unable to deregister output helper hook "
+ "type HHOOK_TYPE_IPSEC_OUT, id HHOOK_IPSEC_INET6: "
+ "error %d returned\n", __func__, error);
+ }
hashdestroy(V_in6_ifaddrhashtbl, M_IFADDR, V_in6_ifaddrhmask);
nd6_destroy();
callout_drain(&V_in6_tmpaddrtimer_ch);
diff --git a/sys/netipsec/ipsec.c b/sys/netipsec/ipsec.c
index 9172347..68a67a7 100644
--- a/sys/netipsec/ipsec.c
+++ b/sys/netipsec/ipsec.c
@@ -48,6 +48,7 @@
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/errno.h>
+#include <sys/hhook.h>
#include <sys/time.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
@@ -55,6 +56,7 @@
#include <sys/proc.h>
#include <net/if.h>
+#include <net/if_enc.h>
#include <net/if_var.h>
#include <net/vnet.h>
@@ -806,6 +808,34 @@ ipsec6_setspidx_ipaddr(struct mbuf *m, struct secpolicyindex *spidx)
}
#endif
+int
+ipsec_run_hhooks(struct ipsec_ctx_data *ctx, int type)
+{
+ int idx;
+
+ switch (ctx->af) {
+#ifdef INET
+ case AF_INET:
+ idx = HHOOK_IPSEC_INET;
+ break;
+#endif
+#ifdef INET6
+ case AF_INET6:
+ idx = HHOOK_IPSEC_INET6;
+ break;
+#endif
+ default:
+ return (EPFNOSUPPORT);
+ }
+ if (type == HHOOK_TYPE_IPSEC_IN)
+ HHOOKS_RUN_IF(V_ipsec_hhh_in[idx], ctx, NULL);
+ else
+ HHOOKS_RUN_IF(V_ipsec_hhh_out[idx], ctx, NULL);
+ if (*ctx->mp == NULL)
+ return (EACCES);
+ return (0);
+}
+
static void
ipsec_delpcbpolicy(struct inpcbpolicy *p)
{
diff --git a/sys/netipsec/ipsec.h b/sys/netipsec/ipsec.h
index c01e54f..9a12c50 100644
--- a/sys/netipsec/ipsec.h
+++ b/sys/netipsec/ipsec.h
@@ -258,6 +258,15 @@ struct ipsecstat {
#ifdef _KERNEL
#include <sys/counter.h>
+struct ipsec_ctx_data;
+#define IPSEC_INIT_CTX(_ctx, _mp, _sav, _af, _enc) do { \
+ (_ctx)->mp = (_mp); \
+ (_ctx)->sav = (_sav); \
+ (_ctx)->af = (_af); \
+ (_ctx)->enc = (_enc); \
+} while(0)
+int ipsec_run_hhooks(struct ipsec_ctx_data *ctx, int direction);
+
VNET_DECLARE(int, ipsec_debug);
#define V_ipsec_debug VNET(ipsec_debug)
@@ -352,14 +361,6 @@ extern struct mbuf *m_makespace(struct mbuf *m0, int skip, int hlen, int *off);
extern caddr_t m_pad(struct mbuf *m, int n);
extern int m_striphdr(struct mbuf *m, int skip, int hlen);
-#ifdef DEV_ENC
-#define ENC_BEFORE 0x0001
-#define ENC_AFTER 0x0002
-#define ENC_IN 0x0100
-#define ENC_OUT 0x0200
-extern int ipsec_filter(struct mbuf **, int, int);
-extern void ipsec_bpf(struct mbuf *, struct secasvar *, int, int);
-#endif
#endif /* _KERNEL */
#ifndef _KERNEL
diff --git a/sys/netipsec/ipsec_input.c b/sys/netipsec/ipsec_input.c
index 6a41ad9..063096f 100644
--- a/sys/netipsec/ipsec_input.c
+++ b/sys/netipsec/ipsec_input.c
@@ -43,7 +43,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
-#include "opt_enc.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -53,11 +52,12 @@
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/errno.h>
+#include <sys/hhook.h>
#include <sys/syslog.h>
#include <net/if.h>
#include <net/if_var.h>
-#include <net/pfil.h>
+#include <net/if_enc.h>
#include <net/netisr.h>
#include <net/vnet.h>
@@ -94,10 +94,6 @@
#include <machine/in_cksum.h>
#include <machine/stdarg.h>
-#ifdef DEV_ENC
-#include <net/if_enc.h>
-#endif
-
#define IPSEC_ISTAT(proto, name) do { \
if ((proto) == IPPROTO_ESP) \
@@ -314,6 +310,7 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
int protoff)
{
char buf[INET6_ADDRSTRLEN];
+ struct ipsec_ctx_data ctx;
int prot, af, sproto, isr_prot;
struct ip *ip;
struct m_tag *mtag;
@@ -368,16 +365,10 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
}
prot = ip->ip_p;
-#ifdef DEV_ENC
- if_inc_counter(encif, IFCOUNTER_IPACKETS, 1);
- if_inc_counter(encif, IFCOUNTER_IBYTES, m->m_pkthdr.len);
-
- /* Pass the mbuf to enc0 for bpf and pfil. */
- ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_BEFORE);
- if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0)
- return (error);
+ IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET, IPSEC_ENC_BEFORE);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0)
+ goto bad;
ip = mtod(m, struct ip *);
-#endif /* DEV_ENC */
/* IP-in-IP encapsulation */
if (prot == IPPROTO_IPIP &&
@@ -501,32 +492,18 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
*/
if (saidx->mode == IPSEC_MODE_TRANSPORT)
prot = IPPROTO_IPIP;
-#ifdef DEV_ENC
- /*
- * Pass the mbuf to enc0 for bpf and pfil.
- */
- if (prot == IPPROTO_IPIP)
- ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER);
-#ifdef INET6
- if (prot == IPPROTO_IPV6)
- ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER);
-#endif
-
- if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0)
- return (error);
-#endif /* DEV_ENC */
-
/*
* Re-dispatch via software interrupt.
*/
-
switch (prot) {
case IPPROTO_IPIP:
isr_prot = NETISR_IP;
+ af = AF_INET;
break;
#ifdef INET6
case IPPROTO_IPV6:
isr_prot = NETISR_IPV6;
+ af = AF_INET6;
break;
#endif
default:
@@ -537,6 +514,9 @@ ipsec4_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
goto bad;
}
+ IPSEC_INIT_CTX(&ctx, &m, sav, af, IPSEC_ENC_AFTER);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0)
+ goto bad;
error = netisr_queue_src(isr_prot, (uintptr_t)sav->spi, m);
if (error) {
IPSEC_ISTAT(sproto, qfull);
@@ -611,6 +591,7 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
int protoff)
{
char buf[INET6_ADDRSTRLEN];
+ struct ipsec_ctx_data ctx;
int prot, af, sproto;
struct ip6_hdr *ip6;
struct m_tag *mtag;
@@ -658,20 +639,13 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
ip6 = mtod(m, struct ip6_hdr *);
ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(struct ip6_hdr));
+ IPSEC_INIT_CTX(&ctx, &m, sav, af, IPSEC_ENC_BEFORE);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0)
+ goto bad;
/* Save protocol */
m_copydata(m, protoff, 1, &nxt8);
prot = nxt8;
-#ifdef DEV_ENC
- if_inc_counter(encif, IFCOUNTER_IPACKETS, 1);
- if_inc_counter(encif, IFCOUNTER_IBYTES, m->m_pkthdr.len);
-
- /* Pass the mbuf to enc0 for bpf and pfil. */
- ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_BEFORE);
- if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_BEFORE)) != 0)
- return (error);
-#endif /* DEV_ENC */
-
/* IPv6-in-IP encapsulation */
if (prot == IPPROTO_IPV6 &&
saidx->mode != IPSEC_MODE_TRANSPORT) {
@@ -778,20 +752,16 @@ ipsec6_common_input_cb(struct mbuf *m, struct secasvar *sav, int skip,
key_sa_recordxfer(sav, m);
-#ifdef DEV_ENC
- /*
- * Pass the mbuf to enc0 for bpf and pfil.
- */
+
#ifdef INET
if (prot == IPPROTO_IPIP)
- ipsec_bpf(m, sav, AF_INET, ENC_IN|ENC_AFTER);
+ af = AF_INET;
+ else
#endif
- if (prot == IPPROTO_IPV6)
- ipsec_bpf(m, sav, AF_INET6, ENC_IN|ENC_AFTER);
-
- if ((error = ipsec_filter(&m, PFIL_IN, ENC_IN|ENC_AFTER)) != 0)
- return (error);
-#endif /* DEV_ENC */
+ af = AF_INET6;
+ IPSEC_INIT_CTX(&ctx, &m, sav, af, IPSEC_ENC_AFTER);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_IN)) != 0)
+ goto bad;
if (skip == 0) {
/*
* We stripped outer IPv6 header.
diff --git a/sys/netipsec/ipsec_output.c b/sys/netipsec/ipsec_output.c
index f5cdf5a..1523e0b 100644
--- a/sys/netipsec/ipsec_output.c
+++ b/sys/netipsec/ipsec_output.c
@@ -32,7 +32,6 @@
#include "opt_inet.h"
#include "opt_inet6.h"
#include "opt_ipsec.h"
-#include "opt_enc.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -41,11 +40,12 @@
#include <sys/protosw.h>
#include <sys/socket.h>
#include <sys/errno.h>
+#include <sys/hhook.h>
#include <sys/syslog.h>
#include <net/if.h>
+#include <net/if_enc.h>
#include <net/if_var.h>
-#include <net/pfil.h>
#include <net/vnet.h>
#include <netinet/in.h>
@@ -88,11 +88,6 @@
#include <netinet/udp.h>
#endif
-#ifdef DEV_ENC
-#include <net/if_enc.h>
-#endif
-
-
int
ipsec_process_done(struct mbuf *m, struct ipsecrequest *isr)
{
@@ -531,6 +526,7 @@ int
ipsec4_process_packet(struct mbuf *m, struct ipsecrequest *isr)
{
char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN];
+ struct ipsec_ctx_data ctx;
union sockaddr_union *dst;
struct secasindex saidx;
struct secasvar *sav;
@@ -555,19 +551,13 @@ ipsec4_process_packet(struct mbuf *m, struct ipsecrequest *isr)
error = ENOBUFS;
goto bad;
}
- ip = mtod(m, struct ip *);
- dst = &sav->sah->saidx.dst;
-#ifdef DEV_ENC
- if_inc_counter(encif, IFCOUNTER_OPACKETS, 1);
- if_inc_counter(encif, IFCOUNTER_OBYTES, m->m_pkthdr.len);
-
- /* pass the mbuf to enc0 for bpf processing */
- ipsec_bpf(m, sav, AF_INET, ENC_OUT|ENC_BEFORE);
- /* pass the mbuf to enc0 for packet filtering */
- if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_BEFORE)) != 0)
+
+ IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET, IPSEC_ENC_BEFORE);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
goto bad;
+
ip = mtod(m, struct ip *);
-#endif
+ dst = &sav->sah->saidx.dst;
/* Do the appropriate encapsulation, if necessary */
if (isr->saidx.mode == IPSEC_MODE_TUNNEL || /* Tunnel requ'd */
dst->sa.sa_family != AF_INET || /* PF mismatch */
@@ -589,13 +579,10 @@ ipsec4_process_packet(struct mbuf *m, struct ipsecrequest *isr)
goto bad;
}
}
-#ifdef DEV_ENC
- /* pass the mbuf to enc0 for bpf processing */
- ipsec_bpf(m, sav, sav->sah->saidx.dst.sa.sa_family, ENC_OUT|ENC_AFTER);
- /* pass the mbuf to enc0 for packet filtering */
- if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_AFTER)) != 0)
+
+ IPSEC_INIT_CTX(&ctx, &m, sav, dst->sa.sa_family, IPSEC_ENC_AFTER);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
goto bad;
-#endif
/*
* Dispatch to the appropriate IPsec transform logic. The
@@ -657,6 +644,7 @@ int
ipsec6_process_packet(struct mbuf *m, struct ipsecrequest *isr)
{
char sbuf[INET6_ADDRSTRLEN], dbuf[INET6_ADDRSTRLEN];
+ struct ipsec_ctx_data ctx;
struct secasindex saidx;
struct secasvar *sav;
struct ip6_hdr *ip6;
@@ -677,19 +665,12 @@ ipsec6_process_packet(struct mbuf *m, struct ipsecrequest *isr)
sav = isr->sav;
dst = &sav->sah->saidx.dst;
- ip6 = mtod(m, struct ip6_hdr *);
- ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6));
-#ifdef DEV_ENC
- if_inc_counter(encif, IFCOUNTER_OPACKETS, 1);
- if_inc_counter(encif, IFCOUNTER_OBYTES, m->m_pkthdr.len);
-
- /* pass the mbuf to enc0 for bpf processing */
- ipsec_bpf(m, isr->sav, AF_INET6, ENC_OUT|ENC_BEFORE);
- /* pass the mbuf to enc0 for packet filtering */
- if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_BEFORE)) != 0)
+ IPSEC_INIT_CTX(&ctx, &m, sav, AF_INET6, IPSEC_ENC_BEFORE);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
goto bad;
+
ip6 = mtod(m, struct ip6_hdr *);
-#endif /* DEV_ENC */
+ ip6->ip6_plen = htons(m->m_pkthdr.len - sizeof(*ip6));
/* Do the appropriate encapsulation, if necessary */
if (isr->saidx.mode == IPSEC_MODE_TUNNEL || /* Tunnel requ'd */
@@ -715,12 +696,9 @@ ipsec6_process_packet(struct mbuf *m, struct ipsecrequest *isr)
}
}
-#ifdef DEV_ENC
- ipsec_bpf(m, isr->sav, dst->sa.sa_family, ENC_OUT|ENC_AFTER);
- /* pass the mbuf to enc0 for packet filtering */
- if ((error = ipsec_filter(&m, PFIL_OUT, ENC_OUT|ENC_AFTER)) != 0)
+ IPSEC_INIT_CTX(&ctx, &m, sav, dst->sa.sa_family, IPSEC_ENC_AFTER);
+ if ((error = ipsec_run_hhooks(&ctx, HHOOK_TYPE_IPSEC_OUT)) != 0)
goto bad;
-#endif /* DEV_ENC */
switch(dst->sa.sa_family) {
#ifdef INET
@@ -741,14 +719,13 @@ ipsec6_process_packet(struct mbuf *m, struct ipsecrequest *isr)
DPRINTF(("%s: unsupported protocol family %u\n",
__func__, dst->sa.sa_family));
error = EPFNOSUPPORT;
- IPSEC6STAT_INC(ips_out_inval);
goto bad;
}
error = (*sav->tdb_xform->xf_output)(m, isr, NULL, i, off);
IPSECREQUEST_UNLOCK(isr);
return error;
bad:
-
+ IPSEC6STAT_INC(ips_out_inval);
if (isr)
IPSECREQUEST_UNLOCK(isr);
if (m)
diff --git a/sys/ofed/include/rdma/ib_pma.h b/sys/ofed/include/rdma/ib_pma.h
index a5889f1..a2300cd 100644
--- a/sys/ofed/include/rdma/ib_pma.h
+++ b/sys/ofed/include/rdma/ib_pma.h
@@ -37,6 +37,25 @@
#include <rdma/ib_mad.h>
+#define MAX_U32 0xffffffffULL
+#define MAX_U16 0xffffUL
+
+/* Counters should be saturate once they reach their maximum value */
+#define ASSIGN_32BIT_COUNTER(counter, value) do { \
+ if ((value) > MAX_U32) \
+ counter = cpu_to_be32(MAX_U32); \
+ else \
+ counter = cpu_to_be32(value); \
+} while (0)
+
+/* Counters should be saturate once they reach their maximum value */
+#define ASSIGN_16BIT_COUNTER(counter, value) do { \
+ if ((value) > MAX_U16) \
+ counter = cpu_to_be16(MAX_U16); \
+ else \
+ counter = cpu_to_be16(value); \
+} while (0)
+
/*
* PMA class portinfo capability mask bits
*/
diff --git a/sys/powerpc/aim/slb.c b/sys/powerpc/aim/slb.c
index 89cfabf..aa6a214 100644
--- a/sys/powerpc/aim/slb.c
+++ b/sys/powerpc/aim/slb.c
@@ -140,7 +140,7 @@ make_new_leaf(uint64_t esid, uint64_t slbv, struct slbtnode *parent)
* that a lockless searcher always sees a valid path through
* the tree.
*/
- mb();
+ powerpc_lwsync();
idx = esid2idx(esid, parent->ua_level);
parent->u.ua_child[idx] = child;
@@ -188,7 +188,7 @@ make_intermediate(uint64_t esid, struct slbtnode *parent)
idx = esid2idx(child->ua_base, inter->ua_level);
inter->u.ua_child[idx] = child;
setbit(&inter->ua_alloc, idx);
- mb();
+ powerpc_lwsync();
/* Set up parent to point to intermediate node ... */
idx = esid2idx(inter->ua_base, parent->ua_level);
@@ -241,6 +241,12 @@ user_va_to_slb_entry(pmap_t pm, vm_offset_t va)
return ((ua->u.slb_entries[idx].slbe & SLBE_VALID) ?
&ua->u.slb_entries[idx] : NULL);
+ /*
+ * The following accesses are implicitly ordered under the POWER
+ * ISA by load dependencies (the store ordering is provided by
+ * the powerpc_lwsync() calls elsewhere) and so are run without
+ * barriers.
+ */
ua = ua->u.ua_child[idx];
if (ua == NULL ||
esid2base(esid, ua->ua_level) != ua->ua_base)
diff --git a/sys/powerpc/include/atomic.h b/sys/powerpc/include/atomic.h
index 92fe279..c4db5ff 100644
--- a/sys/powerpc/include/atomic.h
+++ b/sys/powerpc/include/atomic.h
@@ -48,7 +48,7 @@
*/
#ifdef __powerpc64__
-#define mb() __asm __volatile("lwsync" : : : "memory")
+#define mb() __asm __volatile("sync" : : : "memory")
#define rmb() __asm __volatile("lwsync" : : : "memory")
#define wmb() __asm __volatile("lwsync" : : : "memory")
#define __ATOMIC_REL() __asm __volatile("lwsync" : : : "memory")
@@ -61,6 +61,17 @@
#define __ATOMIC_ACQ() __asm __volatile("isync" : : : "memory")
#endif
+static __inline void
+powerpc_lwsync(void)
+{
+
+#ifdef __powerpc64__
+ __asm __volatile("lwsync" : : : "memory");
+#else
+ __asm __volatile("sync" : : : "memory");
+#endif
+}
+
/*
* atomic_add(p, v)
* { *p += v; }
@@ -506,7 +517,8 @@ atomic_load_acq_##TYPE(volatile u_##TYPE *p) \
static __inline void \
atomic_store_rel_##TYPE(volatile u_##TYPE *p, u_##TYPE v) \
{ \
- mb(); \
+ \
+ powerpc_lwsync(); \
*p = v; \
}
@@ -734,34 +746,21 @@ static __inline void
atomic_thread_fence_acq(void)
{
- /* See above comment about lwsync being broken on Book-E. */
-#ifdef __powerpc64__
- __asm __volatile("lwsync" : : : "memory");
-#else
- __asm __volatile("sync" : : : "memory");
-#endif
+ powerpc_lwsync();
}
static __inline void
atomic_thread_fence_rel(void)
{
-#ifdef __powerpc64__
- __asm __volatile("lwsync" : : : "memory");
-#else
- __asm __volatile("sync" : : : "memory");
-#endif
+ powerpc_lwsync();
}
static __inline void
atomic_thread_fence_acq_rel(void)
{
-#ifdef __powerpc64__
- __asm __volatile("lwsync" : : : "memory");
-#else
- __asm __volatile("sync" : : : "memory");
-#endif
+ powerpc_lwsync();
}
static __inline void
diff --git a/sys/sys/hhook.h b/sys/sys/hhook.h
index 9d5d8e3..1d60dd3 100644
--- a/sys/sys/hhook.h
+++ b/sys/sys/hhook.h
@@ -65,6 +65,8 @@
/* Helper hook types. */
#define HHOOK_TYPE_TCP 1
#define HHOOK_TYPE_SOCKET 2
+#define HHOOK_TYPE_IPSEC_IN 3
+#define HHOOK_TYPE_IPSEC_OUT 4
struct helper;
struct osd;
diff --git a/sys/x86/x86/identcpu.c b/sys/x86/x86/identcpu.c
index 2f6cfbc..ae72121 100644
--- a/sys/x86/x86/identcpu.c
+++ b/sys/x86/x86/identcpu.c
@@ -1890,7 +1890,7 @@ print_INTEL_TLB(u_int data)
printf("DTLB: 4KByte pages, 8-way set associative, 256 entries\n");
break;
case 0x6c:
- printf("DTLB: 2M/4M pages, 8-way set associative, 126 entries\n");
+ printf("DTLB: 2M/4M pages, 8-way set associative, 128 entries\n");
break;
case 0x6d:
printf("DTLB: 1 GByte pages, fully associative, 16 entries\n");
diff --git a/targets/pseudo/bootstrap-tools/Makefile b/targets/pseudo/bootstrap-tools/Makefile
index aa6166c..f196c8a 100644
--- a/targets/pseudo/bootstrap-tools/Makefile
+++ b/targets/pseudo/bootstrap-tools/Makefile
@@ -20,7 +20,9 @@ BSENV= \
MAKESYSPATH=${SRCTOP}/tools/build/mk:${SRCTOP}/share/mk \
TARGET=${HOST_MACHINE} TARGET_ARCH=${HOST_MACHINE_ARCH} \
WITHOUT_STAGING=1 STAGE_ROOT= BOOTSTRAPPING_TOOLS=1 \
- WORLDTMP=${BTOOLSDIR} LEGACY_TOOLS=${LEGACY_TOOLS}
+ WORLDTMP=${BTOOLSDIR} LEGACY_TOOLS=${LEGACY_TOOLS} \
+ INSTALL="sh ${SRCTOP}/tools/install.sh" \
+ PATH=${LEGACY_TOOLS}/usr/sbin:${LEGACY_TOOLS}/usr/bin:${LEGACY_TOOLS}/bin:${PATH}
.if !defined(OSRELDATE)
ord_h= /usr/include/osreldate.h
@@ -41,11 +43,12 @@ BSARGS= DESTDIR= \
MK_LLDB=no MK_TESTS=no \
MK_INCLUDES=yes
+DISTRIB_ENV= INSTALL="sh ${SRCTOP}/tools/install.sh" NO_FSCHG=1 MK_TESTS=no
legacy: .MAKE .META
mkdir -p ${LEGACY_TOOLS}
- ${MAKE} -C ${SRCTOP}/etc distrib-dirs -DNO_FSCHG DESTDIR=${BTOOLSDIR} \
- > $@.distrib-dirs_btoolsdir
- ${MAKE} -C ${SRCTOP}/etc distrib-dirs -DNO_FSCHG \
+ ${DISTRIB_ENV} ${MAKE} -C ${SRCTOP}/etc distrib-dirs \
+ DESTDIR=${BTOOLSDIR} > $@.distrib-dirs_btoolsdir
+ ${DISTRIB_ENV} ${MAKE} -C ${SRCTOP}/etc distrib-dirs \
DESTDIR=${LEGACY_TOOLS} > $@.distrib-dirs_legacy_tools
${BSENV} ${MAKE} -C ${SRCTOP} -f Makefile.inc1 ${BSARGS} $@
touch $@
@@ -59,7 +62,7 @@ cross-tools build-tools bootstrap-tools: .MAKE .META
touch $@
# MAKELEVEL=0 so that dirdeps.mk does its thing
-# LEGACY_TOOLS lets us use the bootstaped stuff above
+# LEGACY_TOOLS lets us use the bootstrapped stuff above
# TARGET* is so that MK_CLANG gets set correctly.
BSTCENV= \
MAKELEVEL=0 \
@@ -76,4 +79,4 @@ BSTCARGS= \
# finally we build toolchain leveraging the above.
bootstrap-toolchain: .MAKE cross-tools
- ${BSTCENV} ${MAKE} -C ${.CURDIR:H:H} ${BSTCARGS} toolchain
+ ${BSTCENV} ${MAKE} -C ${.CURDIR:H:H} ${BSTCARGS:NDESTDIR=} toolchain
diff --git a/targets/pseudo/hosttools/Makefile.depend b/targets/pseudo/hosttools/Makefile.depend
index 2b46cf0..ea364f1 100644
--- a/targets/pseudo/hosttools/Makefile.depend
+++ b/targets/pseudo/hosttools/Makefile.depend
@@ -11,10 +11,13 @@ DIRDEPS = \
usr.bin/clang/clang.host \
usr.bin/clang/tblgen.host \
usr.bin/lex/lib.host \
+ usr.bin/localedef.host \
usr.bin/mkcsmapper_static.host \
usr.bin/mkesdb_static.host \
usr.bin/mkuzip.host \
+ usr.bin/yacc.host \
usr.bin/xinstall.host \
+ usr.bin/xlint/xlint.host \
usr.sbin/config.host \
diff --git a/targets/pseudo/stage/Makefile b/targets/pseudo/stage/Makefile
index e1041a2..daa352d 100644
--- a/targets/pseudo/stage/Makefile
+++ b/targets/pseudo/stage/Makefile
@@ -8,8 +8,8 @@ all:
# we don't need to see it.
stage-distrib-dirs: .META
mkdir -p ${STAGE_OBJTOP}
- ${.MAKE} -C ${SRCTOP}/etc distrib-dirs -DNO_FSCHG -DWITH_TESTS \
- DESTDIR=${STAGE_OBJTOP} > $@.distrib_dirs
+ INSTALL="sh ${SRCTOP}/tools/install.sh" ${.MAKE} -C ${SRCTOP}/etc \
+ distrib-dirs -DNO_FSCHG -DWITH_TESTS DESTDIR=${STAGE_OBJTOP}
touch $@
.include <bsd.prog.mk>
diff --git a/targets/pseudo/toolchain/Makefile.depend b/targets/pseudo/toolchain/Makefile.depend
index 827e3f9..c3af1f1 100644
--- a/targets/pseudo/toolchain/Makefile.depend
+++ b/targets/pseudo/toolchain/Makefile.depend
@@ -5,44 +5,26 @@
.if !defined(MK_CLANG)
.include "${SRCTOP}/share/mk/src.opts.mk"
.endif
-DIRDEPS=
-.if ${MK_TOOLCHAIN} == "yes"
-DIRDEPS+= \
+DIRDEPS= \
+ gnu/usr.bin/binutils/as \
+ gnu/usr.bin/binutils/ld \
usr.bin/addr2line \
- usr.bin/cxxflit \
+ usr.bin/ar \
+ usr.bin/cxxfilt \
usr.bin/elfcopy \
+ usr.bin/elfdump \
usr.bin/nm \
usr.bin/readelf \
usr.bin/size \
- usr.bin/strip \
usr.bin/strings \
-
-.else
-DIRDEPS+= \
- gnu/usr.bin/binutils/addr2line \
- gnu/usr.bin/binutils/nm \
- gnu/usr.bin/binutils/readelf \
- gnu/usr.bin/binutils/size \
- gnu/usr.bin/binutils/strip \
- gnu/usr.bin/binutils/strings \
-
-.endif
-
-DIRDEPS+= \
+ usr.bin/strip \
usr.bin/xinstall \
- gnu/usr.bin/binutils/ar \
- gnu/usr.bin/binutils/as \
- gnu/usr.bin/binutils/ld \
- gnu/usr.bin/binutils/objcopy \
- gnu/usr.bin/binutils/objdump \
- gnu/usr.bin/binutils/ranlib \
-
-.if ${MK_CLANG} == "yes"
+.if ${MK_CLANG_BOOTSTRAP} == "yes"
DIRDEPS+= targets/pseudo/clang
.endif
-.if ${MK_GCC} == "yes"
+.if ${MK_GCC_BOOTSTRAP} == "yes"
DIRDEPS+= targets/pseudo/gcc
.endif
diff --git a/targets/pseudo/userland/share/Makefile.depend b/targets/pseudo/userland/share/Makefile.depend
index 1417d1c..9f13ae0 100644
--- a/targets/pseudo/userland/share/Makefile.depend
+++ b/targets/pseudo/userland/share/Makefile.depend
@@ -4,6 +4,7 @@
DIRDEPS = \
share/atf \
+ share/ctypedef \
share/colldef \
share/dict \
share/doc/IPv6 \
diff --git a/tests/sys/kern/acct/Makefile b/tests/sys/kern/acct/Makefile
index 03fad6d..ca3df4c 100644
--- a/tests/sys/kern/acct/Makefile
+++ b/tests/sys/kern/acct/Makefile
@@ -9,6 +9,7 @@ CFLAGS+= -I${.OBJDIR}
CLEANFILES+= convert.c convert.c.tmp
DPSRCS.acct_test= convert.c
+acct_test.o: convert.c
convert.c: ${SRCTOP}/sys/kern/kern_acct.c
sed -n -e 's/log(/syslog(/g' \
diff --git a/tools/tools/README b/tools/tools/README
index 44d13bd..307cf16 100644
--- a/tools/tools/README
+++ b/tools/tools/README
@@ -33,6 +33,7 @@ hcomp Compress header files by removing comments and whitespace.
html-mv Rename HTML generated filenames to human readable filenames.
ifinfo Uses the interface MIB to print out all the information
an interface exports in an ugly form.
+indent_wrapper Tool for style(9) checking SVN/GIT patches.
iso Tool to compare the iso3166 and iso639 files in
/usr/share/misc with the data from the master sites.
iwi Tools specific to the Intel PRO/Wireless 2200BG/2225BG/2915ABG
diff --git a/tools/tools/indent_wrapper/Makefile b/tools/tools/indent_wrapper/Makefile
new file mode 100644
index 0000000..87aa812
--- /dev/null
+++ b/tools/tools/indent_wrapper/Makefile
@@ -0,0 +1,9 @@
+# $FreeBSD$
+PREFIX?= /usr/local
+LOCALBASE?= /usr/local
+BINDIR= ${PREFIX}/sbin
+PROG= indent_wrapper
+MAN=
+SRCS+= indent_wrapper.c
+
+.include <bsd.prog.mk>
diff --git a/tools/tools/indent_wrapper/indent_wrapper.c b/tools/tools/indent_wrapper/indent_wrapper.c
new file mode 100644
index 0000000..d9aab17
--- /dev/null
+++ b/tools/tools/indent_wrapper/indent_wrapper.c
@@ -0,0 +1,746 @@
+/*-
+ * Copyright (c) 2015 Hans Petter Selasky. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must 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.
+ *
+ * $FreeBSD$
+ */
+
+#include <stdio.h>
+#include <stdint.h>
+#include <sys/queue.h>
+#include <sysexits.h>
+#include <err.h>
+#include <fcntl.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <ctype.h>
+#include <signal.h>
+
+extern char **environ;
+
+static int opt_verbose;
+static char *opt_diff_tool;
+
+#define BLOCK_SIZE 4096
+#define BLOCK_MASK 0x100
+#define BLOCK_ADD 0x200
+
+struct block {
+ TAILQ_ENTRY(block) entry;
+ uint32_t length;
+ uint32_t flags;
+ uint8_t *data;
+ uint8_t *mask;
+};
+
+typedef TAILQ_HEAD(, block) block_head_t;
+
+static void
+sigpipe(int sig)
+{
+}
+
+static struct block *
+alloc_block(void)
+{
+ struct block *pb;
+ size_t size = sizeof(*pb) + (2 * BLOCK_SIZE);
+
+ pb = malloc(size);
+ if (pb == NULL)
+ errx(EX_SOFTWARE, "Out of memory");
+ memset(pb, 0, size);
+ pb->data = (void *)(pb + 1);
+ pb->mask = pb->data + BLOCK_SIZE;
+ pb->length = BLOCK_SIZE;
+ return (pb);
+}
+
+static int
+write_block(int fd, block_head_t *ph)
+{
+ struct block *ptr;
+
+ if (fd < 0)
+ return (-1);
+
+ TAILQ_FOREACH(ptr, ph, entry) {
+ if (write(fd, ptr->data, ptr->length) != ptr->length)
+ return (-1);
+ }
+ return (0);
+}
+
+static uint16_t
+peek_block(block_head_t *pbh, uint64_t off)
+{
+ struct block *ptr;
+
+ TAILQ_FOREACH(ptr, pbh, entry) {
+ if (off < ptr->length)
+ break;
+ off -= ptr->length;
+ }
+ if (ptr == NULL)
+ return (0);
+ return (ptr->data[off] | (ptr->mask[off] << 8));
+}
+
+static void
+set_block(block_head_t *pbh, uint64_t off, uint16_t ch)
+{
+ struct block *ptr;
+
+ TAILQ_FOREACH(ptr, pbh, entry) {
+ if (off < ptr->length)
+ break;
+ off -= ptr->length;
+ }
+ if (ptr == NULL)
+ return;
+ ptr->data[off] = ch & 0xFF;
+ ptr->mask[off] = (ch >> 8) & 0xFF;
+}
+
+static uint64_t
+size_block(block_head_t *pbh)
+{
+ struct block *ptr;
+ uint64_t off = 0;
+
+ TAILQ_FOREACH(ptr, pbh, entry)
+ off += ptr->length;
+ return (off);
+}
+
+static int
+diff_tool(block_head_t *pa, block_head_t *pb)
+{
+ char ca[] = {"/tmp/diff.orig.XXXXXX"};
+ char cb[] = {"/tmp/diff.styled.XXXXXX"};
+ char cc[256];
+ uint64_t sa;
+ uint64_t sb;
+ uint64_t s;
+ uint64_t x;
+ int fa;
+ int fb;
+
+ sa = size_block(pa);
+ sb = size_block(pb);
+ s = (sa > sb) ? sa : sb;
+
+ for (x = 0; x != s; x++) {
+ char cha = peek_block(pa, x) & 0xFF;
+ char chb = peek_block(pb, x) & 0xFF;
+
+ if (cha != chb) {
+ /* false positive */
+ if (cha == '\n' && chb == 0 && x == sa - 1)
+ return (0);
+ break;
+ }
+ }
+ if (x == s)
+ return (0); /* identical */
+
+ fa = mkstemp(ca);
+ fb = mkstemp(cb);
+
+ if (write_block(fa, pa) < 0 || write_block(fb, pb) < 0) {
+ close(fa);
+ close(fb);
+ unlink(ca);
+ unlink(cb);
+ err(EX_SOFTWARE, "Could not write data to temporary files");
+ }
+ close(fa);
+ close(fb);
+
+ snprintf(cc, sizeof(cc), "%s %s %s", opt_diff_tool, ca, cb);
+ system(cc);
+
+ unlink(ca);
+ unlink(cb);
+ return (-1);
+}
+
+static int
+diff_block(block_head_t *pa, block_head_t *pb)
+{
+ uint64_t sa = size_block(pa);
+ uint64_t sb = size_block(pb);
+ uint64_t s;
+ uint64_t x;
+ uint64_t y;
+ uint64_t n;
+
+ s = (sa > sb) ? sa : sb;
+
+ for (y = x = 0; x != s; x++) {
+ char cha = peek_block(pa, x) & 0xFF;
+ char chb = peek_block(pb, x) & 0xFF;
+
+ if (cha != chb) {
+ int nonspace;
+
+ /* false positive */
+ if (cha == '\n' && chb == 0 && x == sa - 1)
+ return (0);
+
+ n = x - y;
+ printf("Style error:\n");
+ nonspace = 0;
+ for (n = y; n < sa; n++) {
+ char ch = peek_block(pa, n) & 0xFF;
+
+ if (nonspace && ch == '\n')
+ break;
+ printf("%c", ch);
+ if (!isspace(ch))
+ nonspace = 1;
+ }
+ printf("\n");
+ printf("Style corrected:\n");
+ nonspace = 0;
+ for (n = y; n < sb; n++) {
+ char ch = peek_block(pb, n) & 0xFF;
+
+ if (nonspace && ch == '\n')
+ break;
+ printf("%c", ch);
+ if (!isspace(ch))
+ nonspace = 1;
+ }
+ printf("\n");
+ for (n = y; n != x; n++) {
+ if ((peek_block(pa, n) & 0xFF) == '\t')
+ printf("\t");
+ else
+ printf(" ");
+ }
+ printf("^ %sdifference%s\n",
+ (isspace(cha) || isspace(chb)) ? "whitespace " : "",
+ (x >= sa || x >= sb) ? " in the end of a block" : "");
+ return (1);
+ } else if (cha == '\n') {
+ y = x + 1;
+ }
+ }
+ return (0);
+}
+
+static void
+free_block(block_head_t *pbh)
+{
+ struct block *ptr;
+
+ while ((ptr = TAILQ_FIRST(pbh))) {
+ TAILQ_REMOVE(pbh, ptr, entry);
+ free(ptr);
+ }
+}
+
+static void
+cmd_popen(char *command, FILE **iop)
+{
+ char *argv[4];
+ int pdes[4];
+ int pid;
+
+ if (pipe(pdes) < 0)
+ goto error;
+
+ if (pipe(pdes + 2) < 0) {
+ close(pdes[0]);
+ close(pdes[1]);
+ goto error;
+ }
+ argv[0] = "sh";
+ argv[1] = "-c";
+ argv[2] = command;
+ argv[3] = NULL;
+
+ switch ((pid = vfork())) {
+ case -1: /* Error. */
+ close(pdes[0]);
+ close(pdes[1]);
+ close(pdes[2]);
+ close(pdes[3]);
+ goto error;
+ case 0: /* Child. */
+ dup2(pdes[1], STDOUT_FILENO);
+ dup2(pdes[2], STDIN_FILENO);
+ close(pdes[0]);
+ close(pdes[3]);
+ execve("/bin/sh", argv, environ);
+ exit(127);
+ default:
+ break;
+ }
+ iop[0] = fdopen(pdes[3], "w");
+ iop[1] = fdopen(pdes[0], "r");
+ close(pdes[1]);
+ close(pdes[2]);
+ return;
+error:
+ iop[0] = iop[1] = NULL;
+}
+
+static void
+cmd_block_process(block_head_t *pbh_in, block_head_t *pbh_out, char *cmd_str)
+{
+ FILE *pfd[2];
+ struct block *ptr;
+
+ TAILQ_INIT(pbh_out);
+
+ cmd_popen(cmd_str, pfd);
+
+ if (pfd[0] == NULL || pfd[1] == NULL)
+ errx(EX_SOFTWARE, "Cannot invoke command '%s'", cmd_str);
+
+ if (pbh_in != NULL) {
+ TAILQ_FOREACH(ptr, pbh_in, entry) {
+ if (fwrite(ptr->data, 1, ptr->length, pfd[0]) != ptr->length)
+ err(EX_SOFTWARE, "Cannot write all data to command '%s'", cmd_str);
+ }
+ fflush(pfd[0]);
+ }
+ fclose(pfd[0]);
+
+ while (1) {
+ int len;
+
+ ptr = alloc_block();
+ len = fread(ptr->data, 1, BLOCK_SIZE, pfd[1]);
+ if (len <= 0) {
+ free(ptr);
+ break;
+ }
+ ptr->length = len;
+ TAILQ_INSERT_TAIL(pbh_out, ptr, entry);
+ }
+ fclose(pfd[1]);
+}
+
+static void
+usage(void)
+{
+ fprintf(stderr,
+ "indent_wrapper [-v] [-d] [-D] [-g <githash>]\n"
+ "\t" "[-s <svnrevision> ] [ -t <tool> ] [ -c <command> ]\n"
+ "\t" "-v Increase verbosity\n"
+ "\t" "-d Check output from git diff\n"
+ "\t" "-D Check output from svn diff\n"
+ "\t" "-c <cmd> Set custom command to produce diff\n"
+ "\t" "-g <hash> Check output from git hash\n"
+ "\t" "-s <rev> Check output from svn revision\n"
+ "\t" "-t <tool> Launch external diff tool\n"
+ "\n"
+ "Examples:\n"
+ "\t" "indent_wrapper -D\n"
+ "\t" "indent_wrapper -D -t meld\n"
+ "\t" "indent_wrapper -D -t \"diff -u\"\n");
+ exit(EX_SOFTWARE);
+}
+
+int
+main(int argc, char **argv)
+{
+ block_head_t diff_head;
+ block_head_t diff_a_head;
+ block_head_t diff_b_head;
+ block_head_t indent_in_head;
+ block_head_t indent_out_head;
+ struct block *p1 = NULL;
+ struct block *p2 = NULL;
+ uint64_t size;
+ uint64_t x;
+ uint64_t y1 = 0;
+ uint64_t y2 = 0;
+ int recurse = 0;
+ int inside_string = 0;
+ int escape_char = 0;
+ int do_parse = 0;
+ char cmdbuf[256];
+ uint16_t ch;
+ uint16_t chn;
+ int c;
+ int retval = 0;
+
+ signal(SIGPIPE, &sigpipe);
+
+ cmdbuf[0] = 0;
+
+ while ((c = getopt(argc, argv, "dDvg:s:c:ht:")) != -1) {
+ switch (c) {
+ case 'v':
+ opt_verbose++;
+ break;
+ case 't':
+ opt_diff_tool = optarg;
+ break;
+ case 'g':
+ snprintf(cmdbuf, sizeof(cmdbuf), "git show -U1000000 %s", optarg);
+ break;
+ case 'd':
+ snprintf(cmdbuf, sizeof(cmdbuf), "git diff -U1000000");
+ break;
+ case 'D':
+ snprintf(cmdbuf, sizeof(cmdbuf), "svn diff --diff-cmd=diff -x -U1000000");
+ break;
+ case 's':
+ snprintf(cmdbuf, sizeof(cmdbuf), "svn diff --diff-cmd=diff -x -U1000000 -r %s", optarg);
+ break;
+ case 'c':
+ snprintf(cmdbuf, sizeof(cmdbuf), "%s", optarg);
+ break;
+ default:
+ usage();
+ }
+ }
+ if (cmdbuf[0] == 0)
+ usage();
+
+ cmd_block_process(NULL, &diff_head, cmdbuf);
+
+ TAILQ_INIT(&diff_a_head);
+ TAILQ_INIT(&diff_b_head);
+
+ size = size_block(&diff_head);
+ p1 = alloc_block();
+ y1 = 0;
+ p2 = alloc_block();
+ y2 = 0;
+
+ for (x = 0; x < size;) {
+ ch = peek_block(&diff_head, x);
+ switch (ch & 0xFF) {
+ case '+':
+ if (ch == peek_block(&diff_head, x + 1) &&
+ ch == peek_block(&diff_head, x + 2) &&
+ ' ' == (peek_block(&diff_head, x + 3) & 0xFF))
+ goto parse_filename;
+ if (do_parse == 0)
+ break;
+ for (x++; x != size; x++) {
+ ch = peek_block(&diff_head, x);
+ p1->mask[y1] = BLOCK_ADD >> 8;
+ p1->data[y1++] = ch;
+ if (y1 == BLOCK_SIZE) {
+ TAILQ_INSERT_TAIL(&diff_a_head, p1, entry);
+ p1 = alloc_block();
+ y1 = 0;
+ }
+ if ((ch & 0xFF) == '\n')
+ break;
+ }
+ break;
+ case '-':
+ if (ch == peek_block(&diff_head, x + 1) &&
+ ch == peek_block(&diff_head, x + 2) &&
+ ' ' == (peek_block(&diff_head, x + 3) & 0xFF))
+ goto parse_filename;
+ if (do_parse == 0)
+ break;
+ for (x++; x != size; x++) {
+ ch = peek_block(&diff_head, x);
+ p2->data[y2++] = ch;
+ if (y2 == BLOCK_SIZE) {
+ TAILQ_INSERT_TAIL(&diff_b_head, p2, entry);
+ p2 = alloc_block();
+ y2 = 0;
+ }
+ if ((ch & 0xFF) == '\n')
+ break;
+ }
+ break;
+ case ' ':
+ if (do_parse == 0)
+ break;
+ for (x++; x != size; x++) {
+ ch = peek_block(&diff_head, x);
+ p1->data[y1++] = ch;
+ if (y1 == BLOCK_SIZE) {
+ TAILQ_INSERT_TAIL(&diff_a_head, p1, entry);
+ p1 = alloc_block();
+ y1 = 0;
+ }
+ p2->data[y2++] = ch;
+ if (y2 == BLOCK_SIZE) {
+ TAILQ_INSERT_TAIL(&diff_b_head, p2, entry);
+ p2 = alloc_block();
+ y2 = 0;
+ }
+ if ((ch & 0xFF) == '\n')
+ break;
+ }
+ break;
+ parse_filename:
+ for (x += 3; x != size; x++) {
+ ch = peek_block(&diff_head, x);
+ chn = peek_block(&diff_head, x + 1);
+ if ((ch & 0xFF) == '.') {
+ /* only accept .c and .h files */
+ do_parse = ((chn & 0xFF) == 'c' || (chn & 0xFF) == 'h');
+ }
+ if ((ch & 0xFF) == '\n')
+ break;
+ }
+ default:
+ break;
+ }
+ /* skip till end of line */
+ for (; x < size; x++) {
+ ch = peek_block(&diff_head, x);
+ if ((ch & 0xFF) == '\n') {
+ x++;
+ break;
+ }
+ }
+ }
+ p1->length = y1;
+ p2->length = y2;
+ TAILQ_INSERT_TAIL(&diff_a_head, p1, entry);
+ TAILQ_INSERT_TAIL(&diff_b_head, p2, entry);
+
+ /* first pass - verify input */
+ size = size_block(&diff_a_head);
+ for (x = 0; x != size; x++) {
+ ch = peek_block(&diff_a_head, x) & 0xFF;
+ if (!(ch & 0x80) && ch != '\t' && ch != '\r' && ch != '\n' &&
+ ch != ' ' && !isprint(ch))
+ errx(EX_SOFTWARE, "Non printable characters are not allowed: '%c'", ch);
+ else if (ch & 0x80) {
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ }
+ }
+
+ /* second pass - identify all comments */
+ for (x = 0; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ chn = peek_block(&diff_a_head, x + 1);
+ if ((ch & 0xFF) == '/' && (chn & 0xFF) == '/') {
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ set_block(&diff_a_head, x + 1, chn | BLOCK_MASK);
+ for (x += 2; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ if ((ch & 0xFF) == '\n')
+ break;
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ }
+ } else if ((ch & 0xFF) == '/' && (chn & 0xFF) == '*') {
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ set_block(&diff_a_head, x + 1, chn | BLOCK_MASK);
+ for (x += 2; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ chn = peek_block(&diff_a_head, x + 1);
+ if ((ch & 0xFF) == '*' && (chn & 0xFF) == '/') {
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ set_block(&diff_a_head, x + 1, chn | BLOCK_MASK);
+ x++;
+ break;
+ }
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ }
+ }
+ }
+
+ /* third pass - identify preprocessor tokens and strings */
+ for (x = 0; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ if (ch & BLOCK_MASK)
+ continue;
+ if (inside_string == 0 && (ch & 0xFF) == '#') {
+ int skip_newline = 0;
+
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ for (x++; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ if ((ch & 0xFF) == '\n') {
+ if (!skip_newline)
+ break;
+ skip_newline = 0;
+ }
+ if (ch & BLOCK_MASK)
+ continue;
+ if ((ch & 0xFF) == '\\')
+ skip_newline = 1;
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ }
+ }
+ if ((ch & 0xFF) == '"' || (ch & 0xFF) == '\'') {
+ if (inside_string == 0) {
+ inside_string = (ch & 0xFF);
+ } else {
+ if (escape_char == 0 && inside_string == (ch & 0xFF))
+ inside_string = 0;
+ }
+ escape_char = 0;
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ } else if (inside_string != 0) {
+ if ((ch & 0xFF) == '\\')
+ escape_char = !escape_char;
+ else
+ escape_char = 0;
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ }
+ }
+
+ /* fourth pass - identify function blocks */
+ if (opt_verbose > 0) {
+ chn = peek_block(&diff_a_head, x);
+ printf("L%02d%c|", recurse,
+ (chn & BLOCK_ADD) ? '+' : ' ');
+ }
+ for (x = 0; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ if (opt_verbose > 0) {
+ printf("%c", ch & 0xFF);
+ if ((ch & 0xFF) == '\n') {
+ chn = peek_block(&diff_a_head, x + 1);
+ printf("L%02d%c|", recurse,
+ (chn & BLOCK_ADD) ? '+' : ' ');
+ }
+ }
+ if (ch & BLOCK_MASK)
+ continue;
+ switch (ch & 0xFF) {
+ case '{':
+ case '(':
+ recurse++;
+ break;
+ default:
+ break;
+ }
+ if (recurse != 0)
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ switch (ch & 0xFF) {
+ case '}':
+ case ')':
+ recurse--;
+ break;
+ default:
+ break;
+ }
+ }
+ if (opt_verbose > 0)
+ printf("\n");
+ if (recurse != 0)
+ errx(EX_SOFTWARE, "Unbalanced parenthesis");
+ if (inside_string != 0)
+ errx(EX_SOFTWARE, "String without end");
+
+ /* fifth pass - on the same line statements */
+ for (x = 0; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ if (ch & BLOCK_MASK)
+ continue;
+ switch (ch & 0xFF) {
+ case '\n':
+ break;
+ default:
+ set_block(&diff_a_head, x, ch | BLOCK_MASK);
+ break;
+ }
+ }
+
+ /* sixth pass - output relevant blocks to indent */
+ for (y1 = x = 0; x < size; x++) {
+ ch = peek_block(&diff_a_head, x);
+ if (ch & BLOCK_ADD) {
+ TAILQ_INIT(&indent_in_head);
+
+ p2 = alloc_block();
+ y2 = 0;
+ for (; y1 < size; y1++) {
+ ch = peek_block(&diff_a_head, y1);
+ if (y1 > x && !(ch & (BLOCK_MASK | BLOCK_ADD)))
+ break;
+ p2->data[y2++] = ch & 0xFF;
+ if (y2 == BLOCK_SIZE) {
+ TAILQ_INSERT_TAIL(&indent_in_head, p2, entry);
+ p2 = alloc_block();
+ y2 = 0;
+ }
+ }
+ if (p2->data[y2] != '\n')
+ p2->data[y2++] = '\n';
+ p2->length = y2;
+ TAILQ_INSERT_TAIL(&indent_in_head, p2, entry);
+
+ cmd_block_process(&indent_in_head, &indent_out_head,
+ "indent "
+ "-Tbool "
+ "-Tclass "
+ "-TFILE "
+ "-TLIST_ENTRY "
+ "-TLIST_HEAD "
+ "-TSLIST_ENTRY "
+ "-TSLIST_HEAD "
+ "-TSTAILQ_ENTRY "
+ "-TSTAILQ_HEAD "
+ "-TTAILQ_ENTRY "
+ "-TTAILQ_HEAD "
+ "-T__aligned "
+ "-T__packed "
+ "-T__unused "
+ "-T__used "
+ "-Tfd_set "
+ "-Toss_mixerinfo "
+ "-Tu_char "
+ "-Tu_int "
+ "-Tu_long "
+ "-Tu_short "
+ "-ta -st -bad -bap -nbbb -nbc -br -nbs "
+ "-c41 -cd41 -cdb -ce -ci4 -cli0 -d0 -di8 -ndj -ei -nfc1 "
+ "-nfcb -i8 -ip8 -l79 -lc77 -ldi0 -nlp -npcs -psl -sc "
+ "-nsob -nv "
+ " | "
+ "sed "
+ "-e 's/_HEAD [(]/_HEAD(/g' "
+ "-e 's/_ENTRY [(]/_ENTRY(/g' "
+ "-e 's/\t__aligned/ __aligned/g' "
+ "-e 's/\t__packed/ __packed/g' "
+ "-e 's/\t__unused/ __unused/g' "
+ "-e 's/\t__used/ __used/g' "
+ "-e 's/^#define /#define\t/g'");
+
+ if (opt_diff_tool != NULL) {
+ if (diff_tool(&indent_in_head, &indent_out_head))
+ retval = 1;
+ } else {
+ if (diff_block(&indent_in_head, &indent_out_head))
+ retval = 1;
+ }
+ free_block(&indent_in_head);
+ free_block(&indent_out_head);
+ x = y1;
+ } else if (!(ch & BLOCK_MASK)) {
+ y1 = x + 1;
+ }
+ }
+ return (retval);
+}
diff --git a/usr.bin/awk/Makefile b/usr.bin/awk/Makefile
index a8bcb5c..80ca5db 100644
--- a/usr.bin/awk/Makefile
+++ b/usr.bin/awk/Makefile
@@ -17,7 +17,7 @@ MLINKS= awk.1 nawk.1
CLEANFILES= maketab proctab.c ytab.h
-ytab.h: awkgram.h
+ytab.h: awkgram.h .NOMETA
ln -sf ${.ALLSRC} ${.TARGET}
proctab.c: maketab
diff --git a/usr.bin/calendar/calendars/calendar.freebsd b/usr.bin/calendar/calendars/calendar.freebsd
index 6817ce2..0cca8f6 100644
--- a/usr.bin/calendar/calendars/calendar.freebsd
+++ b/usr.bin/calendar/calendars/calendar.freebsd
@@ -155,6 +155,7 @@
05/09 Aaron Dalton <aaron@FreeBSD.org> born in Boise, Idaho, United States, 1973
05/09 Jase Thew <jase@FreeBSD.org> born in Abergavenny, Gwent, United Kingdom, 1974
05/10 Markus Brueffer <markus@FreeBSD.org> born in Gronau, Nordrhein-Westfalen, Germany, 1977
+05/11 Kurt Lidl <lidl@FreeBSD.org> born in Rockville, Maryland, United States, 1968
05/11 Jesus Rodriguez <jesusr@FreeBSD.org> born in Barcelona, Spain, 1972
05/11 Roman Kurakin <rik@FreeBSD.org> born in Moscow, USSR, 1979
05/11 Ulrich Spoerlein <uqs@FreeBSD.org> born in Schesslitz, Bayern, Germany, 1981
diff --git a/usr.bin/cpio/tests/Makefile b/usr.bin/cpio/tests/Makefile
index a1f8a5e..d633abd 100644
--- a/usr.bin/cpio/tests/Makefile
+++ b/usr.bin/cpio/tests/Makefile
@@ -75,9 +75,6 @@ SRCS.bsdcpio_test= list.h \
${TESTS_SRCS} \
main.c
-DPSRCS.bsdcpio_test= \
- list.h
-
.PATH: ${LIBARCHIVEDIR}/test_utils
SRCS.bsdcpio_test+= test_utils.c
diff --git a/usr.bin/cxxfilt/Makefile.depend b/usr.bin/cxxfilt/Makefile.depend
new file mode 100644
index 0000000..40241f3
--- /dev/null
+++ b/usr.bin/cxxfilt/Makefile.depend
@@ -0,0 +1,20 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ lib/libelf \
+ lib/libelftc \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+.endif
diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile
index 6f196ac..5048fdd 100644
--- a/usr.bin/kdump/Makefile
+++ b/usr.bin/kdump/Makefile
@@ -6,8 +6,7 @@
.PATH: ${.CURDIR}/../ktrace
PROG= kdump
-SRCS= kdump_subr.c kdump.c ioctl.c subr.c utrace.c
-DPSRCS= kdump_subr.h
+SRCS= kdump_subr.c kdump_subr.h kdump.c ioctl.c subr.c utrace.c
CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
.if ${MK_CASPER} != "no"
diff --git a/usr.bin/localedef/Makefile.depend b/usr.bin/localedef/Makefile.depend
new file mode 100644
index 0000000..ac5eda1
--- /dev/null
+++ b/usr.bin/localedef/Makefile.depend
@@ -0,0 +1,39 @@
+# $FreeBSD$
+# Autogenerated - do NOT edit!
+
+DIRDEPS = \
+ gnu/lib/csu \
+ gnu/lib/libgcc \
+ include \
+ include/xlocale \
+ lib/${CSU_DIR} \
+ lib/libc \
+ lib/libcompiler_rt \
+ usr.bin/yacc.host \
+
+
+.include <dirdeps.mk>
+
+.if ${DEP_RELDIR} == ${_DEP_RELDIR}
+# local dependencies - needed for -jN in clean tree
+charmap.o: parser.h
+charmap.po: parser.h
+collate.o: parser.h
+collate.po: parser.h
+ctype.o: parser.h
+ctype.po: parser.h
+localedef.o: parser.h
+localedef.po: parser.h
+messages.o: parser.h
+messages.po: parser.h
+monetary.o: parser.h
+monetary.po: parser.h
+numeric.o: parser.h
+numeric.po: parser.h
+parser.o: parser.c
+parser.po: parser.c
+scanner.o: parser.h
+scanner.po: parser.h
+time.o: parser.h
+time.po: parser.h
+.endif
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile
index abfebf4..8bbce90 100644
--- a/usr.bin/netstat/Makefile
+++ b/usr.bin/netstat/Makefile
@@ -6,8 +6,7 @@
PROG= netstat
SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c nl_symbols.c route.c \
unix.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c \
- flowtable.c
-DPSRCS= nl_defs.h
+ flowtable.c nl_defs.h
nl_symbols.c: nlist_symbols
awk '\
diff --git a/usr.bin/netstat/inet.c b/usr.bin/netstat/inet.c
index 5644af3..6a93314 100644
--- a/usr.bin/netstat/inet.c
+++ b/usr.bin/netstat/inet.c
@@ -84,7 +84,8 @@ __FBSDID("$FreeBSD$");
#include "netstat.h"
char *inetname(struct in_addr *);
-void inetprint(const char *, struct in_addr *, int, const char *, int);
+void inetprint(const char *, struct in_addr *, int, const char *, int,
+ const int);
#ifdef INET6
static int udp_done, tcp_done, sdp_done;
#endif /* INET6 */
@@ -417,18 +418,24 @@ protopr(u_long off, const char *name, int af1, int proto)
if (Lflag)
xo_emit((Aflag && !Wflag) ?
"{T:/%-5.5s} {T:/%-14.14s} {T:/%-18.18s}" :
- "{T:/%-5.5s} {T:/%-14.14s} {T:/%-22.22s}",
+ ((!Wflag || af1 == AF_INET) ?
+ "{T:/%-5.5s} {T:/%-14.14s} {T:/%-22.22s}" :
+ "{T:/%-5.5s} {T:/%-14.14s} {T:/%-45.45s}"),
"Proto", "Listen", "Local Address");
else if (Tflag)
xo_emit((Aflag && !Wflag) ?
"{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%s}" :
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}",
+ ((!Wflag || af1 == AF_INET) ?
+ "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%s}" :
+ "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-45.45s} {T:/%s}"),
"Proto", "Rexmit", "OOORcv", "0-win",
"Local Address", "Foreign Address");
else {
xo_emit((Aflag && !Wflag) ?
"{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-18.18s} {T:/%-18.18s}" :
- "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%-22.22s}",
+ ((!Wflag || af1 == AF_INET) ?
+ "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-22.22s} {T:/%-22.22s}" :
+ "{T:/%-5.5s} {T:/%-6.6s} {T:/%-6.6s} {T:/%-45.45s} {T:/%-45.45s}"),
"Proto", "Recv-Q", "Send-Q",
"Local Address", "Foreign Address");
if (!xflag && !Rflag)
@@ -491,6 +498,8 @@ protopr(u_long off, const char *name, int af1, int proto)
"{:sent-zero-window/%6u} ",
tp->t_sndrexmitpack, tp->t_rcvoopack,
tp->t_sndzerowin);
+ else
+ xo_emit("{P:/%21s}", "");
} else {
xo_emit("{:receive-bytes-waiting/%6u} "
"{:send-bytes-waiting/%6u} ",
@@ -499,10 +508,10 @@ protopr(u_long off, const char *name, int af1, int proto)
if (numeric_port) {
if (inp->inp_vflag & INP_IPV4) {
inetprint("local", &inp->inp_laddr,
- (int)inp->inp_lport, name, 1);
+ (int)inp->inp_lport, name, 1, af1);
if (!Lflag)
inetprint("remote", &inp->inp_faddr,
- (int)inp->inp_fport, name, 1);
+ (int)inp->inp_fport, name, 1, af1);
}
#ifdef INET6
else if (inp->inp_vflag & INP_IPV6) {
@@ -516,10 +525,10 @@ protopr(u_long off, const char *name, int af1, int proto)
} else if (inp->inp_flags & INP_ANONPORT) {
if (inp->inp_vflag & INP_IPV4) {
inetprint("local", &inp->inp_laddr,
- (int)inp->inp_lport, name, 1);
+ (int)inp->inp_lport, name, 1, af1);
if (!Lflag)
inetprint("remote", &inp->inp_faddr,
- (int)inp->inp_fport, name, 0);
+ (int)inp->inp_fport, name, 0, af1);
}
#ifdef INET6
else if (inp->inp_vflag & INP_IPV6) {
@@ -533,11 +542,12 @@ protopr(u_long off, const char *name, int af1, int proto)
} else {
if (inp->inp_vflag & INP_IPV4) {
inetprint("local", &inp->inp_laddr,
- (int)inp->inp_lport, name, 0);
+ (int)inp->inp_lport, name, 0, af1);
if (!Lflag)
inetprint("remote", &inp->inp_faddr,
(int)inp->inp_fport, name,
- inp->inp_lport != inp->inp_fport);
+ inp->inp_lport != inp->inp_fport,
+ af1);
}
#ifdef INET6
else if (inp->inp_vflag & INP_IPV6) {
@@ -1364,7 +1374,7 @@ pim_stats(u_long off __unused, const char *name, int af1 __unused,
*/
void
inetprint(const char *container, struct in_addr *in, int port,
- const char *proto, int num_port)
+ const char *proto, int num_port, const int af1)
{
struct servent *sp = 0;
char line[80], *cp;
@@ -1384,7 +1394,8 @@ inetprint(const char *container, struct in_addr *in, int port,
sprintf(cp, "%.15s ", sp ? sp->s_name : "*");
else
sprintf(cp, "%d ", ntohs((u_short)port));
- width = (Aflag && !Wflag) ? 18 : 22;
+ width = (Aflag && !Wflag) ? 18 :
+ ((!Wflag || af1 == AF_INET) ? 22 : 45);
if (Wflag)
xo_emit("{d:target/%-*s} ", width, line);
else
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index af532a6..ce9e81a 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -242,6 +242,8 @@ main(int argc, char *argv[])
af = AF_UNSPEC;
argc = xo_parse_args(argc, argv);
+ if (argc < 0)
+ exit(EXIT_FAILURE);
while ((ch = getopt(argc, argv, "46AaBbdF:f:ghI:iLlM:mN:np:Qq:RrSTsuWw:xz"))
!= -1)
diff --git a/usr.bin/readelf/Makefile b/usr.bin/readelf/Makefile
index e5d7401..1905112 100644
--- a/usr.bin/readelf/Makefile
+++ b/usr.bin/readelf/Makefile
@@ -6,9 +6,23 @@ READELFDIR= ${ELFTCDIR}/readelf
.PATH: ${READELFDIR}
PROG= readelf
+SRCS= readelf.c
LIBADD= dwarf elftc elf
CFLAGS+=-I${ELFTCDIR}/libelftc -I${ELFTCDIR}/common
+# This same hack is in lib/libelf/Makefile and lib/libdwarf/Makefile
+# We need to link against the correct version of these files. One
+# solution is to include ../../sys in the include path. This causes
+# problems when a header file in sys depends on a file in another
+# part of the tree, e.g. a machine dependent header.
+#
+SRCS+= sys/elf32.h sys/elf64.h sys/elf_common.h
+CLEANDIRS= sys
+CFLAGS+= -I.
+sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
+ mkdir -p ${.OBJDIR}/sys
+ ln -sf ${.ALLSRC} ${.TARGET}
+
.include <bsd.prog.mk>
diff --git a/usr.bin/svn/svn/Makefile b/usr.bin/svn/svn/Makefile
index e88dbdf..87d9df1 100644
--- a/usr.bin/svn/svn/Makefile
+++ b/usr.bin/svn/svn/Makefile
@@ -52,7 +52,7 @@ DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \
CLEANFILES+= svnlite.1
.if(defined(ORGANIZATION) && !empty(ORGANIZATION))
-DPSRCS+= freebsd-organization.h
+SRCS+= freebsd-organization.h
CLEANFILES+= freebsd-organization.h
CFLAGS+= -I. -DHAS_ORGANIZATION_NAME
freebsd-organization.h:
diff --git a/usr.bin/tar/tests/Makefile b/usr.bin/tar/tests/Makefile
index b1cccfe..02918b3 100644
--- a/usr.bin/tar/tests/Makefile
+++ b/usr.bin/tar/tests/Makefile
@@ -75,8 +75,6 @@ SRCS.bsdtar_test= \
list.h \
main.c
-DPSRCS.bsdtar_test+= list.h
-
.PATH: ${LIBARCHIVEDIR}/test_utils
SRCS.bsdtar_test+= test_utils.c
diff --git a/usr.bin/vacation/Makefile b/usr.bin/vacation/Makefile
index f32e0c4..aa8e9bd 100644
--- a/usr.bin/vacation/Makefile
+++ b/usr.bin/vacation/Makefile
@@ -22,7 +22,7 @@ DPADD+=${SENDMAIL_DPADD}
LDADD+=${SENDMAIL_LDADD}
LDFLAGS+=${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/acpi/iasl/Makefile b/usr.sbin/acpi/iasl/Makefile
index 210b31a..b4385c7 100644
--- a/usr.sbin/acpi/iasl/Makefile
+++ b/usr.sbin/acpi/iasl/Makefile
@@ -95,7 +95,7 @@ aslcompiler.y: aslparser.y aslrules.y aslsupport.y asltokens.y asltypes.y
aslcompilerparse.c aslcompilerparse.h: aslcompiler.y
${YACC} ${YFLAGS} -pAslCompiler -oaslcompilerparse.c ${.ALLSRC}
-aslcompiler.y.h: aslcompilerparse.h
+aslcompiler.y.h: aslcompilerparse.h .NOMETA
ln -f ${.ALLSRC} ${.TARGET}
dtparserlex.c: dtparser.l
@@ -105,7 +105,7 @@ dtparserlex.c: dtparser.l
dtparserparse.c dtparserparse.h: dtparser.y
${YACC} ${YFLAGS} -pDtParser -odtparserparse.c ${.ALLSRC}
-dtparser.y.h: dtparserparse.h
+dtparser.y.h: dtparserparse.h .NOMETA
ln -f ${.ALLSRC} ${.TARGET}
prparserlex.c: prparser.l
@@ -115,7 +115,7 @@ prparserlex.c: prparser.l
prparserparse.c prparserparse.h: prparser.y
${YACC} ${YFLAGS} -pPrParser -oprparserparse.c ${.ALLSRC}
-prparser.y.h: prparserparse.h
+prparser.y.h: prparserparse.h .NOMETA
ln -f ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/amd/include/Makefile.depend b/usr.sbin/amd/include/Makefile.depend
index 50936ca..f80275d 100644
--- a/usr.sbin/amd/include/Makefile.depend
+++ b/usr.sbin/amd/include/Makefile.depend
@@ -2,7 +2,6 @@
# Autogenerated - do NOT edit!
DIRDEPS = \
- bin/cat.host \
.include <dirdeps.mk>
diff --git a/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend
index 06b5e37..aecafbc 100644
--- a/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_atm/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
usr.sbin/bsnmpd/modules/snmp_mibII \
usr.sbin/bsnmpd/modules/snmp_netgraph \
diff --git a/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend
index 7d1ccb6..f391300 100644
--- a/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_bridge/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
usr.sbin/bsnmpd/modules/snmp_mibII \
diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend
index 64bb2df..a492080 100644
--- a/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile.depend
@@ -15,7 +15,6 @@ DIRDEPS = \
lib/libkvm \
lib/libmemstat \
lib/msun \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
usr.sbin/bsnmpd/modules/snmp_mibII \
diff --git a/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend
index ea1a0a5..e3d0506 100644
--- a/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_lm75/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
diff --git a/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend
index 8e546b0..32018d0 100644
--- a/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_mibII/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend
index 19bbcd5..cad32c9 100644
--- a/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_netgraph/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libc \
lib/libcompiler_rt \
lib/libnetgraph \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend
index 6843d75..855779d 100644
--- a/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_pf/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
diff --git a/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend
index c8536c4..66ec571 100644
--- a/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_target/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend
index 2e9a3fe..a7180f9 100644
--- a/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_usm/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend
index 25501c8..89b4f2b 100644
--- a/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_vacm/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend b/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend
index 80b1aea..329da3d 100644
--- a/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend
+++ b/usr.sbin/bsnmpd/modules/snmp_wlan/Makefile.depend
@@ -10,7 +10,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
usr.sbin/bsnmpd/modules \
usr.sbin/bsnmpd/modules/snmp_mibII \
diff --git a/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend b/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend
index 06abcea..fc79573 100644
--- a/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend
+++ b/usr.sbin/bsnmpd/tools/libbsnmptools/Makefile.depend
@@ -11,7 +11,6 @@ DIRDEPS = \
lib/libbsnmp/libbsnmp \
lib/libc \
lib/libcompiler_rt \
- usr.bin/xinstall.host \
.include <dirdeps.mk>
diff --git a/usr.sbin/editmap/Makefile b/usr.sbin/editmap/Makefile
index 20d86ab..23e967f 100644
--- a/usr.sbin/editmap/Makefile
+++ b/usr.sbin/editmap/Makefile
@@ -23,7 +23,7 @@ DPADD+=${SENDMAIL_DPADD}
LDADD+=${SENDMAIL_LDADD}
LDFLAGS+=${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/mailstats/Makefile b/usr.sbin/mailstats/Makefile
index a7911a2..3d03ff8 100644
--- a/usr.sbin/mailstats/Makefile
+++ b/usr.sbin/mailstats/Makefile
@@ -24,7 +24,7 @@ DPADD+= ${SENDMAIL_DPADD}
LDADD+= ${SENDMAIL_LDADD}
LDFLAGS+= ${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/makemap/Makefile b/usr.sbin/makemap/Makefile
index ceec1b3..af5f742 100644
--- a/usr.sbin/makemap/Makefile
+++ b/usr.sbin/makemap/Makefile
@@ -24,7 +24,7 @@ DPADD+=${SENDMAIL_DPADD}
LDADD+=${SENDMAIL_LDADD}
LDFLAGS+=${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/praliases/Makefile b/usr.sbin/praliases/Makefile
index 6fadc1b..b0b3e2d 100644
--- a/usr.sbin/praliases/Makefile
+++ b/usr.sbin/praliases/Makefile
@@ -24,7 +24,7 @@ LDFLAGS+=${SENDMAIL_LDFLAGS}
DPADD+= ${SENDMAIL_DPADD}
LDADD+= ${SENDMAIL_LDADD}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/sendmail/Makefile b/usr.sbin/sendmail/Makefile
index d201d91..80ce13b 100644
--- a/usr.sbin/sendmail/Makefile
+++ b/usr.sbin/sendmail/Makefile
@@ -62,7 +62,7 @@ DPADD+=${SENDMAIL_DPADD}
LDADD+=${SENDMAIL_LDADD}
LDFLAGS+=${SENDMAIL_LDFLAGS}
-sm_os.h:
- ln -sf ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h sm_os.h
+sm_os.h: ${SENDMAIL_DIR}/include/sm/os/sm_os_freebsd.h .NOMETA
+ ln -sf ${.ALLSRC} ${.TARGET}
.include <bsd.prog.mk>
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index b5b57b3..cd0f1b6 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -341,6 +341,7 @@ static void printsys(char *);
static int p_open(const char *, pid_t *);
static void readklog(void);
static void reapchild(int);
+static const char *ttymsg_check(struct iovec *, int, char *, int);
static void usage(void);
static int validate(struct sockaddr *, const char *);
static void unmapped(struct sockaddr *);
@@ -1425,7 +1426,7 @@ wallmsg(struct filed *f, struct iovec *iov, const int iovlen)
if (!f->f_un.f_uname[i][0])
break;
if (!strcmp(f->f_un.f_uname[i], ut->ut_user)) {
- if ((p = ttymsg(iov, iovlen, ut->ut_line,
+ if ((p = ttymsg_check(iov, iovlen, ut->ut_line,
TTYMSGTIME)) != NULL) {
errno = 0; /* already in msg */
logerror(p);
@@ -1438,6 +1439,29 @@ wallmsg(struct filed *f, struct iovec *iov, const int iovlen)
reenter = 0;
}
+/*
+ * Wrapper routine for ttymsg() that checks the terminal for messages enabled.
+ */
+static const char *
+ttymsg_check(struct iovec *iov, int iovcnt, char *line, int tmout)
+{
+ static char device[1024];
+ static char errbuf[1024];
+ struct stat sb;
+
+ (void) snprintf(device, sizeof(device), "%s%s", _PATH_DEV, line);
+
+ if (stat(device, &sb) < 0) {
+ (void) snprintf(errbuf, sizeof(errbuf),
+ "%s: %s", device, strerror(errno));
+ return (errbuf);
+ }
+ if ((sb.st_mode & S_IWGRP) == 0)
+ /* Messages disabled. */
+ return (NULL);
+ return ttymsg(iov, iovcnt, line, tmout);
+}
+
static void
reapchild(int signo __unused)
{
OpenPOWER on IntegriCloud