aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2014-05-08 23:54:15 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2014-05-08 23:54:15 +0000
commitcc3f4b99653c34ae64f8a1fddea370abefef680e (patch)
tree8ce0ddd0e6f508bd20c77429c448969589170fae
parentf974b33f6ed6f35170c520d2be111bfc2c3954cd (diff)
parent16aa1f0950a3b4407a36ecc96acc8ca0710ebd91 (diff)
downloadsrc-cc3f4b99653c34ae64f8a1fddea370abefef680e.tar.gz
src-cc3f4b99653c34ae64f8a1fddea370abefef680e.zip
Merge from head
Notes
Notes: svn path=/projects/bmake/; revision=265720
-rw-r--r--Makefile29
-rw-r--r--Makefile.inc128
-rw-r--r--ObsoleteFiles.inc9
-rw-r--r--UPDATING1291
-rw-r--r--bin/Makefile2
-rw-r--r--bin/Makefile.inc2
-rw-r--r--bin/csh/Makefile2
-rw-r--r--bin/date/Makefile2
-rw-r--r--bin/dd/conv.c2
-rw-r--r--bin/dd/dd.c74
-rw-r--r--bin/dd/dd.h4
-rw-r--r--bin/dd/misc.c20
-rw-r--r--bin/ed/Makefile2
-rw-r--r--bin/ls/Makefile2
-rw-r--r--bin/mv/Makefile2
-rw-r--r--bin/pax/Makefile2
-rw-r--r--bin/pkill/Makefile2
-rw-r--r--bin/ps/Makefile4
-rw-r--r--bin/ps/ps.119
-rw-r--r--bin/ps/ps.c46
-rw-r--r--bin/sh/Makefile2
-rw-r--r--bin/sh/tests/builtins/Makefile3
-rw-r--r--bin/sh/tests/builtins/getopts3.06
-rw-r--r--bin/sh/tests/builtins/getopts4.010
-rw-r--r--bin/sh/tests/builtins/getopts5.010
-rw-r--r--bin/test/Makefile2
-rw-r--r--cddl/Makefile2
-rw-r--r--cddl/compat/opensolaris/include/thread_pool.h99
-rw-r--r--cddl/compat/opensolaris/misc/thread_pool.c430
-rw-r--r--cddl/compat/opensolaris/misc/thread_pool_impl.h99
-rw-r--r--cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c2
-rw-r--r--cddl/lib/Makefile2
-rw-r--r--cddl/lib/libdtrace/libproc_compat.h1
-rw-r--r--cddl/lib/libzfs/Makefile1
-rw-r--r--cddl/sbin/Makefile2
-rw-r--r--cddl/usr.bin/Makefile2
-rw-r--r--cddl/usr.sbin/Makefile2
-rw-r--r--contrib/gcc/config/i386/i386.c2
-rw-r--r--contrib/libstdc++/include/bits/stl_multimap.h2
-rw-r--r--contrib/llvm/tools/clang/include/clang/Driver/Options.td10
-rw-r--r--contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h20
-rw-r--r--contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp12
-rw-r--r--contrib/llvm/tools/clang/lib/Driver/Tools.cpp4
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp22
-rw-r--r--contrib/ntp/ntpd/ntp_request.c2
-rw-r--r--contrib/top/commands.c1
-rw-r--r--contrib/top/machine.h1
-rw-r--r--contrib/top/top.X23
-rw-r--r--contrib/top/top.c63
-rw-r--r--crypto/openssl/ssl/s3_pkt.c2
-rw-r--r--etc/Makefile2
-rw-r--r--etc/defaults/rc.conf6
-rw-r--r--etc/mtree/BSD.tests.dist2
-rw-r--r--etc/mtree/Makefile2
-rw-r--r--etc/periodic/daily/Makefile2
-rw-r--r--etc/periodic/monthly/Makefile2
-rw-r--r--etc/periodic/security/Makefile2
-rw-r--r--etc/periodic/weekly/Makefile2
-rw-r--r--etc/rc.d/Makefile2
-rw-r--r--games/Makefile2
-rw-r--r--games/factor/Makefile2
-rw-r--r--gnu/Makefile2
-rw-r--r--gnu/lib/Makefile2
-rw-r--r--gnu/lib/csu/Makefile2
-rw-r--r--gnu/lib/libgcc/Makefile2
-rw-r--r--gnu/lib/libgcov/Makefile2
-rw-r--r--gnu/lib/libstdc++/Makefile2
-rw-r--r--gnu/lib/libsupc++/Makefile2
-rw-r--r--gnu/usr.bin/Makefile2
-rw-r--r--gnu/usr.bin/binutils/as/Makefile2
-rw-r--r--gnu/usr.bin/binutils/ld/Makefile2
-rw-r--r--gnu/usr.bin/cc/Makefile2
-rw-r--r--gnu/usr.bin/cc/Makefile.inc1
-rw-r--r--gnu/usr.bin/cc/c++/Makefile2
-rw-r--r--gnu/usr.bin/cc/cc/Makefile2
-rw-r--r--gnu/usr.bin/cc/cc1/Makefile2
-rw-r--r--gnu/usr.bin/cc/cc1plus/Makefile2
-rw-r--r--gnu/usr.bin/cc/cc_tools/Makefile2
-rw-r--r--gnu/usr.bin/cc/cpp/Makefile2
-rw-r--r--gnu/usr.bin/dialog/Makefile2
-rw-r--r--gnu/usr.bin/grep/Makefile2
-rw-r--r--include/Makefile2
-rw-r--r--include/arpa/Makefile2
-rw-r--r--kerberos5/Makefile.inc2
-rw-r--r--lib/Makefile2
-rw-r--r--lib/atf/Makefile2
-rw-r--r--lib/atf/libatf-c++/Makefile1
-rw-r--r--lib/atf/libatf-c/Makefile1
-rw-r--r--lib/clang/Makefile2
-rw-r--r--lib/clang/clang.build.mk2
-rw-r--r--lib/clang/libllvmanalysis/Makefile2
-rw-r--r--lib/clang/libllvmipa/Makefile2
-rw-r--r--lib/clang/libllvmipo/Makefile2
-rw-r--r--lib/clang/libllvmmc/Makefile2
-rw-r--r--lib/clang/libllvmscalaropts/Makefile2
-rw-r--r--lib/clang/libllvmsupport/Makefile2
-rw-r--r--lib/clang/libllvmtransformutils/Makefile2
-rw-r--r--lib/clang/libllvmx86disassembler/Makefile2
-rw-r--r--lib/libarchive/Makefile2
-rw-r--r--lib/libbsnmp/libbsnmp/Makefile2
-rw-r--r--lib/libc/Makefile2
-rw-r--r--lib/libc/arm/gen/fpsetmask_vfp.c2
-rw-r--r--lib/libc/locale/utf8.c7
-rw-r--r--lib/libc/regex/engine.c7
-rw-r--r--lib/libc/regex/regcomp.c1
-rw-r--r--lib/libc/rpc/clnt_vc.c14
-rw-r--r--lib/libc/sys/msync.212
-rw-r--r--lib/libc_nonshared/Makefile2
-rw-r--r--lib/libcapsicum/libcapsicum_dns.c1
-rw-r--r--lib/libcompiler_rt/Makefile2
-rw-r--r--lib/libcrypt/Makefile2
-rw-r--r--lib/libfetch/Makefile2
-rw-r--r--lib/libipsec/Makefile2
-rw-r--r--lib/libkiconv/Makefile2
-rw-r--r--lib/libmagic/Makefile2
-rw-r--r--lib/libmilter/Makefile2
-rw-r--r--lib/libpam/modules/modules.inc2
-rw-r--r--lib/libpam/modules/pam_unix/Makefile1
-rw-r--r--lib/libpcap/Makefile2
-rw-r--r--lib/libproc/Makefile2
-rw-r--r--lib/libproc/_libproc.h2
-rw-r--r--lib/libproc/libproc.h1
-rw-r--r--lib/libproc/proc_bkpt.c29
-rw-r--r--lib/libproc/proc_create.c52
-rw-r--r--lib/libproc/proc_rtld.c3
-rw-r--r--lib/libproc/proc_sym.c25
-rw-r--r--lib/libproc/proc_util.c24
-rw-r--r--lib/libprocstat/Makefile2
-rw-r--r--lib/libradius/Makefile2
-rw-r--r--lib/librpcsvc/Makefile2
-rw-r--r--lib/librtld_db/librtld_db.36
-rw-r--r--lib/librtld_db/rtld_db.c46
-rw-r--r--lib/librtld_db/rtld_db.h4
-rw-r--r--lib/libsm/Makefile2
-rw-r--r--lib/libsmb/Makefile2
-rw-r--r--lib/libstand/Makefile2
-rw-r--r--lib/libtelnet/Makefile2
-rw-r--r--lib/libthr/Makefile2
-rw-r--r--lib/libulog/Makefile2
-rw-r--r--lib/libutil/Makefile2
-rw-r--r--lib/libutil/kinfo_getfile.32
-rw-r--r--lib/libvmmapi/vmmapi.c7
-rw-r--r--lib/libvmmapi/vmmapi.h2
-rw-r--r--lib/libwrap/Makefile2
-rw-r--r--lib/ncurses/Makefile2
-rw-r--r--lib/ncurses/ncurses/Makefile2
-rw-r--r--libexec/Makefile2
-rw-r--r--libexec/atf/atf-check/Makefile1
-rw-r--r--libexec/ftpd/Makefile2
-rw-r--r--libexec/rlogind/Makefile2
-rw-r--r--libexec/rtld-elf/Makefile2
-rw-r--r--libexec/rtld-elf/Symbol.map1
-rw-r--r--libexec/rtld-elf/rtld.c17
-rw-r--r--libexec/tcpd/Makefile2
-rw-r--r--libexec/telnetd/Makefile2
-rw-r--r--release/doc/en_US.ISO8859-1/hardware/article.xml12
-rw-r--r--release/doc/en_US.ISO8859-1/relnotes/article.xml157
-rw-r--r--release/doc/share/misc/dev.archlist.txt1
-rw-r--r--release/doc/share/xml/catalog.xml2
-rw-r--r--release/doc/share/xml/release.xsl45
-rw-r--r--release/doc/share/xml/sponsor.ent25
-rw-r--r--release/doc/share/xml/vendor.ent9
-rw-r--r--release/picobsd/tinyware/login/Makefile2
-rwxr-xr-xrelease/powerpc/make-memstick.sh33
-rwxr-xr-xrelease/scripts/relnotes-search.sh133
-rw-r--r--rescue/librescue/Makefile2
-rw-r--r--rescue/rescue/Makefile6
-rw-r--r--sbin/Makefile2
-rw-r--r--sbin/Makefile.inc2
-rw-r--r--sbin/atm/atmconfig/Makefile2
-rw-r--r--sbin/dhclient/Makefile2
-rw-r--r--sbin/geom/class/Makefile2
-rw-r--r--sbin/ggate/Makefile2
-rw-r--r--sbin/growfs/Makefile2
-rw-r--r--sbin/gvinum/gvinum.84
-rw-r--r--sbin/gvinum/gvinum.c252
-rw-r--r--sbin/gvinum/gvinum.h3
-rw-r--r--sbin/hastctl/Makefile2
-rw-r--r--sbin/hastd/Makefile2
-rw-r--r--sbin/ifconfig/Makefile6
-rw-r--r--sbin/ifconfig/tests/Makefile9
-rwxr-xr-xsbin/ifconfig/tests/fibs_test.sh126
-rw-r--r--sbin/ipfw/Makefile2
-rw-r--r--sbin/mdconfig/Makefile2
-rw-r--r--sbin/newfs_msdos/newfs_msdos.c62
-rw-r--r--sbin/pfctl/Makefile2
-rw-r--r--sbin/ping/Makefile2
-rw-r--r--sbin/route/Makefile2
-rw-r--r--sbin/route/route.c2
-rw-r--r--sbin/setkey/Makefile2
-rw-r--r--secure/Makefile2
-rw-r--r--secure/Makefile.inc2
-rw-r--r--secure/lib/Makefile2
-rw-r--r--secure/lib/libssh/Makefile2
-rw-r--r--secure/libexec/Makefile2
-rw-r--r--secure/libexec/sftp-server/Makefile2
-rw-r--r--secure/libexec/ssh-keysign/Makefile2
-rw-r--r--secure/libexec/ssh-pkcs11-helper/Makefile2
-rw-r--r--secure/usr.bin/Makefile2
-rw-r--r--secure/usr.bin/scp/Makefile2
-rw-r--r--secure/usr.bin/sftp/Makefile2
-rw-r--r--secure/usr.bin/ssh-add/Makefile2
-rw-r--r--secure/usr.bin/ssh-agent/Makefile2
-rw-r--r--secure/usr.bin/ssh-keygen/Makefile2
-rw-r--r--secure/usr.bin/ssh-keyscan/Makefile2
-rw-r--r--secure/usr.bin/ssh/Makefile2
-rw-r--r--secure/usr.sbin/Makefile2
-rw-r--r--secure/usr.sbin/sshd/Makefile2
-rw-r--r--share/Makefile2
-rw-r--r--share/doc/Makefile2
-rw-r--r--share/doc/smm/Makefile2
-rw-r--r--share/dtrace/Makefile2
-rw-r--r--share/examples/Makefile2
-rw-r--r--share/man/Makefile2
-rw-r--r--share/man/man1/Makefile2
-rw-r--r--share/man/man3/Makefile2
-rw-r--r--share/man/man4/Makefile9
-rw-r--r--share/man/man4/bce.434
-rw-r--r--share/man/man4/bxe.439
-rw-r--r--share/man/man4/full.4 (renamed from share/man/man4/lindev.4)56
-rw-r--r--share/man/man4/mpr.4229
-rw-r--r--share/man/man4/mrsas.4403
-rw-r--r--share/man/man4/null.41
-rw-r--r--share/man/man4/proto.4134
-rw-r--r--share/man/man4/rsu.423
-rw-r--r--share/man/man4/tnt4882.42
-rw-r--r--share/man/man4/urtwn.49
-rw-r--r--share/man/man4/vtnet.42
-rw-r--r--share/man/man4/zero.41
-rw-r--r--share/man/man5/Makefile2
-rw-r--r--share/man/man5/make.conf.54
-rw-r--r--share/man/man9/Makefile2
-rw-r--r--share/man/man9/mbuf.918
-rw-r--r--share/man/man9/pget.9107
-rw-r--r--share/mk/Makefile5
-rw-r--r--share/mk/bsd.compiler.mk5
-rw-r--r--share/mk/bsd.mkopt.mk34
-rw-r--r--share/mk/bsd.opts.mk342
-rw-r--r--share/mk/bsd.own.mk5
-rw-r--r--share/mk/bsd.prog.mk1
-rw-r--r--share/mk/bsd.sys.mk53
-rw-r--r--share/mk/src.opts.mk376
-rw-r--r--sys/Makefile2
-rw-r--r--sys/amd64/conf/GENERIC1
-rw-r--r--sys/amd64/conf/GENERIC.hints2
-rw-r--r--sys/amd64/conf/NOTES3
-rw-r--r--sys/amd64/include/vmm.h16
-rw-r--r--sys/amd64/include/vmm_dev.h6
-rw-r--r--sys/amd64/vmm/intel/vmx.c16
-rw-r--r--sys/amd64/vmm/vmm.c173
-rw-r--r--sys/amd64/vmm/vmm_dev.c4
-rw-r--r--sys/arm/arm/locore.S67
-rw-r--r--sys/arm/arm/pl310.c133
-rw-r--r--sys/arm/conf/ARNDALE2
-rw-r--r--sys/arm/conf/BWCT2
-rw-r--r--sys/arm/conf/COLIBRI-VF504
-rw-r--r--sys/arm/conf/COSMIC4
-rw-r--r--sys/arm/conf/EB92002
-rw-r--r--sys/arm/conf/ETHERNUT52
-rw-r--r--sys/arm/conf/HL2002
-rw-r--r--sys/arm/conf/HL2012
-rw-r--r--sys/arm/conf/KB920X2
-rw-r--r--sys/arm/conf/NSLU2
-rw-r--r--sys/arm/conf/QILA9G202
-rw-r--r--sys/arm/conf/QUARTZ4
-rw-r--r--sys/arm/conf/SAM9260EK2
-rw-r--r--sys/arm/conf/SAM9X25EK3
-rw-r--r--sys/arm/conf/SN9G452
-rw-r--r--sys/arm/conf/VYBRID (renamed from sys/arm/conf/VYBRID.common)3
-rw-r--r--sys/arm/conf/WANDBOARD-DUAL2
-rw-r--r--sys/arm/conf/WANDBOARD-QUAD2
-rw-r--r--sys/arm/conf/WANDBOARD-SOLO2
-rw-r--r--sys/arm/conf/WANDBOARD.common159
-rw-r--r--sys/arm/conf/ZEDBOARD1
-rw-r--r--sys/arm/freescale/imx/imx6_pl310.c13
-rw-r--r--sys/arm/include/cpufunc.h2
-rw-r--r--sys/arm/include/pl310.h15
-rw-r--r--sys/arm/mv/armadaxp/files.armadaxp2
-rw-r--r--sys/arm/mv/armadaxp/mptramp.S (renamed from sys/dev/lindev/lindev.h)36
-rw-r--r--sys/arm/rockchip/rk30xx_machdep.c22
-rw-r--r--sys/arm/xilinx/files.zynq71
-rw-r--r--sys/arm/xilinx/std.zynq72
-rw-r--r--sys/arm/xilinx/zy7_devcfg.c43
-rw-r--r--sys/arm/xilinx/zy7_machdep.c37
-rw-r--r--sys/arm/xilinx/zy7_mp.c99
-rw-r--r--sys/arm/xilinx/zy7_reg.h6
-rw-r--r--sys/boot/Makefile2
-rw-r--r--sys/boot/amd64/Makefile.inc3
-rw-r--r--sys/boot/amd64/efi/Makefile2
-rw-r--r--sys/boot/arm/at91/bootspi/Makefile2
-rw-r--r--sys/boot/arm/at91/libat91/Makefile1
-rw-r--r--sys/boot/arm/ixp425/boot2/Makefile2
-rw-r--r--sys/boot/arm/uboot/Makefile2
-rw-r--r--sys/boot/fdt/dts/arm/exynos5250.dtsi8
-rw-r--r--sys/boot/fdt/dts/arm/rk3188.dtsi2
-rw-r--r--sys/boot/fdt/dts/arm/zedboard.dts2
-rw-r--r--sys/boot/forth/loader.conf1
-rw-r--r--sys/boot/i386/Makefile2
-rw-r--r--sys/boot/i386/boot2/Makefile3
-rw-r--r--sys/boot/i386/loader/Makefile2
-rw-r--r--sys/boot/ia64/common/Makefile2
-rw-r--r--sys/boot/ia64/efi/Makefile2
-rw-r--r--sys/boot/ia64/ski/Makefile2
-rw-r--r--sys/boot/libstand32/Makefile2
-rw-r--r--sys/boot/mips/beri/loader/Makefile2
-rw-r--r--sys/boot/pc98/loader/Makefile2
-rw-r--r--sys/boot/powerpc/ofw/Makefile2
-rw-r--r--sys/boot/powerpc/ps3/Makefile2
-rw-r--r--sys/boot/powerpc/uboot/Makefile2
-rw-r--r--sys/boot/sparc64/loader/Makefile2
-rw-r--r--sys/boot/uboot/lib/Makefile2
-rw-r--r--sys/boot/userboot/userboot/Makefile2
-rw-r--r--sys/boot/userboot/userboot/conf.c2
-rw-r--r--sys/boot/userboot/userboot/userboot_cons.c44
-rw-r--r--sys/cam/ctl/ctl_io.h55
-rw-r--r--sys/cam/scsi/scsi_da.c71
-rw-r--r--sys/cddl/compat/opensolaris/sys/dkio.h2
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c3
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h8
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h4
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c14
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c42
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c61
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c150
-rw-r--r--sys/conf/NOTES1
-rw-r--r--sys/conf/files32
-rw-r--r--sys/conf/files.amd642
-rw-r--r--sys/conf/files.i3862
-rw-r--r--sys/conf/files.pc982
-rw-r--r--sys/conf/kern.pre.mk2
-rw-r--r--sys/conf/kmod.mk1
-rw-r--r--sys/conf/options1
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c2
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c6
-rw-r--r--sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c13
-rw-r--r--sys/dev/ath/ath_hal/ah_devid.h1
-rw-r--r--sys/dev/ath/ath_hal/ar5210/ar5210_power.c9
-rw-r--r--sys/dev/ath/ath_hal/ar5211/ar5211_power.c9
-rw-r--r--sys/dev/ath/ath_hal/ar5212/ar5212_power.c9
-rw-r--r--sys/dev/ath/ath_hal/ar5416/ar5416_power.c12
-rw-r--r--sys/dev/ath/if_ath.c588
-rw-r--r--sys/dev/ath/if_ath_beacon.c87
-rw-r--r--sys/dev/ath/if_ath_beacon.h2
-rw-r--r--sys/dev/ath/if_ath_debug.h1
-rw-r--r--sys/dev/ath/if_ath_keycache.c16
-rw-r--r--sys/dev/ath/if_ath_led.c9
-rw-r--r--sys/dev/ath/if_ath_misc.h13
-rw-r--r--sys/dev/ath/if_ath_rx.c245
-rw-r--r--sys/dev/ath/if_ath_rx_edma.c65
-rw-r--r--sys/dev/ath/if_ath_sysctl.c25
-rw-r--r--sys/dev/ath/if_ath_tdma.c15
-rw-r--r--sys/dev/ath/if_ath_tx.c82
-rw-r--r--sys/dev/ath/if_ath_tx_edma.c14
-rw-r--r--sys/dev/ath/if_athvar.h24
-rw-r--r--sys/dev/bce/if_bce.c20
-rw-r--r--sys/dev/bce/if_bcefw.h8
-rw-r--r--sys/dev/bce/if_bcereg.h6
-rw-r--r--sys/dev/bxe/57710_init_values.c9
-rw-r--r--sys/dev/bxe/57710_int_offsets.h9
-rw-r--r--sys/dev/bxe/57711_init_values.c9
-rw-r--r--sys/dev/bxe/57711_int_offsets.h9
-rw-r--r--sys/dev/bxe/57712_init_values.c9
-rw-r--r--sys/dev/bxe/57712_int_offsets.h9
-rw-r--r--sys/dev/bxe/bxe.c47
-rw-r--r--sys/dev/bxe/bxe.h9
-rw-r--r--sys/dev/bxe/bxe_dcb.h9
-rw-r--r--sys/dev/bxe/bxe_debug.c9
-rw-r--r--sys/dev/bxe/bxe_elink.c9
-rw-r--r--sys/dev/bxe/bxe_elink.h9
-rw-r--r--sys/dev/bxe/bxe_stats.c9
-rw-r--r--sys/dev/bxe/bxe_stats.h9
-rw-r--r--sys/dev/bxe/ecore_fw_defs.h9
-rw-r--r--sys/dev/bxe/ecore_hsi.h9
-rw-r--r--sys/dev/bxe/ecore_init.h9
-rw-r--r--sys/dev/bxe/ecore_init_ops.h9
-rw-r--r--sys/dev/bxe/ecore_mfw_req.h9
-rw-r--r--sys/dev/bxe/ecore_reg.h9
-rw-r--r--sys/dev/bxe/ecore_sp.c9
-rw-r--r--sys/dev/bxe/ecore_sp.h9
-rw-r--r--sys/dev/drm2/i915/i915_gem.c2
-rw-r--r--sys/dev/drm2/radeon/radeon_drv.c8
-rw-r--r--sys/dev/drm2/radeon/radeon_ioc32.c417
-rw-r--r--sys/dev/gpio/gpio_if.m39
-rw-r--r--sys/dev/gpio/gpiobus.c14
-rw-r--r--sys/dev/gpio/gpiobusvar.h10
-rw-r--r--sys/dev/gpio/ofw_gpiobus.c14
-rw-r--r--sys/dev/lindev/full.c103
-rw-r--r--sys/dev/mpr/mpi/mpi2.h1257
-rw-r--r--sys/dev/mpr/mpi/mpi2_cnfg.h3169
-rw-r--r--sys/dev/mpr/mpi/mpi2_hbd.h152
-rw-r--r--sys/dev/mpr/mpi/mpi2_history.txt619
-rw-r--r--sys/dev/mpr/mpi/mpi2_init.h614
-rw-r--r--sys/dev/mpr/mpi/mpi2_ioc.h1856
-rw-r--r--sys/dev/mpr/mpi/mpi2_ra.h118
-rw-r--r--sys/dev/mpr/mpi/mpi2_raid.h406
-rw-r--r--sys/dev/mpr/mpi/mpi2_sas.h346
-rw-r--r--sys/dev/mpr/mpi/mpi2_targ.h600
-rw-r--r--sys/dev/mpr/mpi/mpi2_tool.h546
-rw-r--r--sys/dev/mpr/mpi/mpi2_type.h131
-rw-r--r--sys/dev/mpr/mpr.c2795
-rw-r--r--sys/dev/mpr/mpr_config.c1302
-rw-r--r--sys/dev/mpr/mpr_ioctl.h386
-rw-r--r--sys/dev/mpr/mpr_mapping.c2269
-rw-r--r--sys/dev/mpr/mpr_mapping.h71
-rw-r--r--sys/dev/mpr/mpr_pci.c350
-rw-r--r--sys/dev/mpr/mpr_sas.c3485
-rw-r--r--sys/dev/mpr/mpr_sas.h168
-rw-r--r--sys/dev/mpr/mpr_sas_lsi.c1218
-rw-r--r--sys/dev/mpr/mpr_table.c516
-rw-r--r--sys/dev/mpr/mpr_table.h (renamed from sys/dev/lindev/lindev.c)76
-rw-r--r--sys/dev/mpr/mpr_user.c2453
-rw-r--r--sys/dev/mpr/mprvar.h766
-rw-r--r--sys/dev/mps/mps_sas.c6
-rw-r--r--sys/dev/mrsas/mrsas.c3672
-rw-r--r--sys/dev/mrsas/mrsas.h2464
-rw-r--r--sys/dev/mrsas/mrsas_cam.c1179
-rw-r--r--sys/dev/mrsas/mrsas_fp.c1451
-rw-r--r--sys/dev/mrsas/mrsas_ioctl.c546
-rw-r--r--sys/dev/mrsas/mrsas_ioctl.h97
-rw-r--r--sys/dev/null/null.c26
-rw-r--r--sys/dev/ofw/ofw_bus.h8
-rw-r--r--sys/dev/ofw/ofw_bus_if.m30
-rw-r--r--sys/dev/pci/pci.c192
-rw-r--r--sys/dev/pci/pci_if.m4
-rw-r--r--sys/dev/pci/pcib_if.m4
-rw-r--r--sys/dev/proto/proto.h63
-rw-r--r--sys/dev/proto/proto_bus_pci.c112
-rw-r--r--sys/dev/proto/proto_core.c384
-rw-r--r--sys/dev/proto/proto_dev.h43
-rw-r--r--sys/dev/sdhci/sdhci_fdt.c16
-rw-r--r--sys/dev/usb/controller/dwc_otg.c1143
-rw-r--r--sys/dev/usb/controller/dwc_otg.h30
-rw-r--r--sys/dev/usb/controller/dwc_otgreg.h10
-rw-r--r--sys/dev/usb/net/if_smsc.c48
-rw-r--r--sys/dev/vt/hw/efifb/efifb.c53
-rw-r--r--sys/dev/vt/hw/fb/vt_early_fb.c80
-rw-r--r--sys/dev/vt/hw/fb/vt_fb.c66
-rw-r--r--sys/dev/vt/hw/fb/vt_fb.h2
-rw-r--r--sys/dev/vt/hw/ofwfb/ofwfb.c1
-rw-r--r--sys/dev/vt/hw/vga/vga.c37
-rw-r--r--sys/dev/vt/vt.h12
-rw-r--r--sys/dev/vt/vt_buf.c5
-rw-r--r--sys/dev/vt/vt_consolectl.c2
-rw-r--r--sys/dev/vt/vt_core.c154
-rw-r--r--sys/dev/vt/vt_sysmouse.c2
-rw-r--r--sys/fs/fifofs/fifo_vnops.c4
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c11
-rw-r--r--sys/fs/nfs/nfs_commonsubs.c23
-rw-r--r--sys/fs/nfsserver/nfs_nfsdport.c3
-rw-r--r--sys/geom/geom_disk.c1
-rw-r--r--sys/geom/label/g_label_ufs.c6
-rw-r--r--sys/geom/part/g_part.c10
-rw-r--r--sys/geom/part/g_part_ebr.c49
-rw-r--r--sys/geom/part/g_part_mbr.c54
-rw-r--r--sys/geom/part/g_part_pc98.c54
-rw-r--r--sys/geom/part/g_part_vtoc8.c37
-rw-r--r--sys/geom/raid/g_raid.c8
-rw-r--r--sys/geom/raid/md_ddf.c6
-rw-r--r--sys/geom/raid/md_intel.c7
-rw-r--r--sys/geom/raid/md_jmicron.c6
-rw-r--r--sys/geom/raid/md_nvidia.c6
-rw-r--r--sys/geom/raid/md_promise.c6
-rw-r--r--sys/geom/raid/md_sii.c6
-rw-r--r--sys/geom/uncompress/g_uncompress.c42
-rw-r--r--sys/geom/uzip/g_uzip.c51
-rw-r--r--sys/i386/conf/GENERIC1
-rw-r--r--sys/i386/conf/GENERIC.hints2
-rw-r--r--sys/i386/conf/NOTES3
-rw-r--r--sys/i386/conf/XEN2
-rw-r--r--sys/ia64/conf/GENERIC2
-rw-r--r--sys/kern/kern_cpu.c1
-rw-r--r--sys/kern/kern_descrip.c4
-rw-r--r--sys/kern/kern_mtxpool.c30
-rw-r--r--sys/kern/sched_4bsd.c2
-rw-r--r--sys/kern/subr_bus.c40
-rw-r--r--sys/kern/subr_clock.c3
-rw-r--r--sys/kern/subr_rman.c18
-rw-r--r--sys/kern/subr_witness.c2
-rw-r--r--sys/kern/sys_pipe.c47
-rw-r--r--sys/mips/beri/beri_machdep.c51
-rw-r--r--sys/mips/conf/OCTEON11
-rw-r--r--sys/mips/mips/vm_machdep.c2
-rw-r--r--sys/modules/Makefile8
-rw-r--r--sys/modules/aic7xxx/ahc/Makefile2
-rw-r--r--sys/modules/bce/Makefile5
-rw-r--r--sys/modules/bxe/Makefile5
-rw-r--r--sys/modules/carp/Makefile2
-rw-r--r--sys/modules/cxgb/Makefile2
-rw-r--r--sys/modules/cxgb/cxgb/Makefile2
-rw-r--r--sys/modules/cxgb/iw_cxgb/Makefile2
-rw-r--r--sys/modules/cxgb/tom/Makefile2
-rw-r--r--sys/modules/cxgbe/Makefile2
-rw-r--r--sys/modules/cxgbe/if_cxgbe/Makefile2
-rw-r--r--sys/modules/cxgbe/iw_cxgbe/Makefile2
-rw-r--r--sys/modules/cxgbe/tom/Makefile2
-rw-r--r--sys/modules/dpt/Makefile2
-rw-r--r--sys/modules/drm/Makefile2
-rw-r--r--sys/modules/drm2/Makefile1
-rw-r--r--sys/modules/drm2/radeonkms/Makefile5
-rw-r--r--sys/modules/dummynet/Makefile2
-rw-r--r--sys/modules/em/Makefile2
-rw-r--r--sys/modules/ep/Makefile2
-rw-r--r--sys/modules/if_bridge/Makefile2
-rw-r--r--sys/modules/if_gif/Makefile2
-rw-r--r--sys/modules/if_lagg/Makefile2
-rw-r--r--sys/modules/igb/Makefile2
-rw-r--r--sys/modules/ipdivert/Makefile2
-rw-r--r--sys/modules/ipfilter/Makefile2
-rw-r--r--sys/modules/ipfw/Makefile2
-rw-r--r--sys/modules/ipoib/Makefile2
-rw-r--r--sys/modules/ixgbe/Makefile2
-rw-r--r--sys/modules/lindev/Makefile8
-rw-r--r--sys/modules/mlx4/Makefile2
-rw-r--r--sys/modules/mlx4ib/Makefile2
-rw-r--r--sys/modules/mlxen/Makefile2
-rw-r--r--sys/modules/mpr/Makefile18
-rw-r--r--sys/modules/mrsas/Makefile20
-rw-r--r--sys/modules/mthca/Makefile2
-rw-r--r--sys/modules/netgraph/Makefile2
-rw-r--r--sys/modules/netgraph/ipfw/Makefile2
-rw-r--r--sys/modules/netgraph/netflow/Makefile2
-rw-r--r--sys/modules/pf/Makefile2
-rw-r--r--sys/modules/pflog/Makefile2
-rw-r--r--sys/modules/pfsync/Makefile2
-rw-r--r--sys/modules/proto/Makefile20
-rw-r--r--sys/modules/sound/driver/Makefile2
-rw-r--r--sys/modules/sound/sound/Makefile3
-rw-r--r--sys/modules/usb/Makefile2
-rw-r--r--sys/modules/virtio/network/Makefile2
-rw-r--r--sys/modules/vmware/vmxnet3/Makefile2
-rw-r--r--sys/modules/vx/Makefile2
-rw-r--r--sys/net/ieee8023ad_lacp.c14
-rw-r--r--sys/net/radix.c10
-rw-r--r--sys/net/route.c42
-rw-r--r--sys/net/route.h4
-rw-r--r--sys/net/rtsock.c117
-rw-r--r--sys/netinet/in.c10
-rw-r--r--sys/netinet/in_rmx.c9
-rw-r--r--sys/netinet/ip_output.c16
-rw-r--r--sys/netinet/sctp_pcb.c8
-rw-r--r--sys/netinet/tcp_input.c6
-rw-r--r--sys/netinet/tcp_reass.c240
-rw-r--r--sys/netinet/tcp_subr.c2
-rw-r--r--sys/netinet/tcp_usrreq.c2
-rw-r--r--sys/netinet/tcp_var.h17
-rw-r--r--sys/netinet6/in6_ifattach.c2
-rw-r--r--sys/ofed/drivers/infiniband/hw/mlx4/Makefile2
-rw-r--r--sys/ofed/drivers/net/mlx4/Makefile2
-rw-r--r--sys/pc98/conf/NOTES3
-rw-r--r--sys/rpc/clnt_vc.c12
-rw-r--r--sys/sparc64/conf/GENERIC1
-rw-r--r--sys/sys/kernel.h5
-rw-r--r--sys/sys/mbuf.h1
-rw-r--r--sys/sys/mutex.h4
-rw-r--r--sys/sys/param.h2
-rw-r--r--sys/sys/pipe.h2
-rw-r--r--sys/sys/select.h2
-rw-r--r--sys/sys/user.h2
-rwxr-xr-xsys/tools/fdt/make_dtb.sh15
-rw-r--r--sys/ufs/ffs/ffs_softdep.c26
-rw-r--r--sys/vm/vm_mmap.c2
-rw-r--r--sys/vm/vm_pageout.c8
-rw-r--r--sys/vm/vm_phys.c4
-rwxr-xr-xtests/sys/netinet/fibs_test.sh94
-rw-r--r--tools/bus_space/C/Makefile9
-rw-r--r--tools/bus_space/C/lang.c100
-rw-r--r--tools/bus_space/C/libbus_space.h42
-rw-r--r--tools/bus_space/Makefile7
-rw-r--r--tools/bus_space/Makefile.inc4
-rw-r--r--tools/bus_space/Python/Makefile9
-rw-r--r--tools/bus_space/Python/lang.c200
-rw-r--r--tools/bus_space/bus_space.c263
-rw-r--r--tools/bus_space/bus_space.h38
-rw-r--r--tools/kerneldoc/subsys/Doxyfile-dev_lindev21
-rw-r--r--tools/regression/priv/Makefile2
-rw-r--r--tools/tools/nanobsd/nanobsd.sh24
-rw-r--r--tools/tools/net80211/wlanwatch/Makefile2
-rw-r--r--usr.bin/Makefile6
-rw-r--r--usr.bin/apply/Makefile2
-rw-r--r--usr.bin/ar/Makefile2
-rw-r--r--usr.bin/atf/atf-sh/Makefile1
-rw-r--r--usr.bin/bmake/Makefile.inc10
-rw-r--r--usr.bin/calendar/Makefile2
-rw-r--r--usr.bin/chkey/Makefile2
-rw-r--r--usr.bin/chpass/Makefile2
-rw-r--r--usr.bin/clang/Makefile2
-rw-r--r--usr.bin/clang/clang/Makefile2
-rw-r--r--usr.bin/comm/Makefile2
-rw-r--r--usr.bin/cpio/Makefile2
-rw-r--r--usr.bin/elfdump/elfdump.c43
-rw-r--r--usr.bin/fetch/Makefile2
-rw-r--r--usr.bin/file2c/Makefile2
-rw-r--r--usr.bin/ftp/Makefile2
-rw-r--r--usr.bin/grep/Makefile2
-rw-r--r--usr.bin/gzip/Makefile2
-rw-r--r--usr.bin/id/Makefile2
-rw-r--r--usr.bin/join/Makefile2
-rw-r--r--usr.bin/jot/Makefile2
-rw-r--r--usr.bin/kdump/Makefile2
-rw-r--r--usr.bin/lastcomm/Makefile2
-rw-r--r--usr.bin/lex/lib/Makefile2
-rw-r--r--usr.bin/logger/Makefile2
-rw-r--r--usr.bin/login/Makefile2
-rw-r--r--usr.bin/m4/Makefile2
-rw-r--r--usr.bin/make/Makefile4
-rw-r--r--usr.bin/mkimg/apm.c11
-rw-r--r--usr.bin/mkimg/bsd.c6
-rw-r--r--usr.bin/mkimg/ebr.c6
-rw-r--r--usr.bin/mkimg/gpt.c21
-rw-r--r--usr.bin/mkimg/mbr.c6
-rw-r--r--usr.bin/mkimg/mkimg.c15
-rw-r--r--usr.bin/mkimg/mkimg.h2
-rw-r--r--usr.bin/mkimg/pc98.c6
-rw-r--r--usr.bin/mkimg/vtoc8.c6
-rw-r--r--usr.bin/ncal/Makefile2
-rw-r--r--usr.bin/netstat/Makefile2
-rw-r--r--usr.bin/netstat/inet.c3
-rw-r--r--usr.bin/netstat/mroute.c24
-rw-r--r--usr.bin/newkey/Makefile2
-rw-r--r--usr.bin/nl/nl.116
-rw-r--r--usr.bin/nl/nl.c3
-rw-r--r--usr.bin/passwd/Makefile2
-rw-r--r--usr.bin/printf/Makefile2
-rw-r--r--usr.bin/printf/printf.c137
-rw-r--r--usr.bin/sed/Makefile2
-rw-r--r--usr.bin/sort/Makefile2
-rwxr-xr-xusr.bin/ssh-copy-id/ssh-copy-id.sh2
-rw-r--r--usr.bin/stat/stat.18
-rw-r--r--usr.bin/stat/stat.c41
-rw-r--r--usr.bin/su/Makefile2
-rw-r--r--usr.bin/svn/Makefile.inc2
-rw-r--r--usr.bin/svn/lib/libapr_util/Makefile2
-rw-r--r--usr.bin/systat/Makefile2
-rw-r--r--usr.bin/tar/Makefile2
-rw-r--r--usr.bin/telnet/Makefile2
-rw-r--r--usr.bin/top/Makefile4
-rw-r--r--usr.bin/top/machine.c44
-rw-r--r--usr.bin/tr/Makefile2
-rw-r--r--usr.bin/uudecode/Makefile5
-rw-r--r--usr.bin/uuencode/Makefile2
-rw-r--r--usr.bin/vi/Makefile2
-rw-r--r--usr.bin/xargs/Makefile2
-rw-r--r--usr.bin/yacc/Makefile2
-rw-r--r--usr.sbin/Makefile2
-rw-r--r--usr.sbin/amd/Makefile.inc2
-rw-r--r--usr.sbin/amd/amd/Makefile2
-rw-r--r--usr.sbin/amd/include/Makefile2
-rw-r--r--usr.sbin/bhyve/bhyve.815
-rw-r--r--usr.sbin/bhyve/bhyverun.c128
-rw-r--r--usr.sbin/bhyve/mevent.c19
-rw-r--r--usr.sbin/bhyve/mptbl.c19
-rw-r--r--usr.sbin/bhyve/pci_ahci.c36
-rw-r--r--usr.sbin/bhyve/pci_emul.c7
-rw-r--r--usr.sbin/bhyve/pci_emul.h1
-rw-r--r--usr.sbin/bhyve/uart_emul.c129
-rw-r--r--usr.sbin/bhyve/xmsr.c2
-rw-r--r--usr.sbin/bhyvectl/bhyvectl.c13
-rw-r--r--usr.sbin/bootparamd/bootparamd/Makefile2
-rw-r--r--usr.sbin/bsdinstall/distextract/Makefile2
-rw-r--r--usr.sbin/bsdinstall/distfetch/Makefile2
-rw-r--r--usr.sbin/bsdinstall/partedit/Makefile2
-rw-r--r--usr.sbin/bsnmpd/bsnmpd/Makefile2
-rw-r--r--usr.sbin/bsnmpd/modules/Makefile2
-rw-r--r--usr.sbin/bsnmpd/modules/snmp_hast/Makefile2
-rw-r--r--usr.sbin/bsnmpd/tools/bsnmptools/Makefile2
-rw-r--r--usr.sbin/etcupdate/Makefile2
-rw-r--r--usr.sbin/flowctl/Makefile2
-rw-r--r--usr.sbin/gssd/Makefile2
-rw-r--r--usr.sbin/ifmcstat/Makefile2
-rw-r--r--usr.sbin/inetd/Makefile2
-rw-r--r--usr.sbin/jail/Makefile2
-rw-r--r--usr.sbin/jls/Makefile2
-rw-r--r--usr.sbin/kldxref/ef.c17
-rw-r--r--usr.sbin/lpr/Makefile.inc2
-rw-r--r--usr.sbin/mailwrapper/Makefile2
-rw-r--r--usr.sbin/mtest/Makefile2
-rw-r--r--usr.sbin/newsyslog/Makefile2
-rw-r--r--usr.sbin/ngctl/Makefile2
-rw-r--r--usr.sbin/ntp/Makefile.inc2
-rw-r--r--usr.sbin/ntp/doc/Makefile2
-rw-r--r--usr.sbin/ntp/ntp-keygen/Makefile2
-rw-r--r--usr.sbin/ntp/ntpd/Makefile2
-rw-r--r--usr.sbin/pmcstat/pmcstat.818
-rw-r--r--usr.sbin/pmcstat/pmcstat.c2
-rw-r--r--usr.sbin/ppp/Makefile2
-rw-r--r--usr.sbin/rpcbind/Makefile2
-rw-r--r--usr.sbin/sa/Makefile2
-rw-r--r--usr.sbin/sendmail/Makefile2
-rw-r--r--usr.sbin/syslogd/Makefile2
-rw-r--r--usr.sbin/tcpdchk/Makefile2
-rw-r--r--usr.sbin/tcpdmatch/Makefile2
-rw-r--r--usr.sbin/tcpdump/tcpdump/Makefile2
-rw-r--r--usr.sbin/trpt/Makefile2
-rw-r--r--usr.sbin/tzsetup/Makefile2
-rw-r--r--usr.sbin/wpa/hostapd/Makefile1
-rw-r--r--usr.sbin/wpa/wpa_supplicant/Makefile2
696 files changed, 44633 insertions, 5424 deletions
diff --git a/Makefile b/Makefile
index 924ad9eb9389..b6cad2f953df 100644
--- a/Makefile
+++ b/Makefile
@@ -139,11 +139,7 @@ _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} \
# Choices add to complexity though.
# We cannot blindly use a make which may not be the one we want
# so be exlicit - until all choice is removed.
-.if !defined(WITHOUT_BMAKE)
WANT_MAKE= bmake
-.else
-WANT_MAKE= fmake
-.endif
MYMAKE= ${MAKEOBJDIRPREFIX}${.CURDIR}/make.${MACHINE}/${WANT_MAKE}
.if defined(.PARSEDIR)
HAVE_MAKE= bmake
@@ -152,7 +148,7 @@ HAVE_MAKE= fmake
.endif
.if exists(${MYMAKE})
SUB_MAKE:= ${MYMAKE} -m ${.CURDIR}/share/mk
-.elif ${WANT_MAKE} != ${HAVE_MAKE} || ${WANT_MAKE} != "bmake"
+.elif ${WANT_MAKE} != ${HAVE_MAKE}
# It may not exist yet but we may cause it to.
# In the case of fmake, upgrade_checks may cause a newer version to be built.
SUB_MAKE= `test -x ${MYMAKE} && echo ${MYMAKE} || echo ${MAKE}` \
@@ -238,8 +234,17 @@ tinderbox toolchains kernel-toolchains: .MAKE
${TGTS}:
${_+_}@cd ${.CURDIR}; ${_MAKE} ${.TARGET}
-# Set a reasonable default
-.MAIN: all
+# The historic default "all" target creates files which may cause stale
+# or (in the cross build case) unlinkable results. Fail with an error
+# when no target is given. The users can explicitly specify "all"
+# if they want the historic behavior.
+.MAIN: _guard
+
+_guard:
+ @echo
+ @echo "Explicit target required (use \"all\" for historic behavior)"
+ @echo
+ @false
STARTTIME!= LC_ALL=C date
CHECK_TIME!= find ${.CURDIR}/sys/sys/param.h -mtime -0s ; echo
@@ -342,7 +347,7 @@ make bmake: .PHONY
${MMAKE} obj && \
${MMAKE} depend && \
${MMAKE} all && \
- ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR=
+ ${MMAKE} install DESTDIR=${MYMAKE:H} BINDIR= NO_MAN=t
tinderbox toolchains kernel-toolchains: upgrade_checks
@@ -449,9 +454,15 @@ universe_kernels: universe_kernconfs
.if !defined(TARGET)
TARGET!= uname -m
.endif
+.if defined(MAKE_ALL_KERNELS)
+_THINNER=cat
+.else
+_THINNER=xargs grep -L "^.NO_UNIVERSE"
+.endif
KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \
find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \
- ! -name DEFAULTS ! -name NOTES
+ ! -name DEFAULTS ! -name NOTES | \
+ ${_THINNER}
universe_kernconfs:
.for kernel in ${KERNCONFS}
TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \
diff --git a/Makefile.inc1 b/Makefile.inc1
index c9ad941b0fe6..549aa2fff001 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -45,7 +45,7 @@
.error "Both TARGET and TARGET_ARCH must be defined."
.endif
-.include <bsd.own.mk>
+.include "share/mk/src.opts.mk"
.include <bsd.arch.inc.mk>
.include <bsd.compiler.mk>
@@ -1001,7 +1001,7 @@ buildkernel:
cd ${KRNLCONFDIR}; \
PATH=${TMPPATH} \
config ${CONFIGARGS} -d ${KRNLOBJDIR}/${_kernel} \
- -I ${KERNCONFDIR} ${KERNCONFDIR}/${_kernel}
+ -I '${KERNCONFDIR}' '${KERNCONFDIR}/${_kernel}'
.endif
.if !defined(NO_CLEAN) && !defined(NO_KERNELCLEAN)
@echo
@@ -1480,6 +1480,7 @@ _prebuild_libs= ${_kerberos5_lib_libasn1} \
${_secure_lib_libssh} ${_secure_lib_libssl}
.if ${MK_GNUCXX} != "no" && ${MK_CXX} != "no"
_prebuild_libs+= gnu/lib/libstdc++ gnu/lib/libsupc++
+gnu/lib/libstdc++__L: lib/msun__L
.endif
.if defined(WITH_ATF) || ${MK_TESTS} != "no"
@@ -1807,7 +1808,7 @@ check-old: check-old-files check-old-libs check-old-dirs
# showconfig - show build configuration.
#
showconfig:
- @${MAKE} -n -f bsd.own.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort
+ @${MAKE} -n -f src.opts.mk -V dummy -dg1 2>&1 | grep ^MK_ | sort
.if !empty(KRNLOBJDIR) && !empty(KERNCONF)
DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
@@ -1815,7 +1816,7 @@ DTBOUTPUTPATH= ${KRNLOBJDIR}/${KERNCONF}/
.if !defined(FDT_DTS_FILE) || empty(FDT_DTS_FILE)
.if exists(${KERNCONFDIR}/${KERNCONF})
FDT_DTS_FILE!= awk 'BEGIN {FS="="} /^makeoptions[[:space:]]+FDT_DTS_FILE/ {print $$2}' \
- ${KERNCONFDIR}/${KERNCONF} ; echo
+ '${KERNCONFDIR}/${KERNCONF}' ; echo
.endif
.endif
@@ -1829,24 +1830,9 @@ DTBOUTPUTPATH= ${.CURDIR}
# Build 'standalone' Device Tree Blob
#
builddtb:
- @if [ "${FDT_DTS_FILE}" = "" ]; then \
- echo "ERROR: FDT_DTS_FILE must be specified!"; \
- exit 1; \
- fi; \
- if [ ! -f ${.CURDIR}/sys/boot/fdt/dts/${TARGET}/${FDT_DTS_FILE} ]; then \
- echo "ERROR: Specified DTS file (${FDT_DTS_FILE}) does not \
- exist!"; \
- exit 1; \
- fi; \
- if [ "${DTBOUTPUTPATH}" = "${.CURDIR}" ]; then \
- echo "WARNING: DTB will be placed in the current working \
- directory"; \
- fi
- @PATH=${TMPPATH} \
- MACHINE=${TARGET} \
+ @PATH=${TMPPATH} MACHINE=${TARGET} \
${.CURDIR}/sys/tools/fdt/make_dtb.sh ${.CURDIR}/sys \
- ${FDT_DTS_FILE} \
- ${DTBOUTPUTPATH}/`basename ${FDT_DTS_FILE} .dts`
+ "${FDT_DTS_FILE}" ${DTBOUTPUTPATH}
###############
diff --git a/ObsoleteFiles.inc b/ObsoleteFiles.inc
index 4e49cdf3ef40..2f6f9f3e2bef 100644
--- a/ObsoleteFiles.inc
+++ b/ObsoleteFiles.inc
@@ -38,6 +38,14 @@
# xargs -n1 | sort | uniq -d;
# done
+# 20140505: Bogusly installing src.opts.mk
+OLD_FILES+=usr/share/mk/src.opts.mk
+# 20140505: Reject PR kern/187551
+OLD_DIRS+=usr/tests/sbin/ifconfig
+OLD_FILES+=usr/tests/sbin/ifconfig/Kyuafile
+OLD_FILES+=usr/tests/sbin/ifconfig/fibs_test
+# 20140502: Removal of lindev(4)
+OLD_FILES+=usr/share/man/man4/lindev.4.gz
# 20140314: AppleTalk
OLD_DIRS+=usr/include/netatalk
OLD_FILES+=usr/include/netatalk/aarp.h
@@ -49,7 +57,6 @@ OLD_FILES+=usr/include/netatalk/ddp_pcb.h
OLD_FILES+=usr/include/netatalk/ddp_var.h
OLD_FILES+=usr/include/netatalk/endian.h
OLD_FILES+=usr/include/netatalk/phase2.h
-
# 20140314: Remove IPX/SPX
OLD_LIBS+=lib/libipx.so.5
OLD_FILES+=usr/include/netipx/ipx.h
diff --git a/UPDATING b/UPDATING
index b1e55e3e87a2..c0585c84b5e4 100644
--- a/UPDATING
+++ b/UPDATING
@@ -12,9 +12,9 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running portupgrade.
NOTE: FreeBSD has switched from gcc to clang. If you have trouble bootstrapping
-from older versions of FreeBSD, try WITHOUT_CLANG to bootstrap to the tip of
-head, and then rebuild without this option. The bootstrap process from
-older version of current is a bit fragile.
+from older versions of FreeBSD, try WITHOUT_CLANG and WITH_GCC to bootstrap to
+the tip of head, and then rebuild without this option. The bootstrap process from
+older version of current across the gcc/clang cutover is a bit fragile.
NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
FreeBSD 11.x has many debugging features turned on, in both the kernel
@@ -31,6 +31,33 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
disable the most expensive debugging functionality run
"ln -s 'abort:false,junk:false' /etc/malloc.conf".)
+20140508:
+ We bogusly installed src.opts.mk in /usr/share/mk. This file should
+ be removed to avoid issues in the future (and has been added to
+ ObsoleteFiles.inc).
+
+20140505:
+ /etc/src.conf now affects only builds of the FreeBSD src tree. In the
+ past, it affected all builds that used the bsd.*.mk files. The old
+ behavior was a bug, but people may have relied upon it. To get this
+ behavior back, you can .include /etc/src.conf from /etc/make.conf
+ (which is still global and isn't changed). This also changes the
+ behavior of incremental builds inside the tree of individual
+ directories. Set MAKESYSPATH to ".../share/mk" to do that.
+ Although this has survived make universe and some upgrade scenarios,
+ other upgrade scenarios may have broken. At least one form of
+ temporary breakage was fixed with MAKESYSPATH settings for buildworld
+ as well...
+
+ One side effect of all this cleaning up is that bsd.compiler.mk
+ is no longer implicitly included by bsd.own.mk. If you wish to
+ use COMPILER_TYPE, you must now explicitly include bsd.compiler.mk
+ as well.
+
+20140430:
+ The lindev device has been removed since /dev/full has been made a
+ standard device. __FreeBSD_version has been bumped.
+
20140418:
The YES_HESIOD knob has been removed. It has been obsolete for
a decade. Please move to using WITH_HESIOD instead or your builds
@@ -648,1264 +675,6 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11.x IS SLOW:
The stable/9 branch created in subversion. This corresponds to the
RELENG_9 branch in CVS.
-20110913:
- This commit modifies vfs_register() so that it uses a hash
- calculation to set vfc_typenum, which is enabled by default.
- The first time a system is booted after this change, the
- vfc_typenum values will change for all file systems. The
- main effect of this is a change to the NFS server file handles
- for file systems that use vfc_typenum in their fsid, such as ZFS.
- It will, however, prevent vfc_typenum from changing when file
- systems are loaded in a different order for subsequent reboots.
- To disable this, you can set vfs.typenumhash=0 in /boot/loader.conf
- until you are ready to remount all NFS clients after a reboot.
-
-20110828:
- Bump the shared library version numbers for libraries that
- do not use symbol versioning, have changed the ABI compared
- to stable/8 and which shared library version was not bumped.
- Done as part of 9.0-RELEASE cycle.
-
-20110815:
- During the merge of Capsicum features, the fget(9) KPI was modified.
- This may require the rebuilding of out-of-tree device drivers --
- issues have been reported specifically with the nVidia device driver.
- __FreeBSD_version is bumped to 900041.
-
- Also, there is a period between 20110811 and 20110814 where the
- special devices /dev/{stdin,stdout,stderr} did not work correctly.
- Building world from a kernel during that window may not work.
-
-20110628:
- The packet filter (pf) code has been updated to OpenBSD 4.5.
- You need to update userland tools to be in sync with kernel.
- This update breaks backward compatibility with earlier pfsync(4)
- versions. Care must be taken when updating redundant firewall setups.
-
-20110608:
- The following sysctls and tunables are retired on x86 platforms:
- machdep.hlt_cpus
- machdep.hlt_logical_cpus
- The following sysctl is retired:
- machdep.hyperthreading_allowed
- The sysctls were supposed to provide a way to dynamically offline and
- online selected CPUs on x86 platforms, but the implementation has not
- been reliable especially with SCHED_ULE scheduler.
- machdep.hyperthreading_allowed tunable is still available to ignore
- hyperthreading CPUs at OS level.
- Individual CPUs can be disabled using hint.lapic.X.disabled tunable,
- where X is an APIC ID of a CPU. Be advised, though, that disabling
- CPUs in non-uniform fashion will result in non-uniform topology and
- may lead to sub-optimal system performance with SCHED_ULE, which is
- a default scheduler.
-
-20110607:
- cpumask_t type is retired and cpuset_t is used in order to describe
- a mask of CPUs.
-
-20110531:
- Changes to ifconfig(8) for dynamic address family detection mandate
- that you are running a kernel of 20110525 or later. Make sure to
- follow the update procedure to boot a new kernel before installing
- world.
-
-20110513:
- Support for sun4v architecture is officially dropped
-
-20110503:
- Several KPI breaking changes have been committed to the mii(4) layer,
- the PHY drivers and consequently some Ethernet drivers using mii(4).
- This means that miibus.ko and the modules of the affected Ethernet
- drivers need to be recompiled.
-
- Note to kernel developers: Given that the OUI bit reversion problem
- was fixed as part of these changes all mii(4) commits related to OUIs,
- i.e. to sys/dev/mii/miidevs, PHY driver probing and vendor specific
- handling, no longer can be merged verbatim to stable/8 and previous
- branches.
-
-20110430:
- Users of the Atheros AR71xx SoC code now need to add 'device ar71xx_pci'
- into their kernel configurations along with 'device pci'.
-
-20110427:
- The default NFS client is now the new NFS client, so fstype "newnfs"
- is now "nfs" and the regular/old NFS client is now fstype "oldnfs".
- Although mounts via fstype "nfs" will usually work without userland
- changes, it is recommended that the mount(8) and mount_nfs(8)
- commands be rebuilt from sources and that a link to mount_nfs called
- mount_oldnfs be created. The new client is compiled into the
- kernel with "options NFSCL" and this is needed for diskless root
- file systems. The GENERIC kernel configs have been changed to use
- NFSCL and NFSD (the new server) instead of NFSCLIENT and NFSSERVER.
- To use the regular/old client, you can "mount -t oldnfs ...". For
- a diskless root file system, you must also include a line like:
-
- vfs.root.mountfrom="oldnfs:"
-
- in the boot/loader.conf on the root fs on the NFS server to make
- a diskless root fs use the old client.
-
-20110424:
- The GENERIC kernels for all architectures now default to the new
- CAM-based ATA stack. It means that all legacy ATA drivers were
- removed and replaced by respective CAM drivers. If you are using
- ATA device names in /etc/fstab or other places, make sure to update
- them respectively (adX -> adaY, acdX -> cdY, afdX -> daY, astX -> saY,
- where 'Y's are the sequential numbers starting from zero for each type
- in order of detection, unless configured otherwise with tunables,
- see cam(4)). There will be symbolic links created in /dev/ to map
- old adX devices to the respective adaY. They should provide basic
- compatibility for file systems mounting in most cases, but they do
- not support old user-level APIs and do not have respective providers
- in GEOM. Consider using updated management tools with new device names.
-
- It is possible to load devices ahci, ata, siis and mvs as modules,
- but option ATA_CAM should remain in kernel configuration to make ata
- module work as CAM driver supporting legacy ATA controllers. Device ata
- still can be used in modular fashion (atacore + ...). Modules atadisk
- and atapi* are not used and won't affect operation in ATA_CAM mode.
- Note that to use CAM-based ATA kernel should include CAM devices
- scbus, pass, da (or explicitly ada), cd and optionally others. All of
- them are parts of the cam module.
-
- ataraid(4) functionality is now supported by the RAID GEOM class.
- To use it you can load geom_raid kernel module and use graid(8) tool
- for management. Instead of /dev/arX device names, use /dev/raid/rX.
-
- No kernel config options or code have been removed, so if a problem
- arises, please report it and optionally revert to the old ATA stack.
- In order to do it you can remove from the kernel config:
- options ATA_CAM
- device ahci
- device mvs
- device siis
- , and instead add back:
- device atadisk # ATA disk drives
- device ataraid # ATA RAID drives
- device atapicd # ATAPI CDROM drives
- device atapifd # ATAPI floppy drives
- device atapist # ATAPI tape drives
-
-20110423:
- The default NFS server has been changed to the new server, which
- was referred to as the experimental server. If you need to switch
- back to the old NFS server, you must now put the "-o" option on
- both the mountd and nfsd commands. This can be done using the
- mountd_flags and nfs_server_flags rc.conf variables until an
- update to the rc scripts is committed, which is coming soon.
-
-20110418:
- The GNU Objective-C runtime library (libobjc), and other Objective-C
- related components have been removed from the base system. If you
- require an Objective-C library, please use one of the available ports.
-
-20110331:
- ath(4) has been split into bus- and device- modules. if_ath contains
- the HAL, the TX rate control and the network device code. if_ath_pci
- contains the PCI bus glue. For Atheros MIPS embedded systems, if_ath_ahb
- contains the AHB glue. Users need to load both if_ath_pci and if_ath
- in order to use ath on everything else.
-
- TO REPEAT: if_ath_ahb is not needed for normal users. Normal users only
- need to load if_ath and if_ath_pci for ath(4) operation.
-
-20110314:
- As part of the replacement of sysinstall, the process of building
- release media has changed significantly. For details, please re-read
- release(7), which has been updated to reflect the new build process.
-
-20110218:
- GNU binutils 2.17.50 (as of 2007-07-03) has been merged to -HEAD. This
- is the last available version under GPLv2. It brings a number of new
- features, such as support for newer x86 CPU's (with SSE-3, SSSE-3, SSE
- 4.1 and SSE 4.2), better support for powerpc64, a number of new
- directives, and lots of other small improvements. See the ChangeLog
- file in contrib/binutils for the full details.
-
-20110218:
- IPsec's HMAC_SHA256-512 support has been fixed to be RFC4868
- compliant, and will now use half of hash for authentication.
- This will break interoperability with all stacks (including all
- actual FreeBSD versions) who implement
- draft-ietf-ipsec-ciph-sha-256-00 (they use 96 bits of hash for
- authentication).
- The only workaround with such peers is to use another HMAC
- algorithm for IPsec ("phase 2") authentication.
-
-20110207:
- Remove the uio_yield prototype and symbol. This function has
- been misnamed since it was introduced and should not be
- globally exposed with this name. The equivalent functionality
- is now available using kern_yield(curthread->td_user_pri).
- The function remains undocumented.
-
-20110112:
- A SYSCTL_[ADD_]UQUAD was added for unsigned uint64_t pointers,
- symmetric with the existing SYSCTL_[ADD_]QUAD. Type checking
- for scalar sysctls is defined but disabled. Code that needs
- UQUAD to pass the type checking that must compile on older
- systems where the define is not present can check against
- __FreeBSD_version >= 900030.
-
- The system dialog(1) has been replaced with a new version previously
- in ports as devel/cdialog. dialog(1) is mostly command-line compatible
- with the previous version, but the libdialog associated with it has
- a largely incompatible API. As such, the original version of libdialog
- will be kept temporarily as libodialog, until its base system consumers
- are replaced or updated. Bump __FreeBSD_version to 900030.
-
-20110103:
- If you are trying to run make universe on a -stable system, and you get
- the following warning:
- "Makefile", line 356: "Target architecture for i386/conf/GENERIC
- unknown. config(8) likely too old."
- or something similar to it, then you must upgrade your -stable system
- to 8.2-Release or newer (really, any time after r210146 7/15/2010 in
- stable/8) or build the config from the latest stable/8 branch and
- install it on your system.
-
- Prior to this date, building a current universe on 8-stable system from
- between 7/15/2010 and 1/2/2011 would result in a weird shell parsing
- error in the first kernel build phase. A new config on those old
- systems will fix that problem for older versions of -current.
-
-20101228:
- The TCP stack has been modified to allow Khelp modules to interact with
- it via helper hook points and store per-connection data in the TCP
- control block. Bump __FreeBSD_version to 900029. User space tools that
- rely on the size of struct tcpcb in tcp_var.h (e.g. sockstat) need to
- be recompiled.
-
-20101114:
- Generic IEEE 802.3 annex 31B full duplex flow control support has been
- added to mii(4) and bge(4), bce(4), msk(4), nfe(4) and stge(4) along
- with brgphy(4), e1000phy(4) as well as ip1000phy() have been converted
- to take advantage of it instead of using custom implementations. This
- means that these drivers now no longer unconditionally advertise
- support for flow control but only do so if flow control is a selected
- media option. This was implemented in the generic support that way in
- order to allow flow control to be switched on and off via ifconfig(8)
- with the PHY specific default to typically off in order to protect
- from unwanted effects. Consequently, if you used flow control with
- one of the above mentioned drivers you now need to explicitly enable
- it, for example via:
- ifconfig bge0 media auto mediaopt flowcontrol
-
- Along with the above mentioned changes generic support for setting
- 1000baseT master mode also has been added and brgphy(4), ciphy(4),
- e1000phy(4) as well as ip1000phy(4) have been converted to take
- advantage of it. This means that these drivers now no longer take the
- link0 parameter for selecting master mode but the master media option
- has to be used instead, for example like in the following:
- ifconfig bge0 media 1000baseT mediaopt full-duplex,master
-
- Selection of master mode now is also available with all other PHY
- drivers supporting 1000baseT.
-
-20101111:
- The TCP stack has received a significant update to add support for
- modularised congestion control and generally improve the clarity of
- congestion control decisions. Bump __FreeBSD_version to 900025. User
- space tools that rely on the size of struct tcpcb in tcp_var.h (e.g.
- sockstat) need to be recompiled.
-
-20101002:
- The man(1) utility has been replaced by a new version that no longer
- uses /etc/manpath.config. Please consult man.conf(5) for how to
- migrate local entries to the new format.
-
-20100928:
- The copyright strings printed by login(1) and sshd(8) at the time of a
- new connection have been removed to follow other operating systems and
- upstream sshd.
-
-20100915:
- A workaround for a fixed ld bug has been removed in kernel code,
- so make sure that your system ld is built from sources after
- revision 210245 from 2010-07-19 (r211583 if building head kernel
- on stable/8, r211584 for stable/7; both from 2010-08-21).
- A symptom of incorrect ld version is different addresses for
- set_pcpu section and __start_set_pcpu symbol in kernel and/or modules.
-
-20100913:
- The $ipv6_prefer variable in rc.conf(5) has been split into
- $ip6addrctl_policy and $ipv6_activate_all_interfaces.
-
- The $ip6addrctl_policy is a variable to choose a pre-defined
- address selection policy set by ip6addrctl(8). A value
- "ipv4_prefer", "ipv6_prefer" or "AUTO" can be specified. The
- default is "AUTO".
-
- The $ipv6_activate_all_interfaces specifies whether IFDISABLED
- flag (see an entry of 20090926) is set on an interface with no
- corresponding $ifconfig_IF_ipv6 line. The default is "NO" for
- security reason. If you want IPv6 link-local address on all
- interfaces by default, set this to "YES".
-
- The old ipv6_prefer="YES" is equivalent to
- ipv6_activate_all_interfaces="YES" and
- ip6addrctl_policy="ipv6_prefer".
-
-20100913:
- DTrace has grown support for userland tracing. Due to this, DTrace is
- now i386 and amd64 only.
- dtruss(1) is now installed by default on those systems and a new
- kernel module is needed for userland tracing: fasttrap.
- No changes to your kernel config file are necessary to enable
- userland tracing, but you might consider adding 'STRIP=' and
- 'CFLAGS+=-fno-omit-frame-pointer' to your make.conf if you want
- to have informative userland stack traces in DTrace (ustack).
-
-20100725:
- The acpi_aiboost(4) driver has been removed in favor of the new
- aibs(4) driver. You should update your kernel configuration file.
-
-20100722:
- BSD grep has been imported to the base system and it is built by
- default. It is completely BSD licensed, highly GNU-compatible, uses
- less memory than its GNU counterpart and has a small codebase.
- However, it is slower than its GNU counterpart, which is mostly
- noticeable for larger searches, for smaller ones it is measurable
- but not significant. The reason is complex, the most important factor
- is that we lack a modern and efficient regex library and GNU
- overcomes this by optimizing the searches internally. Future work
- on improving the regex performance is planned, for the meantime,
- users that need better performance, can build GNU grep instead by
- setting the WITH_GNU_GREP knob.
-
-20100713:
- Due to the import of powerpc64 support, all existing powerpc kernel
- configuration files must be updated with a machine directive like this:
- machine powerpc powerpc
-
- In addition, an updated config(8) is required to build powerpc kernels
- after this change.
-
-20100713:
- A new version of ZFS (version 15) has been merged to -HEAD.
- This version uses a python library for the following subcommands:
- zfs allow, zfs unallow, zfs groupspace, zfs userspace.
- For full functionality of these commands the following port must
- be installed: sysutils/py-zfs
-
-20100429:
- 'vm_page's are now hashed by physical address to an array of mutexes.
- Currently this is only used to serialize access to hold_count. Over
- time the page queue mutex will be peeled away. This changes the size
- of pmap on every architecture. And requires all callers of vm_page_hold
- and vm_page_unhold to be updated.
-
-20100402:
- WITH_CTF can now be specified in src.conf (not recommended, there
- are some problems with static executables), make.conf (would also
- affect ports which do not use GNU make and do not override the
- compile targets) or in the kernel config (via "makeoptions
- WITH_CTF=yes").
- When WITH_CTF was specified there before this was silently ignored,
- so make sure that WITH_CTF is not used in places which could lead
- to unwanted behavior.
-
-20100311:
- The kernel option COMPAT_IA32 has been replaced with COMPAT_FREEBSD32
- to allow 32-bit compatibility on non-x86 platforms. All kernel
- configurations on amd64 and ia64 platforms using these options must
- be modified accordingly.
-
-20100113:
- The utmp user accounting database has been replaced with utmpx,
- the user accounting interface standardized by POSIX.
- Unfortunately the semantics of utmp and utmpx don't match,
- making it practically impossible to support both interfaces.
- The user accounting database is used by tools like finger(1),
- last(1), talk(1), w(1) and ac(8).
-
- All applications in the base system use utmpx. This means only
- local binaries (e.g. from the ports tree) may still use these
- utmp database files. These applications must be rebuilt to make
- use of utmpx.
-
- After the system has been upgraded, it is safe to remove the old
- log files (/var/run/utmp, /var/log/lastlog and /var/log/wtmp*),
- assuming their contents is of no importance anymore. Old wtmp
- databases can only be used by last(1) and ac(8) after they have
- been converted to the new format using wtmpcvt(1).
-
-20100108:
- Introduce the kernel thread "deadlock resolver" (which can be enabled
- via the DEADLKRES option, see NOTES for more details) and the
- sleepq_type() function for sleepqueues.
-
-20091202:
- The rc.firewall and rc.firewall6 were unified, and
- rc.firewall6 and rc.d/ip6fw were removed.
- According to the removal of rc.d/ip6fw, ipv6_firewall_* rc
- variables are obsoleted. Instead, the following new rc
- variables are added to rc.d/ipfw:
-
- firewall_client_net_ipv6, firewall_simple_iif_ipv6,
- firewall_simple_inet_ipv6, firewall_simple_oif_ipv6,
- firewall_simple_onet_ipv6, firewall_trusted_ipv6
-
- The meanings correspond to the relevant IPv4 variables.
-
-20091125:
- 8.0-RELEASE.
-
-20091113:
- The default terminal emulation for syscons(4) has been changed
- from cons25 to xterm on all platforms except pc98. This means
- that the /etc/ttys file needs to be updated to ensure correct
- operation of applications on the console.
-
- The terminal emulation style can be toggled per window by using
- vidcontrol(1)'s -T flag. The TEKEN_CONS25 kernel configuration
- options can be used to change the compile-time default back to
- cons25.
-
- To prevent graphical artifacts, make sure the TERM environment
- variable is set to match the terminal emulation that is being
- performed by syscons(4).
-
-20091109:
- The layout of the structure ieee80211req_scan_result has changed.
- Applications that require wireless scan results (e.g. ifconfig(8))
- from net80211 need to be recompiled.
-
- Applications such as wpa_supplicant(8) may require a full world
- build without using NO_CLEAN in order to get synchronized with the
- new structure.
-
-20091025:
- The iwn(4) driver has been updated to support the 5000 and 5150 series.
- There's one kernel module for each firmware. Adding "device iwnfw"
- to the kernel configuration file means including all three firmware
- images inside the kernel. If you want to include just the one for
- your wireless card, use the devices iwn4965fw, iwn5000fw or
- iwn5150fw.
-
-20090926:
- The rc.d/network_ipv6, IPv6 configuration script has been integrated
- into rc.d/netif. The changes are the following:
-
- 1. To use IPv6, simply define $ifconfig_IF_ipv6 like $ifconfig_IF
- for IPv4. For aliases, $ifconfig_IF_aliasN should be used.
- Note that both variables need the "inet6" keyword at the head.
-
- Do not set $ipv6_network_interfaces manually if you do not
- understand what you are doing. It is not needed in most cases.
-
- $ipv6_ifconfig_IF and $ipv6_ifconfig_IF_aliasN still work, but
- they are obsolete.
-
- 2. $ipv6_enable is obsolete. Use $ipv6_prefer and
- "inet6 accept_rtadv" keyword in ifconfig(8) instead.
-
- If you define $ipv6_enable=YES, it means $ipv6_prefer=YES and
- all configured interfaces have "inet6 accept_rtadv" in the
- $ifconfig_IF_ipv6. These are for backward compatibility.
-
- 3. A new variable $ipv6_prefer has been added. If NO, IPv6
- functionality of interfaces with no corresponding
- $ifconfig_IF_ipv6 is disabled by using "inet6 ifdisabled" flag,
- and the default address selection policy of ip6addrctl(8)
- is the IPv4-preferred one (see rc.d/ip6addrctl for more details).
- Note that if you want to configure IPv6 functionality on the
- disabled interfaces after boot, first you need to clear the flag by
- using ifconfig(8) like:
-
- ifconfig em0 inet6 -ifdisabled
-
- If YES, the default address selection policy is set as
- IPv6-preferred.
-
- The default value of $ipv6_prefer is NO.
-
- 4. If your system need to receive Router Advertisement messages,
- define "inet6 accept_rtadv" in $ifconfig_IF_ipv6. The rc(8)
- scripts automatically invoke rtsol(8) when the interface becomes
- UP. The Router Advertisement messages are used for SLAAC
- (State-Less Address AutoConfiguration).
-
-20090922:
- 802.11s D3.03 support was committed. This is incompatible with the
- previous code, which was based on D3.0.
-
-20090912:
- A sysctl variable net.inet6.ip6.accept_rtadv now sets the default value
- of a per-interface flag ND6_IFF_ACCEPT_RTADV, not a global knob to
- control whether accepting Router Advertisement messages or not.
- Also, a per-interface flag ND6_IFF_AUTO_LINKLOCAL has been added and
- a sysctl variable net.inet6.ip6.auto_linklocal is its default value.
- The ifconfig(8) utility now supports these flags.
-
-20090910:
- ZFS snapshots are now mounted with MNT_IGNORE flag. Use -v option for
- mount(8) and -a option for df(1) to see them.
-
-20090825:
- The old tunable hw.bus.devctl_disable has been superseded by
- hw.bus.devctl_queue. hw.bus.devctl_disable=1 in loader.conf should be
- replaced by hw.bus.devctl_queue=0. The default for this new tunable
- is 1000.
-
-20090813:
- Remove the option STOP_NMI. The default action is now to use NMI only
- for KDB via the newly introduced function stop_cpus_hard() and
- maintain stop_cpus() to just use a normal IPI_STOP on ia32 and amd64.
-
-20090803:
- The stable/8 branch created in subversion. This corresponds to the
- RELENG_8 branch in CVS.
-
-20090719:
- Bump the shared library version numbers for all libraries that do not
- use symbol versioning as part of the 8.0-RELEASE cycle. Bump
- __FreeBSD_version to 800105.
-
-20090714:
- Due to changes in the implementation of virtual network stack support,
- all network-related kernel modules must be recompiled. As this change
- breaks the ABI, bump __FreeBSD_version to 800104.
-
-20090713:
- The TOE interface to the TCP syncache has been modified to remove
- struct tcpopt (<netinet/tcp_var.h>) from the ABI of the network stack.
- The cxgb driver is the only TOE consumer affected by this change, and
- needs to be recompiled along with the kernel. As this change breaks
- the ABI, bump __FreeBSD_version to 800103.
-
-20090712:
- Padding has been added to struct tcpcb, sackhint and tcpstat in
- <netinet/tcp_var.h> to facilitate future MFCs and bug fixes whilst
- maintaining the ABI. However, this change breaks the ABI, so bump
- __FreeBSD_version to 800102. User space tools that rely on the size of
- any of these structs (e.g. sockstat) need to be recompiled.
-
-20090630:
- The NFS_LEGACYRPC option has been removed along with the old kernel
- RPC implementation that this option selected. Kernel configurations
- may need to be adjusted.
-
-20090629:
- The network interface device nodes at /dev/net/<interface> have been
- removed. All ioctl operations can be performed the normal way using
- routing sockets. The kqueue functionality can generally be replaced
- with routing sockets.
-
-20090628:
- The documentation from the FreeBSD Documentation Project (Handbook,
- FAQ, etc.) is now installed via packages by sysinstall(8) and under
- the /usr/local/share/doc/freebsd directory instead of /usr/share/doc.
-
-20090624:
- The ABI of various structures related to the SYSV IPC API have been
- changed. As a result, the COMPAT_FREEBSD[456] and COMPAT_43 kernel
- options now all require COMPAT_FREEBSD7. Bump __FreeBSD_version to
- 800100.
-
-20090622:
- Layout of struct vnet has changed as routing related variables were
- moved to their own Vimage module. Modules need to be recompiled. Bump
- __FreeBSD_version to 800099.
-
-20090619:
- NGROUPS_MAX and NGROUPS have been increased from 16 to 1023 and 1024
- respectively. As long as no more than 16 groups per process are used,
- no changes should be visible. When more than 16 groups are used, old
- binaries may fail if they call getgroups() or getgrouplist() with
- statically sized storage. Recompiling will work around this, but
- applications should be modified to use dynamically allocated storage
- for group arrays as POSIX.1-2008 does not cap an implementation's
- number of supported groups at NGROUPS_MAX+1 as previous versions did.
-
- NFS and portalfs mounts may also be affected as the list of groups is
- truncated to 16. Users of NFS who use more than 16 groups, should
- take care that negative group permissions are not used on the exported
- file systems as they will not be reliable unless a GSSAPI based
- authentication method is used.
-
-20090616:
- The compiling option ADAPTIVE_LOCKMGRS has been introduced. This
- option compiles in the support for adaptive spinning for lockmgrs
- which want to enable it. The lockinit() function now accepts the flag
- LK_ADAPTIVE in order to make the lock object subject to adaptive
- spinning when both held in write and read mode.
-
-20090613:
- The layout of the structure returned by IEEE80211_IOC_STA_INFO has
- changed. User applications that use this ioctl need to be rebuilt.
-
-20090611:
- The layout of struct thread has changed. Kernel and modules need to
- be rebuilt.
-
-20090608:
- The layout of structs ifnet, domain, protosw and vnet_net has changed.
- Kernel modules need to be rebuilt. Bump __FreeBSD_version to 800097.
-
-20090602:
- window(1) has been removed from the base system. It can now be
- installed from ports. The port is called misc/window.
-
-20090601:
- The way we are storing and accessing `routing table' entries has
- changed. Programs reading the FIB, like netstat, need to be
- re-compiled.
-
-20090601:
- A new netisr implementation has been added for FreeBSD 8. Network
- file system modules, such as igmp, ipdivert, and others, should be
- rebuilt.
- Bump __FreeBSD_version to 800096.
-
-20090530:
- Remove the tunable/sysctl debug.mpsafevfs as its initial purpose is no
- more valid.
-
-20090530:
- Add VOP_ACCESSX(9). File system modules need to be rebuilt.
- Bump __FreeBSD_version to 800094.
-
-20090529:
- Add mnt_xflag field to 'struct mount'. File system modules need to be
- rebuilt.
- Bump __FreeBSD_version to 800093.
-
-20090528:
- The compiling option ADAPTIVE_SX has been retired while it has been
- introduced the option NO_ADAPTIVE_SX which handles the reversed logic.
- The KPI for sx_init_flags() changes as accepting flags:
- SX_ADAPTIVESPIN flag has been retired while the SX_NOADAPTIVE flag has
- been introduced in order to handle the reversed logic.
- Bump __FreeBSD_version to 800092.
-
-20090527:
- Add support for hierarchical jails. Remove global securelevel.
- Bump __FreeBSD_version to 800091.
-
-20090523:
- The layout of struct vnet_net has changed, therefore modules
- need to be rebuilt.
- Bump __FreeBSD_version to 800090.
-
-20090523:
- The newly imported zic(8) produces a new format in the output. Please
- run tzsetup(8) to install the newly created data to /etc/localtime.
-
-20090520:
- The sysctl tree for the usb stack has renamed from hw.usb2.* to
- hw.usb.* and is now consistent again with previous releases.
-
-20090520:
- 802.11 monitor mode support was revised and driver api's were changed.
- Drivers dependent on net80211 now support DLT_IEEE802_11_RADIO instead
- of DLT_IEEE802_11. No user-visible data structures were changed but
- applications that use DLT_IEEE802_11 may require changes.
- Bump __FreeBSD_version to 800088.
-
-20090430:
- The layout of the following structs has changed: sysctl_oid,
- socket, ifnet, inpcbinfo, tcpcb, syncache_head, vnet_inet,
- vnet_inet6 and vnet_ipfw. Most modules need to be rebuild or
- panics may be experienced. World rebuild is required for
- correctly checking networking state from userland.
- Bump __FreeBSD_version to 800085.
-
-20090429:
- MLDv2 and Source-Specific Multicast (SSM) have been merged
- to the IPv6 stack. VIMAGE hooks are in but not yet used.
- The implementation of SSM within FreeBSD's IPv6 stack closely
- follows the IPv4 implementation.
-
- For kernel developers:
-
- * The most important changes are that the ip6_output() and
- ip6_input() paths no longer take the IN6_MULTI_LOCK,
- and this lock has been downgraded to a non-recursive mutex.
-
- * As with the changes to the IPv4 stack to support SSM, filtering
- of inbound multicast traffic must now be performed by transport
- protocols within the IPv6 stack. This does not apply to TCP and
- SCTP, however, it does apply to UDP in IPv6 and raw IPv6.
-
- * The KPIs used by IPv6 multicast are similar to those used by
- the IPv4 stack, with the following differences:
- * im6o_mc_filter() is analogous to imo_multicast_filter().
- * The legacy KAME entry points in6_joingroup and in6_leavegroup()
- are shimmed to in6_mc_join() and in6_mc_leave() respectively.
- * IN6_LOOKUP_MULTI() has been deprecated and removed.
- * IPv6 relies on MLD for the DAD mechanism. KAME's internal KPIs
- for MLDv1 have an additional 'timer' argument which is used to
- jitter the initial membership report for the solicited-node
- multicast membership on-link.
- * This is not strictly needed for MLDv2, which already jitters
- its report transmissions. However, the 'timer' argument is
- preserved in case MLDv1 is active on the interface.
-
- * The KAME linked-list based IPv6 membership implementation has
- been refactored to use a vector similar to that used by the IPv4
- stack.
- Code which maintains a list of its own multicast memberships
- internally, e.g. carp, has been updated to reflect the new
- semantics.
-
- * There is a known Lock Order Reversal (LOR) due to in6_setscope()
- acquiring the IF_AFDATA_LOCK and being called within ip6_output().
- Whilst MLDv2 tries to avoid this otherwise benign LOR, it is an
- implementation constraint which needs to be addressed in HEAD.
-
- For application developers:
-
- * The changes are broadly similar to those made for the IPv4
- stack.
-
- * The use of IPv4 and IPv6 multicast socket options on the same
- socket, using mapped addresses, HAS NOT been tested or supported.
-
- * There are a number of issues with the implementation of various
- IPv6 multicast APIs which need to be resolved in the API surface
- before the implementation is fully compatible with KAME userland
- use, and these are mostly to do with interface index treatment.
-
- * The literature available discusses the use of either the delta / ASM
- API with setsockopt(2)/getsockopt(2), or the full-state / ASM API
- using setsourcefilter(3)/getsourcefilter(3). For more information
- please refer to RFC 3768, 'Socket Interface Extensions for
- Multicast Source Filters'.
-
- * Applications which use the published RFC 3678 APIs should be fine.
-
- For systems administrators:
-
- * The mtest(8) utility has been refactored to support IPv6, in
- addition to IPv4. Interface addresses are no longer accepted
- as arguments, their names must be used instead. The utility
- will map the interface name to its first IPv4 address as
- returned by getifaddrs(3).
-
- * The ifmcstat(8) utility has also been updated to print the MLDv2
- endpoint state and source filter lists via sysctl(3).
-
- * The net.inet6.ip6.mcast.loop sysctl may be tuned to 0 to disable
- loopback of IPv6 multicast datagrams by default; it defaults to 1
- to preserve the existing behaviour. Disabling multicast loopback is
- recommended for optimal system performance.
-
- * The IPv6 MROUTING code has been changed to examine this sysctl
- instead of attempting to perform a group lookup before looping
- back forwarded datagrams.
-
- Bump __FreeBSD_version to 800084.
-
-20090422:
- Implement low-level Bluetooth HCI API.
- Bump __FreeBSD_version to 800083.
-
-20090419:
- The layout of struct malloc_type, used by modules to register new
- memory allocation types, has changed. Most modules will need to
- be rebuilt or panics may be experienced.
- Bump __FreeBSD_version to 800081.
-
-20090415:
- Anticipate overflowing inp_flags - add inp_flags2.
- This changes most offsets in inpcb, so checking v4 connection
- state will require a world rebuild.
- Bump __FreeBSD_version to 800080.
-
-20090415:
- Add an llentry to struct route and struct route_in6. Modules
- embedding a struct route will need to be recompiled.
- Bump __FreeBSD_version to 800079.
-
-20090414:
- The size of rt_metrics_lite and by extension rtentry has changed.
- Networking administration apps will need to be recompiled.
- The route command now supports show as an alias for get, weighting
- of routes, sticky and nostick flags to alter the behavior of stateful
- load balancing.
- Bump __FreeBSD_version to 800078.
-
-20090408:
- Do not use Giant for kbdmux(4) locking. This is wrong and
- apparently causing more problems than it solves. This will
- re-open the issue where interrupt handlers may race with
- kbdmux(4) in polling mode. Typical symptoms include (but
- not limited to) duplicated and/or missing characters when
- low level console functions (such as gets) are used while
- interrupts are enabled (for example geli password prompt,
- mountroot prompt etc.). Disabling kbdmux(4) may help.
-
-20090407:
- The size of structs vnet_net, vnet_inet and vnet_ipfw has changed;
- kernel modules referencing any of the above need to be recompiled.
- Bump __FreeBSD_version to 800075.
-
-20090320:
- GEOM_PART has become the default partition slicer for storage devices,
- replacing GEOM_MBR, GEOM_BSD, GEOM_PC98 and GEOM_GPT slicers. It
- introduces some changes:
-
- MSDOS/EBR: the devices created from MSDOS extended partition entries
- (EBR) can be named differently than with GEOM_MBR and are now symlinks
- to devices with offset-based names. fstabs may need to be modified.
-
- BSD: the "geometry does not match label" warning is harmless in most
- cases but it points to problems in file system misalignment with
- disk geometry. The "c" partition is now implicit, covers the whole
- top-level drive and cannot be (mis)used by users.
-
- General: Kernel dumps are now not allowed to be written to devices
- whose partition types indicate they are meant to be used for file
- systems (or, in case of MSDOS partitions, as something else than
- the "386BSD" type).
-
- Most of these changes date approximately from 200812.
-
-20090319:
- The uscanner(4) driver has been removed from the kernel. This follows
- Linux removing theirs in 2.6 and making libusb the default interface
- (supported by sane).
-
-20090319:
- The multicast forwarding code has been cleaned up. netstat(1)
- only relies on KVM now for printing bandwidth upcall meters.
- The IPv4 and IPv6 modules are split into ip_mroute_mod and
- ip6_mroute_mod respectively. The config(5) options for statically
- compiling this code remain the same, i.e. 'options MROUTING'.
-
-20090315:
- Support for the IFF_NEEDSGIANT network interface flag has been
- removed, which means that non-MPSAFE network device drivers are no
- longer supported. In particular, if_ar, if_sr, and network device
- drivers from the old (legacy) USB stack can no longer be built or
- used.
-
-20090313:
- POSIX.1 Native Language Support (NLS) has been enabled in libc and
- a bunch of new language catalog files have also been added.
- This means that some common libc messages are now localized and
- they depend on the LC_MESSAGES environmental variable.
-
-20090313:
- The k8temp(4) driver has been renamed to amdtemp(4) since
- support for Family 10 and Family 11 CPU families was added.
-
-20090309:
- IGMPv3 and Source-Specific Multicast (SSM) have been merged
- to the IPv4 stack. VIMAGE hooks are in but not yet used.
-
- For kernel developers, the most important changes are that the
- ip_output() and ip_input() paths no longer take the IN_MULTI_LOCK(),
- and this lock has been downgraded to a non-recursive mutex.
-
- Transport protocols (UDP, Raw IP) are now responsible for filtering
- inbound multicast traffic according to group membership and source
- filters. The imo_multicast_filter() KPI exists for this purpose.
- Transports which do not use multicast (SCTP, TCP) already reject
- multicast by default. Forwarding and receive performance may improve
- as a mutex acquisition is no longer needed in the ip_input()
- low-level input path. in_addmulti() and in_delmulti() are shimmed
- to new KPIs which exist to support SSM in-kernel.
-
- For application developers, it is recommended that loopback of
- multicast datagrams be disabled for best performance, as this
- will still cause the lock to be taken for each looped-back
- datagram transmission. The net.inet.ip.mcast.loop sysctl may
- be tuned to 0 to disable loopback by default; it defaults to 1
- to preserve the existing behaviour.
-
- For systems administrators, to obtain best performance with
- multicast reception and multiple groups, it is always recommended
- that a card with a suitably precise hash filter is used. Hash
- collisions will still result in the lock being taken within the
- transport protocol input path to check group membership.
-
- If deploying FreeBSD in an environment with IGMP snooping switches,
- it is recommended that the net.inet.igmp.sendlocal sysctl remain
- enabled; this forces 224.0.0.0/24 group membership to be announced
- via IGMP.
-
- The size of 'struct igmpstat' has changed; netstat needs to be
- recompiled to reflect this.
- Bump __FreeBSD_version to 800070.
-
-20090309:
- libusb20.so.1 is now installed as libusb.so.1 and the ports system
- updated to use it. This requires a buildworld/installworld in order to
- update the library and dependencies (usbconfig, etc). Its advisable to
- rebuild all ports which uses libusb. More specific directions are given
- in the ports collection UPDATING file. Any /etc/libmap.conf entries for
- libusb are no longer required and can be removed.
-
-20090302:
- A workaround is committed to allow the creation of System V shared
- memory segment of size > 2 GB on the 64-bit architectures.
- Due to a limitation of the existing ABI, the shm_segsz member
- of the struct shmid_ds, returned by shmctl(IPC_STAT) call is
- wrong for large segments. Note that limits must be explicitly
- raised to allow such segments to be created.
-
-20090301:
- The layout of struct ifnet has changed, requiring a rebuild of all
- network device driver modules.
-
-20090227:
- The /dev handling for the new USB stack has changed, a
- buildworld/installworld is required for libusb20.
-
-20090223:
- The new USB2 stack has now been permanently moved in and all kernel and
- module names reverted to their previous values (eg, usb, ehci, ohci,
- ums, ...). The old usb stack can be compiled in by prefixing the name
- with the letter 'o', the old usb modules have been removed.
- Updating entry 20090216 for xorg and 20090215 for libmap may still
- apply.
-
-20090217:
- The rc.conf(5) option if_up_delay has been renamed to
- defaultroute_delay to better reflect its purpose. If you have
- customized this setting in /etc/rc.conf you need to update it to
- use the new name.
-
-20090216:
- xorg 7.4 wants to configure its input devices via hald which does not
- yet work with USB2. If the keyboard/mouse does not work in xorg then
- add
- Option "AllowEmptyInput" "off"
- to your ServerLayout section. This will cause X to use the configured
- kbd and mouse sections from your xorg.conf.
-
-20090215:
- The GENERIC kernels for all architectures now default to the new USB2
- stack. No kernel config options or code have been removed so if a
- problem arises please report it and optionally revert to the old USB
- stack. If you are loading USB kernel modules or have a custom kernel
- that includes GENERIC then ensure that usb names are also changed over,
- eg uftdi -> usb2_serial_ftdi.
-
- Older programs linked against the ports libusb 0.1 need to be
- redirected to the new stack's libusb20. /etc/libmap.conf can
- be used for this:
- # Map old usb library to new one for usb2 stack
- libusb-0.1.so.8 libusb20.so.1
-
-20090209:
- All USB ethernet devices now attach as interfaces under the name ueN
- (eg. ue0). This is to provide a predictable name as vendors often
- change usb chipsets in a product without notice.
-
-20090203:
- The ichsmb(4) driver has been changed to require SMBus slave
- addresses be left-justified (xxxxxxx0b) rather than right-justified.
- All of the other SMBus controller drivers require left-justified
- slave addresses, so this change makes all the drivers provide the
- same interface.
-
-20090201:
- INET6 statistics (struct ip6stat) was updated.
- netstat(1) needs to be recompiled.
-
-20090119:
- NTFS has been removed from GENERIC kernel on amd64 to match
- GENERIC on i386. Should not cause any issues since mount_ntfs(8)
- will load ntfs.ko module automatically when NTFS support is
- actually needed, unless ntfs.ko is not installed or security
- level prohibits loading kernel modules. If either is the case,
- "options NTFS" has to be added into kernel config.
-
-20090115:
- TCP Appropriate Byte Counting (RFC 3465) support added to kernel.
- New field in struct tcpcb breaks ABI, so bump __FreeBSD_version to
- 800061. User space tools that rely on the size of struct tcpcb in
- tcp_var.h (e.g. sockstat) need to be recompiled.
-
-20081225:
- ng_tty(4) module updated to match the new TTY subsystem.
- Due to API change, user-level applications must be updated.
- New API support added to mpd5 CVS and expected to be present
- in next mpd5.3 release.
-
-20081219:
- With __FreeBSD_version 800060 the makefs tool is part of
- the base system (it was a port).
-
-20081216:
- The afdata and ifnet locks have been changed from mutexes to
- rwlocks, network modules will need to be re-compiled.
-
-20081214:
- __FreeBSD_version 800059 incorporates the new arp-v2 rewrite.
- RTF_CLONING, RTF_LLINFO and RTF_WASCLONED flags are eliminated.
- The new code reduced struct rtentry{} by 16 bytes on 32-bit
- architecture and 40 bytes on 64-bit architecture. The userland
- applications "arp" and "ndp" have been updated accordingly.
- The output from "netstat -r" shows only routing entries and
- none of the L2 information.
-
-20081130:
- __FreeBSD_version 800057 marks the switchover from the
- binary ath hal to source code. Users must add the line:
-
- options AH_SUPPORT_AR5416
-
- to their kernel config files when specifying:
-
- device ath_hal
-
- The ath_hal module no longer exists; the code is now compiled
- together with the driver in the ath module. It is now
- possible to tailor chip support (i.e. reduce the set of chips
- and thereby the code size); consult ath_hal(4) for details.
-
-20081121:
- __FreeBSD_version 800054 adds memory barriers to
- <machine/atomic.h>, new interfaces to ifnet to facilitate
- multiple hardware transmit queues for cards that support
- them, and a lock-less ring-buffer implementation to
- enable drivers to more efficiently manage queueing of
- packets.
-
-20081117:
- A new version of ZFS (version 13) has been merged to -HEAD.
- This version has zpool attribute "listsnapshots" off by
- default, which means "zfs list" does not show snapshots,
- and is the same as Solaris behavior.
-
-20081028:
- dummynet(4) ABI has changed. ipfw(8) needs to be recompiled.
-
-20081009:
- The uhci, ohci, ehci and slhci USB Host controller drivers have
- been put into separate modules. If you load the usb module
- separately through loader.conf you will need to load the
- appropriate *hci module as well. E.g. for a UHCI-based USB 2.0
- controller add the following to loader.conf:
-
- uhci_load="YES"
- ehci_load="YES"
-
-20081009:
- The ABI used by the PMC toolset has changed. Please keep
- userland (libpmc(3)) and the kernel module (hwpmc(4)) in
- sync.
-
-20081009:
- atapci kernel module now includes only generic PCI ATA
- driver. AHCI driver moved to ataahci kernel module.
- All vendor-specific code moved into separate kernel modules:
- ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek,
- atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron,
- atamarvell, atamicron, atanational, atanetcell, atanvidia,
- atapromise, ataserverworks, atasiliconimage, atasis, atavia
-
-20080820:
- The TTY subsystem of the kernel has been replaced by a new
- implementation, which provides better scalability and an
- improved driver model. Most common drivers have been migrated to
- the new TTY subsystem, while others have not. The following
- drivers have not yet been ported to the new TTY layer:
-
- PCI/ISA:
- cy, digi, rc, rp, sio
-
- USB:
- ubser, ucycom
-
- Line disciplines:
- ng_h4, ng_tty, ppp, sl, snp
-
- Adding these drivers to your kernel configuration file shall
- cause compilation to fail.
-
-20080818:
- ntpd has been upgraded to 4.2.4p5.
-
-20080801:
- OpenSSH has been upgraded to 5.1p1.
-
- For many years, FreeBSD's version of OpenSSH preferred DSA
- over RSA for host and user authentication keys. With this
- upgrade, we've switched to the vendor's default of RSA over
- DSA. This may cause upgraded clients to warn about unknown
- host keys even for previously known hosts. Users should
- follow the usual procedure for verifying host keys before
- accepting the RSA key.
-
- This can be circumvented by setting the "HostKeyAlgorithms"
- option to "ssh-dss,ssh-rsa" in ~/.ssh/config or on the ssh
- command line.
-
- Please note that the sequence of keys offered for
- authentication has been changed as well. You may want to
- specify IdentityFile in a different order to revert this
- behavior.
-
-20080713:
- The sio(4) driver has been removed from the i386 and amd64
- kernel configuration files. This means uart(4) is now the
- default serial port driver on those platforms as well.
-
- To prevent collisions with the sio(4) driver, the uart(4) driver
- uses different names for its device nodes. This means the
- onboard serial port will now most likely be called "ttyu0"
- instead of "ttyd0". You may need to reconfigure applications to
- use the new device names.
-
- When using the serial port as a boot console, be sure to update
- /boot/device.hints and /etc/ttys before booting the new kernel.
- If you forget to do so, you can still manually specify the hints
- at the loader prompt:
-
- set hint.uart.0.at="isa"
- set hint.uart.0.port="0x3F8"
- set hint.uart.0.flags="0x10"
- set hint.uart.0.irq="4"
- boot -s
-
-20080609:
- The gpt(8) utility has been removed. Use gpart(8) to partition
- disks instead.
-
-20080603:
- The version that Linuxulator emulates was changed from 2.4.2
- to 2.6.16. If you experience any problems with Linux binaries
- please try to set sysctl compat.linux.osrelease to 2.4.2 and
- if it fixes the problem contact emulation mailing list.
-
-20080525:
- ISDN4BSD (I4B) was removed from the src tree. You may need to
- update a your kernel configuration and remove relevant entries.
-
-20080509:
- I have checked in code to support multiple routing tables.
- See the man pages setfib(1) and setfib(2).
- This is a hopefully backwards compatible version,
- but to make use of it you need to compile your kernel
- with options ROUTETABLES=2 (or more up to 16).
-
-20080420:
- The 802.11 wireless support was redone to enable multi-bss
- operation on devices that are capable. The underlying device
- is no longer used directly but instead wlanX devices are
- cloned with ifconfig. This requires changes to rc.conf files.
- For example, change:
- ifconfig_ath0="WPA DHCP"
- to
- wlans_ath0=wlan0
- ifconfig_wlan0="WPA DHCP"
- see rc.conf(5) for more details. In addition, mergemaster of
- /etc/rc.d is highly recommended. Simultaneous update of userland
- and kernel wouldn't hurt either.
-
- As part of the multi-bss changes the wlan_scan_ap and wlan_scan_sta
- modules were merged into the base wlan module. All references
- to these modules (e.g. in kernel config files) must be removed.
-
-20080408:
- psm(4) has gained write(2) support in native operation level.
- Arbitrary commands can be written to /dev/psm%d and status can
- be read back from it. Therefore, an application is responsible
- for status validation and error recovery. It is a no-op in
- other operation levels.
-
-20080312:
- Support for KSE threading has been removed from the kernel. To
- run legacy applications linked against KSE libmap.conf may
- be used. The following libmap.conf may be used to ensure
- compatibility with any prior release:
-
- libpthread.so.1 libthr.so.1
- libpthread.so.2 libthr.so.2
- libkse.so.3 libthr.so.3
-
-20080301:
- The layout of struct vmspace has changed. This affects libkvm
- and any executables that link against libkvm and use the
- kvm_getprocs() function. In particular, but not exclusively,
- it affects ps(1), fstat(1), pkill(1), systat(1), top(1) and w(1).
- The effects are minimal, but it's advisable to upgrade world
- nonetheless.
-
-20080229:
- The latest em driver no longer has support in it for the
- 82575 adapter, this is now moved to the igb driver. The
- split was done to make new features that are incompatible
- with older hardware easier to do.
-
-20080220:
- The new geom_lvm(4) geom class has been renamed to geom_linux_lvm(4),
- likewise the kernel option is now GEOM_LINUX_LVM.
-
-20080211:
- The default NFS mount mode has changed from UDP to TCP for
- increased reliability. If you rely on (insecurely) NFS
- mounting across a firewall you may need to update your
- firewall rules.
-
-20080208:
- Belatedly note the addition of m_collapse for compacting
- mbuf chains.
-
-20080126:
- The fts(3) structures have been changed to use adequate
- integer types for their members and so to be able to cope
- with huge file trees. The old fts(3) ABI is preserved
- through symbol versioning in libc, so third-party binaries
- using fts(3) should still work, although they will not take
- advantage of the extended types. At the same time, some
- third-party software might fail to build after this change
- due to unportable assumptions made in its source code about
- fts(3) structure members. Such software should be fixed
- by its vendor or, in the worst case, in the ports tree.
- FreeBSD_version 800015 marks this change for the unlikely
- case that a portable fix is impossible.
-
-20080123:
- To upgrade to -current after this date, you must be running
- FreeBSD not older than 6.0-RELEASE. Upgrading to -current
- from 5.x now requires a stop over at RELENG_6 or RELENG_7 systems.
-
-20071128:
- The ADAPTIVE_GIANT kernel option has been retired because its
- functionality is the default now.
-
-20071118:
- The AT keyboard emulation of sunkbd(4) has been turned on
- by default. In order to make the special symbols of the Sun
- keyboards driven by sunkbd(4) work under X these now have
- to be configured the same way as Sun USB keyboards driven
- by ukbd(4) (which also does AT keyboard emulation), f.e.:
-
- Option "XkbLayout" "us"
- Option "XkbRules" "xorg"
- Option "XkbSymbols" "pc(pc105)+sun_vndr/usb(sun_usb)+us"
-
-20071024:
- It has been decided that it is desirable to provide ABI
- backwards compatibility to the FreeBSD 4/5/6 versions of the
- PCIOCGETCONF, PCIOCREAD and PCIOCWRITE IOCTLs, which was
- broken with the introduction of PCI domain support (see the
- 20070930 entry). Unfortunately, this required the ABI of
- PCIOCGETCONF to be broken again in order to be able to
- provide backwards compatibility to the old version of that
- IOCTL. Thus consumers of PCIOCGETCONF have to be recompiled
- again. As for prominent ports this affects neither pciutils
- nor xorg-server this time, the hal port needs to be rebuilt
- however.
-
-20071020:
- The misnamed kthread_create() and friends have been renamed
- to kproc_create() etc. Many of the callers already
- used kproc_start()..
- I will return kthread_create() and friends in a while
- with implementations that actually create threads, not procs.
- Renaming corresponds with version 800002.
-
-20071010:
- RELENG_7 branched.
-
COMMON ITEMS:
General Notes
diff --git a/bin/Makefile b/bin/Makefile
index 63d96fedbdfe..ae509c41470e 100644
--- a/bin/Makefile
+++ b/bin/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 5/31/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= cat \
chflags \
diff --git a/bin/Makefile.inc b/bin/Makefile.inc
index ec24a486b9de..86141a1387f9 100644
--- a/bin/Makefile.inc
+++ b/bin/Makefile.inc
@@ -1,7 +1,7 @@
# @(#)Makefile.inc 8.1 (Berkeley) 5/31/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
BINDIR?= /bin
WARNS?= 6
diff --git a/bin/csh/Makefile b/bin/csh/Makefile
index 1fa24a1f9d73..c8845f9523c9 100644
--- a/bin/csh/Makefile
+++ b/bin/csh/Makefile
@@ -6,7 +6,7 @@
#
# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile.
-.include <bsd.own.mk>
+.include <src.opts.mk>
TCSHDIR= ${.CURDIR}/../../contrib/tcsh
.PATH: ${TCSHDIR}
diff --git a/bin/date/Makefile b/bin/date/Makefile
index 6da5848e16ab..56ce33afb456 100644
--- a/bin/date/Makefile
+++ b/bin/date/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= date
SRCS= date.c netdate.c vary.c
diff --git a/bin/dd/conv.c b/bin/dd/conv.c
index cd66258c2945..2ffba1eaaa0b 100644
--- a/bin/dd/conv.c
+++ b/bin/dd/conv.c
@@ -74,7 +74,7 @@ def(void)
dd_out(0);
/*
- * Ddout copies the leftover output to the beginning of
+ * dd_out copies the leftover output to the beginning of
* the buffer and resets the output buffer. Reset the
* input buffer to match it.
*/
diff --git a/bin/dd/dd.c b/bin/dd/dd.c
index 7e5bd913a2df..8ae11a7d1636 100644
--- a/bin/dd/dd.c
+++ b/bin/dd/dd.c
@@ -50,8 +50,8 @@ __FBSDID("$FreeBSD$");
#include <sys/conf.h>
#include <sys/disklabel.h>
#include <sys/filio.h>
-#include <sys/time.h>
+#include <assert.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
@@ -61,6 +61,7 @@ __FBSDID("$FreeBSD$");
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include "dd.h"
@@ -76,6 +77,7 @@ STAT st; /* statistics */
void (*cfunc)(void); /* conversion function */
uintmax_t cpy_cnt; /* # of blocks to copy */
static off_t pending = 0; /* pending seek if sparse */
+static off_t last_sp = 0; /* size of last added sparse block */
u_int ddflags = 0; /* conversion options */
size_t cbsz; /* conversion block size */
uintmax_t files_cnt = 1; /* # of files to copy */
@@ -123,7 +125,6 @@ static void
setup(void)
{
u_int cnt;
- struct timeval tv;
if (in.name == NULL) {
in.name = "stdin";
@@ -173,6 +174,8 @@ setup(void)
} else if ((in.db = malloc(MAX(in.dbsz, cbsz) + cbsz)) == NULL ||
(out.db = malloc(out.dbsz + cbsz)) == NULL)
err(1, "output buffer");
+
+ /* dbp is the first free position in each buffer. */
in.dbp = in.db;
out.dbp = out.db;
@@ -240,8 +243,8 @@ setup(void)
ctab = casetab;
}
- (void)gettimeofday(&tv, NULL);
- st.start = tv.tv_sec + tv.tv_usec * 1e-6;
+ if (clock_gettime(CLOCK_MONOTONIC, &st.start))
+ err(1, "clock_gettime");
}
static void
@@ -434,8 +437,15 @@ dd_out(int force)
* we play games with the buffer size, and it's usually a partial write.
*/
outp = out.db;
+
+ /*
+ * If force, first try to write all pending data, else try to write
+ * just one block. Subsequently always write data one full block at
+ * a time at most.
+ */
for (n = force ? out.dbcnt : out.dbsz;; n = out.dbsz) {
- for (cnt = n;; cnt -= nw) {
+ cnt = n;
+ do {
sparse = 0;
if (ddflags & C_SPARSE) {
sparse = 1; /* Is buffer sparse? */
@@ -447,18 +457,24 @@ dd_out(int force)
}
if (sparse && !force) {
pending += cnt;
+ last_sp = cnt;
nw = cnt;
} else {
if (pending != 0) {
- if (force)
- pending--;
+ /* If forced to write, and we have no
+ * data left, we need to write the last
+ * sparse block explicitly.
+ */
+ if (force && cnt == 0) {
+ pending -= last_sp;
+ assert(outp == out.db);
+ memset(outp, 0, cnt);
+ }
if (lseek(out.fd, pending, SEEK_CUR) ==
-1)
err(2, "%s: seek error creating sparse file",
out.name);
- if (force)
- write(out.fd, outp, 1);
- pending = 0;
+ pending = last_sp = 0;
}
if (cnt)
nw = write(out.fd, outp, cnt);
@@ -473,27 +489,29 @@ dd_out(int force)
err(1, "%s", out.name);
nw = 0;
}
+
outp += nw;
st.bytes += nw;
- if ((size_t)nw == n) {
- if (n != out.dbsz)
- ++st.out_part;
- else
- ++st.out_full;
- break;
- }
- ++st.out_part;
- if ((size_t)nw == cnt)
- break;
- if (out.flags & ISTAPE)
- errx(1, "%s: short write on tape device",
- out.name);
- if (out.flags & ISCHR && !warned) {
- warned = 1;
- warnx("%s: short write on character device",
- out.name);
+
+ if ((size_t)nw == n && n == out.dbsz)
+ ++st.out_full;
+ else
+ ++st.out_part;
+
+ if ((size_t) nw != cnt) {
+ if (out.flags & ISTAPE)
+ errx(1, "%s: short write on tape device",
+ out.name);
+ if (out.flags & ISCHR && !warned) {
+ warned = 1;
+ warnx("%s: short write on character device",
+ out.name);
+ }
}
- }
+
+ cnt -= nw;
+ } while (cnt != 0);
+
if ((out.dbcnt -= n) < out.dbsz)
break;
}
diff --git a/bin/dd/dd.h b/bin/dd/dd.h
index dace84526f52..a8b45e594776 100644
--- a/bin/dd/dd.h
+++ b/bin/dd/dd.h
@@ -41,7 +41,7 @@ typedef struct {
/* XXX ssize_t? */
size_t dbcnt; /* current buffer byte count */
size_t dbrcnt; /* last read byte count */
- size_t dbsz; /* buffer size */
+ size_t dbsz; /* block size */
#define ISCHR 0x01 /* character device (warn on short) */
#define ISPIPE 0x02 /* pipe-like (see position.c) */
@@ -64,7 +64,7 @@ typedef struct {
uintmax_t trunc; /* # of truncated records */
uintmax_t swab; /* # of odd-length swab blocks */
uintmax_t bytes; /* # of bytes written */
- double start; /* start time of dd */
+ struct timespec start; /* start time of dd */
} STAT;
/* Flags (in ddflags). */
diff --git a/bin/dd/misc.c b/bin/dd/misc.c
index 61f843bf13a4..eb1227bb5ac6 100644
--- a/bin/dd/misc.c
+++ b/bin/dd/misc.c
@@ -40,14 +40,15 @@ static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
__FBSDID("$FreeBSD$");
#include <sys/types.h>
-#include <sys/time.h>
+#include <err.h>
#include <errno.h>
#include <inttypes.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <time.h>
#include <unistd.h>
#include "dd.h"
@@ -56,16 +57,21 @@ __FBSDID("$FreeBSD$");
void
summary(void)
{
- struct timeval tv;
- double secs;
+ struct timespec end, ts_res;
+ double secs, res;
if (ddflags & C_NOINFO)
return;
- (void)gettimeofday(&tv, NULL);
- secs = tv.tv_sec + tv.tv_usec * 1e-6 - st.start;
- if (secs < 1e-6)
- secs = 1e-6;
+ if (clock_gettime(CLOCK_MONOTONIC, &end))
+ err(1, "clock_gettime");
+ if (clock_getres(CLOCK_MONOTONIC, &ts_res))
+ err(1, "clock_getres");
+ secs = (end.tv_sec - st.start.tv_sec) + \
+ (end.tv_nsec - st.start.tv_nsec) * 1e-9;
+ res = ts_res.tv_sec + ts_res.tv_nsec * 1e-9;
+ if (secs < res)
+ secs = res;
(void)fprintf(stderr,
"%ju+%ju records in\n%ju+%ju records out\n",
st.in_full, st.in_part, st.out_full, st.out_part);
diff --git a/bin/ed/Makefile b/bin/ed/Makefile
index 7c39e54bdf46..fb1c37da3d01 100644
--- a/bin/ed/Makefile
+++ b/bin/ed/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ed
SRCS= buf.c cbc.c glbl.c io.c main.c re.c sub.c undo.c
diff --git a/bin/ls/Makefile b/bin/ls/Makefile
index 4d02a7ec94ac..7149d9146b0c 100644
--- a/bin/ls/Makefile
+++ b/bin/ls/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/2/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ls
SRCS= cmp.c ls.c print.c util.c
diff --git a/bin/mv/Makefile b/bin/mv/Makefile
index ad8cc4f02d44..02a5a4805800 100644
--- a/bin/mv/Makefile
+++ b/bin/mv/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.2 (Berkeley) 4/2/94
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= mv
diff --git a/bin/pax/Makefile b/bin/pax/Makefile
index 95f18bba1c06..c00d52c70811 100644
--- a/bin/pax/Makefile
+++ b/bin/pax/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# To install on versions prior to BSD 4.4 the following may have to be
# defined with CFLAGS +=
diff --git a/bin/pkill/Makefile b/bin/pkill/Makefile
index bb4d865b7ae2..11bfbe329596 100644
--- a/bin/pkill/Makefile
+++ b/bin/pkill/Makefile
@@ -1,7 +1,7 @@
# $NetBSD: Makefile,v 1.1 2002/03/01 11:21:58 ad Exp $
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= pkill
diff --git a/bin/ps/Makefile b/bin/ps/Makefile
index 9be197933ee8..5ba4f2fa705b 100644
--- a/bin/ps/Makefile
+++ b/bin/ps/Makefile
@@ -11,7 +11,7 @@ SRCS= fmt.c keyword.c nlist.c print.c ps.c
# on large systems.
#
CFLAGS+=-DLAZY_PS
-DPADD= ${LIBM} ${LIBKVM}
-LDADD= -lm -lkvm
+DPADD= ${LIBM} ${LIBKVM} ${LIBJAIL}
+LDADD= -lm -lkvm -ljail
.include <bsd.prog.mk>
diff --git a/bin/ps/ps.1 b/bin/ps/ps.1
index 118e9618566b..c4239ea5bccd 100644
--- a/bin/ps/ps.1
+++ b/bin/ps/ps.1
@@ -29,7 +29,7 @@
.\" @(#)ps.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
-.Dd December 27, 2013
+.Dd May 2, 2014
.Dt PS 1
.Os
.Sh NAME
@@ -40,6 +40,7 @@
.Op Fl aCcdefHhjlmrSTuvwXxZ
.Op Fl O Ar fmt | Fl o Ar fmt
.Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ...
+.Op Fl J Ar jid Ns Op , Ns Ar jid Ns Ar ...
.Op Fl M Ar core
.Op Fl N Ar system
.Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ...
@@ -62,7 +63,7 @@ will also display processes that do not have controlling terminals.
.Pp
A different set of processes can be selected for display by using any
combination of the
-.Fl a , G , p , T , t ,
+.Fl a , G , J , p , T , t ,
and
.Fl U
options.
@@ -152,6 +153,20 @@ Print information associated with the following keywords:
.Cm user , pid , ppid , pgid , sid , jobc , state , tt , time ,
and
.Cm command .
+.It Fl J
+Display information about processes which match the specified jail IDs.
+This may be either the
+.Cm jid
+or
+.Cm name
+of the jail.
+Use
+.Fl J
+.Sy 0
+to display only host processes.
+This flag implies
+.Fl x
+by default.
.It Fl L
List the set of keywords available for the
.Fl O
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 7099cc0bff6a..9d14a72c9a60 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -50,6 +50,7 @@ static char sccsid[] = "@(#)ps.c 8.4 (Berkeley) 4/2/94";
__FBSDID("$FreeBSD$");
#include <sys/param.h>
+#include <sys/jail.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/stat.h>
@@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <fcntl.h>
#include <grp.h>
+#include <jail.h>
#include <kvm.h>
#include <limits.h>
#include <locale.h>
@@ -124,6 +126,7 @@ struct listinfo {
const char *lname;
union {
gid_t *gids;
+ int *jids;
pid_t *pids;
dev_t *ttys;
uid_t *uids;
@@ -132,6 +135,7 @@ struct listinfo {
};
static int addelem_gid(struct listinfo *, const char *);
+static int addelem_jid(struct listinfo *, const char *);
static int addelem_pid(struct listinfo *, const char *);
static int addelem_tty(struct listinfo *, const char *);
static int addelem_uid(struct listinfo *, const char *);
@@ -163,12 +167,12 @@ static char vfmt[] = "pid,state,time,sl,re,pagein,vsz,rss,lim,tsiz,"
"%cpu,%mem,command";
static char Zfmt[] = "label";
-#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ"
+#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ"
int
main(int argc, char *argv[])
{
- struct listinfo gidlist, pgrplist, pidlist;
+ struct listinfo gidlist, jidlist, pgrplist, pidlist;
struct listinfo ruidlist, sesslist, ttylist, uidlist;
struct kinfo_proc *kp;
KINFO *kinfo = NULL, *next_KINFO;
@@ -208,6 +212,7 @@ main(int argc, char *argv[])
prtheader = showthreads = wflag = xkeep_implied = 0;
xkeep = -1; /* Neither -x nor -X. */
init_list(&gidlist, addelem_gid, sizeof(gid_t), "group");
+ init_list(&jidlist, addelem_jid, sizeof(int), "jail id");
init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group");
init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id");
init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser");
@@ -275,6 +280,11 @@ main(int argc, char *argv[])
case 'h':
prtheader = ws.ws_row > 5 ? ws.ws_row : 22;
break;
+ case 'J':
+ add_list(&jidlist, optarg);
+ xkeep_implied = 1;
+ nselectors++;
+ break;
case 'j':
parsefmt(jfmt, 0);
_fmt = 1;
@@ -538,6 +548,11 @@ main(int argc, char *argv[])
if (kp->ki_rgid == gidlist.l.gids[elem])
goto keepit;
}
+ if (jidlist.count > 0) {
+ for (elem = 0; elem < jidlist.count; elem++)
+ if (kp->ki_jid == jidlist.l.jids[elem])
+ goto keepit;
+ }
if (pgrplist.count > 0) {
for (elem = 0; elem < pgrplist.count; elem++)
if (kp->ki_pgid ==
@@ -666,6 +681,7 @@ main(int argc, char *argv[])
}
}
free_list(&gidlist);
+ free_list(&jidlist);
free_list(&pidlist);
free_list(&pgrplist);
free_list(&ruidlist);
@@ -727,6 +743,30 @@ addelem_gid(struct listinfo *inf, const char *elem)
}
static int
+addelem_jid(struct listinfo *inf, const char *elem)
+{
+ int tempid;
+
+ if (*elem == '\0') {
+ warnx("Invalid (zero-length) jail id");
+ optfatal = 1;
+ return (0); /* Do not add this value. */
+ }
+
+ tempid = jail_getid(elem);
+ if (tempid < 0) {
+ warnx("Invalid %s: %s", inf->lname, elem);
+ optfatal = 1;
+ return (0);
+ }
+
+ if (inf->count >= inf->maxcount)
+ expand_list(inf);
+ inf->l.jids[(inf->count)++] = tempid;
+ return (1);
+}
+
+static int
addelem_pid(struct listinfo *inf, const char *elem)
{
char *endp;
@@ -1373,7 +1413,7 @@ usage(void)
(void)fprintf(stderr, "%s\n%s\n%s\n%s\n",
"usage: ps " SINGLE_OPTS " [-O fmt | -o fmt] [-G gid[,gid...]]",
- " [-M core] [-N system]",
+ " [-J jid[,jid...]] [-M core] [-N system]",
" [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]]",
" ps [-L]");
exit(1);
diff --git a/bin/sh/Makefile b/bin/sh/Makefile
index e1ce5feb1851..6a982bc2b8b7 100644
--- a/bin/sh/Makefile
+++ b/bin/sh/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.4 (Berkeley) 5/5/95
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= sh
INSTALLFLAGS= -S
diff --git a/bin/sh/tests/builtins/Makefile b/bin/sh/tests/builtins/Makefile
index 945a14d6c518..c0b21dc6072d 100644
--- a/bin/sh/tests/builtins/Makefile
+++ b/bin/sh/tests/builtins/Makefile
@@ -80,6 +80,9 @@ FILES+= for2.0
FILES+= for3.0
FILES+= getopts1.0 getopts1.0.stdout
FILES+= getopts2.0 getopts2.0.stdout
+FILES+= getopts3.0
+FILES+= getopts4.0
+FILES+= getopts5.0
FILES+= hash1.0 hash1.0.stdout
FILES+= hash2.0 hash2.0.stdout
FILES+= hash3.0 hash3.0.stdout
diff --git a/bin/sh/tests/builtins/getopts3.0 b/bin/sh/tests/builtins/getopts3.0
new file mode 100644
index 000000000000..d02469b20469
--- /dev/null
+++ b/bin/sh/tests/builtins/getopts3.0
@@ -0,0 +1,6 @@
+# $FreeBSD$
+
+shift $#
+getopts x opt
+r=$?
+[ "$r" != 0 ] && [ "$OPTIND" = 1 ]
diff --git a/bin/sh/tests/builtins/getopts4.0 b/bin/sh/tests/builtins/getopts4.0
new file mode 100644
index 000000000000..61d5c2b6b15c
--- /dev/null
+++ b/bin/sh/tests/builtins/getopts4.0
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+set -- -x
+opt=not
+getopts x opt
+r1=$? OPTIND1=$OPTIND opt1=$opt
+getopts x opt
+r2=$? OPTIND2=$OPTIND
+[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] &&
+ [ "$OPTIND2" = 2 ]
diff --git a/bin/sh/tests/builtins/getopts5.0 b/bin/sh/tests/builtins/getopts5.0
new file mode 100644
index 000000000000..666ee7652de5
--- /dev/null
+++ b/bin/sh/tests/builtins/getopts5.0
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+set -- -x arg
+opt=not
+getopts x opt
+r1=$? OPTIND1=$OPTIND opt1=$opt
+getopts x opt
+r2=$? OPTIND2=$OPTIND
+[ "$r1" = 0 ] && [ "$OPTIND1" = 2 ] && [ "$opt1" = x ] && [ "$r2" != 0 ] &&
+ [ "$OPTIND2" = 2 ]
diff --git a/bin/test/Makefile b/bin/test/Makefile
index e9a0507f0cac..8e3121b3167f 100644
--- a/bin/test/Makefile
+++ b/bin/test/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= test
LINKS= ${BINDIR}/test ${BINDIR}/[
diff --git a/cddl/Makefile b/cddl/Makefile
index 2a9b6f8089d5..44b778dbfc6b 100644
--- a/cddl/Makefile
+++ b/cddl/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= lib sbin usr.bin usr.sbin
diff --git a/cddl/compat/opensolaris/include/thread_pool.h b/cddl/compat/opensolaris/include/thread_pool.h
index 25ac55dedea7..3bd23a6dd2aa 100644
--- a/cddl/compat/opensolaris/include/thread_pool.h
+++ b/cddl/compat/opensolaris/include/thread_pool.h
@@ -1,39 +1,78 @@
-/*-
- * Copyright (c) 2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>
- * All rights reserved.
+/*
+ * CDDL HEADER START
*
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
*
- * 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.
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
*
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
* $FreeBSD$
*/
-#ifndef _OPENSOLARIS_THREAD_POOL_H_
-#define _OPENSOLARIS_THREAD_POOL_H_
+#ifndef _THREAD_POOL_H_
+#define _THREAD_POOL_H_
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <sys/types.h>
+#include <thread.h>
+#include <pthread.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct tpool tpool_t; /* opaque thread pool descriptor */
+
+#if defined(__STDC__)
+
+extern tpool_t *tpool_create(uint_t min_threads, uint_t max_threads,
+ uint_t linger, pthread_attr_t *attr);
+extern int tpool_dispatch(tpool_t *tpool,
+ void (*func)(void *), void *arg);
+extern void tpool_destroy(tpool_t *tpool);
+extern void tpool_abandon(tpool_t *tpool);
+extern void tpool_wait(tpool_t *tpool);
+extern void tpool_suspend(tpool_t *tpool);
+extern int tpool_suspended(tpool_t *tpool);
+extern void tpool_resume(tpool_t *tpool);
+extern int tpool_member(tpool_t *tpool);
+
+#else /* Non ANSI */
+
+extern tpool_t *tpool_create();
+extern int tpool_dispatch();
+extern void tpool_destroy();
+extern void tpool_abandon();
+extern void tpool_wait();
+extern void tpool_suspend();
+extern int tpool_suspended();
+extern void tpool_resume();
+extern int tpool_member();
-typedef int tpool_t;
+#endif /* __STDC__ */
-#define tpool_create(a, b, c, d) (0)
-#define tpool_dispatch(pool, func, arg) func(arg)
-#define tpool_wait(pool) do { } while (0)
-#define tpool_destroy(pool) do { } while (0)
+#ifdef __cplusplus
+}
+#endif
-#endif /* !_OPENSOLARIS_THREAD_POOL_H_ */
+#endif /* _THREAD_POOL_H_ */
diff --git a/cddl/compat/opensolaris/misc/thread_pool.c b/cddl/compat/opensolaris/misc/thread_pool.c
new file mode 100644
index 000000000000..a6a834fb2bbd
--- /dev/null
+++ b/cddl/compat/opensolaris/misc/thread_pool.c
@@ -0,0 +1,430 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <stdlib.h>
+#include <signal.h>
+#include <errno.h>
+#include "thread_pool_impl.h"
+
+typedef void (*_Voidfp)(void*); /* pointer to extern "C" function */
+
+static void
+delete_pool(tpool_t *tpool)
+{
+ tpool_job_t *job;
+
+ /*
+ * There should be no pending jobs, but just in case...
+ */
+ for (job = tpool->tp_head; job != NULL; job = tpool->tp_head) {
+ tpool->tp_head = job->tpj_next;
+ free(job);
+ }
+ (void) pthread_attr_destroy(&tpool->tp_attr);
+ free(tpool);
+}
+
+/*
+ * Worker thread is terminating.
+ */
+static void
+worker_cleanup(void *arg)
+{
+ tpool_t *tpool = arg;
+
+ if (--tpool->tp_current == 0 &&
+ (tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) {
+ if (tpool->tp_flags & TP_ABANDON) {
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ delete_pool(tpool);
+ return;
+ }
+ if (tpool->tp_flags & TP_DESTROY)
+ (void) pthread_cond_broadcast(&tpool->tp_busycv);
+ }
+ pthread_mutex_unlock(&tpool->tp_mutex);
+}
+
+static void
+notify_waiters(tpool_t *tpool)
+{
+ if (tpool->tp_head == NULL && tpool->tp_active == NULL) {
+ tpool->tp_flags &= ~TP_WAIT;
+ (void) pthread_cond_broadcast(&tpool->tp_waitcv);
+ }
+}
+
+/*
+ * Called by a worker thread on return from a tpool_dispatch()d job.
+ */
+static void
+job_cleanup(void *arg)
+{
+ tpool_t *tpool = arg;
+ pthread_t my_tid = pthread_self();
+ tpool_active_t *activep;
+ tpool_active_t **activepp;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ /* CSTYLED */
+ for (activepp = &tpool->tp_active;; activepp = &activep->tpa_next) {
+ activep = *activepp;
+ if (activep->tpa_tid == my_tid) {
+ *activepp = activep->tpa_next;
+ break;
+ }
+ }
+ if (tpool->tp_flags & TP_WAIT)
+ notify_waiters(tpool);
+}
+
+static void *
+tpool_worker(void *arg)
+{
+ tpool_t *tpool = (tpool_t *)arg;
+ int elapsed;
+ tpool_job_t *job;
+ void (*func)(void *);
+ tpool_active_t active;
+ sigset_t maskset;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ pthread_cleanup_push(worker_cleanup, tpool);
+
+ /*
+ * This is the worker's main loop.
+ * It will only be left if a timeout or an error has occured.
+ */
+ active.tpa_tid = pthread_self();
+ for (;;) {
+ elapsed = 0;
+ tpool->tp_idle++;
+ if (tpool->tp_flags & TP_WAIT)
+ notify_waiters(tpool);
+ while ((tpool->tp_head == NULL ||
+ (tpool->tp_flags & TP_SUSPEND)) &&
+ !(tpool->tp_flags & (TP_DESTROY | TP_ABANDON))) {
+ if (tpool->tp_current <= tpool->tp_minimum ||
+ tpool->tp_linger == 0) {
+ (void) pthread_cond_wait(&tpool->tp_workcv,
+ &tpool->tp_mutex);
+ } else {
+ struct timespec timeout;
+
+ clock_gettime(CLOCK_MONOTONIC, &timeout);
+ timeout.tv_sec += tpool->tp_linger;
+ if (pthread_cond_timedwait(&tpool->tp_workcv,
+ &tpool->tp_mutex, &timeout) != 0) {
+ elapsed = 1;
+ break;
+ }
+ }
+ }
+ tpool->tp_idle--;
+ if (tpool->tp_flags & TP_DESTROY)
+ break;
+ if (tpool->tp_flags & TP_ABANDON) {
+ /* can't abandon a suspended pool */
+ if (tpool->tp_flags & TP_SUSPEND) {
+ tpool->tp_flags &= ~TP_SUSPEND;
+ (void) pthread_cond_broadcast(&tpool->tp_workcv);
+ }
+ if (tpool->tp_head == NULL)
+ break;
+ }
+ if ((job = tpool->tp_head) != NULL &&
+ !(tpool->tp_flags & TP_SUSPEND)) {
+ elapsed = 0;
+ func = job->tpj_func;
+ arg = job->tpj_arg;
+ tpool->tp_head = job->tpj_next;
+ if (job == tpool->tp_tail)
+ tpool->tp_tail = NULL;
+ tpool->tp_njobs--;
+ active.tpa_next = tpool->tp_active;
+ tpool->tp_active = &active;
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ pthread_cleanup_push(job_cleanup, tpool);
+ free(job);
+ /*
+ * Call the specified function.
+ */
+ func(arg);
+ /*
+ * We don't know what this thread has been doing,
+ * so we reset its signal mask and cancellation
+ * state back to the initial values.
+ */
+ sigfillset(&maskset);
+ (void) pthread_sigmask(SIG_SETMASK, &maskset, NULL);
+ (void) pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED,
+ NULL);
+ (void) pthread_setcancelstate(PTHREAD_CANCEL_ENABLE,
+ NULL);
+ pthread_cleanup_pop(1);
+ }
+ if (elapsed && tpool->tp_current > tpool->tp_minimum) {
+ /*
+ * We timed out and there is no work to be done
+ * and the number of workers exceeds the minimum.
+ * Exit now to reduce the size of the pool.
+ */
+ break;
+ }
+ }
+ pthread_cleanup_pop(1);
+ return (arg);
+}
+
+/*
+ * Create a worker thread, with all signals blocked.
+ */
+static int
+create_worker(tpool_t *tpool)
+{
+ sigset_t maskset, oset;
+ pthread_t thread;
+ int error;
+
+ sigfillset(&maskset);
+ (void) pthread_sigmask(SIG_SETMASK, &maskset, &oset);
+ error = pthread_create(&thread, &tpool->tp_attr, tpool_worker, tpool);
+ (void) pthread_sigmask(SIG_SETMASK, &oset, NULL);
+ return (error);
+}
+
+tpool_t *
+tpool_create(uint_t min_threads, uint_t max_threads, uint_t linger,
+ pthread_attr_t *attr)
+{
+ tpool_t *tpool;
+ int error;
+
+ if (min_threads > max_threads || max_threads < 1) {
+ errno = EINVAL;
+ return (NULL);
+ }
+
+ tpool = malloc(sizeof (*tpool));
+ if (tpool == NULL) {
+ errno = ENOMEM;
+ return (NULL);
+ }
+ bzero(tpool, sizeof(*tpool));
+ (void) pthread_mutex_init(&tpool->tp_mutex, NULL);
+ (void) pthread_cond_init(&tpool->tp_busycv, NULL);
+ (void) pthread_cond_init(&tpool->tp_workcv, NULL);
+ (void) pthread_cond_init(&tpool->tp_waitcv, NULL);
+ tpool->tp_minimum = min_threads;
+ tpool->tp_maximum = max_threads;
+ tpool->tp_linger = linger;
+
+ /* make all pool threads be detached daemon threads */
+ (void) pthread_attr_init(&tpool->tp_attr);
+ (void) pthread_attr_setdetachstate(&tpool->tp_attr,
+ PTHREAD_CREATE_DETACHED);
+
+ return (tpool);
+}
+
+/*
+ * Dispatch a work request to the thread pool.
+ * If there are idle workers, awaken one.
+ * Else, if the maximum number of workers has
+ * not been reached, spawn a new worker thread.
+ * Else just return with the job added to the queue.
+ */
+int
+tpool_dispatch(tpool_t *tpool, void (*func)(void *), void *arg)
+{
+ tpool_job_t *job;
+
+ if ((job = malloc(sizeof (*job))) == NULL)
+ return (-1);
+ bzero(job, sizeof(*job));
+ job->tpj_next = NULL;
+ job->tpj_func = func;
+ job->tpj_arg = arg;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+
+ if (tpool->tp_head == NULL)
+ tpool->tp_head = job;
+ else
+ tpool->tp_tail->tpj_next = job;
+ tpool->tp_tail = job;
+ tpool->tp_njobs++;
+
+ if (!(tpool->tp_flags & TP_SUSPEND)) {
+ if (tpool->tp_idle > 0)
+ (void) pthread_cond_signal(&tpool->tp_workcv);
+ else if (tpool->tp_current < tpool->tp_maximum &&
+ create_worker(tpool) == 0)
+ tpool->tp_current++;
+ }
+
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ return (0);
+}
+
+/*
+ * Assumes: by the time tpool_destroy() is called no one will use this
+ * thread pool in any way and no one will try to dispatch entries to it.
+ * Calling tpool_destroy() from a job in the pool will cause deadlock.
+ */
+void
+tpool_destroy(tpool_t *tpool)
+{
+ tpool_active_t *activep;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex);
+
+ /* mark the pool as being destroyed; wakeup idle workers */
+ tpool->tp_flags |= TP_DESTROY;
+ tpool->tp_flags &= ~TP_SUSPEND;
+ (void) pthread_cond_broadcast(&tpool->tp_workcv);
+
+ /* cancel all active workers */
+ for (activep = tpool->tp_active; activep; activep = activep->tpa_next)
+ (void) pthread_cancel(activep->tpa_tid);
+
+ /* wait for all active workers to finish */
+ while (tpool->tp_active != NULL) {
+ tpool->tp_flags |= TP_WAIT;
+ (void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex);
+ }
+
+ /* the last worker to terminate will wake us up */
+ while (tpool->tp_current != 0)
+ (void) pthread_cond_wait(&tpool->tp_busycv, &tpool->tp_mutex);
+
+ pthread_cleanup_pop(1); /* pthread_mutex_unlock(&tpool->tp_mutex); */
+ delete_pool(tpool);
+}
+
+/*
+ * Like tpool_destroy(), but don't cancel workers or wait for them to finish.
+ * The last worker to terminate will delete the pool.
+ */
+void
+tpool_abandon(tpool_t *tpool)
+{
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ if (tpool->tp_current == 0) {
+ /* no workers, just delete the pool */
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ delete_pool(tpool);
+ } else {
+ /* wake up all workers, last one will delete the pool */
+ tpool->tp_flags |= TP_ABANDON;
+ tpool->tp_flags &= ~TP_SUSPEND;
+ (void) pthread_cond_broadcast(&tpool->tp_workcv);
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ }
+}
+
+/*
+ * Wait for all jobs to complete.
+ * Calling tpool_wait() from a job in the pool will cause deadlock.
+ */
+void
+tpool_wait(tpool_t *tpool)
+{
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ pthread_cleanup_push((_Voidfp)pthread_mutex_unlock, &tpool->tp_mutex);
+ while (tpool->tp_head != NULL || tpool->tp_active != NULL) {
+ tpool->tp_flags |= TP_WAIT;
+ (void) pthread_cond_wait(&tpool->tp_waitcv, &tpool->tp_mutex);
+ }
+ pthread_cleanup_pop(1); /* pthread_mutex_unlock(&tpool->tp_mutex); */
+}
+
+void
+tpool_suspend(tpool_t *tpool)
+{
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ tpool->tp_flags |= TP_SUSPEND;
+ pthread_mutex_unlock(&tpool->tp_mutex);
+}
+
+int
+tpool_suspended(tpool_t *tpool)
+{
+ int suspended;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ suspended = (tpool->tp_flags & TP_SUSPEND) != 0;
+ pthread_mutex_unlock(&tpool->tp_mutex);
+
+ return (suspended);
+}
+
+void
+tpool_resume(tpool_t *tpool)
+{
+ int excess;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ if (!(tpool->tp_flags & TP_SUSPEND)) {
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ return;
+ }
+ tpool->tp_flags &= ~TP_SUSPEND;
+ (void) pthread_cond_broadcast(&tpool->tp_workcv);
+ excess = tpool->tp_njobs - tpool->tp_idle;
+ while (excess-- > 0 && tpool->tp_current < tpool->tp_maximum) {
+ if (create_worker(tpool) != 0)
+ break; /* pthread_create() failed */
+ tpool->tp_current++;
+ }
+ pthread_mutex_unlock(&tpool->tp_mutex);
+}
+
+int
+tpool_member(tpool_t *tpool)
+{
+ pthread_t my_tid = pthread_self();
+ tpool_active_t *activep;
+
+ pthread_mutex_lock(&tpool->tp_mutex);
+ for (activep = tpool->tp_active; activep; activep = activep->tpa_next) {
+ if (activep->tpa_tid == my_tid) {
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ return (1);
+ }
+ }
+ pthread_mutex_unlock(&tpool->tp_mutex);
+ return (0);
+}
diff --git a/cddl/compat/opensolaris/misc/thread_pool_impl.h b/cddl/compat/opensolaris/misc/thread_pool_impl.h
new file mode 100644
index 000000000000..bc98ac8b1b37
--- /dev/null
+++ b/cddl/compat/opensolaris/misc/thread_pool_impl.h
@@ -0,0 +1,99 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+/*
+ * $FreeBSD$
+ */
+
+#ifndef _THREAD_POOL_IMPL_H
+#define _THREAD_POOL_IMPL_H
+
+#pragma ident "%Z%%M% %I% %E% SMI"
+
+#include <thread_pool.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * Thread pool implementation definitions.
+ * See <thread_pool.h> for interface declarations.
+ */
+
+/*
+ * FIFO queued job
+ */
+typedef struct tpool_job tpool_job_t;
+struct tpool_job {
+ tpool_job_t *tpj_next; /* list of jobs */
+ void (*tpj_func)(void *); /* function to call */
+ void *tpj_arg; /* its argument */
+};
+
+/*
+ * List of active threads, linked through their stacks.
+ */
+typedef struct tpool_active tpool_active_t;
+struct tpool_active {
+ tpool_active_t *tpa_next; /* list of active threads */
+ pthread_t tpa_tid; /* active thread id */
+};
+
+/*
+ * The thread pool.
+ */
+struct tpool {
+ tpool_t *tp_forw; /* circular list of all thread pools */
+ tpool_t *tp_back;
+ mutex_t tp_mutex; /* protects the pool data */
+ cond_t tp_busycv; /* synchronization in tpool_dispatch */
+ cond_t tp_workcv; /* synchronization with workers */
+ cond_t tp_waitcv; /* synchronization in tpool_wait() */
+ tpool_active_t *tp_active; /* threads performing work */
+ tpool_job_t *tp_head; /* FIFO job queue */
+ tpool_job_t *tp_tail;
+ pthread_attr_t tp_attr; /* attributes of the workers */
+ int tp_flags; /* see below */
+ uint_t tp_linger; /* seconds before idle workers exit */
+ int tp_njobs; /* number of jobs in job queue */
+ int tp_minimum; /* minimum number of worker threads */
+ int tp_maximum; /* maximum number of worker threads */
+ int tp_current; /* current number of worker threads */
+ int tp_idle; /* number of idle workers */
+};
+
+/* tp_flags */
+#define TP_WAIT 0x01 /* waiting in tpool_wait() */
+#define TP_SUSPEND 0x02 /* pool is being suspended */
+#define TP_DESTROY 0x04 /* pool is being destroyed */
+#define TP_ABANDON 0x08 /* pool is abandoned (auto-destroy) */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _THREAD_POOL_IMPL_H */
diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
index 767114ea571b..92251d5f4f4b 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c
@@ -1138,7 +1138,7 @@ alloc:
#if defined(sun)
dtp->dt_prcmode = DT_PROC_STOP_PREINIT;
#else
- dtp->dt_prcmode = DT_PROC_STOP_MAIN;
+ dtp->dt_prcmode = DT_PROC_STOP_POSTINIT;
#endif
dtp->dt_linkmode = DT_LINK_KERNEL;
dtp->dt_linktype = DT_LTYP_ELF;
diff --git a/cddl/lib/Makefile b/cddl/lib/Makefile
index fef13839d9ae..634d70eea5fa 100644
--- a/cddl/lib/Makefile
+++ b/cddl/lib/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_drti} \
libavl \
diff --git a/cddl/lib/libdtrace/libproc_compat.h b/cddl/lib/libdtrace/libproc_compat.h
index a561157c0ba2..d796f34f48aa 100644
--- a/cddl/lib/libdtrace/libproc_compat.h
+++ b/cddl/lib/libdtrace/libproc_compat.h
@@ -54,7 +54,6 @@
#define Psetbkpt proc_bkptset
#define Psetflags proc_setflags
#define Pstate proc_state
-#define Pstate proc_state
#define Psymbol_iter_by_addr proc_iter_symbyaddr
#define Punsetflags proc_clearflags
#define Pupdate_maps(p) do { } while (0)
diff --git a/cddl/lib/libzfs/Makefile b/cddl/lib/libzfs/Makefile
index 5b6b47dcc28c..16660aca3ceb 100644
--- a/cddl/lib/libzfs/Makefile
+++ b/cddl/lib/libzfs/Makefile
@@ -14,6 +14,7 @@ SRCS= deviceid.c \
fsshare.c \
mkdirp.c \
mnttab.c \
+ thread_pool.c \
zmount.c \
zone.c
diff --git a/cddl/sbin/Makefile b/cddl/sbin/Makefile
index 4fd96f6ee0e5..f40f2a45e759 100644
--- a/cddl/sbin/Makefile
+++ b/cddl/sbin/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_tests} ${_zfs} ${_zpool}
diff --git a/cddl/usr.bin/Makefile b/cddl/usr.bin/Makefile
index 3547ff7b6994..533697d1ed00 100644
--- a/cddl/usr.bin/Makefile
+++ b/cddl/usr.bin/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= \
ctfconvert \
diff --git a/cddl/usr.sbin/Makefile b/cddl/usr.sbin/Makefile
index 8551c28a1a0b..537b8e52792f 100644
--- a/cddl/usr.sbin/Makefile
+++ b/cddl/usr.sbin/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_dtrace} \
${_dtruss} \
diff --git a/contrib/gcc/config/i386/i386.c b/contrib/gcc/config/i386/i386.c
index 88f28369297d..26528bfa5a30 100644
--- a/contrib/gcc/config/i386/i386.c
+++ b/contrib/gcc/config/i386/i386.c
@@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int align)
if (AGGREGATE_TYPE_P (type)
&& TYPE_SIZE (type)
&& TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
- && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16
+ && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128
|| TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128)
return 128;
}
diff --git a/contrib/libstdc++/include/bits/stl_multimap.h b/contrib/libstdc++/include/bits/stl_multimap.h
index bb1c1544e716..85feba78c556 100644
--- a/contrib/libstdc++/include/bits/stl_multimap.h
+++ b/contrib/libstdc++/include/bits/stl_multimap.h
@@ -185,7 +185,7 @@ _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD)
template <typename _InputIterator>
multimap(_InputIterator __first, _InputIterator __last)
: _M_t()
- { _M_t._M_insert_unique(__first, __last); }
+ { _M_t._M_insert_equal(__first, __last); }
/**
* @brief Builds a %multimap from a range.
diff --git a/contrib/llvm/tools/clang/include/clang/Driver/Options.td b/contrib/llvm/tools/clang/include/clang/Driver/Options.td
index ccfdf745c5a2..5e7c76d98113 100644
--- a/contrib/llvm/tools/clang/include/clang/Driver/Options.td
+++ b/contrib/llvm/tools/clang/include/clang/Driver/Options.td
@@ -549,8 +549,6 @@ def finstrument_functions : Flag<["-"], "finstrument-functions">, Group<f_Group>
def fkeep_inline_functions : Flag<["-"], "fkeep-inline-functions">, Group<clang_ignored_f_Group>;
def flat__namespace : Flag<["-"], "flat_namespace">;
def flax_vector_conversions : Flag<["-"], "flax-vector-conversions">, Group<f_Group>;
-def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Limit debug information produced to reduce size of debug binary">;
def flimited_precision_EQ : Joined<["-"], "flimited-precision=">, Group<f_Group>;
def flto : Flag<["-"], "flto">, Group<f_Group>;
def fno_lto : Flag<["-"], "fno-lto">, Group<f_Group>;
@@ -645,8 +643,6 @@ def fno_inline : Flag<["-"], "fno-inline">, Group<f_clang_Group>, Flags<[CC1Opti
def fno_keep_inline_functions : Flag<["-"], "fno-keep-inline-functions">, Group<clang_ignored_f_Group>;
def fno_lax_vector_conversions : Flag<["-"], "fno-lax-vector-conversions">, Group<f_Group>,
HelpText<"Disallow implicit conversions between vectors with a different number of elements or different element types">, Flags<[CC1Option]>;
-def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Group<f_Group>, Flags<[CC1Option]>,
- HelpText<"Do not limit debug information produced to reduce size of debug binary">;
def fno_merge_all_constants : Flag<["-"], "fno-merge-all-constants">, Group<f_Group>,
Flags<[CC1Option]>, HelpText<"Disallow merging of constants">;
def fno_modules : Flag <["-"], "fno-modules">, Group<f_Group>,
@@ -774,6 +770,12 @@ def fno_signed_char : Flag<["-"], "fno-signed-char">, Flags<[CC1Option]>,
def fsplit_stack : Flag<["-"], "fsplit-stack">, Group<f_Group>;
def fstack_protector_all : Flag<["-"], "fstack-protector-all">, Group<f_Group>;
def fstack_protector : Flag<["-"], "fstack-protector">, Group<f_Group>;
+def fstandalone_debug : Flag<["-"], "fstandalone-debug">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Emit full debug info for all types used by the program">;
+def fno_standalone_debug : Flag<["-"], "fno-standalone-debug">, Group<f_Group>, Flags<[CC1Option]>,
+ HelpText<"Limit debug information produced to reduce size of debug binary">;
+def flimit_debug_info : Flag<["-"], "flimit-debug-info">, Alias<fno_standalone_debug>;
+def fno_limit_debug_info : Flag<["-"], "fno-limit-debug-info">, Alias<fstandalone_debug>;
def fstrict_aliasing : Flag<["-"], "fstrict-aliasing">, Group<f_Group>;
def fstrict_enums : Flag<["-"], "fstrict-enums">, Group<f_Group>, Flags<[CC1Option]>,
HelpText<"Enable optimizations based on the strict definition of an enum's "
diff --git a/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h b/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h
index 86aabf7b95ec..0d2469791ce0 100644
--- a/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h
+++ b/contrib/llvm/tools/clang/include/clang/Frontend/CodeGenOptions.h
@@ -50,12 +50,20 @@ public:
};
enum DebugInfoKind {
- NoDebugInfo, // Don't generate debug info.
- DebugLineTablesOnly, // Emit only debug info necessary for generating
- // line number tables (-gline-tables-only).
- LimitedDebugInfo, // Limit generated debug info to reduce size
- // (-flimit-debug-info).
- FullDebugInfo // Generate complete debug info.
+ NoDebugInfo, /// Don't generate debug info.
+
+ DebugLineTablesOnly, /// Emit only debug info necessary for generating
+ /// line number tables (-gline-tables-only).
+
+ LimitedDebugInfo, /// Limit generated debug info to reduce size
+ /// (-fno-standalone-debug). This emits
+ /// forward decls for types that could be
+ /// replaced with forward decls in the source
+ /// code. For dynamic C++ classes type info
+ /// is only emitted int the module that
+ /// contains the classe's vtable.
+
+ FullDebugInfo /// Generate complete debug info.
};
enum TLSModel {
diff --git a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
index dc93d959fffc..8be351ead4ac 100644
--- a/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/contrib/llvm/tools/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -1456,13 +1456,13 @@ llvm::DIType CGDebugInfo::CreateType(const RecordType *Ty) {
// declaration. The completeType, completeRequiredType, and completeClassData
// callbacks will handle promoting the declaration to a definition.
if (T ||
+ // Under -flimit-debug-info:
(DebugKind <= CodeGenOptions::LimitedDebugInfo &&
- // Under -flimit-debug-info, emit only a declaration unless the type is
- // required to be complete.
- !RD->isCompleteDefinitionRequired() && CGM.getLangOpts().CPlusPlus) ||
- // If the class is dynamic, only emit a declaration. A definition will be
- // emitted whenever the vtable is emitted.
- (CXXDecl && CXXDecl->hasDefinition() && CXXDecl->isDynamicClass()) || T) {
+ // Emit only a forward declaration unless the type is required.
+ ((!RD->isCompleteDefinitionRequired() && CGM.getLangOpts().CPlusPlus) ||
+ // If the class is dynamic, only emit a declaration. A definition will be
+ // emitted whenever the vtable is emitted.
+ (CXXDecl && CXXDecl->hasDefinition() && CXXDecl->isDynamicClass())))) {
llvm::DIDescriptor FDContext =
getContextDescriptor(cast<Decl>(RD->getDeclContext()));
if (!T)
diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
index ceea404e638f..83ce2afd2471 100644
--- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
+++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp
@@ -3002,8 +3002,8 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
Args.AddLastArg(CmdArgs, options::OPT_femit_all_decls);
Args.AddLastArg(CmdArgs, options::OPT_fformat_extensions);
Args.AddLastArg(CmdArgs, options::OPT_fheinous_gnu_extensions);
- Args.AddLastArg(CmdArgs, options::OPT_flimit_debug_info);
- Args.AddLastArg(CmdArgs, options::OPT_fno_limit_debug_info);
+ Args.AddLastArg(CmdArgs, options::OPT_fstandalone_debug);
+ Args.AddLastArg(CmdArgs, options::OPT_fno_standalone_debug);
Args.AddLastArg(CmdArgs, options::OPT_fno_operator_names);
// AltiVec language extensions aren't relevant for assembling.
if (!isa<PreprocessJobAction>(JA) ||
diff --git a/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp b/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
index ec1e53fe6aa6..81128fd1f58a 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/CompilerInvocation.cpp
@@ -295,7 +295,8 @@ static void ParseCommentArgs(CommentOptions &Opts, ArgList &Args) {
}
static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
- DiagnosticsEngine &Diags) {
+ DiagnosticsEngine &Diags,
+ const TargetOptions &TargetOpts) {
using namespace options;
bool Success = true;
@@ -322,10 +323,16 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
Opts.setDebugInfo(CodeGenOptions::DebugLineTablesOnly);
} else if (Args.hasArg(OPT_g_Flag) || Args.hasArg(OPT_gdwarf_2) ||
Args.hasArg(OPT_gdwarf_3) || Args.hasArg(OPT_gdwarf_4)) {
- if (Args.hasFlag(OPT_flimit_debug_info, OPT_fno_limit_debug_info, true))
- Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo);
- else
+ bool Default = false;
+ // Until dtrace (via CTF) can deal with distributed debug info,
+ // Darwin defaults to standalone/full debug info.
+ if (llvm::Triple(TargetOpts.Triple).isOSDarwin())
+ Default = true;
+
+ if (Args.hasFlag(OPT_fstandalone_debug, OPT_fno_standalone_debug, Default))
Opts.setDebugInfo(CodeGenOptions::FullDebugInfo);
+ else
+ Opts.setDebugInfo(CodeGenOptions::LimitedDebugInfo);
}
Opts.DebugColumnInfo = Args.hasArg(OPT_dwarf_column_info);
Opts.SplitDwarfFile = Args.getLastArgValue(OPT_split_dwarf_file);
@@ -1657,8 +1664,9 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
ParseFileSystemArgs(Res.getFileSystemOpts(), *Args);
// FIXME: We shouldn't have to pass the DashX option around here
InputKind DashX = ParseFrontendArgs(Res.getFrontendOpts(), *Args, Diags);
- Success = ParseCodeGenArgs(Res.getCodeGenOpts(), *Args, DashX, Diags)
- && Success;
+ ParseTargetArgs(Res.getTargetOpts(), *Args);
+ Success = ParseCodeGenArgs(Res.getCodeGenOpts(), *Args, DashX, Diags,
+ Res.getTargetOpts()) && Success;
ParseHeaderSearchArgs(Res.getHeaderSearchOpts(), *Args);
if (DashX != IK_AST && DashX != IK_LLVM_IR) {
ParseLangArgs(*Res.getLangOpts(), *Args, DashX, Diags);
@@ -1673,8 +1681,6 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res,
ParsePreprocessorArgs(Res.getPreprocessorOpts(), *Args, FileMgr, Diags);
ParsePreprocessorOutputArgs(Res.getPreprocessorOutputOpts(), *Args,
Res.getFrontendOpts().ProgramAction);
- ParseTargetArgs(Res.getTargetOpts(), *Args);
-
return Success;
}
diff --git a/contrib/ntp/ntpd/ntp_request.c b/contrib/ntp/ntpd/ntp_request.c
index f5eed4449d9a..6d479566d123 100644
--- a/contrib/ntp/ntpd/ntp_request.c
+++ b/contrib/ntp/ntpd/ntp_request.c
@@ -1920,7 +1920,6 @@ mon_getlist_0(
printf("wants monitor 0 list\n");
#endif
if (!mon_enabled) {
- req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
return;
}
im = (struct info_monitor *)prepare_pkt(srcadr, inter, inpkt,
@@ -1965,7 +1964,6 @@ mon_getlist_1(
extern int mon_enabled;
if (!mon_enabled) {
- req_ack(srcadr, inter, inpkt, INFO_ERR_NODATA);
return;
}
im = (struct info_monitor_1 *)prepare_pkt(srcadr, inter, inpkt,
diff --git a/contrib/top/commands.c b/contrib/top/commands.c
index 4d987baac071..707366d8aa48 100644
--- a/contrib/top/commands.c
+++ b/contrib/top/commands.c
@@ -74,6 +74,7 @@ e - list errors generated by last \"kill\" or \"renice\" command\n\
H - toggle the displaying of threads\n\
i or I - toggle the displaying of idle processes\n\
j - toggle the displaying of jail ID\n\
+J - display processes for only one jail (+ selects all jails)\n\
k - kill processes; send a signal to a list of processes\n\
m - toggle the display between 'cpu' and 'io' modes\n\
n or # - change number of processes to display\n", stdout);
diff --git a/contrib/top/machine.h b/contrib/top/machine.h
index 699c7554df05..41da6008647b 100644
--- a/contrib/top/machine.h
+++ b/contrib/top/machine.h
@@ -66,6 +66,7 @@ struct process_select
int thread; /* show threads */
int uid; /* only this uid (unless uid == -1) */
int wcpu; /* show weighted cpu */
+ int jid; /* only this jid (unless jid == -1) */
int jail; /* show jail ID */
int kidle; /* show per-CPU idle threads */
char *command; /* only this command (unless == NULL) */
diff --git a/contrib/top/top.X b/contrib/top/top.X
index 9c54f85637e8..15cf2dcb5119 100644
--- a/contrib/top/top.X
+++ b/contrib/top/top.X
@@ -20,6 +20,8 @@ top \- display and update information about the top cpu processes
] [
.BI \-s time
] [
+.BI \-J jail
+] [
.BI \-U username
] [
.I number
@@ -171,6 +173,21 @@ values are \*(lqcpu\*(rq, \*(lqsize\*(rq, \*(lqres\*(rq, and \*(lqtime\*(rq,
but may vary on different operating systems. Note that
not all operating systems support this option.
.TP
+.BI \-J jail
+Show only those processes owned by
+.IR jail .
+This may be either the
+.B jid
+or
+.B name
+of the jail.
+Use
+.B 0
+to limit to host processes.
+Using this option implies the
+.B \-j
+flag.
+.PP
.BI \-U username
Show only those processes owned by
.IR username .
@@ -315,6 +332,12 @@ Toggle the display of
.IR jail (8)
ID.
.TP
+.B J
+Display only processes owned by a specific jail (prompt for jail).
+If the jail specified is simply \*(lq+\*(rq, then processes belonging
+to all jails and the host will be displayed.
+This will also enable the display of JID.
+.TP
.B P
Toggle the display of per-CPU statistics.
.TP
diff --git a/contrib/top/top.c b/contrib/top/top.c
index c2eb35da1a99..ebb06e5f8923 100644
--- a/contrib/top/top.c
+++ b/contrib/top/top.c
@@ -38,7 +38,9 @@ char *copyright =
#include <signal.h>
#include <setjmp.h>
#include <ctype.h>
+#include <sys/jail.h>
#include <sys/time.h>
+#include <jail.h>
/* includes specific to top */
#include "display.h" /* interface to display package */
@@ -198,9 +200,9 @@ char *argv[];
fd_set readfds;
#ifdef ORDER
- static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPo";
+ static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJo";
#else
- static char command_chars[] = "\f qh?en#sdkriIutHmSCajzP";
+ static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJ";
#endif
/* these defines enumerate the "strchr"s of the commands in command_chars */
#define CMD_redraw 0
@@ -228,8 +230,9 @@ char *argv[];
#define CMD_jidtog 21
#define CMD_kidletog 22
#define CMD_pcputog 23
+#define CMD_jail 24
#ifdef ORDER
-#define CMD_order 24
+#define CMD_order 25
#endif
/* set the buffer for stdout */
@@ -261,6 +264,7 @@ char *argv[];
ps.uid = -1;
ps.thread = No;
ps.wcpu = 1;
+ ps.jid = -1;
ps.jail = No;
ps.kidle = Yes;
ps.command = NULL;
@@ -288,7 +292,7 @@ char *argv[];
optind = 1;
}
- while ((i = getopt(ac, av, "CSIHPabijnquvzs:d:U:m:o:t")) != EOF)
+ while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:t")) != EOF)
{
switch(i)
{
@@ -413,6 +417,15 @@ char *argv[];
ps.jail = !ps.jail;
break;
+ case 'J': /* display only jail's processes */
+ if ((ps.jid = jail_getid(optarg)) == -1)
+ {
+ fprintf(stderr, "%s: unknown jail\n", optarg);
+ exit(1);
+ }
+ ps.jail = 1;
+ break;
+
case 'P':
pcpu_stats = !pcpu_stats;
break;
@@ -425,7 +438,7 @@ char *argv[];
fprintf(stderr,
"Top version %s\n"
"Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n"
-" [-U username] [number]\n",
+" [-J jail] [-U username] [number]\n",
version_string(), myname);
exit(1);
}
@@ -994,7 +1007,7 @@ restart:
case CMD_user:
new_message(MT_standout,
- "Username to show: ");
+ "Username to show (+ for all): ");
if (readline(tempbuf2, sizeof(tempbuf2), No) > 0)
{
if (tempbuf2[0] == '+' &&
@@ -1085,6 +1098,44 @@ restart:
reset_display();
putchar('\r');
break;
+
+ case CMD_jail:
+ new_message(MT_standout,
+ "Jail to show (+ for all): ");
+ if (readline(tempbuf2, sizeof(tempbuf2), No) > 0)
+ {
+ if (tempbuf2[0] == '+' &&
+ tempbuf2[1] == '\0')
+ {
+ ps.jid = -1;
+ }
+ else if ((i = jail_getid(tempbuf2)) == -1)
+ {
+ new_message(MT_standout,
+ " %s: unknown jail", tempbuf2);
+ no_command = Yes;
+ }
+ else
+ {
+ ps.jid = i;
+ }
+ if (ps.jail == 0) {
+ ps.jail = 1;
+ new_message(MT_standout |
+ MT_delayed, " Displaying jail "
+ "ID.");
+ header_text =
+ format_header(uname_field);
+ reset_display();
+ }
+ putchar('\r');
+ }
+ else
+ {
+ clear_message();
+ }
+ break;
+
case CMD_kidletog:
ps.kidle = !ps.kidle;
new_message(MT_standout | MT_delayed,
diff --git a/crypto/openssl/ssl/s3_pkt.c b/crypto/openssl/ssl/s3_pkt.c
index 96ba63262e44..8deeab3c9fbf 100644
--- a/crypto/openssl/ssl/s3_pkt.c
+++ b/crypto/openssl/ssl/s3_pkt.c
@@ -1055,7 +1055,7 @@ start:
{
s->rstate=SSL_ST_READ_HEADER;
rr->off=0;
- if (s->mode & SSL_MODE_RELEASE_BUFFERS)
+ if (s->mode & SSL_MODE_RELEASE_BUFFERS && s->s3->rbuf.left == 0)
ssl3_release_read_buffer(s);
}
}
diff --git a/etc/Makefile b/etc/Makefile
index 340ade4dc2a0..03edb13d6164 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -1,7 +1,7 @@
# from: @(#)Makefile 5.11 (Berkeley) 5/21/91
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.if ${MK_SENDMAIL} != "no"
SUBDIR= sendmail
diff --git a/etc/defaults/rc.conf b/etc/defaults/rc.conf
index 0d4b7428f7ea..aa19b3031e56 100644
--- a/etc/defaults/rc.conf
+++ b/etc/defaults/rc.conf
@@ -641,10 +641,10 @@ devfs_rulesets="/etc/defaults/devfs.rules /etc/devfs.rules" # Files containing
devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev
devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to
# apply (must be mounted already, i.e. fstab(5))
-devfs_load_rulesets="NO" # Enable to always load the default rulesets
-performance_cx_lowest="HIGH" # Online CPU idle state
+devfs_load_rulesets="YES" # Enable to always load the default rulesets
+performance_cx_lowest="Cmax" # Online CPU idle state
performance_cpu_freq="NONE" # Online CPU frequency
-economy_cx_lowest="HIGH" # Offline CPU idle state
+economy_cx_lowest="Cmax" # Offline CPU idle state
economy_cpu_freq="NONE" # Offline CPU frequency
virecover_enable="YES" # Perform housekeeping for the vi(1) editor
ugidfw_enable="NO" # Load mac_bsdextended(4) rules on boot
diff --git a/etc/mtree/BSD.tests.dist b/etc/mtree/BSD.tests.dist
index 4cc3f87b41eb..2e6d30afa0cb 100644
--- a/etc/mtree/BSD.tests.dist
+++ b/etc/mtree/BSD.tests.dist
@@ -97,8 +97,6 @@
..
growfs
..
- ifconfig
- ..
mdconfig
..
..
diff --git a/etc/mtree/Makefile b/etc/mtree/Makefile
index f24867b8ecf8..afed37044fa2 100644
--- a/etc/mtree/Makefile
+++ b/etc/mtree/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= ${_BSD.debug.dist} \
BSD.include.dist \
diff --git a/etc/periodic/daily/Makefile b/etc/periodic/daily/Makefile
index aa28351ae2a1..61ede6ddacb3 100644
--- a/etc/periodic/daily/Makefile
+++ b/etc/periodic/daily/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= 100.clean-disks \
110.clean-tmps \
diff --git a/etc/periodic/monthly/Makefile b/etc/periodic/monthly/Makefile
index d9e49691b6e9..ea2bd9f0b057 100644
--- a/etc/periodic/monthly/Makefile
+++ b/etc/periodic/monthly/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= 450.status-security \
999.local
diff --git a/etc/periodic/security/Makefile b/etc/periodic/security/Makefile
index c5af2f85b012..026948b9d854 100644
--- a/etc/periodic/security/Makefile
+++ b/etc/periodic/security/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= 100.chksetuid \
110.neggrpperm \
diff --git a/etc/periodic/weekly/Makefile b/etc/periodic/weekly/Makefile
index b6f77c4f71d0..865ef5340def 100644
--- a/etc/periodic/weekly/Makefile
+++ b/etc/periodic/weekly/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= 340.noid \
450.status-security \
diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile
index 6c6801b52581..7302d2934c17 100644
--- a/etc/rc.d/Makefile
+++ b/etc/rc.d/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= DAEMON \
FILESYSTEMS \
diff --git a/games/Makefile b/games/Makefile
index 716a7861db5d..a3bb2965a25d 100644
--- a/games/Makefile
+++ b/games/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= \
bcd \
diff --git a/games/factor/Makefile b/games/factor/Makefile
index da1737cdb28d..afc9510405f2 100644
--- a/games/factor/Makefile
+++ b/games/factor/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 5/31/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= factor
SRCS= factor.c pr_tbl.c
diff --git a/gnu/Makefile b/gnu/Makefile
index b460590387ae..25480c7b951a 100644
--- a/gnu/Makefile
+++ b/gnu/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 5.33.1.1 (Berkeley) 5/6/91
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= lib ${_tests} usr.bin
diff --git a/gnu/lib/Makefile b/gnu/lib/Makefile
index 0a607d7afa86..2651eef5abdb 100644
--- a/gnu/lib/Makefile
+++ b/gnu/lib/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= csu libgcc libgcov libdialog libgomp libregex libreadline
diff --git a/gnu/lib/csu/Makefile b/gnu/lib/csu/Makefile
index 5aba49f44734..0a2c7d35ea6c 100644
--- a/gnu/lib/csu/Makefile
+++ b/gnu/lib/csu/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
GCCDIR= ${.CURDIR}/../../../contrib/gcc
diff --git a/gnu/lib/libgcc/Makefile b/gnu/lib/libgcc/Makefile
index d3befcbb89a8..11af4305edbb 100644
--- a/gnu/lib/libgcc/Makefile
+++ b/gnu/lib/libgcc/Makefile
@@ -6,7 +6,7 @@ GCCLIB= ${.CURDIR}/../../../contrib/gcclibs
SHLIB_NAME= libgcc_s.so.1
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
#
# libgcc is linked in last and thus cannot depend on ssp symbols coming
# from earlier libraries. Disable stack protection for this library.
diff --git a/gnu/lib/libgcov/Makefile b/gnu/lib/libgcov/Makefile
index aab624105291..5292f9f8d53f 100644
--- a/gnu/lib/libgcov/Makefile
+++ b/gnu/lib/libgcov/Makefile
@@ -3,7 +3,7 @@
MK_PROFILE= no
MK_SSP= no
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "${.CURDIR}/../../usr.bin/cc/Makefile.tgt"
GCCDIR= ${.CURDIR}/../../../contrib/gcc
diff --git a/gnu/lib/libstdc++/Makefile b/gnu/lib/libstdc++/Makefile
index b0d45d63b651..d19f9f3bb3ff 100644
--- a/gnu/lib/libstdc++/Makefile
+++ b/gnu/lib/libstdc++/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
GCCVER= 4.2
GCCDIR= ${.CURDIR}/../../../contrib/gcc
diff --git a/gnu/lib/libsupc++/Makefile b/gnu/lib/libsupc++/Makefile
index acf1b58ed3c1..5cc5f04adf67 100644
--- a/gnu/lib/libsupc++/Makefile
+++ b/gnu/lib/libsupc++/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
GCCVER= 4.2
GCCDIR= ${.CURDIR}/../../../contrib/gcc
diff --git a/gnu/usr.bin/Makefile b/gnu/usr.bin/Makefile
index 7e96a6f4829f..76330699dffa 100644
--- a/gnu/usr.bin/Makefile
+++ b/gnu/usr.bin/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_binutils} \
${_cc} \
diff --git a/gnu/usr.bin/binutils/as/Makefile b/gnu/usr.bin/binutils/as/Makefile
index 4436394f5de4..c058727069e7 100644
--- a/gnu/usr.bin/binutils/as/Makefile
+++ b/gnu/usr.bin/binutils/as/Makefile
@@ -4,7 +4,7 @@
# BINDIR
.include "${.CURDIR}/../../Makefile.inc"
.include "${.CURDIR}/../Makefile.inc0"
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${SRCDIR}/gas ${SRCDIR}/gas/config
diff --git a/gnu/usr.bin/binutils/ld/Makefile b/gnu/usr.bin/binutils/ld/Makefile
index dff112169eba..81a46d5d21b0 100644
--- a/gnu/usr.bin/binutils/ld/Makefile
+++ b/gnu/usr.bin/binutils/ld/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
.include "../Makefile.inc0"
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${SRCDIR}/ld
diff --git a/gnu/usr.bin/cc/Makefile b/gnu/usr.bin/cc/Makefile
index bf6d20c79ce4..313aaf2da84f 100644
--- a/gnu/usr.bin/cc/Makefile
+++ b/gnu/usr.bin/cc/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# The order of some of these are rather important. Some depend on previous
# subdirs.
diff --git a/gnu/usr.bin/cc/Makefile.inc b/gnu/usr.bin/cc/Makefile.inc
index 39adc91308e7..dc9779973210 100644
--- a/gnu/usr.bin/cc/Makefile.inc
+++ b/gnu/usr.bin/cc/Makefile.inc
@@ -1,5 +1,6 @@
# $FreeBSD$
+.include <src.opts.mk>
.include "../Makefile.inc"
# Sometimes this is .include'd several times...
diff --git a/gnu/usr.bin/cc/c++/Makefile b/gnu/usr.bin/cc/c++/Makefile
index 1e7f33959f36..39f372b2d888 100644
--- a/gnu/usr.bin/cc/c++/Makefile
+++ b/gnu/usr.bin/cc/c++/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "../Makefile.inc"
.include "../Makefile.fe"
diff --git a/gnu/usr.bin/cc/cc/Makefile b/gnu/usr.bin/cc/cc/Makefile
index ba53565c35f7..0fd82e092db4 100644
--- a/gnu/usr.bin/cc/cc/Makefile
+++ b/gnu/usr.bin/cc/cc/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "../Makefile.inc"
.include "../Makefile.fe"
diff --git a/gnu/usr.bin/cc/cc1/Makefile b/gnu/usr.bin/cc/cc1/Makefile
index e73b2c991194..368517c1be00 100644
--- a/gnu/usr.bin/cc/cc1/Makefile
+++ b/gnu/usr.bin/cc/cc1/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "../Makefile.inc"
diff --git a/gnu/usr.bin/cc/cc1plus/Makefile b/gnu/usr.bin/cc/cc1plus/Makefile
index 742d7c6d41f2..64a07255e011 100644
--- a/gnu/usr.bin/cc/cc1plus/Makefile
+++ b/gnu/usr.bin/cc/cc1plus/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "../Makefile.inc"
diff --git a/gnu/usr.bin/cc/cc_tools/Makefile b/gnu/usr.bin/cc/cc_tools/Makefile
index 8f75f43aadda..ae7f8b82d17d 100644
--- a/gnu/usr.bin/cc/cc_tools/Makefile
+++ b/gnu/usr.bin/cc/cc_tools/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
CFLAGS+= -I.
diff --git a/gnu/usr.bin/cc/cpp/Makefile b/gnu/usr.bin/cc/cpp/Makefile
index a8e48af2d02c..a3ac04b909e3 100644
--- a/gnu/usr.bin/cc/cpp/Makefile
+++ b/gnu/usr.bin/cc/cpp/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "../Makefile.inc"
.include "../Makefile.fe"
diff --git a/gnu/usr.bin/dialog/Makefile b/gnu/usr.bin/dialog/Makefile
index 7c98cfc062c8..a7e0a57ad594 100644
--- a/gnu/usr.bin/dialog/Makefile
+++ b/gnu/usr.bin/dialog/Makefile
@@ -10,7 +10,7 @@ CFLAGS+= -I${.CURDIR} -I${DIALOG}
WARNS?= 6
-.include <bsd.own.mk>
+.include <src.opts.mk>
.if ${MK_NCURSESW} == "no"
DPADD+= ${LIBNCURSES}
diff --git a/gnu/usr.bin/grep/Makefile b/gnu/usr.bin/grep/Makefile
index 7d3b60769b8d..d412dfdfd0ed 100644
--- a/gnu/usr.bin/grep/Makefile
+++ b/gnu/usr.bin/grep/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
GREP_LIBZ=YES
diff --git a/include/Makefile b/include/Makefile
index 991c78366b88..8b896bad8999 100644
--- a/include/Makefile
+++ b/include/Makefile
@@ -3,7 +3,7 @@
#
# Doing a "make install" builds /usr/include.
-.include <bsd.own.mk>
+.include <src.opts.mk>
CLEANFILES= osreldate.h version vers.c
SUBDIR= arpa gssapi protocols rpcsvc rpc xlocale
diff --git a/include/arpa/Makefile b/include/arpa/Makefile
index 260b3b347ebe..2f1c2495ebe5 100644
--- a/include/arpa/Makefile
+++ b/include/arpa/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
INCS= ftp.h inet.h nameser.h nameser_compat.h telnet.h tftp.h
diff --git a/kerberos5/Makefile.inc b/kerberos5/Makefile.inc
index 6dfd5187e0da..c57b18a157b0 100644
--- a/kerberos5/Makefile.inc
+++ b/kerberos5/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
NO_LINT=
diff --git a/lib/Makefile b/lib/Makefile
index fe99085104bf..de87cbaa8560 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# To satisfy shared library or ELF linkage when only the libraries being
# built are visible:
diff --git a/lib/atf/Makefile b/lib/atf/Makefile
index a191f0da4d47..0772065f0822 100644
--- a/lib/atf/Makefile
+++ b/lib/atf/Makefile
@@ -25,7 +25,7 @@
#
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= libatf-c \
libatf-c++ \
diff --git a/lib/atf/libatf-c++/Makefile b/lib/atf/libatf-c++/Makefile
index d52e4965d0a1..84477f79927d 100644
--- a/lib/atf/libatf-c++/Makefile
+++ b/lib/atf/libatf-c++/Makefile
@@ -25,6 +25,7 @@
#
# $FreeBSD$
+.include <src.opts.mk>
.include <bsd.init.mk>
LIB= atf-c++
diff --git a/lib/atf/libatf-c/Makefile b/lib/atf/libatf-c/Makefile
index 69c46114e8bb..5c607f7b42da 100644
--- a/lib/atf/libatf-c/Makefile
+++ b/lib/atf/libatf-c/Makefile
@@ -25,6 +25,7 @@
#
# $FreeBSD$
+.include <src.opts.mk>
.include <bsd.init.mk>
LIB= atf-c
diff --git a/lib/clang/Makefile b/lib/clang/Makefile
index d335d80fbee2..ae7ae4a0a44d 100644
--- a/lib/clang/Makefile
+++ b/lib/clang/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.if !make(install)
.if !defined(EARLY_BUILD)
diff --git a/lib/clang/clang.build.mk b/lib/clang/clang.build.mk
index 0ba18f060fcb..27c0ca068785 100644
--- a/lib/clang/clang.build.mk
+++ b/lib/clang/clang.build.mk
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <src.opts.mk>
+
CLANG_SRCS= ${LLVM_SRCS}/tools/clang
CFLAGS+= -I${LLVM_SRCS}/include -I${CLANG_SRCS}/include \
diff --git a/lib/clang/libllvmanalysis/Makefile b/lib/clang/libllvmanalysis/Makefile
index 34725fc39cb2..ea2a7189c40f 100644
--- a/lib/clang/libllvmanalysis/Makefile
+++ b/lib/clang/libllvmanalysis/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmanalysis
diff --git a/lib/clang/libllvmipa/Makefile b/lib/clang/libllvmipa/Makefile
index 85b75afa1c37..c866ca0ddfe0 100644
--- a/lib/clang/libllvmipa/Makefile
+++ b/lib/clang/libllvmipa/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmipa
diff --git a/lib/clang/libllvmipo/Makefile b/lib/clang/libllvmipo/Makefile
index b1e90161786d..85af0360244a 100644
--- a/lib/clang/libllvmipo/Makefile
+++ b/lib/clang/libllvmipo/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmipo
diff --git a/lib/clang/libllvmmc/Makefile b/lib/clang/libllvmmc/Makefile
index 7fdc474eb7f1..84ba618902bb 100644
--- a/lib/clang/libllvmmc/Makefile
+++ b/lib/clang/libllvmmc/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmmc
diff --git a/lib/clang/libllvmscalaropts/Makefile b/lib/clang/libllvmscalaropts/Makefile
index 1f4edffeede9..8da4bf06d0c9 100644
--- a/lib/clang/libllvmscalaropts/Makefile
+++ b/lib/clang/libllvmscalaropts/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmscalaropts
diff --git a/lib/clang/libllvmsupport/Makefile b/lib/clang/libllvmsupport/Makefile
index eb3f633286cb..b7cfe6aa2d86 100644
--- a/lib/clang/libllvmsupport/Makefile
+++ b/lib/clang/libllvmsupport/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmsupport
diff --git a/lib/clang/libllvmtransformutils/Makefile b/lib/clang/libllvmtransformutils/Makefile
index f74209220254..cfad040c638d 100644
--- a/lib/clang/libllvmtransformutils/Makefile
+++ b/lib/clang/libllvmtransformutils/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmtransformutils
diff --git a/lib/clang/libllvmx86disassembler/Makefile b/lib/clang/libllvmx86disassembler/Makefile
index 797f2bf49a89..e5489a0e6089 100644
--- a/lib/clang/libllvmx86disassembler/Makefile
+++ b/lib/clang/libllvmx86disassembler/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= llvmx86disassembler
diff --git a/lib/libarchive/Makefile b/lib/libarchive/Makefile
index eb3921949931..bbe03a0bf126 100644
--- a/lib/libarchive/Makefile
+++ b/lib/libarchive/Makefile
@@ -1,5 +1,5 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIBARCHIVEDIR= ${.CURDIR}/../../contrib/libarchive
diff --git a/lib/libbsnmp/libbsnmp/Makefile b/lib/libbsnmp/libbsnmp/Makefile
index 20015b98a9d0..0b9087d6540c 100644
--- a/lib/libbsnmp/libbsnmp/Makefile
+++ b/lib/libbsnmp/libbsnmp/Makefile
@@ -2,7 +2,7 @@
#
# Author: Harti Brandt <harti@freebsd.org>
-.include <bsd.own.mk>
+.include <src.opts.mk>
CONTRIB= ${.CURDIR}/../../../contrib/bsnmp/lib
.PATH: ${CONTRIB}
diff --git a/lib/libc/Makefile b/lib/libc/Makefile
index 6f88dac8254a..e9bc33bd9277 100644
--- a/lib/libc/Makefile
+++ b/lib/libc/Makefile
@@ -3,7 +3,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIBC_SRCTOP?= ${.CURDIR}
diff --git a/lib/libc/arm/gen/fpsetmask_vfp.c b/lib/libc/arm/gen/fpsetmask_vfp.c
index 061c03385b54..170e06d74fa9 100644
--- a/lib/libc/arm/gen/fpsetmask_vfp.c
+++ b/lib/libc/arm/gen/fpsetmask_vfp.c
@@ -45,7 +45,7 @@ fpsetmask(fp_except_t mask)
__asm __volatile("vmrs %0, fpscr" : "=&r"(old));
mask = (mask & FP_X_MASK) << 8;
new = (old & ~(FP_X_MASK << 8)) | mask;
- __asm __volatile("vmsr fpscr, %0" : : "r"(old));
+ __asm __volatile("vmsr fpscr, %0" : : "r"(new));
return ((old >> 8) & FP_X_MASK);
}
diff --git a/lib/libc/locale/utf8.c b/lib/libc/locale/utf8.c
index 40f0e1701bd5..cffa241133a5 100644
--- a/lib/libc/locale/utf8.c
+++ b/lib/libc/locale/utf8.c
@@ -203,6 +203,13 @@ _UTF8_mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n,
errno = EILSEQ;
return ((size_t)-1);
}
+ if (wch >= 0xd800 && wch <= 0xdfff) {
+ /*
+ * Malformed input; invalid code points.
+ */
+ errno = EILSEQ;
+ return ((size_t)-1);
+ }
if (pwc != NULL)
*pwc = wch;
us->want = 0;
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 2a1a75e0b1d6..589bb9d72698 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -686,19 +686,16 @@ backref(struct match *m,
while (m->g->strip[ss] != SOP(O_BACK, i))
ss++;
return(backref(m, sp+len, stop, ss+1, stopst, lev, rec));
- break;
case OQUEST_: /* to null or not */
dp = backref(m, sp, stop, ss+1, stopst, lev, rec);
if (dp != NULL)
return(dp); /* not */
return(backref(m, sp, stop, ss+OPND(s)+1, stopst, lev, rec));
- break;
case OPLUS_:
assert(m->lastpos != NULL);
assert(lev+1 <= m->g->nplus);
m->lastpos[lev+1] = sp;
return(backref(m, sp, stop, ss+1, stopst, lev+1, rec));
- break;
case O_PLUS:
if (sp == m->lastpos[lev]) /* last pass matched null */
return(backref(m, sp, stop, ss+1, stopst, lev-1, rec));
@@ -709,7 +706,6 @@ backref(struct match *m,
return(backref(m, sp, stop, ss+1, stopst, lev-1, rec));
else
return(dp);
- break;
case OCH_: /* find the right one, if any */
ssub = ss + 1;
esub = ss + OPND(s) - 1;
@@ -730,6 +726,7 @@ backref(struct match *m,
else
assert(OP(m->g->strip[esub]) == O_CH);
}
+ /* NOTREACHED */
break;
case OLPAREN: /* must undo assignment if rest fails */
i = OPND(s);
@@ -741,7 +738,6 @@ backref(struct match *m,
return(dp);
m->pmatch[i].rm_so = offsave;
return(NULL);
- break;
case ORPAREN: /* must undo assignment if rest fails */
i = OPND(s);
assert(0 < i && i <= m->g->nsub);
@@ -752,7 +748,6 @@ backref(struct match *m,
return(dp);
m->pmatch[i].rm_eo = offsave;
return(NULL);
- break;
default: /* uh oh */
assert(nope);
break;
diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c
index f3a41e90fb71..55f9c04c6910 100644
--- a/lib/libc/regex/regcomp.c
+++ b/lib/libc/regex/regcomp.c
@@ -746,7 +746,6 @@ p_b_term(struct parse *p, cset *cs)
case '-':
SETERROR(REG_ERANGE);
return; /* NOTE RETURN */
- break;
default:
c = '\0';
break;
diff --git a/lib/libc/rpc/clnt_vc.c b/lib/libc/rpc/clnt_vc.c
index 7cd93b37e9de..117cfba65486 100644
--- a/lib/libc/rpc/clnt_vc.c
+++ b/lib/libc/rpc/clnt_vc.c
@@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, sendsz, recvsz)
return (cl);
err:
- if (cl) {
- if (ct) {
- if (ct->ct_addr.len)
- mem_free(ct->ct_addr.buf, ct->ct_addr.len);
- mem_free(ct, sizeof (struct ct_data));
- }
- if (cl)
- mem_free(cl, sizeof (CLIENT));
+ if (ct) {
+ if (ct->ct_addr.len)
+ mem_free(ct->ct_addr.buf, ct->ct_addr.len);
+ mem_free(ct, sizeof (struct ct_data));
}
+ if (cl)
+ mem_free(cl, sizeof (CLIENT));
return ((CLIENT *)NULL);
}
diff --git a/lib/libc/sys/msync.2 b/lib/libc/sys/msync.2
index 42d8005418d1..a91faf2a66e0 100644
--- a/lib/libc/sys/msync.2
+++ b/lib/libc/sys/msync.2
@@ -87,11 +87,13 @@ The
.Fa addr
argument
is not a multiple of the hardware page size.
-.It Bq Er EINVAL
-The
+.It Bq Er ENOMEM
+The addresses in the range starting at
+.Fa addr
+and continuing for
.Fa len
-argument
-is too large or negative.
+bytes are outside the range allowed for the address space of a
+process or specify one or more pages that are not mapped.
.It Bq Er EINVAL
The
.Fa flags
@@ -99,7 +101,7 @@ argument
was both MS_ASYNC and MS_INVALIDATE.
Only one of these flags is allowed.
.It Bq Er EIO
- An error occurred while writing at least one of the pages in
+An error occurred while writing at least one of the pages in
the specified region.
.El
.Sh SEE ALSO
diff --git a/lib/libc_nonshared/Makefile b/lib/libc_nonshared/Makefile
index e65fca06f8b6..db4fb32c7922 100644
--- a/lib/libc_nonshared/Makefile
+++ b/lib/libc_nonshared/Makefile
@@ -5,7 +5,7 @@
# compile modes.
# bsd.lib.mk doesn't have an easy way to express that.
MK_PROFILE?=no
-.include <bsd.own.mk>
+.include <src.opts.mk>
NO_PIC=
# -fpic on some platforms, -fPIC on others.
CFLAGS+=${PICFLAG} -DPIC -fvisibility=hidden
diff --git a/lib/libcapsicum/libcapsicum_dns.c b/lib/libcapsicum/libcapsicum_dns.c
index 170e0d07d2d9..113f8dc5a315 100644
--- a/lib/libcapsicum/libcapsicum_dns.c
+++ b/lib/libcapsicum/libcapsicum_dns.c
@@ -247,6 +247,7 @@ cap_getaddrinfo(cap_channel_t *chan, const char *hostname, const char *servname,
prevai->ai_next = curai;
else if (firstai == NULL)
firstai = curai;
+ prevai = curai;
}
nvlist_destroy(nvl);
if (curai == NULL && nvlai != NULL) {
diff --git a/lib/libcompiler_rt/Makefile b/lib/libcompiler_rt/Makefile
index 5f8039bc166f..91ce965739c9 100644
--- a/lib/libcompiler_rt/Makefile
+++ b/lib/libcompiler_rt/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= compiler_rt
NO_PIC=
diff --git a/lib/libcrypt/Makefile b/lib/libcrypt/Makefile
index aca24d8f8af3..85bf94804fca 100644
--- a/lib/libcrypt/Makefile
+++ b/lib/libcrypt/Makefile
@@ -4,7 +4,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
SHLIB_MAJOR= 5
LIB= crypt
diff --git a/lib/libfetch/Makefile b/lib/libfetch/Makefile
index 085aba2c6cb4..cef5f5a43c18 100644
--- a/lib/libfetch/Makefile
+++ b/lib/libfetch/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= fetch
CFLAGS+= -I.
diff --git a/lib/libipsec/Makefile b/lib/libipsec/Makefile
index 840aefa54f27..7d3e94a7db5a 100644
--- a/lib/libipsec/Makefile
+++ b/lib/libipsec/Makefile
@@ -29,7 +29,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= ipsec
SHLIB_MAJOR= 4
diff --git a/lib/libkiconv/Makefile b/lib/libkiconv/Makefile
index bda505eeaff1..c7b2179c1943 100644
--- a/lib/libkiconv/Makefile
+++ b/lib/libkiconv/Makefile
@@ -2,7 +2,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= kiconv
SRCS= kiconv_sysctl.c xlat16_iconv.c xlat16_sysctl.c
diff --git a/lib/libmagic/Makefile b/lib/libmagic/Makefile
index d341a3a5f564..59d772df552f 100644
--- a/lib/libmagic/Makefile
+++ b/lib/libmagic/Makefile
@@ -32,7 +32,7 @@ MAGFILES= ${CONTRDIR}/Header\
${CONTRDIR}/Magdir/[a-z]*
magic: ${MAGFILES}
- cat ${.ALLSRC} > ${.TARGET}
+ cat ${.ALLSRC:O} > ${.TARGET}
magic.mgc: mkmagic magic
./mkmagic magic
diff --git a/lib/libmilter/Makefile b/lib/libmilter/Makefile
index 0e625d0812a4..ca9838d9bff1 100644
--- a/lib/libmilter/Makefile
+++ b/lib/libmilter/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
.PATH: ${SENDMAIL_DIR}/libmilter ${SENDMAIL_DIR}/libsm
diff --git a/lib/libpam/modules/modules.inc b/lib/libpam/modules/modules.inc
index c570cfd2f77c..66fc63c89dc9 100644
--- a/lib/libpam/modules/modules.inc
+++ b/lib/libpam/modules/modules.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MODULES =
MODULES += pam_chroot
diff --git a/lib/libpam/modules/pam_unix/Makefile b/lib/libpam/modules/pam_unix/Makefile
index 4d28cfd6a44b..ea9e639c3b5f 100644
--- a/lib/libpam/modules/pam_unix/Makefile
+++ b/lib/libpam/modules/pam_unix/Makefile
@@ -34,6 +34,7 @@
#
# $FreeBSD$
+.include <src.opts.mk>
.include <bsd.init.mk>
LIB= pam_unix
diff --git a/lib/libpcap/Makefile b/lib/libpcap/Makefile
index 1a3e63409bb8..8cae1f1bdc49 100644
--- a/lib/libpcap/Makefile
+++ b/lib/libpcap/Makefile
@@ -3,7 +3,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= pcap
SRCS= grammar.y tokdefs.h version.h pcap-bpf.c \
diff --git a/lib/libproc/Makefile b/lib/libproc/Makefile
index d2212961a033..930249628edc 100644
--- a/lib/libproc/Makefile
+++ b/lib/libproc/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= proc
diff --git a/lib/libproc/_libproc.h b/lib/libproc/_libproc.h
index 8099ba1d9173..ffc89cfdad83 100644
--- a/lib/libproc/_libproc.h
+++ b/lib/libproc/_libproc.h
@@ -46,6 +46,8 @@ struct proc_handle {
size_t rdobjsz;
size_t nobjs;
struct lwpstatus lwps;
+ rd_loadobj_t *rdexec; /* rdobj index of program executable. */
+ char execname[MAXPATHLEN]; /* Path to program executable. */
};
#ifdef DEBUG
diff --git a/lib/libproc/libproc.h b/lib/libproc/libproc.h
index d80e88c466a0..be77e4b59214 100644
--- a/lib/libproc/libproc.h
+++ b/lib/libproc/libproc.h
@@ -102,6 +102,7 @@ typedef struct lwpstatus {
#define PR_FAULTED 2
#define PR_SYSENTRY 3
#define PR_SYSEXIT 4
+#define PR_SIGNALLED 5
int pr_what;
#define FLTBPT -1
} lwpstatus_t;
diff --git a/lib/libproc/proc_bkpt.c b/lib/libproc/proc_bkpt.c
index 2c2761acc998..fe6ed4ab3c5d 100644
--- a/lib/libproc/proc_bkpt.c
+++ b/lib/libproc/proc_bkpt.c
@@ -55,13 +55,6 @@ __FBSDID("$FreeBSD$");
#error "Add support for your architecture"
#endif
-static void
-proc_cont(struct proc_handle *phdl)
-{
-
- ptrace(PT_CONTINUE, proc_getpid(phdl), (caddr_t)1, 0);
-}
-
static int
proc_stop(struct proc_handle *phdl)
{
@@ -87,7 +80,7 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t address,
{
struct ptrace_io_desc piod;
unsigned long paddr, caddr;
- int ret = 0;
+ int ret = 0, stopped;
*saved = 0;
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
@@ -98,9 +91,12 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t address,
DPRINTFX("adding breakpoint at 0x%lx", address);
- if (phdl->status != PS_STOP)
+ stopped = 0;
+ if (phdl->status != PS_STOP) {
if (proc_stop(phdl) != 0)
return (-1);
+ stopped = 1;
+ }
/*
* Read the original instruction.
@@ -135,9 +131,9 @@ proc_bkptset(struct proc_handle *phdl, uintptr_t address,
}
done:
- if (phdl->status != PS_STOP)
+ if (stopped)
/* Restart the process if we had to stop it. */
- proc_cont(phdl);
+ proc_continue(phdl);
return (ret);
}
@@ -148,7 +144,7 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t address,
{
struct ptrace_io_desc piod;
unsigned long paddr, caddr;
- int ret = 0;
+ int ret = 0, stopped;
if (phdl->status == PS_DEAD || phdl->status == PS_UNDEAD ||
phdl->status == PS_IDLE) {
@@ -158,9 +154,12 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t address,
DPRINTFX("removing breakpoint at 0x%lx", address);
- if (phdl->status != PS_STOP)
+ stopped = 0;
+ if (phdl->status != PS_STOP) {
if (proc_stop(phdl) != 0)
return (-1);
+ stopped = 1;
+ }
/*
* Overwrite the breakpoint instruction that we setup previously.
@@ -177,9 +176,9 @@ proc_bkptdel(struct proc_handle *phdl, uintptr_t address,
ret = -1;
}
- if (phdl->status != PS_STOP)
+ if (stopped)
/* Restart the process if we had to stop it. */
- proc_cont(phdl);
+ proc_continue(phdl);
return (ret);
}
diff --git a/lib/libproc/proc_create.c b/lib/libproc/proc_create.c
index d02eccf0d147..4a925809badf 100644
--- a/lib/libproc/proc_create.c
+++ b/lib/libproc/proc_create.c
@@ -26,8 +26,10 @@
* $FreeBSD$
*/
-#include "_libproc.h"
-#include <stdio.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/wait.h>
+
#include <err.h>
#include <errno.h>
#include <fcntl.h>
@@ -35,7 +37,37 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <sys/wait.h>
+
+#include "_libproc.h"
+
+static int proc_init(pid_t, int, int, struct proc_handle *);
+
+static int
+proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl)
+{
+ int mib[4], error;
+ size_t len;
+
+ memset(phdl, 0, sizeof(*phdl));
+ phdl->pid = pid;
+ phdl->flags = flags;
+ phdl->status = status;
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PATHNAME;
+ mib[3] = pid;
+ len = sizeof(phdl->execname);
+ if (sysctl(mib, 4, phdl->execname, &len, NULL, 0) != 0) {
+ error = errno;
+ DPRINTF("ERROR: cannot get pathname for child process %d", pid);
+ return (error);
+ }
+ if (len == 0)
+ phdl->execname[0] = '\0';
+
+ return (0);
+}
int
proc_attach(pid_t pid, int flags, struct proc_handle **pphdl)
@@ -54,12 +86,12 @@ proc_attach(pid_t pid, int flags, struct proc_handle **pphdl)
if ((phdl = malloc(sizeof(struct proc_handle))) == NULL)
return (ENOMEM);
- memset(phdl, 0, sizeof(struct proc_handle));
- phdl->pid = pid;
- phdl->flags = flags;
- phdl->status = PS_RUN;
elf_version(EV_CURRENT);
+ error = proc_init(pid, flags, PS_RUN, phdl);
+ if (error != 0)
+ goto out;
+
if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) {
error = errno;
DPRINTF("ERROR: cannot ptrace child process %d", pid);
@@ -123,9 +155,9 @@ proc_create(const char *file, char * const *argv, proc_child_func *pcf,
_exit(2);
} else {
/* The parent owns the process handle. */
- memset(phdl, 0, sizeof(struct proc_handle));
- phdl->pid = pid;
- phdl->status = PS_IDLE;
+ error = proc_init(pid, 0, PS_IDLE, phdl);
+ if (error != 0)
+ goto bad;
/* Wait for the child process to stop. */
if (waitpid(pid, &status, WUNTRACED) == -1) {
diff --git a/lib/libproc/proc_rtld.c b/lib/libproc/proc_rtld.c
index 52590493c4c2..8dff3b726615 100644
--- a/lib/libproc/proc_rtld.c
+++ b/lib/libproc/proc_rtld.c
@@ -49,6 +49,9 @@ map_iter(const rd_loadobj_t *lop, void *arg)
if (phdl->rdobjs == NULL)
return (-1);
}
+ if (strcmp(lop->rdl_path, phdl->execname) == 0 &&
+ (lop->rdl_prot & RD_RDL_X) != 0)
+ phdl->rdexec = &phdl->rdobjs[phdl->nobjs];
memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop));
return (0);
diff --git a/lib/libproc/proc_sym.c b/lib/libproc/proc_sym.c
index 2338895ffa4a..3777a46fd5e9 100644
--- a/lib/libproc/proc_sym.c
+++ b/lib/libproc/proc_sym.c
@@ -112,17 +112,23 @@ proc_obj2map(struct proc_handle *p, const char *objname)
rd_loadobj_t *rdl;
char path[MAXPATHLEN];
+ rdl = NULL;
for (i = 0; i < p->nobjs; i++) {
- rdl = &p->rdobjs[i];
- basename_r(rdl->rdl_path, path);
+ basename_r(p->rdobjs[i].rdl_path, path);
if (strcmp(path, objname) == 0) {
- if ((map = malloc(sizeof(*map))) == NULL)
- return (NULL);
- proc_rdl2prmap(rdl, map);
- return (map);
+ rdl = &p->rdobjs[i];
+ break;
}
}
- return (NULL);
+ if (rdl == NULL && strcmp(objname, "a.out") == 0 && p->rdexec != NULL)
+ rdl = p->rdexec;
+ else
+ return (NULL);
+
+ if ((map = malloc(sizeof(*map))) == NULL)
+ return (NULL);
+ proc_rdl2prmap(rdl, map);
+ return (map);
}
int
@@ -386,8 +392,9 @@ proc_name2map(struct proc_handle *p, const char *name)
free(kves);
return (NULL);
}
- if (name == NULL || strcmp(name, "a.out") == 0) {
- map = proc_addr2map(p, p->rdobjs[0].rdl_saddr);
+ if ((name == NULL || strcmp(name, "a.out") == 0) &&
+ p->rdexec != NULL) {
+ map = proc_addr2map(p, p->rdexec->rdl_saddr);
return (map);
}
for (i = 0; i < p->nobjs; i++) {
diff --git a/lib/libproc/proc_util.c b/lib/libproc/proc_util.c
index 1c3d5229c9f4..4d9aa20b3de6 100644
--- a/lib/libproc/proc_util.c
+++ b/lib/libproc/proc_util.c
@@ -35,10 +35,9 @@
#include <sys/wait.h>
#include <err.h>
#include <errno.h>
-#include <unistd.h>
-#include <stdio.h>
#include <signal.h>
#include <string.h>
+#include <unistd.h>
#include "_libproc.h"
int
@@ -59,11 +58,14 @@ proc_clearflags(struct proc_handle *phdl, int mask)
int
proc_continue(struct proc_handle *phdl)
{
+ int pending = 0;
if (phdl == NULL)
return (-1);
- if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t) 1, 0) != 0)
+ if (phdl->status == PS_STOP && WSTOPSIG(phdl->wstat) != SIGTRAP)
+ pending = WSTOPSIG(phdl->wstat);
+ if (ptrace(PT_CONTINUE, phdl->pid, (caddr_t)(uintptr_t)1, pending) != 0)
return (-1);
phdl->status = PS_RUN;
@@ -208,12 +210,16 @@ proc_getlwpstatus(struct proc_handle *phdl)
return (NULL);
siginfo = &lwpinfo.pl_siginfo;
if (lwpinfo.pl_event == PL_EVENT_SIGNAL &&
- (lwpinfo.pl_flags & PL_FLAG_SI) &&
- siginfo->si_signo == SIGTRAP &&
- (siginfo->si_code == TRAP_BRKPT ||
- siginfo->si_code == TRAP_TRACE)) {
- psp->pr_why = PR_FAULTED;
- psp->pr_what = FLTBPT;
+ (lwpinfo.pl_flags & PL_FLAG_SI) != 0) {
+ if (siginfo->si_signo == SIGTRAP &&
+ (siginfo->si_code == TRAP_BRKPT ||
+ siginfo->si_code == TRAP_TRACE)) {
+ psp->pr_why = PR_FAULTED;
+ psp->pr_what = FLTBPT;
+ } else {
+ psp->pr_why = PR_SIGNALLED;
+ psp->pr_what = siginfo->si_signo;
+ }
} else if (lwpinfo.pl_flags & PL_FLAG_SCE) {
psp->pr_why = PR_SYSENTRY;
} else if (lwpinfo.pl_flags & PL_FLAG_SCX) {
diff --git a/lib/libprocstat/Makefile b/lib/libprocstat/Makefile
index af5a775d7d05..32c7daa0b19c 100644
--- a/lib/libprocstat/Makefile
+++ b/lib/libprocstat/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= procstat
diff --git a/lib/libradius/Makefile b/lib/libradius/Makefile
index cb68eaa32b1a..2b769d9ee61d 100644
--- a/lib/libradius/Makefile
+++ b/lib/libradius/Makefile
@@ -24,7 +24,7 @@
#
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= radius
SRCS= radlib.c
diff --git a/lib/librpcsvc/Makefile b/lib/librpcsvc/Makefile
index 9c9e3ae04d53..ba972ac3e8eb 100644
--- a/lib/librpcsvc/Makefile
+++ b/lib/librpcsvc/Makefile
@@ -1,7 +1,7 @@
# from: @(#)Makefile 5.10 (Berkeley) 6/24/90
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${.CURDIR}/../../include/rpcsvc
diff --git a/lib/librtld_db/librtld_db.3 b/lib/librtld_db/librtld_db.3
index 0c9a762eb010..4645142f7311 100644
--- a/lib/librtld_db/librtld_db.3
+++ b/lib/librtld_db/librtld_db.3
@@ -48,7 +48,7 @@
.Fc
.Ft rd_err_e
.Fo rd_event_addr
-.Fa "rd_agent_t *rdap, rd_notify_t *notify"
+.Fa "rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify"
.Fc
.Ft rd_err_e
.Fo rd_event_enable
@@ -142,10 +142,10 @@ enables reporting of events.
This function always returns RD_OK.
.Pp
.Fn rd_event_addr
-returns the event address in the
+returns the event address corresponding to the
.Ft event
parameter.
-At the moment we only report RD_NOTIFY_BPT events.
+At the moment we only report events of type RD_NOTIFY_BPT.
.Pp
.Fn rd_event_getmsg
returns the message associated with the latest event.
diff --git a/lib/librtld_db/rtld_db.c b/lib/librtld_db/rtld_db.c
index fef8d46c88fe..2d1f6e697fac 100644
--- a/lib/librtld_db/rtld_db.c
+++ b/lib/librtld_db/rtld_db.c
@@ -81,20 +81,40 @@ rd_errstr(rd_err_e rderr)
}
rd_err_e
-rd_event_addr(rd_agent_t *rdap, rd_event_e event __unused, rd_notify_t *notify)
+rd_event_addr(rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify)
{
- DPRINTF("%s rdap %p notify %p\n", __func__, rdap, notify);
-
- notify->type = RD_NOTIFY_BPT;
- notify->u.bptaddr = rdap->rda_addr;
-
- return (RD_OK);
+ rd_err_e ret;
+
+ DPRINTF("%s rdap %p event %d notify %p\n", __func__, rdap, event,
+ notify);
+
+ ret = RD_OK;
+ switch (event) {
+ case RD_NONE:
+ break;
+ case RD_PREINIT:
+ notify->type = RD_NOTIFY_BPT;
+ notify->u.bptaddr = rdap->rda_preinit_addr;
+ break;
+ case RD_POSTINIT:
+ notify->type = RD_NOTIFY_BPT;
+ notify->u.bptaddr = rdap->rda_postinit_addr;
+ break;
+ case RD_DLACTIVITY:
+ notify->type = RD_NOTIFY_BPT;
+ notify->u.bptaddr = rdap->rda_dlactivity_addr;
+ break;
+ default:
+ ret = RD_ERR;
+ break;
+ }
+ return (ret);
}
rd_err_e
rd_event_enable(rd_agent_t *rdap __unused, int onoff)
{
- DPRINTF("%s onoff %d\n", __func__, onoff);
+ DPRINTF("%s onoff %d\n", __func__, onoff);
return (RD_OK);
}
@@ -220,7 +240,15 @@ rd_reset(rd_agent_t *rdap)
&sym) < 0)
return (RD_ERR);
DPRINTF("found r_debug_state at 0x%lx\n", (unsigned long)sym.st_value);
- rdap->rda_addr = sym.st_value;
+ rdap->rda_preinit_addr = sym.st_value;
+ rdap->rda_dlactivity_addr = sym.st_value;
+
+ if (proc_name2sym(rdap->rda_php, "ld-elf.so.1", "_r_debug_postinit",
+ &sym) < 0)
+ return (RD_ERR);
+ DPRINTF("found _r_debug_postinit at 0x%lx\n",
+ (unsigned long)sym.st_value);
+ rdap->rda_postinit_addr = sym.st_value;
return (RD_OK);
}
diff --git a/lib/librtld_db/rtld_db.h b/lib/librtld_db/rtld_db.h
index 33da4d3b9f38..9dd53f0095e5 100644
--- a/lib/librtld_db/rtld_db.h
+++ b/lib/librtld_db/rtld_db.h
@@ -51,7 +51,9 @@ typedef enum {
typedef struct rd_agent {
struct proc_handle *rda_php;
- uintptr_t rda_addr; /* address of r_debug_state */
+ uintptr_t rda_dlactivity_addr;
+ uintptr_t rda_preinit_addr;
+ uintptr_t rda_postinit_addr;
} rd_agent_t;
typedef struct rd_loadobj {
diff --git a/lib/libsm/Makefile b/lib/libsm/Makefile
index 07172c75ea27..b30ba42e3af2 100644
--- a/lib/libsm/Makefile
+++ b/lib/libsm/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SENDMAIL_DIR=${.CURDIR}/../../contrib/sendmail
.PATH: ${SENDMAIL_DIR}/libsm
diff --git a/lib/libsmb/Makefile b/lib/libsmb/Makefile
index e464a8fd9875..ea7327b3e94c 100644
--- a/lib/libsmb/Makefile
+++ b/lib/libsmb/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
CONTRIBDIR= ${.CURDIR}/../../contrib/smbfs
.PATH: ${CONTRIBDIR}/lib/smb
diff --git a/lib/libstand/Makefile b/lib/libstand/Makefile
index 5f645203597a..0e074d2a837e 100644
--- a/lib/libstand/Makefile
+++ b/lib/libstand/Makefile
@@ -9,7 +9,7 @@
MK_PROFILE= no
MK_SSP= no
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= stand
NO_PIC=
diff --git a/lib/libtelnet/Makefile b/lib/libtelnet/Makefile
index e98fd53db3d0..a11138e48d90 100644
--- a/lib/libtelnet/Makefile
+++ b/lib/libtelnet/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.2 (Berkeley) 12/15/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
TELNETDIR= ${.CURDIR}/../../contrib/telnet
.PATH: ${TELNETDIR}/libtelnet
diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile
index 1c70a5e71bd2..cfcc41efb997 100644
--- a/lib/libthr/Makefile
+++ b/lib/libthr/Makefile
@@ -10,7 +10,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
LIB=thr
diff --git a/lib/libulog/Makefile b/lib/libulog/Makefile
index 074d9db9f87a..efbaece8fefb 100644
--- a/lib/libulog/Makefile
+++ b/lib/libulog/Makefile
@@ -2,7 +2,7 @@
SHLIBDIR?=/lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= ulog
SHLIB_MAJOR= 0
diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile
index 582cceffba4e..5e5139ff9fa0 100644
--- a/lib/libutil/Makefile
+++ b/lib/libutil/Makefile
@@ -3,7 +3,7 @@
SHLIBDIR?= /lib
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= util
SHLIB_MAJOR= 9
diff --git a/lib/libutil/kinfo_getfile.3 b/lib/libutil/kinfo_getfile.3
index ca8c55c3242b..1e0bab70150b 100644
--- a/lib/libutil/kinfo_getfile.3
+++ b/lib/libutil/kinfo_getfile.3
@@ -48,7 +48,7 @@ field contains the process identifier.
This should be the a process that you have privilege to access.
The
.Ar cntp
-field is allows the caller to know how many records are returned.
+field allows the caller to know how many records are returned.
.Pp
This function is a wrapper around
.Xr sysctl 3
diff --git a/lib/libvmmapi/vmmapi.c b/lib/libvmmapi/vmmapi.c
index 60d3105db206..4a7f852c6ffc 100644
--- a/lib/libvmmapi/vmmapi.c
+++ b/lib/libvmmapi/vmmapi.c
@@ -343,10 +343,13 @@ vm_run(struct vmctx *ctx, int vcpu, uint64_t rip, struct vm_exit *vmexit)
}
int
-vm_suspend(struct vmctx *ctx)
+vm_suspend(struct vmctx *ctx, enum vm_suspend_how how)
{
+ struct vm_suspend vmsuspend;
- return (ioctl(ctx->fd, VM_SUSPEND, 0));
+ bzero(&vmsuspend, sizeof(vmsuspend));
+ vmsuspend.how = how;
+ return (ioctl(ctx->fd, VM_SUSPEND, &vmsuspend));
}
static int
diff --git a/lib/libvmmapi/vmmapi.h b/lib/libvmmapi/vmmapi.h
index ed63fb20259e..2a2ca6b7f9dc 100644
--- a/lib/libvmmapi/vmmapi.h
+++ b/lib/libvmmapi/vmmapi.h
@@ -61,7 +61,7 @@ int vm_set_register(struct vmctx *ctx, int vcpu, int reg, uint64_t val);
int vm_get_register(struct vmctx *ctx, int vcpu, int reg, uint64_t *retval);
int vm_run(struct vmctx *ctx, int vcpu, uint64_t rip,
struct vm_exit *ret_vmexit);
-int vm_suspend(struct vmctx *ctx);
+int vm_suspend(struct vmctx *ctx, enum vm_suspend_how how);
int vm_apicid2vcpu(struct vmctx *ctx, int apicid);
int vm_inject_exception(struct vmctx *ctx, int vcpu, int vec);
int vm_inject_exception2(struct vmctx *ctx, int vcpu, int vec, int errcode);
diff --git a/lib/libwrap/Makefile b/lib/libwrap/Makefile
index 2ae6821d7757..7c2ca9a5535e 100644
--- a/lib/libwrap/Makefile
+++ b/lib/libwrap/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
#
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= wrap
SHLIB_MAJOR= 6
diff --git a/lib/ncurses/Makefile b/lib/ncurses/Makefile
index b363f6462204..822905f44dcc 100644
--- a/lib/ncurses/Makefile
+++ b/lib/ncurses/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ncurses form menu panel
diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile
index 9cf3cc897550..3821d4635b8a 100644
--- a/lib/ncurses/ncurses/Makefile
+++ b/lib/ncurses/ncurses/Makefile
@@ -7,7 +7,7 @@ SHLIBDIR?= /lib
MK_MAN=no
.endif
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include "${.CURDIR}/../config.mk"
diff --git a/libexec/Makefile b/libexec/Makefile
index e087a8a8ffe7..8a32694d4050 100644
--- a/libexec/Makefile
+++ b/libexec/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_atf} \
${_atrun} \
diff --git a/libexec/atf/atf-check/Makefile b/libexec/atf/atf-check/Makefile
index 0cfa8636491b..093de06ed534 100644
--- a/libexec/atf/atf-check/Makefile
+++ b/libexec/atf/atf-check/Makefile
@@ -25,6 +25,7 @@
#
# $FreeBSD$
+.include <src.opts.mk>
.include <bsd.init.mk>
ATF= ${.CURDIR:H:H:H}/contrib/atf
diff --git a/libexec/ftpd/Makefile b/libexec/ftpd/Makefile
index e415407fb9e6..0c7c9826a843 100644
--- a/libexec/ftpd/Makefile
+++ b/libexec/ftpd/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.2 (Berkeley) 4/4/94
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ftpd
MAN= ftpd.8 ftpchroot.5
diff --git a/libexec/rlogind/Makefile b/libexec/rlogind/Makefile
index 9807dc8e5ba3..de0fb20e2961 100644
--- a/libexec/rlogind/Makefile
+++ b/libexec/rlogind/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/4/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= rlogind
MAN= rlogind.8
diff --git a/libexec/rtld-elf/Makefile b/libexec/rtld-elf/Makefile
index 2a0953c96dfa..21e2219d3727 100644
--- a/libexec/rtld-elf/Makefile
+++ b/libexec/rtld-elf/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG?= ld-elf.so.1
diff --git a/libexec/rtld-elf/Symbol.map b/libexec/rtld-elf/Symbol.map
index 9ad6251848bc..5ea7d7e171f6 100644
--- a/libexec/rtld-elf/Symbol.map
+++ b/libexec/rtld-elf/Symbol.map
@@ -30,4 +30,5 @@ FBSDprivate_1.0 {
_rtld_atfork_post;
_rtld_addr_phdr;
_rtld_get_stack_prot;
+ _r_debug_postinit;
};
diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c
index f96b8e7189f7..443767d99ba4 100644
--- a/libexec/rtld-elf/rtld.c
+++ b/libexec/rtld-elf/rtld.c
@@ -162,6 +162,7 @@ static bool matched_symbol(SymLook *, const Obj_Entry *, Sym_Match_Result *,
const unsigned long);
void r_debug_state(struct r_debug *, struct link_map *) __noinline;
+void _r_debug_postinit(struct link_map *) __noinline;
/*
* Data declarations.
@@ -637,6 +638,7 @@ _rtld(Elf_Addr *sp, func_ptr_type *exit_proc, Obj_Entry **objp)
if (obj_main->crt_no_init)
preinit_main();
objlist_call_init(&initlist, &lockstate);
+ _r_debug_postinit(&obj_main->linkmap);
objlist_clear(&initlist);
dbg("loading filtees");
for (obj = obj_list->next; obj != NULL; obj = obj->next) {
@@ -3549,7 +3551,20 @@ r_debug_state(struct r_debug* rd, struct link_map *m)
* even when marked __noinline. However, gdb depends on those
* calls being made.
*/
- __asm __volatile("" : : : "memory");
+ __compiler_membar();
+}
+
+/*
+ * A function called after init routines have completed. This can be used to
+ * break before a program's entry routine is called, and can be used when
+ * main is not available in the symbol table.
+ */
+void
+_r_debug_postinit(struct link_map *m)
+{
+
+ /* See r_debug_state(). */
+ __compiler_membar();
}
/*
diff --git a/libexec/tcpd/Makefile b/libexec/tcpd/Makefile
index e707a4e334e8..f3fbf29b5d5f 100644
--- a/libexec/tcpd/Makefile
+++ b/libexec/tcpd/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${.CURDIR}/../../contrib/tcp_wrappers
diff --git a/libexec/telnetd/Makefile b/libexec/telnetd/Makefile
index dcc339878e14..99f023f263f2 100644
--- a/libexec/telnetd/Makefile
+++ b/libexec/telnetd/Makefile
@@ -3,7 +3,7 @@
# Do not define -DKLUDGELINEMODE, as it does not interact well with many
# telnet implementations.
-.include <bsd.own.mk>
+.include <src.opts.mk>
TELNETDIR= ${.CURDIR}/../../contrib/telnet
.PATH: ${TELNETDIR}/telnetd
diff --git a/release/doc/en_US.ISO8859-1/hardware/article.xml b/release/doc/en_US.ISO8859-1/hardware/article.xml
index 381416d1b850..6255d97ad5e7 100644
--- a/release/doc/en_US.ISO8859-1/hardware/article.xml
+++ b/release/doc/en_US.ISO8859-1/hardware/article.xml
@@ -29,6 +29,7 @@
<year>2011</year>
<year>2012</year>
<year>2013</year>
+ <year>2014</year>
<holder role="mailto:doc@FreeBSD.org">The &os; Documentation Project</holder>
</copyright>
@@ -732,10 +733,14 @@
&hwlist.mly;
+ &hwlist.mpr;
+
&hwlist.mps;
&hwlist.mpt;
+ &hwlist.mrsas;
+
&hwlist.mvs;
&hwlist.ncr;
@@ -818,6 +823,9 @@
&hwlist.axe;
+ <para>ASIX Electronics AX88178A/AX88179 USB Gigabit Ethernet
+ adapters (&man.axge.4; driver)</para>
+
&hwlist.bce;
<para>[&arch.amd64;, &arch.i386;] Broadcom BCM4401 based Fast
@@ -1009,6 +1017,8 @@
&hwlist.ral;
+ &hwlist.rsu;
+
&hwlist.rum;
&hwlist.run;
@@ -1021,6 +1031,8 @@
&hwlist.urtw;
+ &hwlist.urtwn;
+
<para>[&arch.amd64;, &arch.i386;, &arch.pc98;] Lucent
Technologies WaveLAN/IEEE 802.11b wireless network adapters
and workalikes using the Lucent Hermes, Intersil PRISM-II,
diff --git a/release/doc/en_US.ISO8859-1/relnotes/article.xml b/release/doc/en_US.ISO8859-1/relnotes/article.xml
index be2466d5155e..b987fed58afd 100644
--- a/release/doc/en_US.ISO8859-1/relnotes/article.xml
+++ b/release/doc/en_US.ISO8859-1/relnotes/article.xml
@@ -3,6 +3,10 @@
"../../../share/xml/freebsd50.dtd" [
<!ENTITY % release PUBLIC "-//FreeBSD//ENTITIES Release Specification//EN" "release.ent">
%release;
+<!ENTITY % sponsor PUBLIC "-//FreeBSD//ENTITIES Sponsor Specification//EN" "sponsor.ent">
+ %sponsor;
+<!ENTITY % vendor PUBLIC "-//FreeBSD//ENTITIES Vendor Specification//EN" "vendor.ent">
+ %vendor;
]>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0">
<info><title>&os; &release.current; Release Notes</title>
@@ -104,28 +108,63 @@
<sect2 xml:id="kernel">
<title>Kernel Changes</title>
- <para revision="263754">The &man.sysctl.8;
- <literal>hw.bus.devctl_disable</literal> has been
- removed.</para>
+ <para revision="260888">The <filename>VT</filename> kernel
+ configuration file has been added, which enables the new
+ <literal>vt</literal> console driver.</para>
<para revision="260903">Support for GPS ports has been added to
&man.uhso.4;.</para>
- <para revision="260888">The <filename>VT</filename> kernel
- configuration file has been added, which enables the new
- <literal>vt</literal> console driver.</para>
+ <para revision="264601" contrib="sponsor"
+ sponsor="&darpa_afrl;">The <literal>if_nf10bmac(4)</literal>
+ device has been added, providing support for NetFPGA-10G
+ Embedded CPU Ethernet Core.</para>
+
+ <note>
+ <para>The <literal>if_nf10bmac(4)</literal> driver operates on
+ the FPGA, and is not suited for the PCI host interface.</para>
+ </note>
+
+ <para revision="265132">The &man.full.4; device has been added,
+ and the <literal>lindev(4)</literal> device has been removed.
+ Prior to this change, <literal>lindev(4)</literal> provided only
+ the <filename>/dev/full</filename> character device, returning
+ <literal>ENOSPC</literal> on write attempts. As this device is
+ not specific to &linux;, a native &os; version has been
+ added.</para>
+
+ <para revision="265236" contrib="sponsor"
+ sponsor="&lsi;, &spectralogic;" sponsorurl="">The &man.mpr.4;
+ device has been added, providing support for LSI Fusion-MPT
+ 3 12Gb SCSI/SATA controllers.</para>
+
+ <para revision="265555" contrib="sponsor"
+ sponsor="&lsi;">The &man.mrsas.4; driver has been added,
+ providing support for LSI MegaRAID SAS controllers. The
+ &man.mfi.4; driver will attach to the controller, by default.
+ To enable &man.mrsas.4; add
+ <literal>hw.mfi.mrsas_enable=1</literal> to
+ <filename>/boot/loader.conf</filename>, which turns off
+ &man.mfi.4; device probing.</para>
+
+ <note>
+ <para>At this time, the &man.mfiutil.8; utility and
+ the &os; version of
+ <application>MegaCLI</application> and
+ <application>StorCli</application> do not work with
+ &man.mrsas.4;.</para>
+ </note>
<sect3 xml:id="kernel-virtualization">
<title>Virtualization support</title>
- <para revision="260847">The &man.virtio_random.4; driver has
- been added to harvest entropy from the host system.</para>
-
- <para revision="260583">Unmapped IO support has been added to
- &man.virtio_scsi.4;.</para>
-
- <para revision="260582">Unmapped IO support has been added to
- &man.virtio_blk.4;.</para>
+ <para revision="260410">Support for the <quote>Virtual Interrupt
+ Delivery</quote> feature of &intel;&nbsp;VT-x is enabled if
+ supported by the CPU. This feature can be disabled by running
+ <literal>sysctl hw.vmm.vmx.use_apic_vid=0</literal>.
+ Additionally, to persist this setting across reboots, add
+ <literal>hw.vmm.vmx.use_apic_vid=0</literal> to
+ <filename>/etc/sysctl.conf</filename>.</para>
<para revision="260532">Support for <quote>Posted Interrupt
Processing</quote> is enabled if supported by the CPU. This
@@ -135,13 +174,14 @@
<literal>hw.vmm.vmx.use_apic_pir=0</literal> to
<filename>/etc/sysctl.conf</filename>.</para>
- <para revision="260410">Support for the <quote>Virtual Interrupt
- Delivery</quote> feature of &intel;&nbsp;VT-x is enabled if
- supported by the CPU. This feature can be disabled by running
- <literal>sysctl hw.vmm.vmx.use_apic_vid=0</literal>.
- Additionally, to persist this setting across reboots, add
- <literal>hw.vmm.vmx.use_apic_vid=0</literal> to
- <filename>/etc/sysctl.conf</filename>.</para>
+ <para revision="260582">Unmapped IO support has been added to
+ &man.virtio_blk.4;.</para>
+
+ <para revision="260583">Unmapped IO support has been added to
+ &man.virtio_scsi.4;.</para>
+
+ <para revision="260847">The &man.virtio_random.4; driver has
+ been added to harvest entropy from the host system.</para>
</sect3>
<sect3 xml:id="kernel-arm">
@@ -169,22 +209,26 @@
<sect4 xml:id="net-if">
<title>Network Interface Support</title>
- <para revision="260552">Firmware for &intel;
- Centrino&trade; Wireless-N 105 devices has been added
- to the base system.</para>
+ <para revision="258830">Support for Broadcom chipsets
+ BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787 has
+ been added to &man.bge.4;.</para>
<para revision="260448">Support for the &intel;
Centrino&trade; Wireless-N 135 chipset has been
added.</para>
- <para revision="258830">Support for Broadcom chipsets
- BCM57764, BCM57767, BCM57782, BCM57786 and BCM57787 has
- been added to &man.bge.4;.</para>
+ <para revision="260552">Firmware for &intel;
+ Centrino&trade; Wireless-N 105 devices has been added
+ to the base system.</para>
<para revision="261975">The deprecated nve(4) driver has been
removed. Users of NVIDIA nForce MCP network adapters are
advised to use the &man.nfe.4; driver instead, which has been
the default driver for this hardware since &os; 7.0.</para>
+
+ <para revision="265348" contrib="sponsor"
+ sponsor="&netgate;">The &man.ath.hal.4; driver has been
+ updated to support the Atheros AR1111 chipset.</para>
</sect4>
</sect3>
@@ -218,14 +262,15 @@
<sect2 xml:id="userland">
<title>Userland Changes</title>
- <para revision="260926">Support for displaying VPD for PCI devices
- via &man.pciconf.8; has been added.</para>
+ <para revision="258838" contrib="sponsor" sponsor="&ff;, &google;"
+ sponsorurl="">The &man.casperd.8; daemon has been added,
+ which provides access to functionality that is not available in
+ the <quote>capability mode</quote> sandbox.</para>
- <para revision="260913">A new flag, <quote>onifconsole</quote> has
- been added to <filename>/etc/ttys</filename>. This allows the
- system to provide a login prompt via serial console if the
- device is an active kernel console, otherwise it is equivalent
- to <literal>off</literal>.</para>
+ <para revision="260594">When unable to load a kernel module with
+ &man.kldload.8;, a message informing to view output of
+ &man.dmesg.8; is now printed, opposed to the previous output
+ <quote>Exec format error.</quote>.</para>
<para revision="260910">Allow &man.pciconf.8; to identify PCI
devices that are attached to a driver to be identified by their
@@ -234,14 +279,14 @@
to restrict the output to only listing details about a single
device.</para>
- <para revision="260594">When unable to load a kernel module with
- &man.kldload.8;, a message informing to view output of
- &man.dmesg.8; is now printed, opposed to the previous output
- <quote>Exec format error.</quote>.</para>
+ <para revision="260913">A new flag, <quote>onifconsole</quote> has
+ been added to <filename>/etc/ttys</filename>. This allows the
+ system to provide a login prompt via serial console if the
+ device is an active kernel console, otherwise it is equivalent
+ to <literal>off</literal>.</para>
- <para revision="258838">The &man.casperd.8; daemon has been added,
- which provides access to functionality that is not available in
- the <quote>capability mode</quote> sandbox.</para>
+ <para revision="260926">Support for displaying VPD for PCI devices
+ via &man.pciconf.8; has been added.</para>
<para revision="261498">&man.ping.8; protects against malicious
network packets using the Capsicum framework to drop
@@ -250,6 +295,17 @@
<para revision="261504">&os;/&arch.i386; guests can be run under
bhyve.</para>
+ <para revision="265229">The &man.ps.1; utility has been
+ updated to include the <literal>-J</literal> flag, used to
+ filter output by matching &man.jail.8; IDs and names.
+ Additionally, argument <literal>0</literal> can be used to
+ <literal>-J</literal> to only list processes running on the
+ host system.</para>
+
+ <para revision="265249">The &man.top.1; utility has been updated
+ to filter by &man.jail.8; ID or name, in followup to the
+ &man.ps.1; change in <literal>r265229</literal>.</para>
+
<sect3 xml:id="rc-scripts">
<title><filename>/etc/rc.d</filename> Scripts</title>
@@ -260,14 +316,15 @@
<sect2 xml:id="contrib">
<title>Contributed Software</title>
- <para revision="260445">&man.byacc.1; has been updated to version
- 20140101.</para>
+ <para revision="258884" contrib="sponsor"
+ sponsor="&darpa_afrl;">&man.lldb.1; has been updated to upstream
+ snapshot version r196259.</para>
<para revision="259626">Timezone data files have been updated to
version 2013i.</para>
- <para revision="258884">&man.lldb.1; has been updated to upstream
- snapshot version r196259.</para>
+ <para revision="260445">&man.byacc.1; has been updated to version
+ 20140101.</para>
<para revision="261037"><application>OpenSSL</application> has
been updated to version 1.0.1.f.</para>
@@ -275,11 +332,8 @@
<para revision="261071">&man.jemalloc.3; has been updated to
version 3.5.0.</para>
- <para role="merged"><application>sendmail</application> has been
- updated from 8.14.7 to 8.14.8.</para>
-
- <para revision="261320"><application>OpenSSH</application> has
- been updated to 6.5p1.</para>
+ <para revision="261197" role="merged"><application>Sendmail</application>
+ has been updated from 8.14.7 to 8.14.8.</para>
<para revision="261212"><application>bmake</application> has been
updated to version 20140101.</para>
@@ -287,6 +341,9 @@
<para revision="261283"><application>libc++</application> has been
updated to version 3.4.</para>
+ <para revision="261320"><application>OpenSSH</application> has
+ been updated to 6.5p1.</para>
+
<para revision="261344"><application>mdocml</application> has been
updated to version 1.12.3.</para>
diff --git a/release/doc/share/misc/dev.archlist.txt b/release/doc/share/misc/dev.archlist.txt
index 009fb95d1f38..ad7a6afa4ba0 100644
--- a/release/doc/share/misc/dev.archlist.txt
+++ b/release/doc/share/misc/dev.archlist.txt
@@ -108,6 +108,7 @@ qlxgbe amd64
qlxge amd64
rc i386
ral i386,amd64
+rsu i386,amd64
rue i386,pc98,amd64
rum i386,amd64
run i386,amd64
diff --git a/release/doc/share/xml/catalog.xml b/release/doc/share/xml/catalog.xml
index c4e04b6ae295..74f8ccd068ff 100644
--- a/release/doc/share/xml/catalog.xml
+++ b/release/doc/share/xml/catalog.xml
@@ -7,5 +7,7 @@
rewritePrefix="../../"/>
<public publicId="-//FreeBSD//ENTITIES Release Specification//EN" uri="release.ent"/>
+ <public publicId="-//FreeBSD//ENTITIES Sponsor Specification//EN" uri="sponsor.ent"/>
+ <public publicId="-//FreeBSD//ENTITIES Vendor Specification//EN" uri="vendor.ent"/>
<public publicId="-//FreeBSD//ENTITIES Auto Generated Device Lists//EN" uri="dev-auto.ent"/>
</catalog>
diff --git a/release/doc/share/xml/release.xsl b/release/doc/share/xml/release.xsl
index 787cb28284f9..d3616a0c2beb 100644
--- a/release/doc/share/xml/release.xsl
+++ b/release/doc/share/xml/release.xsl
@@ -43,6 +43,51 @@
<xsl:value-of select="concat('[r', @revision, ']')"/>
</xsl:element>
</xsl:if>
+ <xsl:if test="@contrib">
+ <xsl:element name="span">
+ <xsl:attribute name="class">
+ <xsl:value-of select="'contrib'"/>
+ </xsl:attribute>
+ <xsl:choose>
+ <xsl:when test="@contrib = 'sponsor'">
+ <xsl:if test="@sponsor != ''">
+ (Sponsored by
+ <xsl:choose>
+ <xsl:when test="@sponsorurl != ''">
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@sponsorurl"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat(@sponsor, ')')"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(@sponsor, ')')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ <xsl:when test="@contrib = 'vendor'">
+ <xsl:if test="@vendor != ''">
+ (Contributed / provided by
+ <xsl:choose>
+ <xsl:when test="@vendorurl != ''">
+ <xsl:element name="a">
+ <xsl:attribute name="href">
+ <xsl:value-of select="@vendorurl"/>
+ </xsl:attribute>
+ <xsl:value-of select="concat(@vendor, ')')"/>
+ </xsl:element>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="concat(@vendor, ')')"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:element>
+ </xsl:if>
</p>
</xsl:variable>
diff --git a/release/doc/share/xml/sponsor.ent b/release/doc/share/xml/sponsor.ent
new file mode 100644
index 000000000000..6e01090d3435
--- /dev/null
+++ b/release/doc/share/xml/sponsor.ent
@@ -0,0 +1,25 @@
+<!-- -*- sgml -*-
+
+ $FreeBSD$
+
+ Sponsors of various works.
+
+ Please keep the entity list sorted alphabetically.
+
+-->
+
+<!ENTITY afrl "AFRL">
+
+<!ENTITY darpa "DARPA">
+<!ENTITY darpa_afrl "DARPA, AFRL">
+
+<!ENTITY ff "The&nbsp;&os;&nbsp;Foundation">
+<!ENTITY ff.url "https://www.FreeBSDFoundation.org/">
+
+<!ENTITY google "Google, Inc.">
+
+<!ENTITY lsi "LSI">
+
+<!ENTITY netgate "Netgate">
+
+<!ENTITY spectralogic "Spectra Logic">
diff --git a/release/doc/share/xml/vendor.ent b/release/doc/share/xml/vendor.ent
new file mode 100644
index 000000000000..75c879b71c82
--- /dev/null
+++ b/release/doc/share/xml/vendor.ent
@@ -0,0 +1,9 @@
+<!-- -*- sgml -*-
+
+ $FreeBSD$
+
+ Vendors and contributors.
+
+ Please keep the entity list sorted alphabetically.
+
+-->
diff --git a/release/picobsd/tinyware/login/Makefile b/release/picobsd/tinyware/login/Makefile
index a86fff46a933..0a39c756ad18 100644
--- a/release/picobsd/tinyware/login/Makefile
+++ b/release/picobsd/tinyware/login/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 7/19/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${.CURDIR}/../../../../usr.bin/login
diff --git a/release/powerpc/make-memstick.sh b/release/powerpc/make-memstick.sh
index 2277af072fce..4f6b69d47397 100755
--- a/release/powerpc/make-memstick.sh
+++ b/release/powerpc/make-memstick.sh
@@ -41,38 +41,7 @@ if [ $? -ne 0 ]; then
fi
rm ${1}/etc/fstab
-#
-# Use $BLOCKSIZE for transfers to improve efficiency. When calculating
-# how many blocks to transfer "+ 2" is to account for truncation in the
-# division and to provide space for the label.
-#
-
-filesize=`stat -f "%z" ${tempfile}`
-blocks=$(($filesize / ${BLOCKSIZE} + 1728))
-dd if=/dev/zero of=${2} bs=${BLOCKSIZE} count=${blocks}
-if [ $? -ne 0 ]; then
- echo "creation of image file failed"
- exit 1
-fi
-
-unit=`mdconfig -a -t vnode -f ${2}`
-if [ $? -ne 0 ]; then
- echo "mdconfig failed"
- exit 1
-fi
-
-gpart create -s APM ${unit}
-gpart add -t freebsd-boot -s 800K ${unit}
-gpart bootcode -p ${1}/boot/boot1.hfs -i 1 ${unit}
-gpart add -t freebsd-ufs -l FreeBSD_Install ${unit}
-
-dd if=${tempfile} of=/dev/${unit}s3 bs=$BLOCKSIZE conv=sync
-if [ $? -ne 0 ]; then
- echo "copying filesystem into image file failed"
- exit 1
-fi
-
-mdconfig -d -u ${unit}
+mkimg -s apm -p freebsd-boot:=${1}/boot/boot1.hfs -p freebsd-ufs/FreeBSD_Install:=${tempfile} -o ${2}
rm -f ${tempfile}
diff --git a/release/scripts/relnotes-search.sh b/release/scripts/relnotes-search.sh
new file mode 100755
index 000000000000..a9a931a84c10
--- /dev/null
+++ b/release/scripts/relnotes-search.sh
@@ -0,0 +1,133 @@
+#!/bin/sh
+#-
+# Copyright (c) 2014 The FreeBSD Foundation
+# All rights reserved.
+#
+# This software were developed by Glen Barber
+# under sponsorship from the FreeBSD Foundation.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+# SUCH DAMAGE.
+#
+# $FreeBSD$
+#
+
+set -C
+
+PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
+export PATH
+
+usage() {
+ echo "Usage:"
+ echo -n "$(basename ${0}) [-rNNNNNN]"
+ echo " [-l /path/for/output] /path/to/branch"
+ echo " -r: The oldest commit to include in the search"
+ echo ""
+ exit 1
+}
+
+main() {
+ while getopts "l:r:" arg ; do
+ case ${arg} in
+ l)
+ # Disallow '-rNNNNNN' argument for oldest
+ # revision # from becoming the log file
+ # accidentally.
+ where="${OPTARG##-r*}"
+ [ -z "${where}" ] && usage
+ if [ -e "${where}" ]; then
+ echo "Log file already exists:"
+ echo " (${where})"
+ return 2
+ fi
+ ;;
+ r)
+ rev="${OPTARG##-r}"
+ c=$(echo -n ${rev} | tr -d '0-9' | wc -c)
+ if [ ${c} -ne 0 ]; then
+ echo "Revision number must be numeric."
+ return 2
+ fi
+ # Since the last specified revision is
+ # specified, mangle the variable to
+ # make svn syntax happy.
+ rev="-r${rev}:rHEAD"
+ ;;
+ *)
+ usage
+ ;;
+ esac
+ done
+ shift $(( ${OPTIND} - 1 ))
+
+ # This assumes a local working copy, which svn search
+ # allows exactly one repository path (although the root
+ # can still be the path).
+ [ "$#" -ne 1 ] && usage
+
+ # If no log file, write to stdout.
+ [ -z "${where}" ] && where=/dev/stdout
+
+ svn=
+ # Where is svn?
+ for s in /usr/bin /usr/local/bin; do
+ if [ -x ${s}/svn ]; then
+ svn=${s}/svn
+ break
+ fi
+ if [ -x ${s}/svnlite ]; then
+ svn=${s}/svnlite
+ break
+ fi
+ done
+ # Did we find svn?
+ if [ -z "${svn}" ]; then
+ echo "svn(1) binary not found."
+ return 2
+ fi
+ # Is more than one path specified? (This should never
+ # be triggered, because the argument count is checked
+ # above, but better safe than sorry.)
+ if [ $# -gt 1 ]; then
+ echo "Cannot specify more than one working path."
+ return 2
+ fi
+ # Does the directory exist?
+ if [ ! -d "${1}" ]; then
+ echo "Specified path (${1}) is not a directory."
+ return 2
+ fi
+ # Is it a subversion repository checkout?
+ ${svn} info ${1} >/dev/null 2>&1
+ if [ "$?" -ne 0 ]; then
+ echo "Cannot determine svn repository information for ${1}"
+ return 2
+ fi
+
+ # All tests passed. Let's see what can possibly go wrong
+ # from here. The search string specified should match this
+ # in PCRE speak: ':[\t ]*'
+ ${svn} log ${rev} --search 'Relnotes:?[^ ]*' ${1} > ${where}
+ return $?
+}
+
+main "${@}"
+exit $?
diff --git a/rescue/librescue/Makefile b/rescue/librescue/Makefile
index 62f5da1ba292..ad4931e52c66 100644
--- a/rescue/librescue/Makefile
+++ b/rescue/librescue/Makefile
@@ -2,7 +2,7 @@
# $FreeBSD$
#
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
# Certain library entries have hard-coded references to
diff --git a/rescue/rescue/Makefile b/rescue/rescue/Makefile
index ea0d1370d80c..fc778f0aa280 100644
--- a/rescue/rescue/Makefile
+++ b/rescue/rescue/Makefile
@@ -3,7 +3,7 @@
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG= rescue
@@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin
CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo \
ed expr getfacl hostname kenv kill ln ls mkdir mv \
pkill ps pwd realpath rm rmdir setfacl sh stty sync test
-CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil
+CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil
CRUNCH_BUILDTOOLS+= bin/sh
# Additional options for specific programs
@@ -120,7 +120,7 @@ CRUNCH_PROGS_sbin+= zpool
CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec
.if ${MK_ZFS} != "no"
-CRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
+CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem
.endif
CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz
diff --git a/sbin/Makefile b/sbin/Makefile
index 154815514349..3725270c4c3f 100644
--- a/sbin/Makefile
+++ b/sbin/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.5 (Berkeley) 3/31/94
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# XXX MISSING: icheck ncheck
diff --git a/sbin/Makefile.inc b/sbin/Makefile.inc
index e506f9c56cee..896c64c82c13 100644
--- a/sbin/Makefile.inc
+++ b/sbin/Makefile.inc
@@ -1,7 +1,7 @@
# @(#)Makefile.inc 8.1 (Berkeley) 6/8/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
BINDIR?= /sbin
WARNS?= 6
diff --git a/sbin/atm/atmconfig/Makefile b/sbin/atm/atmconfig/Makefile
index b2857c972d60..3e42d3ff87b5 100644
--- a/sbin/atm/atmconfig/Makefile
+++ b/sbin/atm/atmconfig/Makefile
@@ -5,7 +5,7 @@
#
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= atmconfig
.ifndef RESCUE
diff --git a/sbin/dhclient/Makefile b/sbin/dhclient/Makefile
index 57c92118d131..09f19db0747e 100644
--- a/sbin/dhclient/Makefile
+++ b/sbin/dhclient/Makefile
@@ -31,7 +31,7 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
#
-.include <bsd.own.mk>
+.include <src.opts.mk>
SRCS= dhclient.c clparse.c alloc.c dispatch.c hash.c bpf.c options.c \
tree.c conflex.c errwarn.c inet.c packet.c convert.c tables.c \
diff --git a/sbin/geom/class/Makefile b/sbin/geom/class/Makefile
index 912561fbc52f..a7ed1b9450e5 100644
--- a/sbin/geom/class/Makefile
+++ b/sbin/geom/class/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= cache
SUBDIR+=concat
diff --git a/sbin/ggate/Makefile b/sbin/ggate/Makefile
index 8f889f1837eb..b46335991671 100644
--- a/sbin/ggate/Makefile
+++ b/sbin/ggate/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_ggatec} \
${_ggated} \
diff --git a/sbin/growfs/Makefile b/sbin/growfs/Makefile
index 58ce41df6310..025771fa0370 100644
--- a/sbin/growfs/Makefile
+++ b/sbin/growfs/Makefile
@@ -6,7 +6,7 @@
#GFSDBG=
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${.CURDIR}/../mount
diff --git a/sbin/gvinum/gvinum.8 b/sbin/gvinum/gvinum.8
index d1d10d7214dd..703a81056f70 100644
--- a/sbin/gvinum/gvinum.8
+++ b/sbin/gvinum/gvinum.8
@@ -28,7 +28,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 1, 2013
+.Dd May 6, 2014
.Dt GVINUM 8
.Os
.Sh NAME
@@ -168,7 +168,7 @@ the beginning of the plex if the
.Fl f
flag is specified, or otherwise at the location of the parity check pointer.
All subdisks in the plex must be up for a parity check.
-.It Ic resetconfig
+.It Ic resetconfig Oo Fl f Oc
Reset the complete
.Nm
configuration.
diff --git a/sbin/gvinum/gvinum.c b/sbin/gvinum/gvinum.c
index 5760d2b8bb28..4feaa811f2d8 100644
--- a/sbin/gvinum/gvinum.c
+++ b/sbin/gvinum/gvinum.c
@@ -58,35 +58,36 @@
#include "gvinum.h"
-void gvinum_attach(int, char **);
-void gvinum_concat(int, char **);
-void gvinum_create(int, char **);
-void gvinum_detach(int, char **);
-void gvinum_grow(int, char **);
-void gvinum_help(void);
-void gvinum_list(int, char **);
-void gvinum_move(int, char **);
-void gvinum_mirror(int, char **);
-void gvinum_parityop(int, char **, int);
-void gvinum_printconfig(int, char **);
-void gvinum_raid5(int, char **);
-void gvinum_rename(int, char **);
-void gvinum_resetconfig(void);
-void gvinum_rm(int, char **);
-void gvinum_saveconfig(void);
-void gvinum_setstate(int, char **);
-void gvinum_start(int, char **);
-void gvinum_stop(int, char **);
-void gvinum_stripe(int, char **);
-void parseline(int, char **);
-void printconfig(FILE *, char *);
-
-char *create_drive(char *);
-void create_volume(int, char **, char *);
-char *find_name(const char *, int, int);
-char *find_pattern(char *, char *);
-void copy_device(struct gv_drive *, const char *);
-#define find_drive() find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME)
+static void gvinum_attach(int, char * const *);
+static void gvinum_concat(int, char * const *);
+static void gvinum_create(int, char * const *);
+static void gvinum_detach(int, char * const *);
+static void gvinum_grow(int, char * const *);
+static void gvinum_help(void);
+static void gvinum_list(int, char * const *);
+static void gvinum_move(int, char * const *);
+static void gvinum_mirror(int, char * const *);
+static void gvinum_parityop(int, char * const * , int);
+static void gvinum_printconfig(int, char * const *);
+static void gvinum_raid5(int, char * const *);
+static void gvinum_rename(int, char * const *);
+static void gvinum_resetconfig(int, char * const *);
+static void gvinum_rm(int, char * const *);
+static void gvinum_saveconfig(void);
+static void gvinum_setstate(int, char * const *);
+static void gvinum_start(int, char * const *);
+static void gvinum_stop(int, char * const *);
+static void gvinum_stripe(int, char * const *);
+static void parseline(int, char * const *);
+static void printconfig(FILE *, const char *);
+
+static char *create_drive(const char *);
+static void create_volume(int, char * const * , const char *);
+static char *find_name(const char *, int, int);
+static const char *find_pattern(char *, const char *);
+static void copy_device(struct gv_drive *, const char *);
+#define find_drive() \
+ find_name("gvinumdrive", GV_TYPE_DRIVE, GV_MAXDRIVENAME)
int
main(int argc, char **argv)
@@ -95,8 +96,10 @@ main(int argc, char **argv)
char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS];
/* Load the module if necessary. */
- if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0)
- err(1, GVINUMMOD ": Kernel module not available");
+ if (modfind(GVINUMMOD) < 0) {
+ if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0)
+ err(1, GVINUMKLD ": Kernel module not available");
+ }
/* Arguments given on the command line. */
if (argc > 1) {
@@ -130,8 +133,8 @@ main(int argc, char **argv)
}
/* Attach a plex to a volume or a subdisk to a plex. */
-void
-gvinum_attach(int argc, char **argv)
+static void
+gvinum_attach(int argc, char * const *argv)
{
struct gctl_req *req;
const char *errstr;
@@ -167,8 +170,8 @@ gvinum_attach(int argc, char **argv)
gctl_free(req);
}
-void
-gvinum_create(int argc, char **argv)
+static void
+gvinum_create(int argc, char * const *argv)
{
struct gctl_req *req;
struct gv_drive *d;
@@ -191,8 +194,8 @@ gvinum_create(int argc, char **argv)
flags |= GV_FLAG_F;
/* Else it must be a file. */
} else {
- if ((tmp = fopen(argv[1], "r")) == NULL) {
- warn("can't open '%s' for reading", argv[1]);
+ if ((tmp = fopen(argv[i], "r")) == NULL) {
+ warn("can't open '%s' for reading", argv[i]);
return;
}
}
@@ -400,8 +403,8 @@ gvinum_create(int argc, char **argv)
}
/* Create a concatenated volume. */
-void
-gvinum_concat(int argc, char **argv)
+static void
+gvinum_concat(int argc, char * const *argv)
{
if (argc < 2) {
@@ -411,10 +414,9 @@ gvinum_concat(int argc, char **argv)
create_volume(argc, argv, "concat");
}
-
/* Create a drive quick and dirty. */
-char *
-create_drive(char *device)
+static char *
+create_drive(const char *device)
{
struct gv_drive *d;
struct gctl_req *req;
@@ -477,12 +479,12 @@ create_drive(char *device)
return (drivename);
}
-/*
+/*
* General routine for creating a volume. Mainly for use by concat, mirror,
* raid5 and stripe commands.
*/
-void
-create_volume(int argc, char **argv, char *verb)
+static void
+create_volume(int argc, char * const *argv, const char *verb)
{
struct gctl_req *req;
const char *errstr;
@@ -516,7 +518,7 @@ create_volume(int argc, char **argv, char *verb)
snprintf(buf, sizeof(buf), "drive%d", drives++);
/* First we create the drive. */
- drivename = create_drive(argv[i]);
+ drivename = create_drive(argv[i]);
if (drivename == NULL)
goto bad;
/* Then we add it to the request. */
@@ -532,7 +534,7 @@ create_volume(int argc, char **argv, char *verb)
/* Then we send a request to actually create the volumes. */
gctl_ro_param(req, "verb", -1, verb);
- gctl_ro_param(req, "flags", sizeof(int), &flags);
+ gctl_ro_param(req, "flags", sizeof(int), &flags);
gctl_ro_param(req, "drives", sizeof(int), &drives);
gctl_ro_param(req, "name", -1, volname);
errstr = gctl_issue(req);
@@ -543,8 +545,8 @@ bad:
}
/* Parse a line of the config, return the word after <pattern>. */
-char *
-find_pattern(char *line, char *pattern)
+static const char *
+find_pattern(char *line, const char *pattern)
{
char *ptr;
@@ -561,12 +563,12 @@ find_pattern(char *line, char *pattern)
}
/* Find a free name for an object given a prefix. */
-char *
+static char *
find_name(const char *prefix, int type, int namelen)
{
struct gctl_req *req;
- char comment[1], buf[GV_CFG_LEN - 1], *name, *sname, *ptr;
- const char *errstr;
+ char comment[1], buf[GV_CFG_LEN - 1], *sname, *ptr;
+ const char *errstr, *name;
int i, n, begin, len, conflict;
char line[1024];
@@ -631,9 +633,10 @@ find_name(const char *prefix, int type, int namelen)
return (NULL);
}
-void
+static void
copy_device(struct gv_drive *d, const char *device)
{
+
if (strncmp(device, "/dev/", 5) == 0)
strlcpy(d->device, (device + 5), sizeof(d->device));
else
@@ -641,8 +644,8 @@ copy_device(struct gv_drive *d, const char *device)
}
/* Detach a plex or subdisk from its parent. */
-void
-gvinum_detach(int argc, char **argv)
+static void
+gvinum_detach(int argc, char * const *argv)
{
const char *errstr;
struct gctl_req *req;
@@ -652,7 +655,7 @@ gvinum_detach(int argc, char **argv)
optreset = 1;
optind = 1;
while ((i = getopt(argc, argv, "f")) != -1) {
- switch(i) {
+ switch (i) {
case 'f':
flags |= GV_FLAG_F;
break;
@@ -680,9 +683,10 @@ gvinum_detach(int argc, char **argv)
gctl_free(req);
}
-void
+static void
gvinum_help(void)
{
+
printf("COMMANDS\n"
"checkparity [-f] plex\n"
" Check the parity blocks of a RAID-5 plex.\n"
@@ -721,7 +725,7 @@ gvinum_help(void)
" Change the name of the specified object.\n"
"rebuildparity plex [-f]\n"
" Rebuild the parity blocks of a RAID-5 plex.\n"
- "resetconfig\n"
+ "resetconfig [-f]\n"
" Reset the complete gvinum configuration\n"
"rm [-r] [-f] volume | plex | subdisk | drive\n"
" Remove an object.\n"
@@ -737,12 +741,10 @@ gvinum_help(void)
"stripe [-fv] [-n name] drives\n"
" Create a striped volume from the specified drives.\n"
);
-
- return;
}
-void
-gvinum_setstate(int argc, char **argv)
+static void
+gvinum_setstate(int argc, char * const *argv)
{
struct gctl_req *req;
int flags, i;
@@ -796,8 +798,8 @@ gvinum_setstate(int argc, char **argv)
gctl_free(req);
}
-void
-gvinum_list(int argc, char **argv)
+static void
+gvinum_list(int argc, char * const *argv)
{
struct gctl_req *req;
int flags, i, j;
@@ -858,12 +860,11 @@ gvinum_list(int argc, char **argv)
printf("%s", config);
gctl_free(req);
- return;
}
/* Create a mirrored volume. */
-void
-gvinum_mirror(int argc, char **argv)
+static void
+gvinum_mirror(int argc, char * const *argv)
{
if (argc < 2) {
@@ -874,8 +875,8 @@ gvinum_mirror(int argc, char **argv)
}
/* Note that move is currently of form '[-r] target object [...]' */
-void
-gvinum_move(int argc, char **argv)
+static void
+gvinum_move(int argc, char * const *argv)
{
struct gctl_req *req;
const char *errstr;
@@ -925,17 +926,17 @@ gvinum_move(int argc, char **argv)
if (errstr != NULL)
warnx("can't move object(s): %s", errstr);
gctl_free(req);
- return;
}
-void
-gvinum_printconfig(int argc, char **argv)
+static void
+gvinum_printconfig(int argc, char * const *argv)
{
+
printconfig(stdout, "");
}
-void
-gvinum_parityop(int argc, char **argv, int rebuild)
+static void
+gvinum_parityop(int argc, char * const *argv, int rebuild)
{
struct gctl_req *req;
int flags, i;
@@ -959,7 +960,6 @@ gvinum_parityop(int argc, char **argv, int rebuild)
case 'v':
flags |= GV_FLAG_V;
break;
- case '?':
default:
warnx("invalid flag '%c'", i);
return;
@@ -987,8 +987,8 @@ gvinum_parityop(int argc, char **argv, int rebuild)
}
/* Create a RAID-5 volume. */
-void
-gvinum_raid5(int argc, char **argv)
+static void
+gvinum_raid5(int argc, char * const *argv)
{
if (argc < 2) {
@@ -998,9 +998,8 @@ gvinum_raid5(int argc, char **argv)
create_volume(argc, argv, "raid5");
}
-
-void
-gvinum_rename(int argc, char **argv)
+static void
+gvinum_rename(int argc, char * const *argv)
{
struct gctl_req *req;
const char *errstr;
@@ -1016,7 +1015,6 @@ gvinum_rename(int argc, char **argv)
case 'r':
flags |= GV_FLAG_R;
break;
- case '?':
default:
return;
}
@@ -1049,11 +1047,10 @@ gvinum_rename(int argc, char **argv)
if (errstr != NULL)
warnx("can't rename object: %s", errstr);
gctl_free(req);
- return;
}
-void
-gvinum_rm(int argc, char **argv)
+static void
+gvinum_rm(int argc, char * const *argv)
{
struct gctl_req *req;
int flags, i, j;
@@ -1071,7 +1068,6 @@ gvinum_rm(int argc, char **argv)
case 'r':
flags |= GV_FLAG_R;
break;
- case '?':
default:
return;
}
@@ -1099,27 +1095,41 @@ gvinum_rm(int argc, char **argv)
gctl_free(req);
}
-void
-gvinum_resetconfig(void)
+static void
+gvinum_resetconfig(int argc, char * const *argv)
{
struct gctl_req *req;
const char *errstr;
char reply[32];
+ int flags, i;
- if (!isatty(STDIN_FILENO)) {
- warn("Please enter this command from a tty device\n");
- return;
+ flags = 0;
+ while ((i = getopt(argc, argv, "f")) != -1) {
+ switch (i) {
+ case 'f':
+ flags |= GV_FLAG_F;
+ break;
+ default:
+ warn("invalid flag: %c", i);
+ return;
+ }
}
- printf(" WARNING! This command will completely wipe out your gvinum"
- "configuration.\n"
- " All data will be lost. If you really want to do this,"
- " enter the text\n\n"
- " NO FUTURE\n"
- " Enter text -> ");
- fgets(reply, sizeof(reply), stdin);
- if (strcmp(reply, "NO FUTURE\n")) {
- printf("\n No change\n");
- return;
+ if ((flags & GV_FLAG_F) == 0) {
+ if (!isatty(STDIN_FILENO)) {
+ warn("Please enter this command from a tty device\n");
+ return;
+ }
+ printf(" WARNING! This command will completely wipe out"
+ " your gvinum configuration.\n"
+ " All data will be lost. If you really want to do this,"
+ " enter the text\n\n"
+ " NO FUTURE\n"
+ " Enter text -> ");
+ fgets(reply, sizeof(reply), stdin);
+ if (strcmp(reply, "NO FUTURE\n")) {
+ printf("\n No change\n");
+ return;
+ }
}
req = gctl_get_handle();
gctl_ro_param(req, "class", -1, "VINUM");
@@ -1134,7 +1144,7 @@ gvinum_resetconfig(void)
printf("gvinum configuration obliterated\n");
}
-void
+static void
gvinum_saveconfig(void)
{
struct gctl_req *req;
@@ -1149,8 +1159,8 @@ gvinum_saveconfig(void)
gctl_free(req);
}
-void
-gvinum_start(int argc, char **argv)
+static void
+gvinum_start(int argc, char * const *argv)
{
struct gctl_req *req;
int i, initsize, j;
@@ -1170,7 +1180,6 @@ gvinum_start(int argc, char **argv)
case 'S':
initsize = atoi(optarg);
break;
- case '?':
default:
return;
}
@@ -1202,14 +1211,15 @@ gvinum_start(int argc, char **argv)
gctl_free(req);
}
-void
-gvinum_stop(int argc, char **argv)
+static void
+gvinum_stop(int argc, char * const *argv)
{
int err, fileid;
- fileid = kldfind(GVINUMMOD);
+ fileid = kldfind(GVINUMKLD);
if (fileid == -1) {
- warn("cannot find " GVINUMMOD);
+ if (modfind(GVINUMMOD) < 0)
+ warn("cannot find " GVINUMKLD);
return;
}
@@ -1219,7 +1229,7 @@ gvinum_stop(int argc, char **argv)
* event thread will be free for the g_wither_geom() call from
* gv_unload(). It's silly, but it works.
*/
- printf("unloading " GVINUMMOD " kernel module... ");
+ printf("unloading " GVINUMKLD " kernel module... ");
fflush(stdout);
if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) {
sleep(1);
@@ -1227,7 +1237,7 @@ gvinum_stop(int argc, char **argv)
}
if (err != 0) {
printf(" failed!\n");
- warn("cannot unload " GVINUMMOD);
+ warn("cannot unload " GVINUMKLD);
return;
}
@@ -1236,8 +1246,8 @@ gvinum_stop(int argc, char **argv)
}
/* Create a striped volume. */
-void
-gvinum_stripe(int argc, char **argv)
+static void
+gvinum_stripe(int argc, char * const *argv)
{
if (argc < 2) {
@@ -1248,8 +1258,8 @@ gvinum_stripe(int argc, char **argv)
}
/* Grow a subdisk by adding disk backed by provider. */
-void
-gvinum_grow(int argc, char **argv)
+static void
+gvinum_grow(int argc, char * const *argv)
{
struct gctl_req *req;
char *drive, *sdname;
@@ -1259,6 +1269,7 @@ gvinum_grow(int argc, char **argv)
const char *errstr;
int drives, volumes, plexes, subdisks, flags;
+ flags = 0;
drives = volumes = plexes = subdisks = 0;
if (argc < 3) {
warnx("usage:\tgrow plex drive\n");
@@ -1326,9 +1337,10 @@ gvinum_grow(int argc, char **argv)
gctl_free(req);
}
-void
-parseline(int argc, char **argv)
+static void
+parseline(int argc, char * const *argv)
{
+
if (argc <= 0)
return;
@@ -1369,7 +1381,7 @@ parseline(int argc, char **argv)
else if (!strcmp(argv[0], "rename"))
gvinum_rename(argc, argv);
else if (!strcmp(argv[0], "resetconfig"))
- gvinum_resetconfig();
+ gvinum_resetconfig(argc, argv);
else if (!strcmp(argv[0], "rm"))
gvinum_rm(argc, argv);
else if (!strcmp(argv[0], "saveconfig"))
@@ -1388,8 +1400,6 @@ parseline(int argc, char **argv)
gvinum_parityop(argc, argv, 1);
else
printf("unknown command '%s'\n", argv[0]);
-
- return;
}
/*
@@ -1397,8 +1407,8 @@ parseline(int argc, char **argv)
* gvinum_create when called without an argument, in order to give the user
* something to edit.
*/
-void
-printconfig(FILE *of, char *comment)
+static void
+printconfig(FILE *of, const char *comment)
{
struct gctl_req *req;
struct utsname uname_s;
diff --git a/sbin/gvinum/gvinum.h b/sbin/gvinum/gvinum.h
index d1b45a07749b..8b72eea7834f 100644
--- a/sbin/gvinum/gvinum.h
+++ b/sbin/gvinum/gvinum.h
@@ -36,4 +36,5 @@
/* $FreeBSD$ */
-#define GVINUMMOD "geom_vinum"
+#define GVINUMMOD "g_vinum"
+#define GVINUMKLD "geom_vinum"
diff --git a/sbin/hastctl/Makefile b/sbin/hastctl/Makefile
index 02531e6f5e8f..89b972e56705 100644
--- a/sbin/hastctl/Makefile
+++ b/sbin/hastctl/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${.CURDIR}/../hastd
diff --git a/sbin/hastd/Makefile b/sbin/hastd/Makefile
index 7ff6ee830a06..306c83ac9e50 100644
--- a/sbin/hastd/Makefile
+++ b/sbin/hastd/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= hastd
SRCS= activemap.c
diff --git a/sbin/ifconfig/Makefile b/sbin/ifconfig/Makefile
index 44c231942b64..aae67249c2bf 100644
--- a/sbin/ifconfig/Makefile
+++ b/sbin/ifconfig/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ifconfig
@@ -63,8 +63,4 @@ MAN= ifconfig.8
CFLAGS+= -Wall -Wmissing-prototypes -Wcast-qual -Wwrite-strings -Wnested-externs
WARNS?= 2
-.if ${MK_TESTS} != "no"
-SUBDIR+= tests
-.endif
-
.include <bsd.prog.mk>
diff --git a/sbin/ifconfig/tests/Makefile b/sbin/ifconfig/tests/Makefile
deleted file mode 100644
index 9b7aa07e1790..000000000000
--- a/sbin/ifconfig/tests/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-# $FreeBSD$
-
-.include <bsd.own.mk>
-
-TESTSDIR= ${TESTSBASE}/sbin/ifconfig
-
-ATF_TESTS_SH= fibs_test
-
-.include <bsd.test.mk>
diff --git a/sbin/ifconfig/tests/fibs_test.sh b/sbin/ifconfig/tests/fibs_test.sh
deleted file mode 100755
index 2a254580eb2b..000000000000
--- a/sbin/ifconfig/tests/fibs_test.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#
-# Copyright (c) 2014 Spectra Logic Corporation
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions, and the following disclaimer,
-# without modification.
-# 2. Redistributions in binary form must reproduce at minimum a disclaimer
-# substantially similar to the "NO WARRANTY" disclaimer below
-# ("Disclaimer") and any redistribution must be conditioned upon
-# including a substantially similar Disclaimer requirement for further
-# binary redistribution.
-#
-# NO WARRANTY
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
-# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
-# POSSIBILITY OF SUCH DAMAGES.
-#
-# Authors: Alan Somers (Spectra Logic Corporation)
-#
-# $FreeBSD$
-
-
-# Regression test for bin/187551
-atf_test_case process_fib cleanup
-process_fib_head()
-{
- atf_set "descr" "ifconfig will set its process fib whenever configuring an interface with nondefault fib"
- atf_set "require.user" "root"
- atf_set "require.config" "fibs"
-}
-process_fib_body()
-{
- atf_expect_fail "bin/187551 ifconfig should change its process fib when configuring an interface with nondefault fib"
- # Configure the TAP interface to use an RFC5737 nonrouteable address
- # and a non-default fib
- ADDR="192.0.2.2"
- SUBNET="192.0.2.0"
- MASK="24"
-
- # Check system configuration
- if [ 0 != `sysctl -n net.add_addr_allfibs` ]; then
- atf_skip "This test requires net.add_addr_allfibs=0"
- fi
- get_fibs 1
-
- # Configure a TAP interface
- get_tap
- ktrace ifconfig $TAP ${ADDR}/${MASK} fib $FIB0
- if kdump -s | egrep -q 'CALL[[:space:]]+setfib'; then
- atf_pass
- else
- atf_fail "ifconfig never called setfib(2)"
- fi
-}
-
-process_fib_cleanup()
-{
- cleanup_tap
-}
-
-atf_init_test_cases()
-{
- atf_add_test_case process_fib
-}
-
-
-# parameter numfibs The number of fibs to lookup
-get_fibs()
-{
- NUMFIBS=$1
- net_fibs=`sysctl -n net.fibs`
- i=0
- while [ $i -lt "$NUMFIBS" ]; do
- fib=`atf_config_get "fibs" | \
- awk -v i=$(( i + 1 )) '{print $i}'`
- echo "fib is ${fib}"
- eval FIB${i}=${fib}
- if [ "$fib" -ge "$net_fibs" ]; then
- atf_skip "The ${i}th configured fib is ${fib}, which is not less than net.fibs, which is ${net_fibs}"
- fi
- i=$(( $i + 1 ))
- done
-}
-
-
-
-# Creates a new tap(4) interface, registers it for cleanup, and returns the
-# name via the environment variable TAP
-get_tap()
-{
- local TAPN=0
- while ! ifconfig tap${TAPN} create > /dev/null 2>&1; do
- if [ "$TAPN" -ge 8 ]; then
- atf_skip "Could not create a tap(4) interface"
- else
- TAPN=$(($TAPN + 1))
- fi
- done
- local TAPD=tap${TAPN}
- # Record the TAP device so we can clean it up later
- echo ${TAPD} >> "tap_devices_to_cleanup"
- TAP=${TAPD}
-}
-
-
-
-
-cleanup_tap()
-{
- for TAPD in `cat "tap_devices_to_cleanup"`; do
- ifconfig ${TAPD} destroy
- done
-}
-
diff --git a/sbin/ipfw/Makefile b/sbin/ipfw/Makefile
index 6aea26b7a3d4..de27e3ebdedc 100644
--- a/sbin/ipfw/Makefile
+++ b/sbin/ipfw/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ipfw
SRCS= ipfw2.c dummynet.c ipv6.c main.c nat.c
diff --git a/sbin/mdconfig/Makefile b/sbin/mdconfig/Makefile
index 4b9b9405474d..69a688cdc389 100644
--- a/sbin/mdconfig/Makefile
+++ b/sbin/mdconfig/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= mdconfig
MAN= mdconfig.8
diff --git a/sbin/newfs_msdos/newfs_msdos.c b/sbin/newfs_msdos/newfs_msdos.c
index 1f5b4385f9bc..4bfb219e35fc 100644
--- a/sbin/newfs_msdos/newfs_msdos.c
+++ b/sbin/newfs_msdos/newfs_msdos.c
@@ -51,50 +51,50 @@ static const char rcsid[] =
#include <time.h>
#include <unistd.h>
-#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */
-#define BPN 4 /* bits per nibble */
-#define NPB 2 /* nibbles per byte */
+#define MAXU16 0xffff /* maximum unsigned 16-bit quantity */
+#define BPN 4 /* bits per nibble */
+#define NPB 2 /* nibbles per byte */
-#define DOSMAGIC 0xaa55 /* DOS magic number */
-#define MINBPS 512 /* minimum bytes per sector */
-#define MAXSPC 128 /* maximum sectors per cluster */
-#define MAXNFT 16 /* maximum number of FATs */
-#define DEFBLK 4096 /* default block size */
-#define DEFBLK16 2048 /* default block size FAT16 */
-#define DEFRDE 512 /* default root directory entries */
-#define RESFTE 2 /* reserved FAT entries */
-#define MINCLS12 1U /* minimum FAT12 clusters */
-#define MINCLS16 0xff5U /* minimum FAT16 clusters */
-#define MINCLS32 0xfff5U /* minimum FAT32 clusters */
-#define MAXCLS12 0xff4U /* maximum FAT12 clusters */
-#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */
-#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */
+#define DOSMAGIC 0xaa55 /* DOS magic number */
+#define MINBPS 512 /* minimum bytes per sector */
+#define MAXSPC 128 /* maximum sectors per cluster */
+#define MAXNFT 16 /* maximum number of FATs */
+#define DEFBLK 4096 /* default block size */
+#define DEFBLK16 2048 /* default block size FAT16 */
+#define DEFRDE 512 /* default root directory entries */
+#define RESFTE 2 /* reserved FAT entries */
+#define MINCLS12 1U /* minimum FAT12 clusters */
+#define MINCLS16 0xff5U /* minimum FAT16 clusters */
+#define MINCLS32 0xfff5U /* minimum FAT32 clusters */
+#define MAXCLS12 0xff4U /* maximum FAT12 clusters */
+#define MAXCLS16 0xfff4U /* maximum FAT16 clusters */
+#define MAXCLS32 0xffffff4U /* maximum FAT32 clusters */
-#define mincls(fat) ((fat) == 12 ? MINCLS12 : \
+#define mincls(fat) ((fat) == 12 ? MINCLS12 : \
(fat) == 16 ? MINCLS16 : \
MINCLS32)
-#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \
+#define maxcls(fat) ((fat) == 12 ? MAXCLS12 : \
(fat) == 16 ? MAXCLS16 : \
MAXCLS32)
-#define mk1(p, x) \
+#define mk1(p, x) \
(p) = (u_int8_t)(x)
-#define mk2(p, x) \
+#define mk2(p, x) \
(p)[0] = (u_int8_t)(x), \
(p)[1] = (u_int8_t)((x) >> 010)
-#define mk4(p, x) \
+#define mk4(p, x) \
(p)[0] = (u_int8_t)(x), \
(p)[1] = (u_int8_t)((x) >> 010), \
(p)[2] = (u_int8_t)((x) >> 020), \
(p)[3] = (u_int8_t)((x) >> 030)
-#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg)
-#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg)
-#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg)
-#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg)
+#define argto1(arg, lo, msg) argtou(arg, lo, 0xff, msg)
+#define argto2(arg, lo, msg) argtou(arg, lo, 0xffff, msg)
+#define argto4(arg, lo, msg) argtou(arg, lo, 0xffffffff, msg)
+#define argtox(arg, lo, msg) argtou(arg, lo, UINT_MAX, msg)
struct bs {
u_int8_t bsJump[3]; /* bootstrap entry point */
@@ -131,7 +131,7 @@ struct bsx {
u_int8_t exReserved1; /* reserved */
u_int8_t exBootSignature; /* extended boot signature */
u_int8_t exVolumeID[4]; /* volume ID number */
- u_int8_t exVolumeLabel[11]; /* volume label */
+ u_int8_t exVolumeLabel[11]; /* volume label */
u_int8_t exFileSysType[8]; /* file system type */
} __packed;
@@ -164,7 +164,7 @@ struct bpb {
u_int bpbBackup; /* backup boot sector */
};
-#define BPBGAP 0, 0, 0, 0, 0, 0
+#define BPBGAP 0, 0, 0, 0, 0, 0
static struct {
const char *name;
@@ -174,10 +174,10 @@ static struct {
{"180", {512, 1, 1, 2, 64, 360, 0xfc, 2, 9, 1, BPBGAP}},
{"320", {512, 2, 1, 2, 112, 640, 0xff, 1, 8, 2, BPBGAP}},
{"360", {512, 2, 1, 2, 112, 720, 0xfd, 2, 9, 2, BPBGAP}},
- {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}},
+ {"640", {512, 2, 1, 2, 112, 1280, 0xfb, 2, 8, 2, BPBGAP}},
{"720", {512, 2, 1, 2, 112, 1440, 0xf9, 3, 9, 2, BPBGAP}},
{"1200", {512, 1, 1, 2, 224, 2400, 0xf9, 7, 15, 2, BPBGAP}},
- {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}},
+ {"1232", {1024,1, 1, 2, 192, 1232, 0xfe, 2, 8, 2, BPBGAP}},
{"1440", {512, 1, 1, 2, 224, 2880, 0xf0, 9, 18, 2, BPBGAP}},
{"2880", {512, 2, 1, 2, 240, 5760, 0xf0, 9, 36, 2, BPBGAP}}
};
@@ -1029,7 +1029,7 @@ usage(void)
fprintf(stderr,
"usage: newfs_msdos [ -options ] special [disktype]\n"
"where the options are:\n"
- "\t-@ create file system at specified offset\n"
+ "\t-@ create file system at specified offset\n"
"\t-B get bootstrap from file\n"
"\t-C create image file with specified size\n"
"\t-F FAT type (12, 16, or 32)\n"
diff --git a/sbin/pfctl/Makefile b/sbin/pfctl/Makefile
index 5b3735c6e771..937f403569dd 100644
--- a/sbin/pfctl/Makefile
+++ b/sbin/pfctl/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# pf_ruleset.c is shared between kernel and pfctl
.PATH: ${.CURDIR}/../../sys/netpfil/pf
diff --git a/sbin/ping/Makefile b/sbin/ping/Makefile
index c3dda698b519..a05efe371c57 100644
--- a/sbin/ping/Makefile
+++ b/sbin/ping/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ping
MAN= ping.8
diff --git a/sbin/route/Makefile b/sbin/route/Makefile
index 569d21af07a0..25134e473b66 100644
--- a/sbin/route/Makefile
+++ b/sbin/route/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= route
MAN= route.8
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 794f1430397b..9b3bb9533f61 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1727,8 +1727,6 @@ print_getmsg(struct rt_msghdr *rtm, int msglen, int fib)
(sp[RTAX_IFP]->sa_family != AF_LINK ||
((struct sockaddr_dl *)(void *)sp[RTAX_IFP])->sdl_nlen == 0))
sp[RTAX_IFP] = NULL;
- if (sp[RTAX_DST] && sp[RTAX_NETMASK])
- sp[RTAX_NETMASK]->sa_family = sp[RTAX_DST]->sa_family; /* XXX */
if (sp[RTAX_DST])
(void)printf("destination: %s\n", routename(sp[RTAX_DST]));
if (sp[RTAX_NETMASK])
diff --git a/sbin/setkey/Makefile b/sbin/setkey/Makefile
index e2c93ccf489b..bd04f07c1eb4 100644
--- a/sbin/setkey/Makefile
+++ b/sbin/setkey/Makefile
@@ -27,7 +27,7 @@
#
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= setkey
MAN= setkey.8
diff --git a/secure/Makefile b/secure/Makefile
index 4a111a25c548..4e2cc4f72523 100644
--- a/secure/Makefile
+++ b/secure/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= lib libexec ${_tests} usr.bin usr.sbin
diff --git a/secure/Makefile.inc b/secure/Makefile.inc
index eb7c66ef1492..ca4cb857f2f7 100644
--- a/secure/Makefile.inc
+++ b/secure/Makefile.inc
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.if exists(${.CURDIR}/../../lib/libcrypt/obj)
CRYPTOBJDIR= ${.CURDIR}/../../lib/libcrypt/obj
diff --git a/secure/lib/Makefile b/secure/lib/Makefile
index 118204f67f8a..4ca851766e62 100644
--- a/secure/lib/Makefile
+++ b/secure/lib/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR=
.if ${MK_OPENSSL} != "no"
diff --git a/secure/lib/libssh/Makefile b/secure/lib/libssh/Makefile
index f4bfd06ea7fe..b63d6b9c6692 100644
--- a/secure/lib/libssh/Makefile
+++ b/secure/lib/libssh/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
LIB= ssh
PRIVATELIB= true
diff --git a/secure/libexec/Makefile b/secure/libexec/Makefile
index 9edc8e66c197..07aa3dd4bdc4 100644
--- a/secure/libexec/Makefile
+++ b/secure/libexec/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR=
.if ${MK_OPENSSH} != "no"
diff --git a/secure/libexec/sftp-server/Makefile b/secure/libexec/sftp-server/Makefile
index ef56013ff3bc..eb788f6d0637 100644
--- a/secure/libexec/sftp-server/Makefile
+++ b/secure/libexec/sftp-server/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= sftp-server
SRCS= sftp-server.c sftp-common.c sftp-server-main.c
diff --git a/secure/libexec/ssh-keysign/Makefile b/secure/libexec/ssh-keysign/Makefile
index 7deda1976ba3..668ad9e1b4f8 100644
--- a/secure/libexec/ssh-keysign/Makefile
+++ b/secure/libexec/ssh-keysign/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh-keysign
SRCS= ssh-keysign.c roaming_dummy.c readconf.c
diff --git a/secure/libexec/ssh-pkcs11-helper/Makefile b/secure/libexec/ssh-pkcs11-helper/Makefile
index 4682929e2d93..f3cf9029f4cc 100644
--- a/secure/libexec/ssh-pkcs11-helper/Makefile
+++ b/secure/libexec/ssh-pkcs11-helper/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh-pkcs11-helper
SRCS= ssh-pkcs11.c ssh-pkcs11-helper.c
diff --git a/secure/usr.bin/Makefile b/secure/usr.bin/Makefile
index e819ba74686c..e14ebe3000e9 100644
--- a/secure/usr.bin/Makefile
+++ b/secure/usr.bin/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR=
.if ${MK_OPENSSL} != "no"
diff --git a/secure/usr.bin/scp/Makefile b/secure/usr.bin/scp/Makefile
index c33470ca9ef3..d58d855d8029 100644
--- a/secure/usr.bin/scp/Makefile
+++ b/secure/usr.bin/scp/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= scp
SRCS= scp.c
diff --git a/secure/usr.bin/sftp/Makefile b/secure/usr.bin/sftp/Makefile
index 924e1a702163..15dcaa52061d 100644
--- a/secure/usr.bin/sftp/Makefile
+++ b/secure/usr.bin/sftp/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= sftp
SRCS= sftp.c sftp-client.c sftp-common.c sftp-glob.c progressmeter.c
diff --git a/secure/usr.bin/ssh-add/Makefile b/secure/usr.bin/ssh-add/Makefile
index 316a6071280b..97191ba51fbf 100644
--- a/secure/usr.bin/ssh-add/Makefile
+++ b/secure/usr.bin/ssh-add/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh-add
SRCS+= ssh-add.c
diff --git a/secure/usr.bin/ssh-agent/Makefile b/secure/usr.bin/ssh-agent/Makefile
index 353abaced410..b5db53236c8b 100644
--- a/secure/usr.bin/ssh-agent/Makefile
+++ b/secure/usr.bin/ssh-agent/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh-agent
SRCS= ssh-agent.c
diff --git a/secure/usr.bin/ssh-keygen/Makefile b/secure/usr.bin/ssh-keygen/Makefile
index 75934d9bff91..45e4d1691f98 100644
--- a/secure/usr.bin/ssh-keygen/Makefile
+++ b/secure/usr.bin/ssh-keygen/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh-keygen
SRCS= ssh-keygen.c
diff --git a/secure/usr.bin/ssh-keyscan/Makefile b/secure/usr.bin/ssh-keyscan/Makefile
index 7dcb4d10826e..298f52a53c07 100644
--- a/secure/usr.bin/ssh-keyscan/Makefile
+++ b/secure/usr.bin/ssh-keyscan/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh-keyscan
SRCS= ssh-keyscan.c roaming_dummy.c
diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile
index 4a4642970195..89f9927c0aaa 100644
--- a/secure/usr.bin/ssh/Makefile
+++ b/secure/usr.bin/ssh/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ssh
CFLAGS+=-I${SSHDIR} -include ssh_namespace.h
diff --git a/secure/usr.sbin/Makefile b/secure/usr.sbin/Makefile
index 33d945c0c683..e42f456b12d0 100644
--- a/secure/usr.sbin/Makefile
+++ b/secure/usr.sbin/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR=
.if ${MK_OPENSSH} != "no"
diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile
index e1c71a3eab94..d487fe3dd7cc 100644
--- a/secure/usr.sbin/sshd/Makefile
+++ b/secure/usr.sbin/sshd/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= sshd
SRCS= sshd.c auth-rhosts.c auth-passwd.c auth-rsa.c auth-rh-rsa.c \
diff --git a/share/Makefile b/share/Makefile
index 8ac475044833..604e4169313a 100644
--- a/share/Makefile
+++ b/share/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# Do not include `info' in the SUBDIR list, it is handled separately.
diff --git a/share/doc/Makefile b/share/doc/Makefile
index a4fe61d6c479..fda977f118e0 100644
--- a/share/doc/Makefile
+++ b/share/doc/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_IPv6} \
${_atf} \
diff --git a/share/doc/smm/Makefile b/share/doc/smm/Makefile
index fd42bd4d53a6..1d99b052a351 100644
--- a/share/doc/smm/Makefile
+++ b/share/doc/smm/Makefile
@@ -1,7 +1,7 @@
# From: @(#)Makefile 8.1 (Berkeley) 6/10/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# The following modules do not describe FreeBSD:
# 14.uucpimpl, 15.uucpnet
diff --git a/share/dtrace/Makefile b/share/dtrace/Makefile
index adbdc84971c4..ba52997a59ba 100644
--- a/share/dtrace/Makefile
+++ b/share/dtrace/Makefile
@@ -4,7 +4,7 @@
# the DTraceToolkit.
#
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= ${_toolkit}
diff --git a/share/examples/Makefile b/share/examples/Makefile
index a4270bf38ae8..dcc3256d2d29 100644
--- a/share/examples/Makefile
+++ b/share/examples/Makefile
@@ -2,7 +2,7 @@
#
# Doing a make install builds /usr/share/examples
-.include <bsd.own.mk>
+.include <src.opts.mk>
LDIRS= BSD_daemon \
FreeBSD_version \
diff --git a/share/man/Makefile b/share/man/Makefile
index 524235c2e9f0..c3bd5f22aca4 100644
--- a/share/man/Makefile
+++ b/share/man/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.2 (Berkeley) 4/16/94
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# XXX MISSING: man3f
SUBDIR= man1 man3 man4 man5 man6 man7 man8 man9
diff --git a/share/man/man1/Makefile b/share/man/man1/Makefile
index 97885a6a8b83..1b37c4b34e33 100644
--- a/share/man/man1/Makefile
+++ b/share/man/man1/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MAN= builtin.1 intro.1
diff --git a/share/man/man3/Makefile b/share/man/man3/Makefile
index ccdc54985026..f0cbf0ecd9f3 100644
--- a/share/man/man3/Makefile
+++ b/share/man/man3/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.2 (Berkeley) 12/13/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MAN= assert.3 \
ATOMIC_VAR_INIT.3 \
diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile
index 59fd3e9bc3b7..b0f8e572ca26 100644
--- a/share/man/man4/Makefile
+++ b/share/man/man4/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/18/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MAN= aac.4 \
aacraid.4 \
@@ -142,6 +142,7 @@ MAN= aac.4 \
filemon.4 \
firewire.4 \
fpa.4 \
+ full.4 \
fwe.4 \
fwip.4 \
fwohci.4 \
@@ -226,7 +227,6 @@ MAN= aac.4 \
le.4 \
led.4 \
lge.4 \
- ${_lindev.4} \
${_linux.4} \
lmc.4 \
lo.4 \
@@ -262,8 +262,10 @@ MAN= aac.4 \
mod_cc.4 \
mos.4 \
mouse.4 \
+ mpr.4 \
mps.4 \
mpt.4 \
+ mrsas.4 \
msk.4 \
mtio.4 \
multicast.4 \
@@ -378,6 +380,7 @@ MAN= aac.4 \
ppc.4 \
ppi.4 \
procdesc.4 \
+ proto.4 \
psm.4 \
pst.4 \
pt.4 \
@@ -789,7 +792,6 @@ _if_vxge.4= if_vxge.4
_if_wpi.4= if_wpi.4
_ipmi.4= ipmi.4
_io.4= io.4
-_lindev.4= lindev.4
_linux.4= linux.4
_ndis.4= ndis.4
_nfe.4= nfe.4
@@ -818,7 +820,6 @@ _wpi.4= wpi.4
_xen.4= xen.4
_xnb.4= xnb.4
-MLINKS+=lindev.4 full.4
.endif
.if ${MACHINE_CPUARCH} == "amd64"
diff --git a/share/man/man4/bce.4 b/share/man/man4/bce.4
index 00df65931eea..004ffa30f2aa 100644
--- a/share/man/man4/bce.4
+++ b/share/man/man4/bce.4
@@ -1,5 +1,4 @@
-.\" Copyright (c) 2006 Broadcom Corporation
-.\" David Christensen <davidch@broadcom.com>. All rights reserved.
+.\" Copyright (c) 2006-2014 QLogic Corporation
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -10,9 +9,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of Broadcom Corporation nor the name of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written consent.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -33,7 +29,7 @@
.Os
.Sh NAME
.Nm bce
-.Nd "Broadcom NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver"
+.Nd "QLogic NetXtreme II (BCM5706/5708/5709/5716) PCI/PCIe Gigabit Ethernet adapter driver"
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
@@ -52,7 +48,7 @@ if_bce_load="YES"
.Sh DESCRIPTION
The
.Nm
-driver supports Broadcom's NetXtreme II product family, including the
+driver supports QLogic's NetXtreme II product family, including the
BCM5706, BCM5708, BCM5709 and BCM5716 Ethernet controllers.
.Pp
The NetXtreme II product family is composed of various Converged NIC (or CNIC)
@@ -141,25 +137,25 @@ For more information on configuring this device, see
.Sh HARDWARE
The
.Nm
-driver provides support for various NICs based on the Broadcom NetXtreme II
+driver provides support for various NICs based on the QLogic NetXtreme II
family of Gigabit Ethernet controllers, including the
following:
.Pp
.Bl -bullet -compact
.It
-Broadcom NetXtreme II BCM5706 1000Base-SX
+QLogic NetXtreme II BCM5706 1000Base-SX
.It
-Broadcom NetXtreme II BCM5706 1000Base-T
+QLogic NetXtreme II BCM5706 1000Base-T
.It
-Broadcom NetXtreme II BCM5708 1000Base-SX
+QLogic NetXtreme II BCM5708 1000Base-SX
.It
-Broadcom NetXtreme II BCM5708 1000Base-T
+QLogic NetXtreme II BCM5708 1000Base-T
.It
-Broadcom NetXtreme II BCM5709 1000Base-SX
+QLogic NetXtreme II BCM5709 1000Base-SX
.It
-Broadcom NetXtreme II BCM5709 1000Base-T
+QLogic NetXtreme II BCM5709 1000Base-T
.It
-Broadcom NetXtreme II BCM5716 1000Base-T
+QLogic NetXtreme II BCM5716 1000Base-T
.It
Dell PowerEdge 1950 integrated BCM5708 NIC
.It
@@ -411,9 +407,11 @@ A controller hardware failure has occurred.
If the problem continues replace the controller.
.El
.Sh SUPPORT
-For general information and support,
-go to the Broadcom NIC Open Source Developer Resource Site:
-.Pa http://www.broadcom.com/support/ethernet_nic/open_source.php .
+For support questions please contact your QLogic approved reseller or
+QLogic Technical Support at
+.Pa http://support.qlogic.com ,
+or by E-mail at
+.Aq support@qlogic.com .
.Sh SEE ALSO
.Xr altq 4 ,
.Xr arp 4 ,
diff --git a/share/man/man4/bxe.4 b/share/man/man4/bxe.4
index be9ba2551f96..0067385b7cb4 100644
--- a/share/man/man4/bxe.4
+++ b/share/man/man4/bxe.4
@@ -1,4 +1,4 @@
-.\" Copyright (c) 2013 Broadcom Corporation. All rights reserved.
+.\" Copyright (c) 2014 Qlogic Corporation. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -9,9 +9,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. Neither the name of Broadcom Corporation nor the name of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written consent.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS'
.\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -32,7 +29,7 @@
.Os
.Sh NAME
.Nm bxe
-.Nd Broadcom NetXtreme II Ethernet 10Gb PCIe adapter driver
+.Nd QLogic NetXtreme II Ethernet 10Gb PCIe adapter driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
@@ -50,7 +47,7 @@ if_bxe_load="YES"
.Sh DESCRIPTION
The
.Nm
-driver provides support for PCIe 10Gb Ethernet adapters based on the Broadcom
+driver provides support for PCIe 10Gb Ethernet adapters based on the QLogic
NetXtreme II family of 10Gb chips.
The driver supports Jumbo Frames, VLAN
tagging, checksum offload (IPv4, TCP, UDP, IPv6-TCP, IPv6-UDP), MSI-X
@@ -59,32 +56,32 @@ Receive Side Scaling (RSS).
.Sh HARDWARE
The
.Nm
-driver provides support for various NICs based on the Broadcom NetXtreme II
+driver provides support for various NICs based on the QLogic NetXtreme II
family of 10Gb Ethernet controller chips, including the following:
.Pp
.Bl -bullet -compact
.It
-Broadcom NetXtreme II BCM57710 10Gb
+QLogic NetXtreme II BCM57710 10Gb
.It
-Broadcom NetXtreme II BCM57711 10Gb
+QLogic NetXtreme II BCM57711 10Gb
.It
-Broadcom NetXtreme II BCM57711E 10Gb
+QLogic NetXtreme II BCM57711E 10Gb
.It
-Broadcom NetXtreme II BCM57712 10Gb
+QLogic NetXtreme II BCM57712 10Gb
.It
-Broadcom NetXtreme II BCM57712-MF 10Gb
+QLogic NetXtreme II BCM57712-MF 10Gb
.It
-Broadcom NetXtreme II BCM57800 10Gb
+QLogic NetXtreme II BCM57800 10Gb
.It
-Broadcom NetXtreme II BCM57800-MF 10Gb
+QLogic NetXtreme II BCM57800-MF 10Gb
.It
-Broadcom NetXtreme II BCM57810 10Gb
+QLogic NetXtreme II BCM57810 10Gb
.It
-Broadcom NetXtreme II BCM57810-MF 10Gb
+QLogic NetXtreme II BCM57810-MF 10Gb
.It
-Broadcom NetXtreme II BCM57840 10Gb / 20Gb
+QLogic NetXtreme II BCM57840 10Gb / 20Gb
.It
-Broadcom NetXtreme II BCM57840-MF 10Gb
+QLogic NetXtreme II BCM57840-MF 10Gb
.El
.Sh CONFIGURATION
There a number of configuration parameters that can be set to tweak the
@@ -318,6 +315,12 @@ When finished turn the logging back off:
.Bd -literal -offset indent
# sysctl dev.bxe.0.debug=0
.Ed
+.Sh SUPPORT
+For support questions please contact your QLogic approved reseller or
+QLogic Technical Support at
+.Pa http://support.qlogic.com ,
+or by E-mail at
+.Aq support@qlogic.com .
.Sh SEE ALSO
.Xr netstat 1 ,
.Xr altq 4 ,
diff --git a/share/man/man4/lindev.4 b/share/man/man4/full.4
index ffc5e8310f97..a71eb926361d 100644
--- a/share/man/man4/lindev.4
+++ b/share/man/man4/full.4
@@ -1,20 +1,19 @@
-.\"-
-.\" Copyright (c) 2009 "Bjoern A. Zeeb" <bz@FreeBSD.org>
-.\" All rights reserved.
+.\" Copyright (c) 2014
+.\" Eitan Adler <eadler@FreeBSD.org>. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
+.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
+.\" 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
+.\" 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)
@@ -25,40 +24,17 @@
.\"
.\" $FreeBSD$
.\"
-.Dd September 26, 2009
-.Dt LINDEV 4
+.Dd March 29, 2014
+.Dt FULL 4
.Os
.Sh NAME
-.Nm lindev
-.Nd Linux-specific pseudo devices support
-.Sh SYNOPSIS
-To compile this collection of linux-specific pseudo devices into the kernel,
-place the following line in your kernel configuration file:
-.Bd -ragged -offset indent
-.Cd "device lindev"
-.Ed
-.Pp
-Alternatively, to load the driver as a module at boot time,
-place the following line in
-.Xr loader.conf 5 :
-.Bd -literal -offset indent
-lindev_load="YES"
-.Ed
+.Nm full
+.Nd the full device
.Sh DESCRIPTION
The
.Nm
-module provides a collection of linux-specific pseudo devices.
-.Sh DEVICES
-.Bl -tag -width /dev/full
-.It Pa /dev/full
-The
-.Xr full
-device always returns
-.Er ENOSPC
-on write attempts.
-For reads it emulates
-.Xr zero 4 .
-.El
+device supplies an endless stream of zeros when read.
+However, it will always be full when writing to it.
.Sh FILES
.Bl -tag -width /dev/full
.It Pa /dev/full
@@ -66,8 +42,6 @@ For reads it emulates
.Sh SEE ALSO
.Xr null 4 ,
.Xr zero 4
-.Sh HISTORY
-The
-.Nm
-module first appeared in
-.Fx 8.1 .
+.Sh Author
+This device and man page was written by
+.An Eitan Adler Aq eadler@FreeBSD.org .
diff --git a/share/man/man4/mpr.4 b/share/man/man4/mpr.4
new file mode 100644
index 000000000000..4a42fa136d17
--- /dev/null
+++ b/share/man/man4/mpr.4
@@ -0,0 +1,229 @@
+.\"
+.\" Copyright (c) 2010 Spectra Logic Corporation
+.\" Copyright (c) 2014 LSI Corp
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions, and the following disclaimer,
+.\" without modification.
+.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer
+.\" substantially similar to the "NO WARRANTY" disclaimer below
+.\" ("Disclaimer") and any redistribution must be conditioned upon
+.\" including a substantially similar Disclaimer requirement for further
+.\" binary redistribution.
+.\"
+.\" NO WARRANTY
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
+.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGES.
+.\"
+.\" mpr driver man page.
+.\"
+.\" Author: Ken Merry <ken@FreeBSD.org>
+.\" Author: Stephen McConnell <stephen.mcconnell@lsi.com>
+.\"
+.\" $Id$
+.\" $FreeBSD$
+.\"
+.Dd May 2, 2014
+.Dt MPR 4
+.Os
+.Sh NAME
+.Nm mpr
+.Nd "LSI Fusion-MPT 3 IT/IR 12Gb/s Serial Attached SCSI/SATA driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel, place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device pci"
+.Cd "device scbus"
+.Cd "device mpr"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+mpr_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver provides support for LSI Fusion-MPT 3 IT/IR
+.Tn SAS
+controllers.
+.Sh HARDWARE
+The following controllers are supported by the
+.Nm
+driver:
+.Pp
+.Bl -bullet -compact
+.It
+LSI SAS 3004 (4 Port SAS)
+.It
+LSI SAS 3008 (8 Port SAS)
+.It
+LSI SAS 3108 (8 Port SAS)
+.El
+.Sh CONFIGURATION
+To disable MSI interrupts for all
+.Nm
+driver instances, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.disable_msi=1
+.Ed
+.Pp
+To disable MSI interrupts for a specific
+.Nm
+driver instance, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.disable_msi=1
+.Ed
+.Pp
+where X is the adapter number.
+.Pp
+To disable MSI-X interrupts for all
+.Nm
+driver instances, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.disable_msix=1
+.Ed
+.Pp
+To disable MSI-X interrupts for a specific
+.Nm
+driver instance, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.disable_msix=1
+.Ed
+.Pp
+To set the maximum number of DMA chains allocated for all adapters, set
+the following variable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.max_chains=NNNN
+.Ed
+.Pp
+To set the maximum number of DMA chains allocated for a specific adapter,
+set the following variable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.max_chains=NNNN
+.Ed
+.Pp
+This variable may also be viewed via
+.Xr sysctl 8
+to see the maximum set for a given adapter.
+.Pp
+The current number of free chain frames may be seen via the
+dev.mpr.X.chain_free
+.Xr sysctl 8
+variable.
+.Pp
+The lowest number of free chain frames may be seen via the
+dev.mpr.X.chain_free_lowwater
+.Xr sysctl 8
+variable.
+.Pp
+The current number of active I/O commands is shown in the
+dev.mpr.X.io_cmds_active
+.Xr sysctl 8
+variable.
+.Pp
+The maximum number of active I/O commands seen since boot is shown in the
+dev.mpr.X.io_cmds_highwater
+.Xr sysctl 8
+variable.
+.Pp
+Devices can be excluded from
+.Nm
+control for all adapters by setting the following variable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+hw.mpr.exclude_ids=Y
+.Ed
+.Pp
+where Y is the target ID of the device.
+If more than one device is to be
+excluded, target ID's are separated by commas.
+.Pp
+Devices can be excluded from
+.Nm
+control for a specific adapter by setting the following variable in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mpr.X.exclude_ids=Y
+.Ed
+.Pp
+where X is the adapter number and Y is the target ID of the device.
+If more
+than one device is to be excluded, target ID's are separated by commas.
+.Sh DEBUGGING
+To enable debugging prints from the
+.Nm
+driver, set the
+.Bd -literal -offset indent
+hw.mpr.X.debug_level
+.Ed
+.Pp
+variable, where X is the adapter number, either in
+.Xr loader.conf 5
+or via
+.Xr sysctl 8 .
+The following bits have the described effects:
+.Bd -literal -offset indent
+0x0001 Enable informational prints.
+0x0002 Enable prints for driver faults.
+0x0004 Enable prints for controller events.
+0x0008 Enable prints for controller logging.
+0x0010 Enable prints for tracing recovery operations.
+0x0020 Enable prints for parameter errors and programming bugs.
+0x0040 Enable prints for system initialization operations.
+0x0080 Enable prints for more detailed information.
+0x0100 Enable prints for user-generated commands.
+0x0200 Enable prints for device mapping.
+0x0400 Enable prints for tracing through driver functions.
+.Ed
+.Sh SEE ALSO
+.Xr cam 4 ,
+.Xr cd 4 ,
+.Xr ch 4 ,
+.Xr da 4 ,
+.Xr mps 4 ,
+.Xr mpt 4 ,
+.Xr pci 4 ,
+.Xr sa 4 ,
+.Xr scsi 4 ,
+.Xr targ 4 ,
+.Xr loader.conf 5 ,
+.Xr sysctl 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in FreeBSD 9.3.
+.Sh AUTHORS
+The
+.Nm
+driver was originally written by
+.An -nosplit
+.An Scott Long Aq scottl@FreeBSD.org .
+It has been improved and tested by LSI Corporation.
+.Pp
+This man page was written by
+.An Ken Merry Aq ken@FreeBSD.org
+with additional input from
+.An Stephen McConnell Aq stephen.mcconnell@lsi.com .
diff --git a/share/man/man4/mrsas.4 b/share/man/man4/mrsas.4
new file mode 100644
index 000000000000..60c144ecb414
--- /dev/null
+++ b/share/man/man4/mrsas.4
@@ -0,0 +1,403 @@
+.\" Copyright (c) 2014 LSI Corp
+.\" All rights reserved.
+.\" Author: Kashyap Desai
+.\" Support: freebsdraid@lsi.com
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\" 3. Neither the name of the <ORGANIZATION> nor the names of its
+.\" contributors may be used to endorse or promote products derived
+.\" from this software without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+.\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+.\" CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+.\" POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" The views and conclusions contained in the software and documentation
+.\" are those of the authors and should not be interpreted as representing
+.\" official policies, either expressed or implied, of the FreeBSD Project.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd May 8, 2014
+.Dt MRSAS 4
+.Os
+.Sh NAME
+.Nm mrsas
+.Nd "LSI MegaRAID 6Gb/s and 12Gb/s SAS+SATA RAID controller driver"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following lines in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device pci"
+.Cd "device mrsas"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+mrsas_load="YES"
+.Ed
+.Sh DESCRIPTION
+The
+.Nm
+driver will detect LSI's next generation (6Gb/s and 12Gb/s) PCI Express
+SAS/SATA RAID controllers.
+See the
+.Nm HARDWARE
+section for the supported devices list.
+A disk (virtual disk/physical disk) attached to the
+.Nm
+driver will be visible to the user through
+.Xr camcontrol 8
+as
+.Pa /dev/da?
+device nodes.
+A simple management interface is also provided on a per-controller basis via the
+.Pa /dev/mrsas?
+device node.
+.Pp
+The
+.Nm
+name is derived from the phrase "MegaRAID SAS HBA", which is
+substantially different than the old "MegaRAID" Driver
+.Xr mfi 4
+which does not connect targets
+to the
+.Xr cam 4
+layer and thus requires a new driver which attaches targets to the
+.Xr cam 4
+layer.
+Older MegaRAID controllers are supported by
+.Xr mfi 4
+and will not work with
+.Nm ,
+but both the
+.Xr mfi 4
+and
+.Nm
+drivers can detect and manage the LSI MegaRAID SAS 2208/2308/3008/3108 series of
+controllers.
+.Pp
+The
+.Xr device.hints 5
+option is provided to tune the
+.Nm
+driver's behavior for LSI MegaRAID SAS 2208/2308/3008/3108 controllers.
+By default, the
+.Xr mfi 4
+driver will detect these controllers.
+See the
+.Nm PRIORITY
+section to know more about driver priority for MR-Fusion devices.
+.Pp
+.Nm
+will provide a priority of (-30) (between
+.Dv BUS_PROBE_DEFAULT
+and
+.Dv BUS_PROBE_LOW_PRIORITY )
+at probe call for device id's 0x005B, 0x005D, and
+0x005F so that
+.Nm
+does not take control of these devices without user intervention.
+.Sh HARDWARE
+The
+.Nm
+driver supports the following hardware:
+.Pp
+[ Thunderbolt 6Gb/s MR controller ]
+.Bl -bullet -compact
+.It
+LSI MegaRAID SAS 9265
+.It
+LSI MegaRAID SAS 9266
+.It
+LSI MegaRAID SAS 9267
+.It
+LSI MegaRAID SAS 9270
+.It
+LSI MegaRAID SAS 9271
+.It
+LSI MegaRAID SAS 9272
+.It
+LSI MegaRAID SAS 9285
+.It
+LSI MegaRAID SAS 9286
+.It
+DELL PERC H810
+.It
+DELL PERC H710/P
+.El
+.Pp
+[ Invader/Fury 12Gb/s MR controller ]
+.Bl -bullet -compact
+.It
+LSI MegaRAID SAS 9380
+.It
+LSI MegaRAID SAS 9361
+.It
+LSI MegaRAID SAS 9341
+.It
+DELL PERC H830
+.It
+DELL PERC H730/P
+.It
+DELL PERC H330
+.El
+.Sh CONFIGURATION
+To disable Online Controller Reset(OCR) for a specific
+.Nm
+driver instance, set the
+following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mrsas.X.disable_ocr=1
+.Ed
+.Pp
+where X is the adapter number.
+.Pp
+To change the I/O timeout value for a specific
+.Nm
+driver instance, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mrsas.X.mrsas_io_timeout=NNNNNN
+.Ed
+.Pp
+where NNNNNN is the timeout value in milli-seconds.
+.Pp
+To change the firmware fault check timer value for a specific
+.Nm
+driver instance, set the following tunable value in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+dev.mrsas.X.mrsas_fw_fault_check_delay=NN
+.Ed
+.Pp
+where NN is the fault check delay value in seconds.
+.Pp
+The current number of active I/O commands is shown in the
+.Va dev.mrsas.X.fw_outstanding
+.Xr sysctl 8
+variable.
+.Sh DEBUGGING
+To enable debugging prints from the
+.Nm
+driver, set the
+.Va hw.mrsas.X.debug_level
+variable, where X is the adapter number, either in
+.Xr loader.conf 5
+or via
+.Xr sysctl 8 .
+The following bits have the described effects:
+.Bl -tag -offset indent
+.It 0x01
+Enable informational prints.
+.It 0x02
+Enable tracing prints.
+.It 0x04
+Enable prints for driver faults.
+.It 0x08
+Enable prints for OCR and I/O timeout.
+.It 0x10
+Enable prints for AEN events.
+.El
+.Sh PRIORITY
+The
+.Nm
+driver will always set a default (-30) priority in the PCI subsystem for
+selection of MR-Fusion cards.
+(It is between
+.Dv BUS_PROBE_DEFAULT
+and
+.Dv BUS_PROBE_LOW_PRIORITY ) .
+MR-Fusion Controllers include all cards with the
+Device IDs -
+0x005B,
+0x005D,
+0x005F.
+.Pp
+The
+.Xr mfi 4
+driver will set a priority of either
+.Dv BUS_PROBE_DEFAULT
+or
+.Dv BUS_PROBE_LOW_PRIORITY
+(depending on the device.hints setting) in the PCI
+subsystem for selection of MR-Fusion cards.
+With the above design in place, the
+.Xr mfi 4
+driver will attach to a MR-Fusion card given that it has a higher priority than
+.Nm .
+.Pp
+Using
+.Pa /boot/device.hints
+(as mentioned below), the user can provide a preference
+for the
+.Nm
+driver to detect a MR-Fusion card instead of the
+.Xr mfi 4
+driver.
+.Bd -ragged -offset indent
+.Cd hw.mfi.mrsas_enable="1"
+.Ed
+.Pp
+At boot time, the
+.Xr mfi 4
+driver will get priority to detect MR-Fusion controllers by default.
+Before
+changing this default driver selection policy, LSI advises users to understand
+how the driver selection policy works.
+LSI's policy is to provide priority to
+the
+.Xr mfi 4
+driver to detect MR-Fusion cards, but allow for the ability to choose the
+.Nm
+driver to detect MR-Fusion cards.
+.Pp
+LSI recommends setting hw.mfi.mrsas_enable="0" for customers who are using the
+older
+.Xr mfi 4
+driver and do not want to switch to
+.Nm .
+For those customers who are using a MR-Fusion controller for the first time, LSI
+recommends using the
+.Nm
+driver and setting hw.mfi.mrsas_enable="1".
+.Pp
+Changing the default behavior is well tested under most conditions, but
+unexpected behavior may pop up if more complex and unrealistic operations are
+executed by switching between the
+.Xr mfi 4
+and
+.Nm
+drivers for MR-Fusion.
+Switching drivers is designed to happen only one time.
+Although multiple
+switching is possible, it is not recommended.
+The user should decide from
+.Nm Start of Day
+which driver they want to use for the MR-Fusion card.
+.Pp
+The user may see different device names when switching from
+.Xr mfi 4
+to
+.Nm .
+This behavior is
+.Nm Functions As Designed
+and the user needs to change the
+.Xr fstab 5
+entry manually if they are doing any experiments with
+.Xr mfi 4
+and
+.Nm
+interoperability.
+.Sh FILES
+.Bl -tag -width ".Pa /dev/mrsas?" -compact
+.It Pa /dev/da?
+array/logical disk interface
+.It Pa /dev/mrsas?
+management interface
+.El
+.Sh SEE ALSO
+.Xr cam 4 ,
+.Xr mfi 4 ,
+.Xr pci 4 ,
+.Xr device.hints 5 ,
+.Xt camcontrol 8
+.Sh HISTORY
+The
+.Nm
+driver first appeared in
+.Fx 10.1 .
+.Bd -ragged
+.Cd "mfi Driver:"
+.Xr mfi 4
+is the old
+.Fx
+driver which started with support for Gen-1 Controllers and
+was extended to support up to MR-Fusion (Device ID = 0x005B, 0x005D, 0x005F).
+.Ed
+.Bd -ragged
+.Cd "mrsas Driver:"
+.Nm
+is the new driver reworked by LSI which supports Thunderbolt and onward
+products.
+The SAS+SATA RAID controller with device id 0x005b is referred to as
+the Thunderbolt controller throughout this man page.
+.Ed
+.Bd -ragged
+.Nm cam aware HBA drivers:
+.Fx
+has a
+.Xr cam 4
+layer which attaches storage devices and provides a common access mechanism to
+storage controllers and attached devices.
+The
+.Nm
+driver is
+.Xr cam 4
+aware and devices associated with
+.Nm
+can be seen using
+.Xr camcontrol 8 .
+The
+.Xr mfi 4
+driver does not understand the
+.Xr cam 4
+layer and it directly associates storage disks to the block layer.
+.Pp
+.Nm Thunderbolt Controller:
+This is the 6Gb/s MegaRAID HBA card which has device id 0x005B.
+.Pp
+.Nm Invader Controller:
+This is 12Gb/s MegaRAID HBA card which has device id 0x005D.
+.Pp
+.Nm Fury Controller:
+This is the 12Gb/s MegaRAID HBA card which has device id 0x005F.
+.Ed
+.Sh AUTHORS
+The
+.Nm
+driver and this manual page were written by
+.An Kashyap Desai Aq Kashyap.Desai@lsi.com .
+.Sh TODO
+The driver does not support big-endian architectures at this time.
+.Pp
+The driver does not support alias for device name (it is required when the user
+switches between two drivers and does not want to edit
+.Pa /etc/fstab
+manually).
+.Pp
+The
+.Nm
+driver exposes devices as
+.Pa /dev/da? ,
+whereas
+.Xr mfi 4
+exposes devices as
+.Pa /dev/mfid? .
+.Pp
+.Nm
+does not support the Linux Emulator interface.
+.Pp
+.Nm
+will not work with
+.Xr mfiutil 8 .
diff --git a/share/man/man4/null.4 b/share/man/man4/null.4
index 05ba12a70e58..067c2d8e7f39 100644
--- a/share/man/man4/null.4
+++ b/share/man/man4/null.4
@@ -48,6 +48,7 @@ device is always zero.
.It Pa /dev/null
.El
.Sh SEE ALSO
+.Xr full 4 ,
.Xr zero 4
.Sh HISTORY
A
diff --git a/share/man/man4/proto.4 b/share/man/man4/proto.4
new file mode 100644
index 000000000000..f0fd60a88582
--- /dev/null
+++ b/share/man/man4/proto.4
@@ -0,0 +1,134 @@
+.\"
+.\" Copyright (c) 2014 Marcel Moolenaar
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+.\"
+.\" $FreeBSD$
+.\"
+.Dd April 29, 2014
+.Dt PROTO 4
+.Os
+.\"
+.Sh NAME
+.Nm proto
+.Nd Driver for prototyping and H/W diagnostics
+.\"
+.Sh SYNOPSIS
+To compile this driver into the kernel,
+place the following line in your
+kernel configuration file:
+.Bd -ragged -offset indent
+.Cd "device proto"
+.Ed
+.Pp
+Alternatively, to load the driver as a
+module at boot time, place the following line in
+.Xr loader.conf 5 :
+.Bd -literal -offset indent
+proto_load="YES"
+.Ed
+.\"
+.Sh DESCRIPTION
+The
+.Nm
+device driver attaches to PCI devices when no other device drivers are
+present and creates device special files for all resources associated
+with the device.
+The driver itself has no knowledge of the device it attaches to.
+Programs can open these device special files and perform register-level
+reads and writes.
+As such, the
+.Nm
+device driver is nothing but a conduit or gateway between user space
+programs and the hardware device.
+.Pp
+Examples for why this is useful include hardware diagnostics and prototyping.
+In both these use cases, it is far more convenient to develop and run the
+logic in user space.
+Especially hardware diagnostics requires a somewhat user-friendly interface
+and adequate reporting.
+Neither is done easily as kernel code.
+.\"
+.Sh FILES
+All device special files corresponding to a PCI device are located under
+.Pa /dev/proto/pci<d>:<b>:<s>:<f>
+with
+.Pa pci<d>:<b>:<s>:<f>
+representing the location of the PCI device in the PCI hierarchy.
+A location includes:
+.Bl -tag -width XXXXXX -compact
+.It <d>
+The PCI domain number
+.It <b>
+The PCI bus number
+.It <s>
+The PCI slot or device number
+.It <f>
+The PCI function number
+.El
+.Pp
+Every PCI device has a device special file called
+.Pa pcicfg .
+This device special file gives access to the PCI configuration space.
+For each valid base address register (BAR), a device special file is created
+that contains the BAR offset and the resource type.
+A resource type can be either
+.Pa io
+or
+.Pa mem
+representing I/O port or memory mapped I/O space (resp.)
+.\"
+.Sh EXAMPLES
+A single function PCI device in domain 0, on bus 1, in slot 2 and having a
+single memory mapped I/O region will have the following device special files:
+.Bl -tag -compact
+.It Pa /dev/proto/pci0:1:2:0/10.mem
+.It Pa /dev/proto/pci0:1:2:0/pcicfg
+.El
+.\"
+.Sh SECURITY CONSIDERATIONS
+Because programs have direct access to the hardware, the
+.Nm
+driver is inherently insecure.
+It is not advisable to use this driver on a production machine.
+.\"
+.Sh MISSING FUNCTIONALITY
+The
+.Nm
+driver does not yet support interrupts.
+Since interrupts cannot be handled by the driver itself, they must be converted
+into signals and delivered to the program that has registered for interrupts.
+.Pp
+In order to test the transmission or reception of data, some means of doing
+direct memory access (DMA) by the device must be possible.
+This too must be under the control of the program.
+The details of how a program can set up and
+initiate DMA still need to be fleshed out.
+.Pp
+Support for non-PCI devices has not been implemented yet.
+.\"
+.Sh AUTHORS
+The
+.Nm
+device driver and this manual page were written by
+.An Marcel Moolenaar Aq marcel@xcllnt.net .
diff --git a/share/man/man4/rsu.4 b/share/man/man4/rsu.4
index 5d5c56c30061..e26e3588fe82 100644
--- a/share/man/man4/rsu.4
+++ b/share/man/man4/rsu.4
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd July 29 2013
+.Dd May 3, 2014
.Dt RSU 4
.Os
.Sh NAME
@@ -40,7 +40,8 @@ place the following line in
if_rsu_load="YES"
.Ed
.Pp
-After you have read the license in /usr/share/doc/legal/realtek
+After you have read the license in
+.Pa /usr/share/doc/legal/realtek
you will want to add the following lines to
.Xr loader.conf 5 :
.Bd -literal -offset indent
@@ -93,18 +94,19 @@ due to serious weaknesses in it.
The
.Nm
driver can be configured at runtime with
-.Xr ifconfig 8
-or on boot with
-.Xr hostname 1 .
+.Xr ifconfig 8 .
.Sh FILES
The driver needs at least version 1.2 of the following firmware file,
which is loaded when an interface is attached:
.Pp
.Bl -tag -width Ds -offset indent -compact
-.It /boot/kernel/rsu-rtl8712fw.ko
+.It Pa /boot/kernel/rsu-rtl8712fw.ko
.El
.Sh HARDWARE
-The following adapters should work:
+The
+.Nm
+driver provices support for Realtek RTL8188SU/RTL8192SU USB IEEE 802.11b/g/n
+wireless network adapters, including:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It ASUS USB-N10
@@ -149,14 +151,15 @@ The driver will reset the hardware.
This should not happen.
.El
.Sh SEE ALSO
-.Xr hostname 1 ,
.Xr intro 1 ,
-.Xr usb 3 ,
+.Xr usb 4 ,
.Xr netintro 4 ,
.Xr rsufw 4 ,
.Xr wlan 4 ,
.Xr arp 8 ,
-.Xr ifconfig 8
+.Xr hostapd 8 ,
+.Xr ifconfig 8 ,
+.Xr wpa_supplicant 8
.Sh HISTORY
The
.Nm
diff --git a/share/man/man4/tnt4882.4 b/share/man/man4/tnt4882.4
index d95ff8981cf2..e3eacbb3d49c 100644
--- a/share/man/man4/tnt4882.4
+++ b/share/man/man4/tnt4882.4
@@ -44,7 +44,7 @@ This chip emulates a NEC \(mcPD7210 controller IC as the main
interface between the host computer and the instrument bus.
.Sh SEE ALSO
.Xr gpib 3 ,
-.Xr gpib 4 ,
+.Xr gpib 4
.Sh HISTORY
The
.Nm
diff --git a/share/man/man4/urtwn.4 b/share/man/man4/urtwn.4
index ec1b612c9771..da1db76cb415 100644
--- a/share/man/man4/urtwn.4
+++ b/share/man/man4/urtwn.4
@@ -14,7 +14,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd April 25, 2014
+.Dd May 3, 2014
.Dt URTWN 4
.Os
.Sh NAME
@@ -80,7 +80,10 @@ must be agreed by adding the following line to
firmware license
.El
.Sh HARDWARE
-The following adapters should work:
+The
+.Nm
+driver supports Realtek RTL8188CU/RTL8188EU/RTL8192CU based USB
+IEEE 802.11b/g/n wireless network adapters, including:
.Pp
.Bl -tag -width Ds -offset indent -compact
.It ASUS USB-N10 NANO
@@ -122,9 +125,9 @@ The driver will reset the hardware.
This should not happen.
.El
.Sh SEE ALSO
-.Xr urtwnfw 4 ,
.Xr intro 4 ,
.Xr netintro 4 ,
+.Xr urtwnfw 4 ,
.Xr usb 4 ,
.Xr wlan 4 ,
.Xr wlan_ccmp 4 ,
diff --git a/share/man/man4/vtnet.4 b/share/man/man4/vtnet.4
index c7b2189abbb0..d3d7bc81d5cd 100644
--- a/share/man/man4/vtnet.4
+++ b/share/man/man4/vtnet.4
@@ -35,7 +35,7 @@ To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
-.Cd "device if_vtnet"
+.Cd "device vtnet"
.Ed
.Pp
Alternatively, to load the driver as a
diff --git a/share/man/man4/zero.4 b/share/man/man4/zero.4
index cb73a2c6549f..c2ba4bd4b54b 100644
--- a/share/man/man4/zero.4
+++ b/share/man/man4/zero.4
@@ -49,6 +49,7 @@ supply of null bytes when read.
.It Pa /dev/zero
.El
.Sh SEE ALSO
+.Xr full 4 ,
.Xr null 4
.Sh HISTORY
A
diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile
index e0bd22247d40..541f21176f07 100644
--- a/share/man/man5/Makefile
+++ b/share/man/man5/Makefile
@@ -1,7 +1,7 @@
# @(#)Makefile 8.1 (Berkeley) 6/5/93
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
#MISSING: dump.5 plot.5
MAN= acct.5 \
diff --git a/share/man/man5/make.conf.5 b/share/man/man5/make.conf.5
index 2480b84d857e..441de4b0a173 100644
--- a/share/man/man5/make.conf.5
+++ b/share/man/man5/make.conf.5
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd May 28, 2013
+.Dd May 2, 2014
.Dt MAKE.CONF 5
.Os
.Sh NAME
@@ -692,6 +692,8 @@ and
.Ev MAKEOBJDIR
are environment variables and should not be set in
.Nm
+or as command line arguments to
+.Xr make 1 ,
but in make's environment.
.Sh BUGS
This manual page may occasionally be out of date with respect to
diff --git a/share/man/man9/Makefile b/share/man/man9/Makefile
index 37ba7f2e85fc..453f3c0850df 100644
--- a/share/man/man9/Makefile
+++ b/share/man/man9/Makefile
@@ -192,6 +192,7 @@ MAN= accept_filter.9 \
pci.9 \
pfil.9 \
pfind.9 \
+ pget.9 \
pgfind.9 \
physio.9 \
pmap.9 \
@@ -902,6 +903,7 @@ MLINKS+=\
mbuf.9 m_freem.9 \
mbuf.9 MGET.9 \
mbuf.9 m_get.9 \
+ mbuf.9 m_get2.9 \
mbuf.9 m_getjcl.9 \
mbuf.9 m_getcl.9 \
mbuf.9 m_getclr.9 \
diff --git a/share/man/man9/mbuf.9 b/share/man/man9/mbuf.9
index 4df1d6ab704d..9b75c6136b78 100644
--- a/share/man/man9/mbuf.9
+++ b/share/man/man9/mbuf.9
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd January 16, 2014
+.Dd April 30, 2014
.Dt MBUF 9
.Os
.\"
@@ -64,23 +64,25 @@
.Fn M_TRAILINGSPACE "struct mbuf *mbuf"
.Fn M_MOVE_PKTHDR "struct mbuf *to" "struct mbuf *from"
.Fn M_PREPEND "struct mbuf *mbuf" "int len" "int how"
-.Fn MCHTYPE "struct mbuf *mbuf" "u_int type"
+.Fn MCHTYPE "struct mbuf *mbuf" "short type"
.Ft int
.Fn M_WRITABLE "struct mbuf *mbuf"
.\"
.Ss Mbuf allocation functions
.Ft struct mbuf *
-.Fn m_get "int how" "int type"
+.Fn m_get "int how" "short type"
.Ft struct mbuf *
-.Fn m_getm "struct mbuf *orig" "int len" "int how" "int type"
+.Fn m_get2 "int size" "int how" "short type" "int flags"
+.Ft struct mbuf *
+.Fn m_getm "struct mbuf *orig" "int len" "int how" "short type"
.Ft struct mbuf *
.Fn m_getjcl "int how" "short type" "int flags" "int size"
.Ft struct mbuf *
.Fn m_getcl "int how" "short type" "int flags"
.Ft struct mbuf *
-.Fn m_getclr "int how" "int type"
+.Fn m_getclr "int how" "short type"
.Ft struct mbuf *
-.Fn m_gethdr "int how" "int type"
+.Fn m_gethdr "int how" "short type"
.Ft struct mbuf *
.Fn m_free "struct mbuf *mbuf"
.Ft void
@@ -528,6 +530,10 @@ The functions are:
A function version of
.Fn MGET
for non-critical paths.
+.It Fn m_get2 size how type flags
+Allocate an
+.Vt mbuf
+with enough space to hold specified amount of data.
.It Fn m_getm orig len how type
Allocate
.Fa len
diff --git a/share/man/man9/pget.9 b/share/man/man9/pget.9
new file mode 100644
index 000000000000..12eda29ca7c8
--- /dev/null
+++ b/share/man/man9/pget.9
@@ -0,0 +1,107 @@
+.\" Copyright (c) 2011 Sergey Kandaurov
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\" 2. Redistributions in binary form must 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$
+.\"
+.Dd May 3, 2014
+.Dt PGET 9
+.Os
+.Sh NAME
+.Nm pget
+.Nd locate a process by number
+.Sh SYNOPSIS
+.In sys/param.h
+.In sys/proc.h
+.Ft int
+.Fn pget "pid_t pid" "int flags" "struct proc **pp"
+.Sh DESCRIPTION
+This function
+takes a
+.Fa pid
+as its argument,
+which can be either a process or thread id,
+and fills a pointer to the
+.Vt proc
+structure in
+.Fa *pp .
+In the latter case, a process owning the specified thread is looked for.
+The operation is performed by invoking the
+.Xr pfind 9
+function.
+The found process is returned locked.
+For the
+.Dv PGET_HOLD
+case, it is returned unlocked (but held).
+The
+.Fn pget
+function can
+perform additional manipulations, depending on a
+.Fa flags
+argument.
+.Pp
+The
+.Fa flags
+argument is the logical OR of some subset of:
+.Bl -tag -width ".Dv PGET_NOTINEXEC"
+.It Dv PGET_HOLD
+If set, the found process will be held and unlocked.
+.It Dv PGET_CANSEE
+If set, the found process will be checked for its visibility.
+See
+.Xr p_cansee 9 .
+.It Dv PGET_CANDEBUG
+If set, the found process will be checked for its debuggability.
+See
+.Xr p_candebug 9 .
+.It Dv PGET_ISCURRENT
+If set, the found process will be checked that it matches the current
+process context.
+.It Dv PGET_NOTWEXIT
+If set, the found process will be checked that it does not have the process
+flag
+.Dv P_WEXIT
+set.
+.It Dv PGET_NOTINEXEC
+If set, the found process will be checked that it does not have the process
+flag
+.Dv P_INEXEC
+set.
+.It Dv PGET_NOTID
+If set,
+.Fa pid
+is not assumed as a thread id for values larger than
+.Dv PID_MAX .
+.It Dv PGET_WANTREAD
+If set, the found process will be checked that the caller may get
+a read access to its structure.
+A shorthand for
+.Pq Dv PGET_HOLD | PGET_CANDEBUG | PGET_NOTWEXIT .
+.El
+.Sh RETURN VALUES
+If the process is found in the specified way, then zero is returned,
+otherwise an appropriate error code is returned.
+.Sh SEE ALSO
+.Xr p_candebug 9 ,
+.Xr p_cansee 9 ,
+.Xr pfind 9
diff --git a/share/mk/Makefile b/share/mk/Makefile
index 75cd9be82a0b..ca3d8b3cff79 100644
--- a/share/mk/Makefile
+++ b/share/mk/Makefile
@@ -1,7 +1,7 @@
# $FreeBSD$
# @(#)Makefile 8.1 (Berkeley) 6/8/93
-.include <bsd.own.mk>
+.include <src.opts.mk>
FILES= \
bsd.README \
@@ -42,6 +42,9 @@ FILES= \
sys.mk \
version_gen.awk
+# Installed for the moment, but not may not be in the future.
+#FILES+= src.opts.mk
+
FILESDIR= ${BINDIR}/mk
.if ${MK_TESTS} != "no"
diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk
index 6554625bd4e9..ca15d656596c 100644
--- a/share/mk/bsd.compiler.mk
+++ b/share/mk/bsd.compiler.mk
@@ -1,5 +1,8 @@
# $FreeBSD$
+.if !target(__<bsd.compiler.mk>__)
+__<bsd.compiler.mk>__:
+
.if ${MACHINE} == "common"
COMPILER_TYPE= none
.endif
@@ -34,3 +37,5 @@ COMPILER_VERSION:= ${_COMPILER_VERSION:M[1-9].[0-9]*}
.else
COMPILER_FEATURES=
.endif
+
+.endif # !target(__<bsd.compiler.mk>__)
diff --git a/share/mk/bsd.mkopt.mk b/share/mk/bsd.mkopt.mk
index b86658340421..3f22bc8aac9a 100644
--- a/share/mk/bsd.mkopt.mk
+++ b/share/mk/bsd.mkopt.mk
@@ -1,22 +1,34 @@
#
# $FreeBSD$
#
-# Generic mechanism to deal with WITH and WITHOUT options and turn them into MK_ options.
+# Generic mechanism to deal with WITH and WITHOUT options and turn
+# them into MK_ options.
#
+# For each option FOO in __DEFUALT_YES_OPTIONS, MK_FOO is set to
+# "yes", unless WITHOUT_FOO is defined, in which case it is set to
+# "no".
#
-# For each option FOO that defaults to YES, MK_FOO is set to yes, unless WITHOUT_FOO
-# is defined, in which case it is set to no. If both WITH_FOO and WITHOUT_FOO are
-# defined, WITHOUT_FOO wins. The list of default yes options is contained in the
-# __DEFAULT_YES_OPTIONS variable, which is undefined after expansion.
+# For each option FOO in __DEFUALT_NO_OPTIONS, MK_FOO is set to "no",
+# unless WITH_FOO is defined, in which case it is set to "yes".
#
-# For each option FOO that defaults to NO, MK_FOO is set to no, unless WITH_FOO
-# is defined, in which case it is set to yes. If both WITH_FOO and WITHOUT_FOO are
-# defined, WITH_FOO wins. The list of default no options is contained in the
-# __DEFAULT_NO_OPTIONS variable, which is undefined after expansion.
+# If both WITH_FOO and WITHOUT_FOO are defined, WITHOUT_FOO wins and
+# MK_FOO is set to "no" regardless of which list it was in.
+#
+# Both __DEFAULT_YES_OPTIONS and __DEFAULT_NO_OPTIONS are undef'd
+# after all this processing, allowing this file to be included
+# multiple times with different lists.
+#
+# Users should generally define WITH_FOO or WITHOUT_FOO, but the build
+# system should use MK_FOO={yes,no} when it needs to override the
+# user's desires or default behavior.
+#
+
+#
+# MK_* options which default to "yes".
#
.for var in ${__DEFAULT_YES_OPTIONS}
.if !defined(MK_${var})
-.if defined(WITHOUT_${var}) # IF both WITH and WITHOUT defined, WITHOUT wins.
+.if defined(WITHOUT_${var}) # WITHOUT always wins
MK_${var}:= no
.else
MK_${var}:= yes
@@ -30,7 +42,7 @@ MK_${var}:= yes
#
.for var in ${__DEFAULT_NO_OPTIONS}
.if !defined(MK_${var})
-.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT wins
+.if defined(WITH_${var}) && !defined(WITHOUT_${var}) # WITHOUT aways wins
MK_${var}:= yes
.else
MK_${var}:= no
diff --git a/share/mk/bsd.opts.mk b/share/mk/bsd.opts.mk
index f689dc91fbbc..5f6a4db0edfc 100644
--- a/share/mk/bsd.opts.mk
+++ b/share/mk/bsd.opts.mk
@@ -31,11 +31,6 @@
__<bsd.opts.mk>__:
.if !defined(_WITHOUT_SRCCONF)
-SRCCONF?= /etc/src.conf
-.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
-.include "${SRCCONF}"
-.endif
-
#
# Define MK_* variables (which are either "yes" or "no") for users
# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
@@ -56,6 +51,7 @@ __DEFAULT_YES_OPTIONS = \
MAN \
MANCOMPRESS \
NIS \
+ NLS \
OPENSSH \
PROFILE \
SSP \
@@ -65,196 +61,16 @@ __DEFAULT_YES_OPTIONS = \
__DEFAULT_NO_OPTIONS = \
CTF \
DEBUG_FILES \
- INSTALL_AS_USER \
-
-.include <bsd.mkopt.mk>
+ INSTALL_AS_USER
-# Note: __DEFAULT_{YES,NO}_OPTIONS unset by bsd.mkopt.mk
-# These options are used by src the builds
-
-__DEFAULT_YES_OPTIONS = \
- ACCT \
- ACPI \
- AMD \
- APM \
- ARM_EABI \
- AT \
- ATM \
- AUDIT \
- AUTHPF \
- BINUTILS \
- BINUTILS_BOOTSTRAP \
- BLUETOOTH \
- BMAKE \
- BOOT \
- BSD_CPIO \
- BSNMP \
- BZIP2 \
- CALENDAR \
- CAPSICUM \
- CASPER \
- CDDL \
- CPP \
- CROSS_COMPILER \
- CRYPT \
- CTM \
- CXX \
- DICT \
- DMAGENT \
- DYNAMICROOT \
- ED_CRYPTO \
- EXAMPLES \
- FDT \
- FLOPPY \
- FMTREE \
- FORMAT_EXTENSIONS \
- FORTH \
- FP_LIBC \
- FREEBSD_UPDATE \
- GAMES \
- GCOV \
- GDB \
- GNU \
- GNU_GREP_COMPAT \
- GPIB \
- GPIO \
- GPL_DTC \
- GROFF \
- HTML \
- ICONV \
- INET \
- INET6 \
- IPFILTER \
- IPFW \
- JAIL \
- KDUMP \
- KERNEL_SYMBOLS \
- KVM \
- LDNS \
- LDNS_UTILS \
- LEGACY_CONSOLE \
- LIB32 \
- LIBPTHREAD \
- LIBTHR \
- LOCALES \
- LOCATE \
- LPR \
- LS_COLORS \
- LZMA_SUPPORT \
- MAIL \
- MAILWRAPPER \
- MAKE \
- NCURSESW \
- NDIS \
- NETCAT \
- NETGRAPH \
- NLS \
- NLS_CATALOGS \
- NS_CACHING \
- NTP \
- OPENSSL \
- PAM \
- PC_SYSINSTALL \
- PF \
- PKGBOOTSTRAP \
- PMC \
- PORTSNAP \
- PPP \
- QUOTAS \
- RCMDS \
- RCS \
- RESCUE \
- ROUTED \
- SENDMAIL \
- SETUID_LOGIN \
- SHAREDOCS \
- SOURCELESS \
- SOURCELESS_HOST \
- SOURCELESS_UCODE \
- SVNLITE \
- SYSCALL_COMPAT \
- SYSCONS \
- SYSINSTALL \
- TCSH \
- TELNET \
- TEXTPROC \
- UNBOUND \
- USB \
- UTMPX \
- VI \
- WIRELESS \
- WPA_SUPPLICANT_EAPOL \
- ZFS \
- ZONEINFO
-
-__DEFAULT_NO_OPTIONS = \
+# meta mode related
+__DEFAULT_NO_OPTIONS += \
AUTO_OBJ \
- BSD_GREP \
- CLANG_EXTRAS \
- EISA \
- HESIOD \
- LLDB \
META_MODE \
- NAND \
- OFED \
- OPENLDAP \
- OPENSSH_NONE_CIPHER \
- SHARED_TOOLCHAIN \
- SORT_THREADS \
STAGING \
- STAGING_PROG \
- SVN \
- TESTS \
- USB_GADGET_EXAMPLES
-
-#
-# Default behaviour of some options depends on the architecture. Unfortunately
-# this means that we have to test TARGET_ARCH (the buildworld case) as well
-# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
-# used at all in bsd.*.mk, but we have to make an exception here if we want
-# to allow defaults for some things like clang to vary by target architecture.
-# Additional, per-target behavior should be rarely added only after much
-# gnashing of teeth and grinding of gears.
-#
-.if defined(TARGET_ARCH)
-__T=${TARGET_ARCH}
-.else
-__T=${MACHINE_ARCH}
-.endif
-.if defined(TARGET)
-__TT=${TARGET}
-.else
-__TT=${MACHINE}
-.endif
-# Clang is only for x86, powerpc and little-endian arm right now, by default.
-.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
-__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
-.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf"
-__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP
-# GCC is unable to build the full clang on arm, disable it by default.
-__DEFAULT_NO_OPTIONS+=CLANG_FULL
-.else
-__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
-.endif
-# Clang the default system compiler only on little-endian arm and x86.
-.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
- ${__T} == "armv6hf" || ${__T} == "i386"
-__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
-__DEFAULT_NO_OPTIONS+=GNUCXX
-# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
-# for pc98 for now.
-.if ${__TT} == "pc98"
-__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP
-.else
-__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP
-.endif
-.else
-# If clang is not cc, then build gcc by default
-__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP
-__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP
-.endif
-
+ STAGING_PROG
+
.include <bsd.mkopt.mk>
#
@@ -270,154 +86,12 @@ __DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP
MAN \
PROFILE
.if defined(NO_${var})
-.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
+# This warning may be premature...
+#.warning "NO_${var} is defined, but deprecated. Please use MK_${var}=no instead."
MK_${var}:=no
.endif
.endfor
-#
-# MK_* options that default to "yes" if the compiler is a C++11 compiler.
-#
-.include <bsd.compiler.mk>
-.for var in \
- LIBCPLUSPLUS
-.if !defined(MK_${var})
-.if ${COMPILER_FEATURES:Mc++11}
-.if defined(WITHOUT_${var})
-MK_${var}:= no
-.else
-MK_${var}:= yes
-.endif
-.else
-.if defined(WITH_${var})
-MK_${var}:= yes
-.else
-MK_${var}:= no
-.endif
-.endif
-.endif
-.endfor
-
-#
-# Force some options off if their dependencies are off.
-# Order is somewhat important.
-#
-.if ${MK_LIBPTHREAD} == "no"
-MK_LIBTHR:= no
-.endif
-
-.if ${MK_LDNS} == "no"
-MK_LDNS_UTILS:= no
-MK_UNBOUND:= no
-.endif
-
-.if ${MK_SOURCELESS} == "no"
-MK_SOURCELESS_HOST:= no
-MK_SOURCELESS_UCODE:= no
-.endif
-
-.if ${MK_CDDL} == "no"
-MK_ZFS:= no
-MK_CTF:= no
-.endif
-
-.if ${MK_CRYPT} == "no"
-MK_OPENSSL:= no
-MK_OPENSSH:= no
-MK_KERBEROS:= no
-.endif
-
-.if ${MK_CXX} == "no"
-MK_CLANG:= no
-MK_GROFF:= no
-.endif
-
-.if ${MK_MAIL} == "no"
-MK_MAILWRAPPER:= no
-MK_SENDMAIL:= no
-MK_DMAGENT:= no
-.endif
-
-.if ${MK_NETGRAPH} == "no"
-MK_ATM:= no
-MK_BLUETOOTH:= no
-.endif
-
-.if ${MK_OPENSSL} == "no"
-MK_OPENSSH:= no
-MK_KERBEROS:= no
-.endif
-
-.if ${MK_PF} == "no"
-MK_AUTHPF:= no
-.endif
-
-.if ${MK_TEXTPROC} == "no"
-MK_GROFF:= no
-.endif
-
-.if ${MK_CROSS_COMPILER} == "no"
-MK_BINUTILS_BOOTSTRAP:= no
-MK_CLANG_BOOTSTRAP:= no
-MK_GCC_BOOTSTRAP:= no
-.endif
-
-.if ${MK_TOOLCHAIN} == "no"
-MK_BINUTILS:= no
-MK_CLANG:= no
-MK_GCC:= no
-MK_GDB:= no
-.endif
-
-.if ${MK_CLANG} == "no"
-MK_CLANG_EXTRAS:= no
-MK_CLANG_FULL:= no
-.endif
-
-#
-# Set defaults for the MK_*_SUPPORT variables.
-#
-
-#
-# MK_*_SUPPORT options which default to "yes" unless their corresponding
-# MK_* variable is set to "no".
-#
-.for var in \
- BZIP2 \
- GNU \
- INET \
- INET6 \
- KERBEROS \
- KVM \
- NETGRAPH \
- PAM \
- WIRELESS
-.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
-MK_${var}_SUPPORT:= no
-.else
-MK_${var}_SUPPORT:= yes
-.endif
-.endfor
-
-#
-# MK_* options whose default value depends on another option.
-#
-.for vv in \
- GSSAPI/KERBEROS \
- MAN_UTILS/MAN
-.if defined(WITH_${vv:H})
-MK_${vv:H}:= yes
-.elif defined(WITHOUT_${vv:H})
-MK_${vv:H}:= no
-.else
-MK_${vv:H}:= ${MK_${vv:T}}
-.endif
-.endfor
-
-.if !${COMPILER_FEATURES:Mc++11}
-MK_LLDB:= no
-.endif
-
.endif # !_WITHOUT_SRCCONF
.endif
diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk
index 3105cd63d0a2..952ca21a2852 100644
--- a/share/mk/bsd.own.mk
+++ b/share/mk/bsd.own.mk
@@ -1,6 +1,6 @@
# $FreeBSD$
#
-# The include file <bsd.own.mk> set common variables for owner,
+# The include file <src.opts.mk> set common variables for owner,
# group, mode, and directories. Defaults are in brackets.
#
#
@@ -234,4 +234,7 @@ COMPRESS_EXT?= .gz
# overriden by Makefiles, but the user may choose to set this in src.conf(5).
TESTSBASE?= /usr/tests
+# Compat for the moment
+.include <bsd.compiler.mk>
+
.endif # !target(__<bsd.own.mk>__)
diff --git a/share/mk/bsd.prog.mk b/share/mk/bsd.prog.mk
index fc6ccbe0cac0..976794d5cad6 100644
--- a/share/mk/bsd.prog.mk
+++ b/share/mk/bsd.prog.mk
@@ -2,6 +2,7 @@
# $FreeBSD$
.include <bsd.init.mk>
+.include <bsd.compiler.mk>
.SUFFIXES: .out .o .c .cc .cpp .cxx .C .m .y .l .ln .s .S .asm
diff --git a/share/mk/bsd.sys.mk b/share/mk/bsd.sys.mk
index ca59d0b69380..a587b0d28b15 100644
--- a/share/mk/bsd.sys.mk
+++ b/share/mk/bsd.sys.mk
@@ -24,7 +24,6 @@ CFLAGS+= -std=iso9899:1999
.else # CSTD
CFLAGS+= -std=${CSTD}
.endif # CSTD
-.if !defined(NO_WARNS)
# -pedantic is problematic because it also imposes namespace restrictions
#CFLAGS+= -pedantic
.if defined(WARNS)
@@ -52,9 +51,8 @@ CWARNFLAGS+= -Wcast-align
.if ${WARNS} >= 6
CWARNFLAGS+= -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls\
-Wold-style-definition
-.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD) && \
- !defined(NO_WMISSING_VARIABLE_DECLARATIONS)
-CWARNFLAGS+= -Wmissing-variable-declarations
+.if !defined(NO_WMISSING_VARIABLE_DECLARATIONS)
+CWARNFLAGS.clang+= -Wmissing-variable-declarations
.endif
.endif # WARNS >= 6
.if ${WARNS} >= 2 && ${WARNS} <= 4
@@ -65,27 +63,25 @@ CWARNFLAGS+= -Wno-uninitialized
CWARNFLAGS+= -Wno-pointer-sign
# Clang has more warnings enabled by default, and when using -Wall, so if WARNS
# is set to low values, these have to be disabled explicitly.
-.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD)
.if ${WARNS} <= 6
-CWARNFLAGS+= -Wno-empty-body -Wno-string-plus-int
+CWARNFLAGS.clang+= -Wno-empty-body -Wno-string-plus-int
.if ${COMPILER_VERSION} > 3.3
-CWARNFLAGS+= -Wno-unused-const-variable
+CWARNFLAGS.clang+= -Wno-unused-const-variable
.endif
.endif # WARNS <= 6
.if ${WARNS} <= 3
-CWARNFLAGS+= -Wno-tautological-compare -Wno-unused-value\
+CWARNFLAGS.clang+= -Wno-tautological-compare -Wno-unused-value\
-Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion
.endif # WARNS <= 3
.if ${WARNS} <= 2
-CWARNFLAGS+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter
+CWARNFLAGS.clang+= -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter
.endif # WARNS <= 2
.if ${WARNS} <= 1
-CWARNFLAGS+= -Wno-parentheses
+CWARNFLAGS.clang+= -Wno-parentheses
.endif # WARNS <= 1
.if defined(NO_WARRAY_BOUNDS)
-CWARNFLAGS+= -Wno-array-bounds
+CWARNFLAGS.clang+= -Wno-array-bounds
.endif # NO_WARRAY_BOUNDS
-.endif # CLANG
.endif # WARNS
.if defined(FORMAT_AUDIT)
@@ -95,11 +91,9 @@ WFORMAT= 1
.if ${WFORMAT} > 0
#CWARNFLAGS+= -Wformat-nonliteral -Wformat-security -Wno-format-extra-args
CWARNFLAGS+= -Wformat=2 -Wno-format-extra-args
-.if ${COMPILER_TYPE} == "clang" && !defined(EARLY_BUILD)
.if ${WARNS} <= 3
-CWARNFLAGS+= -Wno-format-nonliteral
+CWARNFLAGS.clang+= -Wno-format-nonliteral
.endif # WARNS <= 3
-.endif # CLANG
.if !defined(NO_WERROR) && !defined(NO_WERROR.${COMPILER_TYPE})
CWARNFLAGS+= -Werror
.endif # !NO_WERROR && !NO_WERROR.${COMPILER_TYPE}
@@ -108,32 +102,29 @@ CWARNFLAGS+= -Werror
.if defined(NO_WFORMAT) || defined(NO_WFORMAT.${COMPILER_TYPE})
CWARNFLAGS+= -Wno-format
.endif # NO_WFORMAT || NO_WFORMAT.${COMPILER_TYPE}
-.endif # !NO_WARNS
.if defined(IGNORE_PRAGMA)
CWARNFLAGS+= -Wno-unknown-pragmas
.endif # IGNORE_PRAGMA
-.if !defined(EARLY_BUILD)
.if ${COMPILER_TYPE} == "clang"
+# Would love to do this unconditionally, but can't due to its use in
+# kernel build coupled with CFLAGS.${TARGET} feature
CLANG_NO_IAS= -no-integrated-as
+.endif
CLANG_OPT_SMALL= -mstack-alignment=8 -mllvm -inline-threshold=3\
-mllvm -enable-load-pre=false -mllvm -simplifycfg-dup-ret
-CFLAGS+= -Qunused-arguments
+CFLAGS.clang+= -Qunused-arguments
.if ${MACHINE_CPUARCH} == "sparc64"
# Don't emit .cfi directives, since we must use GNU as on sparc64, for now.
-CFLAGS+= -fno-dwarf2-cfi-asm
+CFLAGS.clang+= -fno-dwarf2-cfi-asm
.endif # SPARC64
# The libc++ headers use c++11 extensions. These are normally silenced because
# they are treated as system headers, but we explicitly disable that warning
# suppression when building the base system to catch bugs in our headers.
# Eventually we'll want to start building the base system C++ code as C++11,
# but not yet.
-CXXFLAGS+= -Wno-c++11-extensions
-.endif # CLANG
-CFLAGS+= ${CFLAGS.${COMPILER_TYPE}}
-CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}}
-.endif # !EARLY_BUILD
+CXXFLAGS.clang+= -Wno-c++11-extensions
.if ${MK_SSP} != "no" && ${MACHINE_CPUARCH} != "ia64" && \
${MACHINE_CPUARCH} != "arm" && ${MACHINE_CPUARCH} != "mips"
@@ -142,9 +133,19 @@ SSP_CFLAGS?= -fstack-protector
CFLAGS+= ${SSP_CFLAGS}
.endif # SSP && !IA64 && !ARM && !MIPS
-# Allow user-specified additional warning flags
-CFLAGS+= ${CWARNFLAGS}
+# Allow user-specified additional warning flags, plus compiler specific flag overrides.
+# Unless we're early in the build, in which case don't (which is lame, this should
+# be handled by NO_WARNS which needs to migrate to something else.
+.if !defined(NO_WARNS) && !defined(EARLY_BUILD)
+CFLAGS+= ${CWARNFLAGS} ${CWARNFLAGS.${COMPILER_TYPE}}
+.endif
+# Not sure this is 100% kosher, but I think that EARLY_BUILD must be only
+# defined when we're not building programs that use the CFLAGS.foo feature.
+.if !defined(EARLY_BUILD)
+CFLAGS+= ${CFLAGS.${COMPILER_TYPE}}
+CXXFLAGS+= ${CXXFLAGS.${COMPILER_TYPE}}
+.endif
# Tell bmake not to mistake standard targets for things to be searched for
# or expect to ever be up-to-date.
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
new file mode 100644
index 000000000000..f82167b87bf6
--- /dev/null
+++ b/share/mk/src.opts.mk
@@ -0,0 +1,376 @@
+# $FreeBSD$
+#
+# Option file for FreeBSD /usr/src builds.
+#
+# Users define WITH_FOO and WITHOUT_FOO on the command line or in /etc/src.conf
+# and /etc/make.conf files. These translate in the build system to MK_FOO={yes,no}
+# with sensible (usually) defaults.
+#
+# Makefiles must include bsd.opts.mk after defining specific MK_FOO options that
+# are applicable for that Makefile (typically there are none, but sometimes there
+# are exceptions). Recursive makes usually add MK_FOO=no for options that they wish
+# to omit from that make.
+#
+# Makefiles must include bsd.srcpot.mk before they test the value of any MK_FOO
+# variable.
+#
+# Makefiles may also assume that this file is included by src.opts.mk should it
+# need variables defined there prior to the end of the Makefile where
+# bsd.{subdir,lib.bin}.mk is traditionally included.
+#
+# The old-style YES_FOO and NO_FOO are being phased out. No new instances of them
+# should be added. Old instances should be removed since they were just to
+# bridge the gap between FreeBSD 4 and FreeBSD 5.
+#
+# Makefiles should never test WITH_FOO or WITHOUT_FOO directly (although an
+# exception is made for _WITHOUT_SRCONF which turns off this mechanism
+# completely).
+#
+
+.if !target(__<src.opts.mk>__)
+__<src.opts.mk>__:
+
+# Compat -- needed still?
+.include <bsd.own.mk>
+
+# Allow user to configure things, but in the future this will move
+# elsehwere...
+
+SRCCONF?= /etc/src.conf
+.if exists(${SRCCONF}) || ${SRCCONF} != "/etc/src.conf"
+.include "${SRCCONF}"
+.endif
+
+#
+# Define MK_* variables (which are either "yes" or "no") for users
+# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
+# make(1) environment.
+# These should be tested with `== "no"' or `!= "no"' in makefiles.
+# The NO_* variables should only be set by makefiles for variables
+# that haven't been converted over.
+#
+
+# These options are used by src the builds
+
+__DEFAULT_YES_OPTIONS = \
+ ACCT \
+ ACPI \
+ AMD \
+ APM \
+ ARM_EABI \
+ AT \
+ ATM \
+ AUDIT \
+ AUTHPF \
+ BINUTILS \
+ BINUTILS_BOOTSTRAP \
+ BLUETOOTH \
+ BOOT \
+ BSD_CPIO \
+ BSNMP \
+ BZIP2 \
+ CALENDAR \
+ CAPSICUM \
+ CASPER \
+ CDDL \
+ CPP \
+ CROSS_COMPILER \
+ CRYPT \
+ CTM \
+ CXX \
+ DICT \
+ DMAGENT \
+ DYNAMICROOT \
+ ED_CRYPTO \
+ EXAMPLES \
+ FDT \
+ FLOPPY \
+ FMTREE \
+ FORMAT_EXTENSIONS \
+ FORTH \
+ FP_LIBC \
+ FREEBSD_UPDATE \
+ GAMES \
+ GCOV \
+ GDB \
+ GNU \
+ GNU_GREP_COMPAT \
+ GPIB \
+ GPIO \
+ GPL_DTC \
+ GROFF \
+ HTML \
+ ICONV \
+ INET \
+ INET6 \
+ IPFILTER \
+ IPFW \
+ JAIL \
+ KDUMP \
+ KERNEL_SYMBOLS \
+ KVM \
+ LDNS \
+ LDNS_UTILS \
+ LEGACY_CONSOLE \
+ LIB32 \
+ LIBPTHREAD \
+ LIBTHR \
+ LOCALES \
+ LOCATE \
+ LPR \
+ LS_COLORS \
+ LZMA_SUPPORT \
+ MAIL \
+ MAILWRAPPER \
+ MAKE \
+ NCURSESW \
+ NDIS \
+ NETCAT \
+ NETGRAPH \
+ NLS_CATALOGS \
+ NS_CACHING \
+ NTP \
+ OPENSSL \
+ PAM \
+ PC_SYSINSTALL \
+ PF \
+ PKGBOOTSTRAP \
+ PMC \
+ PORTSNAP \
+ PPP \
+ QUOTAS \
+ RCMDS \
+ RCS \
+ RESCUE \
+ ROUTED \
+ SENDMAIL \
+ SETUID_LOGIN \
+ SHAREDOCS \
+ SOURCELESS \
+ SOURCELESS_HOST \
+ SOURCELESS_UCODE \
+ SVNLITE \
+ SYSCALL_COMPAT \
+ SYSCONS \
+ SYSINSTALL \
+ TCSH \
+ TELNET \
+ TEXTPROC \
+ UNBOUND \
+ USB \
+ UTMPX \
+ VI \
+ WIRELESS \
+ WPA_SUPPLICANT_EAPOL \
+ ZFS \
+ ZONEINFO
+
+__DEFAULT_NO_OPTIONS = \
+ BSD_GREP \
+ CLANG_EXTRAS \
+ EISA \
+ HESIOD \
+ LLDB \
+ NAND \
+ OFED \
+ OPENLDAP \
+ OPENSSH_NONE_CIPHER \
+ SHARED_TOOLCHAIN \
+ SORT_THREADS \
+ SVN \
+ TESTS \
+ USB_GADGET_EXAMPLES
+
+#
+# Default behaviour of some options depends on the architecture. Unfortunately
+# this means that we have to test TARGET_ARCH (the buildworld case) as well
+# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not
+# used at all in bsd.*.mk, but we have to make an exception here if we want
+# to allow defaults for some things like clang to vary by target architecture.
+# Additional, per-target behavior should be rarely added only after much
+# gnashing of teeth and grinding of gears.
+#
+.if defined(TARGET_ARCH)
+__T=${TARGET_ARCH}
+.else
+__T=${MACHINE_ARCH}
+.endif
+.if defined(TARGET)
+__TT=${TARGET}
+.else
+__TT=${MACHINE}
+.endif
+# Clang is only for x86, powerpc and little-endian arm right now, by default.
+.if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
+__DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
+.elif ${__T} == "arm" || ${__T} == "armv6" || ${__T} == "armv6hf"
+__DEFAULT_YES_OPTIONS+=CLANG CLANG_BOOTSTRAP
+# GCC is unable to build the full clang on arm, disable it by default.
+__DEFAULT_NO_OPTIONS+=CLANG_FULL
+.else
+__DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL CLANG_BOOTSTRAP
+.endif
+# Clang the default system compiler only on little-endian arm and x86.
+.if ${__T} == "amd64" || ${__T} == "arm" || ${__T} == "armv6" || \
+ ${__T} == "armv6hf" || ${__T} == "i386"
+__DEFAULT_YES_OPTIONS+=CLANG_IS_CC
+__DEFAULT_NO_OPTIONS+=GNUCXX
+# The pc98 bootloader requires gcc to build and so we must leave gcc enabled
+# for pc98 for now.
+.if ${__TT} == "pc98"
+__DEFAULT_YES_OPTIONS+=GCC GCC_BOOTSTRAP
+.else
+__DEFAULT_NO_OPTIONS+=GCC GCC_BOOTSTRAP
+.endif
+.else
+# If clang is not cc, then build gcc by default
+__DEFAULT_NO_OPTIONS+=CLANG_IS_CC CLANG CLANG_BOOTSTRAP
+__DEFAULT_YES_OPTIONS+=GCC GNUCXX GCC_BOOTSTRAP
+.endif
+
+.include <bsd.mkopt.mk>
+
+#
+# MK_* options that default to "yes" if the compiler is a C++11 compiler.
+#
+.include <bsd.compiler.mk>
+.for var in \
+ LIBCPLUSPLUS
+.if !defined(MK_${var})
+.if ${COMPILER_FEATURES:Mc++11}
+.if defined(WITHOUT_${var})
+MK_${var}:= no
+.else
+MK_${var}:= yes
+.endif
+.else
+.if defined(WITH_${var})
+MK_${var}:= yes
+.else
+MK_${var}:= no
+.endif
+.endif
+.endif
+.endfor
+
+#
+# Force some options off if their dependencies are off.
+# Order is somewhat important.
+#
+.if ${MK_LIBPTHREAD} == "no"
+MK_LIBTHR:= no
+.endif
+
+.if ${MK_LDNS} == "no"
+MK_LDNS_UTILS:= no
+MK_UNBOUND:= no
+.endif
+
+.if ${MK_SOURCELESS} == "no"
+MK_SOURCELESS_HOST:= no
+MK_SOURCELESS_UCODE:= no
+.endif
+
+.if ${MK_CDDL} == "no"
+MK_ZFS:= no
+MK_CTF:= no
+.endif
+
+.if ${MK_CRYPT} == "no"
+MK_OPENSSL:= no
+MK_OPENSSH:= no
+MK_KERBEROS:= no
+.endif
+
+.if ${MK_CXX} == "no"
+MK_CLANG:= no
+MK_GROFF:= no
+.endif
+
+.if ${MK_MAIL} == "no"
+MK_MAILWRAPPER:= no
+MK_SENDMAIL:= no
+MK_DMAGENT:= no
+.endif
+
+.if ${MK_NETGRAPH} == "no"
+MK_ATM:= no
+MK_BLUETOOTH:= no
+.endif
+
+.if ${MK_OPENSSL} == "no"
+MK_OPENSSH:= no
+MK_KERBEROS:= no
+.endif
+
+.if ${MK_PF} == "no"
+MK_AUTHPF:= no
+.endif
+
+.if ${MK_TEXTPROC} == "no"
+MK_GROFF:= no
+.endif
+
+.if ${MK_CROSS_COMPILER} == "no"
+MK_BINUTILS_BOOTSTRAP:= no
+MK_CLANG_BOOTSTRAP:= no
+MK_GCC_BOOTSTRAP:= no
+.endif
+
+.if ${MK_TOOLCHAIN} == "no"
+MK_BINUTILS:= no
+MK_CLANG:= no
+MK_GCC:= no
+MK_GDB:= no
+.endif
+
+.if ${MK_CLANG} == "no"
+MK_CLANG_EXTRAS:= no
+MK_CLANG_FULL:= no
+.endif
+
+#
+# Set defaults for the MK_*_SUPPORT variables.
+#
+
+#
+# MK_*_SUPPORT options which default to "yes" unless their corresponding
+# MK_* variable is set to "no".
+#
+.for var in \
+ BZIP2 \
+ GNU \
+ INET \
+ INET6 \
+ KERBEROS \
+ KVM \
+ NETGRAPH \
+ PAM \
+ WIRELESS
+.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
+MK_${var}_SUPPORT:= no
+.else
+MK_${var}_SUPPORT:= yes
+.endif
+.endfor
+
+#
+# MK_* options whose default value depends on another option.
+#
+.for vv in \
+ GSSAPI/KERBEROS \
+ MAN_UTILS/MAN
+.if defined(WITH_${vv:H})
+MK_${vv:H}:= yes
+.elif defined(WITHOUT_${vv:H})
+MK_${vv:H}:= no
+.else
+MK_${vv:H}:= ${MK_${vv:T}}
+.endif
+.endfor
+
+.if !${COMPILER_FEATURES:Mc++11}
+MK_LLDB:= no
+.endif
+
+.endif
diff --git a/sys/Makefile b/sys/Makefile
index 935f30d96147..47fd4629fb07 100644
--- a/sys/Makefile
+++ b/sys/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# The boot loader
.if ${MK_BOOT} != "no"
diff --git a/sys/amd64/conf/GENERIC b/sys/amd64/conf/GENERIC
index 84031d985a92..1c21758ba9f4 100644
--- a/sys/amd64/conf/GENERIC
+++ b/sys/amd64/conf/GENERIC
@@ -119,6 +119,7 @@ device isp # Qlogic family
#device ispfw # Firmware for QLogic HBAs- normally a module
device mpt # LSI-Logic MPT-Fusion
device mps # LSI-Logic MPT-Fusion 2
+device mpr # LSI-Logic MPT-Fusion 3
#device ncr # NCR/Symbios Logic
device sym # NCR/Symbios Logic (newer chipsets + those of `ncr')
device trm # Tekram DC395U/UW/F DC315U adapters
diff --git a/sys/amd64/conf/GENERIC.hints b/sys/amd64/conf/GENERIC.hints
index eacbbe851206..39beae158893 100644
--- a/sys/amd64/conf/GENERIC.hints
+++ b/sys/amd64/conf/GENERIC.hints
@@ -31,3 +31,5 @@ hint.attimer.0.at="isa"
hint.attimer.0.port="0x40"
hint.attimer.0.irq="0"
hint.wbwd.0.at="isa"
+hint.acpi_throttle.0.disabled="1"
+hint.p4tcc.0.disabled="1"
diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES
index aa80598cac47..61372f5342bb 100644
--- a/sys/amd64/conf/NOTES
+++ b/sys/amd64/conf/NOTES
@@ -647,8 +647,5 @@ options VM_KMEM_SIZE_SCALE
options NDISAPI
device ndis
-# Linux-specific pseudo devices support
-device lindev
-
# Module to enable execution of application via emulators like QEMU
options IMAGACT_BINMISC
diff --git a/sys/amd64/include/vmm.h b/sys/amd64/include/vmm.h
index 364bbb855e7f..68240b9d1317 100644
--- a/sys/amd64/include/vmm.h
+++ b/sys/amd64/include/vmm.h
@@ -29,6 +29,14 @@
#ifndef _VMM_H_
#define _VMM_H_
+enum vm_suspend_how {
+ VM_SUSPEND_NONE,
+ VM_SUSPEND_RESET,
+ VM_SUSPEND_POWEROFF,
+ VM_SUSPEND_HALT,
+ VM_SUSPEND_LAST
+};
+
#ifdef _KERNEL
#define VM_MAX_NAMELEN 32
@@ -115,7 +123,7 @@ int vm_get_seg_desc(struct vm *vm, int vcpu, int reg,
int vm_set_seg_desc(struct vm *vm, int vcpu, int reg,
struct seg_desc *desc);
int vm_run(struct vm *vm, struct vm_run *vmrun);
-int vm_suspend(struct vm *vm);
+int vm_suspend(struct vm *vm, enum vm_suspend_how how);
int vm_inject_nmi(struct vm *vm, int vcpu);
int vm_nmi_pending(struct vm *vm, int vcpuid);
void vm_nmi_clear(struct vm *vm, int vcpuid);
@@ -134,6 +142,7 @@ int vm_apicid2vcpuid(struct vm *vm, int apicid);
void vm_activate_cpu(struct vm *vm, int vcpu);
cpuset_t vm_active_cpus(struct vm *vm);
struct vm_exit *vm_exitinfo(struct vm *vm, int vcpuid);
+void vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip);
/*
* Rendezvous all vcpus specified in 'dest' and execute 'func(arg)'.
@@ -317,7 +326,7 @@ enum vm_exitcode {
VM_EXITCODE_PAGING,
VM_EXITCODE_INST_EMUL,
VM_EXITCODE_SPINUP_AP,
- VM_EXITCODE_SPINDOWN_CPU,
+ VM_EXITCODE_DEPRECATED1, /* used to be SPINDOWN_CPU */
VM_EXITCODE_RENDEZVOUS,
VM_EXITCODE_IOAPIC_EOI,
VM_EXITCODE_SUSPENDED,
@@ -382,6 +391,9 @@ struct vm_exit {
struct {
int vector;
} ioapic_eoi;
+ struct {
+ enum vm_suspend_how how;
+ } suspended;
} u;
};
diff --git a/sys/amd64/include/vmm_dev.h b/sys/amd64/include/vmm_dev.h
index 475a07fb7e8b..fcd437f0198f 100644
--- a/sys/amd64/include/vmm_dev.h
+++ b/sys/amd64/include/vmm_dev.h
@@ -159,6 +159,10 @@ struct vm_hpet_cap {
uint32_t capabilities; /* lower 32 bits of HPET capabilities */
};
+struct vm_suspend {
+ enum vm_suspend_how how;
+};
+
enum {
/* general routines */
IOCNUM_ABIVERS = 0,
@@ -214,7 +218,7 @@ enum {
#define VM_RUN \
_IOWR('v', IOCNUM_RUN, struct vm_run)
#define VM_SUSPEND \
- _IO('v', IOCNUM_SUSPEND)
+ _IOW('v', IOCNUM_SUSPEND, struct vm_suspend)
#define VM_MAP_MEMORY \
_IOWR('v', IOCNUM_MAP_MEMORY, struct vm_memory_segment)
#define VM_GET_MEMORY_SEG \
diff --git a/sys/amd64/vmm/intel/vmx.c b/sys/amd64/vmm/intel/vmx.c
index 286eba93616a..767bcc5132dc 100644
--- a/sys/amd64/vmm/intel/vmx.c
+++ b/sys/amd64/vmm/intel/vmx.c
@@ -1797,6 +1797,7 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
vmm_stat_incr(vmx->vm, vcpu, VMEXIT_RDMSR, 1);
retu = false;
ecx = vmxctx->guest_rcx;
+ VCPU_CTR1(vmx->vm, vcpu, "rdmsr 0x%08x", ecx);
error = emulate_rdmsr(vmx->vm, vcpu, ecx, &retu);
if (error) {
vmexit->exitcode = VM_EXITCODE_RDMSR;
@@ -1815,6 +1816,8 @@ vmx_exit_process(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
eax = vmxctx->guest_rax;
ecx = vmxctx->guest_rcx;
edx = vmxctx->guest_rdx;
+ VCPU_CTR2(vmx->vm, vcpu, "wrmsr 0x%08x value 0x%016lx",
+ ecx, (uint64_t)edx << 32 | eax);
error = emulate_wrmsr(vmx->vm, vcpu, ecx,
(uint64_t)edx << 32 | eax, &retu);
if (error) {
@@ -2045,16 +2048,6 @@ vmx_exit_rendezvous(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
}
static __inline int
-vmx_exit_suspended(struct vmx *vmx, int vcpu, struct vm_exit *vmexit)
-{
-
- vmexit->rip = vmcs_guest_rip();
- vmexit->inst_length = 0;
- vmexit->exitcode = VM_EXITCODE_SUSPENDED;
- return (UNHANDLED);
-}
-
-static __inline int
vmx_exit_inst_error(struct vmxctx *vmxctx, int rc, struct vm_exit *vmexit)
{
@@ -2173,7 +2166,8 @@ vmx_run(void *arg, int vcpu, register_t startrip, pmap_t pmap,
disable_intr();
if (vcpu_suspended(suspend_cookie)) {
enable_intr();
- handled = vmx_exit_suspended(vmx, vcpu, vmexit);
+ vm_exit_suspended(vmx->vm, vcpu, vmcs_guest_rip());
+ handled = UNHANDLED;
break;
}
diff --git a/sys/amd64/vmm/vmm.c b/sys/amd64/vmm/vmm.c
index 27136f301286..9aed5f5bb0bb 100644
--- a/sys/amd64/vmm/vmm.c
+++ b/sys/amd64/vmm/vmm.c
@@ -142,6 +142,8 @@ struct vm {
int suspend;
volatile cpuset_t suspended_cpus;
+
+ volatile cpuset_t halted_cpus;
};
static int vmm_initialized;
@@ -187,12 +189,20 @@ static VMM_STAT(VCPU_TOTAL_RUNTIME, "vcpu total runtime");
SYSCTL_NODE(_hw, OID_AUTO, vmm, CTLFLAG_RW, NULL, NULL);
+/*
+ * Halt the guest if all vcpus are executing a HLT instruction with
+ * interrupts disabled.
+ */
+static int halt_detection_enabled = 1;
+TUNABLE_INT("hw.vmm.halt_detection", &halt_detection_enabled);
+SYSCTL_INT(_hw_vmm, OID_AUTO, halt_detection, CTLFLAG_RDTUN,
+ &halt_detection_enabled, 0,
+ "Halt VM if all vcpus execute HLT with interrupts disabled");
+
static int vmm_ipinum;
SYSCTL_INT(_hw_vmm, OID_AUTO, ipinum, CTLFLAG_RD, &vmm_ipinum, 0,
"IPI vector used for vcpu notifications");
-static void vm_deactivate_cpu(struct vm *vm, int vcpuid);
-
static void
vcpu_cleanup(struct vm *vm, int i)
{
@@ -1006,59 +1016,73 @@ vm_handle_rendezvous(struct vm *vm, int vcpuid)
static int
vm_handle_hlt(struct vm *vm, int vcpuid, bool intr_disabled, bool *retu)
{
- struct vm_exit *vmexit;
struct vcpu *vcpu;
- int t, timo, spindown;
+ const char *wmesg;
+ int t, vcpu_halted, vm_halted;
+
+ KASSERT(!CPU_ISSET(vcpuid, &vm->halted_cpus), ("vcpu already halted"));
vcpu = &vm->vcpu[vcpuid];
- spindown = 0;
+ vcpu_halted = 0;
+ vm_halted = 0;
vcpu_lock(vcpu);
+ while (1) {
+ /*
+ * Do a final check for pending NMI or interrupts before
+ * really putting this thread to sleep. Also check for
+ * software events that would cause this vcpu to wakeup.
+ *
+ * These interrupts/events could have happened after the
+ * vcpu returned from VMRUN() and before it acquired the
+ * vcpu lock above.
+ */
+ if (vm->rendezvous_func != NULL || vm->suspend)
+ break;
+ if (vm_nmi_pending(vm, vcpuid))
+ break;
+ if (!intr_disabled) {
+ if (vm_extint_pending(vm, vcpuid) ||
+ vlapic_pending_intr(vcpu->vlapic, NULL)) {
+ break;
+ }
+ }
- /*
- * Do a final check for pending NMI or interrupts before
- * really putting this thread to sleep.
- *
- * These interrupts could have happened any time after we
- * returned from VMRUN() and before we grabbed the vcpu lock.
- */
- if (vm->rendezvous_func == NULL &&
- !vm_nmi_pending(vm, vcpuid) &&
- (intr_disabled || !vlapic_pending_intr(vcpu->vlapic, NULL))) {
- t = ticks;
- vcpu_require_state_locked(vcpu, VCPU_SLEEPING);
- if (vlapic_enabled(vcpu->vlapic)) {
- /*
- * XXX msleep_spin() is not interruptible so use the
- * 'timo' to put an upper bound on the sleep time.
- */
- timo = hz;
- msleep_spin(vcpu, &vcpu->mtx, "vmidle", timo);
+ /*
+ * Some Linux guests implement "halt" by having all vcpus
+ * execute HLT with interrupts disabled. 'halted_cpus' keeps
+ * track of the vcpus that have entered this state. When all
+ * vcpus enter the halted state the virtual machine is halted.
+ */
+ if (intr_disabled) {
+ wmesg = "vmhalt";
+ VCPU_CTR0(vm, vcpuid, "Halted");
+ if (!vcpu_halted && halt_detection_enabled) {
+ vcpu_halted = 1;
+ CPU_SET_ATOMIC(vcpuid, &vm->halted_cpus);
+ }
+ if (CPU_CMP(&vm->halted_cpus, &vm->active_cpus) == 0) {
+ vm_halted = 1;
+ break;
+ }
} else {
- /*
- * Spindown the vcpu if the APIC is disabled and it
- * had entered the halted state, but never spin
- * down the BSP.
- */
- if (vcpuid != 0)
- spindown = 1;
+ wmesg = "vmidle";
}
+
+ t = ticks;
+ vcpu_require_state_locked(vcpu, VCPU_SLEEPING);
+ msleep_spin(vcpu, &vcpu->mtx, wmesg, 0);
vcpu_require_state_locked(vcpu, VCPU_FROZEN);
vmm_stat_incr(vm, vcpuid, VCPU_IDLE_TICKS, ticks - t);
}
+
+ if (vcpu_halted)
+ CPU_CLR_ATOMIC(vcpuid, &vm->halted_cpus);
+
vcpu_unlock(vcpu);
- /*
- * Since 'vm_deactivate_cpu()' grabs a sleep mutex we must call it
- * outside the confines of the vcpu spinlock.
- */
- if (spindown) {
- *retu = true;
- vmexit = vm_exitinfo(vm, vcpuid);
- vmexit->exitcode = VM_EXITCODE_SPINDOWN_CPU;
- vm_deactivate_cpu(vm, vcpuid);
- VCPU_CTR0(vm, vcpuid, "spinning down cpu");
- }
+ if (vm_halted)
+ vm_suspend(vm, VM_SUSPEND_HALT);
return (0);
}
@@ -1211,16 +1235,45 @@ vm_handle_suspend(struct vm *vm, int vcpuid, bool *retu)
}
int
-vm_suspend(struct vm *vm)
+vm_suspend(struct vm *vm, enum vm_suspend_how how)
{
+ int i;
- if (atomic_cmpset_int(&vm->suspend, 0, 1)) {
- VM_CTR0(vm, "virtual machine suspended");
- return (0);
- } else {
- VM_CTR0(vm, "virtual machine already suspended");
+ if (how <= VM_SUSPEND_NONE || how >= VM_SUSPEND_LAST)
+ return (EINVAL);
+
+ if (atomic_cmpset_int(&vm->suspend, 0, how) == 0) {
+ VM_CTR2(vm, "virtual machine already suspended %d/%d",
+ vm->suspend, how);
return (EALREADY);
}
+
+ VM_CTR1(vm, "virtual machine successfully suspended %d", how);
+
+ /*
+ * Notify all active vcpus that they are now suspended.
+ */
+ for (i = 0; i < VM_MAXCPU; i++) {
+ if (CPU_ISSET(i, &vm->active_cpus))
+ vcpu_notify_event(vm, i, false);
+ }
+
+ return (0);
+}
+
+void
+vm_exit_suspended(struct vm *vm, int vcpuid, uint64_t rip)
+{
+ struct vm_exit *vmexit;
+
+ KASSERT(vm->suspend > VM_SUSPEND_NONE && vm->suspend < VM_SUSPEND_LAST,
+ ("vm_exit_suspended: invalid suspend type %d", vm->suspend));
+
+ vmexit = vm_exitinfo(vm, vcpuid);
+ vmexit->rip = rip;
+ vmexit->inst_length = 0;
+ vmexit->exitcode = VM_EXITCODE_SUSPENDED;
+ vmexit->u.suspended.how = vm->suspend;
}
int
@@ -1644,30 +1697,6 @@ vm_activate_cpu(struct vm *vm, int vcpuid)
CPU_SET_ATOMIC(vcpuid, &vm->active_cpus);
}
-static void
-vm_deactivate_cpu(struct vm *vm, int vcpuid)
-{
-
- KASSERT(vcpuid >= 0 && vcpuid < VM_MAXCPU,
- ("vm_deactivate_cpu: invalid vcpuid %d", vcpuid));
- KASSERT(CPU_ISSET(vcpuid, &vm->active_cpus),
- ("vm_deactivate_cpu: vcpuid %d is not active", vcpuid));
-
- VCPU_CTR0(vm, vcpuid, "deactivated");
- CPU_CLR_ATOMIC(vcpuid, &vm->active_cpus);
-
- /*
- * If a vcpu rendezvous is in progress then it could be blocked
- * on 'vcpuid' - unblock it before disappearing forever.
- */
- mtx_lock(&vm->rendezvous_mtx);
- if (vm->rendezvous_func != NULL) {
- VCPU_CTR0(vm, vcpuid, "unblock rendezvous after deactivation");
- wakeup(&vm->rendezvous_func);
- }
- mtx_unlock(&vm->rendezvous_mtx);
-}
-
cpuset_t
vm_active_cpus(struct vm *vm)
{
diff --git a/sys/amd64/vmm/vmm_dev.c b/sys/amd64/vmm/vmm_dev.c
index 37d841d20551..3112c52c97a8 100644
--- a/sys/amd64/vmm/vmm_dev.c
+++ b/sys/amd64/vmm/vmm_dev.c
@@ -166,6 +166,7 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
struct vm_stat_desc *statdesc;
struct vm_x2apic *x2apic;
struct vm_gpa_pte *gpapte;
+ struct vm_suspend *vmsuspend;
sc = vmmdev_lookup2(cdev);
if (sc == NULL)
@@ -241,7 +242,8 @@ vmmdev_ioctl(struct cdev *cdev, u_long cmd, caddr_t data, int fflag,
error = vm_run(sc->vm, vmrun);
break;
case VM_SUSPEND:
- error = vm_suspend(sc->vm);
+ vmsuspend = (struct vm_suspend *)data;
+ error = vm_suspend(sc->vm, vmsuspend->how);
break;
case VM_STAT_DESC: {
statdesc = (struct vm_stat_desc *)data;
diff --git a/sys/arm/arm/locore.S b/sys/arm/arm/locore.S
index 90eeeaf9aa05..ad4204b82628 100644
--- a/sys/arm/arm/locore.S
+++ b/sys/arm/arm/locore.S
@@ -308,11 +308,6 @@ Lreal_start:
Lend:
.word _edata
-#ifdef SMP
-Lstartup_pagetable_secondary:
- .word temp_pagetable
-#endif
-
.Lstart:
.word _edata
.word _ebss
@@ -320,10 +315,6 @@ Lstartup_pagetable_secondary:
.Lvirt_done:
.word virt_done
-#if defined(SMP)
-.Lmpvirt_done:
- .word mpvirt_done
-#endif
.Lmainreturned:
.asciz "main() returned"
@@ -349,52 +340,14 @@ pagetable:
.word _C_LABEL(cpufuncs)
#if defined(SMP)
-Lsramaddr:
- .word 0xffff0080
-
-#if 0
-#define AP_DEBUG(tmp) \
- mrc p15, 0, r1, c0, c0, 5; \
- ldr r0, Lsramaddr; \
- add r0, r1, lsl #2; \
- mov r1, tmp; \
- str r1, [r0], #0x0000;
-#else
-#define AP_DEBUG(tmp)
-#endif
-
-
-ASENTRY_NP(mptramp)
- mov r0, #0
- mcr p15, 0, r0, c7, c7, 0
-
- AP_DEBUG(#1)
-
- mrs r3, cpsr
- bic r3, r3, #(PSR_MODE)
- orr r3, r3, #(PSR_SVC32_MODE)
- msr cpsr_fsxc, r3
-
- mrc p15, 0, r0, c0, c0, 5
- and r0, #0x0f /* Get CPU ID */
-
- /* Read boot address for CPU */
- mov r1, #0x100
- mul r2, r0, r1
- ldr r1, Lpmureg
- add r0, r2, r1
- ldr r1, [r0], #0x00
- mov pc, r1
-
-Lpmureg:
- .word 0xd0022124
-END(mptramp)
+.Lmpvirt_done:
+ .word mpvirt_done
+Lstartup_pagetable_secondary:
+ .word temp_pagetable
ASENTRY_NP(mpentry)
- AP_DEBUG(#2)
-
/* Make sure interrupts are disabled. */
mrs r7, cpsr
orr r7, r7, #(I32_bit|F32_bit)
@@ -417,35 +370,25 @@ ASENTRY_NP(mpentry)
nop
nop
- AP_DEBUG(#3)
-
Ltag:
ldr r0, Lstartup_pagetable_secondary
bic r0, r0, #0xf0000000
orr r0, r0, #PHYSADDR
ldr r0, [r0]
-#if defined(SMP)
orr r0, r0, #2 /* Set TTB shared memory flag */
-#endif
mcr p15, 0, r0, c2, c0, 0 /* Set TTB */
mcr p15, 0, r0, c8, c7, 0 /* Flush TLB */
-#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT)
mov r0, #0
mcr p15, 0, r0, c13, c0, 1 /* Set ASID to 0 */
-#endif
-
- AP_DEBUG(#4)
/* Set the Domain Access register. Very important! */
mov r0, #((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL*2)) | DOMAIN_CLIENT)
mcr p15, 0, r0, c3, c0, 0
/* Enable MMU */
mrc p15, 0, r0, c1, c0, 0
-#if defined(CPU_ARM1136) || defined(CPU_ARM1176) || defined(CPU_MV_PJ4B) || defined(CPU_CORTEXA) || defined(CPU_KRAIT)
orr r0, r0, #CPU_CONTROL_V6_EXTPAGE
orr r0, r0, #CPU_CONTROL_AF_ENABLE
-#endif
orr r0, r0, #(CPU_CONTROL_MMU_ENABLE | CPU_CONTROL_DC_ENABLE)
mcr p15, 0, r0, c1, c0, 0
nop
@@ -473,7 +416,7 @@ mpvirt_done:
/* NOTREACHED */
.Lmpreturned:
- .asciz "main() returned"
+ .asciz "init_secondary() returned"
.align 0
END(mpentry)
#endif
diff --git a/sys/arm/arm/pl310.c b/sys/arm/arm/pl310.c
index b087365b5835..83e690711b41 100644
--- a/sys/arm/arm/pl310.c
+++ b/sys/arm/arm/pl310.c
@@ -71,7 +71,7 @@ __FBSDID("$FreeBSD$");
} while(0);
static int pl310_enabled = 1;
-TUNABLE_INT("pl310.enabled", &pl310_enabled);
+TUNABLE_INT("hw.pl310.enabled", &pl310_enabled);
static uint32_t g_l2cache_way_mask;
@@ -125,6 +125,35 @@ pl310_print_config(struct pl310_softc *sc)
(prefetch & PREFETCH_CTRL_OFFSET_MASK));
}
+void
+pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg,
+ uint32_t read, uint32_t write, uint32_t setup)
+{
+ uint32_t v;
+
+ KASSERT(which_reg == PL310_TAG_RAM_CTRL ||
+ which_reg == PL310_DATA_RAM_CTRL,
+ ("bad pl310 ram latency register address"));
+
+ v = pl310_read4(sc, which_reg);
+ if (setup != 0) {
+ KASSERT(setup <= 8, ("bad pl310 setup latency: %d", setup));
+ v &= ~RAM_CTRL_SETUP_MASK;
+ v |= (setup - 1) << RAM_CTRL_SETUP_SHIFT;
+ }
+ if (read != 0) {
+ KASSERT(read <= 8, ("bad pl310 read latency: %d", read));
+ v &= ~RAM_CTRL_READ_MASK;
+ v |= (read - 1) << RAM_CTRL_READ_SHIFT;
+ }
+ if (write != 0) {
+ KASSERT(write <= 8, ("bad pl310 write latency: %d", write));
+ v &= ~RAM_CTRL_WRITE_MASK;
+ v |= (write - 1) << RAM_CTRL_WRITE_SHIFT;
+ }
+ pl310_write4(sc, which_reg, v);
+}
+
static int
pl310_filter(void *arg)
{
@@ -149,7 +178,8 @@ static __inline void
pl310_wait_background_op(uint32_t off, uint32_t mask)
{
- while (pl310_read4(pl310_softc, off) & mask);
+ while (pl310_read4(pl310_softc, off) & mask)
+ continue;
}
@@ -167,6 +197,7 @@ pl310_wait_background_op(uint32_t off, uint32_t mask)
static __inline void
pl310_cache_sync(void)
{
+
if ((pl310_softc == NULL) || !pl310_softc->sc_enabled)
return;
@@ -318,6 +349,23 @@ pl310_inv_range(vm_paddr_t start, vm_size_t size)
PL310_UNLOCK(pl310_softc);
}
+static void
+pl310_set_way_sizes(struct pl310_softc *sc)
+{
+ uint32_t aux_value;
+
+ aux_value = pl310_read4(sc, PL310_AUX_CTRL);
+ g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >>
+ AUX_CTRL_WAY_SIZE_SHIFT;
+ g_way_size = 1 << (g_way_size + 13);
+ if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT))
+ g_ways_assoc = 16;
+ else
+ g_ways_assoc = 8;
+ g_l2cache_way_mask = (1 << g_ways_assoc) - 1;
+ g_l2cache_size = g_way_size * g_ways_assoc;
+}
+
static int
pl310_probe(device_t dev)
{
@@ -335,12 +383,11 @@ static int
pl310_attach(device_t dev)
{
struct pl310_softc *sc = device_get_softc(dev);
- int rid = 0;
- uint32_t aux_value;
- uint32_t ctrl_value;
- uint32_t cache_id;
+ int rid;
+ uint32_t cache_id, debug_ctrl;
sc->sc_dev = dev;
+ rid = 0;
sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
RF_ACTIVE);
if (sc->sc_mem_res == NULL)
@@ -356,7 +403,6 @@ pl310_attach(device_t dev)
pl310_softc = sc;
mtx_init(&sc->sc_mtx, "pl310lock", NULL, MTX_SPIN);
- sc->sc_enabled = pl310_enabled;
/* activate the interrupt */
bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE,
@@ -368,39 +414,49 @@ pl310_attach(device_t dev)
device_printf(dev, "Part number: 0x%x, release: 0x%x\n",
(cache_id >> CACHE_ID_PARTNUM_SHIFT) & CACHE_ID_PARTNUM_MASK,
(cache_id >> CACHE_ID_RELEASE_SHIFT) & CACHE_ID_RELEASE_MASK);
- aux_value = pl310_read4(sc, PL310_AUX_CTRL);
- g_way_size = (aux_value & AUX_CTRL_WAY_SIZE_MASK) >>
- AUX_CTRL_WAY_SIZE_SHIFT;
- g_way_size = 1 << (g_way_size + 13);
- if (aux_value & (1 << AUX_CTRL_ASSOCIATIVITY_SHIFT))
- g_ways_assoc = 16;
- else
- g_ways_assoc = 8;
- g_l2cache_way_mask = (1 << g_ways_assoc) - 1;
- g_l2cache_size = g_way_size * g_ways_assoc;
- /* Print the information */
- device_printf(dev, "L2 Cache: %uKB/%dB %d ways\n", (g_l2cache_size / 1024),
- g_l2cache_line_size, g_ways_assoc);
- ctrl_value = pl310_read4(sc, PL310_CTRL);
+ /*
+ * If L2 cache is already enabled then something has violated the rules,
+ * because caches are supposed to be off at kernel entry. The cache
+ * must be disabled to write the configuration registers without
+ * triggering an access error (SLVERR), but there's no documented safe
+ * procedure for disabling the L2 cache in the manual. So we'll try to
+ * invent one:
+ * - Use the debug register to force write-through mode and prevent
+ * linefills (allocation of new lines on read); now anything we do
+ * will not cause new data to come into the L2 cache.
+ * - Writeback and invalidate the current contents.
+ * - Disable the controller.
+ * - Restore the original debug settings.
+ */
+ if (pl310_read4(sc, PL310_CTRL) & CTRL_ENABLED) {
+ device_printf(dev, "Warning: L2 Cache should not already be "
+ "active; trying to de-activate and re-initialize...\n");
+ sc->sc_enabled = 1;
+ debug_ctrl = pl310_read4(sc, PL310_DEBUG_CTRL);
+ platform_pl310_write_debug(sc, debug_ctrl |
+ DEBUG_CTRL_DISABLE_WRITEBACK | DEBUG_CTRL_DISABLE_LINEFILL);
+ pl310_set_way_sizes(sc);
+ pl310_wbinv_all();
+ platform_pl310_write_ctrl(sc, CTRL_DISABLED);
+ platform_pl310_write_debug(sc, debug_ctrl);
+ }
+ sc->sc_enabled = pl310_enabled;
- if (sc->sc_enabled && !(ctrl_value & CTRL_ENABLED)) {
- /* invalidate current content */
+ if (sc->sc_enabled) {
+ platform_pl310_init(sc);
+ pl310_set_way_sizes(sc); /* platform init might change these */
pl310_write4(pl310_softc, PL310_INV_WAY, 0xffff);
pl310_wait_background_op(PL310_INV_WAY, 0xffff);
-
- /* Enable the L2 cache if disabled */
platform_pl310_write_ctrl(sc, CTRL_ENABLED);
- device_printf(dev, "L2 Cache enabled\n");
+ device_printf(dev, "L2 Cache enabled: %uKB/%dB %d ways\n",
+ (g_l2cache_size / 1024), g_l2cache_line_size, g_ways_assoc);
if (bootverbose)
pl310_print_config(sc);
- }
-
- if (!sc->sc_enabled && (ctrl_value & CTRL_ENABLED)) {
+ } else {
/*
- * Set counters so when cache event happens
- * we'll get interrupt and be warned that something
- * is off
+ * Set counters so when cache event happens we'll get interrupt
+ * and be warned that something is off.
*/
/* Cache Line Eviction for Counter 0 */
@@ -410,12 +466,6 @@ pl310_attach(device_t dev)
pl310_write4(sc, PL310_EVENT_COUNTER1_CONF,
EVENT_COUNTER_CONF_INCR | EVENT_COUNTER_CONF_DRREQ);
- /* Temporary switch on for final flush*/
- sc->sc_enabled = 1;
- pl310_wbinv_all();
- sc->sc_enabled = 0;
- platform_pl310_write_ctrl(sc, CTRL_DISABLED);
-
/* Enable and clear pending interrupts */
pl310_write4(sc, PL310_INTR_CLEAR, INTR_MASK_ECNTR);
pl310_write4(sc, PL310_INTR_MASK, INTR_MASK_ALL);
@@ -429,11 +479,6 @@ pl310_attach(device_t dev)
device_printf(dev, "L2 Cache disabled\n");
}
- if (sc->sc_enabled)
- platform_pl310_init(sc);
-
- pl310_wbinv_all();
-
/* Set the l2 functions in the set of cpufuncs */
cpufuncs.cf_l2cache_wbinv_all = pl310_wbinv_all;
cpufuncs.cf_l2cache_wbinv_range = pl310_wbinv_range;
@@ -446,7 +491,7 @@ pl310_attach(device_t dev)
static device_method_t pl310_methods[] = {
DEVMETHOD(device_probe, pl310_probe),
DEVMETHOD(device_attach, pl310_attach),
- {0, 0},
+ DEVMETHOD_END
};
static driver_t pl310_driver = {
diff --git a/sys/arm/conf/ARNDALE b/sys/arm/conf/ARNDALE
index e50d3f4ed65e..da4c598e385e 100644
--- a/sys/arm/conf/ARNDALE
+++ b/sys/arm/conf/ARNDALE
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
include "EXYNOS5250.common"
ident ARNDALE
diff --git a/sys/arm/conf/BWCT b/sys/arm/conf/BWCT
index 4c0001952af7..5ed552b702c6 100644
--- a/sys/arm/conf/BWCT
+++ b/sys/arm/conf/BWCT
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident BWCT
options VERBOSE_INIT_ARM
diff --git a/sys/arm/conf/COLIBRI-VF50 b/sys/arm/conf/COLIBRI-VF50
index 343fb8963238..9f73f6987f2f 100644
--- a/sys/arm/conf/COLIBRI-VF50
+++ b/sys/arm/conf/COLIBRI-VF50
@@ -17,7 +17,9 @@
#
# $FreeBSD$
-include "VYBRID.common"
+#NO_UNIVERSE
+
+include "VYBRID"
ident COLIBRI-VF50
#FDT
diff --git a/sys/arm/conf/COSMIC b/sys/arm/conf/COSMIC
index b3b407432f6f..72ae5c20b07b 100644
--- a/sys/arm/conf/COSMIC
+++ b/sys/arm/conf/COSMIC
@@ -17,7 +17,9 @@
#
# $FreeBSD$
-include "VYBRID.common"
+#NO_UNIVERSE
+
+include "VYBRID"
ident COSMIC
#FDT
diff --git a/sys/arm/conf/EB9200 b/sys/arm/conf/EB9200
index 0afa9b4288eb..3e3d124501fe 100644
--- a/sys/arm/conf/EB9200
+++ b/sys/arm/conf/EB9200
@@ -12,6 +12,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident EB9200
include "../at91/std.eb9200"
diff --git a/sys/arm/conf/ETHERNUT5 b/sys/arm/conf/ETHERNUT5
index 9bc234df9494..9df7f9c55aaf 100644
--- a/sys/arm/conf/ETHERNUT5
+++ b/sys/arm/conf/ETHERNUT5
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident ETHERNUT5
include "../at91/std.ethernut5"
diff --git a/sys/arm/conf/HL200 b/sys/arm/conf/HL200
index c8d43c261600..8e0d174512ef 100644
--- a/sys/arm/conf/HL200
+++ b/sys/arm/conf/HL200
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident HL200
include "../at91/std.hl200"
diff --git a/sys/arm/conf/HL201 b/sys/arm/conf/HL201
index 200f2f86ef7f..fb80bbed8ca9 100644
--- a/sys/arm/conf/HL201
+++ b/sys/arm/conf/HL201
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident HL201
include "../at91/std.hl201"
diff --git a/sys/arm/conf/KB920X b/sys/arm/conf/KB920X
index 916425ac9e04..a758a66e4e6d 100644
--- a/sys/arm/conf/KB920X
+++ b/sys/arm/conf/KB920X
@@ -18,6 +18,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident KB920X
include "../at91/std.kb920x"
diff --git a/sys/arm/conf/NSLU b/sys/arm/conf/NSLU
index a8c04d3185d3..e54e63b72568 100644
--- a/sys/arm/conf/NSLU
+++ b/sys/arm/conf/NSLU
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident NSLU
# XXX What is defined in std.avila does not exactly match the following:
diff --git a/sys/arm/conf/QILA9G20 b/sys/arm/conf/QILA9G20
index e0055573cf4d..257e37d34f5a 100644
--- a/sys/arm/conf/QILA9G20
+++ b/sys/arm/conf/QILA9G20
@@ -18,6 +18,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident QILA9G20
include "../at91/std.qila9g20"
diff --git a/sys/arm/conf/QUARTZ b/sys/arm/conf/QUARTZ
index b6c20bb66af6..04f1b5c94749 100644
--- a/sys/arm/conf/QUARTZ
+++ b/sys/arm/conf/QUARTZ
@@ -17,7 +17,9 @@
#
# $FreeBSD$
-include "VYBRID.common"
+#NO_UNIVERSE
+
+include "VYBRID"
ident QUARTZ
#FDT
diff --git a/sys/arm/conf/SAM9260EK b/sys/arm/conf/SAM9260EK
index 930429d2f800..34b64afd234b 100644
--- a/sys/arm/conf/SAM9260EK
+++ b/sys/arm/conf/SAM9260EK
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident SAM9260EK
include "../at91/std.sam9260ek"
diff --git a/sys/arm/conf/SAM9X25EK b/sys/arm/conf/SAM9X25EK
index 63fa8158bf94..d4b6343d9777 100644
--- a/sys/arm/conf/SAM9X25EK
+++ b/sys/arm/conf/SAM9X25EK
@@ -17,7 +17,8 @@
#
# $FreeBSD$
-# NOUNIVERSE: disable building in make universe
+#NO_UNIVERSE
+
ident SAM9X25EK
include "../at91/std.sam9x25ek"
diff --git a/sys/arm/conf/SN9G45 b/sys/arm/conf/SN9G45
index e44a0cf2c856..3eb646bbeeb4 100644
--- a/sys/arm/conf/SN9G45
+++ b/sys/arm/conf/SN9G45
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
ident SN9G45
include "../at91/std.sn9g45"
diff --git a/sys/arm/conf/VYBRID.common b/sys/arm/conf/VYBRID
index 412f65cc1e64..43cdac5940c0 100644
--- a/sys/arm/conf/VYBRID.common
+++ b/sys/arm/conf/VYBRID
@@ -17,6 +17,7 @@
#
# $FreeBSD$
+ident VYBRID
include "../freescale/vybrid/std.vybrid"
makeoptions MODULES_OVERRIDE=""
@@ -146,3 +147,5 @@ device kbdmux
options SC_DFLT_FONT # compile font in
makeoptions SC_DFLT_FONT=cp437
device ukbd
+
+options FDT
diff --git a/sys/arm/conf/WANDBOARD-DUAL b/sys/arm/conf/WANDBOARD-DUAL
index 168b17d9e42b..598c91d8a800 100644
--- a/sys/arm/conf/WANDBOARD-DUAL
+++ b/sys/arm/conf/WANDBOARD-DUAL
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
include "IMX6"
ident WANDBOARD-DUAL
diff --git a/sys/arm/conf/WANDBOARD-QUAD b/sys/arm/conf/WANDBOARD-QUAD
index 155b36adc7f5..571f54be1ca1 100644
--- a/sys/arm/conf/WANDBOARD-QUAD
+++ b/sys/arm/conf/WANDBOARD-QUAD
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
include "IMX6"
ident WANDBOARD-QUAD
diff --git a/sys/arm/conf/WANDBOARD-SOLO b/sys/arm/conf/WANDBOARD-SOLO
index 7465e4f61996..f6df97c9574e 100644
--- a/sys/arm/conf/WANDBOARD-SOLO
+++ b/sys/arm/conf/WANDBOARD-SOLO
@@ -17,6 +17,8 @@
#
# $FreeBSD$
+#NO_UNIVERSE
+
include "IMX6"
ident WANDBOARD-SOLO
diff --git a/sys/arm/conf/WANDBOARD.common b/sys/arm/conf/WANDBOARD.common
deleted file mode 100644
index a147353e9b71..000000000000
--- a/sys/arm/conf/WANDBOARD.common
+++ /dev/null
@@ -1,159 +0,0 @@
-# Kernel configuration for Wandboard
-#
-# For more information on this file, please read the config(5) manual page,
-# and/or the handbook section on Kernel Configuration Files:
-#
-# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
-#
-# The handbook is also available locally in /usr/share/doc/handbook
-# if you've installed the doc distribution, otherwise always see the
-# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
-# latest information.
-#
-# An exhaustive list of options and more detailed explanations of the
-# device lines is also present in the ../../conf/NOTES and NOTES files.
-# If you are in doubt as to the purpose or necessity of a line, check first
-# in NOTES.
-#
-# $FreeBSD$
-
-include "../freescale/imx/std.imx6"
-
-options HZ=250 # Scheduling quantum is 4 milliseconds.
-options SCHED_4BSD # 4BSD scheduler
-options PREEMPTION # Enable kernel thread preemption
-options INET # InterNETworking
-options INET6 # IPv6 communications protocols
-#options SCTP # Stream Control Transmission Protocol
-options FFS # Berkeley Fast Filesystem
-options SOFTUPDATES # Enable FFS soft updates support
-options UFS_ACL # Support for access control lists
-options UFS_DIRHASH # Improve performance on big directories
-options UFS_GJOURNAL # Enable gjournal-based UFS journaling
-#options MD_ROOT # MD is a potential root device
-options NFSCL # New Network Filesystem Client
-#options NFSD # New Network Filesystem Server
-options NFSLOCKD # Network Lock Manager
-options NFS_ROOT # NFS usable as /, requires NFSCL
-options TMPFS # Efficient memory filesystem
-options MSDOSFS # MSDOS Filesystem
-options CD9660 # ISO 9660 Filesystem
-#options PROCFS # Process filesystem (requires PSEUDOFS)
-options PSEUDOFS # Pseudo-filesystem framework
-options GEOM_PART_BSD # BSD partition scheme
-options GEOM_PART_MBR # MBR partition scheme
-options GEOM_PART_GPT # GUID Partition Tables.
-options GEOM_LABEL # Provides labelization
-options KTRACE # ktrace(1) support
-options SYSVSHM # SYSV-style shared memory
-options SYSVMSG # SYSV-style message queues
-options SYSVSEM # SYSV-style semaphores
-options _KPOSIX_PRIORITY_SCHEDULING # POSIX P1003_1B real-time extensions
-options INCLUDE_CONFIG_FILE # Include this file in kernel
-
-# Debugging support. Always need this:
-options KDB # Enable kernel debugger support.
-# For minimum debugger support use KDB_TRACE, for interactive use DDB.
-#options KDB_TRACE # Print a stack trace for a panic.
-options DDB # Support DDB.
-# For full debugger support use this instead:
-#options GDB # Support remote GDB.
-# Other debugging options...
-makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols
-options ALT_BREAK_TO_DEBUGGER # Use <CR><tilde><ctrl-b> to enter debugger.
-#options DEBUG
-#options DEADLKRES # Enable the deadlock resolver
-#options INVARIANTS # Enable calls of extra sanity checking
-#options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS
-#options WITNESS # Enable checks to detect deadlocks and cycles
-
-# Note that 'bpf' is required for DHCP.
-device bpf # Berkeley packet filter
-
-# Pseudo devices.
-device loop # Network loopback
-device random # Entropy device
-device vlan # 802.1Q VLAN support
-device tun # Packet tunnel.
-device md # Memory "disks"
-#device gif # IPv6 and IPv4 tunneling
-#device faith # IPv6-to-IPv4 relaying (translation)
-#device firmware # firmware assist module
-device ether # Ethernet support
-device miibus # Required for ethernet
-
-# Serial (COM) ports
-device uart # Multi-uart driver
-
-#device iomux # IO Multiplexor
-
-# SCSI peripherals
-device scbus # SCSI bus (required for SCSI)
-device da # Direct Access (disks)
-device cd # CD
-device pass # Passthrough device (direct SCSI access)
-
-# USB support
-#options USB_DEBUG # enable debug msgs
-options USB_HOST_ALIGN=32 # Required for ARM, set to cache line size.
-device ehci # OHCI USB interface
-device usb # USB Bus (required)
-device umass # Disks/Mass storage - Requires scbus and da
-device uhid # "Human Interface Devices"
-device u3g # USB modems
-
-# USB Ethernet, requires miibus
-#device aue # ADMtek USB Ethernet
-#device axe # ASIX Electronics USB Ethernet
-#device cdce # Generic USB over Ethernet
-#device cue # CATC USB Ethernet
-#device kue # Kawasaki LSI USB Ethernet
-#device rue # RealTek RTL8150 USB Ethernet
-#device udav # Davicom DM9601E USB
-
-# USB Wireless
-#device rum # Ralink Technology RT2501USB wireless NICs
-
-# Watchdog timer.
-# WARNING: can't be disabled!!!
-#device imxwdt # Watchdog
-
-# Wireless NIC cards
-#device wlan # 802.11 support
-#device wlan_wep # 802.11 WEP support
-#device wlan_ccmp # 802.11 CCMP support
-#device wlan_tkip # 802.11 TKIP support
-#device wlan_amrr # AMRR transmit rate control algorithm
-
-# NOTE: serial console will be disabled if syscons enabled
-# Uncomment following lines for framebuffer/syscons support
-# Wandboard has no video console support yet.
-#device sc
-#device kbdmux
-#options SC_DFLT_FONT # compile font in
-#makeoptions SC_DFLT_FONT=cp437
-#device ukbd # Allow keyboard like HIDs to control console
-#device ums
-
-# required for netbooting
-#options BOOTP
-#options BOOTP_COMPAT
-#options BOOTP_NFSROOT
-#options BOOTP_NFSV3
-#options BOOTP_WIRED_TO=ffec0
-
-# U-Boot stuff lives on slice 1, FreeBSD on slice 2.
-options ROOTDEVNAME=\"ufs:mmcsd0s2a\"
-
-#device fsliic # Freescale i2c/iic (not ready yet)
-#device iic # iic protocol
-#device iicbus # iic bus
-
-device sdhci # SD controller
-device mmc # SD/MMC protocol
-device mmcsd # SDCard disk device
-
-device ffec # Freescale Fast Ethernet Controller
-
-options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8)
-
diff --git a/sys/arm/conf/ZEDBOARD b/sys/arm/conf/ZEDBOARD
index 147c7f386d14..99a2272b75ed 100644
--- a/sys/arm/conf/ZEDBOARD
+++ b/sys/arm/conf/ZEDBOARD
@@ -56,6 +56,7 @@ options SYSVSEM # SYSV-style semaphores
options _KPOSIX_PRIORITY_SCHEDULING # Posix P1003_1B real-time extensions
options FREEBSD_BOOT_LOADER
options VFP # vfp/neon
+options SMP # Symmetric MultiProcessor Kernel
# Debugging
makeoptions DEBUG=-g
diff --git a/sys/arm/freescale/imx/imx6_pl310.c b/sys/arm/freescale/imx/imx6_pl310.c
index a4e383ea1bd6..9e0427faf4ed 100644
--- a/sys/arm/freescale/imx/imx6_pl310.c
+++ b/sys/arm/freescale/imx/imx6_pl310.c
@@ -44,6 +44,19 @@ __FBSDID("$FreeBSD$");
void
platform_pl310_init(struct pl310_softc *sc)
{
+ uint32_t reg;
+
+ /*
+ * Enable power saving modes:
+ * - Dynamic Gating stops the clock when the controller is idle.
+ * - Standby stops the clock when the cores are in WFI mode.
+ */
+ reg = pl310_read4(sc, PL310_POWER_CTRL);
+ reg |= POWER_CTRL_ENABLE_GATING | POWER_CTRL_ENABLE_STANDBY;
+ pl310_write4(sc, PL310_POWER_CTRL, reg);
+
+ pl310_set_ram_latency(sc, PL310_TAG_RAM_CTRL, 4, 2, 3);
+ pl310_set_ram_latency(sc, PL310_DATA_RAM_CTRL, 4, 2, 3);
}
void
diff --git a/sys/arm/include/cpufunc.h b/sys/arm/include/cpufunc.h
index 6251e2c85a69..c2a96a81507e 100644
--- a/sys/arm/include/cpufunc.h
+++ b/sys/arm/include/cpufunc.h
@@ -411,7 +411,7 @@ void armv6_idcache_wbinv_range (vm_offset_t, vm_size_t);
void armv7_setttb (u_int);
void armv7_tlb_flushID (void);
void armv7_tlb_flushID_SE (u_int);
-void armv7_icache_sync_all ();
+void armv7_icache_sync_all (void);
void armv7_icache_sync_range (vm_offset_t, vm_size_t);
void armv7_idcache_wbinv_range (vm_offset_t, vm_size_t);
void armv7_idcache_inv_all (void);
diff --git a/sys/arm/include/pl310.h b/sys/arm/include/pl310.h
index b4200a8dada2..873087700f0d 100644
--- a/sys/arm/include/pl310.h
+++ b/sys/arm/include/pl310.h
@@ -62,6 +62,14 @@
#define AUX_CTRL_DATA_PREFETCH (1 << 28)
#define AUX_CTRL_INSTR_PREFETCH (1 << 29)
#define AUX_CTRL_EARLY_BRESP (1 << 30)
+#define PL310_TAG_RAM_CTRL 0x108
+#define PL310_DATA_RAM_CTRL 0x10C
+#define RAM_CTRL_WRITE_SHIFT 8
+#define RAM_CTRL_WRITE_MASK (0x7 << 8)
+#define RAM_CTRL_READ_SHIFT 4
+#define RAM_CTRL_READ_MASK (0x7 << 4)
+#define RAM_CTRL_SETUP_SHIFT 0
+#define RAM_CTRL_SETUP_MASK (0x7 << 0)
#define PL310_EVENT_COUNTER_CTRL 0x200
#define EVENT_COUNTER_CTRL_ENABLED (1 << 0)
#define EVENT_COUNTER_CTRL_C0_RESET (1 << 1)
@@ -113,6 +121,9 @@
#define PL310_ADDR_FILTER_STAR 0xC00
#define PL310_ADDR_FILTER_END 0xC04
#define PL310_DEBUG_CTRL 0xF40
+#define DEBUG_CTRL_DISABLE_LINEFILL (1 << 0)
+#define DEBUG_CTRL_DISABLE_WRITEBACK (1 << 1)
+#define DEBUG_CTRL_SPNIDEN (1 << 2)
#define PL310_PREFETCH_CTRL 0xF60
#define PREFETCH_CTRL_OFFSET_MASK (0x1f)
#define PREFETCH_CTRL_NOTSAMEID (1 << 21)
@@ -123,6 +134,8 @@
#define PREFETCH_CTRL_INSTR_PREFETCH (1 << 29)
#define PREFETCH_CTRL_DL (1 << 30)
#define PL310_POWER_CTRL 0xF60
+#define POWER_CTRL_ENABLE_GATING (1 << 0)
+#define POWER_CTRL_ENABLE_STANDBY (1 << 1)
struct pl310_softc {
device_t sc_dev;
@@ -162,6 +175,8 @@ pl310_write4(struct pl310_softc *sc, bus_size_t off, uint32_t val)
}
void pl310_print_config(struct pl310_softc *sc);
+void pl310_set_ram_latency(struct pl310_softc *sc, uint32_t which_reg,
+ uint32_t read, uint32_t write, uint32_t setup);
void platform_pl310_init(struct pl310_softc *);
void platform_pl310_write_ctrl(struct pl310_softc *, uint32_t);
diff --git a/sys/arm/mv/armadaxp/files.armadaxp b/sys/arm/mv/armadaxp/files.armadaxp
index bd0316fa97c2..2ca0836e3a15 100644
--- a/sys/arm/mv/armadaxp/files.armadaxp
+++ b/sys/arm/mv/armadaxp/files.armadaxp
@@ -4,3 +4,5 @@ arm/mv/armadaxp/armadaxp.c standard
arm/mv/mpic.c standard
arm/mv/rtc.c standard
arm/mv/armadaxp/armadaxp_mp.c optional smp
+arm/mv/armadaxp/mptramp.S optional smp
+
diff --git a/sys/dev/lindev/lindev.h b/sys/arm/mv/armadaxp/mptramp.S
index 9b0be8250a02..4d657e41b470 100644
--- a/sys/dev/lindev/lindev.h
+++ b/sys/arm/mv/armadaxp/mptramp.S
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2009 "Bjoern A. Zeeb" <bz@FreeBSD.org>
+ * Copyright 2011 Semihalf
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,13 +22,35 @@
* LIABILITY, OR TORT (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$
*/
-#ifndef _DEV_LINDEV_LINDEV_H
-#define _DEV_LINDEV_LINDEV_H
+#include <machine/asm.h>
+#include <machine/armreg.h>
+
+__FBSDID("$FreeBSD$");
+
+ASENTRY_NP(mptramp)
+ mov r0, #0
+ mcr p15, 0, r0, c7, c7, 0
+
+ mrs r3, cpsr
+ bic r3, r3, #(PSR_MODE)
+ orr r3, r3, #(PSR_SVC32_MODE)
+ msr cpsr_fsxc, r3
+
+ mrc p15, 0, r0, c0, c0, 5
+ and r0, #0x0f /* Get CPU ID */
+
+ /* Read boot address for CPU */
+ mov r1, #0x100
+ mul r2, r0, r1
+ ldr r1, Lpmureg
+ add r0, r2, r1
+ ldr r1, [r0], #0x00
+
+ mov pc, r1
-int lindev_modevent_full(module_t, int, void *);
+Lpmureg:
+ .word 0xd0022124
+END(mptramp)
-#endif /* _DEV_LINDEV_LINDEV_H */
diff --git a/sys/arm/rockchip/rk30xx_machdep.c b/sys/arm/rockchip/rk30xx_machdep.c
index d8e3f3c2253b..0cb9bca6871f 100644
--- a/sys/arm/rockchip/rk30xx_machdep.c
+++ b/sys/arm/rockchip/rk30xx_machdep.c
@@ -51,14 +51,11 @@ __FBSDID("$FreeBSD$");
#include <arm/rockchip/rk30xx_wdog.h>
-/* Start of address space used for bootstrap map */
-#define DEVMAP_BOOTSTRAP_MAP_START 0xF0000000
-
vm_offset_t
initarm_lastaddr(void)
{
- return (DEVMAP_BOOTSTRAP_MAP_START);
+ return (arm_devmap_lastaddr());
}
void
@@ -81,27 +78,14 @@ initarm_late_init(void)
CPU_CONTROL_DC_ENABLE|CPU_CONTROL_IC_ENABLE);
}
-#define FDT_DEVMAP_MAX (1 + 2 + 1 + 1)
-static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_MAX] = {
- { 0, 0, 0, 0, 0, }
-};
-
/*
- * Construct pmap_devmap[] with DT-derived config data.
+ * Set up static device mappings.
*/
int
initarm_devmap_init(void)
{
- int i = 0;
-
- fdt_devmap[i].pd_va = 0xF0000000;
- fdt_devmap[i].pd_pa = 0x20000000;
- fdt_devmap[i].pd_size = 0x100000;
- fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
- fdt_devmap[i].pd_cache = PTE_DEVICE;
- i++;
- arm_devmap_register_table(&fdt_devmap[0]);
+ arm_devmap_add_entry(0x20000000, 0x00100000);
return (0);
}
diff --git a/sys/arm/xilinx/files.zynq7 b/sys/arm/xilinx/files.zynq7
index 5b25dc495d0c..0407ecb4d5d1 100644
--- a/sys/arm/xilinx/files.zynq7
+++ b/sys/arm/xilinx/files.zynq7
@@ -21,6 +21,7 @@ arm/xilinx/zy7_l2cache.c standard
arm/xilinx/zy7_bus_space.c standard
arm/xilinx/zy7_slcr.c standard
arm/xilinx/zy7_devcfg.c standard
+arm/xilinx/zy7_mp.c optional smp
dev/cadence/if_cgem.c optional if_cgem
dev/sdhci/sdhci_fdt.c optional sdhci
diff --git a/sys/arm/xilinx/std.zynq7 b/sys/arm/xilinx/std.zynq7
index f387703fccfb..1cee32da2e7a 100644
--- a/sys/arm/xilinx/std.zynq7
+++ b/sys/arm/xilinx/std.zynq7
@@ -20,3 +20,5 @@ makeoptions KERNVIRTADDR=0xc0100000
options ARM_L2_PIPT
+options IPI_IRQ_START=0
+options IPI_IRQ_END=15
diff --git a/sys/arm/xilinx/zy7_devcfg.c b/sys/arm/xilinx/zy7_devcfg.c
index ae96dd36671e..a8df6c7d75d9 100644
--- a/sys/arm/xilinx/zy7_devcfg.c
+++ b/sys/arm/xilinx/zy7_devcfg.c
@@ -267,24 +267,35 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_softc *sc)
devcfg_ctl = RD4(sc, ZY7_DEVCFG_CTRL);
+ /* Clear sticky bits and set up INIT signal positive edge interrupt. */
+ WR4(sc, ZY7_DEVCFG_INT_STATUS, ZY7_DEVCFG_INT_ALL);
+ WR4(sc, ZY7_DEVCFG_INT_MASK, ~ZY7_DEVCFG_INT_PCFG_INIT_PE);
+
/* Deassert PROG_B (active low). */
devcfg_ctl |= ZY7_DEVCFG_CTRL_PCFG_PROG_B;
WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl);
- /* Wait for INIT_B deasserted (active low). */
- tries = 0;
- while ((RD4(sc, ZY7_DEVCFG_STATUS) &
- ZY7_DEVCFG_STATUS_PCFG_INIT) == 0) {
- if (++tries >= 100)
- return (EIO);
- DELAY(5);
+ /*
+ * Wait for INIT to assert. If it is already asserted, we may not get
+ * an edge interrupt so cancel it and continue.
+ */
+ if ((RD4(sc, ZY7_DEVCFG_STATUS) &
+ ZY7_DEVCFG_STATUS_PCFG_INIT) != 0) {
+ /* Already asserted. Cancel interrupt. */
+ WR4(sc, ZY7_DEVCFG_INT_MASK, ~0);
}
-
- /* Reassert PROG_B. */
+ else {
+ /* Wait for positive edge interrupt. */
+ err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7i1", hz);
+ if (err != 0)
+ return (err);
+ }
+
+ /* Reassert PROG_B (active low). */
devcfg_ctl &= ~ZY7_DEVCFG_CTRL_PCFG_PROG_B;
WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl);
- /* Wait for INIT_B asserted. */
+ /* Wait for INIT deasserted. This happens almost instantly. */
tries = 0;
while ((RD4(sc, ZY7_DEVCFG_STATUS) &
ZY7_DEVCFG_STATUS_PCFG_INIT) != 0) {
@@ -293,7 +304,7 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_softc *sc)
DELAY(5);
}
- /* Clear sticky bits and set up INIT_B positive edge interrupt. */
+ /* Clear sticky bits and set up INIT positive edge interrupt. */
WR4(sc, ZY7_DEVCFG_INT_STATUS, ZY7_DEVCFG_INT_ALL);
WR4(sc, ZY7_DEVCFG_INT_MASK, ~ZY7_DEVCFG_INT_PCFG_INIT_PE);
@@ -301,11 +312,11 @@ zy7_devcfg_reset_pl(struct zy7_devcfg_softc *sc)
devcfg_ctl |= ZY7_DEVCFG_CTRL_PCFG_PROG_B;
WR4(sc, ZY7_DEVCFG_CTRL, devcfg_ctl);
- /* Wait for INIT_B deasserted indicating FPGA internal initialization
- * is complete. This takes much longer than the previous waits for
- * INIT_B transition (on the order of 700us).
+ /*
+ * Wait for INIT asserted indicating FPGA internal initialization
+ * is complete.
*/
- err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7in", hz);
+ err = mtx_sleep(sc, &sc->sc_mtx, PCATCH, "zy7i2", hz);
if (err != 0)
return (err);
@@ -404,7 +415,9 @@ zy7_devcfg_write(struct cdev *dev, struct uio *uio, int ioflag)
/* uiomove the data from user buffer to our dma map. */
segsz = MIN(PAGE_SIZE, uio->uio_resid);
+ DEVCFG_SC_UNLOCK(sc);
err = uiomove(dma_mem, segsz, uio);
+ DEVCFG_SC_LOCK(sc);
if (err != 0)
break;
diff --git a/sys/arm/xilinx/zy7_machdep.c b/sys/arm/xilinx/zy7_machdep.c
index 8461fca906bb..e7ffaa49ca75 100644
--- a/sys/arm/xilinx/zy7_machdep.c
+++ b/sys/arm/xilinx/zy7_machdep.c
@@ -60,7 +60,7 @@ vm_offset_t
initarm_lastaddr(void)
{
- return (ZYNQ7_PSIO_VBASE);
+ return (arm_devmap_lastaddr());
}
void
@@ -79,39 +79,18 @@ initarm_late_init(void)
{
}
-#define FDT_DEVMAP_SIZE 3
-static struct arm_devmap_entry fdt_devmap[FDT_DEVMAP_SIZE];
-
/*
- * Construct pmap_devmap[] with DT-derived config data.
+ * Set up static device mappings. Not strictly necessary -- simplebus will
+ * dynamically establish mappings as needed -- but doing it this way gets us
+ * nice efficient 1MB section mappings.
*/
int
initarm_devmap_init(void)
{
- int i = 0;
-
- fdt_devmap[i].pd_va = ZYNQ7_PSIO_VBASE;
- fdt_devmap[i].pd_pa = ZYNQ7_PSIO_HWBASE;
- fdt_devmap[i].pd_size = ZYNQ7_PSIO_SIZE;
- fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
- fdt_devmap[i].pd_cache = PTE_DEVICE;
- i++;
-
- fdt_devmap[i].pd_va = ZYNQ7_PSCTL_VBASE;
- fdt_devmap[i].pd_pa = ZYNQ7_PSCTL_HWBASE;
- fdt_devmap[i].pd_size = ZYNQ7_PSCTL_SIZE;
- fdt_devmap[i].pd_prot = VM_PROT_READ | VM_PROT_WRITE;
- fdt_devmap[i].pd_cache = PTE_DEVICE;
- i++;
-
- /* end of table */
- fdt_devmap[i].pd_va = 0;
- fdt_devmap[i].pd_pa = 0;
- fdt_devmap[i].pd_size = 0;
- fdt_devmap[i].pd_prot = 0;
- fdt_devmap[i].pd_cache = 0;
-
- arm_devmap_register_table(&fdt_devmap[0]);
+
+ arm_devmap_add_entry(ZYNQ7_PSIO_HWBASE, ZYNQ7_PSIO_SIZE);
+ arm_devmap_add_entry(ZYNQ7_PSCTL_HWBASE, ZYNQ7_PSCTL_SIZE);
+
return (0);
}
diff --git a/sys/arm/xilinx/zy7_mp.c b/sys/arm/xilinx/zy7_mp.c
new file mode 100644
index 000000000000..831c4df273c6
--- /dev/null
+++ b/sys/arm/xilinx/zy7_mp.c
@@ -0,0 +1,99 @@
+/*-
+ * Copyright (c) 2013 Thomas Skibo. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/bus.h>
+#include <sys/lock.h>
+#include <sys/mutex.h>
+#include <sys/smp.h>
+
+#include <machine/smp.h>
+#include <machine/fdt.h>
+#include <machine/intr.h>
+
+#include <arm/xilinx/zy7_reg.h>
+
+#define ZYNQ7_CPU1_ENTRY 0xfffffff0
+
+void
+platform_mp_init_secondary(void)
+{
+
+ gic_init_secondary();
+}
+
+void
+platform_mp_setmaxid(void)
+{
+
+ mp_maxid = 1;
+}
+
+int
+platform_mp_probe(void)
+{
+
+ mp_ncpus = 2;
+ return (1);
+}
+
+void
+platform_mp_start_ap(void)
+{
+ bus_space_handle_t ocm_handle;
+
+ /* Map in magic location to give entry address to CPU1. */
+ if (bus_space_map(fdtbus_bs_tag, ZYNQ7_CPU1_ENTRY, 4,
+ 0, &ocm_handle) != 0)
+ panic("platform_mp_start_ap: Couldn't map OCM\n");
+
+ /* Write start address for CPU1. */
+ bus_space_write_4(fdtbus_bs_tag, ocm_handle, 0,
+ pmap_kextract((vm_offset_t)mpentry));
+
+ /*
+ * The SCU is enabled by the BOOTROM but I think the second CPU doesn't
+ * turn on filtering until after the wake-up below. I think that's why
+ * things don't work if I don't put these cache ops here. Also, the
+ * magic location, 0xfffffff0, isn't in the SCU's filtering range so it
+ * needs a write-back too.
+ */
+ cpu_idcache_wbinv_all();
+ cpu_l2cache_wbinv_all();
+
+ /* Wake up CPU1. */
+ armv7_sev();
+
+ bus_space_unmap(fdtbus_bs_tag, ocm_handle, 4);
+}
+
+void
+platform_ipi_send(cpuset_t cpus, u_int ipi)
+{
+
+ pic_ipi_send(cpus, ipi);
+}
diff --git a/sys/arm/xilinx/zy7_reg.h b/sys/arm/xilinx/zy7_reg.h
index c1aac9445cb4..2f55ffedaaca 100644
--- a/sys/arm/xilinx/zy7_reg.h
+++ b/sys/arm/xilinx/zy7_reg.h
@@ -44,16 +44,13 @@
#define ZYNQ7_PLGP1_SIZE 0x40000000
/* I/O Peripheral registers. */
-#define ZYNQ7_PSIO_VBASE 0xE0000000
#define ZYNQ7_PSIO_HWBASE 0xE0000000
#define ZYNQ7_PSIO_SIZE 0x00300000
/* UART0 and UART1 */
-#define ZYNQ7_UART0_VBASE (ZYNQ7_PSIO_VBASE)
#define ZYNQ7_UART0_HWBASE (ZYNQ7_PSIO_HWBASE)
#define ZYNQ7_UART0_SIZE 0x1000
-#define ZYNQ7_UART1_VBASE (ZYNQ7_PSIO_VBASE+0x1000)
#define ZYNQ7_UART1_HWBASE (ZYNQ7_PSIO_HWBASE+0x1000)
#define ZYNQ7_UART1_SIZE 0x1000
@@ -63,15 +60,12 @@
#define ZYNQ7_SMC_SIZE 0x05000000
/* SLCR, PS system, and CPU private registers combined in this region. */
-#define ZYNQ7_PSCTL_VBASE 0xF8000000
#define ZYNQ7_PSCTL_HWBASE 0xF8000000
#define ZYNQ7_PSCTL_SIZE 0x01000000
-#define ZYNQ7_SLCR_VBASE (ZYNQ7_PSCTL_VBASE)
#define ZYNQ7_SLCR_HWBASE (ZYNQ7_PSCTL_HWBASE)
#define ZYNQ7_SLCR_SIZE 0x1000
-#define ZYNQ7_DEVCFG_VBASE (ZYNQ7_PSCTL_VBASE+0x7000)
#define ZYNQ7_DEVCFG_HWBASE (ZYNQ7_PSCTL_HWBASE+0x7000)
#define ZYNQ7_DEVCFG_SIZE 0x1000
diff --git a/sys/boot/Makefile b/sys/boot/Makefile
index 0d6441d77bd8..2984bd5c89cf 100644
--- a/sys/boot/Makefile
+++ b/sys/boot/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include <bsd.arch.inc.mk>
.if ${MK_FORTH} != "no"
diff --git a/sys/boot/amd64/Makefile.inc b/sys/boot/amd64/Makefile.inc
index 1bc7ad8f1c3b..ee96a42abd82 100644
--- a/sys/boot/amd64/Makefile.inc
+++ b/sys/boot/amd64/Makefile.inc
@@ -4,8 +4,9 @@
BINDIR?= /boot
+# See conf/kern.mk for the correct set of these
CFLAGS+= -ffreestanding
-CFLAGS+= -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -mno-sse3 -msoft-float
+CFLAGS+= -mno-mmx -mno-sse -mno-aes -mno-avx -msoft-float
LDFLAGS+= -nostdlib
.include "../Makefile.inc"
diff --git a/sys/boot/amd64/efi/Makefile b/sys/boot/amd64/efi/Makefile
index f4138c937052..a9a213227d0e 100644
--- a/sys/boot/amd64/efi/Makefile
+++ b/sys/boot/amd64/efi/Makefile
@@ -2,7 +2,7 @@
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
# In-tree GCC does not support __attribute__((ms_abi)).
.if ${COMPILER_TYPE} != "gcc"
diff --git a/sys/boot/arm/at91/bootspi/Makefile b/sys/boot/arm/at91/bootspi/Makefile
index 04c4fbb51592..a02d447b48a3 100644
--- a/sys/boot/arm/at91/bootspi/Makefile
+++ b/sys/boot/arm/at91/bootspi/Makefile
@@ -1,5 +1,7 @@
# $FreeBSD$
+.include <src.opts.mk>
+
.PATH: ${.CURDIR}/../libat91
P=bootspi
diff --git a/sys/boot/arm/at91/libat91/Makefile b/sys/boot/arm/at91/libat91/Makefile
index 7ab9a1f3bb47..b02281dc640d 100644
--- a/sys/boot/arm/at91/libat91/Makefile
+++ b/sys/boot/arm/at91/libat91/Makefile
@@ -1,5 +1,6 @@
# $FreeBSD$
+.include <src.opts.mk>
.include "${.CURDIR}/../Makefile.inc"
SOC?=at91rm9200
diff --git a/sys/boot/arm/ixp425/boot2/Makefile b/sys/boot/arm/ixp425/boot2/Makefile
index 14e87d1cea63..6fe515e0cfcb 100644
--- a/sys/boot/arm/ixp425/boot2/Makefile
+++ b/sys/boot/arm/ixp425/boot2/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
# We get a lot of the std lib functions from here.
.PATH: ${.CURDIR}/../../at91/libat91
diff --git a/sys/boot/arm/uboot/Makefile b/sys/boot/arm/uboot/Makefile
index 3402e02e2ed4..a24eeac45a2f 100644
--- a/sys/boot/arm/uboot/Makefile
+++ b/sys/boot/arm/uboot/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ubldr
NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
diff --git a/sys/boot/fdt/dts/arm/exynos5250.dtsi b/sys/boot/fdt/dts/arm/exynos5250.dtsi
index 55246eabc2f7..3d2e6bcd2e7c 100644
--- a/sys/boot/fdt/dts/arm/exynos5250.dtsi
+++ b/sys/boot/fdt/dts/arm/exynos5250.dtsi
@@ -126,7 +126,7 @@
reg = <0x12200000 0x1000>;
interrupts = <107>;
interrupt-parent = <&GIC>;
- clock-frequency = <24000000>; /* TODO: verify freq */
+ max-frequency = <24000000>; /* TODO: verify freq */
};
sdhci@12210000 {
@@ -134,7 +134,7 @@
reg = <0x12210000 0x1000>;
interrupts = <108>;
interrupt-parent = <&GIC>;
- clock-frequency = <24000000>;
+ max-frequency = <24000000>;
};
sdhci@12220000 {
@@ -142,7 +142,7 @@
reg = <0x12220000 0x1000>;
interrupts = <109>;
interrupt-parent = <&GIC>;
- clock-frequency = <24000000>;
+ max-frequency = <24000000>;
};
sdhci@12230000 {
@@ -150,7 +150,7 @@
reg = <0x12230000 0x1000>;
interrupts = <110>;
interrupt-parent = <&GIC>;
- clock-frequency = <24000000>;
+ max-frequency = <24000000>;
};
serial0: serial@12C00000 {
diff --git a/sys/boot/fdt/dts/arm/rk3188.dtsi b/sys/boot/fdt/dts/arm/rk3188.dtsi
index 03e38c07cac1..c6ac38561a1f 100644
--- a/sys/boot/fdt/dts/arm/rk3188.dtsi
+++ b/sys/boot/fdt/dts/arm/rk3188.dtsi
@@ -31,6 +31,8 @@
#address-cells = <1>;
#size-cells = <1>;
+ interrupt-parent = <&GIC>;
+
aliases {
soc = &SOC;
};
diff --git a/sys/boot/fdt/dts/arm/zedboard.dts b/sys/boot/fdt/dts/arm/zedboard.dts
index a95a2f7769d1..2d9fccdeac2a 100644
--- a/sys/boot/fdt/dts/arm/zedboard.dts
+++ b/sys/boot/fdt/dts/arm/zedboard.dts
@@ -183,7 +183,7 @@
reg = <0x100000 0x1000>;
interrupts = <56>;
interrupt-parent = <&GIC>;
- clock-frequency = <50000000>;
+ max-frequency = <50000000>;
};
// QSPI
diff --git a/sys/boot/forth/loader.conf b/sys/boot/forth/loader.conf
index 641f95b2f906..3f31b7a8ebec 100644
--- a/sys/boot/forth/loader.conf
+++ b/sys/boot/forth/loader.conf
@@ -241,7 +241,6 @@ screensave_name="green_saver" # Set to the name of the screensaver module
ibcs2_load="NO" # IBCS2 (SCO) emulation
ibcs2_coff_load="NO"
linux_load="NO" # Linux emulation
-lindev_load="NO" # Linux-specific pseudo devices (see lindev(4))
svr4_load="NO" # SystemV R4 emulation
streams_load="NO" # System V streams module
diff --git a/sys/boot/i386/Makefile b/sys/boot/i386/Makefile
index 3c05759fcf09..5ebd55764787 100644
--- a/sys/boot/i386/Makefile
+++ b/sys/boot/i386/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot kgzldr \
libi386 libfirewire loader
diff --git a/sys/boot/i386/boot2/Makefile b/sys/boot/i386/boot2/Makefile
index 1391ac47a975..fa8c29d33a88 100644
--- a/sys/boot/i386/boot2/Makefile
+++ b/sys/boot/i386/boot2/Makefile
@@ -38,13 +38,14 @@ CFLAGS= -Os \
-Wmissing-declarations -Wmissing-prototypes -Wnested-externs \
-Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \
-Winline \
- ${CLANG_OPT_SMALL}
CFLAGS.gcc+= -fno-guess-branch-probability \
-fno-unit-at-a-time \
-mno-align-long-strings \
--param max-inline-insns-single=100
+CFLAGS.clang+=${CLANG_OPT_SMALL}
+
LD_FLAGS=-static -N --gc-sections
# Pick up ../Makefile.inc early.
diff --git a/sys/boot/i386/loader/Makefile b/sys/boot/i386/loader/Makefile
index b98a725ab1e8..b33101283b49 100644
--- a/sys/boot/i386/loader/Makefile
+++ b/sys/boot/i386/loader/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
LOADER?= loader
diff --git a/sys/boot/ia64/common/Makefile b/sys/boot/ia64/common/Makefile
index 5740070594e6..ef2737f4cd2f 100644
--- a/sys/boot/ia64/common/Makefile
+++ b/sys/boot/ia64/common/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
LIB= ia64
diff --git a/sys/boot/ia64/efi/Makefile b/sys/boot/ia64/efi/Makefile
index 6bb53b587123..fc11d6e8d657 100644
--- a/sys/boot/ia64/efi/Makefile
+++ b/sys/boot/ia64/efi/Makefile
@@ -2,7 +2,7 @@
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG= loader.sym
diff --git a/sys/boot/ia64/ski/Makefile b/sys/boot/ia64/ski/Makefile
index 31af84e3450f..06201265f901 100644
--- a/sys/boot/ia64/ski/Makefile
+++ b/sys/boot/ia64/ski/Makefile
@@ -2,7 +2,7 @@
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG= skiload
diff --git a/sys/boot/libstand32/Makefile b/sys/boot/libstand32/Makefile
index fd60d60f2f1b..56f7d153678e 100644
--- a/sys/boot/libstand32/Makefile
+++ b/sys/boot/libstand32/Makefile
@@ -8,7 +8,7 @@
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
S= ${.CURDIR}/../../../lib/libstand
diff --git a/sys/boot/mips/beri/loader/Makefile b/sys/boot/mips/beri/loader/Makefile
index 93360018cedb..fed224712ccd 100644
--- a/sys/boot/mips/beri/loader/Makefile
+++ b/sys/boot/mips/beri/loader/Makefile
@@ -29,7 +29,7 @@
#
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG?= loader
diff --git a/sys/boot/pc98/loader/Makefile b/sys/boot/pc98/loader/Makefile
index 489eeac1542e..7ab13a189dd3 100644
--- a/sys/boot/pc98/loader/Makefile
+++ b/sys/boot/pc98/loader/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
LOADER?= loader
diff --git a/sys/boot/powerpc/ofw/Makefile b/sys/boot/powerpc/ofw/Makefile
index ae4a443986ea..bf4ea8ab1651 100644
--- a/sys/boot/powerpc/ofw/Makefile
+++ b/sys/boot/powerpc/ofw/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG= loader
diff --git a/sys/boot/powerpc/ps3/Makefile b/sys/boot/powerpc/ps3/Makefile
index 87aa6ed565e7..5742a86bd500 100644
--- a/sys/boot/powerpc/ps3/Makefile
+++ b/sys/boot/powerpc/ps3/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG= loader.ps3
diff --git a/sys/boot/powerpc/uboot/Makefile b/sys/boot/powerpc/uboot/Makefile
index c4180cbf2579..4239e47b4c3e 100644
--- a/sys/boot/powerpc/uboot/Makefile
+++ b/sys/boot/powerpc/uboot/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
PROG= ubldr
NEWVERSWHAT= "U-Boot loader" ${MACHINE_ARCH}
diff --git a/sys/boot/sparc64/loader/Makefile b/sys/boot/sparc64/loader/Makefile
index 4624b6f7b448..d7266ad08781 100644
--- a/sys/boot/sparc64/loader/Makefile
+++ b/sys/boot/sparc64/loader/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
PROG?= loader
diff --git a/sys/boot/uboot/lib/Makefile b/sys/boot/uboot/lib/Makefile
index e5ed3ceea56d..4c9e5919a3e9 100644
--- a/sys/boot/uboot/lib/Makefile
+++ b/sys/boot/uboot/lib/Makefile
@@ -1,6 +1,6 @@
# $FreeBSD$
-.include <bsd.own.mk>
+.include <src.opts.mk>
.PATH: ${.CURDIR}/../../common
diff --git a/sys/boot/userboot/userboot/Makefile b/sys/boot/userboot/userboot/Makefile
index cc528b35a738..5623e72c2eda 100644
--- a/sys/boot/userboot/userboot/Makefile
+++ b/sys/boot/userboot/userboot/Makefile
@@ -2,7 +2,7 @@
MAN=
-.include <bsd.own.mk>
+.include <src.opts.mk>
MK_SSP= no
SHLIB_NAME= userboot.so
diff --git a/sys/boot/userboot/userboot/conf.c b/sys/boot/userboot/userboot/conf.c
index 5eac87da9869..6727a223e327 100644
--- a/sys/boot/userboot/userboot/conf.c
+++ b/sys/boot/userboot/userboot/conf.c
@@ -97,8 +97,10 @@ struct file_format *file_formats[] = {
* data structures from bootstrap.h as well.
*/
extern struct console userboot_console;
+extern struct console userboot_comconsole;
struct console *consoles[] = {
&userboot_console,
+ &userboot_comconsole,
NULL
};
diff --git a/sys/boot/userboot/userboot/userboot_cons.c b/sys/boot/userboot/userboot/userboot_cons.c
index 5ecb7c8b2ec1..6f73ad5633bb 100644
--- a/sys/boot/userboot/userboot/userboot_cons.c
+++ b/sys/boot/userboot/userboot/userboot_cons.c
@@ -33,8 +33,12 @@ __FBSDID("$FreeBSD$");
int console;
+static struct console *userboot_comconsp;
+
static void userboot_cons_probe(struct console *cp);
static int userboot_cons_init(int);
+static void userboot_comcons_probe(struct console *cp);
+static int userboot_comcons_init(int);
static void userboot_cons_putchar(int);
static int userboot_cons_getchar(void);
static int userboot_cons_poll(void);
@@ -50,6 +54,21 @@ struct console userboot_console = {
userboot_cons_poll,
};
+/*
+ * Provide a simple alias to allow loader scripts to set the
+ * console to comconsole without resulting in an error
+ */
+struct console userboot_comconsole = {
+ "comconsole",
+ "comconsole",
+ 0,
+ userboot_comcons_probe,
+ userboot_comcons_init,
+ userboot_cons_putchar,
+ userboot_cons_getchar,
+ userboot_cons_poll,
+};
+
static void
userboot_cons_probe(struct console *cp)
{
@@ -65,6 +84,31 @@ userboot_cons_init(int arg)
}
static void
+userboot_comcons_probe(struct console *cp)
+{
+
+ /*
+ * Save the console pointer so the comcons_init routine
+ * can set the C_PRESENT* flags. They are not set
+ * here to allow the existing userboot console to
+ * be elected the default.
+ */
+ userboot_comconsp = cp;
+}
+
+static int
+userboot_comcons_init(int arg)
+{
+
+ /*
+ * Set the C_PRESENT* flags to allow the comconsole
+ * to be selected as the active console
+ */
+ userboot_comconsp->c_flags |= (C_PRESENTIN | C_PRESENTOUT);
+ return (0);
+}
+
+static void
userboot_cons_putchar(int c)
{
diff --git a/sys/cam/ctl/ctl_io.h b/sys/cam/ctl/ctl_io.h
index e423bb065ba6..e018b3f8a5f6 100644
--- a/sys/cam/ctl/ctl_io.h
+++ b/sys/cam/ctl/ctl_io.h
@@ -293,21 +293,60 @@ union ctl_io;
*/
struct ctl_scsiio {
struct ctl_io_hdr io_hdr; /* common to all I/O types */
+
+ /*
+ * The ext_* fields are generally intended for frontend use; CTL itself
+ * doesn't modify or use them.
+ */
uint32_t ext_sg_entries; /* 0 = no S/G list, > 0 = num entries */
uint8_t *ext_data_ptr; /* data buffer or S/G list */
uint32_t ext_data_len; /* Data transfer length */
uint32_t ext_data_filled; /* Amount of data filled so far */
- uint32_t kern_sg_entries; /* 0 = no S/G list, > 0 = num entries */
- uint32_t rem_sg_entries; /* 0 = no S/G list, > 0 = num entries */
- uint8_t *kern_data_ptr; /* data buffer or S/G list */
- uint32_t kern_data_len; /* Length of this S/G list/buffer */
- uint32_t kern_total_len; /* Total length of this transaction */
- uint32_t kern_data_resid; /* Length left to transfer after this*/
- uint32_t kern_rel_offset; /* Byte Offset of this transfer */
+
+ /*
+ * The number of scatter/gather entries in the list pointed to
+ * by kern_data_ptr. 0 means there is no list, just a data pointer.
+ */
+ uint32_t kern_sg_entries;
+
+ uint32_t rem_sg_entries; /* Unused. */
+
+ /*
+ * The data pointer or a pointer to the scatter/gather list.
+ */
+ uint8_t *kern_data_ptr;
+
+ /*
+ * Length of the data buffer or scatter/gather list. It's also
+ * the length of this particular piece of the data transfer,
+ * ie. number of bytes expected to be transferred by the current
+ * invocation of frontend's datamove() callback. It's always
+ * less than or equal to kern_total_len.
+ */
+ uint32_t kern_data_len;
+
+ /*
+ * Total length of data to be transferred during this particular
+ * SCSI command, as decoded from SCSI CDB.
+ */
+ uint32_t kern_total_len;
+
+ /*
+ * Amount of data left after the current data transfer.
+ */
+ uint32_t kern_data_resid;
+
+ /*
+ * Byte offset of this transfer, equal to the amount of data
+ * already transferred for this SCSI command during previous
+ * datamove() invocations.
+ */
+ uint32_t kern_rel_offset;
+
struct scsi_sense_data sense_data; /* sense data */
uint8_t sense_len; /* Returned sense length */
uint8_t scsi_status; /* SCSI status byte */
- uint8_t sense_residual; /* sense residual length */
+ uint8_t sense_residual; /* Unused. */
uint32_t residual; /* data residual length */
uint32_t tag_num; /* tag number */
ctl_tag_type tag_type; /* simple, ordered, head of queue,etc.*/
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 2faa8ddcb4e4..de2035323b34 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -90,7 +90,8 @@ typedef enum {
DA_FLAG_SCTX_INIT = 0x200,
DA_FLAG_CAN_RC16 = 0x400,
DA_FLAG_PROBED = 0x800,
- DA_FLAG_DIRTY = 0x1000
+ DA_FLAG_DIRTY = 0x1000,
+ DA_FLAG_ANNOUNCED = 0x2000
} da_flags;
typedef enum {
@@ -211,6 +212,7 @@ struct da_softc {
int trim_max_ranges;
int delete_running;
int delete_available; /* Delete methods possibly available */
+ u_int maxio;
uint32_t unmap_max_ranges;
uint32_t unmap_max_lba; /* Max LBAs in UNMAP req */
uint64_t ws_max_blks;
@@ -1658,10 +1660,18 @@ daasync(void *callback_arg, u_int32_t code,
&error_code, &sense_key, &asc, &ascq)) {
if (asc == 0x2A && ascq == 0x09) {
xpt_print(ccb->ccb_h.path,
- "capacity data has changed\n");
+ "Capacity data has changed\n");
+ softc->flags &= ~DA_FLAG_PROBED;
dareprobe(periph);
- } else if (asc == 0x28 && ascq == 0x00)
+ } else if (asc == 0x28 && ascq == 0x00) {
+ softc->flags &= ~DA_FLAG_PROBED;
disk_media_changed(softc->disk, M_NOWAIT);
+ } else if (asc == 0x3F && ascq == 0x03) {
+ xpt_print(ccb->ccb_h.path,
+ "INQUIRY data has changed\n");
+ softc->flags &= ~DA_FLAG_PROBED;
+ dareprobe(periph);
+ }
}
cam_periph_async(periph, code, path, arg);
break;
@@ -1891,7 +1901,7 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
dadeletemethodchoose(softc, DA_DELETE_NONE);
- if (bootverbose && (softc->flags & DA_FLAG_PROBED) == 0) {
+ if (bootverbose && (softc->flags & DA_FLAG_ANNOUNCED) == 0) {
char buf[80];
int i, sep;
@@ -1932,10 +1942,11 @@ daprobedone(struct cam_periph *periph, union ccb *ccb)
*/
xpt_release_ccb(ccb);
softc->state = DA_STATE_NORMAL;
+ softc->flags |= DA_FLAG_PROBED;
daschedule(periph);
wakeup(&softc->disk->d_mediasize);
- if ((softc->flags & DA_FLAG_PROBED) == 0) {
- softc->flags |= DA_FLAG_PROBED;
+ if ((softc->flags & DA_FLAG_ANNOUNCED) == 0) {
+ softc->flags |= DA_FLAG_ANNOUNCED;
cam_periph_unhold(periph);
} else
cam_periph_release_locked(periph);
@@ -2125,11 +2136,12 @@ daregister(struct cam_periph *periph, void *arg)
softc->disk->d_name = "da";
softc->disk->d_drv1 = periph;
if (cpi.maxio == 0)
- softc->disk->d_maxsize = DFLTPHYS; /* traditional default */
+ softc->maxio = DFLTPHYS; /* traditional default */
else if (cpi.maxio > MAXPHYS)
- softc->disk->d_maxsize = MAXPHYS; /* for safety */
+ softc->maxio = MAXPHYS; /* for safety */
else
- softc->disk->d_maxsize = cpi.maxio;
+ softc->maxio = cpi.maxio;
+ softc->disk->d_maxsize = softc->maxio;
softc->disk->d_unit = periph->unit_number;
softc->disk->d_flags = DISKFLAG_DIRECT_COMPLETION;
if ((softc->quirks & DA_Q_NO_SYNC_CACHE) == 0)
@@ -3190,7 +3202,8 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
}
}
free(csio->data_ptr, M_SCSIDA);
- if (announce_buf[0] != '\0' && ((softc->flags & DA_FLAG_PROBED) == 0)) {
+ if (announce_buf[0] != '\0' &&
+ ((softc->flags & DA_FLAG_ANNOUNCED) == 0)) {
/*
* Create our sysctl variables, now that we know
* we have successfully attached.
@@ -3208,6 +3221,12 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
}
}
+ /* We already probed the device. */
+ if (softc->flags & DA_FLAG_PROBED) {
+ daprobedone(periph, done_ccb);
+ return;
+ }
+
/* Ensure re-probe doesn't see old delete. */
softc->delete_available = 0;
if (lbp && (softc->quirks & DA_Q_NO_UNMAP) == 0) {
@@ -3259,14 +3278,6 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
(lbp->flags & SVPD_LBP_WS10));
dadeleteflag(softc, DA_DELETE_UNMAP,
(lbp->flags & SVPD_LBP_UNMAP));
-
- if (lbp->flags & SVPD_LBP_UNMAP) {
- free(lbp, M_SCSIDA);
- xpt_release_ccb(done_ccb);
- softc->state = DA_STATE_PROBE_BLK_LIMITS;
- xpt_schedule(periph, priority);
- return;
- }
} else {
int error;
error = daerror(done_ccb, CAM_RETRY_SELTO,
@@ -3292,7 +3303,7 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
free(lbp, M_SCSIDA);
xpt_release_ccb(done_ccb);
- softc->state = DA_STATE_PROBE_BDC;
+ softc->state = DA_STATE_PROBE_BLK_LIMITS;
xpt_schedule(periph, priority);
return;
}
@@ -3303,12 +3314,20 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
block_limits = (struct scsi_vpd_block_limits *)csio->data_ptr;
if ((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_CMP) {
+ uint32_t max_txfer_len = scsi_4btoul(
+ block_limits->max_txfer_len);
uint32_t max_unmap_lba_cnt = scsi_4btoul(
block_limits->max_unmap_lba_cnt);
uint32_t max_unmap_blk_cnt = scsi_4btoul(
block_limits->max_unmap_blk_cnt);
uint64_t ws_max_blks = scsi_8btou64(
block_limits->max_write_same_length);
+
+ if (max_txfer_len != 0) {
+ softc->disk->d_maxsize = MIN(softc->maxio,
+ (off_t)max_txfer_len * softc->params.secsize);
+ }
+
/*
* We should already support UNMAP but we check lba
* and block count to be sure
@@ -3546,13 +3565,21 @@ daerror(union ccb *ccb, u_int32_t cam_flags, u_int32_t sense_flags)
*/
else if (sense_key == SSD_KEY_UNIT_ATTENTION &&
asc == 0x2A && ascq == 0x09) {
- xpt_print(periph->path, "capacity data has changed\n");
+ xpt_print(periph->path, "Capacity data has changed\n");
+ softc->flags &= ~DA_FLAG_PROBED;
dareprobe(periph);
sense_flags |= SF_NO_PRINT;
} else if (sense_key == SSD_KEY_UNIT_ATTENTION &&
- asc == 0x28 && ascq == 0x00)
+ asc == 0x28 && ascq == 0x00) {
+ softc->flags &= ~DA_FLAG_PROBED;
disk_media_changed(softc->disk, M_NOWAIT);
- else if (sense_key == SSD_KEY_NOT_READY &&
+ } else if (sense_key == SSD_KEY_UNIT_ATTENTION &&
+ asc == 0x3F && ascq == 0x03) {
+ xpt_print(periph->path, "INQUIRY data has changed\n");
+ softc->flags &= ~DA_FLAG_PROBED;
+ dareprobe(periph);
+ sense_flags |= SF_NO_PRINT;
+ } else if (sense_key == SSD_KEY_NOT_READY &&
asc == 0x3a && (softc->flags & DA_FLAG_PACK_INVALID) == 0) {
softc->flags |= DA_FLAG_PACK_INVALID;
disk_media_gone(softc->disk, M_NOWAIT);
diff --git a/sys/cddl/compat/opensolaris/sys/dkio.h b/sys/cddl/compat/opensolaris/sys/dkio.h
index 50cafabb1e11..a365c335c421 100644
--- a/sys/cddl/compat/opensolaris/sys/dkio.h
+++ b/sys/cddl/compat/opensolaris/sys/dkio.h
@@ -75,8 +75,6 @@ extern "C" {
*/
#define DKIOCFLUSHWRITECACHE (DKIOC|34) /* flush cache to phys medium */
-#define DKIOCTRIM (DKIOC|35) /* TRIM a block */
-
struct dk_callback {
void (*dkc_callback)(void *dkc_cookie, int error);
void *dkc_cookie;
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
index 58aca2ca555f..407c6eaf429f 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/metaslab.c
@@ -411,7 +411,7 @@ metaslab_group_create(metaslab_class_t *mc, vdev_t *vd)
mg->mg_class = mc;
mg->mg_activation_count = 0;
- mg->mg_taskq = taskq_create("metaslab_group_tasksq", metaslab_load_pct,
+ mg->mg_taskq = taskq_create("metaslab_group_taskq", metaslab_load_pct,
minclsyspri, 10, INT_MAX, TASKQ_THREADS_CPU_PCT);
return (mg);
@@ -429,6 +429,7 @@ metaslab_group_destroy(metaslab_group_t *mg)
*/
ASSERT(mg->mg_activation_count <= 0);
+ taskq_destroy(mg->mg_taskq);
avl_destroy(&mg->mg_metaslab_tree);
mutex_destroy(&mg->mg_lock);
kmem_free(mg, sizeof (metaslab_group_t));
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
index 41960b51e8ba..84187a843b17 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h
@@ -135,9 +135,10 @@ typedef enum zio_priority {
ZIO_PRIORITY_ASYNC_READ, /* prefetch */
ZIO_PRIORITY_ASYNC_WRITE, /* spa_sync() */
ZIO_PRIORITY_SCRUB, /* asynchronous scrub/resilver reads */
+ ZIO_PRIORITY_TRIM, /* free requests used for TRIM */
ZIO_PRIORITY_NUM_QUEUEABLE,
- ZIO_PRIORITY_NOW /* non-queued i/os (e.g. free) */
+ ZIO_PRIORITY_NOW /* non-queued I/Os (e.g. ioctl) */
} zio_priority_t;
#define ZIO_PIPELINE_CONTINUE 0x100
@@ -195,6 +196,7 @@ enum zio_flag {
ZIO_FLAG_NOPWRITE = 1 << 25,
ZIO_FLAG_REEXECUTED = 1 << 26,
ZIO_FLAG_DELEGATED = 1 << 27,
+ ZIO_FLAG_QUEUE_IO_DONE = 1 << 28,
};
#define ZIO_FLAG_MUSTSUCCEED 0
@@ -349,7 +351,7 @@ typedef struct zio_transform {
struct zio_transform *zt_next;
} zio_transform_t;
-typedef int zio_pipe_stage_t(zio_t *zio);
+typedef int zio_pipe_stage_t(zio_t **ziop);
/*
* The io_reexecute flags are distinct from io_flags because the child must
@@ -508,7 +510,7 @@ extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg,
extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd,
uint64_t offset, uint64_t size, zio_done_func_t *done, void *priv,
- enum zio_flag flags);
+ zio_priority_t priority, enum zio_flag flags);
extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset,
uint64_t size, void *data, int checksum,
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h
index ad212b74e52a..33b8edb51a81 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio_impl.h
@@ -215,6 +215,10 @@ enum zio_stage {
ZIO_STAGE_FREE_BP_INIT | \
ZIO_STAGE_DVA_FREE)
+#define ZIO_FREE_PHYS_PIPELINE \
+ (ZIO_INTERLOCK_STAGES | \
+ ZIO_VDEV_IO_STAGES)
+
#define ZIO_DDT_FREE_PIPELINE \
(ZIO_INTERLOCK_STAGES | \
ZIO_STAGE_FREE_BP_INIT | \
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
index fd7394a931a2..7e981993ca46 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c
@@ -449,7 +449,7 @@ trim_map_vdev_commit(spa_t *spa, zio_t *zio, vdev_t *vd)
{
trim_map_t *tm = vd->vdev_trimmap;
trim_seg_t *ts;
- uint64_t size, txgtarget, txgsafe;
+ uint64_t size, offset, txgtarget, txgsafe;
hrtime_t timelimit;
ASSERT(vd->vdev_ops->vdev_op_leaf);
@@ -477,9 +477,19 @@ trim_map_vdev_commit(spa_t *spa, zio_t *zio, vdev_t *vd)
avl_remove(&tm->tm_queued_frees, ts);
avl_add(&tm->tm_inflight_frees, ts);
size = ts->ts_end - ts->ts_start;
- zio_nowait(zio_trim(zio, spa, vd, ts->ts_start, size));
+ offset = ts->ts_start;
TRIM_MAP_SDEC(tm, size);
TRIM_MAP_QDEC(tm);
+ /*
+ * We drop the lock while we call zio_nowait as the IO
+ * scheduler can result in a different IO being run e.g.
+ * a write which would result in a recursive lock.
+ */
+ mutex_exit(&tm->tm_lock);
+
+ zio_nowait(zio_trim(zio, spa, vd, offset, size));
+
+ mutex_enter(&tm->tm_lock);
}
mutex_exit(&tm->tm_lock);
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
index 1c30941fb2d1..b64ebddbcb1a 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c
@@ -800,10 +800,11 @@ vdev_geom_io_start(zio_t *zio)
vd = zio->io_vd;
- if (zio->io_type == ZIO_TYPE_IOCTL) {
+ switch (zio->io_type) {
+ case ZIO_TYPE_IOCTL:
/* XXPOLICY */
if (!vdev_readable(vd)) {
- zio->io_error = ENXIO;
+ zio->io_error = SET_ERROR(ENXIO);
return (ZIO_PIPELINE_CONTINUE);
}
@@ -812,28 +813,28 @@ vdev_geom_io_start(zio_t *zio)
if (zfs_nocacheflush || vdev_geom_bio_flush_disable)
break;
if (vd->vdev_nowritecache) {
- zio->io_error = ENOTSUP;
- break;
- }
- goto sendreq;
- case DKIOCTRIM:
- if (vdev_geom_bio_delete_disable)
- break;
- if (vd->vdev_notrim) {
- zio->io_error = ENOTSUP;
+ zio->io_error = SET_ERROR(ENOTSUP);
break;
}
goto sendreq;
default:
- zio->io_error = ENOTSUP;
+ zio->io_error = SET_ERROR(ENOTSUP);
}
return (ZIO_PIPELINE_CONTINUE);
+ case ZIO_TYPE_FREE:
+ if (vdev_geom_bio_delete_disable)
+ return (ZIO_PIPELINE_CONTINUE);
+
+ if (vd->vdev_notrim) {
+ zio->io_error = SET_ERROR(ENOTSUP);
+ return (ZIO_PIPELINE_CONTINUE);
+ }
}
sendreq:
cp = vd->vdev_tsd;
if (cp == NULL) {
- zio->io_error = ENXIO;
+ zio->io_error = SET_ERROR(ENXIO);
return (ZIO_PIPELINE_CONTINUE);
}
bp = g_alloc_bio();
@@ -846,21 +847,20 @@ sendreq:
bp->bio_offset = zio->io_offset;
bp->bio_length = zio->io_size;
break;
+ case ZIO_TYPE_FREE:
+ bp->bio_cmd = BIO_DELETE;
+ bp->bio_data = NULL;
+ bp->bio_offset = zio->io_offset;
+ bp->bio_length = zio->io_size;
+ break;
case ZIO_TYPE_IOCTL:
- switch (zio->io_cmd) {
- case DKIOCFLUSHWRITECACHE:
+ if (zio->io_cmd == DKIOCFLUSHWRITECACHE) {
bp->bio_cmd = BIO_FLUSH;
bp->bio_flags |= BIO_ORDERED;
bp->bio_data = NULL;
bp->bio_offset = cp->provider->mediasize;
bp->bio_length = 0;
break;
- case DKIOCTRIM:
- bp->bio_cmd = BIO_DELETE;
- bp->bio_data = NULL;
- bp->bio_offset = zio->io_offset;
- bp->bio_length = zio->io_size;
- break;
}
break;
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
index d7d0deeadd3d..60fd4c3eedf2 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_queue.c
@@ -40,9 +40,9 @@
*
* ZFS issues I/O operations to leaf vdevs to satisfy and complete zios. The
* I/O scheduler determines when and in what order those operations are
- * issued. The I/O scheduler divides operations into five I/O classes
+ * issued. The I/O scheduler divides operations into six I/O classes
* prioritized in the following order: sync read, sync write, async read,
- * async write, and scrub/resilver. Each queue defines the minimum and
+ * async write, scrub/resilver and trim. Each queue defines the minimum and
* maximum number of concurrent operations that may be issued to the device.
* In addition, the device has an aggregate maximum. Note that the sum of the
* per-queue minimums must not exceed the aggregate maximum, and if the
@@ -61,7 +61,7 @@
* done in the order specified above. No further operations are issued if the
* aggregate maximum number of concurrent operations has been hit or if there
* are no operations queued for an I/O class that has not hit its maximum.
- * Every time an i/o is queued or an operation completes, the I/O scheduler
+ * Every time an I/O is queued or an operation completes, the I/O scheduler
* looks for new operations to issue.
*
* All I/O classes have a fixed maximum number of outstanding operations
@@ -70,7 +70,7 @@
* transaction groups (see txg.c). Transaction groups enter the syncing state
* periodically so the number of queued async writes will quickly burst up and
* then bleed down to zero. Rather than servicing them as quickly as possible,
- * the I/O scheduler changes the maximum number of active async write i/os
+ * the I/O scheduler changes the maximum number of active async write I/Os
* according to the amount of dirty data in the pool (see dsl_pool.c). Since
* both throughput and latency typically increase with the number of
* concurrent operations issued to physical devices, reducing the burstiness
@@ -113,14 +113,14 @@
*/
/*
- * The maximum number of i/os active to each device. Ideally, this will be >=
+ * The maximum number of I/Os active to each device. Ideally, this will be >=
* the sum of each queue's max_active. It must be at least the sum of each
* queue's min_active.
*/
uint32_t zfs_vdev_max_active = 1000;
/*
- * Per-queue limits on the number of i/os active to each device. If the
+ * Per-queue limits on the number of I/Os active to each device. If the
* sum of the queue's max_active is < zfs_vdev_max_active, then the
* min_active comes into play. We will send min_active from each queue,
* and then select from queues in the order defined by zio_priority_t.
@@ -145,6 +145,14 @@ uint32_t zfs_vdev_async_write_min_active = 1;
uint32_t zfs_vdev_async_write_max_active = 10;
uint32_t zfs_vdev_scrub_min_active = 1;
uint32_t zfs_vdev_scrub_max_active = 2;
+uint32_t zfs_vdev_trim_min_active = 1;
+/*
+ * TRIM max active is large in comparison to the other values due to the fact
+ * that TRIM IOs are coalesced at the device layer. This value is set such
+ * that a typical SSD can process the queued IOs in a single request.
+ */
+uint32_t zfs_vdev_trim_max_active = 64;
+
/*
* When the pool has less than zfs_vdev_async_write_active_min_dirty_percent
@@ -171,7 +179,7 @@ SYSCTL_DECL(_vfs_zfs_vdev);
TUNABLE_INT("vfs.zfs.vdev.max_active", &zfs_vdev_max_active);
SYSCTL_UINT(_vfs_zfs_vdev, OID_AUTO, max_active, CTLFLAG_RW,
&zfs_vdev_max_active, 0,
- "The maximum number of i/os of all types active for each device.");
+ "The maximum number of I/Os of all types active for each device.");
#define ZFS_VDEV_QUEUE_KNOB_MIN(name) \
TUNABLE_INT("vfs.zfs.vdev." #name "_min_active", \
@@ -199,6 +207,8 @@ ZFS_VDEV_QUEUE_KNOB_MIN(async_write);
ZFS_VDEV_QUEUE_KNOB_MAX(async_write);
ZFS_VDEV_QUEUE_KNOB_MIN(scrub);
ZFS_VDEV_QUEUE_KNOB_MAX(scrub);
+ZFS_VDEV_QUEUE_KNOB_MIN(trim);
+ZFS_VDEV_QUEUE_KNOB_MAX(trim);
#undef ZFS_VDEV_QUEUE_KNOB
@@ -299,6 +309,7 @@ static void
vdev_queue_io_add(vdev_queue_t *vq, zio_t *zio)
{
spa_t *spa = zio->io_spa;
+ ASSERT(MUTEX_HELD(&vq->vq_lock));
ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
avl_add(&vq->vq_class[zio->io_priority].vqc_queued_tree, zio);
@@ -315,6 +326,7 @@ static void
vdev_queue_io_remove(vdev_queue_t *vq, zio_t *zio)
{
spa_t *spa = zio->io_spa;
+ ASSERT(MUTEX_HELD(&vq->vq_lock));
ASSERT3U(zio->io_priority, <, ZIO_PRIORITY_NUM_QUEUEABLE);
avl_remove(&vq->vq_class[zio->io_priority].vqc_queued_tree, zio);
@@ -403,6 +415,8 @@ vdev_queue_class_min_active(zio_priority_t p)
return (zfs_vdev_async_write_min_active);
case ZIO_PRIORITY_SCRUB:
return (zfs_vdev_scrub_min_active);
+ case ZIO_PRIORITY_TRIM:
+ return (zfs_vdev_trim_min_active);
default:
panic("invalid priority %u", p);
return (0);
@@ -454,6 +468,8 @@ vdev_queue_class_max_active(spa_t *spa, zio_priority_t p)
spa->spa_dsl_pool->dp_dirty_total));
case ZIO_PRIORITY_SCRUB:
return (zfs_vdev_scrub_max_active);
+ case ZIO_PRIORITY_TRIM:
+ return (zfs_vdev_trim_max_active);
default:
panic("invalid priority %u", p);
return (0);
@@ -470,6 +486,8 @@ vdev_queue_class_to_issue(vdev_queue_t *vq)
spa_t *spa = vq->vq_vdev->vdev_spa;
zio_priority_t p;
+ ASSERT(MUTEX_HELD(&vq->vq_lock));
+
if (avl_numnodes(&vq->vq_active_tree) >= zfs_vdev_max_active)
return (ZIO_PRIORITY_NUM_QUEUEABLE);
@@ -511,10 +529,11 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
zio_t *first, *last, *aio, *dio, *mandatory, *nio;
uint64_t maxgap = 0;
uint64_t size;
- boolean_t stretch = B_FALSE;
- vdev_queue_class_t *vqc = &vq->vq_class[zio->io_priority];
- avl_tree_t *t = &vqc->vqc_queued_tree;
- enum zio_flag flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT;
+ boolean_t stretch;
+ avl_tree_t *t;
+ enum zio_flag flags;
+
+ ASSERT(MUTEX_HELD(&vq->vq_lock));
if (zio->io_flags & ZIO_FLAG_DONT_AGGREGATE)
return (NULL);
@@ -552,6 +571,8 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
* Walk backwards through sufficiently contiguous I/Os
* recording the last non-option I/O.
*/
+ flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT;
+ t = &vq->vq_class[zio->io_priority].vqc_queued_tree;
while ((dio = AVL_PREV(t, first)) != NULL &&
(dio->io_flags & ZIO_FLAG_AGG_INHERIT) == flags &&
IO_SPAN(dio, last) <= zfs_vdev_aggregation_limit &&
@@ -591,6 +612,7 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
* non-optional I/O is close enough to make aggregation
* worthwhile.
*/
+ stretch = B_FALSE;
if (zio->io_type == ZIO_TYPE_WRITE && mandatory != NULL) {
zio_t *nio = last;
while ((dio = AVL_NEXT(t, nio)) != NULL &&
@@ -731,11 +753,13 @@ vdev_queue_io(zio_t *zio)
zio->io_priority != ZIO_PRIORITY_ASYNC_READ &&
zio->io_priority != ZIO_PRIORITY_SCRUB)
zio->io_priority = ZIO_PRIORITY_ASYNC_READ;
- } else {
- ASSERT(zio->io_type == ZIO_TYPE_WRITE);
+ } else if (zio->io_type == ZIO_TYPE_WRITE) {
if (zio->io_priority != ZIO_PRIORITY_SYNC_WRITE &&
zio->io_priority != ZIO_PRIORITY_ASYNC_WRITE)
zio->io_priority = ZIO_PRIORITY_ASYNC_WRITE;
+ } else {
+ ASSERT(zio->io_type == ZIO_TYPE_FREE);
+ zio->io_priority = ZIO_PRIORITY_TRIM;
}
zio->io_flags |= ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE;
@@ -772,14 +796,25 @@ vdev_queue_io_done(zio_t *zio)
vq->vq_io_complete_ts = gethrtime();
+ if (zio->io_flags & ZIO_FLAG_QUEUE_IO_DONE) {
+ /*
+ * Executing from a previous vdev_queue_io_done so
+ * to avoid recursion we just unlock and return.
+ */
+ mutex_exit(&vq->vq_lock);
+ return;
+ }
+
while ((nio = vdev_queue_io_to_issue(vq)) != NULL) {
mutex_exit(&vq->vq_lock);
+ nio->io_flags |= ZIO_FLAG_QUEUE_IO_DONE;
if (nio->io_done == vdev_queue_agg_io_done) {
zio_nowait(nio);
} else {
zio_vdev_io_reissue(nio);
zio_execute(nio);
}
+ nio->io_flags &= ~ZIO_FLAG_QUEUE_IO_DONE;
mutex_enter(&vq->vq_lock);
}
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
index ea81b43b3232..01946fb2b553 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c
@@ -788,6 +788,8 @@ zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp,
else if (BP_IS_GANG(bp) || BP_GET_DEDUP(bp))
stage |= ZIO_STAGE_ISSUE_ASYNC;
+ flags |= ZIO_FLAG_DONT_QUEUE;
+
zio = zio_create(pio, spa, txg, bp, NULL, size,
NULL, NULL, ZIO_TYPE_FREE, ZIO_PRIORITY_NOW, flags,
NULL, 0, NULL, ZIO_STAGE_OPEN, stage);
@@ -827,14 +829,14 @@ zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp,
zio_t *
zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, uint64_t offset,
uint64_t size, zio_done_func_t *done, void *private,
- enum zio_flag flags)
+ zio_priority_t priority, enum zio_flag flags)
{
zio_t *zio;
int c;
if (vd->vdev_children == 0) {
zio = zio_create(pio, spa, 0, NULL, NULL, size, done, private,
- ZIO_TYPE_IOCTL, ZIO_PRIORITY_NOW, flags, vd, offset, NULL,
+ ZIO_TYPE_IOCTL, priority, flags, vd, offset, NULL,
ZIO_STAGE_OPEN, ZIO_IOCTL_PIPELINE);
zio->io_cmd = cmd;
@@ -843,7 +845,7 @@ zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, uint64_t offset,
for (c = 0; c < vd->vdev_children; c++)
zio_nowait(zio_ioctl(zio, spa, vd->vdev_child[c], cmd,
- offset, size, done, private, flags));
+ offset, size, done, private, priority, flags));
}
return (zio);
@@ -928,6 +930,10 @@ zio_vdev_child_io(zio_t *pio, blkptr_t *bp, vdev_t *vd, uint64_t offset,
pio->io_pipeline &= ~ZIO_STAGE_CHECKSUM_VERIFY;
}
+ /* Not all IO types require vdev io done stage e.g. free */
+ if (!(pio->io_pipeline & ZIO_STAGE_VDEV_IO_DONE))
+ pipeline &= ~ZIO_STAGE_VDEV_IO_DONE;
+
if (vd->vdev_children == 0)
offset += VDEV_LABEL_START_SIZE;
@@ -973,7 +979,7 @@ void
zio_flush(zio_t *zio, vdev_t *vd)
{
zio_nowait(zio_ioctl(zio, zio->io_spa, vd, DKIOCFLUSHWRITECACHE, 0, 0,
- NULL, NULL,
+ NULL, NULL, ZIO_PRIORITY_NOW,
ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY));
}
@@ -983,9 +989,10 @@ zio_trim(zio_t *zio, spa_t *spa, vdev_t *vd, uint64_t offset, uint64_t size)
ASSERT(vd->vdev_ops->vdev_op_leaf);
- return zio_ioctl(zio, spa, vd, DKIOCTRIM, offset, size,
- NULL, NULL,
- ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY);
+ return (zio_create(zio, spa, 0, NULL, NULL, size, NULL, NULL,
+ ZIO_TYPE_FREE, ZIO_PRIORITY_TRIM, ZIO_FLAG_DONT_AGGREGATE |
+ ZIO_FLAG_CANFAIL | ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY,
+ vd, offset, NULL, ZIO_STAGE_OPEN, ZIO_FREE_PHYS_PIPELINE));
}
void
@@ -1012,8 +1019,9 @@ zio_shrink(zio_t *zio, uint64_t size)
*/
static int
-zio_read_bp_init(zio_t *zio)
+zio_read_bp_init(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
if (BP_GET_COMPRESS(bp) != ZIO_COMPRESS_OFF &&
@@ -1038,8 +1046,9 @@ zio_read_bp_init(zio_t *zio)
}
static int
-zio_write_bp_init(zio_t *zio)
+zio_write_bp_init(zio_t **ziop)
{
+ zio_t *zio = *ziop;
spa_t *spa = zio->io_spa;
zio_prop_t *zp = &zio->io_prop;
enum zio_compress compress = zp->zp_compress;
@@ -1189,8 +1198,9 @@ zio_write_bp_init(zio_t *zio)
}
static int
-zio_free_bp_init(zio_t *zio)
+zio_free_bp_init(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
if (zio->io_child_type == ZIO_CHILD_LOGICAL) {
@@ -1273,8 +1283,10 @@ zio_taskq_member(zio_t *zio, zio_taskq_type_t q)
}
static int
-zio_issue_async(zio_t *zio)
+zio_issue_async(zio_t **ziop)
{
+ zio_t *zio = *ziop;
+
zio_taskq_dispatch(zio, ZIO_TASKQ_ISSUE, B_FALSE);
return (ZIO_PIPELINE_STOP);
@@ -1342,7 +1354,7 @@ zio_execute(zio_t *zio)
}
zio->io_stage = stage;
- rv = zio_pipeline[highbit64(stage) - 1](zio);
+ rv = zio_pipeline[highbit64(stage) - 1](&zio);
if (rv == ZIO_PIPELINE_STOP)
return;
@@ -1776,8 +1788,9 @@ zio_gang_tree_issue(zio_t *pio, zio_gang_node_t *gn, blkptr_t *bp, void *data)
}
static int
-zio_gang_assemble(zio_t *zio)
+zio_gang_assemble(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == NULL);
@@ -1791,8 +1804,9 @@ zio_gang_assemble(zio_t *zio)
}
static int
-zio_gang_issue(zio_t *zio)
+zio_gang_issue(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE))
@@ -1926,8 +1940,9 @@ zio_write_gang_block(zio_t *pio)
* writes) and as a result is mutually exclusive with dedup.
*/
static int
-zio_nop_write(zio_t *zio)
+zio_nop_write(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
blkptr_t *bp_orig = &zio->io_bp_orig;
zio_prop_t *zp = &zio->io_prop;
@@ -1998,8 +2013,9 @@ zio_ddt_child_read_done(zio_t *zio)
}
static int
-zio_ddt_read_start(zio_t *zio)
+zio_ddt_read_start(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
ASSERT(BP_GET_DEDUP(bp));
@@ -2041,8 +2057,9 @@ zio_ddt_read_start(zio_t *zio)
}
static int
-zio_ddt_read_done(zio_t *zio)
+zio_ddt_read_done(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE))
@@ -2210,8 +2227,9 @@ zio_ddt_ditto_write_done(zio_t *zio)
}
static int
-zio_ddt_write(zio_t *zio)
+zio_ddt_write(zio_t **ziop)
{
+ zio_t *zio = *ziop;
spa_t *spa = zio->io_spa;
blkptr_t *bp = zio->io_bp;
uint64_t txg = zio->io_txg;
@@ -2322,8 +2340,9 @@ zio_ddt_write(zio_t *zio)
ddt_entry_t *freedde; /* for debugging */
static int
-zio_ddt_free(zio_t *zio)
+zio_ddt_free(zio_t **ziop)
{
+ zio_t *zio = *ziop;
spa_t *spa = zio->io_spa;
blkptr_t *bp = zio->io_bp;
ddt_t *ddt = ddt_select(spa, bp);
@@ -2348,8 +2367,9 @@ zio_ddt_free(zio_t *zio)
* ==========================================================================
*/
static int
-zio_dva_allocate(zio_t *zio)
+zio_dva_allocate(zio_t **ziop)
{
+ zio_t *zio = *ziop;
spa_t *spa = zio->io_spa;
metaslab_class_t *mc = spa_normal_class(spa);
blkptr_t *bp = zio->io_bp;
@@ -2391,16 +2411,19 @@ zio_dva_allocate(zio_t *zio)
}
static int
-zio_dva_free(zio_t *zio)
+zio_dva_free(zio_t **ziop)
{
+ zio_t *zio = *ziop;
+
metaslab_free(zio->io_spa, zio->io_bp, zio->io_txg, B_FALSE);
return (ZIO_PIPELINE_CONTINUE);
}
static int
-zio_dva_claim(zio_t *zio)
+zio_dva_claim(zio_t **ziop)
{
+ zio_t *zio = *ziop;
int error;
error = metaslab_claim(zio->io_spa, zio->io_bp, zio->io_txg);
@@ -2494,8 +2517,9 @@ zio_free_zil(spa_t *spa, uint64_t txg, blkptr_t *bp)
* ==========================================================================
*/
static int
-zio_vdev_io_start(zio_t *zio)
+zio_vdev_io_start(zio_t **ziop)
{
+ zio_t *zio = *ziop;
vdev_t *vd = zio->io_vd;
uint64_t align;
spa_t *spa = zio->io_spa;
@@ -2513,7 +2537,8 @@ zio_vdev_io_start(zio_t *zio)
return (vdev_mirror_ops.vdev_op_io_start(zio));
}
- if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE) {
+ if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_FREE &&
+ zio->io_priority == ZIO_PRIORITY_NOW) {
trim_map_free(vd, zio->io_offset, zio->io_size, zio->io_txg);
return (ZIO_PIPELINE_CONTINUE);
}
@@ -2581,30 +2606,33 @@ zio_vdev_io_start(zio_t *zio)
return (ZIO_PIPELINE_CONTINUE);
}
- if (vd->vdev_ops->vdev_op_leaf &&
- (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) {
-
- if (zio->io_type == ZIO_TYPE_READ && vdev_cache_read(zio))
- return (ZIO_PIPELINE_CONTINUE);
+ if (vd->vdev_ops->vdev_op_leaf) {
+ switch (zio->io_type) {
+ case ZIO_TYPE_READ:
+ if (vdev_cache_read(zio))
+ return (ZIO_PIPELINE_CONTINUE);
+ /* FALLTHROUGH */
+ case ZIO_TYPE_WRITE:
+ case ZIO_TYPE_FREE:
+ if ((zio = vdev_queue_io(zio)) == NULL)
+ return (ZIO_PIPELINE_STOP);
+ *ziop = zio;
- if ((zio = vdev_queue_io(zio)) == NULL)
- return (ZIO_PIPELINE_STOP);
-
- if (!vdev_accessible(vd, zio)) {
- zio->io_error = SET_ERROR(ENXIO);
- zio_interrupt(zio);
- return (ZIO_PIPELINE_STOP);
+ if (!vdev_accessible(vd, zio)) {
+ zio->io_error = SET_ERROR(ENXIO);
+ zio_interrupt(zio);
+ return (ZIO_PIPELINE_STOP);
+ }
+ break;
}
- }
-
- /*
- * Note that we ignore repair writes for TRIM because they can conflict
- * with normal writes. This isn't an issue because, by definition, we
- * only repair blocks that aren't freed.
- */
- if (vd->vdev_ops->vdev_op_leaf && zio->io_type == ZIO_TYPE_WRITE &&
- !(zio->io_flags & ZIO_FLAG_IO_REPAIR)) {
- if (!trim_map_write_start(zio))
+ /*
+ * Note that we ignore repair writes for TRIM because they can
+ * conflict with normal writes. This isn't an issue because, by
+ * definition, we only repair blocks that aren't freed.
+ */
+ if (zio->io_type == ZIO_TYPE_WRITE &&
+ !(zio->io_flags & ZIO_FLAG_IO_REPAIR) &&
+ !trim_map_write_start(zio))
return (ZIO_PIPELINE_STOP);
}
@@ -2612,8 +2640,9 @@ zio_vdev_io_start(zio_t *zio)
}
static int
-zio_vdev_io_done(zio_t *zio)
+zio_vdev_io_done(zio_t **ziop)
{
+ zio_t *zio = *ziop;
vdev_t *vd = zio->io_vd;
vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops;
boolean_t unexpected_error = B_FALSE;
@@ -2625,7 +2654,8 @@ zio_vdev_io_done(zio_t *zio)
zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE);
if (vd != NULL && vd->vdev_ops->vdev_op_leaf &&
- (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE)) {
+ (zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE ||
+ zio->io_type == ZIO_TYPE_FREE)) {
if (zio->io_type == ZIO_TYPE_WRITE &&
!(zio->io_flags & ZIO_FLAG_IO_REPAIR))
@@ -2644,7 +2674,10 @@ zio_vdev_io_done(zio_t *zio)
zio->io_error = zio_handle_label_injection(zio, EIO);
if (zio->io_error) {
- if (!vdev_accessible(vd, zio)) {
+ if (zio->io_error == ENOTSUP &&
+ zio->io_type == ZIO_TYPE_FREE) {
+ /* Not all devices support TRIM. */
+ } else if (!vdev_accessible(vd, zio)) {
zio->io_error = SET_ERROR(ENXIO);
} else {
unexpected_error = B_TRUE;
@@ -2687,8 +2720,9 @@ zio_vsd_default_cksum_report(zio_t *zio, zio_cksum_report_t *zcr, void *ignored)
}
static int
-zio_vdev_io_assess(zio_t *zio)
+zio_vdev_io_assess(zio_t **ziop)
{
+ zio_t *zio = *ziop;
vdev_t *vd = zio->io_vd;
if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE))
@@ -2705,7 +2739,8 @@ zio_vdev_io_assess(zio_t *zio)
if (zio_injection_enabled && zio->io_error == 0)
zio->io_error = zio_handle_fault_injection(zio, EIO);
- if (zio->io_type == ZIO_TYPE_IOCTL && zio->io_cmd == DKIOCTRIM)
+ if (zio->io_type == ZIO_TYPE_FREE &&
+ zio->io_priority != ZIO_PRIORITY_NOW) {
switch (zio->io_error) {
case 0:
ZIO_TRIM_STAT_INCR(bytes, zio->io_size);
@@ -2718,6 +2753,7 @@ zio_vdev_io_assess(zio_t *zio)
ZIO_TRIM_STAT_BUMP(failed);
break;
}
+ }
/*
* If the I/O failed, determine whether we should attempt to retry it.
@@ -2801,8 +2837,9 @@ zio_vdev_io_bypass(zio_t *zio)
* ==========================================================================
*/
static int
-zio_checksum_generate(zio_t *zio)
+zio_checksum_generate(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
enum zio_checksum checksum;
@@ -2832,8 +2869,9 @@ zio_checksum_generate(zio_t *zio)
}
static int
-zio_checksum_verify(zio_t *zio)
+zio_checksum_verify(zio_t **ziop)
{
+ zio_t *zio = *ziop;
zio_bad_cksum_t info;
blkptr_t *bp = zio->io_bp;
int error;
@@ -2904,8 +2942,9 @@ zio_worst_error(int e1, int e2)
* ==========================================================================
*/
static int
-zio_ready(zio_t *zio)
+zio_ready(zio_t **ziop)
{
+ zio_t *zio = *ziop;
blkptr_t *bp = zio->io_bp;
zio_t *pio, *pio_next;
@@ -2962,8 +3001,9 @@ zio_ready(zio_t *zio)
}
static int
-zio_done(zio_t *zio)
+zio_done(zio_t **ziop)
{
+ zio_t *zio = *ziop;
spa_t *spa = zio->io_spa;
zio_t *lio = zio->io_logical;
blkptr_t *bp = zio->io_bp;
diff --git a/sys/conf/NOTES b/sys/conf/NOTES
index 22a2bb064b01..9d0e51952ad0 100644
--- a/sys/conf/NOTES
+++ b/sys/conf/NOTES
@@ -176,6 +176,7 @@ options GEOM_SHSEC # Shared secret.
options GEOM_STRIPE # Disk striping.
options GEOM_SUNLABEL # Sun/Solaris partitioning
options GEOM_UZIP # Read-only compressed disks
+options GEOM_VINUM # Vinum logical volume manager
options GEOM_VIRSTOR # Virtual storage.
options GEOM_VOL # Volume names from UFS superblock
options GEOM_ZERO # Performance testing helper.
diff --git a/sys/conf/files b/sys/conf/files
index 8c0c2fc61059..d11faa97473e 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -14,7 +14,7 @@ acpi_quirks.h optional acpi \
# from the specified source (DTS) file: <platform>.dts -> <platform>.dtb
#
fdt_dtb_file optional fdt fdt_dtb_static \
- compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}/${FDT_DTS_FILE:R}.dtb" \
+ compile-with "sh $S/tools/fdt/make_dtb.sh $S ${FDT_DTS_FILE} ${.CURDIR}" \
no-obj no-implicit-rule before-depend \
clean "${FDT_DTS_FILE:R}.dtb"
fdt_static_dtb.h optional fdt fdt_dtb_static \
@@ -1804,6 +1804,17 @@ dev/mmc/mmcbr_if.m standard
dev/mmc/mmcbus_if.m standard
dev/mmc/mmcsd.c optional mmcsd
dev/mn/if_mn.c optional mn pci
+dev/mpr/mpr.c optional mpr
+dev/mpr/mpr_config.c optional mpr
+# XXX Work around clang warning, until maintainer approves fix.
+dev/mpr/mpr_mapping.c optional mpr \
+ compile-with "${NORMAL_C} ${NO_WSOMETIMES_UNINITIALIZED}"
+dev/mpr/mpr_pci.c optional mpr pci
+dev/mpr/mpr_sas.c optional mpr \
+ compile-with "${NORMAL_C} ${NO_WUNNEEDED_INTERNAL_DECL}"
+dev/mpr/mpr_sas_lsi.c optional mpr
+dev/mpr/mpr_table.c optional mpr
+dev/mpr/mpr_user.c optional mpr
dev/mps/mps.c optional mps
dev/mps/mps_config.c optional mps
# XXX Work around clang warning, until maintainer approves fix.
@@ -1821,6 +1832,10 @@ dev/mpt/mpt_debug.c optional mpt
dev/mpt/mpt_pci.c optional mpt pci
dev/mpt/mpt_raid.c optional mpt
dev/mpt/mpt_user.c optional mpt
+dev/mrsas/mrsas.c optional mrsas
+dev/mrsas/mrsas_cam.c optional mrsas
+dev/mrsas/mrsas_ioctl.c optional mrsas
+dev/mrsas/mrsas_fp.c optional mrsas
dev/msk/if_msk.c optional msk
dev/mvs/mvs.c optional mvs
dev/mvs/mvs_if.m optional mvs
@@ -2759,6 +2774,21 @@ contrib/xz-embedded/linux/lib/xz/xz_dec_stream.c \
optional xz_embedded | geom_uncompress \
compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/"
geom/uzip/g_uzip.c optional geom_uzip
+geom/vinum/geom_vinum.c optional geom_vinum
+geom/vinum/geom_vinum_create.c optional geom_vinum
+geom/vinum/geom_vinum_drive.c optional geom_vinum
+geom/vinum/geom_vinum_plex.c optional geom_vinum
+geom/vinum/geom_vinum_volume.c optional geom_vinum
+geom/vinum/geom_vinum_subr.c optional geom_vinum
+geom/vinum/geom_vinum_raid5.c optional geom_vinum
+geom/vinum/geom_vinum_share.c optional geom_vinum
+geom/vinum/geom_vinum_list.c optional geom_vinum
+geom/vinum/geom_vinum_rm.c optional geom_vinum
+geom/vinum/geom_vinum_init.c optional geom_vinum
+geom/vinum/geom_vinum_state.c optional geom_vinum
+geom/vinum/geom_vinum_rename.c optional geom_vinum
+geom/vinum/geom_vinum_move.c optional geom_vinum
+geom/vinum/geom_vinum_events.c optional geom_vinum
geom/virstor/binstream.c optional geom_virstor
geom/virstor/g_virstor.c optional geom_virstor
geom/virstor/g_virstor_md.c optional geom_virstor
diff --git a/sys/conf/files.amd64 b/sys/conf/files.amd64
index f78f1c87bf31..e7d33a800f1c 100644
--- a/sys/conf/files.amd64
+++ b/sys/conf/files.amd64
@@ -232,8 +232,6 @@ dev/hyperv/vmbus/hv_hv.c optional hyperv
dev/hyperv/vmbus/hv_ring_buffer.c optional hyperv
dev/hyperv/vmbus/hv_vmbus_drv_freebsd.c optional hyperv
dev/kbd/kbd.c optional atkbd | sc | ukbd | vt
-dev/lindev/full.c optional lindev
-dev/lindev/lindev.c optional lindev
dev/nfe/if_nfe.c optional nfe pci
dev/ntb/if_ntb/if_ntb.c optional if_ntb
dev/ntb/ntb_hw/ntb_hw.c optional if_ntb ntb_hw
diff --git a/sys/conf/files.i386 b/sys/conf/files.i386
index 30c224a44e1f..b07eebdfd2fa 100644
--- a/sys/conf/files.i386
+++ b/sys/conf/files.i386
@@ -240,8 +240,6 @@ dev/ipmi/ipmi_pci.c optional ipmi pci
dev/ipmi/ipmi_linux.c optional ipmi compat_linux
dev/kbd/kbd.c optional atkbd | sc | ukbd | vt
dev/le/if_le_isa.c optional le isa
-dev/lindev/full.c optional lindev
-dev/lindev/lindev.c optional lindev
dev/mse/mse.c optional mse
dev/mse/mse_isa.c optional mse isa
dev/nfe/if_nfe.c optional nfe pci
diff --git a/sys/conf/files.pc98 b/sys/conf/files.pc98
index 92696ee9c08b..fff7b3ce8f49 100644
--- a/sys/conf/files.pc98
+++ b/sys/conf/files.pc98
@@ -110,8 +110,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc
dev/io/iodev.c optional io
dev/kbd/kbd.c optional pckbd | sc | ukbd
dev/le/if_le_cbus.c optional le isa
-dev/lindev/full.c optional lindev
-dev/lindev/lindev.c optional lindev
dev/mse/mse.c optional mse
dev/mse/mse_cbus.c optional mse isa
dev/sbni/if_sbni.c optional sbni
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
index 3ff23c2db92d..1b7c49dbd6dc 100644
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -3,7 +3,7 @@
# Part of a unified Makefile for building kernels. This part contains all
# of the definitions that need to be before %BEFORE_DEPEND.
-.include <bsd.own.mk>
+.include <src.opts.mk>
.include <bsd.compiler.mk>
# backwards compat option for older systems.
diff --git a/sys/conf/kmod.mk b/sys/conf/kmod.mk
index 125ebc1b45c7..100c4705ab0d 100644
--- a/sys/conf/kmod.mk
+++ b/sys/conf/kmod.mk
@@ -72,6 +72,7 @@ OBJCOPY?= objcopy
.error "Do not use KMODDEPS on 5.0+; use MODULE_VERSION/MODULE_DEPEND"
.endif
+.include <src.opts.mk>
.include <bsd.init.mk>
.include <bsd.compiler.mk>
diff --git a/sys/conf/options b/sys/conf/options
index 99596525cd88..fdc3530ab761 100644
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -125,6 +125,7 @@ GEOM_STRIPE opt_geom.h
GEOM_SUNLABEL opt_geom.h
GEOM_UNCOMPRESS opt_geom.h
GEOM_UZIP opt_geom.h
+GEOM_VINUM opt_geom.h
GEOM_VIRSTOR opt_geom.h
GEOM_VOL opt_geom.h
GEOM_ZERO opt_geom.h
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
index 46833ef749f4..9cc99ec701f0 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_attach.c
@@ -4113,6 +4113,8 @@ ar9300_probe(uint16_t vendorid, uint16_t devid)
return "Qualcomm Atheros QCA955x";
case AR9300_DEVID_QCA9565: /* Aphrodite */
return "Qualcomm Atheros AR9565";
+ case AR9300_DEVID_AR1111_PCIE:
+ return "Atheros AR1111";
default:
return AH_NULL;
}
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
index 251957eaae3f..a2cc25d741ea 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
+++ b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_freebsd.c
@@ -60,6 +60,11 @@ ar9300_freebsd_set_tx_power_limit(struct ath_hal *ah, uint32_t limit)
return (ar9300_set_tx_power_limit(ah, limit, 0, 0));
}
+static uint64_t
+ar9300_get_next_tbtt(struct ath_hal *ah)
+{
+ return (OS_REG_READ(ah, AR_NEXT_TBTT_TIMER));
+}
void
ar9300_attach_freebsd_ops(struct ath_hal *ah)
@@ -195,6 +200,7 @@ ar9300_attach_freebsd_ops(struct ath_hal *ah)
ah->ah_setStationBeaconTimers = ar9300_set_sta_beacon_timers;
/* ah_resetStationBeaconTimers */
/* ah_getNextTBTT */
+ ah->ah_getNextTBTT = ar9300_get_next_tbtt;
/* Interrupt functions */
ah->ah_isInterruptPending = ar9300_is_interrupt_pending;
diff --git a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c b/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c
index 629c40f9b8b1..b842993c23f9 100644
--- a/sys/contrib/dev/ath/ath_hal/ar9300/ar9300_power.c
+++ b/