CVS commit: src/sys/net
Module Name:src Committed By: ozaki-r Date: Mon Mar 7 01:41:55 UTC 2016 Modified Files: src/sys/net: if.c Log Message: Add missing percpu_putref to error path To generate a diff of this commit: cvs rdiff -u -r1.325 -r1.326 src/sys/net/if.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/net/if.c diff -u src/sys/net/if.c:1.325 src/sys/net/if.c:1.326 --- src/sys/net/if.c:1.325 Fri Feb 19 20:05:43 2016 +++ src/sys/net/if.c Mon Mar 7 01:41:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if.c,v 1.325 2016/02/19 20:05:43 roy Exp $ */ +/* $NetBSD: if.c,v 1.326 2016/03/07 01:41:55 ozaki-r Exp $ */ /*- * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc. @@ -90,7 +90,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.325 2016/02/19 20:05:43 roy Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if.c,v 1.326 2016/03/07 01:41:55 ozaki-r Exp $"); #if defined(_KERNEL_OPT) #include "opt_inet.h" @@ -770,6 +770,7 @@ if_percpuq_enqueue(struct if_percpuq *ip ifq = percpu_getref(ipq->ipq_ifqs); if (IF_QFULL(ifq)) { IF_DROP(ifq); + percpu_putref(ipq->ipq_ifqs); m_freem(m); goto out; }
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: christos Date: Mon Mar 7 00:51:32 UTC 2016 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: Avoid void * arithmetic To generate a diff of this commit: cvs rdiff -u -r1.139 -r1.140 src/sys/rump/librump/rumpvfs/rumpfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.139 src/sys/rump/librump/rumpvfs/rumpfs.c:1.140 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.139 Sun Mar 6 14:47:41 2016 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Sun Mar 6 19:51:32 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.139 2016/03/06 19:47:41 christos Exp $ */ +/* $NetBSD: rumpfs.c,v 1.140 2016/03/07 00:51:32 christos Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.139 2016/03/06 19:47:41 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.140 2016/03/07 00:51:32 christos Exp $"); #include #include @@ -934,7 +934,7 @@ rump_vop_setattr(void *v) copylen = MIN(rn->rn_dlen, newlen); memcpy(newdata, rn->rn_data, copylen); - memset(newdata + copylen, 0, newlen - copylen); + memset((char *)newdata + copylen, 0, newlen - copylen); if ((rn->rn_flags & RUMPNODE_EXTSTORAGE) == 0) { rump_hyperfree(rn->rn_data, rn->rn_dlen);
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: christos Date: Mon Mar 7 00:28:36 UTC 2016 Modified Files: src/sys/arch/sparc64/dev: iommu.c Log Message: Better to panic! Otherwise we end in an endless loop. To generate a diff of this commit: cvs rdiff -u -r1.112 -r1.113 src/sys/arch/sparc64/dev/iommu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/dev/iommu.c diff -u src/sys/arch/sparc64/dev/iommu.c:1.112 src/sys/arch/sparc64/dev/iommu.c:1.113 --- src/sys/arch/sparc64/dev/iommu.c:1.112 Sun Mar 6 19:16:48 2016 +++ src/sys/arch/sparc64/dev/iommu.c Sun Mar 6 19:28:36 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: iommu.c,v 1.112 2016/03/07 00:16:48 christos Exp $ */ +/* $NetBSD: iommu.c,v 1.113 2016/03/07 00:28:36 christos Exp $ */ /* * Copyright (c) 1999, 2000 Matthew R. Green @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.112 2016/03/07 00:16:48 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.113 2016/03/07 00:28:36 christos Exp $"); #include "opt_ddb.h" @@ -746,10 +746,8 @@ iommu_dvmamap_unload(bus_dma_tag_t t, bu bus_size_t sgsize = map->_dm_dvmasize; /* Flush the iommu */ - if (!map->_dm_dvmastart) { - printf("%s: error dvmastart is zero!\n", __func__); - return; - } + if (!map->_dm_dvmastart) + panic("%s: error dvmastart is zero!\n", __func__); iommu_remove(is, map->_dm_dvmastart, map->_dm_dvmasize); /* Flush the caches */
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: christos Date: Mon Mar 7 00:16:48 UTC 2016 Modified Files: src/sys/arch/sparc64/dev: iommu.c Log Message: Return instead of crashing. This is wrong, and should be fixed properly. To generate a diff of this commit: cvs rdiff -u -r1.111 -r1.112 src/sys/arch/sparc64/dev/iommu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/dev/iommu.c diff -u src/sys/arch/sparc64/dev/iommu.c:1.111 src/sys/arch/sparc64/dev/iommu.c:1.112 --- src/sys/arch/sparc64/dev/iommu.c:1.111 Sun Mar 6 19:11:33 2016 +++ src/sys/arch/sparc64/dev/iommu.c Sun Mar 6 19:16:48 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: iommu.c,v 1.111 2016/03/07 00:11:33 christos Exp $ */ +/* $NetBSD: iommu.c,v 1.112 2016/03/07 00:16:48 christos Exp $ */ /* * Copyright (c) 1999, 2000 Matthew R. Green @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.111 2016/03/07 00:11:33 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.112 2016/03/07 00:16:48 christos Exp $"); #include "opt_ddb.h" @@ -746,11 +746,10 @@ iommu_dvmamap_unload(bus_dma_tag_t t, bu bus_size_t sgsize = map->_dm_dvmasize; /* Flush the iommu */ -#ifdef DEBUG if (!map->_dm_dvmastart) { - printf("iommu_dvmamap_unload: No dvmastart is zero\n"); + printf("%s: error dvmastart is zero!\n", __func__); + return; } -#endif iommu_remove(is, map->_dm_dvmastart, map->_dm_dvmasize); /* Flush the caches */
CVS commit: src/sys/arch/sparc64/dev
Module Name:src Committed By: christos Date: Mon Mar 7 00:11:34 UTC 2016 Modified Files: src/sys/arch/sparc64/dev: iommu.c Log Message: Don't throw us in the debugger! To generate a diff of this commit: cvs rdiff -u -r1.110 -r1.111 src/sys/arch/sparc64/dev/iommu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/sparc64/dev/iommu.c diff -u src/sys/arch/sparc64/dev/iommu.c:1.110 src/sys/arch/sparc64/dev/iommu.c:1.111 --- src/sys/arch/sparc64/dev/iommu.c:1.110 Sun Sep 6 19:47:09 2015 +++ src/sys/arch/sparc64/dev/iommu.c Sun Mar 6 19:11:33 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: iommu.c,v 1.110 2015/09/06 23:47:09 nakayama Exp $ */ +/* $NetBSD: iommu.c,v 1.111 2016/03/07 00:11:33 christos Exp $ */ /* * Copyright (c) 1999, 2000 Matthew R. Green @@ -59,7 +59,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.110 2015/09/06 23:47:09 nakayama Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iommu.c,v 1.111 2016/03/07 00:11:33 christos Exp $"); #include "opt_ddb.h" @@ -749,9 +749,6 @@ iommu_dvmamap_unload(bus_dma_tag_t t, bu #ifdef DEBUG if (!map->_dm_dvmastart) { printf("iommu_dvmamap_unload: No dvmastart is zero\n"); -#ifdef DDB - Debugger(); -#endif } #endif iommu_remove(is, map->_dm_dvmastart, map->_dm_dvmasize);
CVS commit: src/lib/libedit
Module Name:src Committed By: christos Date: Mon Mar 7 00:05:20 UTC 2016 Modified Files: src/lib/libedit: chartype.h Log Message: Remove advertising clause. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/lib/libedit/chartype.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libedit/chartype.h diff -u src/lib/libedit/chartype.h:1.24 src/lib/libedit/chartype.h:1.25 --- src/lib/libedit/chartype.h:1.24 Wed Mar 2 14:24:20 2016 +++ src/lib/libedit/chartype.h Sun Mar 6 19:05:20 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: chartype.h,v 1.24 2016/03/02 19:24:20 christos Exp $ */ +/* $NetBSD: chartype.h,v 1.25 2016/03/07 00:05:20 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -12,13 +12,6 @@ * 2. Redistributions in binary form must reproduce the above copyright *notice, this list of conditions and the following disclaimer in the *documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - *must display the following acknowledgement: - *This product includes software developed by the NetBSD - *Foundation, Inc. and its contributors. - * 4. Neither the name of The NetBSD Foundation 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 NETBSD FOUNDATION, INC. AND CONTRIBUTORS * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
CVS commit: src/usr.bin/bthset
Module Name:src Committed By: plunky Date: Sun Mar 6 21:12:07 UTC 2016 Modified Files: src/usr.bin/bthset: bthset.c Log Message: use correct offset for channel in SDP record To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/usr.bin/bthset/bthset.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/bthset/bthset.c diff -u src/usr.bin/bthset/bthset.c:1.8 src/usr.bin/bthset/bthset.c:1.9 --- src/usr.bin/bthset/bthset.c:1.8 Thu Mar 15 02:02:23 2012 +++ src/usr.bin/bthset/bthset.c Sun Mar 6 21:12:07 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bthset.c,v 1.8 2012/03/15 02:02:23 joerg Exp $ */ +/* $NetBSD: bthset.c,v 1.9 2016/03/06 21:12:07 plunky Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -33,7 +33,7 @@ #include __COPYRIGHT("@(#) Copyright (c) 2006 Itronix, Inc. All rights reserved."); -__RCSID("$NetBSD: bthset.c,v 1.8 2012/03/15 02:02:23 joerg Exp $"); +__RCSID("$NetBSD: bthset.c,v 1.9 2016/03/06 21:12:07 plunky Exp $"); #include #include @@ -140,8 +140,8 @@ static uint8_t hset_data[] = { 0x77, 0x61, 0x79 }; -static sdp_data_t hset_record = { hset_data + 0, hset_data + 91 }; -static sdp_data_t hset_channel = { hset_data + 36, hset_data + 37 }; +static sdp_data_t hset_record = { hset_data + 0, hset_data + 89 }; +static sdp_data_t hset_channel = { hset_data + 34, hset_data + 36 }; int main(int ac, char *av[])
CVS commit: src/sys/arch/mips/mips
Module Name:src Committed By: tnn Date: Sun Mar 6 21:03:01 UTC 2016 Modified Files: src/sys/arch/mips/mips: trap.c Log Message: Don't try to interpret MIPS3-specific status register bit on MIPS1. Fixes boot of NetBSD/pmax in gxemul 3max emulation mode. To generate a diff of this commit: cvs rdiff -u -r1.238 -r1.239 src/sys/arch/mips/mips/trap.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/mips/mips/trap.c diff -u src/sys/arch/mips/mips/trap.c:1.238 src/sys/arch/mips/mips/trap.c:1.239 --- src/sys/arch/mips/mips/trap.c:1.238 Thu Jun 11 15:50:17 2015 +++ src/sys/arch/mips/mips/trap.c Sun Mar 6 21:03:01 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: trap.c,v 1.238 2015/06/11 15:50:17 matt Exp $ */ +/* $NetBSD: trap.c,v 1.239 2016/03/06 21:03:01 tnn Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -39,7 +39,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.238 2015/06/11 15:50:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.239 2016/03/06 21:03:01 tnn Exp $"); #include "opt_cputype.h" /* which mips CPU levels do we support? */ #include "opt_ddb.h" @@ -167,7 +167,7 @@ trap(uint32_t status, uint32_t cause, va KSI_INIT_TRAP(); curcpu()->ci_data.cpu_ntrap++; - if (status & MIPS3_SR_NMI) { + if (CPUISMIPS3 && (status & MIPS3_SR_NMI)) { type = T_NMI; } else { type = TRAPTYPE(cause);
CVS commit: src/sys/rump/librump/rumpvfs
Module Name:src Committed By: christos Date: Sun Mar 6 19:47:41 UTC 2016 Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: PR/50900: David Binderman: optimize memset To generate a diff of this commit: cvs rdiff -u -r1.138 -r1.139 src/sys/rump/librump/rumpvfs/rumpfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/rump/librump/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.138 src/sys/rump/librump/rumpvfs/rumpfs.c:1.139 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.138 Tue Feb 2 08:02:34 2016 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Sun Mar 6 14:47:41 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpfs.c,v 1.138 2016/02/02 13:02:34 pooka Exp $ */ +/* $NetBSD: rumpfs.c,v 1.139 2016/03/06 19:47:41 christos Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.138 2016/02/02 13:02:34 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.139 2016/03/06 19:47:41 christos Exp $"); #include #include @@ -933,8 +933,8 @@ rump_vop_setattr(void *v) return ENOSPC; copylen = MIN(rn->rn_dlen, newlen); - memset(newdata, 0, newlen); memcpy(newdata, rn->rn_data, copylen); + memset(newdata + copylen, 0, newlen - copylen); if ((rn->rn_flags & RUMPNODE_EXTSTORAGE) == 0) { rump_hyperfree(rn->rn_data, rn->rn_dlen);
CVS commit: src/sys/netinet
Module Name:src Committed By: christos Date: Sun Mar 6 19:46:05 UTC 2016 Modified Files: src/sys/netinet: sctputil.c Log Message: PR/50899: David Binderman: optimize memset To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/sys/netinet/sctputil.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/netinet/sctputil.c diff -u src/sys/netinet/sctputil.c:1.2 src/sys/netinet/sctputil.c:1.3 --- src/sys/netinet/sctputil.c:1.2 Mon Feb 15 14:00:42 2016 +++ src/sys/netinet/sctputil.c Sun Mar 6 14:46:05 2016 @@ -1,5 +1,5 @@ /* $KAME: sctputil.c,v 1.39 2005/06/16 20:54:06 jinmei Exp $ */ -/* $NetBSD: sctputil.c,v 1.2 2016/02/15 19:00:42 rtr Exp $ */ +/* $NetBSD: sctputil.c,v 1.3 2016/03/06 19:46:05 christos Exp $ */ /* * Copyright (c) 2001, 2002, 2003, 2004 Cisco Systems, Inc. @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.2 2016/02/15 19:00:42 rtr Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sctputil.c,v 1.3 2016/03/06 19:46:05 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_inet.h" @@ -844,9 +844,10 @@ sctp_expand_mapping_array(struct sctp_as { /* mapping array needs to grow */ u_int8_t *new_array; - uint16_t new_size; + uint16_t new_size, old_size; - new_size = asoc->mapping_array_size + SCTP_MAPPING_ARRAY_INCR; + old_size = asoc->mapping_array_size; + new_size = old_size + SCTP_MAPPING_ARRAY_INCR; new_array = malloc(new_size, M_PCB, M_NOWAIT); if (new_array == NULL) { /* can't get more, forget it */ @@ -854,8 +855,8 @@ sctp_expand_mapping_array(struct sctp_as new_size); return (-1); } - memset(new_array, 0, new_size); - memcpy(new_array, asoc->mapping_array, asoc->mapping_array_size); + memcpy(new_array, asoc->mapping_array, old_size); + memset(new_array + old_size, 0, SCTP_MAPPING_ARRAY_INCR); free(asoc->mapping_array, M_PCB); asoc->mapping_array = new_array; asoc->mapping_array_size = new_size;
CVS commit: src/sys/dev/pci/n8/common/api
Module Name:src Committed By: christos Date: Sun Mar 6 19:42:25 UTC 2016 Modified Files: src/sys/dev/pci/n8/common/api: n8_rsa.c Log Message: PR/50898: David Binderman: remove redundant memset. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/n8/common/api/n8_rsa.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/pci/n8/common/api/n8_rsa.c diff -u src/sys/dev/pci/n8/common/api/n8_rsa.c:1.1 src/sys/dev/pci/n8/common/api/n8_rsa.c:1.2 --- src/sys/dev/pci/n8/common/api/n8_rsa.c:1.1 Thu Oct 30 08:02:15 2008 +++ src/sys/dev/pci/n8/common/api/n8_rsa.c Sun Mar 6 14:42:25 2016 @@ -32,7 +32,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -static char const n8_id[] = "$Id: n8_rsa.c,v 1.1 2008/10/30 12:02:15 darran Exp $"; +static char const n8_id[] = "$Id: n8_rsa.c,v 1.2 2016/03/06 19:42:25 christos Exp $"; /*/ /** @file n8_rsa.c * @brief Public RSA functions. @@ -1087,7 +1087,6 @@ static N8_Status_t initPublicKey(N8_RSAK * * padding = digit_size - (pub_key_len % digit_size) */ - memset(vAddr, 0x0, padding); memcpy([padding], material_p->publicKey.value_p, material_p->publicKey.lengthBytes);
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Sun Mar 6 18:53:51 UTC 2016 Modified Files: src/doc [netbsd-7]: CHANGES-7.1 Log Message: Ticket #1125 To generate a diff of this commit: cvs rdiff -u -r1.1.2.62 -r1.1.2.63 src/doc/CHANGES-7.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.1 diff -u src/doc/CHANGES-7.1:1.1.2.62 src/doc/CHANGES-7.1:1.1.2.63 --- src/doc/CHANGES-7.1:1.1.2.62 Sun Mar 6 18:47:39 2016 +++ src/doc/CHANGES-7.1 Sun Mar 6 18:53:50 2016 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.1,v 1.1.2.62 2016/03/06 18:47:39 martin Exp $ +# $NetBSD: CHANGES-7.1,v 1.1.2.63 2016/03/06 18:53:50 martin Exp $ A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1 release: @@ -2369,3 +2369,11 @@ bin/cp/cp.c 1.59 a terminal. [uwe, ticket #1131] +sys/arch/xen/xen/if_xennet_xenbus.c 1.67 + + In xennet_xenbus_detach(), remove the event handler early (just after + xennet_stop()) so that we don't get events while slepping (e.g. + in softint_disestablish()) when some structures have already been + freed. + [bouyer, ticket #1125] +
CVS commit: [netbsd-7] src/sys/arch/xen/xen
Module Name:src Committed By: martin Date: Sun Mar 6 18:52:07 UTC 2016 Modified Files: src/sys/arch/xen/xen [netbsd-7]: if_xennet_xenbus.c Log Message: Pull up following revision(s) (requested by bouyer in ticket #1125): sys/arch/xen/xen/if_xennet_xenbus.c: revision 1.67 In xennet_xenbus_detach(), remove the event handler early (just after xennet_stop()) so that we don't get events while slepping (e.g. in softint_disestablish()) when some structures have already been freed. Problem reported and patch tested by Rohan Desai. To generate a diff of this commit: cvs rdiff -u -r1.63 -r1.63.2.1 src/sys/arch/xen/xen/if_xennet_xenbus.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/xen/xen/if_xennet_xenbus.c diff -u src/sys/arch/xen/xen/if_xennet_xenbus.c:1.63 src/sys/arch/xen/xen/if_xennet_xenbus.c:1.63.2.1 --- src/sys/arch/xen/xen/if_xennet_xenbus.c:1.63 Sun Aug 10 16:44:35 2014 +++ src/sys/arch/xen/xen/if_xennet_xenbus.c Sun Mar 6 18:52:06 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: if_xennet_xenbus.c,v 1.63 2014/08/10 16:44:35 tls Exp $ */ +/* $NetBSD: if_xennet_xenbus.c,v 1.63.2.1 2016/03/06 18:52:06 martin Exp $ */ /* * Copyright (c) 2006 Manuel Bouyer. @@ -85,7 +85,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.63 2014/08/10 16:44:35 tls Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_xennet_xenbus.c,v 1.63.2.1 2016/03/06 18:52:06 martin Exp $"); #include "opt_xen.h" #include "opt_nfs_boot.h" @@ -421,6 +421,7 @@ xennet_xenbus_detach(device_t self, int DPRINTF(("%s: xennet_xenbus_detach\n", device_xname(self))); s0 = splnet(); xennet_stop(ifp, 1); + event_remove_handler(sc->sc_evtchn, _handler, sc); /* wait for pending TX to complete, and collect pending RX packets */ xennet_handler(sc); while (sc->sc_tx_ring.sring->rsp_prod != sc->sc_tx_ring.rsp_cons) { @@ -456,7 +457,6 @@ xennet_xenbus_detach(device_t self, int uvm_km_free(kernel_map, (vaddr_t)sc->sc_rx_ring.sring, PAGE_SIZE, UVM_KMF_WIRED); softint_disestablish(sc->sc_softintr); - event_remove_handler(sc->sc_evtchn, _handler, sc); splx(s0); pmf_device_deregister(self);
CVS commit: src/etc/rc.d
Module Name:src Committed By: christos Date: Sun Mar 6 18:50:06 UTC 2016 Modified Files: src/etc/rc.d: network Log Message: use kat, a version of cat that strips comments To generate a diff of this commit: cvs rdiff -u -r1.70 -r1.71 src/etc/rc.d/network Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/rc.d/network diff -u src/etc/rc.d/network:1.70 src/etc/rc.d/network:1.71 --- src/etc/rc.d/network:1.70 Thu Jan 7 06:51:07 2016 +++ src/etc/rc.d/network Sun Mar 6 13:50:06 2016 @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: network,v 1.70 2016/01/07 11:51:07 roy Exp $ +# $NetBSD: network,v 1.71 2016/03/06 18:50:06 christos Exp $ # # PROVIDE: network @@ -61,7 +61,7 @@ network_start_hostname() # otherwise use /etc/myname # if [ -z "$hostname" ] && [ -f /etc/myname ]; then - hostname=$(cat /etc/myname) + hostname=$(kat /etc/myname) fi if [ -n "$hostname" ]; then echo "Hostname: $hostname" @@ -85,7 +85,7 @@ network_start_domainname() # for NIS/YP domain name # if [ -z "$domainname" ] && [ -f /etc/defaultdomain ]; then - domainname=$(cat /etc/defaultdomain) + domainname=$(kat /etc/defaultdomain) fi if [ -n "$domainname" ]; then echo "NIS domainname: $domainname" @@ -403,7 +403,7 @@ network_start_defaultroute() # /etc/hosts. # if [ -z "$defaultroute" ] && [ -f /etc/mygate ]; then - defaultroute=$(cat /etc/mygate) + defaultroute=$(kat /etc/mygate) fi if [ -n "$defaultroute" ]; then /sbin/route add default $defaultroute @@ -418,7 +418,7 @@ network_start_defaultroute6() # address if it is not using an stf* interface. # if [ -z "$defaultroute6" ] && [ -f /etc/mygate6 ]; then - defaultroute6=$(cat /etc/mygate6) + defaultroute6=$(kat /etc/mygate6) fi if [ -n "$defaultroute6" ]; then if [ "$ip6mode" = "autohost" ]; then
CVS commit: src/etc
Module Name:src Committed By: christos Date: Sun Mar 6 18:49:42 UTC 2016 Modified Files: src/etc: rc.subr Log Message: Introduce kat() a built-in version of cat(1) that strips shell-like comments. To generate a diff of this commit: cvs rdiff -u -r1.97 -r1.98 src/etc/rc.subr Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/etc/rc.subr diff -u src/etc/rc.subr:1.97 src/etc/rc.subr:1.98 --- src/etc/rc.subr:1.97 Sat Oct 31 08:31:37 2015 +++ src/etc/rc.subr Sun Mar 6 13:49:42 2016 @@ -1,4 +1,4 @@ -# $NetBSD: rc.subr,v 1.97 2015/10/31 12:31:37 phx Exp $ +# $NetBSD: rc.subr,v 1.98 2016/03/06 18:49:42 christos Exp $ # # Copyright (c) 1997-2011 The NetBSD Foundation, Inc. # All rights reserved. @@ -1346,4 +1346,18 @@ printf() esac } +kat() { + local i + local v + for i; do + while read -r v; do + v="${v%%#*}" + if [ -z "$v" ]; then +continue + fi + echo "$v" + done < "$i" + done +} + _rc_subr_loaded=:
CVS commit: [netbsd-7] src/doc
Module Name:src Committed By: martin Date: Sun Mar 6 18:47:39 UTC 2016 Modified Files: src/doc [netbsd-7]: CHANGES-7.1 Log Message: Tickets #1103, #1117 - #1121, #1123, #1124, #1126, #1129 - #1131 To generate a diff of this commit: cvs rdiff -u -r1.1.2.61 -r1.1.2.62 src/doc/CHANGES-7.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.1 diff -u src/doc/CHANGES-7.1:1.1.2.61 src/doc/CHANGES-7.1:1.1.2.62 --- src/doc/CHANGES-7.1:1.1.2.61 Thu Mar 3 15:43:57 2016 +++ src/doc/CHANGES-7.1 Sun Mar 6 18:47:39 2016 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.1,v 1.1.2.61 2016/03/03 15:43:57 martin Exp $ +# $NetBSD: CHANGES-7.1,v 1.1.2.62 2016/03/06 18:47:39 martin Exp $ A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.1 release: @@ -2251,3 +2251,121 @@ sys/kern/kern_time.c1.184 Don't leak garabage from the kernel stack on sleep(0) and equivalents. [uwe, ticket #1128] +sys/kern/subr_pool.c1.206 + + fix: "vmstat -C" CpuLayer shows only the last cpu values. + [knakahara, ticket #1103] + +sys/arch/x86/include/cacheinfo.h 1.20-1.21 +sys/arch/x86/include/specialreg.h 1.83-1.86 +usr.sbin/cpuctl/arch/i386.c 1.67-1.70 + + Changes for x86's cpuctl(8): + - Add some TLB information (index 0x6a-0x6d). + - Add Hardware-Controlled Performance States (HWP) bits, FPU Data + Pointer Updated Only bit and CLFLUSHOPT bit. + - Add some AMD's bit definitions from "BIOS and Kernel Developer(BKDG) + for AMD Family 15h Models 60h-6Fh Processors". + - Add Xeon E5-4600 v3, + - Add Xeon E3-1200 v4 and v5. + - Add 6th gen Core, Xeon E3-1500 v5 and Xeon D-1500. + - Change CPU family 0x1c from "Atom Family" to "45nm Atom Family" + [msaitoh, ticket #1117] + +sys/arch/x86/include/cpu.h 1.67 +sys/arch/x86/include/cpuvar.h 1.47 +sys/arch/x86/x86/cpu.c1.117 +sys/arch/x86/x86/identcpu.c 1.49 + + Retrieve cpuid7 (Structured Extended Features) into ci_feat_val. + [msaitoh, ticket #1118] + +sys/arch/x86/x86/procfs_machdep.c 1.7-1.11 + + x86's /proc/cpuinfo fixes: + - Always output 2 digits for the cpu frequency decimal part. + - Update x86's feature bits in /proc/cpuinfo (PR#49246). + - Fix a bug that /proc/cpuinfo's CPU model was incorrect on many newer + CPUs and CPU family was incorrect on some AMD CPUs. + - Add comment. Fix comment. + [msaitoh, ticket #1119] + +lib/libm/src/e_hypotf.c1.10 + + Fix incorrect magic numbers in scaling. From FreeBSD commit 23397, by + way of Rin Okuyama. Fixes PR lib/50698. + [gson, ticket #1120] + +lib/libc/time/localtime.c 1.101 + + PR/50133: Martin Husemann: Can't cache $TZ. + [christos, ticket #1121] + +external/bsd/blacklist/lib/Makefile 1.4-1.5 +external/bsd/blacklist/lib/bl.c 1.27 +lib/Makefile 1.237 + + Move blacklistd later now that it depends on libpthread (From Rin + Okuyama), + Add a mutex to prevent races during initialization code from + multiple threads. + [christos, ticket #1123] + +sys/dev/usb/ugen.c1.127-1.130 + + Remove always true conditional. + Only clear the endpoint information in ugen_set_interface only + if setting the new altno suceeds. + [skrll, ticket #1124] + +libexec/ld.elf_so/headers.c up to 1.59 +libexec/ld.elf_so/map_object.c up to 1.53 +libexec/ld.elf_so/paths.c up to 1.42 +libexec/ld.elf_so/reloc.c up to 1.107 +libexec/ld.elf_so/rtld.c up to 1.177 +libexec/ld.elf_so/rtld.h up to 1.124 +libexec/ld.elf_so/arch/alpha/alpha_reloc.c up to 1.41 +libexec/ld.elf_so/arch/arm/mdreloc.c up to 1.38 +libexec/ld.elf_so/arch/hppa/hppa_reloc.c up to 1.43 +libexec/ld.elf_so/arch/i386/mdreloc.c up to 1.37 +libexec/ld.elf_so/arch/m68k/mdreloc.c up to 1.30 +libexec/ld.elf_so/arch/mips/mips_reloc.c up to 1.65 +libexec/ld.elf_so/arch/powerpc/ppc_reloc.c up to 1.53 +libexec/ld.elf_so/arch/sh3/mdreloc.c up to 1.31 +libexec/ld.elf_so/arch/sparc/mdreloc.c up to 1.48 +libexec/ld.elf_so/arch/sparc64/mdreloc.c up to 1.57 +libexec/ld.elf_so/arch/vax/mdreloc.c up to 1.30 +libexec/ld.elf_so/arch/x86_64/mdreloc.c up to 1.41 + + Replace casts in the inline version of _rtld_call_function_void of + _rtld_call_function_addr with ifdef on RTLD_LOADER. + Introduce a cast to fix the build for Elf32 on _LP64. + Add basic support for indirect functions. It allows providing a public + function symbol with an implementation choosen at run time. + Refactor calls to functions by address in ld.elf_so to create temporary + function descriptors on the stack, if the address is not leaked outside. + Fix membars around rtld internal mutex. + lib/49813: Release mutex on error. + HPPA hack for a problem where gdb doesn't see _rtld_debug_state when + it's a single bv,n %r0(%rp) instruction. +
CVS commit: [netbsd-7] src/bin/cp
Module Name:src Committed By: martin Date: Sun Mar 6 18:44:10 UTC 2016 Modified Files: src/bin/cp [netbsd-7]: cp.c Log Message: Pull up following revision(s) (requested by uwe in ticket #1131): bin/cp/cp.c: revision 1.59 The '-i' flag should work regardless of whether the standard input is a terminal. The Open Group notes this historic behavior and correctly notes that it doesn't make much sense. Note also, that mv(1) has always respected its '-i' regardless of whether the standard input is a terminal. >From Timo Buhrmester. To generate a diff of this commit: cvs rdiff -u -r1.58 -r1.58.20.1 src/bin/cp/cp.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/cp/cp.c diff -u src/bin/cp/cp.c:1.58 src/bin/cp/cp.c:1.58.20.1 --- src/bin/cp/cp.c:1.58 Wed Jan 4 15:58:37 2012 +++ src/bin/cp/cp.c Sun Mar 6 18:44:10 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $ */ +/* $NetBSD: cp.c,v 1.58.20.1 2016/03/06 18:44:10 martin Exp $ */ /* * Copyright (c) 1988, 1993, 1994 @@ -43,7 +43,7 @@ __COPYRIGHT( #if 0 static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95"; #else -__RCSID("$NetBSD: cp.c,v 1.58 2012/01/04 15:58:37 christos Exp $"); +__RCSID("$NetBSD: cp.c,v 1.58.20.1 2016/03/06 18:44:10 martin Exp $"); #endif #endif /* not lint */ @@ -145,7 +145,7 @@ main(int argc, char *argv[]) iflag = 0; break; case 'i': - iflag = isatty(fileno(stdin)); + iflag = 1; fflag = 0; break; case 'l':
CVS commit: [netbsd-7] src/bin/cp
Module Name:src Committed By: martin Date: Sun Mar 6 18:41:53 UTC 2016 Modified Files: src/bin/cp [netbsd-7]: utils.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1130): bin/cp/utils.c: revision 1.45 for display in the (post) SIGINFO handler use off_t not size_t for file sizes. fixes incorrect reporting errors on 32 bit platforms with >4GB file sizes. To generate a diff of this commit: cvs rdiff -u -r1.42.4.1 -r1.42.4.2 src/bin/cp/utils.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/cp/utils.c diff -u src/bin/cp/utils.c:1.42.4.1 src/bin/cp/utils.c:1.42.4.2 --- src/bin/cp/utils.c:1.42.4.1 Thu Mar 3 14:30:52 2016 +++ src/bin/cp/utils.c Sun Mar 6 18:41:53 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: utils.c,v 1.42.4.1 2016/03/03 14:30:52 martin Exp $ */ +/* $NetBSD: utils.c,v 1.42.4.2 2016/03/06 18:41:53 martin Exp $ */ /*- * Copyright (c) 1991, 1993, 1994 @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94"; #else -__RCSID("$NetBSD: utils.c,v 1.42.4.1 2016/03/03 14:30:52 martin Exp $"); +__RCSID("$NetBSD: utils.c,v 1.42.4.2 2016/03/06 18:41:53 martin Exp $"); #endif #endif /* not lint */ @@ -77,17 +77,18 @@ set_utimes(const char *file, struct stat struct finfo { const char *from; const char *to; - size_t size; + off_t size; }; static void -progress(const struct finfo *fi, size_t written) +progress(const struct finfo *fi, off_t written) { int pcent = (int)((100.0 * written) / fi->size); pinfo = 0; - (void)fprintf(stderr, "%s => %s %zu/%zu bytes %d%% written\n", - fi->from, fi->to, written, fi->size, pcent); + (void)fprintf(stderr, "%s => %s %llu/%llu bytes %d%% written\n", + fi->from, fi->to, (unsigned long long)written, + (unsigned long long)fi->size, pcent); } int @@ -97,7 +98,7 @@ copy_file(FTSENT *entp, int dne) struct stat to_stat, *fs; int ch, checkch, from_fd, rcount, rval, to_fd, tolnk, wcount; char *p; - size_t ptotal = 0; + off_t ptotal = 0; if ((from_fd = open(entp->fts_path, O_RDONLY, 0)) == -1) { warn("%s", entp->fts_path); @@ -184,7 +185,7 @@ copy_file(FTSENT *entp, int dne) fi.from = entp->fts_path; fi.to = to.p_path; - fi.size = (size_t)fs->st_size; + fi.size = fs->st_size; /* * Mmap and write if less than 8M (the limit is so
CVS commit: [netbsd-7] src/bin/mv
Module Name:src Committed By: martin Date: Sun Mar 6 18:40:09 UTC 2016 Modified Files: src/bin/mv [netbsd-7]: mv.c Log Message: Pull up following revision(s) (requested by mrg in ticket #1129): bin/mv/mv.c: revision 1.45 add SIGINFO for mv(1), largely based upon the support in cp(1). To generate a diff of this commit: cvs rdiff -u -r1.43.22.1 -r1.43.22.2 src/bin/mv/mv.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/bin/mv/mv.c diff -u src/bin/mv/mv.c:1.43.22.1 src/bin/mv/mv.c:1.43.22.2 --- src/bin/mv/mv.c:1.43.22.1 Fri Mar 4 21:25:36 2016 +++ src/bin/mv/mv.c Sun Mar 6 18:40:09 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: mv.c,v 1.43.22.1 2016/03/04 21:25:36 martin Exp $ */ +/* $NetBSD: mv.c,v 1.43.22.2 2016/03/06 18:40:09 martin Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 19 #if 0 static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94"; #else -__RCSID("$NetBSD: mv.c,v 1.43.22.1 2016/03/04 21:25:36 martin Exp $"); +__RCSID("$NetBSD: mv.c,v 1.43.22.2 2016/03/06 18:40:09 martin Exp $"); #endif #endif /* not lint */ @@ -67,12 +67,20 @@ __RCSID("$NetBSD: mv.c,v 1.43.22.1 2016/ static int fflg, iflg, vflg; static int stdin_ok; +static sig_atomic_t pinfo; static int copy(char *, char *); static int do_move(char *, char *); static int fastcopy(char *, char *, struct stat *); __dead static void usage(void); +static void +progress(int sig __unused) +{ + + pinfo++; +} + int main(int argc, char *argv[]) { @@ -109,6 +117,8 @@ main(int argc, char *argv[]) stdin_ok = isatty(STDIN_FILENO); + (void)signal(SIGINFO, progress); + /* * If the stat on the target fails or the target isn't a directory, * try the move. More than 2 arguments is an error in this case. @@ -262,7 +272,9 @@ fastcopy(char *from, char *to, struct st #endif static blksize_t blen; static char *bp; - int nread, from_fd, to_fd; + int from_fd, to_fd; + ssize_t nread; + off_t total = 0; if ((from_fd = open(from, O_RDONLY, 0)) < 0) { warn("%s", from); @@ -281,11 +293,21 @@ fastcopy(char *from, char *to, struct st (void)close(to_fd); return (1); } - while ((nread = read(from_fd, bp, blen)) > 0) + while ((nread = read(from_fd, bp, blen)) > 0) { if (write(to_fd, bp, nread) != nread) { warn("%s", to); goto err; } + total += nread; + if (pinfo) { + int pcent = (int)((100.0 * total) / sbp->st_size); + + pinfo = 0; + (void)fprintf(stderr, "%s => %s %llu/%llu bytes %d%% " + "written\n", from, to, (unsigned long long)total, + (unsigned long long)sbp->st_size, pcent); + } + } if (nread < 0) { warn("%s", from); err: if (unlink(to))
CVS commit: [netbsd-7] src/libexec/ld.elf_so
Module Name:src Committed By: martin Date: Sun Mar 6 18:17:56 UTC 2016 Modified Files: src/libexec/ld.elf_so [netbsd-7]: headers.c map_object.c paths.c reloc.c rtld.c rtld.h src/libexec/ld.elf_so/arch/aarch64 [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/alpha [netbsd-7]: alpha_reloc.c src/libexec/ld.elf_so/arch/arm [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/hppa [netbsd-7]: hppa_reloc.c src/libexec/ld.elf_so/arch/i386 [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/m68k [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/mips [netbsd-7]: mips_reloc.c src/libexec/ld.elf_so/arch/powerpc [netbsd-7]: ppc_reloc.c src/libexec/ld.elf_so/arch/sh3 [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/sparc [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/sparc64 [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/vax [netbsd-7]: mdreloc.c src/libexec/ld.elf_so/arch/x86_64 [netbsd-7]: mdreloc.c Log Message: Catch up to -current, via patch, requested by christos in ticket #1126: To generate a diff of this commit: cvs rdiff -u -r1.54 -r1.54.4.1 src/libexec/ld.elf_so/headers.c cvs rdiff -u -r1.52 -r1.52.4.1 src/libexec/ld.elf_so/map_object.c cvs rdiff -u -r1.41 -r1.41.6.1 src/libexec/ld.elf_so/paths.c cvs rdiff -u -r1.106 -r1.106.18.1 src/libexec/ld.elf_so/reloc.c cvs rdiff -u -r1.173.4.2 -r1.173.4.3 src/libexec/ld.elf_so/rtld.c cvs rdiff -u -r1.118 -r1.118.2.1 src/libexec/ld.elf_so/rtld.h cvs rdiff -u -r1.1 -r1.1.2.1 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c cvs rdiff -u -r1.40 -r1.40.22.1 \ src/libexec/ld.elf_so/arch/alpha/alpha_reloc.c cvs rdiff -u -r1.37 -r1.37.18.1 src/libexec/ld.elf_so/arch/arm/mdreloc.c cvs rdiff -u -r1.42 -r1.42.18.1 src/libexec/ld.elf_so/arch/hppa/hppa_reloc.c cvs rdiff -u -r1.35 -r1.35.8.1 src/libexec/ld.elf_so/arch/i386/mdreloc.c cvs rdiff -u -r1.29 -r1.29.18.1 src/libexec/ld.elf_so/arch/m68k/mdreloc.c cvs rdiff -u -r1.62 -r1.62.22.1 src/libexec/ld.elf_so/arch/mips/mips_reloc.c cvs rdiff -u -r1.52 -r1.52.2.1 src/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c cvs rdiff -u -r1.30 -r1.30.22.1 src/libexec/ld.elf_so/arch/sh3/mdreloc.c cvs rdiff -u -r1.47 -r1.47.22.1 src/libexec/ld.elf_so/arch/sparc/mdreloc.c cvs rdiff -u -r1.56 -r1.56.4.1 src/libexec/ld.elf_so/arch/sparc64/mdreloc.c cvs rdiff -u -r1.29 -r1.29.4.1 src/libexec/ld.elf_so/arch/vax/mdreloc.c cvs rdiff -u -r1.40 -r1.40.22.1 src/libexec/ld.elf_so/arch/x86_64/mdreloc.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/libexec/ld.elf_so/headers.c diff -u src/libexec/ld.elf_so/headers.c:1.54 src/libexec/ld.elf_so/headers.c:1.54.4.1 --- src/libexec/ld.elf_so/headers.c:1.54 Fri Mar 7 01:27:14 2014 +++ src/libexec/ld.elf_so/headers.c Sun Mar 6 18:17:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: headers.c,v 1.54 2014/03/07 01:27:14 matt Exp $ */ +/* $NetBSD: headers.c,v 1.54.4.1 2016/03/06 18:17:55 martin Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include #ifndef lint -__RCSID("$NetBSD: headers.c,v 1.54 2014/03/07 01:27:14 matt Exp $"); +__RCSID("$NetBSD: headers.c,v 1.54.4.1 2016/03/06 18:17:55 martin Exp $"); #endif /* not lint */ #include @@ -74,7 +74,9 @@ _rtld_digest_dynamic(const char *execnam bool use_pltrela = false; Elf_Addrrelsz = 0, relasz = 0; Elf_Addr pltrel = 0, pltrelsz = 0; +#ifdef RTLD_LOADER Elf_Addr init = 0, fini = 0; +#endif dbg(("headers: digesting PT_DYNAMIC at %p", obj->dynamic)); for (dynp = obj->dynamic; dynp->d_tag != DT_NULL; ++dynp) { @@ -227,13 +229,15 @@ _rtld_digest_dynamic(const char *execnam break; case DT_INIT: +#ifdef RTLD_LOADER init = dynp->d_un.d_ptr; +#endif break; #ifdef HAVE_INITFINI_ARRAY case DT_INIT_ARRAY: obj->init_array = - (fptr_t *)(obj->relocbase + dynp->d_un.d_ptr); + (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr); dbg(("headers: DT_INIT_ARRAY at %p", obj->init_array)); break; @@ -246,13 +250,15 @@ _rtld_digest_dynamic(const char *execnam #endif case DT_FINI: +#ifdef RTLD_LOADER fini = dynp->d_un.d_ptr; +#endif break; #ifdef HAVE_INITFINI_ARRAY case DT_FINI_ARRAY: obj->fini_array = - (fptr_t *)(obj->relocbase + dynp->d_un.d_ptr); + (Elf_Addr *)(obj->relocbase + dynp->d_un.d_ptr); dbg(("headers: DT_FINI_ARRAY at %p", obj->fini_array)); break; @@ -345,20 +351,11 @@ _rtld_digest_dynamic(const char *execnam obj->relalim = obj->pltrela; } -#if defined(RTLD_LOADER) && defined(__HAVE_FUNCTION_DESCRIPTORS) - if (init != 0) - obj->init = (void (*)(void)) - _rtld_function_descriptor_alloc(obj, NULL, init); - if (fini != 0) - obj->fini = (void (*)(void)) - _rtld_function_descriptor_alloc(obj, NULL, fini); -#else +#ifdef RTLD_LOADER if (init != 0) - obj->init = (void (*)(void)) -
CVS commit: [netbsd-7-0] src/doc
Module Name:src Committed By: martin Date: Sun Mar 6 18:11:41 UTC 2016 Modified Files: src/doc [netbsd-7-0]: CHANGES-7.0.1 Log Message: Note ticket #1124 To generate a diff of this commit: cvs rdiff -u -r1.1.2.38 -r1.1.2.39 src/doc/CHANGES-7.0.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/CHANGES-7.0.1 diff -u src/doc/CHANGES-7.0.1:1.1.2.38 src/doc/CHANGES-7.0.1:1.1.2.39 --- src/doc/CHANGES-7.0.1:1.1.2.38 Thu Mar 3 15:44:19 2016 +++ src/doc/CHANGES-7.0.1 Sun Mar 6 18:11:41 2016 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-7.0.1,v 1.1.2.38 2016/03/03 15:44:19 martin Exp $ +# $NetBSD: CHANGES-7.0.1,v 1.1.2.39 2016/03/06 18:11:41 martin Exp $ A complete list of changes from the NetBSD 7.0 release to the NetBSD 7.0.1 release: @@ -1027,3 +1027,10 @@ sys/kern/kern_time.c1.184 Don't leak garabage from the kernel stack on sleep(0) and equivalents. [uwe, ticket #1128] +sys/dev/usb/ugen.c1.127-1.130 + + Remove always true conditional. + Only clear the endpoint information in ugen_set_interface only + if setting the new altno suceeds. + [skrll, ticket #1124] +
CVS commit: [netbsd-7-0] src/sys/dev/usb
Module Name:src Committed By: martin Date: Sun Mar 6 18:10:20 UTC 2016 Modified Files: src/sys/dev/usb [netbsd-7-0]: ugen.c Log Message: Pull up following revision(s) (requested by skrll in ticket #1124): sys/dev/usb/ugen.c: revision 1.127 sys/dev/usb/ugen.c: revision 1.128 sys/dev/usb/ugen.c: revision 1.129 sys/dev/usb/ugen.c: revision 1.130 s/0/NULL/ One more s/0/NULL/ Remove always true conditional Only clear the endpoint information in ugen_set_interface only if setting the new altno suceeds. Avoids the null de-ref in PR/50597 and PR/50810 To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.124.4.1 src/sys/dev/usb/ugen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ugen.c diff -u src/sys/dev/usb/ugen.c:1.124 src/sys/dev/usb/ugen.c:1.124.4.1 --- src/sys/dev/usb/ugen.c:1.124 Fri Jul 25 08:10:39 2014 +++ src/sys/dev/usb/ugen.c Sun Mar 6 18:10:20 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ugen.c,v 1.124 2014/07/25 08:10:39 dholland Exp $ */ +/* $NetBSD: ugen.c,v 1.124.4.1 2016/03/06 18:10:20 martin Exp $ */ /* * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.124 2014/07/25 08:10:39 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.124.4.1 2016/03/06 18:10:20 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -267,6 +267,19 @@ ugen_attach(device_t parent, device_t se return; } +Static void +ugen_clear_endpoints(struct ugen_softc *sc) +{ + + /* Clear out the old info, but leave the selinfo and cv initialised. */ + for (int i = 0; i < USB_MAX_ENDPOINTS; i++) { + for (int dir = OUT; dir <= IN; dir++) { + struct ugen_endpoint *sce = >sc_endpoints[i][dir]; + memset(sce, 0, UGEN_ENDPOINT_NONZERO_CRUFT); + } + } +} + Static int ugen_set_config(struct ugen_softc *sc, int configno) { @@ -278,7 +291,7 @@ ugen_set_config(struct ugen_softc *sc, i u_int8_t niface, nendpt; int ifaceno, endptno, endpt; usbd_status err; - int dir, i; + int dir; DPRINTFN(1,("ugen_set_config: %s to configno %d, sc=%p\n", device_xname(sc->sc_dev), configno, sc)); @@ -307,13 +320,7 @@ ugen_set_config(struct ugen_softc *sc, i if (err) return (err); - /* Clear out the old info, but leave the selinfo and cv initialised. */ - for (i = 0; i < USB_MAX_ENDPOINTS; i++) { - for (dir = OUT; dir <= IN; dir++) { - sce = >sc_endpoints[i][dir]; - memset(sce, 0, UGEN_ENDPOINT_NONZERO_CRUFT); - } - } + ugen_clear_endpoints(sc); for (ifaceno = 0; ifaceno < niface; ifaceno++) { DPRINTFN(1,("ugen_set_config: ifaceno %d\n", ifaceno)); @@ -378,7 +385,7 @@ ugenopen(dev_t dev, int flag, int mode, for (dir = OUT; dir <= IN; dir++) { if (flag & (dir == OUT ? FWRITE : FREAD)) { sce = >sc_endpoints[endpt][dir]; - if (sce == 0 || sce->edesc == 0) + if (sce->edesc == NULL) return (ENXIO); } } @@ -532,7 +539,7 @@ ugenclose(dev_t dev, int flag, int mode, if (!(flag & (dir == OUT ? FWRITE : FREAD))) continue; sce = >sc_endpoints[endpt][dir]; - if (sce == NULL || sce->pipeh == NULL) + if (sce->pipeh == NULL) continue; DPRINTFN(5, ("ugenclose: endpt=%d dir=%d sce=%p\n", endpt, dir, sce)); @@ -1032,7 +1039,7 @@ ugen_detach(device_t self, int flags) for (i = 0; i < USB_MAX_ENDPOINTS; i++) { for (dir = OUT; dir <= IN; dir++) { sce = >sc_endpoints[i][dir]; - if (sce && sce->pipeh) + if (sce->pipeh) usbd_abort_pipe(sce->pipeh); } } @@ -1333,16 +1340,6 @@ ugen_set_interface(struct ugen_softc *sc err = usbd_endpoint_count(iface, ); if (err) return (err); - /* XXX should only do this after setting new altno has succeeded */ - for (endptno = 0; endptno < nendpt; endptno++) { - ed = usbd_interface2endpoint_descriptor(iface,endptno); - endpt = ed->bEndpointAddress; - dir = UE_GET_DIR(endpt) == UE_DIR_IN ? IN : OUT; - sce = >sc_endpoints[UE_GET_ADDR(endpt)][dir]; - sce->sc = 0; - sce->edesc = 0; - sce->iface = 0; - } /* change setting */ err = usbd_set_interface(iface, altno); @@ -1352,6 +1349,9 @@ ugen_set_interface(struct ugen_softc *sc err = usbd_endpoint_count(iface, ); if (err) return (err); + + ugen_clear_endpoints(sc); + for (endptno = 0; endptno < nendpt; endptno++) { ed = usbd_interface2endpoint_descriptor(iface,endptno); KASSERT(ed != NULL);
CVS commit: [netbsd-7] src/sys/dev/usb
Module Name:src Committed By: martin Date: Sun Mar 6 18:08:04 UTC 2016 Modified Files: src/sys/dev/usb [netbsd-7]: ugen.c Log Message: Pull up following revision(s) (requested by skrll in ticket #1124): sys/dev/usb/ugen.c: revision 1.127 sys/dev/usb/ugen.c: revision 1.128 sys/dev/usb/ugen.c: revision 1.129 sys/dev/usb/ugen.c: revision 1.130 s/0/NULL/ One more s/0/NULL/ Remove always true conditional Only clear the endpoint information in ugen_set_interface only if setting the new altno suceeds. Avoids the null de-ref in PR/50597 and PR/50810 To generate a diff of this commit: cvs rdiff -u -r1.124 -r1.124.2.1 src/sys/dev/usb/ugen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/ugen.c diff -u src/sys/dev/usb/ugen.c:1.124 src/sys/dev/usb/ugen.c:1.124.2.1 --- src/sys/dev/usb/ugen.c:1.124 Fri Jul 25 08:10:39 2014 +++ src/sys/dev/usb/ugen.c Sun Mar 6 18:08:04 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: ugen.c,v 1.124 2014/07/25 08:10:39 dholland Exp $ */ +/* $NetBSD: ugen.c,v 1.124.2.1 2016/03/06 18:08:04 martin Exp $ */ /* * Copyright (c) 1998, 2004 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include -__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.124 2014/07/25 08:10:39 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ugen.c,v 1.124.2.1 2016/03/06 18:08:04 martin Exp $"); #ifdef _KERNEL_OPT #include "opt_compat_netbsd.h" @@ -267,6 +267,19 @@ ugen_attach(device_t parent, device_t se return; } +Static void +ugen_clear_endpoints(struct ugen_softc *sc) +{ + + /* Clear out the old info, but leave the selinfo and cv initialised. */ + for (int i = 0; i < USB_MAX_ENDPOINTS; i++) { + for (int dir = OUT; dir <= IN; dir++) { + struct ugen_endpoint *sce = >sc_endpoints[i][dir]; + memset(sce, 0, UGEN_ENDPOINT_NONZERO_CRUFT); + } + } +} + Static int ugen_set_config(struct ugen_softc *sc, int configno) { @@ -278,7 +291,7 @@ ugen_set_config(struct ugen_softc *sc, i u_int8_t niface, nendpt; int ifaceno, endptno, endpt; usbd_status err; - int dir, i; + int dir; DPRINTFN(1,("ugen_set_config: %s to configno %d, sc=%p\n", device_xname(sc->sc_dev), configno, sc)); @@ -307,13 +320,7 @@ ugen_set_config(struct ugen_softc *sc, i if (err) return (err); - /* Clear out the old info, but leave the selinfo and cv initialised. */ - for (i = 0; i < USB_MAX_ENDPOINTS; i++) { - for (dir = OUT; dir <= IN; dir++) { - sce = >sc_endpoints[i][dir]; - memset(sce, 0, UGEN_ENDPOINT_NONZERO_CRUFT); - } - } + ugen_clear_endpoints(sc); for (ifaceno = 0; ifaceno < niface; ifaceno++) { DPRINTFN(1,("ugen_set_config: ifaceno %d\n", ifaceno)); @@ -378,7 +385,7 @@ ugenopen(dev_t dev, int flag, int mode, for (dir = OUT; dir <= IN; dir++) { if (flag & (dir == OUT ? FWRITE : FREAD)) { sce = >sc_endpoints[endpt][dir]; - if (sce == 0 || sce->edesc == 0) + if (sce->edesc == NULL) return (ENXIO); } } @@ -532,7 +539,7 @@ ugenclose(dev_t dev, int flag, int mode, if (!(flag & (dir == OUT ? FWRITE : FREAD))) continue; sce = >sc_endpoints[endpt][dir]; - if (sce == NULL || sce->pipeh == NULL) + if (sce->pipeh == NULL) continue; DPRINTFN(5, ("ugenclose: endpt=%d dir=%d sce=%p\n", endpt, dir, sce)); @@ -1032,7 +1039,7 @@ ugen_detach(device_t self, int flags) for (i = 0; i < USB_MAX_ENDPOINTS; i++) { for (dir = OUT; dir <= IN; dir++) { sce = >sc_endpoints[i][dir]; - if (sce && sce->pipeh) + if (sce->pipeh) usbd_abort_pipe(sce->pipeh); } } @@ -1333,16 +1340,6 @@ ugen_set_interface(struct ugen_softc *sc err = usbd_endpoint_count(iface, ); if (err) return (err); - /* XXX should only do this after setting new altno has succeeded */ - for (endptno = 0; endptno < nendpt; endptno++) { - ed = usbd_interface2endpoint_descriptor(iface,endptno); - endpt = ed->bEndpointAddress; - dir = UE_GET_DIR(endpt) == UE_DIR_IN ? IN : OUT; - sce = >sc_endpoints[UE_GET_ADDR(endpt)][dir]; - sce->sc = 0; - sce->edesc = 0; - sce->iface = 0; - } /* change setting */ err = usbd_set_interface(iface, altno); @@ -1352,6 +1349,9 @@ ugen_set_interface(struct ugen_softc *sc err = usbd_endpoint_count(iface, ); if (err) return (err); + + ugen_clear_endpoints(sc); + for (endptno = 0; endptno < nendpt; endptno++) { ed = usbd_interface2endpoint_descriptor(iface,endptno); KASSERT(ed != NULL);
CVS commit: [netbsd-7] src
Module Name:src Committed By: martin Date: Sun Mar 6 18:05:09 UTC 2016 Modified Files: src/external/bsd/blacklist/lib [netbsd-7]: Makefile bl.c src/lib [netbsd-7]: Makefile Log Message: Pull up following revision(s) (requested by christos in ticket #1123): external/bsd/blacklist/lib/bl.c: revision 1.27 lib/Makefile: revision 1.237 external/bsd/blacklist/lib/Makefile: revision 1.4 external/bsd/blacklist/lib/Makefile: revision 1.5 Move blacklistd later now that it depends on libpthread (From Rin Okuyama) typo Add a mutex to prevent races during initialization code from multiple threads. Found in named. To generate a diff of this commit: cvs rdiff -u -r1.3.2.2 -r1.3.2.3 src/external/bsd/blacklist/lib/Makefile cvs rdiff -u -r1.24.2.3 -r1.24.2.4 src/external/bsd/blacklist/lib/bl.c cvs rdiff -u -r1.215.2.2 -r1.215.2.3 src/lib/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/bsd/blacklist/lib/Makefile diff -u src/external/bsd/blacklist/lib/Makefile:1.3.2.2 src/external/bsd/blacklist/lib/Makefile:1.3.2.3 --- src/external/bsd/blacklist/lib/Makefile:1.3.2.2 Thu Apr 30 06:07:34 2015 +++ src/external/bsd/blacklist/lib/Makefile Sun Mar 6 18:05:08 2016 @@ -1,7 +1,10 @@ -# $NetBSD: Makefile,v 1.3.2.2 2015/04/30 06:07:34 riz Exp $ +# $NetBSD: Makefile,v 1.3.2.3 2016/03/06 18:05:08 martin Exp $ USE_SHLIBDIR= yes +CPPFLAGS+=-D_REENTRANT +DPADD+=${LIBPTHREAD} +LDADD+=-lpthread LIB=blacklist SRCS=bl.c blacklist.c MAN=libblacklist.3 Index: src/external/bsd/blacklist/lib/bl.c diff -u src/external/bsd/blacklist/lib/bl.c:1.24.2.3 src/external/bsd/blacklist/lib/bl.c:1.24.2.4 --- src/external/bsd/blacklist/lib/bl.c:1.24.2.3 Tue Jun 2 20:32:44 2015 +++ src/external/bsd/blacklist/lib/bl.c Sun Mar 6 18:05:08 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: bl.c,v 1.24.2.3 2015/06/02 20:32:44 snj Exp $ */ +/* $NetBSD: bl.c,v 1.24.2.4 2016/03/06 18:05:08 martin Exp $ */ /*- * Copyright (c) 2014 The NetBSD Foundation, Inc. @@ -33,7 +33,7 @@ #endif #include -__RCSID("$NetBSD: bl.c,v 1.24.2.3 2015/06/02 20:32:44 snj Exp $"); +__RCSID("$NetBSD: bl.c,v 1.24.2.4 2016/03/06 18:05:08 martin Exp $"); #include #include @@ -53,6 +53,9 @@ __RCSID("$NetBSD: bl.c,v 1.24.2.3 2015/0 #include #include #include +#ifdef _REENTRANT +#include +#endif #include "bl.h" @@ -66,6 +69,16 @@ typedef struct { } bl_message_t; struct blacklist { +#ifdef _REENTRANT + pthread_mutex_t b_mutex; +# define BL_INIT(b) pthread_mutex_init(>b_mutex, NULL) +# define BL_LOCK(b) pthread_mutex_lock(>b_mutex) +# define BL_UNLOCK(b) pthread_mutex_unlock(>b_mutex) +#else +# define BL_INIT(b) do {} while(/*CONSTCOND*/0) +# define BL_LOCK(b) BL_INIT(b) +# define BL_UNLOCK(b) BL_INIT(b) +#endif int b_fd; int b_connected; struct sockaddr_un b_sun; @@ -88,13 +101,17 @@ bl_getfd(bl_t b) } static void -bl_reset(bl_t b) +bl_reset(bl_t b, bool locked) { int serrno = errno; + if (!locked) + BL_LOCK(b); close(b->b_fd); errno = serrno; b->b_fd = -1; b->b_connected = -1; + if (!locked) + BL_UNLOCK(b); } static void @@ -129,12 +146,15 @@ bl_init(bl_t b, bool srv) #define SOCK_NOSIGPIPE 0 #endif + BL_LOCK(b); + if (b->b_fd == -1) { b->b_fd = socket(PF_LOCAL, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK|SOCK_NOSIGPIPE, 0); if (b->b_fd == -1) { bl_log(b->b_fun, LOG_ERR, "%s: socket failed (%m)", __func__); + BL_UNLOCK(b); return -1; } #if SOCK_CLOEXEC == 0 @@ -153,9 +173,16 @@ bl_init(bl_t b, bool srv) #endif } - if (bl_isconnected(b)) + if (bl_isconnected(b)) { + BL_UNLOCK(b); return 0; + } + /* + * We try to connect anyway even when we are a server to verify + * that no other server is listening to the socket. If we succeed + * to connect and we are a server, someone else owns it. + */ rv = connect(b->b_fd, (const void *)sun, (socklen_t)sizeof(*sun)); if (rv == 0) { if (srv) { @@ -177,6 +204,7 @@ bl_init(bl_t b, bool srv) __func__, sun->sun_path); b->b_connected = 1; } + BL_UNLOCK(b); return -1; } bl_log(b->b_fun, LOG_DEBUG, "Connected to blacklist server", @@ -237,9 +265,11 @@ bl_init(bl_t b, bool srv) } #endif + BL_UNLOCK(b); return 0; out: - bl_reset(b); + bl_reset(b, true); + BL_UNLOCK(b); return -1; } @@ -252,6 +282,7 @@ bl_create(bool srv, const char *path, vo b->b_fun = fun == NULL ? vsyslog : fun; b->b_fd = -1; b->b_connected = -1; + BL_INIT(b); memset(>b_sun, 0, sizeof(b->b_sun)); b->b_sun.sun_family = AF_LOCAL; @@ -272,7 +303,7 @@ out: void bl_destroy(bl_t b) { - bl_reset(b); + bl_reset(b, false); free(b); } @@ -377,7 +408,7 @@ again: return -1; if ((sendmsg(b->b_fd, , 0) == -1) && tried++ < NTRIES) { - bl_reset(b); + bl_reset(b, false); goto again; } return tried >= NTRIES ? -1 : 0; Index: src/lib/Makefile diff -u
CVS commit: src/usr.bin/vmstat
Module Name:src Committed By: christos Date: Sun Mar 6 18:01:28 UTC 2016 Modified Files: src/usr.bin/vmstat: Makefile Log Message: Work around gcc on sparc64 bug To generate a diff of this commit: cvs rdiff -u -r1.32 -r1.33 src/usr.bin/vmstat/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/vmstat/Makefile diff -u src/usr.bin/vmstat/Makefile:1.32 src/usr.bin/vmstat/Makefile:1.33 --- src/usr.bin/vmstat/Makefile:1.32 Tue Jun 3 17:41:56 2014 +++ src/usr.bin/vmstat/Makefile Sun Mar 6 13:01:28 2016 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.32 2014/06/03 21:41:56 joerg Exp $ +# $NetBSD: Makefile,v 1.33 2016/03/06 18:01:28 christos Exp $ # @(#)Makefile 8.1 (Berkeley) 6/6/93 .include @@ -16,4 +16,7 @@ BINMODE=2555 CWARNFLAGS.clang+= -Wno-format-extra-args COPTS.vmstat.c += -Wno-format-nonliteral +# sparc64 is broken! +COPTS.vmstat.c += -Wno-error=stack-protector + .include
CVS commit: [netbsd-7] src/lib/libc/time
Module Name:src Committed By: martin Date: Sun Mar 6 18:01:48 UTC 2016 Modified Files: src/lib/libc/time [netbsd-7]: localtime.c Log Message: Pull up following revision(s) (requested by christos in ticket #1121): lib/libc/time/localtime.c: revision 1.101 PR/50133: Martin Husemann: Can't cache $TZ. XXX: Pullup-7 To generate a diff of this commit: cvs rdiff -u -r1.82.2.1 -r1.82.2.2 src/lib/libc/time/localtime.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/time/localtime.c diff -u src/lib/libc/time/localtime.c:1.82.2.1 src/lib/libc/time/localtime.c:1.82.2.2 --- src/lib/libc/time/localtime.c:1.82.2.1 Sun Jan 25 09:11:03 2015 +++ src/lib/libc/time/localtime.c Sun Mar 6 18:01:48 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: localtime.c,v 1.82.2.1 2015/01/25 09:11:03 martin Exp $ */ +/* $NetBSD: localtime.c,v 1.82.2.2 2016/03/06 18:01:48 martin Exp $ */ /* ** This file is in the public domain, so clarified as of @@ -10,7 +10,7 @@ #if 0 static char elsieid[] = "@(#)localtime.c 8.17"; #else -__RCSID("$NetBSD: localtime.c,v 1.82.2.1 2015/01/25 09:11:03 martin Exp $"); +__RCSID("$NetBSD: localtime.c,v 1.82.2.2 2016/03/06 18:01:48 martin Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -1476,7 +1476,7 @@ localtime(const time_t *const timep) struct tm * localtime_r(const time_t * __restrict timep, struct tm *tmp) { - return localtime_tzset(timep, tmp, false); + return localtime_tzset(timep, tmp, true); } /*
CVS commit: [netbsd-7] src/lib/libm/src
Module Name:src Committed By: martin Date: Sun Mar 6 18:00:08 UTC 2016 Modified Files: src/lib/libm/src [netbsd-7]: e_hypotf.c Log Message: Pull up following revision(s) (requested by gson in ticket #1120): lib/libm/src/e_hypotf.c: revision 1.10 Fix incorrect magic numbers in scaling. From FreeBSD commit 23397, by way of Rin Okuyama. Fixes PR lib/50698. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.9.40.1 src/lib/libm/src/e_hypotf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libm/src/e_hypotf.c diff -u src/lib/libm/src/e_hypotf.c:1.9 src/lib/libm/src/e_hypotf.c:1.9.40.1 --- src/lib/libm/src/e_hypotf.c:1.9 Fri Apr 25 22:21:53 2008 +++ src/lib/libm/src/e_hypotf.c Sun Mar 6 18:00:07 2016 @@ -15,7 +15,7 @@ #include #if defined(LIBM_SCCS) && !defined(lint) -__RCSID("$NetBSD: e_hypotf.c,v 1.9 2008/04/25 22:21:53 christos Exp $"); +__RCSID("$NetBSD: e_hypotf.c,v 1.9.40.1 2016/03/06 18:00:07 martin Exp $"); #endif #include "math.h" @@ -43,22 +43,22 @@ __ieee754_hypotf(float x, float y) if(hb == 0x7f80) w = b; return w; } - /* scale a and b by 2**-60 */ - ha -= 0x5d80; hb -= 0x5d80; k += 60; + /* scale a and b by 2**-68 */ + ha -= 0x2200; hb -= 0x2200; k += 68; SET_FLOAT_WORD(a,ha); SET_FLOAT_WORD(b,hb); } if(hb < 0x2680) { /* b < 2**-50 */ if(hb <= 0x007f) { /* subnormal b or 0 */ if(hb==0) return a; - SET_FLOAT_WORD(t1,0x3f00); /* t1=2^126 */ + SET_FLOAT_WORD(t1,0x7e80); /* t1=2^126 */ b *= t1; a *= t1; k -= 126; - } else { /* scale a and b by 2^60 */ - ha += 0x5d80; /* a *= 2^60 */ - hb += 0x5d80; /* b *= 2^60 */ - k -= 60; + } else { /* scale a and b by 2^68 */ + ha += 0x2200; /* a *= 2^68 */ + hb += 0x2200; /* b *= 2^68 */ + k -= 68; SET_FLOAT_WORD(a,ha); SET_FLOAT_WORD(b,hb); }
CVS commit: [netbsd-7] src/sys/arch/x86/x86
Module Name:src Committed By: martin Date: Sun Mar 6 17:58:22 UTC 2016 Modified Files: src/sys/arch/x86/x86 [netbsd-7]: procfs_machdep.c Log Message: Pull up the following revisions, requested by msaitoh in ticket #1119: sys/arch/x86/x86/procfs_machdep.c 1.7-1.11 x86's /proc/cpuinfo fixes: - Always output 2 digits for the cpu frequency decimal part. - Update x86's feature bits in /proc/cpuinfo (PR#49246). - Fix a bug that /proc/cpuinfo's CPU model was incorrect on many newer CPUs and CPU family was incorrect on some AMD CPUs. - Add comment. Fix comment. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.6.4.1 src/sys/arch/x86/x86/procfs_machdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/x86/procfs_machdep.c diff -u src/sys/arch/x86/x86/procfs_machdep.c:1.6 src/sys/arch/x86/x86/procfs_machdep.c:1.6.4.1 --- src/sys/arch/x86/x86/procfs_machdep.c:1.6 Sat Apr 5 18:43:09 2014 +++ src/sys/arch/x86/x86/procfs_machdep.c Sun Mar 6 17:58:22 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:43:09 christos Exp $ */ +/* $NetBSD: procfs_machdep.c,v 1.6.4.1 2016/03/06 17:58:22 martin Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -42,7 +42,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6 2014/04/05 18:43:09 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: procfs_machdep.c,v 1.6.4.1 2016/03/06 17:58:22 martin Exp $"); #include #include @@ -56,50 +56,97 @@ __KERNEL_RCSID(0, "$NetBSD: procfs_machd #include #include -static const char * const x86_features[] = { - /* Intel-defined */ +/* + * The feature table. The order is the same as Linux's + * x86/include/asm/cpufeatures.h. + */ +static const char * const x86_features[][32] = { + { /* (0) Common */ "fpu", "vme", "de", "pse", "tsc", "msr", "pae", "mce", "cx8", "apic", NULL, "sep", "mtrr", "pge", "mca", "cmov", "pat", "pse36", "pn", "clflush", NULL, "dts", "acpi", "mmx", - "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", NULL, -#ifdef __x86_64__ - /* AMD-defined */ - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, "nx", NULL, "mmxext", NULL, - NULL, "fxsr_opt", "rdtscp", NULL, NULL, "lm", "3dnowext", "3dnow", - - /* Transmeta-defined */ - "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - - /* Linux-defined */ - "cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL, - "constant_tsc", NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - - /* Intel-defined */ - "pni", NULL, NULL, "monitor", "ds_cpi", "vmx", NULL, "est", - "tm2", NULL, "cid", NULL, NULL, "cx16", "xtpr", NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - - /* VIA/Cyrix/Centaur-defined */ - NULL, NULL, "rng", "rng_en", NULL, NULL, "ace", "ace_en", - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - - /* AMD defined */ - "lahf_lm", "cmp_legacy", "svm", NULL, "cr8_legacy", NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -#endif + "fxsr", "sse", "sse2", "ss", "ht", "tm", "ia64", "pbe"}, + + { /* (1) AMD-defined: 8001 edx */ + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, "syscall", NULL, NULL, NULL, NULL, + NULL, NULL, NULL, "mp", "nx", NULL, "mmxext", NULL, + NULL, "fxsr_opt", "pdpe1gb", "rdtscp", NULL, "lm", "3dnowext","3dnow"}, + + { /* (2) Transmeta-defined */ + "recovery", "longrun", NULL, "lrti", NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, + + { /* (3) Linux mapping */ + "cxmmx", NULL, "cyrix_arr", "centaur_mcr", NULL, + "constant_tsc", NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}, + + { /* (4) Intel-defined: 8001 ecx */ + "pni", "pclmulqdq", "dtes64", "monitor", "ds_cpl", "vmx", "smx", "est", + "tm2", "ssse3", "cid", "sdbg", "fma", "cx16", "xtpr", "pdcm", + NULL, "pcid", "dca", "sse4_1", "sse4_2", "x2apic", "movbe", "popcnt", + "tsc_deadline_timer", "aes", "xsave", NULL, + "avx", "f16c", "rdrand", "hypervisor"}, + + { /* (5) VIA/Cyrix/Centaur-defined */ + NULL, NULL, "rng", "rng_en", NULL, NULL, "ace", "ace_en", + NULL, NULL, NULL, NULL, NULL, NULL,
CVS commit: [netbsd-7] src/sys/arch/x86
Module Name:src Committed By: martin Date: Sun Mar 6 17:53:27 UTC 2016 Modified Files: src/sys/arch/x86/include [netbsd-7]: cpu.h cpuvar.h src/sys/arch/x86/x86 [netbsd-7]: cpu.c identcpu.c Log Message: Pull up following revision(s) (requested by msaitoh in ticket #1118): sys/arch/x86/include/cpuvar.h: revision 1.47 sys/arch/x86/x86/cpu.c: revision 1.117 sys/arch/x86/x86/identcpu.c: revision 1.49 sys/arch/x86/include/cpu.h: revision 1.67 Retrieve cpuid7 (Structured Extended Features) into ci_feat_val. To generate a diff of this commit: cvs rdiff -u -r1.66 -r1.66.4.1 src/sys/arch/x86/include/cpu.h cvs rdiff -u -r1.46 -r1.46.14.1 src/sys/arch/x86/include/cpuvar.h cvs rdiff -u -r1.111.2.2 -r1.111.2.3 src/sys/arch/x86/x86/cpu.c cvs rdiff -u -r1.45.2.1 -r1.45.2.2 src/sys/arch/x86/x86/identcpu.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/cpu.h diff -u src/sys/arch/x86/include/cpu.h:1.66 src/sys/arch/x86/include/cpu.h:1.66.4.1 --- src/sys/arch/x86/include/cpu.h:1.66 Sun Feb 23 22:38:40 2014 +++ src/sys/arch/x86/include/cpu.h Sun Mar 6 17:53:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.66 2014/02/23 22:38:40 dsl Exp $ */ +/* $NetBSD: cpu.h,v 1.66.4.1 2016/03/06 17:53:26 martin Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -157,12 +157,14 @@ struct cpu_info { uint32_t ci_max_ext_cpuid; /* cpuid.8000:%eax */ volatile uint32_t ci_lapic_counter; - uint32_t ci_feat_val[5]; /* X86 CPUID feature bits */ + uint32_t ci_feat_val[7]; /* X86 CPUID feature bits */ /* [0] basic features cpuid.1:%edx * [1] basic features cpuid.1:%ecx (CPUID2_xxx bits) * [2] extended features cpuid:8001:%edx * [3] extended features cpuid:8001:%ecx * [4] VIA padlock features + * [5] structured extended features cpuid.7:%ebx + * [6] structured extended features cpuid.7:%ecx */ const struct cpu_functions *ci_func; /* start/stop functions */ Index: src/sys/arch/x86/include/cpuvar.h diff -u src/sys/arch/x86/include/cpuvar.h:1.46 src/sys/arch/x86/include/cpuvar.h:1.46.14.1 --- src/sys/arch/x86/include/cpuvar.h:1.46 Fri Apr 20 22:23:24 2012 +++ src/sys/arch/x86/include/cpuvar.h Sun Mar 6 17:53:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cpuvar.h,v 1.46 2012/04/20 22:23:24 rmind Exp $ */ +/* $NetBSD: cpuvar.h,v 1.46.14.1 2016/03/06 17:53:26 martin Exp $ */ /*- * Copyright (c) 2000, 2007 The NetBSD Foundation, Inc. @@ -125,7 +125,7 @@ void pat_init(struct cpu_info *); extern int cpu_vendor; extern bool x86_mp_online; -extern uint32_t cpu_feature[5]; +extern uint32_t cpu_feature[7]; #endif /* _KERNEL */ Index: src/sys/arch/x86/x86/cpu.c diff -u src/sys/arch/x86/x86/cpu.c:1.111.2.2 src/sys/arch/x86/x86/cpu.c:1.111.2.3 --- src/sys/arch/x86/x86/cpu.c:1.111.2.2 Fri Nov 6 00:40:02 2015 +++ src/sys/arch/x86/x86/cpu.c Sun Mar 6 17:53:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.111.2.2 2015/11/06 00:40:02 riz Exp $ */ +/* $NetBSD: cpu.c,v 1.111.2.3 2016/03/06 17:53:26 martin Exp $ */ /*- * Copyright (c) 2000-2012 NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111.2.2 2015/11/06 00:40:02 riz Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.111.2.3 2016/03/06 17:53:26 martin Exp $"); #include "opt_ddb.h" #include "opt_mpbios.h" /* for MPDEBUG */ @@ -177,13 +177,15 @@ static void tss_init(struct i386tss *, v static void cpu_init_idle_lwp(struct cpu_info *); -uint32_t cpu_feature[5]; /* X86 CPUID feature bits - * [0] basic features %edx - * [1] basic features %ecx - * [2] extended features %edx - * [3] extended features %ecx - * [4] VIA padlock features - */ +uint32_t cpu_feature[7]; /* X86 CPUID feature bits */ + /* [0] basic features cpuid.1:%edx + * [1] basic features cpuid.1:%ecx (CPUID2_xxx bits) + * [2] extended features cpuid:8001:%edx + * [3] extended features cpuid:8001:%ecx + * [4] VIA padlock features + * [5] structured extended features cpuid.7:%ebx + * [6] structured extended features cpuid.7:%ecx + */ extern char x86_64_doubleflt_stack[]; @@ -784,7 +786,7 @@ cpu_boot_secondary(struct cpu_info *ci) } /* - * The CPU ends up here when its ready to run + * The CPU ends up here when it's ready to run. * This is called from code in mptramp.s; at this point, we are running * in the idle pcb/idle stack of the new CPU. When this function returns, * this processor will enter the idle loop and start looking for work. Index: src/sys/arch/x86/x86/identcpu.c diff -u src/sys/arch/x86/x86/identcpu.c:1.45.2.1 src/sys/arch/x86/x86/identcpu.c:1.45.2.2 --- src/sys/arch/x86/x86/identcpu.c:1.45.2.1 Thu Oct 30 18:58:45 2014 +++ src/sys/arch/x86/x86/identcpu.c Sun Mar 6 17:53:26 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: identcpu.c,v 1.45.2.1
CVS commit: [netbsd-7] src
Module Name:src Committed By: martin Date: Sun Mar 6 17:49:56 UTC 2016 Modified Files: src/sys/arch/x86/include [netbsd-7]: cacheinfo.h specialreg.h src/usr.sbin/cpuctl/arch [netbsd-7]: i386.c Log Message: Pull up the following changes, requested by msaitoh in #1117: sys/arch/x86/include/cacheinfo.h1.20-1.21 sys/arch/x86/include/specialreg.h 1.83-1.86 usr.sbin/cpuctl/arch/i386.c 1.67-1.70 Changes for x86's cpuctl(8): - Add some TLB information (index 0x6a-0x6d). - Add Hardware-Controlled Performance States (HWP) bits, FPU Data Pointer Updated Only bit and CLFLUSHOPT bit. - Add some AMD's bit definitions from "BIOS and Kernel Developer(BKDG) for AMD Family 15h Models 60h-6Fh Processors". - Add Xeon E5-4600 v3, - Add Xeon E3-1200 v4 and v5. - Add 6th gen Core, Xeon E3-1500 v5 and Xeon D-1500. - Change CPU family 0x1c from "Atom Family" to "45nm Atom Family" To generate a diff of this commit: cvs rdiff -u -r1.18.2.1 -r1.18.2.2 src/sys/arch/x86/include/cacheinfo.h cvs rdiff -u -r1.78.4.3 -r1.78.4.4 src/sys/arch/x86/include/specialreg.h cvs rdiff -u -r1.58.2.4 -r1.58.2.5 src/usr.sbin/cpuctl/arch/i386.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x86/include/cacheinfo.h diff -u src/sys/arch/x86/include/cacheinfo.h:1.18.2.1 src/sys/arch/x86/include/cacheinfo.h:1.18.2.2 --- src/sys/arch/x86/include/cacheinfo.h:1.18.2.1 Fri Dec 12 16:44:35 2014 +++ src/sys/arch/x86/include/cacheinfo.h Sun Mar 6 17:49:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: cacheinfo.h,v 1.18.2.1 2014/12/12 16:44:35 martin Exp $ */ +/* $NetBSD: cacheinfo.h,v 1.18.2.2 2016/03/06 17:49:55 martin Exp $ */ #ifndef _X86_CACHEINFO_H_ #define _X86_CACHEINFO_H_ @@ -234,6 +234,10 @@ __CI_TBL(CAI_DTLB, 0x5c, 0xff, 64, __CI_TBL(CAI_DTLB, 0x5d, 0xff, 64,4 * 1024, "4K/4M: 256 entries"),\ __CI_TBL(CAI_ITLB, 0x61, 0xff, 48,4 * 1024, NULL), \ __CI_TBL(CAI_L1_1GBDTLB,0x63, 4, 4,1024*1024 * 1024, NULL), \ +__CI_TBL(CAI_ITLB, 0x6a,8, 64,4 * 1024, NULL), \ +__CI_TBL(CAI_DTLB, 0x6b,8,256,4 * 1024, NULL), \ +__CI_TBL(CAI_L2_DTLB2, 0x6c,8,128, 0, "2M/4M: 128 entries"),\ +__CI_TBL(CAI_L1_1GBDTLB,0x6d,0xff, 16,1024*1024 * 1024, NULL), \ __CI_TBL(CAI_ITLB2,0x76, 0xff, 8, 4 * 1024 * 1024, "2M/4M: 8 entries"), \ __CI_TBL(CAI_DTLB, 0xa0, 0xff, 32,4 * 1024, NULL), \ __CI_TBL(CAI_ITLB, 0xb0,4,128,4 * 1024, NULL), \ Index: src/sys/arch/x86/include/specialreg.h diff -u src/sys/arch/x86/include/specialreg.h:1.78.4.3 src/sys/arch/x86/include/specialreg.h:1.78.4.4 --- src/sys/arch/x86/include/specialreg.h:1.78.4.3 Sat May 9 08:35:10 2015 +++ src/sys/arch/x86/include/specialreg.h Sun Mar 6 17:49:55 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: specialreg.h,v 1.78.4.3 2015/05/09 08:35:10 snj Exp $ */ +/* $NetBSD: specialreg.h,v 1.78.4.4 2016/03/06 17:49:55 martin Exp $ */ /*- * Copyright (c) 1991 The Regents of the University of California. @@ -279,16 +279,24 @@ * Intel Digital Thermal Sensor and * Power Management, Fn_0006 - %eax. */ -#define CPUID_DSPM_DTS 0x0001 /* Digital Thermal Sensor */ -#define CPUID_DSPM_IDA 0x0002 /* Intel Dynamic Acceleration */ -#define CPUID_DSPM_ARAT 0x0004 /* Always Running APIC Timer */ -#define CPUID_DSPM_PLN 0x0010 /* Power Limit Notification */ -#define CPUID_DSPM_CME 0x0020 /* Clock Modulation Extension */ -#define CPUID_DSPM_PLTM 0x0040 /* Package Level Thermal Management */ +#define CPUID_DSPM_DTS __BIT(0) /* Digital Thermal Sensor */ +#define CPUID_DSPM_IDA __BIT(1) /* Intel Dynamic Acceleration */ +#define CPUID_DSPM_ARAT __BIT(2) /* Always Running APIC Timer */ +#define CPUID_DSPM_PLN __BIT(4) /* Power Limit Notification */ +#define CPUID_DSPM_ECMD __BIT(5) /* Clock Modulation Extension */ +#define CPUID_DSPM_PTM __BIT(6) /* Package Level Thermal Management */ +#define CPUID_DSPM_HWP __BIT(7) /* HWP */ +#define CPUID_DSPM_HWP_NOTIFY __BIT(8) /* HWP Notification */ +#define CPUID_DSPM_HWP_ACTWIN __BIT(9) /* HWP Activity Window */ +#define CPUID_DSPM_HWP_EPP __BIT(10) /* HWP Energy Performance Preference */ +#define CPUID_DSPM_HWP_PLR __BIT(11) /* HWP Package Level Request */ +#define CPUID_DSPM_HDC __BIT(13) /* HDC */ #define CPUID_DSPM_FLAGS "\20" \ - "\1" "DTS" "\2" "IDA" "\3" "ARAT" \ - "\5" "PLN" "\6" "CME" "\7" "PLTM" + "\1" "DTS" "\2" "IDA" "\3" "ARAT" \ + "\5" "PLN" "\6" "ECMD" "\7" "PTM" "\10" "HWP" \ + "\11" "HWP_NOTIFY" "\12" "HWP_ACTWIN" "\13" "HWP_EPP" "\14" "HWP_PLR" \ + "\16" "HDC" /* * Intel Digital Thermal Sensor and @@ -313,6 +321,7 @@ #define CPUID_SEF_BMI1 __BIT(3) #define CPUID_SEF_HLE __BIT(4) #define CPUID_SEF_AVX2 __BIT(5) +#define CPUID_SEF_FDPEXONLY __BIT(6) #define CPUID_SEF_SMEP __BIT(7) #define CPUID_SEF_BMI2 __BIT(8)
CVS commit: [netbsd-7] src/sys/kern
Module Name:src Committed By: martin Date: Sun Mar 6 17:32:02 UTC 2016 Modified Files: src/sys/kern [netbsd-7]: subr_pool.c Log Message: Pull up following revision(s) (requested by knakahara in ticket #1103): sys/kern/subr_pool.c: revision 1.206 fix: "vmstat -C" CpuLayer showed only the last cpu values. To generate a diff of this commit: cvs rdiff -u -r1.203 -r1.203.2.1 src/sys/kern/subr_pool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/kern/subr_pool.c diff -u src/sys/kern/subr_pool.c:1.203 src/sys/kern/subr_pool.c:1.203.2.1 --- src/sys/kern/subr_pool.c:1.203 Fri Jun 13 19:09:07 2014 +++ src/sys/kern/subr_pool.c Sun Mar 6 17:32:02 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_pool.c,v 1.203 2014/06/13 19:09:07 joerg Exp $ */ +/* $NetBSD: subr_pool.c,v 1.203.2.1 2016/03/06 17:32:02 martin Exp $ */ /*- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014 @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.203 2014/06/13 19:09:07 joerg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: subr_pool.c,v 1.203.2.1 2016/03/06 17:32:02 martin Exp $"); #include "opt_ddb.h" #include "opt_lockdebug.h" @@ -2814,8 +2814,8 @@ pool_sysctl(SYSCTLFN_ARGS) cc = pc->pc_cpus[i]; if (cc == NULL) continue; -data.pr_cache_nmiss_pcpu = cc->cc_misses; -data.pr_cache_nhit_pcpu = cc->cc_hits; +data.pr_cache_nmiss_pcpu += cc->cc_misses; +data.pr_cache_nhit_pcpu += cc->cc_hits; } } else { data.pr_cache_meta_size = 0;
CVS commit: src/usr.bin/elf2aout
Module Name:src Committed By: christos Date: Sun Mar 6 16:13:22 UTC 2016 Modified Files: src/usr.bin/elf2aout: Makefile elf2aout.c Log Message: PR/50897: David Binderman: fix memory leaks. While here, modernize error handling, and types. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/usr.bin/elf2aout/Makefile cvs rdiff -u -r1.16 -r1.17 src/usr.bin/elf2aout/elf2aout.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/elf2aout/Makefile diff -u src/usr.bin/elf2aout/Makefile:1.10 src/usr.bin/elf2aout/Makefile:1.11 --- src/usr.bin/elf2aout/Makefile:1.10 Tue Mar 18 14:20:44 2014 +++ src/usr.bin/elf2aout/Makefile Sun Mar 6 11:13:21 2016 @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.10 2014/03/18 18:20:44 riastradh Exp $ +# $NetBSD: Makefile,v 1.11 2016/03/06 16:13:21 christos Exp $ # from: @(#)Makefile 5.4 (Berkeley) 5/11/90 .include # for MACHINE_CPU +WARNS=6 # Build ELF to {ecoff, aout} tools on m68k/powerpc, for kernels with old amigappc bootblocks. .if (${MACHINE_CPU} == "m68k" || \ Index: src/usr.bin/elf2aout/elf2aout.c diff -u src/usr.bin/elf2aout/elf2aout.c:1.16 src/usr.bin/elf2aout/elf2aout.c:1.17 --- src/usr.bin/elf2aout/elf2aout.c:1.16 Sun Mar 6 10:44:06 2016 +++ src/usr.bin/elf2aout/elf2aout.c Sun Mar 6 11:13:21 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: elf2aout.c,v 1.16 2016/03/06 15:44:06 martin Exp $ */ +/* $NetBSD: elf2aout.c,v 1.17 2016/03/06 16:13:21 christos Exp $ */ /* * Copyright (c) 1995 @@ -65,7 +65,7 @@ struct sect { void combine(struct sect *, struct sect *, int); int phcmp(const void *, const void *); -char *saveRead(int file, off_t offset, off_t len, const char *name); +void *saveRead(int file, off_t offset, size_t len, const char *name); void copy(int, int, off_t, off_t); void translate_syms(int, int, off_t, off_t, off_t, off_t); @@ -82,8 +82,7 @@ main(int argc, char **argv) Elf32_Phdr *ph; Elf32_Shdr *sh; char *shstrtab; - int strtabix, symtabix; - int i; + ssize_t i, strtabix, symtabix; struct sect text, data, bss; struct exec aex; int infile, outfile; @@ -99,8 +98,9 @@ main(int argc, char **argv) if (argc < 3 || argc > 4) { usage: fprintf(stderr, - "usage: elf2aout [-s]\n"); - exit(1); + "Usage: %s [-s]\n", + getprogname()); + exit(EXIT_FAILURE); } if (argc == 4) { if (strcmp(argv[3], "-s")) @@ -108,17 +108,16 @@ usage: symflag = 1; } /* Try the input file... */ - if ((infile = open(argv[1], O_RDONLY)) < 0) { - fprintf(stderr, "Can't open %s for read: %s\n", - argv[1], strerror(errno)); - exit(1); - } + if ((infile = open(argv[1], O_RDONLY)) < 0) + err(EXIT_FAILURE, "Can't open `%s' for read", argv[1]); + /* Read the header, which is at the beginning of the file... */ i = read(infile, , sizeof ex); if (i != sizeof ex) { - fprintf(stderr, "ex: %s: %s.\n", - argv[1], i ? strerror(errno) : "End of file reached"); - exit(1); + if (i == -1) + err(EXIT_FAILURE, "Error reading `%s'", argv[1]); + else + errx(EXIT_FAILURE, "End of file reading `%s'", argv[1]); } #if TARGET_BYTE_ORDER != BYTE_ORDER ex.e_type = bswap16(ex.e_type); @@ -136,28 +135,26 @@ usage: ex.e_shstrndx = bswap16(ex.e_shstrndx); #endif /* Read the program headers... */ - ph = (Elf32_Phdr *) saveRead(infile, ex.e_phoff, - ex.e_phnum * sizeof(Elf32_Phdr), "ph"); + ph = saveRead(infile, ex.e_phoff, + (size_t)ex.e_phnum * sizeof(Elf32_Phdr), "ph"); #if TARGET_BYTE_ORDER != BYTE_ORDER bswap32_region((int32_t*)ph, sizeof(Elf32_Phdr) * ex.e_phnum); #endif /* Read the section headers... */ - sh = (Elf32_Shdr *) saveRead(infile, ex.e_shoff, - ex.e_shnum * sizeof(Elf32_Shdr), "sh"); + sh = saveRead(infile, ex.e_shoff, + (size_t)ex.e_shnum * sizeof(Elf32_Shdr), "sh"); #if TARGET_BYTE_ORDER != BYTE_ORDER bswap32_region((int32_t*)sh, sizeof(Elf32_Shdr) * ex.e_shnum); #endif /* Read in the section string table. */ shstrtab = saveRead(infile, sh[ex.e_shstrndx].sh_offset, - sh[ex.e_shstrndx].sh_size, "shstrtab"); + (size_t)sh[ex.e_shstrndx].sh_size, "shstrtab"); /* Find space for a table matching ELF section indices to a.out symbol * types. */ symTypeTable = malloc(ex.e_shnum * sizeof(int)); - if (symTypeTable == NULL) { - fprintf(stderr, "symTypeTable: can't allocate.\n"); - exit(1); - } + if (symTypeTable == NULL) + err(EXIT_FAILURE, "symTypeTable: can't allocate"); memset(symTypeTable, 0, ex.e_shnum * sizeof(int)); /* Look for the symbol table and string table... Also map section @@ -197,7 +194,9 @@ usage: /* Section types we can't handle... */ else if (ph[i].p_type != PT_LOAD) -errx(1, "Program header %d type %d can't be converted.", i, ph[i].p_type); +errx(EXIT_FAILURE, "Program header %zd " +"type %d can't be converted.", +i, ph[i].p_type); /* Writable (data) segment? */ if
CVS commit: src/usr.bin/elf2aout
Module Name:src Committed By: martin Date: Sun Mar 6 15:44:06 UTC 2016 Modified Files: src/usr.bin/elf2aout: elf2aout.c Log Message: David Binderman in PR bin/50897: fix memory leak. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/usr.bin/elf2aout/elf2aout.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.bin/elf2aout/elf2aout.c diff -u src/usr.bin/elf2aout/elf2aout.c:1.15 src/usr.bin/elf2aout/elf2aout.c:1.16 --- src/usr.bin/elf2aout/elf2aout.c:1.15 Sun Jul 10 05:07:48 2011 +++ src/usr.bin/elf2aout/elf2aout.c Sun Mar 6 15:44:06 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: elf2aout.c,v 1.15 2011/07/10 05:07:48 tsutsui Exp $ */ +/* $NetBSD: elf2aout.c,v 1.16 2016/03/06 15:44:06 martin Exp $ */ /* * Copyright (c) 1995 @@ -478,6 +478,7 @@ translate_syms(int out, int in, off_t sy fprintf(stderr, "translate_syms: newstrings: %s\n", strerror(errno)); exit(1); } + free(oldstrings); } void
CVS commit: src/sys/external/bsd/drm2/drm
Module Name:src Committed By: mlelstv Date: Sun Mar 6 10:59:56 UTC 2016 Modified Files: src/sys/external/bsd/drm2/drm: drm_memory.c Log Message: Non-x86 doesn't have AGP. This should really be handled by config logic. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/external/bsd/drm2/drm/drm_memory.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/external/bsd/drm2/drm/drm_memory.c diff -u src/sys/external/bsd/drm2/drm/drm_memory.c:1.9 src/sys/external/bsd/drm2/drm/drm_memory.c:1.10 --- src/sys/external/bsd/drm2/drm/drm_memory.c:1.9 Sat Mar 5 06:48:31 2016 +++ src/sys/external/bsd/drm2/drm/drm_memory.c Sun Mar 6 10:59:56 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_memory.c,v 1.9 2016/03/05 06:48:31 mlelstv Exp $ */ +/* $NetBSD: drm_memory.c,v 1.10 2016/03/06 10:59:56 mlelstv Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -30,27 +30,33 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.9 2016/03/05 06:48:31 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: drm_memory.c,v 1.10 2016/03/06 10:59:56 mlelstv Exp $"); #if defined(__i386__) || defined(__x86_64__) -#define HAS_AGP_I810 1 + +# ifdef _KERNEL_OPT +# include "agp.h" +# if NAGP > 0 +# include "agp_i810.h" +# else +# define NAGP_I810 0 +# endif +# include "genfb.h" +# else +# define NAGP_I810 1 +# define NGENFB 0 +# endif + #else -#define HAS_AGP_I810 0 -#endif -#ifdef _KERNEL_OPT -# include "agp.h" -# if NAGP == 0 +# ifdef _KERNEL_OPT # define NAGP_I810 0 -# elif HAS_AGP_I810 > 0 -# include "agp_i810.h" +# include "genfb.h" # else # define NAGP_I810 0 +# define NGENFB 0 # endif -# include "genfb.h" -#else -# define NAGP_I810 HAS_AGP_I810 /* XXX WTF? */ -# define NGENFB 0 /* XXX WTF? */ + #endif #include
CVS commit: src
Module Name:src Committed By: aymeric Date: Sun Mar 6 10:26:57 UTC 2016 Modified Files: src: UPDATING Log Message: bump date for entry about using NetBSD's regex, now that it works To generate a diff of this commit: cvs rdiff -u -r1.265 -r1.266 src/UPDATING Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/UPDATING diff -u src/UPDATING:1.265 src/UPDATING:1.266 --- src/UPDATING:1.265 Mon Feb 29 22:49:11 2016 +++ src/UPDATING Sun Mar 6 10:26:57 2016 @@ -1,4 +1,4 @@ -$NetBSD: UPDATING,v 1.265 2016/02/29 22:49:11 aymeric Exp $ +$NetBSD: UPDATING,v 1.266 2016/03/06 10:26:57 aymeric Exp $ This file (UPDATING) is intended to be a brief reference to recent changes that might cause problems in the build process, and a guide for @@ -19,7 +19,7 @@ See also: BUILDING, build.sh, Makefile. Recent changes: ^^^ -20160229: +20160306: NetBSD's regexp implementation is now part of libnbcompat. Nblex, nbm4, nbpax, nbsed use it and they may crash on non-NetBSD hosts if linked with stale object files produced
CVS commit: [nick-nhusb] src/sys/dev/usb
Module Name:src Committed By: skrll Date: Sun Mar 6 10:25:31 UTC 2016 Modified Files: src/sys/dev/usb [nick-nhusb]: usbdivar.h Log Message: Whitespace To generate a diff of this commit: cvs rdiff -u -r1.109.2.23 -r1.109.2.24 src/sys/dev/usb/usbdivar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/dev/usb/usbdivar.h diff -u src/sys/dev/usb/usbdivar.h:1.109.2.23 src/sys/dev/usb/usbdivar.h:1.109.2.24 --- src/sys/dev/usb/usbdivar.h:1.109.2.23 Tue Feb 16 08:02:49 2016 +++ src/sys/dev/usb/usbdivar.h Sun Mar 6 10:25:31 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: usbdivar.h,v 1.109.2.23 2016/02/16 08:02:49 skrll Exp $ */ +/* $NetBSD: usbdivar.h,v 1.109.2.24 2016/03/06 10:25:31 skrll Exp $ */ /* * Copyright (c) 1998, 2012 The NetBSD Foundation, Inc. @@ -226,7 +226,7 @@ struct usbd_pipe { LIST_ENTRY(usbd_pipe) up_next; struct usb_task up_async_task; - struct usbd_xfer * up_intrxfer; /* used for repeating requests */ + struct usbd_xfer *up_intrxfer; /* used for repeating requests */ char up_repeat; int up_interval; uint8_t up_flags;
CVS commit: src/tools/compat
Module Name:src Committed By: aymeric Date: Sun Mar 6 10:22:59 UTC 2016 Added Files: src/tools/compat: regex.h Log Message: add our libc's regex implementation to libnbcompat. This way, nbsed picks it up and it unbreaks the build of xf86-video-intel-old's man page under Linux and probably other future changes which rightfully expect the (net)bsd behaviour. Full release tested on ArchLinux and NetBSD 7.0_STABLE To generate a diff of this commit: cvs rdiff -u -r0 -r1.3 src/tools/compat/regex.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/tools/compat/regex.h diff -u /dev/null src/tools/compat/regex.h:1.3 --- /dev/null Sun Mar 6 10:22:59 2016 +++ src/tools/compat/regex.h Sun Mar 6 10:22:59 2016 @@ -0,0 +1,3 @@ +/* $NetBSD: regex.h,v 1.3 2016/03/06 10:22:59 aymeric Exp $ */ + +#include "../../include/regex.h"
CVS commit: src/external/gpl3/binutils/dist/bfd
Module Name:src Committed By: nakayama Date: Sun Mar 6 09:39:42 UTC 2016 Modified Files: src/external/gpl3/binutils/dist/bfd: config.bfd Log Message: Remove unnecessary local change. To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/external/gpl3/binutils/dist/bfd/config.bfd Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/dist/bfd/config.bfd diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.19 src/external/gpl3/binutils/dist/bfd/config.bfd:1.20 --- src/external/gpl3/binutils/dist/bfd/config.bfd:1.19 Sun Mar 6 09:38:08 2016 +++ src/external/gpl3/binutils/dist/bfd/config.bfd Sun Mar 6 09:39:42 2016 @@ -1611,10 +1611,6 @@ case "${targ}" in targ_selvecs="sparc_elf32_vec sparc_aout_linux_vec sparc_aout_sunos_be_vec" want64=true ;; - sparc64-*-netbsd*) -targ_defvec=bfd_elf64_sparc_vec -targ_selvecs="bfd_elf32_sparc_vec sparcnetbsd_vec sunos_big_vec" -;; sparc64-*-elf* | sparc64-*-rtems* ) targ_defvec=sparc_elf64_vec targ_selvecs=sparc_elf32_vec
CVS commit: src/external/gpl3/binutils
Module Name:src Committed By: nakayama Date: Sun Mar 6 09:38:08 UTC 2016 Modified Files: src/external/gpl3/binutils/dist/bfd: config.bfd src/external/gpl3/binutils/lib/libbfd/arch/sparc: bfd.h defs.mk Log Message: Reapply following changes to binutils 2.26 to fix PR toolchain/48630. http://mail-index.netbsd.org/source-changes/2014/03/10/msg052578.html http://mail-index.netbsd.org/source-changes/2014/03/10/msg052579.html To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/external/gpl3/binutils/dist/bfd/config.bfd cvs rdiff -u -r1.7 -r1.8 \ src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h cvs rdiff -u -r1.4 -r1.5 \ src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/external/gpl3/binutils/dist/bfd/config.bfd diff -u src/external/gpl3/binutils/dist/bfd/config.bfd:1.18 src/external/gpl3/binutils/dist/bfd/config.bfd:1.19 --- src/external/gpl3/binutils/dist/bfd/config.bfd:1.18 Wed Feb 3 13:24:12 2016 +++ src/external/gpl3/binutils/dist/bfd/config.bfd Sun Mar 6 09:38:08 2016 @@ -1559,6 +1559,7 @@ case "${targ}" in sparc-*-netbsdelf*) targ_defvec=sparc_elf32_vec targ_selvecs=sparc_aout_nbsd_vec +want64=true ;; sparc-*-netbsdaout* | sparc-*-netbsd*) targ_defvec=sparc_aout_nbsd_vec Index: src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h diff -u src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h:1.7 src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h:1.8 --- src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h:1.7 Fri Jan 29 17:30:24 2016 +++ src/external/gpl3/binutils/lib/libbfd/arch/sparc/bfd.h Sun Mar 6 09:38:08 2016 @@ -87,7 +87,7 @@ extern "C" { /* The word size used by BFD on the host. This may be 64 with a 32 bit target if the host is 64 bit, or if other 64 bit targets have been selected with --enable-targets, or if --enable-64-bit-bfd. */ -#define BFD_ARCH_SIZE 32 +#define BFD_ARCH_SIZE 64 /* The word size of the default bfd target. */ #define BFD_DEFAULT_TARGET_SIZE 32 Index: src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk diff -u src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk:1.4 src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk:1.5 --- src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk:1.4 Fri Jan 29 17:30:24 2016 +++ src/external/gpl3/binutils/lib/libbfd/arch/sparc/defs.mk Sun Mar 6 09:38:08 2016 @@ -2,7 +2,7 @@ # Generated from: NetBSD: mknative-binutils,v 1.9 2013/10/01 15:41:17 skrll Exp # Generated from: NetBSD: mknative.common,v 1.11 2014/02/17 21:39:43 christos Exp # -G_libbfd_la_DEPENDENCIES=elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo sparcnetbsd.lo aout32.lo elf32-gen.lo plugin.lo cpu-sparc.lo cpu-plugin.lo netbsd-core.lo ofiles +G_libbfd_la_DEPENDENCIES=elf32-sparc.lo elfxx-sparc.lo elf-vxworks.lo elf32.lo elf.lo elflink.lo elf-attrs.lo elf-strtab.lo elf-eh-frame.lo dwarf1.lo dwarf2.lo sparcnetbsd.lo aout32.lo elf32-gen.lo plugin.lo cpu-sparc.lo cpu-plugin.lo netbsd-core.lo archive64.lo ofiles G_libbfd_la_OBJECTS=archive.lo archures.lo bfd.lo bfdio.lo bfdwin.lo cache.lo coff-bfd.lo compress.lo corefile.lo format.lo hash.lo init.lo libbfd.lo linker.lo merge.lo opncls.lo reloc.lo section.lo simple.lo stab-syms.lo stabs.lo syms.lo targets.lo binary.lo ihex.lo srec.lo tekhex.lo verilog.lo G_DEFS=-DHAVE_CONFIG_H G_INCLUDES=-DNETBSD_CORE-I. -I${GNUHOSTDIST}/bfd -I${GNUHOSTDIST}/bfd/../include -DHAVE_sparc_elf32_vec -DHAVE_sparc_aout_nbsd_vec -DHAVE_elf32_le_vec -DHAVE_elf32_be_vec -DHAVE_plugin_vec -I./../intl