From owner-svn-src-user@freebsd.org Thu Feb 1 16:43:52 2018 Return-Path: Delivered-To: svn-src-user@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2888EEDCFC6 for ; Thu, 1 Feb 2018 16:43:52 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFD997667A; Thu, 1 Feb 2018 16:43:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CA6EC796F; Thu, 1 Feb 2018 16:43:51 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w11Ghp90025933; Thu, 1 Feb 2018 16:43:51 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w11GhmHf025902; Thu, 1 Feb 2018 16:43:48 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802011643.w11GhmHf025902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 1 Feb 2018 16:43:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r328682 - in user/markj/netdump: cddl/usr.sbin/zfsd contrib/jemalloc contrib/jemalloc/include/jemalloc contrib/llvm/include/llvm/MC contrib/llvm/lib/MC contrib/netbsd-tests/lib/libc/sys... X-SVN-Group: user X-SVN-Commit-Author: markj X-SVN-Commit-Paths: in user/markj/netdump: cddl/usr.sbin/zfsd contrib/jemalloc contrib/jemalloc/include/jemalloc contrib/llvm/include/llvm/MC contrib/llvm/lib/MC contrib/netbsd-tests/lib/libc/sys contrib/netbsd-tests/usr... X-SVN-Commit-Revision: 328682 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2018 16:43:52 -0000 Author: markj Date: Thu Feb 1 16:43:48 2018 New Revision: 328682 URL: https://svnweb.freebsd.org/changeset/base/328682 Log: MFH at r328681. Added: user/markj/netdump/lib/libc/stdlib/strtold.c - copied unchanged from r328681, head/lib/libc/stdlib/strtold.c user/markj/netdump/lib/libc/tests/gen/makecontext_test.c - copied unchanged from r328681, head/lib/libc/tests/gen/makecontext_test.c user/markj/netdump/stand/common/interp_simple.c - copied unchanged from r328681, head/stand/common/interp_simple.c user/markj/netdump/stand/libsa/libsa.3 - copied unchanged from r328681, head/stand/libsa/libsa.3 user/markj/netdump/stand/libsa/xlocale_private.h - copied unchanged from r328681, head/stand/libsa/xlocale_private.h user/markj/netdump/sys/mips/include/abi.h - copied unchanged from r328681, head/sys/mips/include/abi.h Deleted: user/markj/netdump/stand/libsa/libstand.3 user/markj/netdump/stand/libsa/strtol.c user/markj/netdump/stand/libsa/strtoul.c Modified: user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc user/markj/netdump/contrib/jemalloc/FREEBSD-diffs user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh user/markj/netdump/lib/libc/gen/makecontext.3 user/markj/netdump/lib/libc/i386/gen/makecontext.c user/markj/netdump/lib/libc/mips/gen/makecontext.c user/markj/netdump/lib/libc/powerpc/gen/makecontext.c user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c user/markj/netdump/lib/libc/stdlib/Makefile.inc user/markj/netdump/lib/libc/stdlib/strtol.c user/markj/netdump/lib/libc/tests/gen/Makefile user/markj/netdump/lib/libedit/Makefile user/markj/netdump/lib/libgcc_s/Makefile user/markj/netdump/release/scripts/make-manifest.sh user/markj/netdump/share/man/man4/usb_template.4 user/markj/netdump/share/man/man7/arch.7 user/markj/netdump/stand/common/bootstrap.h user/markj/netdump/stand/common/install.c user/markj/netdump/stand/common/interp.c user/markj/netdump/stand/common/interp_forth.c user/markj/netdump/stand/common/load_elf.c user/markj/netdump/stand/fdt/fdt_loader_cmd.c user/markj/netdump/stand/libsa/Makefile user/markj/netdump/stand/libsa/stand.h user/markj/netdump/stand/loader.mk user/markj/netdump/sys/amd64/amd64/db_trace.c user/markj/netdump/sys/amd64/amd64/exception.S user/markj/netdump/sys/amd64/amd64/genassym.c user/markj/netdump/sys/amd64/amd64/initcpu.c user/markj/netdump/sys/amd64/amd64/machdep.c user/markj/netdump/sys/amd64/amd64/support.S user/markj/netdump/sys/amd64/ia32/ia32_exception.S user/markj/netdump/sys/amd64/include/md_var.h user/markj/netdump/sys/amd64/include/pcpu.h user/markj/netdump/sys/amd64/linux/Makefile user/markj/netdump/sys/amd64/linux32/Makefile user/markj/netdump/sys/amd64/vmm/amd/svm.c user/markj/netdump/sys/arm64/arm64/pmap.c user/markj/netdump/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c user/markj/netdump/sys/compat/cloudabi32/Makefile user/markj/netdump/sys/compat/cloudabi64/Makefile user/markj/netdump/sys/compat/freebsd32/Makefile user/markj/netdump/sys/compat/linuxkpi/common/include/linux/sched.h user/markj/netdump/sys/dev/atkbdc/psm.c user/markj/netdump/sys/dev/cpuctl/cpuctl.c user/markj/netdump/sys/dev/cxgbe/tom/t4_tom.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitch_8327.c user/markj/netdump/sys/dev/etherswitch/arswitch/arswitchvar.h user/markj/netdump/sys/dev/mlx5/mlx5_en/en.h user/markj/netdump/sys/dev/ntb/ntb_transport.c user/markj/netdump/sys/dev/uart/uart_dev_mvebu.c user/markj/netdump/sys/dev/usb/usb_device.c user/markj/netdump/sys/fs/ext2fs/ext2_alloc.c user/markj/netdump/sys/fs/ext2fs/ext2_inode_cnv.c user/markj/netdump/sys/fs/ext2fs/ext2_vfsops.c user/markj/netdump/sys/fs/ext2fs/ext2fs.h user/markj/netdump/sys/geom/journal/g_journal.c user/markj/netdump/sys/i386/i386/support.s user/markj/netdump/sys/i386/ibcs2/Makefile user/markj/netdump/sys/i386/linux/Makefile user/markj/netdump/sys/kern/Makefile user/markj/netdump/sys/kern/makesyscalls.sh user/markj/netdump/sys/kern/vfs_subr.c user/markj/netdump/sys/mips/include/asm.h user/markj/netdump/sys/mips/mips/pm_machdep.c user/markj/netdump/sys/mips/mips/vm_machdep.c user/markj/netdump/sys/netinet/tcp_timer.c user/markj/netdump/sys/netinet/tcp_timer.h user/markj/netdump/sys/netpfil/pf/pf.c user/markj/netdump/sys/powerpc/aim/aim_machdep.c user/markj/netdump/sys/powerpc/aim/mp_cpudep.c user/markj/netdump/sys/powerpc/booke/booke_machdep.c user/markj/netdump/sys/powerpc/include/psl.h user/markj/netdump/sys/powerpc/powerpc/exec_machdep.c user/markj/netdump/sys/powerpc/powerpc/genassym.c user/markj/netdump/sys/powerpc/powerpc/machdep.c user/markj/netdump/sys/powerpc/powerpc/vm_machdep.c user/markj/netdump/sys/sys/mouse.h user/markj/netdump/sys/ufs/ffs/ffs_alloc.c user/markj/netdump/sys/x86/include/specialreg.h user/markj/netdump/sys/x86/include/x86_var.h user/markj/netdump/sys/x86/x86/cpu_machdep.c user/markj/netdump/sys/x86/x86/identcpu.c user/markj/netdump/usr.bin/dtc/Makefile user/markj/netdump/usr.bin/nfsstat/Makefile user/markj/netdump/usr.bin/nfsstat/nfsstat.1 user/markj/netdump/usr.bin/nfsstat/nfsstat.c Directory Properties: user/markj/netdump/ (props changed) user/markj/netdump/cddl/ (props changed) user/markj/netdump/contrib/llvm/ (props changed) user/markj/netdump/contrib/netbsd-tests/ (props changed) user/markj/netdump/lib/libedit/ (props changed) user/markj/netdump/sys/cddl/contrib/opensolaris/ (props changed) Modified: user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc ============================================================================== --- user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/cddl/usr.sbin/zfsd/case_file.cc Thu Feb 1 16:43:48 2018 (r328682) @@ -442,10 +442,38 @@ CaseFile::ReEvaluate(const ZfsEvent &event) return (consumed || closed); } +/* Find a Vdev containing the vdev with the given GUID */ +static nvlist_t* +find_parent(nvlist_t *pool_config, nvlist_t *config, DevdCtl::Guid child_guid) +{ + nvlist_t **vdevChildren; + int error; + unsigned ch, numChildren; + error = nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN, + &vdevChildren, &numChildren); + + if (error != 0 || numChildren == 0) + return (NULL); + + for (ch = 0; ch < numChildren; ch++) { + nvlist *result; + Vdev vdev(pool_config, vdevChildren[ch]); + + if (vdev.GUID() == child_guid) + return (config); + + result = find_parent(pool_config, vdevChildren[ch], child_guid); + if (result != NULL) + return (result); + } + + return (NULL); +} + bool CaseFile::ActivateSpare() { - nvlist_t *config, *nvroot; + nvlist_t *config, *nvroot, *parent_config; nvlist_t **spares; char *devPath, *vdev_type; const char *poolname; @@ -472,6 +500,22 @@ CaseFile::ActivateSpare() { "tree for pool %s", poolname); return (false); } + + parent_config = find_parent(config, nvroot, m_vdevGUID); + if (parent_config != NULL) { + char *parent_type; + + /* + * Don't activate spares for members of a "replacing" vdev. + * They're already dealt with. Sparing them will just drag out + * the resilver process. + */ + error = nvlist_lookup_string(parent_config, + ZPOOL_CONFIG_TYPE, &parent_type); + if (error == 0 && strcmp(parent_type, VDEV_TYPE_REPLACING) == 0) + return (false); + } + nspares = 0; nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES, &spares, &nspares); Modified: user/markj/netdump/contrib/jemalloc/FREEBSD-diffs ============================================================================== --- user/markj/netdump/contrib/jemalloc/FREEBSD-diffs Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/jemalloc/FREEBSD-diffs Thu Feb 1 16:43:48 2018 (r328682) @@ -153,7 +153,7 @@ index 00000000..355b565c + * each supported architecture. + */ +#undef JEMALLOC_TLS_MODEL -+#undef STATIC_PAGE_SHIFT ++#undef LG_PAGE +#undef LG_VADDR +#undef LG_SIZEOF_PTR +#undef LG_SIZEOF_INT @@ -212,7 +212,7 @@ index 00000000..355b565c +# define JEMALLOC_TLS_MODEL /* Default. */ +#endif + -+#define STATIC_PAGE_SHIFT PAGE_SHIFT ++#define LG_PAGE PAGE_SHIFT +#define LG_SIZEOF_INT 2 +#define LG_SIZEOF_LONG LG_SIZEOF_PTR +#define LG_SIZEOF_INTMAX_T 3 Modified: user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h ============================================================================== --- user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/jemalloc/include/jemalloc/jemalloc_FreeBSD.h Thu Feb 1 16:43:48 2018 (r328682) @@ -17,7 +17,7 @@ * each supported architecture. */ #undef JEMALLOC_TLS_MODEL -#undef STATIC_PAGE_SHIFT +#undef LG_PAGE #undef LG_VADDR #undef LG_SIZEOF_PTR #undef LG_SIZEOF_INT @@ -76,7 +76,7 @@ # define JEMALLOC_TLS_MODEL /* Default. */ #endif -#define STATIC_PAGE_SHIFT PAGE_SHIFT +#define LG_PAGE PAGE_SHIFT #define LG_SIZEOF_INT 2 #define LG_SIZEOF_LONG LG_SIZEOF_PTR #define LG_SIZEOF_INTMAX_T 3 Modified: user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/include/llvm/MC/MCFragment.h Thu Feb 1 16:43:48 2018 (r328682) @@ -422,14 +422,21 @@ class MCFillFragment : public MCFragment { uint8_t Value; /// The number of bytes to insert. - uint64_t Size; + const MCExpr &Size; + /// Source location of the directive that this fragment was created for. + SMLoc Loc; + public: - MCFillFragment(uint8_t Value, uint64_t Size, MCSection *Sec = nullptr) - : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size) {} + MCFillFragment(uint8_t Value, const MCExpr &Size, SMLoc Loc, + MCSection *Sec = nullptr) + : MCFragment(FT_Fill, false, 0, Sec), Value(Value), Size(Size), Loc(Loc) { + } uint8_t getValue() const { return Value; } - uint64_t getSize() const { return Size; } + const MCExpr &getSize() const { return Size; } + + SMLoc getLoc() const { return Loc; } static bool classof(const MCFragment *F) { return F->getKind() == MCFragment::FT_Fill; Modified: user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/include/llvm/MC/MCObjectStreamer.h Thu Feb 1 16:43:48 2018 (r328682) @@ -161,7 +161,6 @@ class MCObjectStreamer : public MCStreamer { (public) bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc) override; using MCStreamer::emitFill; - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, Modified: user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h ============================================================================== --- user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/include/llvm/MC/MCStreamer.h Thu Feb 1 16:43:48 2018 (r328682) @@ -662,7 +662,7 @@ class MCStreamer { (public) /// \brief Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. - virtual void emitFill(uint64_t NumBytes, uint8_t FillValue); + void emitFill(uint64_t NumBytes, uint8_t FillValue); /// \brief Emit \p Size bytes worth of the value specified by \p FillValue. /// Modified: user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCAsmStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -192,9 +192,6 @@ class MCAsmStreamer final : public MCStreamer { (publi void EmitGPRel32Value(const MCExpr *Value) override; - - void emitFill(uint64_t NumBytes, uint8_t FillValue) override; - void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()) override; @@ -965,17 +962,12 @@ void MCAsmStreamer::EmitGPRel32Value(const MCExpr *Val EmitEOL(); } -/// emitFill - Emit NumBytes bytes worth of the value specified by -/// FillValue. This implements directives such as '.space'. -void MCAsmStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - if (NumBytes == 0) return; - - const MCExpr *E = MCConstantExpr::create(NumBytes, getContext()); - emitFill(*E, FillValue); -} - void MCAsmStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) { + int64_t IntNumBytes; + if (NumBytes.evaluateAsAbsolute(IntNumBytes) && IntNumBytes == 0) + return; + if (const char *ZeroDirective = MAI->getZeroDirective()) { // FIXME: Emit location directives OS << ZeroDirective; Modified: user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCAssembler.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -281,8 +281,18 @@ uint64_t MCAssembler::computeFragmentSize(const MCAsmL return cast(F).getContents().size(); case MCFragment::FT_CompactEncodedInst: return cast(F).getContents().size(); - case MCFragment::FT_Fill: - return cast(F).getSize(); + case MCFragment::FT_Fill: { + auto &FF = cast(F); + int64_t Size = 0; + if (!FF.getSize().evaluateAsAbsolute(Size, Layout)) + getContext().reportError(FF.getLoc(), + "expected assembly-time absolute expression"); + if (Size < 0) { + getContext().reportError(FF.getLoc(), "invalid number of bytes"); + return 0; + } + return Size; + } case MCFragment::FT_LEB: return cast(F).getContents().size(); @@ -540,7 +550,7 @@ static void writeFragment(const MCAssembler &Asm, cons for (unsigned I = 1; I < MaxChunkSize; ++I) Data[I] = Data[0]; - uint64_t Size = FF.getSize(); + uint64_t Size = FragmentSize; for (unsigned ChunkSize = MaxChunkSize; ChunkSize; ChunkSize /= 2) { StringRef Ref(Data, ChunkSize); for (uint64_t I = 0, E = Size / ChunkSize; I != E; ++I) Modified: user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCMachOStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -411,29 +411,19 @@ void MCMachOStreamer::EmitLocalCommonSymbol(MCSymbol * void MCMachOStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) { - getAssembler().registerSection(*Section); - - // The symbol may not be present, which only creates the section. - if (!Symbol) - return; - // On darwin all virtual sections have zerofill type. assert(Section->isVirtualSection() && "Section does not have zerofill type!"); - assert(Symbol->isUndefined() && "Cannot define a symbol twice!"); + PushSection(); + SwitchSection(Section); - getAssembler().registerSymbol(*Symbol); - - // Emit an align fragment if necessary. - if (ByteAlignment != 1) - new MCAlignFragment(ByteAlignment, 0, 0, ByteAlignment, Section); - - MCFragment *F = new MCFillFragment(0, Size, Section); - Symbol->setFragment(F); - - // Update the maximum alignment on the zero fill section if necessary. - if (ByteAlignment > Section->getAlignment()) - Section->setAlignment(ByteAlignment); + // The symbol may not be present, which only creates the section. + if (Symbol) { + EmitValueToAlignment(ByteAlignment, 0, 1, 0); + EmitLabel(Symbol); + EmitZeros(Size); + } + PopSection(); } // This should always be called with the thread local bss section. Like the Modified: user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCObjectStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -577,28 +577,13 @@ bool MCObjectStreamer::EmitRelocDirective(const MCExpr return false; } -void MCObjectStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - assert(getCurrentSectionOnly() && "need a section"); - insert(new MCFillFragment(FillValue, NumBytes)); -} - void MCObjectStreamer::emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc) { MCDataFragment *DF = getOrCreateDataFragment(); flushPendingLabels(DF, DF->getContents().size()); - int64_t IntNumBytes; - if (!NumBytes.evaluateAsAbsolute(IntNumBytes, getAssembler())) { - getContext().reportError(Loc, "expected absolute expression"); - return; - } - - if (IntNumBytes <= 0) { - getContext().reportError(Loc, "invalid number of bytes"); - return; - } - - emitFill(IntNumBytes, FillValue); + assert(getCurrentSectionOnly() && "need a section"); + insert(new MCFillFragment(FillValue, NumBytes, Loc)); } void MCObjectStreamer::emitFill(const MCExpr &NumValues, int64_t Size, Modified: user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -184,8 +184,7 @@ void MCStreamer::EmitGPRel32Value(const MCExpr *Value) /// Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - for (uint64_t i = 0, e = NumBytes; i != e; ++i) - EmitIntValue(FillValue, 1); + emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue); } void MCStreamer::emitFill(uint64_t NumValues, int64_t Size, int64_t Expr) { Modified: user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/MCWinCOFFStreamer.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -257,20 +257,13 @@ void MCWinCOFFStreamer::EmitLocalCommonSymbol(MCSymbol auto *Symbol = cast(S); MCSection *Section = getContext().getObjectFileInfo()->getBSSSection(); - getAssembler().registerSection(*Section); - if (Section->getAlignment() < ByteAlignment) - Section->setAlignment(ByteAlignment); - - getAssembler().registerSymbol(*Symbol); + PushSection(); + SwitchSection(Section); + EmitValueToAlignment(ByteAlignment, 0, 1, 0); + EmitLabel(Symbol); Symbol->setExternal(false); - - if (ByteAlignment != 1) - new MCAlignFragment(ByteAlignment, /*Value=*/0, /*ValueSize=*/0, - ByteAlignment, Section); - - MCFillFragment *Fragment = new MCFillFragment( - /*Value=*/0, Size, Section); - Symbol->setFragment(Fragment); + EmitZeros(Size); + PopSection(); } void MCWinCOFFStreamer::EmitZerofill(MCSection *Section, MCSymbol *Symbol, Modified: user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp ============================================================================== --- user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/llvm/lib/MC/WasmObjectWriter.cpp Thu Feb 1 16:43:48 2018 (r328682) @@ -528,7 +528,10 @@ static void addData(SmallVectorImpl &DataBytes, Align->getMaxBytesToEmit()); DataBytes.resize(Size, Value); } else if (auto *Fill = dyn_cast(&Frag)) { - DataBytes.insert(DataBytes.end(), Fill->getSize(), Fill->getValue()); + int64_t Size; + if (!Fill->getSize().evaluateAsAbsolute(Size)) + llvm_unreachable("The fill should be an assembler constant"); + DataBytes.insert(DataBytes.end(), Size, Fill->getValue()); } else { const auto &DataFrag = cast(Frag); const SmallVectorImpl &Contents = DataFrag.getContents(); Modified: user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c ============================================================================== --- user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/netbsd-tests/lib/libc/sys/t_getcontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -52,12 +52,10 @@ run(int n, ...) va_start(va, n); #ifdef __FreeBSD__ -#if defined(__amd64__) +#if defined(__amd64__) || defined(__sparc64__) for (i = 0; i < 5; i++) { -#elif defined(__aarch64__) +#elif defined(__aarch64__) || defined(__riscv__) for (i = 0; i < 7; i++) { -#elif defined(__mips__) - for (i = 0; i < 5; i++) { #else for (i = 0; i < 9; i++) { #endif @@ -121,18 +119,20 @@ ATF_TC_BODY(setcontext_link, tc) uc[i].uc_link = (i > 0) ? &uc[i - 1] : &save; #ifdef __FreeBSD__ -#if defined(__amd64__) - /* FreeBSD/amd64 only permits up to 6 arguments. */ +#if defined(__amd64__) || defined(__sparc64__) + /* + * FreeBSD/amd64 and FreeBSD/sparc64 only permit up to + * 6 arguments. + */ makecontext(&uc[i], (void *)run, 6, i, 0, 1, 2, 3, 4); -#elif defined(__aarch64__) - /* FreeBSD/arm64 only permits up to 8 arguments. */ +#elif defined(__aarch64__) || defined(__riscv__) + /* + * FreeBSD/arm64 and FreeBSD/riscv64 only permit up to + * 8 arguments. + */ makecontext(&uc[i], (void *)run, 8, i, 0, 1, 2, 3, 4, 5, 6); -#elif defined(__mips__) - /* FreeBSD/mips only permits up to 6 arguments. */ - makecontext(&uc[i], (void *)run, 6, i, - 0, 1, 2, 3, 4); #else makecontext(&uc[i], (void *)run, 10, i, 0, 1, 2, 3, 4, 5, 6, 7, 8); Modified: user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh ============================================================================== --- user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/contrib/netbsd-tests/usr.bin/grep/t_grep.sh Thu Feb 1 16:43:48 2018 (r328682) @@ -646,30 +646,6 @@ mmap_body() atf_check -s exit:1 grep --mmap -e "Z" test1 } -atf_test_case mmap_eof_not_eol -mmap_eof_not_eol_head() -{ - atf_set "descr" "Check --mmap flag handling of encountering EOF without EOL (PR 165471, 219402)" -} -mmap_eof_not_eol_body() -{ - grep_type - if [ $? -eq $GREP_TYPE_GNU ]; then - atf_expect_fail "gnu grep from ports has no --mmap option" - fi - - atf_expect_fail "relies on jemalloc feature no longer available; needs to be rewritten - bug 220309" - - printf "ABC" > test1 - jot -b " " -s "" 4096 >> test2 - - atf_check -s exit:0 -o inline:"B\n" grep --mmap -oe "B" test1 - # Dependency on jemalloc(3) to detect buffer overflow, otherwise this - # unreliably produces a SIGSEGV or SIGBUS - atf_check -s exit:0 -o not-empty \ - env MALLOC_CONF="redzone:true" grep --mmap -e " " test2 -} - atf_test_case matchall matchall_head() { @@ -779,7 +755,6 @@ atf_init_test_cases() atf_add_test_case binary_flags atf_add_test_case badcontext atf_add_test_case mmap - atf_add_test_case mmap_eof_not_eol atf_add_test_case matchall atf_add_test_case fgrep_multipattern atf_add_test_case fgrep_icase Modified: user/markj/netdump/lib/libc/gen/makecontext.3 ============================================================================== --- user/markj/netdump/lib/libc/gen/makecontext.3 Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/gen/makecontext.3 Thu Feb 1 16:43:48 2018 (r328682) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd January 31, 2018 .Dt MAKECONTEXT 3 .Os .Sh NAME @@ -68,11 +68,16 @@ with the arguments provided. The .Fa argc argument -must be equal to the number of additional arguments provided to +must be equal to the number of additional arguments of type +.Vt int +provided to .Fn makecontext -and also equal to the number of arguments to -.Fn func , -or else the behavior is undefined. +and also equal to the number of arguments of type +.Vt int +to +.Fn func ; +otherwise , +the behavior is undefined. .Pp The .Fa "ucp->uc_link" Modified: user/markj/netdump/lib/libc/i386/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/i386/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/i386/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -85,7 +85,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in ucp->uc_mcontext.mc_len = 0; } /* XXX - Do we want to sanity check argc? */ - else if ((argc < 0) || (argc > NCARGS)) { + else if (argc < 0) { ucp->uc_mcontext.mc_len = 0; } /* Make sure the context is valid. */ Modified: user/markj/netdump/lib/libc/mips/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/mips/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/mips/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -38,6 +38,7 @@ __RCSID("$NetBSD: makecontext.c,v 1.5 2009/12/14 01:07 #endif #include +#include #include #include @@ -65,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int * so that we can mark a context as invalid. Store it in * mc->mc_regs[ZERO] perhaps? */ - if (argc < 0 || argc > 6 || ucp == NULL || + if (argc < 0 || ucp == NULL || ucp->uc_stack.ss_sp == NULL || ucp->uc_stack.ss_size < MINSIGSTKSZ) return; @@ -75,13 +76,10 @@ __makecontext(ucontext_t *ucp, void (*func)(void), int ((uintptr_t)ucp->uc_stack.ss_sp + ucp->uc_stack.ss_size); #if defined(__mips_o32) || defined(__mips_o64) sp -= (argc >= 4 ? argc : 4); /* Make room for >=4 arguments. */ - sp = (register_t *) - ((uintptr_t)sp & ~0x7); /* Align on double-word boundary. */ #elif defined(__mips_n32) || defined(__mips_n64) sp -= (argc > 8 ? argc - 8 : 0); /* Make room for > 8 arguments. */ - sp = (register_t *) - ((uintptr_t)sp & ~0xf); /* Align on quad-word boundary. */ #endif + sp = (register_t *)((uintptr_t)sp & ~(STACK_ALIGN - 1)); mc->mc_regs[SP] = (intptr_t)sp; mc->mc_regs[S0] = (intptr_t)ucp; Modified: user/markj/netdump/lib/libc/powerpc/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/powerpc/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/powerpc/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -66,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in int i, regargs, stackargs; /* Sanity checks */ - if ((ucp == NULL) || (argc < 0) || (argc > NCARGS) + if ((ucp == NULL) || (argc < 0) || (ucp->uc_stack.ss_sp == NULL) || (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { /* invalidate context */ Modified: user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c ============================================================================== --- user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/powerpc64/gen/makecontext.c Thu Feb 1 16:43:48 2018 (r328682) @@ -66,7 +66,7 @@ __makecontext(ucontext_t *ucp, void (*start)(void), in int i, regargs, stackargs; /* Sanity checks */ - if ((ucp == NULL) || (argc < 0) || (argc > NCARGS) + if ((ucp == NULL) || (argc < 0) || (ucp->uc_stack.ss_sp == NULL) || (ucp->uc_stack.ss_size < MINSIGSTKSZ)) { /* invalidate context */ Modified: user/markj/netdump/lib/libc/stdlib/Makefile.inc ============================================================================== --- user/markj/netdump/lib/libc/stdlib/Makefile.inc Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/stdlib/Makefile.inc Thu Feb 1 16:43:48 2018 (r328682) @@ -15,7 +15,7 @@ MISRCS+=C99_Exit.c a64l.c abort.c abs.c atexit.c atof. radixsort.c rand.c \ random.c reallocarray.c reallocf.c realpath.c remque.c \ set_constraint_handler_s.c strfmon.c strtoimax.c \ - strtol.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ + strtol.c strtold.c strtoll.c strtoq.c strtoul.c strtonum.c strtoull.c \ strtoumax.c strtouq.c system.c tdelete.c tfind.c tsearch.c twalk.c # Work around an issue on case-insensitive file systems. Modified: user/markj/netdump/lib/libc/stdlib/strtol.c ============================================================================== --- user/markj/netdump/lib/libc/stdlib/strtol.c Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/stdlib/strtol.c Thu Feb 1 16:43:48 2018 (r328682) @@ -46,7 +46,6 @@ __FBSDID("$FreeBSD$"); #include #include "xlocale_private.h" - /* * Convert a string to a long integer. * @@ -152,9 +151,4 @@ long strtol(const char * __restrict nptr, char ** __restrict endptr, int base) { return strtol_l(nptr, endptr, base, __get_locale()); -} -long double -strtold(const char * __restrict nptr, char ** __restrict endptr) -{ - return strtold_l(nptr, endptr, __get_locale()); } Copied: user/markj/netdump/lib/libc/stdlib/strtold.c (from r328681, head/lib/libc/stdlib/strtold.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/stdlib/strtold.c Thu Feb 1 16:43:48 2018 (r328682, copy of r328681, head/lib/libc/stdlib/strtold.c) @@ -0,0 +1,45 @@ +/*- + * SPDX-License-Identifier: BSD-3-Clause + * + * Copyright (c) 2011 The FreeBSD Foundation + * All rights reserved. + * Portions of this software were developed by David Chisnall + * 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. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (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 +__FBSDID("$FreeBSD$"); + +#include +#include "xlocale_private.h" + +long double +strtold(const char * __restrict nptr, char ** __restrict endptr) +{ + + return strtold_l(nptr, endptr, __get_locale()); +} Modified: user/markj/netdump/lib/libc/tests/gen/Makefile ============================================================================== --- user/markj/netdump/lib/libc/tests/gen/Makefile Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libc/tests/gen/Makefile Thu Feb 1 16:43:48 2018 (r328682) @@ -12,6 +12,7 @@ ATF_TESTS_C+= fpclassify2_test ATF_TESTS_C+= ftw_test ATF_TESTS_C+= getmntinfo_test ATF_TESTS_C+= glob2_test +ATF_TESTS_C+= makecontext_test ATF_TESTS_C+= popen_test ATF_TESTS_C+= posix_spawn_test ATF_TESTS_C+= realpath2_test Copied: user/markj/netdump/lib/libc/tests/gen/makecontext_test.c (from r328681, head/lib/libc/tests/gen/makecontext_test.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ user/markj/netdump/lib/libc/tests/gen/makecontext_test.c Thu Feb 1 16:43:48 2018 (r328682, copy of r328681, head/lib/libc/tests/gen/makecontext_test.c) @@ -0,0 +1,189 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD + * + * Copyright (c) 2018 John H. Baldwin + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include + +static char uc_stack[16 * 1024]; + +static void +check_1(int arg1) +{ + + ATF_REQUIRE_EQ(arg1, 1); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg1); +ATF_TC_BODY(makecontext_arg1, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_1, 1, 1); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_2(int arg1, int arg2) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg2); +ATF_TC_BODY(makecontext_arg2, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_2, 2, 1, 2); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_3(int arg1, int arg2, int arg3) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg3); +ATF_TC_BODY(makecontext_arg3, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_3, 3, 1, 2, 3); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_4(int arg1, int arg2, int arg3, int arg4) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); + ATF_REQUIRE_EQ(arg4, 4); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg4); +ATF_TC_BODY(makecontext_arg4, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_4, 4, 1, 2, 3, 4); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_5(int arg1, int arg2, int arg3, int arg4, int arg5) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); + ATF_REQUIRE_EQ(arg4, 4); + ATF_REQUIRE_EQ(arg5, 5); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg5); +ATF_TC_BODY(makecontext_arg5, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_5, 5, 1, 2, 3, 4, 5); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +static void +check_6(int arg1, int arg2, int arg3, int arg4, int arg5, int arg6) +{ + + ATF_REQUIRE_EQ(arg1, 1); + ATF_REQUIRE_EQ(arg2, 2); + ATF_REQUIRE_EQ(arg3, 3); + ATF_REQUIRE_EQ(arg4, 4); + ATF_REQUIRE_EQ(arg5, 5); + ATF_REQUIRE_EQ(arg6, 6); +} + +ATF_TC_WITHOUT_HEAD(makecontext_arg6); +ATF_TC_BODY(makecontext_arg6, tc) +{ + ucontext_t ctx[2]; + + ATF_REQUIRE_EQ(getcontext(&ctx[1]), 0); + ctx[1].uc_stack.ss_sp = uc_stack; + ctx[1].uc_stack.ss_size = sizeof(uc_stack); + ctx[1].uc_link = &ctx[0]; + makecontext(&ctx[1], (void (*)(void))check_6, 6, 1, 2, 3, 4, 5, 6); + + ATF_REQUIRE_EQ(swapcontext(&ctx[0], &ctx[1]), 0); +} + +ATF_TP_ADD_TCS(tp) +{ + + ATF_TP_ADD_TC(tp, makecontext_arg1); + ATF_TP_ADD_TC(tp, makecontext_arg2); + ATF_TP_ADD_TC(tp, makecontext_arg3); + ATF_TP_ADD_TC(tp, makecontext_arg4); + ATF_TP_ADD_TC(tp, makecontext_arg5); + ATF_TP_ADD_TC(tp, makecontext_arg6); + + return (atf_no_error()); +} Modified: user/markj/netdump/lib/libedit/Makefile ============================================================================== --- user/markj/netdump/lib/libedit/Makefile Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libedit/Makefile Thu Feb 1 16:43:48 2018 (r328682) @@ -3,18 +3,19 @@ # $FreeBSD$ PACKAGE=clibs -LIB= edit + SHLIB_MAJOR= 7 SHLIBDIR?= /lib WARNS?= 3 +LIB= edit +LIBADD= ncursesw + OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ hist.c keymacro.c map.c chartype.c \ parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c -LIBADD= ncursesw - MAN= editline.3 editrc.5 MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 el_init.3 \ @@ -28,25 +29,26 @@ MLINKS= editline.3 el_deletestr.3 editline.3 el_end.3 editline.3 tok_line.3 editline.3 tok_str.3 # For speed and debugging -#SRCS= ${OSRCS} +#SRCS= ${OSRCS} readline.c tokenizer.c history.c # For protection -SRCS= editline.c -SRCS+= tokenizer.c history.c readline.c +SRCS= editline.c readline.c tokenizer.c history.c SRCS+= common.h emacs.h fcns.h help.h vi.h -CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h -INCS= histedit.h - +# Widechar SRCS+= tokenizern.c historyn.c CLEANFILES+= tokenizern.c historyn.c + +INCS= histedit.h + +CLEANFILES+= common.h editline.c emacs.h fcns.c fcns.h help.c help.h vi.h CFLAGS+= -I. -I${.CURDIR} -I${.CURDIR}/edit -DWIDECHAR #CFLAGS+= -DDEBUG_TTY -DDEBUG_KEY -DDEBUG_READ -DDEBUG -DDEBUG_REFRESH #CFLAGS+= -DDEBUG_PASTE -DDEBUG_EDIT -SUBDIR= edit/readline - AHDR= vi.h emacs.h common.h ASRC= ${.CURDIR}/vi.c ${.CURDIR}/emacs.c ${.CURDIR}/common.c + +SUBDIR= edit/readline .for hdr in vi emacs common ${hdr}.h: ${hdr}.c makelist Modified: user/markj/netdump/lib/libgcc_s/Makefile ============================================================================== --- user/markj/netdump/lib/libgcc_s/Makefile Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/lib/libgcc_s/Makefile Thu Feb 1 16:43:48 2018 (r328682) @@ -28,12 +28,18 @@ SRCS+= s_fabsf.c SRCS+= s_fabsl.c SRCS+= s_fmax.c SRCS+= s_fmaxf.c -SRCS+= s_fmaxl.c SRCS+= s_logb.c SRCS+= s_logbf.c -SRCS+= s_logbl.c SRCS+= s_scalbn.c SRCS+= s_scalbnf.c + +# Don't include long double routines on architectures where long double +# is the same size as double. +.if ${MACHINE_CPUARCH} != "mips" && ${MACHINE_CPUARCH} != "arm" && \ + ${MACHINE_CPUARCH} != "powerpc" +SRCS+= s_fmaxl.c +SRCS+= s_logbl.c SRCS+= s_scalbnl.c +.endif .include Modified: user/markj/netdump/release/scripts/make-manifest.sh ============================================================================== --- user/markj/netdump/release/scripts/make-manifest.sh Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/release/scripts/make-manifest.sh Thu Feb 1 16:43:48 2018 (r328682) @@ -32,6 +32,7 @@ desc_tests="${tests}" default_doc=off default_src=off +default_ports=off default_tests=off default_base_dbg=off default_lib32_dbg=off Modified: user/markj/netdump/share/man/man4/usb_template.4 ============================================================================== --- user/markj/netdump/share/man/man4/usb_template.4 Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/share/man/man4/usb_template.4 Thu Feb 1 16:43:48 2018 (r328682) @@ -23,7 +23,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd June 8, 2016 +.Dd January 30, 2018 .Dt USB_TEMPLATE 4 .Os . @@ -66,9 +66,11 @@ or by using the .Xr usbconfig 8 .Cm set_template subcommand. -The sysctl values can be changed at any time, but will not -have any effect until the USB device has been re-enumerated. -. +Changing the +.Va hw.usb.template +sysctl triggers reenumeration by the USB host; changes to other sysctls +may not be visible to the host until reenumeration is performed. +.Pp Available templates are: .Bl -column -offset 3n "Value" .It Em Value Ta Em Description @@ -93,6 +95,7 @@ tunables: .Bl -tag -width indent .It Va hw.usb.template Currently selected template. +Set to -1 to make the device disappear from the USB host point of view. .It Va hw.usb.templates.N Configuration for template number .Va N . Modified: user/markj/netdump/share/man/man7/arch.7 ============================================================================== --- user/markj/netdump/share/man/man7/arch.7 Thu Feb 1 16:40:37 2018 (r328681) +++ user/markj/netdump/share/man/man7/arch.7 Thu Feb 1 16:43:48 2018 (r328682) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 15, 2017 +.Dd January 31, 2018 .Dt ARCH 7 .Os .Sh NAME @@ -95,6 +95,7 @@ architectures, the final release. .It arm Ta 6.0 .It armeb Ta 8.0 .It armv6 Ta 10.0 +.It armv7 Ta 12.0 .It arm64 Ta 11.0 .It ia64 Ta 5.0 Ta 10.x .It i386 Ta 1.0 @@ -164,6 +165,8 @@ Examples are: .Dv arm64 currently does not support execution of .Dv armv6 +or +.Dv armv7 binaries, even if the CPU implements .Dv AArch32 execution state. @@ -220,6 +223,7 @@ is 8 bytes on all supported architectures except i386. .It arm Ta little Ta unsigned .It armeb Ta big Ta unsigned .It armv6 Ta little Ta unsigned +.It armv7 Ta little Ta unsigned .It arm64 Ta little Ta unsigned .It i386 Ta little Ta signed .It mips Ta big Ta signed @@ -245,6 +249,7 @@ is 8 bytes on all supported architectures except i386. .It arm Ta 4K .It armeb Ta 4K .It armv6 Ta 4K, 1M +.It armv7 Ta 4K, 1M .It arm64 Ta 4K, 2M, 1G .It i386 Ta 4K, 2M (PAE), 4M .It mips Ta 4K @@ -270,6 +275,7 @@ is 8 bytes on all supported architectures except i386. .It arm Ta soft Ta soft, double precision .It armeb Ta soft Ta soft, double precision .It armv6 Ta hard(1) Ta hard, double precision +.It armv7 Ta hard(1) Ta hard, double precision .It arm64 Ta hard Ta soft, quad precision .It i386 Ta hard Ta hard, 80 bit .It mips Ta soft Ta identical to double @@ -322,6 +328,7 @@ Architecture-specific macros: .It arm Ta Dv __arm__ .It armeb Ta Dv __arm__ .It armv6 Ta Dv __arm__, Dv __ARM_ARCH >= 6 +.It armv7 Ta Dv __arm__, Dv __ARM_ARCH >= 7 *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***