diff options
author | dim <dim@FreeBSD.org> | 2015-01-26 21:41:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-01-26 21:41:54 +0000 |
commit | a53e4d44d0463dae21283fdb3ca61a1e38df799f (patch) | |
tree | 6f5baa0292e962bb69dc0020ada66d60ea578642 | |
parent | c9e57e45aceb65bdac0c758538375582075c8a97 (diff) | |
parent | 191df99881cad772b533cb8ad72897ab307efdb9 (diff) | |
download | FreeBSD-src-a53e4d44d0463dae21283fdb3ca61a1e38df799f.zip FreeBSD-src-a53e4d44d0463dae21283fdb3ca61a1e38df799f.tar.gz |
Merge ^/head r277719 through 277776.
41 files changed, 629 insertions, 133 deletions
diff --git a/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp b/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp index d734d43..99ebcf3 100644 --- a/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp +++ b/contrib/llvm/lib/Target/AArch64/AArch64RegisterInfo.cpp @@ -33,6 +33,10 @@ using namespace llvm; #define GET_REGINFO_TARGET_DESC #include "AArch64GenRegisterInfo.inc" +static cl::opt<bool> +ReserveX18("aarch64-reserve-x18", cl::Hidden, + cl::desc("Reserve X18, making it unavailable as GPR")); + AArch64RegisterInfo::AArch64RegisterInfo(const AArch64InstrInfo *tii, const AArch64Subtarget *sti) : AArch64GenRegisterInfo(AArch64::LR), TII(tii), STI(sti) {} @@ -90,7 +94,7 @@ AArch64RegisterInfo::getReservedRegs(const MachineFunction &MF) const { Reserved.set(AArch64::W29); } - if (STI->isTargetDarwin()) { + if (STI->isTargetDarwin() || ReserveX18) { Reserved.set(AArch64::X18); // Platform register Reserved.set(AArch64::W18); } @@ -117,7 +121,7 @@ bool AArch64RegisterInfo::isReservedReg(const MachineFunction &MF, return true; case AArch64::X18: case AArch64::W18: - return STI->isTargetDarwin(); + return STI->isTargetDarwin() || ReserveX18; case AArch64::FP: case AArch64::W29: return TFI->hasFP(MF) || STI->isTargetDarwin(); @@ -379,7 +383,7 @@ unsigned AArch64RegisterInfo::getRegPressureLimit(const TargetRegisterClass *RC, case AArch64::GPR64commonRegClassID: return 32 - 1 // XZR/SP - (TFI->hasFP(MF) || STI->isTargetDarwin()) // FP - - STI->isTargetDarwin() // X18 reserved as platform register + - (STI->isTargetDarwin() || ReserveX18) // X18 reserved as platform register - hasBasePointer(MF); // X19 case AArch64::FPR8RegClassID: case AArch64::FPR16RegClassID: diff --git a/contrib/llvm/patches/patch-06-llvm-r226664-aarch64-x18.diff b/contrib/llvm/patches/patch-06-llvm-r226664-aarch64-x18.diff new file mode 100644 index 0000000..887d3aa --- /dev/null +++ b/contrib/llvm/patches/patch-06-llvm-r226664-aarch64-x18.diff @@ -0,0 +1,83 @@ +Pull in r226664 from upstream llvm trunk (by Tim Northover): + + AArch64: add backend option to reserve x18 (platform register) + + AAPCS64 says that it's up to the platform to specify whether x18 is + reserved, and a first step on that way is to add a flag controlling + it. + + From: Andrew Turner <andrew@fubar.geek.nz> + +Introduced here: http://svnweb.freebsd.org/changeset/base/277774 + +Index: lib/Target/AArch64/AArch64RegisterInfo.cpp +=================================================================== +--- lib/Target/AArch64/AArch64RegisterInfo.cpp ++++ lib/Target/AArch64/AArch64RegisterInfo.cpp +@@ -33,6 +33,10 @@ using namespace llvm; + #define GET_REGINFO_TARGET_DESC + #include "AArch64GenRegisterInfo.inc" + ++static cl::opt<bool> ++ReserveX18("aarch64-reserve-x18", cl::Hidden, ++ cl::desc("Reserve X18, making it unavailable as GPR")); ++ + AArch64RegisterInfo::AArch64RegisterInfo(const AArch64InstrInfo *tii, + const AArch64Subtarget *sti) + : AArch64GenRegisterInfo(AArch64::LR), TII(tii), STI(sti) {} +@@ -90,7 +94,7 @@ AArch64RegisterInfo::getReservedRegs(const Machine + Reserved.set(AArch64::W29); + } + +- if (STI->isTargetDarwin()) { ++ if (STI->isTargetDarwin() || ReserveX18) { + Reserved.set(AArch64::X18); // Platform register + Reserved.set(AArch64::W18); + } +@@ -117,7 +121,7 @@ bool AArch64RegisterInfo::isReservedReg(const Mach + return true; + case AArch64::X18: + case AArch64::W18: +- return STI->isTargetDarwin(); ++ return STI->isTargetDarwin() || ReserveX18; + case AArch64::FP: + case AArch64::W29: + return TFI->hasFP(MF) || STI->isTargetDarwin(); +@@ -379,7 +383,7 @@ unsigned AArch64RegisterInfo::getRegPressureLimit( + case AArch64::GPR64commonRegClassID: + return 32 - 1 // XZR/SP + - (TFI->hasFP(MF) || STI->isTargetDarwin()) // FP +- - STI->isTargetDarwin() // X18 reserved as platform register ++ - (STI->isTargetDarwin() || ReserveX18) // X18 reserved as platform register + - hasBasePointer(MF); // X19 + case AArch64::FPR8RegClassID: + case AArch64::FPR16RegClassID: +Index: test/CodeGen/AArch64/arm64-platform-reg.ll +=================================================================== +--- test/CodeGen/AArch64/arm64-platform-reg.ll ++++ test/CodeGen/AArch64/arm64-platform-reg.ll +@@ -1,4 +1,5 @@ +-; RUN: llc -mtriple=arm64-apple-ios -o - %s | FileCheck %s --check-prefix=CHECK-DARWIN ++; RUN: llc -mtriple=arm64-apple-ios -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE-X18 ++; RUN: llc -mtriple=arm64-freebsd-gnu -aarch64-reserve-x18 -o - %s | FileCheck %s --check-prefix=CHECK-RESERVE-X18 + ; RUN: llc -mtriple=arm64-linux-gnu -o - %s | FileCheck %s + + ; x18 is reserved as a platform register on Darwin but not on other +@@ -16,11 +17,11 @@ define void @keep_live() { + ; CHECK: ldr x18 + ; CHECK: str x18 + +-; CHECK-DARWIN-NOT: ldr fp +-; CHECK-DARWIN-NOT: ldr x18 +-; CHECK-DARWIN: Spill +-; CHECK-DARWIN-NOT: ldr fp +-; CHECK-DARWIN-NOT: ldr x18 +-; CHECK-DARWIN: ret ++; CHECK-RESERVE-X18-NOT: ldr fp ++; CHECK-RESERVE-X18-NOT: ldr x18 ++; CHECK-RESERVE-X18: Spill ++; CHECK-RESERVE-X18-NOT: ldr fp ++; CHECK-RESERVE-X18-NOT: ldr x18 ++; CHECK-RESERVE-X18: ret + ret void + } diff --git a/contrib/llvm/patches/patch-07-clang-r227062-fixes-x18.diff b/contrib/llvm/patches/patch-07-clang-r227062-fixes-x18.diff new file mode 100644 index 0000000..9316f5d --- /dev/null +++ b/contrib/llvm/patches/patch-07-clang-r227062-fixes-x18.diff @@ -0,0 +1,53 @@ +Pull in r227062 from upstream clang trunk (by Renato Golin): + + Allows Clang to use LLVM's fixes-x18 option + + This patch allows clang to have llvm reserve the x18 + platform register on AArch64. FreeBSD will use this in the kernel for + per-cpu data but has no need to reserve this register in userland so + will need this flag to reserve it. + + This uses llvm r226664 to allow this register to be reserved. + + Patch by Andrew Turner. + +Introduced here: http://svnweb.freebsd.org/changeset/base/277775 + +Index: tools/clang/include/clang/Driver/Options.td +=================================================================== +--- tools/clang/include/clang/Driver/Options.td ++++ tools/clang/include/clang/Driver/Options.td +@@ -1209,6 +1209,8 @@ def mfix_cortex_a53_835769 : Flag<["-"], "mfix-cor + def mno_fix_cortex_a53_835769 : Flag<["-"], "mno-fix-cortex-a53-835769">, + Group<m_aarch64_Features_Group>, + HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">; ++def ffixed_x18 : Flag<["-"], "ffixed-x18">, Group<m_aarch64_Features_Group>, ++ HelpText<"Reserve the x18 register (AArch64 only)">; + + def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>; + def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>; +Index: tools/clang/lib/Driver/Tools.cpp +=================================================================== +--- tools/clang/lib/Driver/Tools.cpp ++++ tools/clang/lib/Driver/Tools.cpp +@@ -958,6 +958,11 @@ void Clang::AddAArch64TargetArgs(const ArgList &Ar + if (A->getOption().matches(options::OPT_mno_global_merge)) + CmdArgs.push_back("-mno-global-merge"); + } ++ ++ if (Args.hasArg(options::OPT_ffixed_x18)) { ++ CmdArgs.push_back("-backend-option"); ++ CmdArgs.push_back("-aarch64-reserve-x18"); ++ } + } + + // Get CPU and ABI names. They are not independent +Index: tools/clang/test/Driver/aarch64-fixed-x18.c +=================================================================== +--- tools/clang/test/Driver/aarch64-fixed-x18.c ++++ tools/clang/test/Driver/aarch64-fixed-x18.c +@@ -0,0 +1,4 @@ ++// RUN: %clang -target aarch64-none-gnu -ffixed-x18 -### %s 2> %t ++// RUN: FileCheck --check-prefix=CHECK-FIXED-X18 < %t %s ++ ++// CHECK-FIXED-X18: "-backend-option" "-aarch64-reserve-x18" diff --git a/contrib/llvm/tools/clang/include/clang/Driver/Options.td b/contrib/llvm/tools/clang/include/clang/Driver/Options.td index 4daddba..b68a46b 100644 --- a/contrib/llvm/tools/clang/include/clang/Driver/Options.td +++ b/contrib/llvm/tools/clang/include/clang/Driver/Options.td @@ -1209,6 +1209,8 @@ def mfix_cortex_a53_835769 : Flag<["-"], "mfix-cortex-a53-835769">, def mno_fix_cortex_a53_835769 : Flag<["-"], "mno-fix-cortex-a53-835769">, Group<m_aarch64_Features_Group>, HelpText<"Don't workaround Cortex-A53 erratum 835769 (AArch64 only)">; +def ffixed_x18 : Flag<["-"], "ffixed-x18">, Group<m_aarch64_Features_Group>, + HelpText<"Reserve the x18 register (AArch64 only)">; def mvsx : Flag<["-"], "mvsx">, Group<m_ppc_Features_Group>; def mno_vsx : Flag<["-"], "mno-vsx">, Group<m_ppc_Features_Group>; diff --git a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp index 86c6ac1..daa581e 100644 --- a/contrib/llvm/tools/clang/lib/Driver/Tools.cpp +++ b/contrib/llvm/tools/clang/lib/Driver/Tools.cpp @@ -958,6 +958,11 @@ void Clang::AddAArch64TargetArgs(const ArgList &Args, if (A->getOption().matches(options::OPT_mno_global_merge)) CmdArgs.push_back("-mno-global-merge"); } + + if (Args.hasArg(options::OPT_ffixed_x18)) { + CmdArgs.push_back("-backend-option"); + CmdArgs.push_back("-aarch64-reserve-x18"); + } } // Get CPU and ABI names. They are not independent diff --git a/etc/Makefile b/etc/Makefile index 62b837f..b27542a 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -14,8 +14,7 @@ SUBDIR+=sendmail SUBDIR+=tests .endif -BIN1= auto_master \ - crontab \ +BIN1= crontab \ devd.conf \ devfs.conf \ ddb.conf \ @@ -90,6 +89,10 @@ BIN1+= amd.map BIN1+= apmd.conf .endif +.if ${MK_AUTOFS} != "no" +BIN1+= auto_master +.endif + .if ${MK_BSNMP} != "no" BIN1+= snmpd.config .endif @@ -229,7 +232,9 @@ distribution: echo "./etc/spwd.db type=file mode=0600 uname=root gname=wheel"; \ ) | ${METALOG.add} .endif +.if ${MK_AUTOFS} != "no" ${_+_}cd ${.CURDIR}/autofs; ${MAKE} install +.endif .if ${MK_BLUETOOTH} != "no" ${_+_}cd ${.CURDIR}/bluetooth; ${MAKE} install .endif diff --git a/etc/defaults/Makefile b/etc/defaults/Makefile index c6555e6..1f6ac5e 100644 --- a/etc/defaults/Makefile +++ b/etc/defaults/Makefile @@ -1,7 +1,13 @@ # $FreeBSD$ -FILES= bluetooth.device.conf devfs.rules periodic.conf rc.conf +.include <src.opts.mk> + +FILES= devfs.rules periodic.conf rc.conf NO_OBJ= FILESDIR= /etc/defaults +.if ${MK_BLUETOOTH} != "no" +FILES+= bluetooth.device.conf +.endif + .include <bsd.prog.mk> diff --git a/etc/devd/Makefile b/etc/devd/Makefile index 27dfb92..a0909af 100644 --- a/etc/devd/Makefile +++ b/etc/devd/Makefile @@ -2,12 +2,16 @@ .include <src.opts.mk> +FILES= + .if ${MACHINE} == "powerpc" FILES+= apple.conf .endif .if ${MACHINE} == "amd64" || ${MACHINE} == "i386" +.if ${MK_ACPI} != "no" FILES+= asus.conf +.endif .if ${MK_HYPERV} != "no" FILES+= hyperv.conf .endif diff --git a/etc/pam.d/Makefile b/etc/pam.d/Makefile index 7369022..ac7db6c 100644 --- a/etc/pam.d/Makefile +++ b/etc/pam.d/Makefile @@ -1,9 +1,10 @@ # $FreeBSD$ +.include <src.opts.mk> + NO_OBJ= FILES= README \ - atrun \ cron \ ftpd \ imap \ @@ -15,6 +16,10 @@ FILES= README \ telnetd \ xdm +.if ${MK_AT} != "no" +FILES+= atrun +.endif + FILESDIR= /etc/pam.d FILESMODE= 644 FILESMODE_README= 444 diff --git a/etc/rc.d/Makefile b/etc/rc.d/Makefile index 3cd0711..a19f73a 100644 --- a/etc/rc.d/Makefile +++ b/etc/rc.d/Makefile @@ -11,18 +11,12 @@ FILES= DAEMON \ accounting \ addswap \ adjkerntz \ - amd \ - apm \ - apmd \ archdep \ atm1 \ atm2 \ atm3 \ auditd \ auditdistd \ - automount \ - automountd \ - autounmountd \ bgfsck \ ${_bluetooth} \ bootparams \ @@ -48,7 +42,6 @@ FILES= DAEMON \ gptboot \ growfs \ gssd \ - hastd \ ${_hcsecd} \ hostapd \ hostid \ @@ -61,10 +54,7 @@ FILES= DAEMON \ ipfw \ ipmon \ ipnat \ - ipropd_master \ - ipropd_slave \ ipsec \ - jail \ ${_kadmind} \ ${_kdc} \ ${_kfd} \ @@ -75,7 +65,6 @@ FILES= DAEMON \ local \ localpkg \ lockd \ - lpd \ mixer \ motd \ mountcritlocal \ @@ -107,7 +96,6 @@ FILES= DAEMON \ pflog \ pfsync \ powerd \ - power_profile \ ppp \ pppoed \ pwcheck \ @@ -159,6 +147,29 @@ FILES= DAEMON \ zfs \ zvol +.if ${MK_ACCT} != "no" +FILES+= accounting +.endif + +.if ${MK_ACPI} != "no" +FILES+= power_profile +.endif + +.if ${MK_AMD} != "no" +FILES+= amd +.endif + +.if ${MK_APM} != "no" +FILES+= apm +FILES+= apmd +.endif + +.if ${MK_AUTOFS} != "no" +FILES+= automount +FILES+= automountd +FILES+= autounmountd +.endif + .if ${MK_BLUETOOTH} != "no" _bluetooth= bluetooth _bthidd= bthidd @@ -178,16 +189,30 @@ _casperd= casperd FILES+= ccd .endif +.if ${MK_HAST} != "no" +FILES+= hastd +.endif + .if ${MK_ISCSI} != "no" FILES+= iscsictl FILES+= iscsid .endif +.if ${MK_JAIL} != "no" +FILES+= jail +.endif + +.if ${MK_LPR} != "no" +FILES+= lpd +.endif + .if ${MK_NS_CACHING} != "no" _nscd= nscd .endif .if ${MK_KERBEROS} != "no" +FILES+= ipropd_master +FILES+= ipropd_slave _kadmind= kadmind _kdc= kdc _kfd= kfd @@ -222,6 +247,11 @@ _unbound= local_unbound _utx= utx .endif +.if ${MK_WIRELESS} != "no" +FILES+= hostapd +FILES+= wpa_supplicant +.endif + FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} diff --git a/lib/Makefile b/lib/Makefile index 83d9d63..90e217e 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -258,8 +258,10 @@ _librtld_db= librtld_db .endif .if ${MACHINE_CPUARCH} == "amd64" +.if ${MK_BHYVE} != "no" _libvmmapi= libvmmapi .endif +.endif .if ${MACHINE_CPUARCH} == "mips" _libproc= libproc diff --git a/sbin/Makefile b/sbin/Makefile index 1c34e0c..6825cb6 100644 --- a/sbin/Makefile +++ b/sbin/Makefile @@ -30,8 +30,6 @@ SUBDIR=adjkerntz \ ggate \ growfs \ gvinum \ - hastctl \ - hastd \ ifconfig \ init \ kldconfig \ @@ -88,6 +86,11 @@ SUBDIR+= ccdconfig SUBDIR+= devd .endif +.if ${MK_HAST} != "no" +SUBDIR+= hastctl +SUBDIR+= hastd +.endif + .if ${MK_IPFILTER} != "no" SUBDIR+= ipf .endif @@ -97,6 +100,10 @@ SUBDIR+= ipfw SUBDIR+= natd .endif +.if ${MK_ISCSI} != "no" +SUBDIR+= iscontrol +.endif + .if ${MK_NAND} != "no" SUBDIR+= nandfs SUBDIR+= newfs_nandfs diff --git a/share/examples/Makefile b/share/examples/Makefile index 79de48e..7e0576c 100644 --- a/share/examples/Makefile +++ b/share/examples/Makefile @@ -7,14 +7,12 @@ LDIRS= BSD_daemon \ FreeBSD_version \ IPv6 \ - bhyve \ bootforth \ csh \ diskless \ drivers \ etc \ find_interface \ - hast \ ibcs2 \ indent \ ipfw \ @@ -42,7 +40,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ FreeBSD_version/Makefile \ FreeBSD_version/README \ IPv6/USAGE \ - bhyve/vmrun.sh \ bootforth/README \ bootforth/boot.4th \ bootforth/frames.4th \ @@ -64,11 +61,6 @@ XFILES= BSD_daemon/FreeBSD.pfa \ find_interface/Makefile \ find_interface/README \ find_interface/find_interface.c \ - hast/ucarp.sh \ - hast/ucarp_down.sh \ - hast/ucarp_up.sh \ - hast/vip-down.sh \ - hast/vip-up.sh \ ibcs2/README \ ibcs2/hello.uu \ indent/indent.pro \ @@ -202,6 +194,22 @@ BINDIR= ${SHAREDIR}/examples NO_OBJ= +.if ${MK_HAST} != "no" +LDIRS+= hast +XFILES+= hast/ucarp.sh \ + hast/ucarp_down.sh \ + hast/ucarp_up.sh \ + hast/vip-down.sh \ + hast/vip-up.sh +.endif + +.if ${MACHINE_CPUARCH} == "amd64" +.if ${MK_BHYVE} != "no" +LDIRS+= bhyve +XFILES+= bhyve/vmrun.sh +.endif +.endif + # Define SHARED to indicate whether you want symbolic links to the system # source (``symlinks''), or a separate copy (``copies''); (latter useful # in environments where it's not possible to keep /sys publicly readable) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 8bfd875..afdd16e 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -835,7 +835,6 @@ _xnb.4= xnb.4 .endif .if ${MACHINE_CPUARCH} == "amd64" -_bhyve.4= bhyve.4 _if_ntb.4= if_ntb.4 _ntb.4= ntb.4 _ntb_hw.4= ntb_hw.4 @@ -848,6 +847,10 @@ MLINKS+=qlxge.4 if_qlxge.4 MLINKS+=qlxgb.4 if_qlxgb.4 MLINKS+=qlxgbe.4 if_qlxgbe.4 MLINKS+=sfxge.4 if_sfxge.4 + +.if ${MK_BHYVE} != "no" +_bhyve.4= bhyve.4 +.endif .endif .if ${MACHINE_CPUARCH} == "mips" diff --git a/share/man/man5/Makefile b/share/man/man5/Makefile index e848335..15056f3 100644 --- a/share/man/man5/Makefile +++ b/share/man/man5/Makefile @@ -7,7 +7,6 @@ MAN= acct.5 \ ar.5 \ a.out.5 \ - autofs.5 \ bluetooth.device.conf.5 \ bluetooth.hosts.5 \ bluetooth.protocols.5 \ @@ -80,6 +79,10 @@ MLINKS+=quota.user.5 quota.group.5 MLINKS+=rc.conf.5 rc.conf.local.5 MLINKS+=resolver.5 resolv.conf.5 +.if ${MK_AUTOFS} != "no" +MAN+= autofs.5 +.endif + .if ${MK_FREEBSD_UPDATE} != "no" MAN+= freebsd-update.conf.5 .endif diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 index ed806a4..4795fe1 100644 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 255964 2013-10-01 07:22:04Z des .\" $FreeBSD$ -.Dd January 24, 2015 +.Dd January 25, 2015 .Dt SRC.CONF 5 .Os .Sh NAME @@ -121,6 +121,18 @@ Set to not build audit support into system programs. .\" from FreeBSD: head/tools/build/options/WITHOUT_AUTHPF 156932 2006-03-21 07:50:50Z ru Set to not build .Xr authpf 8 . +.It Va WITHOUT_AUTOFS +.\" from FreeBSD: head/tools/build/options/WITHOUT_AUTOFS 277728 2015-01-26 07:15:49Z ngie +Set to not build +.Xr autofs 4 +related programs, libraries, and kernel modules. +.It Va WITHOUT_BHYVE +.\" from FreeBSD: head/tools/build/options/WITHOUT_BHYVE 277727 2015-01-26 06:44:48Z ngie +Set to not build or install +.Xr bhyve 8 , +associated utilities, and examples. +.Pp +This option only affects amd64/amd64. .It Va WITHOUT_BINUTILS .\" from FreeBSD: head/tools/build/options/WITHOUT_BINUTILS 266158 2014-05-15 16:51:45Z brooks Set to not build or install binutils (as, c++-filt, gconv, @@ -543,6 +555,11 @@ You should consider installing the textproc/groff port to not break .It Va WITHOUT_GSSAPI .\" from FreeBSD: head/tools/build/options/WITHOUT_GSSAPI 174548 2007-12-12 16:39:32Z ru Set to not build libgssapi. +.It Va WITHOUT_HAST +.\" from FreeBSD: head/tools/build/options/WITHOUT_HAST 277725 2015-01-26 06:27:07Z ngie +Set to not build +.Xr hastd 8 +and related utilities. .It Va WITH_HESIOD .\" from FreeBSD: head/tools/build/options/WITH_HESIOD 156932 2006-03-21 07:50:50Z ru Set to build Hesiod support. diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk index 8082b14..0609a9e 100644 --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -52,6 +52,8 @@ __DEFAULT_YES_OPTIONS = \ ATM \ AUDIT \ AUTHPF \ + AUTOFS \ + BHYVE \ BINUTILS \ BINUTILS_BOOTSTRAP \ BLUETOOTH \ @@ -92,6 +94,7 @@ __DEFAULT_YES_OPTIONS = \ GPIO \ GPL_DTC \ GROFF \ + HAST \ HTML \ HYPERV \ ICONV \ diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 07378fdd..839da01 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -1355,8 +1355,10 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, /* * Find insertion point while checking for overlap. Start off by * assuming the new entry will be added to the end. + * + * NB: physmap_idx points to the next free slot. */ - insert_idx = physmap_idx + 2; + insert_idx = physmap_idx; for (i = 0; i <= physmap_idx; i += 2) { if (base < physmap[i + 1]) { if (base + length <= physmap[i]) { @@ -1394,7 +1396,7 @@ add_physmap_entry(uint64_t base, uint64_t length, vm_paddr_t *physmap, * Move the last 'N' entries down to make room for the new * entry if needed. */ - for (i = physmap_idx; i > insert_idx; i -= 2) { + for (i = (physmap_idx - 2); i > insert_idx; i -= 2) { physmap[i] = physmap[i - 2]; physmap[i + 1] = physmap[i - 1]; } @@ -1580,23 +1582,27 @@ getmemsize(caddr_t kmdp, u_int64_t first) int page_counter; bzero(physmap, sizeof(physmap)); - basemem = 0; physmap_idx = 0; init_ops.parse_memmap(kmdp, physmap, &physmap_idx); + physmap_idx -= 2; /* * Find the 'base memory' segment for SMP */ basemem = 0; for (i = 0; i <= physmap_idx; i += 2) { - if (physmap[i] == 0x00000000) { + if (physmap[i] <= 0xA0000) { basemem = physmap[i + 1] / 1024; break; } } - if (basemem == 0) - panic("BIOS smap did not include a basemem segment!"); + if (basemem == 0 || basemem > 640) { + if (bootverbose) + printf( + "Memory map doesn't contain a basemem segment, faking it"); + basemem = 640; + } /* * Make hole for "AP -> long mode" bootstrap code. The @@ -1604,8 +1610,12 @@ getmemsize(caddr_t kmdp, u_int64_t first) * is configured to support APs and APs for the system start * in 32bit mode (e.g. SMP bare metal). */ - if (init_ops.mp_bootaddress) + if (init_ops.mp_bootaddress) { + if (physmap[1] >= 0x100000000) + panic( + "Basemem segment is not suitable for AP bootstrap code!"); physmap[1] = init_ops.mp_bootaddress(physmap[1] / 1024); + } /* * Maxmem isn't the "maximum memory", it's one larger than the @@ -1657,12 +1667,14 @@ getmemsize(caddr_t kmdp, u_int64_t first) */ physmem_start = (vm_guest > VM_GUEST_NO ? 1 : 16) << PAGE_SHIFT; TUNABLE_ULONG_FETCH("hw.physmem.start", &physmem_start); - if (physmem_start < PAGE_SIZE) - physmap[0] = PAGE_SIZE; - else if (physmem_start >= physmap[1]) - physmap[0] = round_page(physmap[1] - PAGE_SIZE); - else - physmap[0] = round_page(physmem_start); + if (physmap[0] < physmem_start) { + if (physmem_start < PAGE_SIZE) + physmap[0] = PAGE_SIZE; + else if (physmem_start >= physmap[1]) + physmap[0] = round_page(physmap[1] - PAGE_SIZE); + else + physmap[0] = round_page(physmem_start); + } pa_indx = 0; da_indx = 1; phys_avail[pa_indx++] = physmap[0]; diff --git a/sys/arm/arm/mem.c b/sys/arm/arm/mem.c index 30d4b1d..58b0d25 100644 --- a/sys/arm/arm/mem.c +++ b/sys/arm/arm/mem.c @@ -55,6 +55,7 @@ __FBSDID("$FreeBSD$"); #include <sys/mutex.h> #include <sys/proc.h> #include <sys/signalvar.h> +#include <sys/sx.h> #include <sys/systm.h> #include <sys/uio.h> @@ -72,6 +73,9 @@ MALLOC_DEFINE(M_MEMDESC, "memdesc", "memory range descriptors"); struct mem_range_softc mem_range_softc; +static struct sx tmppt_lock; +SX_SYSINIT(tmppt, &tmppt_lock, "mem4map"); + /* ARGSUSED */ int memrw(struct cdev *dev, struct uio *uio, int flags) @@ -107,6 +111,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags) } if (!address_valid) return (EINVAL); + sx_xlock(&tmppt_lock); pmap_kenter((vm_offset_t)_tmppt, v); o = (int)uio->uio_offset & PAGE_MASK; c = (u_int)(PAGE_SIZE - ((int)iov->iov_base & PAGE_MASK)); @@ -114,6 +119,7 @@ memrw(struct cdev *dev, struct uio *uio, int flags) c = min(c, (u_int)iov->iov_len); error = uiomove((caddr_t)&_tmppt[o], (int)c, uio); pmap_qremove((vm_offset_t)_tmppt, 1); + sx_xunlock(&tmppt_lock); continue; } else if (dev2unit(dev) == CDEV_MINOR_KMEM) { diff --git a/sys/arm/arm/pmu.c b/sys/arm/arm/pmu.c new file mode 100644 index 0000000..168c8b4 --- /dev/null +++ b/sys/arm/arm/pmu.c @@ -0,0 +1,157 @@ +/*- + * Copyright (c) 2015 Ruslan Bukin <br@bsdpad.com> + * All rights reserved. + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract (FA8750-10-C-0237) + * ("CTSRD"), as part of the DARPA CRASH research programme. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must 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. + */ + +/* + * Performance Monitoring Unit + */ + +#include <sys/cdefs.h> +__FBSDID("$FreeBSD$"); + +#include "opt_hwpmc_hooks.h" + +#include <sys/param.h> +#include <sys/systm.h> +#include <sys/bus.h> +#include <sys/kernel.h> +#include <sys/module.h> +#include <sys/malloc.h> +#include <sys/rman.h> +#include <sys/timeet.h> +#include <sys/timetc.h> +#include <sys/pmc.h> +#include <sys/pmckern.h> + +#include <dev/fdt/fdt_common.h> +#include <dev/ofw/openfirm.h> +#include <dev/ofw/ofw_bus.h> +#include <dev/ofw/ofw_bus_subr.h> + +#include <machine/bus.h> +#include <machine/fdt.h> +#include <machine/cpu.h> +#include <machine/intr.h> + +struct pmu_softc { + struct resource *res[1]; + device_t dev; + void *ih; +}; + +static struct ofw_compat_data compat_data[] = { + {"arm,cortex-a17-pmu", 1}, + {"arm,cortex-a15-pmu", 1}, + {"arm,cortex-a12-pmu", 1}, + {"arm,cortex-a9-pmu", 1}, + {"arm,cortex-a8-pmu", 1}, + {"arm,cortex-a7-pmu", 1}, + {"arm,cortex-a5-pmu", 1}, + {"arm,arm11mpcore-pmu", 1}, + {"arm,arm1176-pmu", 1}, + {"arm,arm1136-pmu", 1}, + {"qcom,krait-pmu", 1}, + {NULL, 0} +}; + +static struct resource_spec pmu_spec[] = { + { SYS_RES_IRQ, 0, RF_ACTIVE }, + { -1, 0 } +}; + +static int +pmu_intr(void *arg) +{ + struct trapframe *tf; + + tf = arg; + +#ifdef HWPMC_HOOKS + if (pmc_intr) + (*pmc_intr)(PCPU_GET(cpuid), tf); +#endif + + return (FILTER_HANDLED); +} + +static int +pmu_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Performance Monitoring Unit"); + return (BUS_PROBE_DEFAULT); + } + + return (ENXIO); +} + +static int +pmu_attach(device_t dev) +{ + struct pmu_softc *sc; + int err; + + sc = device_get_softc(dev); + sc->dev = dev; + + if (bus_alloc_resources(dev, pmu_spec, sc->res)) { + device_printf(dev, "could not allocate resources\n"); + return (ENXIO); + } + + /* Setup interrupt handler */ + err = bus_setup_intr(dev, sc->res[0], INTR_MPSAFE | INTR_TYPE_MISC, + pmu_intr, NULL, NULL, &sc->ih); + if (err) { + device_printf(dev, "Unable to setup interrupt handler.\n"); + return (ENXIO); + } + + return (0); +} + +static device_method_t pmu_methods[] = { + DEVMETHOD(device_probe, pmu_probe), + DEVMETHOD(device_attach, pmu_attach), + { 0, 0 } +}; + +static driver_t pmu_driver = { + "pmu", + pmu_methods, + sizeof(struct pmu_softc), +}; + +static devclass_t pmu_devclass; + +DRIVER_MODULE(pmu, simplebus, pmu_driver, pmu_devclass, 0, 0); diff --git a/sys/arm/ti/ti_i2c.c b/sys/arm/ti/ti_i2c.c index 0da338e..ad688f3 100644 --- a/sys/arm/ti/ti_i2c.c +++ b/sys/arm/ti/ti_i2c.c @@ -95,6 +95,7 @@ struct ti_i2c_softc int sc_buffer_pos; int sc_error; int sc_fifo_trsh; + int sc_timeout; uint16_t sc_con_reg; uint16_t sc_rev; @@ -442,7 +443,7 @@ ti_i2c_transfer(device_t dev, struct iic_msg *msgs, uint32_t nmsgs) ti_i2c_write_2(sc, I2C_REG_CON, reg); /* Wait for an event. */ - err = mtx_sleep(sc, &sc->sc_mtx, 0, "i2ciowait", hz); + err = mtx_sleep(sc, &sc->sc_mtx, 0, "i2ciowait", sc->sc_timeout); if (err == 0) err = sc->sc_error; @@ -761,12 +762,10 @@ ti_i2c_deactivate(device_t dev) static int ti_i2c_sysctl_clk(SYSCTL_HANDLER_ARGS) { - device_t dev; int clk, psc, sclh, scll; struct ti_i2c_softc *sc; - dev = (device_t)arg1; - sc = device_get_softc(dev); + sc = arg1; TI_I2C_LOCK(sc); /* Get the system prescaler value. */ @@ -783,6 +782,34 @@ ti_i2c_sysctl_clk(SYSCTL_HANDLER_ARGS) } static int +ti_i2c_sysctl_timeout(SYSCTL_HANDLER_ARGS) +{ + struct ti_i2c_softc *sc; + unsigned int val; + int err; + + sc = arg1; + + /* + * MTX_DEF lock can't be held while doing uimove in + * sysctl_handle_int + */ + TI_I2C_LOCK(sc); + val = sc->sc_timeout; + TI_I2C_UNLOCK(sc); + + err = sysctl_handle_int(oidp, &val, 0, req); + /* Write request? */ + if ((err == 0) && (req->newptr != NULL)) { + TI_I2C_LOCK(sc); + sc->sc_timeout = val; + TI_I2C_UNLOCK(sc); + } + + return (err); +} + +static int ti_i2c_probe(device_t dev) { @@ -858,12 +885,19 @@ ti_i2c_attach(device_t dev) /* Set the FIFO threshold to 5 for now. */ sc->sc_fifo_trsh = 5; + /* Set I2C bus timeout */ + sc->sc_timeout = 5*hz; + ctx = device_get_sysctl_ctx(dev); tree = SYSCTL_CHILDREN(device_get_sysctl_tree(dev)); SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "i2c_clock", - CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_MPSAFE, dev, 0, + CTLFLAG_RD | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0, ti_i2c_sysctl_clk, "IU", "I2C bus clock"); + SYSCTL_ADD_PROC(ctx, tree, OID_AUTO, "i2c_timeout", + CTLFLAG_RW | CTLTYPE_UINT | CTLFLAG_MPSAFE, sc, 0, + ti_i2c_sysctl_timeout, "IU", "I2C bus timeout (in ticks)"); + /* Activate the interrupt. */ err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, NULL, ti_i2c_intr, sc, &sc->sc_irq_h); diff --git a/sys/boot/fdt/dts/arm/am335x.dtsi b/sys/boot/fdt/dts/arm/am335x.dtsi index 4f443f0..fea57e9 100644 --- a/sys/boot/fdt/dts/arm/am335x.dtsi +++ b/sys/boot/fdt/dts/arm/am335x.dtsi @@ -47,6 +47,11 @@ reg = < 0x48200000 0x1000 >; }; + pmu { + compatible = "arm,cortex-a8-pmu"; + interrupts = <3>; + }; + scm@44e10000 { compatible = "ti,scm"; reg = < 0x44e10000 0x2000 >; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 2d09d57..a65d2dc 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1910,18 +1910,18 @@ dadeletemaxsize(struct da_softc *softc, da_delete_methods delete_method) sectors = (off_t)ATA_DSM_RANGE_MAX * softc->trim_max_ranges; break; case DA_DELETE_WS16: - sectors = (off_t)min(softc->ws_max_blks, WS16_MAX_BLKS); + sectors = omin(softc->ws_max_blks, WS16_MAX_BLKS); break; case DA_DELETE_ZERO: case DA_DELETE_WS10: - sectors = (off_t)min(softc->ws_max_blks, WS10_MAX_BLKS); + sectors = omin(softc->ws_max_blks, WS10_MAX_BLKS); break; default: return 0; } return (off_t)softc->params.secsize * - min(sectors, (off_t)softc->params.sectors); + omin(sectors, softc->params.sectors); } static void @@ -2684,7 +2684,7 @@ da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp) /* Try to extend the previous range. */ if (lba == lastlba) { - c = min(count, ATA_DSM_RANGE_MAX - lastcount); + c = omin(count, ATA_DSM_RANGE_MAX - lastcount); lastcount += c; off = (ranges - 1) * 8; buf[off + 6] = lastcount & 0xff; @@ -2694,7 +2694,7 @@ da_delete_trim(struct cam_periph *periph, union ccb *ccb, struct bio *bp) } while (count > 0) { - c = min(count, ATA_DSM_RANGE_MAX); + c = omin(count, ATA_DSM_RANGE_MAX); off = ranges * 8; buf[off + 0] = lba & 0xff; @@ -2770,7 +2770,7 @@ da_delete_ws(struct cam_periph *periph, union ccb *ccb, struct bio *bp) "%s issuing short delete %ld > %ld\n", da_delete_method_desc[softc->delete_method], count, ws_max_blks); - count = min(count, ws_max_blks); + count = omin(count, ws_max_blks); break; } bp1 = bioq_first(&softc->delete_queue); diff --git a/sys/conf/kern.opts.mk b/sys/conf/kern.opts.mk index 84e4e4f..81d91af 100644 --- a/sys/conf/kern.opts.mk +++ b/sys/conf/kern.opts.mk @@ -23,6 +23,8 @@ # src tree. __DEFAULT_YES_OPTIONS = \ + AUTOFS \ + BHYVE \ BLUETOOTH \ CCD \ CDDL \ diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index dbd6334..7f59e84 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -3292,6 +3292,12 @@ cxgbe_uninit_synchronized(struct port_info *pi) ASSERT_SYNCHRONIZED_OP(sc); + if (!(pi->flags & PORT_INIT_DONE)) { + KASSERT(!(ifp->if_drv_flags & IFF_DRV_RUNNING), + ("uninited port is running")); + return (0); + } + /* * Disable the VI so that all its data in either direction is discarded * by the MPS. Leave everything else (the queues, interrupts, and 1Hz diff --git a/sys/dev/cxgbe/tom/t4_ddp.c b/sys/dev/cxgbe/tom/t4_ddp.c index e89eb70..6908de9 100644 --- a/sys/dev/cxgbe/tom/t4_ddp.c +++ b/sys/dev/cxgbe/tom/t4_ddp.c @@ -852,9 +852,9 @@ handle_ddp(struct socket *so, struct uio *uio, int flags, int error) SOCKBUF_LOCK_ASSERT(sb); #if 0 - if (sb->sb_cc + sc->tt.ddp_thres > uio->uio_resid) { + if (sbused(sb) + sc->tt.ddp_thres > uio->uio_resid) { CTR4(KTR_CXGBE, "%s: sb_cc %d, threshold %d, resid %d", - __func__, sb->sb_cc, sc->tt.ddp_thres, uio->uio_resid); + __func__, sbused(sb), sc->tt.ddp_thres, uio->uio_resid); } #endif @@ -1057,9 +1057,9 @@ t4_soreceive_ddp(struct socket *so, struct sockaddr **psa, struct uio *uio, /* Prevent other readers from entering the socket. */ error = sblock(sb, SBLOCKWAIT(flags)); + SOCKBUF_LOCK(sb); if (error) goto out; - SOCKBUF_LOCK(sb); /* Easy one, no space to copyout anything. */ if (uio->uio_resid == 0) { @@ -1081,8 +1081,8 @@ restart: /* uio should be just as it was at entry */ KASSERT(oresid == uio->uio_resid, - ("%s: oresid = %d, uio_resid = %zd, sbused = %d", - __func__, oresid, uio->uio_resid, sbused(sb))); + ("%s: oresid = %d, uio_resid = %zd, sbavail = %d", + __func__, oresid, uio->uio_resid, sbavail(sb))); error = handle_ddp(so, uio, flags, 0); ddp_handled = 1; @@ -1092,7 +1092,7 @@ restart: /* Abort if socket has reported problems. */ if (so->so_error) { - if (sbused(sb)) + if (sbavail(sb)) goto deliver; if (oresid > uio->uio_resid) goto out; @@ -1104,32 +1104,32 @@ restart: /* Door is closed. Deliver what is left, if any. */ if (sb->sb_state & SBS_CANTRCVMORE) { - if (sbused(sb)) + if (sbavail(sb)) goto deliver; else goto out; } /* Socket buffer is empty and we shall not block. */ - if (sbused(sb) == 0 && + if (sbavail(sb) == 0 && ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)))) { error = EAGAIN; goto out; } /* Socket buffer got some data that we shall deliver now. */ - if (sbused(sb) && !(flags & MSG_WAITALL) && + if (sbavail(sb) > 0 && !(flags & MSG_WAITALL) && ((so->so_state & SS_NBIO) || (flags & (MSG_DONTWAIT|MSG_NBIO)) || - sbused(sb) >= sb->sb_lowat || - sbused(sb) >= uio->uio_resid || - sbused(sb) >= sb->sb_hiwat) ) { + sbavail(sb) >= sb->sb_lowat || + sbavail(sb) >= uio->uio_resid || + sbavail(sb) >= sb->sb_hiwat) ) { goto deliver; } /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sbused(sb) >= uio->uio_resid || sbused(sb) >= sb->sb_lowat)) + (sbavail(sb) >= uio->uio_resid || sbavail(sb) >= sb->sb_lowat)) goto deliver; /* @@ -1148,7 +1148,7 @@ restart: deliver: SOCKBUF_LOCK_ASSERT(&so->so_rcv); - KASSERT(sbused(sb) > 0, ("%s: sockbuf empty", __func__)); + KASSERT(sbavail(sb) > 0, ("%s: sockbuf empty", __func__)); KASSERT(sb->sb_mb != NULL, ("%s: sb_mb == NULL", __func__)); if (sb->sb_flags & SB_DDP_INDICATE && !ddp_handled) @@ -1159,7 +1159,7 @@ deliver: uio->uio_td->td_ru.ru_msgrcv++; /* Fill uio until full or current end of socket buffer is reached. */ - len = min(uio->uio_resid, sbused(sb)); + len = min(uio->uio_resid, sbavail(sb)); if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 13822fd..1d5d24f 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -1096,6 +1096,10 @@ _callout_stop_safe(struct callout *c, int safe) struct lock_class *class; int direct, sq_locked, use_lock; + if (safe) + WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, c->c_lock, + "calling %s", __func__); + /* * Some old subsystems don't hold Giant while running a callout_stop(), * so just discard this check for the moment. diff --git a/sys/kern/subr_sglist.c b/sys/kern/subr_sglist.c index c66973a..df88a26 100644 --- a/sys/kern/subr_sglist.c +++ b/sys/kern/subr_sglist.c @@ -216,6 +216,9 @@ void sglist_free(struct sglist *sg) { + if (sg == NULL) + return; + if (refcount_release(&sg->sg_refs)) free(sg, M_SGLIST); } diff --git a/sys/modules/Makefile b/sys/modules/Makefile index 5c74856..7498dab 100644 --- a/sys/modules/Makefile +++ b/sys/modules/Makefile @@ -47,7 +47,7 @@ SUBDIR= \ ata \ ath \ ath_pci \ - autofs \ + ${_autofs} \ ${_auxio} \ ${_bce} \ bfe \ @@ -382,6 +382,10 @@ SUBDIR= \ ${_zfs} \ zlib +.if ${MK_AUTOFS} != "no" || defined(ALL_MODULES) +_autofs= autofs +.endif + .if ${MK_CRYPT} != "no" || defined(ALL_MODULES) .if exists(${.CURDIR}/../opencrypto) _crypto= crypto @@ -620,8 +624,11 @@ _qlxge= qlxge _qlxgb= qlxgb _qlxgbe= qlxgbe _sfxge= sfxge + +.if ${MK_BHYVE} != "no" || defined(ALL_MODULES) _vmm= vmm .endif +.endif .if ${MACHINE_CPUARCH} == "i386" # XXX some of these can move to the general case when de-i386'ed diff --git a/sys/modules/iscsi/Makefile b/sys/modules/iscsi/Makefile index d072cfb..2bff545 100644 --- a/sys/modules/iscsi/Makefile +++ b/sys/modules/iscsi/Makefile @@ -4,22 +4,12 @@ KMOD= iscsi SRCS= iscsi.c -.if defined(ICL_RDMA) -SRCS+= icl_rdma.c -.else SRCS+= icl.c -.endif SRCS+= icl_proxy.c SRCS+= opt_cam.h SRCS+= bus_if.h SRCS+= device_if.h -# Those below are required for RDMA. -SRCS+= vnode_if.h -SRCS+= opt_inet.h -SRCS+= opt_inet6.h - -CFLAGS+= -I${.CURDIR}/../../ofed/include #CFLAGS+=-DICL_KERNEL_PROXY .include <bsd.kmod.mk> diff --git a/tools/build/mk/OptionalObsoleteFiles.inc b/tools/build/mk/OptionalObsoleteFiles.inc index dfc6a9d..e1a04a1 100644 --- a/tools/build/mk/OptionalObsoleteFiles.inc +++ b/tools/build/mk/OptionalObsoleteFiles.inc @@ -6,6 +6,7 @@ # .if ${MK_ACCT} == no +OLD_FILES+=etc/rc.d/accounting OLD_FILES+=etc/periodic/daily/310.accounting OLD_FILES+=usr/sbin/accton OLD_FILES+=usr/sbin/sa @@ -14,6 +15,8 @@ OLD_FILES+=usr/share/man/man8/sa.8.gz .endif .if ${MK_ACPI} == no +OLD_FILES+=etc/devd/asus.conf +OLD_FILES+=etc/rc.d/power_profile OLD_FILES+=usr/sbin/acpiconf OLD_FILES+=usr/sbin/acpidb OLD_FILES+=usr/sbin/acpidump @@ -26,6 +29,7 @@ OLD_FILES+=usr/share/man/man8/iasl.8.gz .if ${MK_AMD} == no OLD_FILES+=etc/amd.map +OLD_FILES+=etc/rc.d/amd OLD_FILES+=usr/bin/pawd OLD_FILES+=usr/sbin/amd OLD_FILES+=usr/sbin/amq @@ -48,6 +52,8 @@ OLD_FILES+=usr/share/man/man8/wire-test.8.gz .endif .if ${MK_APM} == no +OLD_FILES+=etc/rc.d/apm +OLD_FILES+=etc/rc.d/apmd OLD_FILES+=etc/apmd.conf OLD_FILES+=usr/sbin/apm OLD_FILES+=usr/share/examples/etc/apmd.conf @@ -56,6 +62,7 @@ OLD_FILES+=usr/share/man/man8/amd64/apmconf.8.gz .endif .if ${MK_AT} == no +OLD_FILES+=etc/pam.d/atrun OLD_FILES+=usr/bin/at OLD_FILES+=usr/bin/atq OLD_FILES+=usr/bin/atrm @@ -144,10 +151,41 @@ OLD_FILES+=usr/share/man/man8/authpf.8.gz OLD_FILES+=usr/share/man/man8/authpf-noip.8.gz .endif +.if ${MK_AUTOFS} == no +OLD_FILES+=etc/autofs/include_ldap +OLD_FILES+=etc/autofs/special_hosts +OLD_FILES+=etc/autofs/special_media +OLD_FILES+=etc/autofs/special_null +OLD_FILES+=etc/auto_master +OLD_FILES+=etc/rc.d/automount +OLD_FILES+=etc/rc.d/automountd +OLD_FILES+=etc/rc.d/autounmountd +OLD_FILES+=usr/sbin/automount +OLD_FILES+=usr/sbin/automountd +OLD_FILES+=usr/sbin/autounmountd +OLD_FILES+=usr/share/man/man5/autofs.5.gz +OLD_FILES+=usr/share/man/man5/auto_master.5.gz +OLD_FILES+=usr/share/man/man8/automount.8.gz +OLD_FILES+=usr/share/man/man8/automountd.8.gz +OLD_FILES+=usr/share/man/man8/autounmountd.8.gz +OLD_DIRS+=etc/autofs +.endif + +.if ${MK_BHYVE} == no +OLD_FILES+=usr/sbin/bhyve +OLD_FILES+=usr/sbin/bhyvectl +OLD_FILES+=usr/sbin/bhyveload +OLD_FILES+=usr/share/examples/bhyve/vmrun.sh +OLD_FILES+=usr/share/man/man8/bhyve.8.gz +OLD_FILES+=usr/share/man/man8/bhyveload.8.gz +OLD_DIRS+=usr/share/examples/bhyve +.endif + .if ${MK_BLUETOOTH} == no OLD_FILES+=etc/bluetooth/hcsecd.conf OLD_FILES+=etc/bluetooth/hosts OLD_FILES+=etc/bluetooth/protocols +OLD_FILES+=etc/defaults/bluetooth.device.conf OLD_DIRS+=etc/bluetooth OLD_FILES+=usr/bin/bthost OLD_FILES+=usr/bin/btsockstat @@ -2150,6 +2188,20 @@ OLD_FILES+=usr/share/man/man5/qop.5.gz OLD_FILES+=usr/share/man/man8/gssd.8.gz .endif +.if ${MK_HAST} == no +OLD_FILES+=sbin/hastctl +OLD_FILES+=sbin/hastd +OLD_FILES+=usr/share/examples/hast/ucarp.sh +OLD_FILES+=usr/share/examples/hast/ucarp_down.sh +OLD_FILES+=usr/share/examples/hast/ucarp_up.sh +OLD_FILES+=usr/share/examples/hast/vip-down.sh +OLD_FILES+=usr/share/examples/hast/vip-up.sh +OLD_FILES+=usr/share/man/man5/hast.conf.5.gz +OLD_FILES+=usr/share/man/man8/hastctl.8.gz +OLD_FILES+=usr/share/man/man8/hastd.8.gz +OLD_DIRS+=usr/share/examples/hast +.endif + .if ${MK_HESIOD} == no OLD_FILES+=usr/bin/hesinfo OLD_FILES+=usr/include/hesiod.h @@ -2323,6 +2375,7 @@ OLD_FILES+=usr/share/man/man8/iscsid.8.gz .endif .if ${MK_JAIL} == no +OLD_FILES+=etc/rc.d/jail OLD_FILES+=usr/sbin/jail OLD_FILES+=usr/sbin/jexec OLD_FILES+=usr/sbin/jls @@ -2332,6 +2385,8 @@ OLD_FILES+=usr/share/man/man8/jls.8.gz .endif .if ${MK_KERBEROS} == no +OLD_FILES+=etc/rc.d/ipropd_master +OLD_FILES+=etc/rc.d/ipropd_slave OLD_FILES+=usr/bin/compile_et OLD_FILES+=usr/bin/hxtool OLD_FILES+=usr/bin/kadmin @@ -3472,6 +3527,7 @@ OLD_FILES+=usr/share/man/man8/updatedb.8.gz .if ${MK_LPR} == no OLD_FILES+=etc/hosts.lpd OLD_FILES+=etc/printcap +OLD_FILES+=etc/rc.d/lpd OLD_FILES+=usr/bin/lp OLD_FILES+=usr/bin/lpq OLD_FILES+=usr/bin/lpr @@ -4933,6 +4989,8 @@ OLD_FILES+=usr/share/man/man8/utx.8.gz .if ${MK_WIRELESS} == no OLD_FILES+=etc/regdomain.xml +OLD_FILES+=etc/rc.d/hostapd +OLD_FILES+=etc/rc.d/wpa_supplicant OLD_FILES+=usr/sbin/ancontrol OLD_FILES+=usr/sbin/hostapd OLD_FILES+=usr/sbin/hostapd_cli diff --git a/tools/build/options/WITHOUT_AUTOFS b/tools/build/options/WITHOUT_AUTOFS new file mode 100644 index 0000000..f9c5c2c --- /dev/null +++ b/tools/build/options/WITHOUT_AUTOFS @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr autofs 4 +related programs, libraries, and kernel modules. diff --git a/tools/build/options/WITHOUT_BHYVE b/tools/build/options/WITHOUT_BHYVE new file mode 100644 index 0000000..b80a726 --- /dev/null +++ b/tools/build/options/WITHOUT_BHYVE @@ -0,0 +1,6 @@ +.\" $FreeBSD$ +Set to not build or install +.Xr bhyve 8 , +associated utilities, and examples. +.Pp +This option only affects amd64/amd64. diff --git a/tools/build/options/WITHOUT_HAST b/tools/build/options/WITHOUT_HAST new file mode 100644 index 0000000..0c31b8c --- /dev/null +++ b/tools/build/options/WITHOUT_HAST @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to not build +.Xr hastd 8 +and related utilities. diff --git a/usr.sbin/Makefile b/usr.sbin/Makefile index 1db4046..79e4909 100644 --- a/usr.sbin/Makefile +++ b/usr.sbin/Makefile @@ -5,7 +5,6 @@ SUBDIR= adduser \ arp \ - autofs \ binmiscctl \ bootparamd \ bsdconfig \ @@ -124,6 +123,10 @@ SUBDIR+= praudit SUBDIR+= authpf .endif +.if ${MK_AUTOFS} != "no" +SUBDIR+= autofs +.endif + .if ${MK_BLUETOOTH} != "no" SUBDIR+= bluetooth .endif diff --git a/usr.sbin/Makefile.amd64 b/usr.sbin/Makefile.amd64 index 2d1a3e8..3f40974 100644 --- a/usr.sbin/Makefile.amd64 +++ b/usr.sbin/Makefile.amd64 @@ -10,9 +10,11 @@ SUBDIR+= acpi SUBDIR+= apm .endif SUBDIR+= asf +.if ${MK_BHYVE} != "no" SUBDIR+= bhyve SUBDIR+= bhyvectl SUBDIR+= bhyveload +.endif SUBDIR+= boot0cfg .if ${MK_TOOLCHAIN} != "no" SUBDIR+= btxld diff --git a/usr.sbin/pw/pw_group.c b/usr.sbin/pw/pw_group.c index 51166cd..b20ce88 100644 --- a/usr.sbin/pw/pw_group.c +++ b/usr.sbin/pw/pw_group.c @@ -68,11 +68,7 @@ pw_group(struct userconf * cnf, int mode, struct cargs * args) }; if (a_gid != NULL) { - const char *teststr; - teststr = a_gid->val; - if (*teststr == '-') - teststr++; - if (strspn(teststr, "0123456789") != strlen(teststr)) + if (strspn(a_gid->val, "0123456789") != strlen(a_gid->val)) errx(EX_USAGE, "-g expects a number"); } diff --git a/usr.sbin/pw/pw_user.c b/usr.sbin/pw/pw_user.c index f146b46..483148a 100644 --- a/usr.sbin/pw/pw_user.c +++ b/usr.sbin/pw/pw_user.c @@ -322,10 +322,7 @@ pw_user(struct userconf * cnf, int mode, struct cargs * args) a_name = NULL; } } else { - const char *teststr = a_uid->val; - if (*teststr == '-') - teststr++; - if (strspn(teststr, "0123456789") != strlen(teststr)) + if (strspn(a_uid->val, "0123456789") != strlen(a_uid->val)) errx(EX_USAGE, "-u expects a number"); } diff --git a/usr.sbin/pw/tests/Makefile b/usr.sbin/pw/tests/Makefile index c609884..1283ff2 100644 --- a/usr.sbin/pw/tests/Makefile +++ b/usr.sbin/pw/tests/Makefile @@ -9,11 +9,9 @@ ATF_TESTS_SH= pw_etcdir \ pw_lock \ pw_groupdel \ pw_groupmod \ - pw_groupshow \ pw_useradd \ pw_userdel \ - pw_usermod \ - pw_usershow + pw_usermod .for tp in ${ATF_TESTS_SH} TEST_METADATA.${tp}+= required_user="root" diff --git a/usr.sbin/pw/tests/pw_groupshow.sh b/usr.sbin/pw/tests/pw_groupshow.sh deleted file mode 100755 index 2ba53d6..0000000 --- a/usr.sbin/pw/tests/pw_groupshow.sh +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ - -# Import helper functions -. $(atf_get_srcdir)/helper_functions.shin - - -# Test negative uid are still valid -# PR: 196514 -atf_test_case show_group_with_negative_number -show_group_with_negative_number_body() { - populate_etc_skel - atf_check -s exit:0 \ - -o inline:"wheel:*:0:root\n" \ - ${PW} groupshow -n wheel -g -1 -} - -atf_init_test_cases() { - atf_add_test_case show_group_with_negative_number -} diff --git a/usr.sbin/pw/tests/pw_usershow.sh b/usr.sbin/pw/tests/pw_usershow.sh deleted file mode 100755 index 4703644..0000000 --- a/usr.sbin/pw/tests/pw_usershow.sh +++ /dev/null @@ -1,19 +0,0 @@ -# $FreeBSD$ - -# Import helper functions -. $(atf_get_srcdir)/helper_functions.shin - - -# Test negative uid are still valid -# PR: 196514 -atf_test_case show_user_with_negative_number -show_user_with_negative_number_body() { - populate_etc_skel - atf_check -s exit:0 \ - -o inline:"root:*:0:0::0:0:Charlie &:/root:/bin/csh\n" \ - ${PW} usershow -n root -u -1 -} - -atf_init_test_cases() { - atf_add_test_case show_user_with_negative_number -} |