CVS commit: src/sys
Module Name:src Committed By: rtr Date: Sun Jun 22 08:10:19 UTC 2014 Modified Files: src/sys/compat/common: if_43.c src/sys/kern: sys_socket.c uipc_usrreq.c src/sys/net: if.c link_proto.c raw_usrreq.c rtsock.c src/sys/netatalk: ddp_usrreq.c src/sys/netbt: hci.h hci_ioctl.c hci_socket.c l2cap_socket.c rfcomm_socket.c sco_socket.c src/sys/netinet: raw_ip.c tcp_usrreq.c udp_usrreq.c src/sys/netinet6: raw_ip6.c udp6_usrreq.c src/sys/netipsec: keysock.c src/sys/netmpls: mpls_proto.c src/sys/netnatm: natm.c src/sys/rump/net/lib/libsockin: sockin.c src/sys/sys: protosw.h Log Message: * split PRU_CONTROL functionality out of xxx_userreq() switches and place into separate xxx_ioctl() functions. * place KASSERT(req != PRU_CONTROL) inside xxx_userreq() as it is now inappropriate for req = PRU_CONTROL in xxx_userreq(). * replace calls to pr_generic() with req = PRU_CONTROL with pr_ioctl(). * remove fixup references to PRU_CONTROL xxx_userreq() function comments. * fix various comments references for xxx_userreq() that mentioned PRU_CONTROL as xxx_userreq() no longer handles the request. a further change will follow to fix parameter and naming inconsistencies retained from original code. Reviewed by rmind@ To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/sys/compat/common/if_43.c cvs rdiff -u -r1.68 -r1.69 src/sys/kern/sys_socket.c cvs rdiff -u -r1.153 -r1.154 src/sys/kern/uipc_usrreq.c cvs rdiff -u -r1.282 -r1.283 src/sys/net/if.c cvs rdiff -u -r1.9 -r1.10 src/sys/net/link_proto.c cvs rdiff -u -r1.39 -r1.40 src/sys/net/raw_usrreq.c cvs rdiff -u -r1.147 -r1.148 src/sys/net/rtsock.c cvs rdiff -u -r1.44 -r1.45 src/sys/netatalk/ddp_usrreq.c cvs rdiff -u -r1.37 -r1.38 src/sys/netbt/hci.h cvs rdiff -u -r1.10 -r1.11 src/sys/netbt/hci_ioctl.c cvs rdiff -u -r1.24 -r1.25 src/sys/netbt/hci_socket.c cvs rdiff -u -r1.15 -r1.16 src/sys/netbt/l2cap_socket.c cvs rdiff -u -r1.16 -r1.17 src/sys/netbt/rfcomm_socket.c cvs rdiff -u -r1.17 -r1.18 src/sys/netbt/sco_socket.c cvs rdiff -u -r1.124 -r1.125 src/sys/netinet/raw_ip.c cvs rdiff -u -r1.177 -r1.178 src/sys/netinet/tcp_usrreq.c cvs rdiff -u -r1.199 -r1.200 src/sys/netinet/udp_usrreq.c cvs rdiff -u -r1.118 -r1.119 src/sys/netinet6/raw_ip6.c cvs rdiff -u -r1.98 -r1.99 src/sys/netinet6/udp6_usrreq.c cvs rdiff -u -r1.27 -r1.28 src/sys/netipsec/keysock.c cvs rdiff -u -r1.9 -r1.10 src/sys/netmpls/mpls_proto.c cvs rdiff -u -r1.27 -r1.28 src/sys/netnatm/natm.c cvs rdiff -u -r1.40 -r1.41 src/sys/rump/net/lib/libsockin/sockin.c cvs rdiff -u -r1.47 -r1.48 src/sys/sys/protosw.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/compat/common/if_43.c diff -u src/sys/compat/common/if_43.c:1.5 src/sys/compat/common/if_43.c:1.6 --- src/sys/compat/common/if_43.c:1.5 Sun May 18 14:46:15 2014 +++ src/sys/compat/common/if_43.c Sun Jun 22 08:10:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: if_43.c,v 1.5 2014/05/18 14:46:15 rmind Exp $ */ +/* $NetBSD: if_43.c,v 1.6 2014/06/22 08:10:18 rtr Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1990, 1993 @@ -32,7 +32,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: if_43.c,v 1.5 2014/05/18 14:46:15 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: if_43.c,v 1.6 2014/06/22 08:10:18 rtr Exp $); #if defined(_KERNEL_OPT) #include opt_compat_netbsd.h @@ -256,7 +256,7 @@ compat_ifioctl(struct socket *so, u_long cmd = SIOCGIFNETMASK; } - error = (*so-so_proto-pr_usrreqs-pr_generic)(so, PRU_CONTROL, + error = (*so-so_proto-pr_usrreqs-pr_ioctl)(so, (struct mbuf *)cmd, (struct mbuf *)ifr, (struct mbuf *)ifp, l); switch (ocmd) { Index: src/sys/kern/sys_socket.c diff -u src/sys/kern/sys_socket.c:1.68 src/sys/kern/sys_socket.c:1.69 --- src/sys/kern/sys_socket.c:1.68 Sun May 18 14:46:15 2014 +++ src/sys/kern/sys_socket.c Sun Jun 22 08:10:18 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_socket.c,v 1.68 2014/05/18 14:46:15 rmind Exp $ */ +/* $NetBSD: sys_socket.c,v 1.69 2014/06/22 08:10:18 rtr Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -61,7 +61,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: sys_socket.c,v 1.68 2014/05/18 14:46:15 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: sys_socket.c,v 1.69 2014/06/22 08:10:18 rtr Exp $); #include sys/param.h #include sys/systm.h @@ -201,8 +201,8 @@ soo_ioctl(file_t *fp, u_long cmd, void * if (IOCGROUP(cmd) == 'i') error = ifioctl(so, cmd, data, curlwp); else { - error = (*so-so_proto-pr_usrreqs-pr_generic)(so, - PRU_CONTROL, (struct mbuf *)cmd, + error = (*so-so_proto-pr_usrreqs-pr_ioctl)(so, + (struct mbuf *)cmd, (struct mbuf *)data, NULL, curlwp); } KERNEL_UNLOCK_ONE(NULL); Index: src/sys/kern/uipc_usrreq.c diff -u src/sys/kern/uipc_usrreq.c:1.153 src/sys/kern/uipc_usrreq.c:1.154 ---
CVS commit: src/sys/fs/cd9660
Module Name:src Committed By: hannken Date: Sun Jun 22 09:47:40 UTC 2014 Modified Files: src/sys/fs/cd9660: cd9660_vfsops.c Log Message: CID 1223346: No need to check bp against NULL. It is always valid here. To generate a diff of this commit: cvs rdiff -u -r1.87 -r1.88 src/sys/fs/cd9660/cd9660_vfsops.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/fs/cd9660/cd9660_vfsops.c diff -u src/sys/fs/cd9660/cd9660_vfsops.c:1.87 src/sys/fs/cd9660/cd9660_vfsops.c:1.88 --- src/sys/fs/cd9660/cd9660_vfsops.c:1.87 Mon Jun 16 09:55:49 2014 +++ src/sys/fs/cd9660/cd9660_vfsops.c Sun Jun 22 09:47:40 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: cd9660_vfsops.c,v 1.87 2014/06/16 09:55:49 hannken Exp $ */ +/* $NetBSD: cd9660_vfsops.c,v 1.88 2014/06/22 09:47:40 hannken Exp $ */ /*- * Copyright (c) 1994 @@ -37,7 +37,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: cd9660_vfsops.c,v 1.87 2014/06/16 09:55:49 hannken Exp $); +__KERNEL_RCSID(0, $NetBSD: cd9660_vfsops.c,v 1.88 2014/06/22 09:47:40 hannken Exp $); #if defined(_KERNEL_OPT) #include opt_compat_netbsd.h @@ -746,8 +746,7 @@ cd9660_loadvnode(struct mount *mp, struc if (off + isonum_711(isodir-length) imp-logical_block_size) { pool_put(cd9660_node_pool, ip); - if (bp != 0) - brelse(bp, 0); + brelse(bp, 0); printf(fhtovp: directory crosses block boundary %d[off=%d/len=%d]\n, off +isonum_711(isodir-length), off, isonum_711(isodir-length)); @@ -800,8 +799,7 @@ cd9660_loadvnode(struct mount *mp, struc break; } - if (bp != 0) - brelse(bp, 0); + brelse(bp, 0); /* * Initialize the associated vnode
CVS commit: src/sys/dev/pci
Module Name:src Committed By: hannken Date: Sun Jun 22 09:48:20 UTC 2014 Modified Files: src/sys/dev/pci: piixpm.c Log Message: Consistently pass a struct piixpm_softc to piixpm_intr. Prevents a crash on hardware interrupts. To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/dev/pci/piixpm.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/piixpm.c diff -u src/sys/dev/pci/piixpm.c:1.44 src/sys/dev/pci/piixpm.c:1.45 --- src/sys/dev/pci/piixpm.c:1.44 Sat Mar 29 19:28:25 2014 +++ src/sys/dev/pci/piixpm.c Sun Jun 22 09:48:20 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: piixpm.c,v 1.44 2014/03/29 19:28:25 christos Exp $ */ +/* $NetBSD: piixpm.c,v 1.45 2014/06/22 09:48:20 hannken Exp $ */ /* $OpenBSD: piixpm.c,v 1.20 2006/02/27 08:25:02 grange Exp $ */ /* @@ -22,7 +22,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.44 2014/03/29 19:28:25 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: piixpm.c,v 1.45 2014/06/22 09:48:20 hannken Exp $); #include sys/param.h #include sys/systm.h @@ -508,7 +508,7 @@ piixpm_i2c_exec(void *cookie, i2c_op_t o } if (st PIIX_SMB_HS_BUSY) goto timeout; - piixpm_intr(smbus); + piixpm_intr(sc); } else { /* Wait for interrupt */ if (tsleep(sc, PRIBIO, iicexec, PIIXPM_TIMEOUT * hz)) @@ -543,8 +543,7 @@ timeout: static int piixpm_intr(void *arg) { - struct piixpm_smbus *smbus = arg; - struct piixpm_softc *sc = smbus-softc; + struct piixpm_softc *sc = arg; u_int8_t st; u_int8_t *b; size_t len;
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sun Jun 22 17:23:34 UTC 2014 Modified Files: src/sys/kern: kern_exec.c Log Message: A KASSERT() is better. To generate a diff of this commit: cvs rdiff -u -r1.407 -r1.408 src/sys/kern/kern_exec.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/kern_exec.c diff -u src/sys/kern/kern_exec.c:1.407 src/sys/kern/kern_exec.c:1.408 --- src/sys/kern/kern_exec.c:1.407 Fri Apr 25 18:04:45 2014 +++ src/sys/kern/kern_exec.c Sun Jun 22 17:23:34 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_exec.c,v 1.407 2014/04/25 18:04:45 riastradh Exp $ */ +/* $NetBSD: kern_exec.c,v 1.408 2014/06/22 17:23:34 maxv Exp $ */ /*- * Copyright (c) 2008 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.407 2014/04/25 18:04:45 riastradh Exp $); +__KERNEL_RCSID(0, $NetBSD: kern_exec.c,v 1.408 2014/06/22 17:23:34 maxv Exp $); #include opt_exec.h #include opt_execfmt.h @@ -339,8 +339,8 @@ check_exec(struct lwp *l, struct exec_pa return error; epp-ep_vp = vp = nd.ni_vp; /* normally this can't fail */ - if ((error = copystr(nd.ni_pnbuf, epp-ep_resolvedname, PATH_MAX, NULL))) - goto bad1; + error = copystr(nd.ni_pnbuf, epp-ep_resolvedname, PATH_MAX, NULL); + KASSERT(error == 0); #ifdef DIAGNOSTIC /* paranoia (take this out once namei stuff stabilizes) */
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sun Jun 22 17:36:42 UTC 2014 Modified Files: src/sys/kern: subr_kmem.c Log Message: Put the KMEM_GUARD code under #if defined(KMEM_GUARD). No functional change. To generate a diff of this commit: cvs rdiff -u -r1.51 -r1.52 src/sys/kern/subr_kmem.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_kmem.c diff -u src/sys/kern/subr_kmem.c:1.51 src/sys/kern/subr_kmem.c:1.52 --- src/sys/kern/subr_kmem.c:1.51 Fri Oct 25 16:09:29 2013 +++ src/sys/kern/subr_kmem.c Sun Jun 22 17:36:42 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: subr_kmem.c,v 1.51 2013/10/25 16:09:29 martin Exp $ */ +/* $NetBSD: subr_kmem.c,v 1.52 2014/06/22 17:36:42 maxv Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -56,7 +56,7 @@ */ /* - * allocator of kernel wired memory. + * Allocator of kernel wired memory. */ /* @@ -102,7 +102,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.51 2013/10/25 16:09:29 martin Exp $); +__KERNEL_RCSID(0, $NetBSD: subr_kmem.c,v 1.52 2014/06/22 17:36:42 maxv Exp $); #include sys/param.h #include sys/callback.h @@ -178,15 +178,7 @@ static size_t kmem_cache_maxidx __read_m static pool_cache_t kmem_cache_big[KMEM_CACHE_BIG_COUNT] __cacheline_aligned; static size_t kmem_cache_big_maxidx __read_mostly; - #if defined(DEBUG) defined(_HARDKERNEL) -#ifndef KMEM_GUARD_DEPTH -#define KMEM_GUARD_DEPTH 0 -#endif -int kmem_guard_depth = KMEM_GUARD_DEPTH; -size_t kmem_guard_size; -static struct uvm_kmguard kmem_guard; -static void *kmem_freecheck; #define KMEM_POISON #define KMEM_REDZONE #define KMEM_SIZE @@ -218,6 +210,16 @@ static void kmem_size_check(void *, size #define kmem_size_check(p, sz) /* nothing */ #endif +#if defined(KMEM_GUARD) +#ifndef KMEM_GUARD_DEPTH +#define KMEM_GUARD_DEPTH 0 +#endif +int kmem_guard_depth = KMEM_GUARD_DEPTH; +size_t kmem_guard_size; +static struct uvm_kmguard kmem_guard; +static void *kmem_freecheck; +#endif /* defined(KMEM_GUARD) */ + CTASSERT(KM_SLEEP == PR_WAITOK); CTASSERT(KM_NOSLEEP == PR_NOWAIT);
CVS commit: src/sys/kern
Module Name:src Committed By: maxv Date: Sun Jun 22 18:32:27 UTC 2014 Modified Files: src/sys/kern: vfs_vnops.c Log Message: Fix a NULL pointer dereference after a lng discussion with dholland@, hannken@, blymn@ and martin@. This bug would panic the system when veriexec is set to the VERIEXEC_LOCKDOWN mode (only settable from root). To generate a diff of this commit: cvs rdiff -u -r1.189 -r1.190 src/sys/kern/vfs_vnops.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/vfs_vnops.c diff -u src/sys/kern/vfs_vnops.c:1.189 src/sys/kern/vfs_vnops.c:1.190 --- src/sys/kern/vfs_vnops.c:1.189 Thu Feb 27 16:51:38 2014 +++ src/sys/kern/vfs_vnops.c Sun Jun 22 18:32:27 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_vnops.c,v 1.189 2014/02/27 16:51:38 hannken Exp $ */ +/* $NetBSD: vfs_vnops.c,v 1.190 2014/06/22 18:32:27 maxv Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -66,7 +66,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.189 2014/02/27 16:51:38 hannken Exp $); +__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.190 2014/06/22 18:32:27 maxv Exp $); #include veriexec.h @@ -171,8 +171,25 @@ vn_open(struct nameidata *ndp, int fmode #if NVERIEXEC 0 error = veriexec_openchk(l, ndp-ni_vp, pathstring, fmode); - if (error) - goto bad; + if (error) { + /* We have to release the locks ourselves */ + if (fmode O_CREAT) { + if (vp == NULL) { +vput(ndp-ni_dvp); + } else { +VOP_ABORTOP(ndp-ni_dvp, ndp-ni_cnd); +if (ndp-ni_dvp == ndp-ni_vp) + vrele(ndp-ni_dvp); +else + vput(ndp-ni_dvp); +ndp-ni_dvp = NULL; +vput(vp); + } + } else { + vput(vp); + } + goto out; + } #endif /* NVERIEXEC 0 */ if (fmode O_CREAT) {
CVS commit: src/sys
Module Name:src Committed By: maxv Date: Sun Jun 22 19:09:39 UTC 2014 Modified Files: src/sys/compat/netbsd32: netbsd32_netbsd.c src/sys/uvm: uvm_swap.c Log Message: Sync swapctl() with netbsd32. Return EINVAL when misc0, and 0 when misc=0 or uvmexp.nswapdev=0. To generate a diff of this commit: cvs rdiff -u -r1.189 -r1.190 src/sys/compat/netbsd32/netbsd32_netbsd.c cvs rdiff -u -r1.168 -r1.169 src/sys/uvm/uvm_swap.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/compat/netbsd32/netbsd32_netbsd.c diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.189 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.190 --- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.189 Fri Jun 13 10:37:02 2014 +++ src/sys/compat/netbsd32/netbsd32_netbsd.c Sun Jun 22 19:09:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32_netbsd.c,v 1.189 2014/06/13 10:37:02 joerg Exp $ */ +/* $NetBSD: netbsd32_netbsd.c,v 1.190 2014/06/22 19:09:39 maxv Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -27,7 +27,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.189 2014/06/13 10:37:02 joerg Exp $); +__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.190 2014/06/22 19:09:39 maxv Exp $); #if defined(_KERNEL_OPT) #include opt_ddb.h @@ -1765,10 +1765,8 @@ netbsd32_swapctl_stats(struct lwp *l, st if (count 0) return EINVAL; - if (count == 0 || uvmexp.nswapdev == 0) return 0; - /* Make sure userland cannot exhaust kernel memory */ if ((size_t)count (size_t)uvmexp.nswapdev) count = uvmexp.nswapdev; Index: src/sys/uvm/uvm_swap.c diff -u src/sys/uvm/uvm_swap.c:1.168 src/sys/uvm/uvm_swap.c:1.169 --- src/sys/uvm/uvm_swap.c:1.168 Sun Mar 16 05:20:30 2014 +++ src/sys/uvm/uvm_swap.c Sun Jun 22 19:09:39 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: uvm_swap.c,v 1.168 2014/03/16 05:20:30 dholland Exp $ */ +/* $NetBSD: uvm_swap.c,v 1.169 2014/06/22 19:09:39 maxv Exp $ */ /* * Copyright (c) 1995, 1996, 1997, 2009 Matthew R. Green @@ -30,7 +30,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: uvm_swap.c,v 1.168 2014/03/16 05:20:30 dholland Exp $); +__KERNEL_RCSID(0, $NetBSD: uvm_swap.c,v 1.169 2014/06/22 19:09:39 maxv Exp $); #include opt_uvmhist.h #include opt_compat_netbsd.h @@ -492,13 +492,17 @@ sys_swapctl(struct lwp *l, const struct || SCARG(uap, cmd) == SWAP_STATS13 #endif ) { - if ((size_t)misc (size_t)uvmexp.nswapdev) - misc = uvmexp.nswapdev; - - if (misc == 0) { + if (misc 0) { error = EINVAL; goto out; } + if (misc == 0 || uvmexp.nswapdev == 0) { + error = 0; + goto out; + } + /* Make sure userland cannot exhaust kernel memory */ + if ((size_t)misc (size_t)uvmexp.nswapdev) + misc = uvmexp.nswapdev; KASSERT(misc 0); #if defined(COMPAT_13) if (SCARG(uap, cmd) == SWAP_STATS13)
CVS commit: src/sys/rump/librump/rumpkern
Module Name:src Committed By: pooka Date: Sun Jun 22 20:09:19 UTC 2014 Modified Files: src/sys/rump/librump/rumpkern: intr.c Log Message: Initialize cpu_softcpu before creating softint threads. Fixes things with rump kernel hypervisors which wrap the thread creation hypercall. pointed out by Justin Cormack To generate a diff of this commit: cvs rdiff -u -r1.45 -r1.46 src/sys/rump/librump/rumpkern/intr.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/rumpkern/intr.c diff -u src/sys/rump/librump/rumpkern/intr.c:1.45 src/sys/rump/librump/rumpkern/intr.c:1.46 --- src/sys/rump/librump/rumpkern/intr.c:1.45 Mon Jun 9 13:03:16 2014 +++ src/sys/rump/librump/rumpkern/intr.c Sun Jun 22 20:09:19 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: intr.c,v 1.45 2014/06/09 13:03:16 rmind Exp $ */ +/* $NetBSD: intr.c,v 1.46 2014/06/22 20:09:19 pooka Exp $ */ /* * Copyright (c) 2008-2010 Antti Kantee. All Rights Reserved. @@ -26,7 +26,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.45 2014/06/09 13:03:16 rmind Exp $); +__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.46 2014/06/22 20:09:19 pooka Exp $); #include sys/param.h #include sys/atomic.h @@ -242,7 +242,15 @@ softint_init(struct cpu_info *ci) if (!rump_threads) return; + slev = kmem_alloc(sizeof(struct softint_lev) * SOFTINT_COUNT, KM_SLEEP); + for (i = 0; i SOFTINT_COUNT; i++) { + rumpuser_cv_init(slev[i].si_cv); + LIST_INIT(slev[i].si_pending); + } + cd-cpu_softcpu = slev; + /* overloaded global init ... */ + /* XXX: should be done the last time we are called */ if (ci-ci_index == 0) { int sithr_swap; @@ -261,13 +269,6 @@ softint_init(struct cpu_info *ci) } } - slev = kmem_alloc(sizeof(struct softint_lev) * SOFTINT_COUNT, KM_SLEEP); - for (i = 0; i SOFTINT_COUNT; i++) { - rumpuser_cv_init(slev[i].si_cv); - LIST_INIT(slev[i].si_pending); - } - cd-cpu_softcpu = slev; - /* well, not really a soft interrupt ... */ if ((rv = kthread_create(PRI_NONE, KTHREAD_MPSAFE, ci, doclock, NULL, NULL, rumpclk%d, ci-ci_index)) != 0)
CVS commit: src/lib/librumpuser
Module Name:src Committed By: pooka Date: Sun Jun 22 20:17:23 UTC 2014 Modified Files: src/lib/librumpuser: rumpuser_pth.c Log Message: Wrap pthread_create(). Shouldn't really have a functional effect, apart from testing that rumpuser_thread_create() can actually survive an unschedule/schedule cycle (which may or may not be necessary with other hypercall implementations). To generate a diff of this commit: cvs rdiff -u -r1.40 -r1.41 src/lib/librumpuser/rumpuser_pth.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/librumpuser/rumpuser_pth.c diff -u src/lib/librumpuser/rumpuser_pth.c:1.40 src/lib/librumpuser/rumpuser_pth.c:1.41 --- src/lib/librumpuser/rumpuser_pth.c:1.40 Wed Apr 2 17:09:23 2014 +++ src/lib/librumpuser/rumpuser_pth.c Sun Jun 22 20:17:23 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: rumpuser_pth.c,v 1.40 2014/04/02 17:09:23 justin Exp $ */ +/* $NetBSD: rumpuser_pth.c,v 1.41 2014/06/22 20:17:23 pooka Exp $ */ /* * Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved. @@ -28,7 +28,7 @@ #include rumpuser_port.h #if !defined(lint) -__RCSID($NetBSD: rumpuser_pth.c,v 1.40 2014/04/02 17:09:23 justin Exp $); +__RCSID($NetBSD: rumpuser_pth.c,v 1.41 2014/06/22 20:17:23 pooka Exp $); #endif /* !lint */ #include sys/queue.h @@ -87,7 +87,7 @@ rumpuser_thread_create(void *(*f)(void * for (i = 0; i 10; i++) { const struct timespec ts = {0, 10*1000*1000}; - rv = pthread_create(ptidp, pattr, f, arg); + KLOCK_WRAP(rv = pthread_create(ptidp, pattr, f, arg)); if (rv != EAGAIN) break; nanosleep(ts, NULL);
CVS commit: src/sys/compat/freebsd
Module Name:src Committed By: christos Date: Sun Jun 22 22:19:28 UTC 2014 Modified Files: src/sys/compat/freebsd: freebsd_sched.c Log Message: simplify and clarify To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/sys/compat/freebsd/freebsd_sched.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/compat/freebsd/freebsd_sched.c diff -u src/sys/compat/freebsd/freebsd_sched.c:1.20 src/sys/compat/freebsd/freebsd_sched.c:1.21 --- src/sys/compat/freebsd/freebsd_sched.c:1.20 Sat Jun 21 19:12:10 2014 +++ src/sys/compat/freebsd/freebsd_sched.c Sun Jun 22 18:19:28 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: freebsd_sched.c,v 1.20 2014/06/21 23:12:10 christos Exp $ */ +/* $NetBSD: freebsd_sched.c,v 1.21 2014/06/22 22:19:28 christos Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -35,7 +35,7 @@ */ #include sys/cdefs.h -__KERNEL_RCSID(0, $NetBSD: freebsd_sched.c,v 1.20 2014/06/21 23:12:10 christos Exp $); +__KERNEL_RCSID(0, $NetBSD: freebsd_sched.c,v 1.21 2014/06/22 22:19:28 christos Exp $); #include sys/param.h #include sys/mount.h @@ -67,26 +67,26 @@ sched_freebsd2native(int freebsd_policy, { int p; - if (native_policy == NULL) - native_policy = p; - switch (freebsd_policy) { case FREEBSD_SCHED_OTHER: - *native_policy = SCHED_OTHER; + p = SCHED_OTHER; break; case FREEBSD_SCHED_FIFO: - *native_policy = SCHED_FIFO; + p = SCHED_FIFO; break; case FREEBSD_SCHED_RR: - *native_policy = SCHED_RR; + p = SCHED_RR; break; default: return EINVAL; } + if (native_policy != NULL) + *native_policy = p; + if (freebsd_params != NULL native_params != NULL) { /* XXX: Needs adjustment to do a proper conversion. */ native_params-sched_priority = freebsd_params-sched_priority; @@ -102,26 +102,26 @@ sched_native2freebsd(int native_policy, { int p; - if (freebsd_policy == NULL) - freebsd_policy = p; - switch (native_policy) { case SCHED_OTHER: - *freebsd_policy = FREEBSD_SCHED_OTHER; + p = FREEBSD_SCHED_OTHER; break; case SCHED_FIFO: - *freebsd_policy = FREEBSD_SCHED_FIFO; + p = FREEBSD_SCHED_FIFO; break; case SCHED_RR: - *freebsd_policy = FREEBSD_SCHED_RR; + p = FREEBSD_SCHED_RR; break; default: return EINVAL; } + if (freebsd_policy != NULL) + *freebsd_policy = p; + if (native_params != NULL freebsd_params != NULL) { /* XXX: Needs adjustment to do a proper conversion. */ freebsd_params-sched_priority = native_params-sched_priority;
CVS commit: src/external/gpl3/gdb
Module Name:src Committed By: christos Date: Sun Jun 22 23:53:04 UTC 2014 Modified Files: src/external/gpl3/gdb/bin/gdb: Makefile src/external/gpl3/gdb/bin/gdbtui: Makefile tui-main.c src/external/gpl3/gdb/dist: config.guess config.sub src/external/gpl3/gdb/dist/bfd: bfdio.c config.bfd configure elf.c elf32-i386.c src/external/gpl3/gdb/dist/bfd/doc: Makefile.in bfd.info src/external/gpl3/gdb/dist/gdb: alphabsd-nat.c alphanbsd-tdep.c amd64bsd-nat.c amd64nbsd-nat.c amd64nbsd-tdep.c arm-tdep.c armnbsd-nat.c bsd-kvm.c configure configure.ac configure.host configure.tgt hppa-tdep.c hppa-tdep.h hppanbsd-nat.c hppanbsd-tdep.c i386bsd-nat.c i386bsd-nat.h i386nbsd-nat.c i386nbsd-tdep.c inf-ptrace.c m68kbsd-nat.c m68kbsd-tdep.c mips-tdep.h mipsnbsd-nat.c mipsnbsd-tdep.c nbsd-thread.c objfiles.c p-exp.y ppcnbsd-nat.c regcache.c remote.c sh-tdep.c shnbsd-nat.c shnbsd-tdep.c sparc-nat.c sparc64nbsd-nat.c sparcnbsd-nat.c ui-file.c user-regs.c varobj.c vaxbsd-nat.c src/external/gpl3/gdb/dist/gdb/common: agent.c src/external/gpl3/gdb/dist/gdb/tui: tui-stack.c src/external/gpl3/gdb/dist/opcodes: configure configure.in src/external/gpl3/gdb/dist/sim: configure src/external/gpl3/gdb/dist/sim/common: callback.c src/external/gpl3/gdb/dist/sim/mn10300: Makefile.in src/external/gpl3/gdb/dist/sim/v850: Makefile.in src/external/gpl3/gdb/lib/libbfd/arch/alpha: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/earm: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/i386: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/m68k: bfd-in3.h bfd.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/mipseb: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/mipsel: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/powerpc: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/sh3eb: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/sparc: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/sparc64: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/vax: bfd-in3.h bfd.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libbfd/arch/x86_64: bfd-in3.h bfd.h bfd_stdint.h bfdver.h config.h targmatch.h src/external/gpl3/gdb/lib/libdecnumber/arch/alpha: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/earm: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/i386: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/mipseb: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/mipsel: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/powerpc: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/sh3eb: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/sparc: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/sparc64: gstdint.h src/external/gpl3/gdb/lib/libdecnumber/arch/x86_64: gstdint.h src/external/gpl3/gdb/lib/libgdb: Makefile src/external/gpl3/gdb/lib/libgdb/arch/alpha: config.h defs.mk init.c jit-reader.h observer.h observer.inc version.c xml-builtin.c src/external/gpl3/gdb/lib/libgdb/arch/alpha/build-gnulib: config.h src/external/gpl3/gdb/lib/libgdb/arch/earm: config.h defs.mk init.c jit-reader.h observer.h observer.inc version.c xml-builtin.c src/external/gpl3/gdb/lib/libgdb/arch/earm/build-gnulib: config.h src/external/gpl3/gdb/lib/libgdb/arch/i386: config.h defs.mk init.c jit-reader.h observer.h observer.inc version.c xml-builtin.c src/external/gpl3/gdb/lib/libgdb/arch/i386/build-gnulib: config.h src/external/gpl3/gdb/lib/libgdb/arch/m68k: config.h defs.mk init.c jit-reader.h observer.h observer.inc version.c xml-builtin.c src/external/gpl3/gdb/lib/libgdb/arch/m68k/build-gnulib: config.h src/external/gpl3/gdb/lib/libgdb/arch/mipseb: config.h defs.mk init.c jit-reader.h observer.h observer.inc version.c xml-builtin.c src/external/gpl3/gdb/lib/libgdb/arch/mipseb/build-gnulib: config.h src/external/gpl3/gdb/lib/libgdb/arch/mipsel: config.h defs.mk init.c jit-reader.h observer.h
CVS commit: src/doc
Module Name:src Committed By: christos Date: Sun Jun 22 23:53:16 UTC 2014 Modified Files: src/doc: 3RDPARTY CHANGES Log Message: mention new gdb To generate a diff of this commit: cvs rdiff -u -r1.1124 -r1.1125 src/doc/3RDPARTY cvs rdiff -u -r1.1938 -r1.1939 src/doc/CHANGES Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/doc/3RDPARTY diff -u src/doc/3RDPARTY:1.1124 src/doc/3RDPARTY:1.1125 --- src/doc/3RDPARTY:1.1124 Tue Jun 17 14:48:35 2014 +++ src/doc/3RDPARTY Sun Jun 22 19:53:16 2014 @@ -1,4 +1,4 @@ -# $NetBSD: 3RDPARTY,v 1.1124 2014/06/17 18:48:35 alnsn Exp $ +# $NetBSD: 3RDPARTY,v 1.1125 2014/06/22 23:53:16 christos Exp $ # # This file contains a list of the software that has been integrated into # NetBSD where we are not the primary maintainer. @@ -400,7 +400,7 @@ Before importing a new version of extern - you can use the gcc2netbsd script for the above (except version) Package: gdb -Version: 7.6.1 +Version: 7.7.1 Current Vers: 7.7.1 Maintainer: FSF Archive Site: ftp://ftp.gnu.org/gnu/gdb/ Index: src/doc/CHANGES diff -u src/doc/CHANGES:1.1938 src/doc/CHANGES:1.1939 --- src/doc/CHANGES:1.1938 Mon Jun 16 05:12:30 2014 +++ src/doc/CHANGES Sun Jun 22 19:53:16 2014 @@ -1,4 +1,4 @@ -# LIST OF CHANGES FROM LAST RELEASE: $Revision: 1.1938 $ +# LIST OF CHANGES FROM LAST RELEASE: $Revision: 1.1939 $ # # # [Note: This file does not mention every change made to the NetBSD source tree. @@ -433,3 +433,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0: libc: Update to tzcode2014e. [christos 20140614] dhcpcd(8): Import dhcpcd-6.4.0 [roy 20140614] pigz(1): Update to pigz-2.3.1 [tls 20140615] + gdb(1): Updated to 7.7.1. [christos 20140622]
CVS commit: src/external/bsd/cron/dist
Module Name:src Committed By: christos Date: Mon Jun 23 01:00:48 UTC 2014 Modified Files: src/external/bsd/cron/dist: do_command.c Log Message: even more detailed logging To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/bsd/cron/dist/do_command.c 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/cron/dist/do_command.c diff -u src/external/bsd/cron/dist/do_command.c:1.4 src/external/bsd/cron/dist/do_command.c:1.5 --- src/external/bsd/cron/dist/do_command.c:1.4 Sat Jun 21 00:33:53 2014 +++ src/external/bsd/cron/dist/do_command.c Sun Jun 22 21:00:48 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: do_command.c,v 1.4 2014/06/21 04:33:53 dholland Exp $ */ +/* $NetBSD: do_command.c,v 1.5 2014/06/23 01:00:48 christos Exp $ */ /* Copyright 1988,1990,1993,1994 by Paul Vixie * All rights reserved @@ -25,7 +25,7 @@ #if 0 static char rcsid[] = Id: do_command.c,v 1.9 2004/01/23 18:56:42 vixie Exp; #else -__RCSID($NetBSD: do_command.c,v 1.4 2014/06/21 04:33:53 dholland Exp $); +__RCSID($NetBSD: do_command.c,v 1.5 2014/06/23 01:00:48 christos Exp $); #endif #endif @@ -71,7 +71,7 @@ static void child_process(entry *e) { int stdin_pipe[2], stdout_pipe[2]; char * volatile input_data; - char *usernm, * volatile mailto; + char *homedir, *usernm, * volatile mailto; int children = 0; Debug(DPROC, ([%ld] child_process('%s')\n, (long)getpid(), e-cmd)); @@ -243,33 +243,33 @@ child_process(entry *e) { } #else if (setgid(e-pwd-pw_gid) != 0) { - syslog(LOG_ERR, setgid failed for %s, - e-pwd-pw_name); + syslog(LOG_ERR, setgid(%d) failed for %s: %m, + e-pwd-pw_gid, e-pwd-pw_name); _exit(ERROR_EXIT); } if (initgroups(usernm, e-pwd-pw_gid) != 0) { - syslog(LOG_ERR, initgroups failed for %s, - e-pwd-pw_name); + syslog(LOG_ERR, initgroups(%s, %d) failed for %s: %m, + usernm, e-pwd-pw_gid, e-pwd-pw_name); _exit(ERROR_EXIT); } #if (defined(BSD)) (BSD = 199103) if (setlogin(usernm) 0) { - syslog(LOG_ERR, setlogin() failure for %s: %m, - e-pwd-pw_name); + syslog(LOG_ERR, setlogin(%s) failure for %s: %m, + usernm, e-pwd-pw_name); _exit(ERROR_EXIT); } #endif /* BSD */ if (setuid(e-pwd-pw_uid) != 0) { - syslog(LOG_ERR, setuid failed for %s, - e-pwd-pw_name); + syslog(LOG_ERR, setuid(%d) failed for %s: %m, + e-pwd-pw_uid, e-pwd-pw_name); _exit(ERROR_EXIT); } /* we aren't root after this... */ #endif /* LOGIN_CAP */ - - if (chdir(env_get(HOME, e-envp)) != 0) { - syslog(LOG_ERR, chdir $HOME failed for %s, - e-pwd-pw_name); + homedir = env_get(HOME, e-envp); + if (chdir(homedir) != 0) { + syslog(LOG_ERR, chdir(%s) $HOME failed for %s: %m, + homedir, e-pwd-pw_name); _exit(ERROR_EXIT); }
CVS commit: src/share/mk
Module Name:src Committed By: christos Date: Mon Jun 23 02:13:53 UTC 2014 Modified Files: src/share/mk: bsd.own.mk Log Message: unbreak powerpc64; it is not ready for gcc-4.8 ATM. To generate a diff of this commit: cvs rdiff -u -r1.815 -r1.816 src/share/mk/bsd.own.mk Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/mk/bsd.own.mk diff -u src/share/mk/bsd.own.mk:1.815 src/share/mk/bsd.own.mk:1.816 --- src/share/mk/bsd.own.mk:1.815 Fri Jun 6 17:04:02 2014 +++ src/share/mk/bsd.own.mk Sun Jun 22 22:13:53 2014 @@ -1,4 +1,4 @@ -# $NetBSD: bsd.own.mk,v 1.815 2014/06/06 21:04:02 skrll Exp $ +# $NetBSD: bsd.own.mk,v 1.816 2014/06/23 02:13:53 christos Exp $ # This needs to be before bsd.init.mk .if defined(BSD_MK_COMPAT_FILE) @@ -54,7 +54,8 @@ TOOLCHAIN_MISSING?= no # Platforms still using GCC 4.5 .if \ ${MACHINE_CPU} == m68k || \ - ${MACHINE_ARCH} == powerpc + ${MACHINE_ARCH} == powerpc || \ + ${MACHINE_ARCH} == powerpc64 HAVE_GCC?=45 .else
CVS commit: src/sys/arch/arm/include
Module Name:src Committed By: christos Date: Mon Jun 23 03:40:57 UTC 2014 Modified Files: src/sys/arch/arm/include: cdefs.h Log Message: unbreak lint To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/include/cdefs.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/arch/arm/include/cdefs.h diff -u src/sys/arch/arm/include/cdefs.h:1.14 src/sys/arch/arm/include/cdefs.h:1.15 --- src/sys/arch/arm/include/cdefs.h:1.14 Mon Mar 24 00:45:08 2014 +++ src/sys/arch/arm/include/cdefs.h Sun Jun 22 23:40:57 2014 @@ -1,11 +1,13 @@ -/* $NetBSD: cdefs.h,v 1.14 2014/03/24 04:45:08 matt Exp $ */ +/* $NetBSD: cdefs.h,v 1.15 2014/06/23 03:40:57 christos Exp $ */ #ifndef _ARM_CDEFS_H_ #define _ARM_CDEFS_H_ +#ifndef __lint__ #if (__GNUC__ == 4 __GNUC_MINOR__ 1) || __GNUC__ 4 #error GCC 4.1 or compatible required. #endif +#endif #if defined (__ARM_ARCH_8A__) #define _ARM_ARCH_8 /* ARMv8 64-bit in AARCH32 */