CVS commit: src/sys/compat/netbsd32

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 10:36:18 UTC 2014

Modified Files:
src/sys/compat/netbsd32: syscalls.master

Log Message:
Rename argument like the native syscall.


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/compat/netbsd32/syscalls.master

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/syscalls.master
diff -u src/sys/compat/netbsd32/syscalls.master:1.100 src/sys/compat/netbsd32/syscalls.master:1.101
--- src/sys/compat/netbsd32/syscalls.master:1.100	Thu May 15 09:54:06 2014
+++ src/sys/compat/netbsd32/syscalls.master	Fri Jun 13 10:36:18 2014
@@ -1,4 +1,4 @@
-	$NetBSD: syscalls.master,v 1.100 2014/05/15 09:54:06 njoly Exp $
+	$NetBSD: syscalls.master,v 1.101 2014/06/13 10:36:18 joerg Exp $
 
 ;	from: NetBSD: syscalls.master,v 1.81 1998/07/05 08:49:50 jonathan Exp
 ;	@(#)syscalls.master	8.2 (Berkeley) 1/13/94
@@ -412,8 +412,8 @@
 201	STD		{ int|netbsd32||ftruncate(int fd, int PAD, \
 			netbsd32_off_t length); }
 202	STD		{ int|netbsd32||__sysctl(netbsd32_intp name, \
-			u_int namelen, netbsd32_voidp old, \
-			netbsd32_size_tp oldlenp, netbsd32_voidp new, \
+			u_int namelen, netbsd32_voidp oldv, \
+			netbsd32_size_tp oldlenp, netbsd32_voidp newv, \
 			netbsd32_size_t newlen); }
 203	STD		{ int|netbsd32||mlock(netbsd32_voidp addr, \
 			netbsd32_size_t len); }



CVS commit: src/sys/compat/netbsd32

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 10:37:02 UTC 2014

Modified Files:
src/sys/compat/netbsd32: netbsd32.h netbsd32_netbsd.c

Log Message:
delete - remove


To generate a diff of this commit:
cvs rdiff -u -r1.100 -r1.101 src/sys/compat/netbsd32/netbsd32.h
cvs rdiff -u -r1.188 -r1.189 src/sys/compat/netbsd32/netbsd32_netbsd.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.h
diff -u src/sys/compat/netbsd32/netbsd32.h:1.100 src/sys/compat/netbsd32/netbsd32.h:1.101
--- src/sys/compat/netbsd32/netbsd32.h:1.100	Wed Apr 30 17:23:45 2014
+++ src/sys/compat/netbsd32/netbsd32.h	Fri Jun 13 10:37:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32.h,v 1.100 2014/04/30 17:23:45 njoly Exp $	*/
+/*	$NetBSD: netbsd32.h,v 1.101 2014/06/13 10:37:02 joerg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001, 2008 Matthew R. Green
@@ -300,7 +300,7 @@ struct netbsd32_quotactlargs {
 		} put;
 		struct {
 			netbsd32_pointer_t qc_key;
-		} delete;
+		} remove;
 		struct {
 			netbsd32_pointer_t qc_cursor;
 		} cursoropen;

Index: src/sys/compat/netbsd32/netbsd32_netbsd.c
diff -u src/sys/compat/netbsd32/netbsd32_netbsd.c:1.188 src/sys/compat/netbsd32/netbsd32_netbsd.c:1.189
--- src/sys/compat/netbsd32/netbsd32_netbsd.c:1.188	Thu Jun 12 21:39:45 2014
+++ src/sys/compat/netbsd32/netbsd32_netbsd.c	Fri Jun 13 10:37:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_netbsd.c,v 1.188 2014/06/12 21:39:45 joerg Exp $	*/
+/*	$NetBSD: netbsd32_netbsd.c,v 1.189 2014/06/13 10:37:02 joerg 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.188 2014/06/12 21:39:45 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_netbsd.c,v 1.189 2014/06/13 10:37:02 joerg Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ddb.h
@@ -1236,7 +1236,7 @@ netbsd32___quotactl(struct lwp *l, const
 		args.u.put.qc_val = NETBSD32PTR64(args32.u.put.qc_val);
 		break;
 	case QUOTACTL_DELETE:
-		args.u.remove.qc_key = NETBSD32PTR64(args32.u.delete.qc_key);
+		args.u.remove.qc_key = NETBSD32PTR64(args32.u.remove.qc_key);
 		break;
 	case QUOTACTL_CURSOROPEN:
 		args.u.cursoropen.qc_cursor =



CVS commit: src/sys/compat/netbsd32

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 10:37:22 UTC 2014

Modified Files:
src/sys/compat/netbsd32: netbsd32_syscall.h netbsd32_syscallargs.h
netbsd32_syscalls.c netbsd32_sysent.c

Log Message:
Regnerate


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/compat/netbsd32/netbsd32_syscall.h \
src/sys/compat/netbsd32/netbsd32_syscallargs.h
cvs rdiff -u -r1.107 -r1.108 src/sys/compat/netbsd32/netbsd32_syscalls.c \
src/sys/compat/netbsd32/netbsd32_sysent.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_syscall.h
diff -u src/sys/compat/netbsd32/netbsd32_syscall.h:1.108 src/sys/compat/netbsd32/netbsd32_syscall.h:1.109
--- src/sys/compat/netbsd32/netbsd32_syscall.h:1.108	Thu May 15 09:55:11 2014
+++ src/sys/compat/netbsd32/netbsd32_syscall.h	Fri Jun 13 10:37:22 2014
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscall.h,v 1.108 2014/05/15 09:55:11 njoly Exp $ */
+/* $NetBSD: netbsd32_syscall.h,v 1.109 2014/06/13 10:37:22 joerg Exp $ */
 
 /*
  * System call numbers.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.100 2014/05/15 09:54:06 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.101 2014/06/13 10:36:18 joerg Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALL_H_
Index: src/sys/compat/netbsd32/netbsd32_syscallargs.h
diff -u src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.108 src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.109
--- src/sys/compat/netbsd32/netbsd32_syscallargs.h:1.108	Thu May 15 09:55:11 2014
+++ src/sys/compat/netbsd32/netbsd32_syscallargs.h	Fri Jun 13 10:37:22 2014
@@ -1,10 +1,10 @@
-/* $NetBSD: netbsd32_syscallargs.h,v 1.108 2014/05/15 09:55:11 njoly Exp $ */
+/* $NetBSD: netbsd32_syscallargs.h,v 1.109 2014/06/13 10:37:22 joerg Exp $ */
 
 /*
  * System call argument lists.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.100 2014/05/15 09:54:06 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.101 2014/06/13 10:36:18 joerg Exp
  */
 
 #ifndef _NETBSD32_SYS_SYSCALLARGS_H_
@@ -1038,9 +1038,9 @@ check_syscall_args(netbsd32_ftruncate)
 struct netbsd32___sysctl_args {
 	syscallarg(netbsd32_intp) name;
 	syscallarg(u_int) namelen;
-	syscallarg(netbsd32_voidp) old;
+	syscallarg(netbsd32_voidp) oldv;
 	syscallarg(netbsd32_size_tp) oldlenp;
-	syscallarg(netbsd32_voidp) new;
+	syscallarg(netbsd32_voidp) newv;
 	syscallarg(netbsd32_size_t) newlen;
 };
 check_syscall_args(netbsd32___sysctl)

Index: src/sys/compat/netbsd32/netbsd32_syscalls.c
diff -u src/sys/compat/netbsd32/netbsd32_syscalls.c:1.107 src/sys/compat/netbsd32/netbsd32_syscalls.c:1.108
--- src/sys/compat/netbsd32/netbsd32_syscalls.c:1.107	Thu May 15 09:55:11 2014
+++ src/sys/compat/netbsd32/netbsd32_syscalls.c	Fri Jun 13 10:37:22 2014
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_syscalls.c,v 1.107 2014/05/15 09:55:11 njoly Exp $ */
+/* $NetBSD: netbsd32_syscalls.c,v 1.108 2014/06/13 10:37:22 joerg Exp $ */
 
 /*
  * System call names.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.100 2014/05/15 09:54:06 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.101 2014/06/13 10:36:18 joerg Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.107 2014/05/15 09:55:11 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_syscalls.c,v 1.108 2014/06/13 10:37:22 joerg Exp $);
 
 #if defined(_KERNEL_OPT)
 #if defined(_KERNEL_OPT)
Index: src/sys/compat/netbsd32/netbsd32_sysent.c
diff -u src/sys/compat/netbsd32/netbsd32_sysent.c:1.107 src/sys/compat/netbsd32/netbsd32_sysent.c:1.108
--- src/sys/compat/netbsd32/netbsd32_sysent.c:1.107	Thu May 15 09:55:11 2014
+++ src/sys/compat/netbsd32/netbsd32_sysent.c	Fri Jun 13 10:37:22 2014
@@ -1,14 +1,14 @@
-/* $NetBSD: netbsd32_sysent.c,v 1.107 2014/05/15 09:55:11 njoly Exp $ */
+/* $NetBSD: netbsd32_sysent.c,v 1.108 2014/06/13 10:37:22 joerg Exp $ */
 
 /*
  * System call switch table.
  *
  * DO NOT EDIT-- this file is automatically generated.
- * created from	NetBSD: syscalls.master,v 1.100 2014/05/15 09:54:06 njoly Exp
+ * created from	NetBSD: syscalls.master,v 1.101 2014/06/13 10:36:18 joerg Exp
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_sysent.c,v 1.107 2014/05/15 09:55:11 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_sysent.c,v 1.108 2014/06/13 10:37:22 joerg Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_compat_netbsd.h



CVS commit: src/sys/compat/netbsd32

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 10:42:26 UTC 2014

Modified Files:
src/sys/compat/netbsd32: netbsd32_sysctl.c

Log Message:
Rename stack gap arguments.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/compat/netbsd32/netbsd32_sysctl.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_sysctl.c
diff -u src/sys/compat/netbsd32/netbsd32_sysctl.c:1.34 src/sys/compat/netbsd32/netbsd32_sysctl.c:1.35
--- src/sys/compat/netbsd32/netbsd32_sysctl.c:1.34	Fri May 16 12:22:32 2014
+++ src/sys/compat/netbsd32/netbsd32_sysctl.c	Fri Jun 13 10:42:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: netbsd32_sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $	*/
+/*	$NetBSD: netbsd32_sysctl.c,v 1.35 2014/06/13 10:42:26 joerg Exp $	*/
 
 /*
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: netbsd32_sysctl.c,v 1.34 2014/05/16 12:22:32 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: netbsd32_sysctl.c,v 1.35 2014/06/13 10:42:26 joerg Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_ddb.h
@@ -186,8 +186,8 @@ netbsd32___sysctl(struct lwp *l, const s
 	 * get and convert 32 bit size_t to native size_t
 	 */
 	namep = SCARG_P32(uap, name);
-	oldp = SCARG_P32(uap, old);
-	newp = SCARG_P32(uap, new);
+	oldp = SCARG_P32(uap, oldv);
+	newp = SCARG_P32(uap, newv);
 	oldlenp = SCARG_P32(uap, oldlenp);
 	oldlen = 0;
 	if (oldlenp != NULL) {



CVS commit: src/usr.bin/vmstat

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 11:26:37 UTC 2014

Modified Files:
src/usr.bin/vmstat: drvstats.c

Log Message:
Remove unused headers.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/vmstat/drvstats.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/vmstat/drvstats.c
diff -u src/usr.bin/vmstat/drvstats.c:1.8 src/usr.bin/vmstat/drvstats.c:1.9
--- src/usr.bin/vmstat/drvstats.c:1.8	Mon Jun  2 22:57:50 2014
+++ src/usr.bin/vmstat/drvstats.c	Fri Jun 13 11:26:37 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: drvstats.c,v 1.8 2014/06/02 22:57:50 joerg Exp $	*/
+/*	$NetBSD: drvstats.c,v 1.9 2014/06/13 11:26:37 joerg Exp $	*/
 
 /*
  * Copyright (c) 1996 John M. Vinopal
@@ -40,9 +40,7 @@
 
 #include err.h
 #include fcntl.h
-#include kvm.h
 #include limits.h
-#include nlist.h
 #include stdio.h
 #include stdlib.h
 #include string.h



CVS commit: src/sys/rump/librump/rumpkern

2014-06-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 13 11:48:56 UTC 2014

Modified Files:
src/sys/rump/librump/rumpkern: vm.c

Log Message:
fill in a few more uvmexp entries


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/rump/librump/rumpkern/vm.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/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.156 src/sys/rump/librump/rumpkern/vm.c:1.157
--- src/sys/rump/librump/rumpkern/vm.c:1.156	Fri Apr 25 13:20:45 2014
+++ src/sys/rump/librump/rumpkern/vm.c	Fri Jun 13 11:48:56 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.156 2014/04/25 13:20:45 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.157 2014/06/13 11:48:56 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.156 2014/04/25 13:20:45 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.157 2014/06/13 11:48:56 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -306,15 +306,15 @@ uvm_init(void)
 
 		if (rump_physmemlimit / mult != tmp)
 			panic(uvm_init: RUMP_MEMLIMIT overflow: %s, buf);
-		/* it's not like we'd get far with, say, 1 byte, but ... */
-		if (rump_physmemlimit  1024*1024)
-			printf(uvm_init: WARNING: 1MB RAM limit, 
-			hope you know what you're doing\n);
 
 		/* reserve some memory for the pager */
 		pdlimit = rump_physmemlimit;
 		rump_physmemlimit -= 2*MAXPHYS;
 
+		if (pdlimit  1024*1024)
+			printf(uvm_init: WARNING: 1MB RAM limit, 
+			hope you know what you're doing\n);
+
 #define HUMANIZE_BYTES 9
 		CTASSERT(sizeof(buf) = HUMANIZE_BYTES);
 		format_bytes(buf, HUMANIZE_BYTES, rump_physmemlimit);
@@ -327,7 +327,21 @@ uvm_init(void)
 
 	TAILQ_INIT(vmpage_lruqueue);
 
-	uvmexp.free = 1024*1024; /* XXX: arbitrary  not updated */
+	if (rump_physmemlimit == RUMPMEM_UNLIMITED) {
+		uvmexp.npages = physmem;
+	} else {
+		uvmexp.npages = pdlimit  PAGE_SHIFT;
+		uvmexp.reserve_pagedaemon
+		= (pdlimit-rump_physmemlimit)  PAGE_SHIFT;
+		uvmexp.freetarg = (rump_physmemlimit-dddlim)  PAGE_SHIFT;
+	}
+	/*
+	 * uvmexp.free is not used internally or updated.  The reason is
+	 * that the memory hypercall allocator is allowed to allocate
+	 * non-page sized chunks.  We use a byte count in curphysmem
+	 * instead.
+	 */
+	uvmexp.free = uvmexp.npages;
 
 #ifndef __uvmexp_pagesize
 	uvmexp.pagesize = PAGE_SIZE;



CVS commit: src/sys/rump/librump/rumpkern

2014-06-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 13 11:53:48 UTC 2014

Modified Files:
src/sys/rump/librump/rumpkern: vm.c

Log Message:
make sure we don't underflow the memlimit


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/rump/librump/rumpkern/vm.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/vm.c
diff -u src/sys/rump/librump/rumpkern/vm.c:1.157 src/sys/rump/librump/rumpkern/vm.c:1.158
--- src/sys/rump/librump/rumpkern/vm.c:1.157	Fri Jun 13 11:48:56 2014
+++ src/sys/rump/librump/rumpkern/vm.c	Fri Jun 13 11:53:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: vm.c,v 1.157 2014/06/13 11:48:56 pooka Exp $	*/
+/*	$NetBSD: vm.c,v 1.158 2014/06/13 11:53:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.157 2014/06/13 11:48:56 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: vm.c,v 1.158 2014/06/13 11:53:48 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -100,6 +100,7 @@ static unsigned long curphysmem;
 static unsigned long dddlim;		/* 90% of memory limit used */
 #define NEED_PAGEDAEMON() \
 (rump_physmemlimit != RUMPMEM_UNLIMITED  curphysmem  dddlim)
+#define PDRESERVE (2*MAXPHYS)
 
 /*
  * Try to free two pages worth of pages from objects.
@@ -308,8 +309,12 @@ uvm_init(void)
 			panic(uvm_init: RUMP_MEMLIMIT overflow: %s, buf);
 
 		/* reserve some memory for the pager */
+		if (rump_physmemlimit = PDRESERVE)
+			panic(uvm_init: system reserves %d bytes of mem, 
+			only %lu bytes given,
+			PDRESERVE, rump_physmemlimit);
 		pdlimit = rump_physmemlimit;
-		rump_physmemlimit -= 2*MAXPHYS;
+		rump_physmemlimit -= PDRESERVE;
 
 		if (pdlimit  1024*1024)
 			printf(uvm_init: WARNING: 1MB RAM limit, 
@@ -331,8 +336,7 @@ uvm_init(void)
 		uvmexp.npages = physmem;
 	} else {
 		uvmexp.npages = pdlimit  PAGE_SHIFT;
-		uvmexp.reserve_pagedaemon
-		= (pdlimit-rump_physmemlimit)  PAGE_SHIFT;
+		uvmexp.reserve_pagedaemon = PDRESERVE  PAGE_SHIFT;
 		uvmexp.freetarg = (rump_physmemlimit-dddlim)  PAGE_SHIFT;
 	}
 	/*



CVS commit: src/sys/fs/tmpfs

2014-06-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 13 11:57:48 UTC 2014

Modified Files:
src/sys/fs/tmpfs: tmpfs_mem.c

Log Message:
use psize_t for physical memory calculation


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/fs/tmpfs/tmpfs_mem.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/tmpfs/tmpfs_mem.c
diff -u src/sys/fs/tmpfs/tmpfs_mem.c:1.7 src/sys/fs/tmpfs/tmpfs_mem.c:1.8
--- src/sys/fs/tmpfs/tmpfs_mem.c:1.7	Tue Jun 10 15:44:27 2014
+++ src/sys/fs/tmpfs/tmpfs_mem.c	Fri Jun 13 11:57:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: tmpfs_mem.c,v 1.7 2014/06/10 15:44:27 martin Exp $	*/
+/*	$NetBSD: tmpfs_mem.c,v 1.8 2014/06/13 11:57:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: tmpfs_mem.c,v 1.7 2014/06/10 15:44:27 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: tmpfs_mem.c,v 1.8 2014/06/13 11:57:48 pooka Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -115,7 +115,7 @@ tmpfs_mem_info(bool total)
 uint64_t
 tmpfs_bytes_max(struct tmpfs_mount *mp)
 {
-	size_t freepages = tmpfs_mem_info(false);
+	psize_t freepages = tmpfs_mem_info(false);
 	uint64_t avail_mem;
 
 	if (freepages  uvmexp.freetarg) {
@@ -123,8 +123,7 @@ tmpfs_bytes_max(struct tmpfs_mount *mp)
 	} else {
 		freepages -= uvmexp.freetarg;
 	}
-	avail_mem = round_page(mp-tm_bytes_used)
-	+ ((uint64_t)freepages  PAGE_SHIFT);
+	avail_mem = round_page(mp-tm_bytes_used) + (freepages  PAGE_SHIFT);
 	return MIN(mp-tm_mem_limit, avail_mem);
 }
 



CVS commit: src/external/bsd/file/dist/src

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 13:38:53 UTC 2014

Modified Files:
src/external/bsd/file/dist/src: readelf.c

Log Message:
Initialise all fields.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/file/dist/src/readelf.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/file/dist/src/readelf.c
diff -u src/external/bsd/file/dist/src/readelf.c:1.8 src/external/bsd/file/dist/src/readelf.c:1.9
--- src/external/bsd/file/dist/src/readelf.c:1.8	Fri Jun 13 02:08:06 2014
+++ src/external/bsd/file/dist/src/readelf.c	Fri Jun 13 13:38:52 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: readelf.c,v 1.8 2014/06/13 02:08:06 christos Exp $	*/
+/*	$NetBSD: readelf.c,v 1.9 2014/06/13 13:38:52 joerg Exp $	*/
 /*
  * Copyright (c) Christos Zoulas 2003.
  * All Rights Reserved.
@@ -31,7 +31,7 @@
 #if 0
 FILE_RCSID(@(#)$File: readelf.c,v 1.103 2014/05/02 02:25:10 christos Exp $)
 #else
-__RCSID($NetBSD: readelf.c,v 1.8 2014/06/13 02:08:06 christos Exp $);
+__RCSID($NetBSD: readelf.c,v 1.9 2014/06/13 13:38:52 joerg Exp $);
 #endif
 #endif
 
@@ -473,8 +473,8 @@ private size_t
 donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
 int clazz, int swap, size_t align, int *flags)
 {
-	Elf32_Nhdr nh32 = { 0 };
-	Elf64_Nhdr nh64 = { 0 };
+	Elf32_Nhdr nh32 = { 0, 0, 0 };
+	Elf64_Nhdr nh64 = { 0, 0, 0 };
 	size_t noff, doff;
 #ifdef ELFCORE
 	int os_style = -1;



CVS commit: src/sys/net

2014-06-13 Thread Mindaugas Rasiukevicius
Module Name:src
Committed By:   rmind
Date:   Fri Jun 13 13:54:08 UTC 2014

Modified Files:
src/sys/net: if.c

Log Message:
if_detach: drain ip6_pktq as well.


To generate a diff of this commit:
cvs rdiff -u -r1.280 -r1.281 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.280 src/sys/net/if.c:1.281
--- src/sys/net/if.c:1.280	Tue Jun 10 09:38:30 2014
+++ src/sys/net/if.c	Fri Jun 13 13:54:08 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if.c,v 1.280 2014/06/10 09:38:30 joerg Exp $	*/
+/*	$NetBSD: if.c,v 1.281 2014/06/13 13:54:08 rmind Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -90,7 +90,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if.c,v 1.280 2014/06/10 09:38:30 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if.c,v 1.281 2014/06/13 13:54:08 rmind Exp $);
 
 #include opt_inet.h
 
@@ -875,6 +875,9 @@ again:
 #ifdef INET
 	pktq_barrier(ip_pktq);
 #endif
+#ifdef INET6
+	pktq_barrier(ip6_pktq);
+#endif
 	xc = xc_broadcast(0, (xcfunc_t)nullop, NULL, NULL);
 	xc_wait(xc);
 



CVS commit: src

2014-06-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 13 15:45:02 UTC 2014

Modified Files:
src/lib/librumpvfs: rump_etfs.3
src/sys/rump/include/rump: rump.h
src/sys/rump/librump/rumpkern: rump.c
src/sys/rump/librump/rumpvfs: rumpfs.c

Log Message:
Add rump_boot_etfs_register(), which can be used to specify etfs
nodes that will be available immediately when mountroot is done
and file systems are available.

The intended use is for example for firmware images to be available when
config_mountroot() hooks run.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/lib/librumpvfs/rump_etfs.3
cvs rdiff -u -r1.62 -r1.63 src/sys/rump/include/rump/rump.h
cvs rdiff -u -r1.305 -r1.306 src/sys/rump/librump/rumpkern/rump.c
cvs rdiff -u -r1.128 -r1.129 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/lib/librumpvfs/rump_etfs.3
diff -u src/lib/librumpvfs/rump_etfs.3:1.6 src/lib/librumpvfs/rump_etfs.3:1.7
--- src/lib/librumpvfs/rump_etfs.3:1.6	Thu Dec 19 15:51:39 2013
+++ src/lib/librumpvfs/rump_etfs.3	Fri Jun 13 15:45:01 2014
@@ -1,4 +1,4 @@
-.\ $NetBSD: rump_etfs.3,v 1.6 2013/12/19 15:51:39 pooka Exp $
+.\ $NetBSD: rump_etfs.3,v 1.7 2014/06/13 15:45:01 pooka Exp $
 .\
 .\ Copyright (c) 2010 Antti Kantee.  All rights reserved.
 .\
@@ -23,7 +23,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd December 19, 2013
+.Dd June 13, 2014
 .Dt RUMP_ETFS 3
 .Os
 .Sh NAME
@@ -42,6 +42,8 @@ rump kernel (librump, \-lrump)
 .Fa const char *key const char *hostpath enum rump_etfs_type ftype
 .Fa uint64_t begin uint64_t size
 .Fc
+.Ft void
+.Fn rump_boot_etfs_register struct rump_boot_etfs *eb
 .Ft int
 .Fn rump_pub_etfs_remove const char *key
 .Sh DESCRIPTION
@@ -128,6 +130,56 @@ is given the special value
 the underlying file is mapped from
 .Ar begin
 to the end of the file.
+.It Fn rump_boot_etfs_register eb
+Unlike the above interfaces,
+.Fn rump_boot_etfs_register
+can and must be called before
+.Fn rump_init .
+It causes an etfs key to be available immediately when the root file
+system is mounted as part of
+.Fn rump_init .
+The intended use is for example for firmware images to be available
+immediately when device driver autoconfiguration is run as part of
+.Fn rump_init .
+.Pp
+To use
+.Fn rump_boot_etfs_register ,
+the client fills out
+.Fa eb .
+The layout of
+.Fa eb
+is as follows:
+.Bd -literal
+struct rump_boot_etfs {
+	/* client initializes */
+	const char *eb_key;
+	const char *eb_hostpath;
+	enum rump_etfs_type eb_type;
+	uint64_t eb_begin;
+	uint64_t eb_size;
+
+	/* rump kernel initializes */
+	struct rump_boot_etfs *_eb_next;
+	int eb_status;
+};
+.Ed
+.Pp
+All of the client fields must be initialized before the call.
+See
+.Fn rump_pub_etfs_register_withsize
+for descriptions of the fields.
+After the function has been called, the client may not touch the
+structure memory or the pathname pointers.
+After
+.Fn rump_init
+returns, the client may check the status of the registration from
+.Fa eb_status
+and free the structure.
+A value of \-1 designates that the etfs registration was not
+performed, 0 designates success and a value larger than 0 designates
+an errno.
+The client must serialize calls to
+.Fn rump_boot_etfs_register .
 .It Fn rump_pub_etfs_remove key
 Remove etfs mapping for
 .Fa key .

Index: src/sys/rump/include/rump/rump.h
diff -u src/sys/rump/include/rump/rump.h:1.62 src/sys/rump/include/rump/rump.h:1.63
--- src/sys/rump/include/rump/rump.h:1.62	Wed Apr  2 17:09:23 2014
+++ src/sys/rump/include/rump/rump.h	Fri Jun 13 15:45:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.h,v 1.62 2014/04/02 17:09:23 justin Exp $	*/
+/*	$NetBSD: rump.h,v 1.63 2014/06/13 15:45:02 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -108,6 +108,20 @@ int	rump_boot_gethowto(void);
 void	rump_boot_sethowto(int);
 void	rump_boot_setsigmodel(enum rump_sigmodel);
 
+struct rump_boot_etfs {
+	/* client initializes */
+	const char *eb_key;
+	const char *eb_hostpath;
+	enum rump_etfs_type eb_type;
+	uint64_t eb_begin;
+	uint64_t eb_size;
+
+	/* rump kernel initializes */
+	struct rump_boot_etfs *_eb_next;
+	int eb_status;
+};
+void	rump_boot_etfs_register(struct rump_boot_etfs *);
+
 void	rump_schedule(void);
 void	rump_unschedule(void);
 

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.305 src/sys/rump/librump/rumpkern/rump.c:1.306
--- src/sys/rump/librump/rumpkern/rump.c:1.305	Sun May 25 16:31:51 2014
+++ src/sys/rump/librump/rumpkern/rump.c	Fri Jun 13 15:45:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.305 2014/05/25 16:31:51 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.306 2014/06/13 15:45:02 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007-2011 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 

CVS commit: src

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 15:45:05 UTC 2014

Modified Files:
src/distrib/sets/lists/base: ad.arm ad.mips ad.powerpc md.amd64
md.sparc64 shl.mi
src/distrib/sets/lists/debug: ad.arm ad.mips ad.powerpc md.amd64
md.sparc64 shl.mi
src/lib/libc: shlib_version
src/lib/libc/gen: Makefile.inc sysctl.3
src/lib/libc/include: namespace.h
src/sys/sys: sysctl.h
Added Files:
src/lib/libc/gen: asysctl.c

Log Message:
Add asysctl(3) and asysctlbyname(3) wrappers for the common idiom of
fetching dynamically sized data via sysctl.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/distrib/sets/lists/base/ad.arm
cvs rdiff -u -r1.40 -r1.41 src/distrib/sets/lists/base/ad.mips
cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/base/ad.powerpc
cvs rdiff -u -r1.234 -r1.235 src/distrib/sets/lists/base/md.amd64
cvs rdiff -u -r1.221 -r1.222 src/distrib/sets/lists/base/md.sparc64
cvs rdiff -u -r1.703 -r1.704 src/distrib/sets/lists/base/shl.mi
cvs rdiff -u -r1.34 -r1.35 src/distrib/sets/lists/debug/ad.arm
cvs rdiff -u -r1.30 -r1.31 src/distrib/sets/lists/debug/ad.mips
cvs rdiff -u -r1.9 -r1.10 src/distrib/sets/lists/debug/ad.powerpc
cvs rdiff -u -r1.53 -r1.54 src/distrib/sets/lists/debug/md.amd64
cvs rdiff -u -r1.52 -r1.53 src/distrib/sets/lists/debug/md.sparc64
cvs rdiff -u -r1.63 -r1.64 src/distrib/sets/lists/debug/shl.mi
cvs rdiff -u -r1.250 -r1.251 src/lib/libc/shlib_version
cvs rdiff -u -r1.187 -r1.188 src/lib/libc/gen/Makefile.inc
cvs rdiff -u -r0 -r1.1 src/lib/libc/gen/asysctl.c
cvs rdiff -u -r1.200 -r1.201 src/lib/libc/gen/sysctl.3
cvs rdiff -u -r1.173 -r1.174 src/lib/libc/include/namespace.h
cvs rdiff -u -r1.211 -r1.212 src/sys/sys/sysctl.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/distrib/sets/lists/base/ad.arm
diff -u src/distrib/sets/lists/base/ad.arm:1.44 src/distrib/sets/lists/base/ad.arm:1.45
--- src/distrib/sets/lists/base/ad.arm:1.44	Wed May 28 11:32:50 2014
+++ src/distrib/sets/lists/base/ad.arm	Fri Jun 13 15:45:05 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.arm,v 1.44 2014/05/28 11:32:50 tron Exp $
+# $NetBSD: ad.arm,v 1.45 2014/06/13 15:45:05 joerg Exp $
 ./lib/oabi	base-compat-shlib	compat
 ./lib/oabi/npf	base-npf-shlib		compat
 ./lib/oabi/npf/ext_log.so			base-npf-shlib		compat,pic
@@ -92,7 +92,7 @@
 ./usr/lib/oabi/libc++.so.1			base-compat-shlib	compat,pic,libcxx
 ./usr/lib/oabi/libc++.so.1.0			base-compat-shlib	compat,pic,libcxx
 ./usr/lib/oabi/libc.so.12			base-compat-shlib	compat,pic
-./usr/lib/oabi/libc.so.12.190			base-compat-shlib	compat,pic
+./usr/lib/oabi/libc.so.12.191			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libc_vfp.so.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libc_vfp.so.0.0			base-compat-shlib	compat,pic
 ./usr/lib/oabi/libcom_err.so.7			base-compat-shlib	compat,pic,kerberos

Index: src/distrib/sets/lists/base/ad.mips
diff -u src/distrib/sets/lists/base/ad.mips:1.40 src/distrib/sets/lists/base/ad.mips:1.41
--- src/distrib/sets/lists/base/ad.mips:1.40	Wed May 28 11:32:50 2014
+++ src/distrib/sets/lists/base/ad.mips	Fri Jun 13 15:45:05 2014
@@ -1,4 +1,4 @@
-# $NetBSD: ad.mips,v 1.40 2014/05/28 11:32:50 tron Exp $
+# $NetBSD: ad.mips,v 1.41 2014/06/13 15:45:05 joerg Exp $
 ./lib/64	base-compat-shlib	compat,arch64
 ./lib/64/npf	base-npf-shlib		compat,arch64
 ./lib/64/npf/ext_log.sobase-npf-shlib		compat,pic,arch64
@@ -94,7 +94,7 @@
 ./usr/lib/64/libc++.so.1			base-compat-shlib	compat,pic,libcxx,arch64
 ./usr/lib/64/libc++.so.1.0			base-compat-shlib	compat,pic,libcxx,arch64
 ./usr/lib/64/libc.so.12base-compat-shlib	compat,pic,arch64
-./usr/lib/64/libc.so.12.190			base-compat-shlib	compat,pic,arch64
+./usr/lib/64/libc.so.12.191			base-compat-shlib	compat,pic,arch64
 ./usr/lib/64/libcom_err.so.7			base-compat-shlib	compat,pic,kerberos,arch64
 ./usr/lib/64/libcom_err.so.7.0			base-compat-shlib	compat,pic,kerberos,arch64
 ./usr/lib/64/libcrypt.so.1			base-compat-shlib	compat,pic,arch64
@@ -434,7 +434,7 @@
 ./usr/lib/o32/libc++.so.1			base-compat-shlib	compat,pic,libcxx,arch64
 ./usr/lib/o32/libc++.so.1.0			base-compat-shlib	compat,pic,libcxx,arch64
 ./usr/lib/o32/libc.so.12			base-compat-shlib	compat,pic,arch64
-./usr/lib/o32/libc.so.12.190			base-compat-shlib	compat,pic,arch64
+./usr/lib/o32/libc.so.12.191			base-compat-shlib	compat,pic,arch64
 ./usr/lib/o32/libcom_err.so.7			base-compat-shlib	compat,pic,kerberos,arch64
 ./usr/lib/o32/libcom_err.so.7.0			base-compat-shlib	compat,pic,kerberos,arch64
 ./usr/lib/o32/libcrypt.so.1			base-compat-shlib	compat,pic,arch64

Index: src/distrib/sets/lists/base/ad.powerpc
diff -u src/distrib/sets/lists/base/ad.powerpc:1.9 src/distrib/sets/lists/base/ad.powerpc:1.10
--- src/distrib/sets/lists/base/ad.powerpc:1.9	Wed May 28 11:32:50 2014
+++ src/distrib/sets/lists/base/ad.powerpc	Fri Jun 13 15:45:05 2014
@@ 

CVS commit: src/sys/rump/librump/rumpdev

2014-06-13 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Fri Jun 13 15:51:13 UTC 2014

Modified Files:
src/sys/rump/librump/rumpdev: rump_dev.c

Log Message:
call config_create_mountrootthreads(), if applicable


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/rump/librump/rumpdev/rump_dev.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/rumpdev/rump_dev.c
diff -u src/sys/rump/librump/rumpdev/rump_dev.c:1.25 src/sys/rump/librump/rumpdev/rump_dev.c:1.26
--- src/sys/rump/librump/rumpdev/rump_dev.c:1.25	Fri Apr  4 01:35:11 2014
+++ src/sys/rump/librump/rumpdev/rump_dev.c	Fri Jun 13 15:51:13 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_dev.c,v 1.25 2014/04/04 01:35:11 christos Exp $	*/
+/*	$NetBSD: rump_dev.c,v 1.26 2014/06/13 15:51:13 pooka Exp $	*/
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_dev.c,v 1.25 2014/04/04 01:35:11 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_dev.c,v 1.26 2014/06/13 15:51:13 pooka Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -72,6 +72,12 @@ RUMP_COMPONENT(RUMP__FACTION_DEV)
 	config_finalize();
 
 	KERNEL_UNLOCK_LAST(curlwp);
+
+	/* if there is a vfs, perform activity deferred until mountroot */
+	if (rump_component_count(RUMP__FACTION_VFS)) {
+		config_create_mountrootthreads();
+		yield();
+	}
 }
 
 void



CVS commit: src/usr.sbin/mlxctl

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 16:00:55 UTC 2014

Modified Files:
src/usr.sbin/mlxctl: dklist.c

Log Message:
Use asysctl.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/usr.sbin/mlxctl/dklist.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.sbin/mlxctl/dklist.c
diff -u src/usr.sbin/mlxctl/dklist.c:1.10 src/usr.sbin/mlxctl/dklist.c:1.11
--- src/usr.sbin/mlxctl/dklist.c:1.10	Wed Jun 11 14:51:49 2014
+++ src/usr.sbin/mlxctl/dklist.c	Fri Jun 13 16:00:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dklist.c,v 1.10 2014/06/11 14:51:49 joerg Exp $	*/
+/*	$NetBSD: dklist.c,v 1.11 2014/06/13 16:00:55 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 
 #ifndef lint
 #include sys/cdefs.h
-__RCSID($NetBSD: dklist.c,v 1.10 2014/06/11 14:51:49 joerg Exp $);
+__RCSID($NetBSD: dklist.c,v 1.11 2014/06/13 16:00:55 joerg Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -146,29 +146,6 @@ mlx_disk_add(const char *name)
 		errx(EXIT_FAILURE, %s is not attached to %s, name, mlxname);
 }
 
-static void *
-fetch_sysctl(size_t *len, const int oids[], size_t oidlen, const char *msg)
-{
-	void *data;
-
-	*len = 0;
-	data = NULL;
-
-	for (;;) {
-		if (sysctl(oids, oidlen, data, len, NULL, 0) == 0) {
-			if (data != NULL || len == 0)
-return data;
-			errno = ENOMEM;
-		}
-		free(data);
-		if (errno == ENOMEM) {
-			data = emalloc(*len);
-			continue;
-		}
-		err(1, %s, msg);
-	}
-}
-
 void
 mlx_disk_add_all(void)
 {
@@ -176,10 +153,10 @@ mlx_disk_add_all(void)
 	size_t i, len;
 	static const int mib[3] = { CTL_HW, HW_IOSTATS, sizeof(*data) };
 
-	data = fetch_sysctl(len, mib, __arraycount(mib), hw.iostats failed);
+	data = asysctl(mib, __arraycount(mib), len);
 	len /= sizeof(*data);
 
-	if (len == 0)
+	if (data == NULL || len == 0)
 		errx(EXIT_FAILURE, no drives attached.);
 
 	for (i = 0; i  len; ++i) {



CVS commit: src/usr.sbin/ifmcstat

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 16:04:41 UTC 2014

Modified Files:
src/usr.sbin/ifmcstat: ifmcstat.c

Log Message:
Use asysctl.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/usr.sbin/ifmcstat/ifmcstat.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.sbin/ifmcstat/ifmcstat.c
diff -u src/usr.sbin/ifmcstat/ifmcstat.c:1.18 src/usr.sbin/ifmcstat/ifmcstat.c:1.19
--- src/usr.sbin/ifmcstat/ifmcstat.c:1.18	Wed Jun 11 14:05:28 2014
+++ src/usr.sbin/ifmcstat/ifmcstat.c	Fri Jun 13 16:04:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ifmcstat.c,v 1.18 2014/06/11 14:05:28 joerg Exp $	*/
+/*	$NetBSD: ifmcstat.c,v 1.19 2014/06/13 16:04:41 joerg Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: ifmcstat.c,v 1.18 2014/06/11 14:05:28 joerg Exp $);
+__RCSID($NetBSD: ifmcstat.c,v 1.19 2014/06/13 16:04:41 joerg Exp $);
 
 #include err.h
 #include errno.h
@@ -100,31 +100,6 @@ main(void)
 	/*NOTREACHED*/
 }
 
-static void *
-fetch_sysctl(size_t *len, const int oids[], size_t oidlen, const char *msg)
-{
-	void *data;
-
-	*len = 0;
-	data = NULL;
-
-	for (;;) {
-		if (sysctl(oids, oidlen, data, len, NULL, 0) == 0) {
-			if (data != NULL || len == 0)
-return data;
-			errno = ENOMEM;
-		}
-		free(data);
-		if (errno == ENOMEM) {
-			data = emalloc(*len);
-			continue;
-		}
-		if (errno != ENODEV)
-			warn(%s, msg);
-		return NULL;
-	}
-}
-
 static void
 print_hwaddr(const uint8_t *hwaddr, size_t len)
 {
@@ -157,18 +132,25 @@ print_ether_mcast(u_short ifindex)
 	}
 
 	sdl_oids[2] = ifindex;
-	hwaddr = fetch_sysctl(sdl_len, sdl_oids, 3, failed to read net.sdl);
+	hwaddr = asysctl(sdl_oids, 3, sdl_len);
 
 	if (sdl_len == 0) {
 		free(hwaddr);
 		return;
 	}
+	if (hwaddr == NULL) {
+		warn(failed to read net.sdl);
+	}
 
 	ems_oids[3] = ifindex;
-	ems = fetch_sysctl(ems_len, ems_oids, 4,
-	failed to read net.ether.multicast);
+	ems = asysctl(ems_oids, 4, ems_len);
 	ems_len /= sizeof(*ems);
 
+	if (ems == NULL  ems_len != 0) {
+		warn(failed to read net.ether.multicast);
+		return;
+	}
+
 	printf(\tenaddr );
 	print_hwaddr(hwaddr, sdl_len);
 	printf( multicnt %zu\n, ems_len);
@@ -214,8 +196,11 @@ print_inet6_mcast(u_short ifindex, const
 	mcast_oids[3] = ifindex;
 	kludge_oids[3] = ifindex;
 
-	mcast_addrs = fetch_sysctl(len, mcast_oids, 4,
-	failed to read net.inet6.multicast);
+	mcast_addrs = asysctl(mcast_oids, 4, len);
+	if (mcast_addrs == NULL  len != 0) {
+		warn(failed to read net.inet6.multicast);
+		return;
+	}
 	if (len) {
 		p = mcast_addrs;
 		last_p = NULL;
@@ -236,8 +221,11 @@ print_inet6_mcast(u_short ifindex, const
 	}
 	free(mcast_addrs);
 
-	kludge_addrs = fetch_sysctl(len, kludge_oids, 4,
-	failed to read net.inet6.multicast_kludge);
+	kludge_addrs = asysctl(kludge_oids, 4, len);
+	if (kludge_addrs == NULL  len != 0) {
+		warn(failed to read net.inet6.multicast_kludge);
+		return;
+	}
 	if (len) {
 		printf(\t(on kludge entry for %s)\n, ifname);
 		p = kludge_addrs;



CVS commit: src/sys/dev/usb

2014-06-13 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Fri Jun 13 18:49:41 UTC 2014

Modified Files:
src/sys/dev/usb: if_smsc.c

Log Message:
Align buffer pointer to longwords. Otherwise arbitrary data will be
interpreted as length field of the receive header which can
cause mbuf overruns and memory corruption. Also add sanity checks.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/dev/usb/if_smsc.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/if_smsc.c
diff -u src/sys/dev/usb/if_smsc.c:1.16 src/sys/dev/usb/if_smsc.c:1.17
--- src/sys/dev/usb/if_smsc.c:1.16	Mon Jun  9 15:50:55 2014
+++ src/sys/dev/usb/if_smsc.c	Fri Jun 13 18:49:41 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_smsc.c,v 1.16 2014/06/09 15:50:55 skrll Exp $	*/
+/*	$NetBSD: if_smsc.c,v 1.17 2014/06/13 18:49:41 mlelstv Exp $	*/
 
 /*	$OpenBSD: if_smsc.c,v 1.4 2012/09/27 12:38:11 jsg Exp $	*/
 /* $FreeBSD: src/sys/dev/usb/net/if_smsc.c,v 1.1 2012/08/15 04:03:55 gonzo Exp $ */
@@ -1305,6 +1305,13 @@ smsc_rxeof(usbd_xfer_handle xfer, usbd_p
 
 		pktlen += ETHER_ALIGN;
 
+		if (pktlen  MCLBYTES) {
+			smsc_dbg_printf(sc, pktlen %d  MCLBYTES %d\n,
+			pktlen, MCLBYTES);
+			ifp-if_ierrors++;
+			goto done;
+		}
+
 		if (pktlen  total_len) {
 			smsc_dbg_printf(sc, pktlen %d  total_len %d\n,
 			pktlen, total_len);
@@ -1324,6 +1331,8 @@ smsc_rxeof(usbd_xfer_handle xfer, usbd_p
 		m-m_pkthdr.len = m-m_len = pktlen;
 		m-m_flags |= M_HASFCS;
 		m_adj(m, ETHER_ALIGN);
+
+		KASSERT(m-m_len  MCLBYTES);
 		memcpy(mtod(m, char *), buf + ETHER_ALIGN, m-m_len);
 
 		/* Check if RX TCP/UDP checksumming is being offloaded */
@@ -1375,6 +1384,13 @@ smsc_rxeof(usbd_xfer_handle xfer, usbd_p
 			}
 		}
 
+		/* round up to next longword */
+		pktlen = (pktlen + 3)  ~0x3;
+
+		/* total_len does not include the padding */
+		if (pktlen  total_len)
+			pktlen = total_len;
+
 		buf += pktlen;
 		total_len -= pktlen;
 



CVS commit: src

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 19:09:07 UTC 2014

Modified Files:
src/share/man/man7: sysctl.7
src/sys/kern: subr_pool.c
src/sys/sys: pool.h

Log Message:
Add kern.pool for memory pool stats.


To generate a diff of this commit:
cvs rdiff -u -r1.81 -r1.82 src/share/man/man7/sysctl.7
cvs rdiff -u -r1.202 -r1.203 src/sys/kern/subr_pool.c
cvs rdiff -u -r1.75 -r1.76 src/sys/sys/pool.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.81 src/share/man/man7/sysctl.7:1.82
--- src/share/man/man7/sysctl.7:1.81	Fri May 30 01:43:20 2014
+++ src/share/man/man7/sysctl.7	Fri Jun 13 19:09:07 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: sysctl.7,v 1.81 2014/05/30 01:43:20 christos Exp $
+.\	$NetBSD: sysctl.7,v 1.82 2014/06/13 19:09:07 joerg Exp $
 .\
 .\ Copyright (c) 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\
 .\	@(#)sysctl.3	8.4 (Berkeley) 5/9/95
 .\
-.Dd May 29, 2014
+.Dd June 13, 2014
 .Dt SYSCTL 7
 .Os
 .Sh NAME
@@ -329,6 +329,7 @@ privilege may change the value.
 .It kern.ostype	string	no
 .\.It kern.panic_now	integer	yes
 .It kern.pipe	node	not applicable
+.It kern.pool	struct pool_sysctl	no
 .\ .It kern.posix	node	not applicable
 .It kern.posix1version	integer	no
 .It kern.posix_aio	integer	no
@@ -849,6 +850,12 @@ Number of
 .Dq big
 pipes.
 .El
+.It Li kern.pool
+Provides statistics about the
+.Xr pool 9 
+and
+.Xr pool_cache 9
+subsystems.
 .\ XXX: Undocumented .It Li kern.posix ( ? )
 .\	 This is a node in which the only variable is semmax.
 .It Li kern.posix1version ( KERN_POSIX1 )

Index: src/sys/kern/subr_pool.c
diff -u src/sys/kern/subr_pool.c:1.202 src/sys/kern/subr_pool.c:1.203
--- src/sys/kern/subr_pool.c:1.202	Sat Apr 26 16:30:05 2014
+++ src/sys/kern/subr_pool.c	Fri Jun 13 19:09:07 2014
@@ -1,7 +1,7 @@
-/*	$NetBSD: subr_pool.c,v 1.202 2014/04/26 16:30:05 abs Exp $	*/
+/*	$NetBSD: subr_pool.c,v 1.203 2014/06/13 19:09:07 joerg Exp $	*/
 
 /*-
- * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010
+ * Copyright (c) 1997, 1999, 2000, 2002, 2007, 2008, 2010, 2014
  * The NetBSD Foundation, Inc.
  * All rights reserved.
  *
@@ -32,13 +32,14 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_pool.c,v 1.202 2014/04/26 16:30:05 abs Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_pool.c,v 1.203 2014/06/13 19:09:07 joerg Exp $);
 
 #include opt_ddb.h
 #include opt_lockdebug.h
 
 #include sys/param.h
 #include sys/systm.h
+#include sys/sysctl.h
 #include sys/bitops.h
 #include sys/proc.h
 #include sys/errno.h
@@ -2751,3 +2752,100 @@ print:
 	}
 }
 #endif /* defined(DDB) */
+
+static int
+pool_sysctl(SYSCTLFN_ARGS)
+{
+	struct pool_sysctl data;
+	struct pool *pp;
+	struct pool_cache *pc;
+	pool_cache_cpu_t *cc;
+	int error;
+	size_t i, written;
+
+	if (oldp == NULL) {
+		*oldlenp = 0;
+		TAILQ_FOREACH(pp, pool_head, pr_poollist)
+			*oldlenp += sizeof(data);
+		return 0;
+	}
+
+	memset(data, 0, sizeof(data));
+	error = 0;
+	written = 0;
+	TAILQ_FOREACH(pp, pool_head, pr_poollist) {
+		if (written + sizeof(data)  *oldlenp)
+			break;
+		strlcpy(data.pr_wchan, pp-pr_wchan, sizeof(data.pr_wchan));
+		data.pr_pagesize = pp-pr_alloc-pa_pagesz;
+		data.pr_flags = pp-pr_roflags | pp-pr_flags;
+#define COPY(field) data.field = pp-field
+		COPY(pr_size);
+
+		COPY(pr_itemsperpage);
+		COPY(pr_nitems);
+		COPY(pr_nout);
+		COPY(pr_hardlimit);
+		COPY(pr_npages);
+		COPY(pr_minpages);
+		COPY(pr_maxpages);
+
+		COPY(pr_nget);
+		COPY(pr_nfail);
+		COPY(pr_nput);
+		COPY(pr_npagealloc);
+		COPY(pr_npagefree);
+		COPY(pr_hiwat);
+		COPY(pr_nidle);
+#undef COPY
+
+		data.pr_cache_nmiss_pcpu = 0;
+		data.pr_cache_nhit_pcpu = 0;
+		if (pp-pr_cache) {
+			pc = pp-pr_cache;
+			data.pr_cache_meta_size = pc-pc_pcgsize;
+			data.pr_cache_nfull = pc-pc_nfull;
+			data.pr_cache_npartial = pc-pc_npart;
+			data.pr_cache_nempty = pc-pc_nempty;
+			data.pr_cache_ncontended = pc-pc_contended;
+			data.pr_cache_nmiss_global = pc-pc_misses;
+			data.pr_cache_nhit_global = pc-pc_hits;
+			for (i = 0; i  pc-pc_ncpu; ++i) {
+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;
+			}
+		} else {
+			data.pr_cache_meta_size = 0;
+			data.pr_cache_nfull = 0;
+			data.pr_cache_npartial = 0;
+			data.pr_cache_nempty = 0;
+			data.pr_cache_ncontended = 0;
+			data.pr_cache_nmiss_global = 0;
+			data.pr_cache_nhit_global = 0;
+		}
+
+		error = sysctl_copyout(l, data, oldp, sizeof(data));
+		if (error)
+			break;
+		written += sizeof(data);
+		oldp = (char *)oldp + sizeof(data);
+	}
+
+	*oldlenp = written;
+	return error;
+}
+
+SYSCTL_SETUP(sysctl_pool_setup, sysctl kern.pool setup)
+{
+	const struct sysctlnode *rnode = NULL;
+
+	sysctl_createv(clog, 0, NULL, rnode,
+		   

CVS commit: src/usr.bin/vmstat

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Fri Jun 13 19:10:01 UTC 2014

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
Use kern.pool for the live system.


To generate a diff of this commit:
cvs rdiff -u -r1.199 -r1.200 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.199 src/usr.bin/vmstat/vmstat.c:1.200
--- src/usr.bin/vmstat/vmstat.c:1.199	Tue Jun  3 21:56:30 2014
+++ src/usr.bin/vmstat/vmstat.c	Fri Jun 13 19:10:01 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.199 2014/06/03 21:56:30 joerg Exp $ */
+/* $NetBSD: vmstat.c,v 1.200 2014/06/13 19:10:01 joerg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)vmstat.c	8.2 (Berkeley) 3/1/95;
 #else
-__RCSID($NetBSD: vmstat.c,v 1.199 2014/06/03 21:56:30 joerg Exp $);
+__RCSID($NetBSD: vmstat.c,v 1.200 2014/06/13 19:10:01 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -1354,6 +1354,147 @@ doevcnt(int verbose, int type)
 		Total, counttotal, counttotal / uptime);
 }
 
+static void
+dopool_sysctl(int verbose, int wide)
+{
+	uint64_t total, inuse, this_total, this_inuse;
+	struct {
+		uint64_t pt_nget;
+		uint64_t pt_nfail;
+		uint64_t pt_nput;
+		uint64_t pt_nout;
+		uint64_t pt_nitems;
+		uint64_t pt_npagealloc;
+		uint64_t pt_npagefree;
+		uint64_t pt_npages;
+	} pool_totals;
+	size_t i, len;
+	int name_len, ovflw;
+	struct pool_sysctl *pp, *data;
+	char in_use[8], avail[8], maxp[32];
+
+	data = asysctlbyname(kern.pool, len);
+	if (data == NULL)
+		err(1, failed to reead kern.pool);
+
+	total = inuse = 0;
+	len /= sizeof(*data);
+
+	(void)printf(Memory resource pool statistics\n);
+	(void)printf(
+	%-*s%*s%*s%5s%*s%s%s%*s%*s%6s%s%6s%6s%6s%5s%s%s\n,
+	wide ? 16 : 11, Name,
+	wide ? 6 : 5, Size,
+	wide ? 12 : 9, Requests,
+	Fail,
+	wide ? 12 : 9, Releases,
+	wide ?   InUse : ,
+	wide ?  Avail : ,
+	wide ? 7 : 6, Pgreq,
+	wide ? 7 : 6, Pgrel,
+	Npage,
+	wide ?  PageSz : ,
+	Hiwat,
+	Minpg,
+	Maxpg,
+	Idle,
+	wide ?  Flags : ,
+	wide ?Util : );
+
+	name_len = MIN((int)sizeof(pp-pr_wchan), wide ? 16 : 11);
+	for (i = 0; i  len; ++i) {
+		pp = data[i];
+		if (pp-pr_nget == 0  !verbose)
+			continue;
+		if (pp-pr_maxpages == UINT_MAX)
+			(void)snprintf(maxp, sizeof(maxp), inf);
+		else
+			(void)snprintf(maxp, sizeof(maxp), % PRIu64,
+			pp-pr_maxpages);
+		ovflw = 0;
+		PRWORD(ovflw, %-*s, name_len, 0, pp-pr_wchan);
+		PRWORD(ovflw,  %* PRIu64, wide ? 6 : 5, 1, pp-pr_size);
+		PRWORD(ovflw,  %* PRIu64, wide ? 12 : 9, 1, pp-pr_nget);
+		pool_totals.pt_nget += pp-pr_nget;
+		PRWORD(ovflw,  %* PRIu64, 5, 1, pp-pr_nfail);
+		pool_totals.pt_nfail += pp-pr_nfail;
+		PRWORD(ovflw,  %* PRIu64, wide ? 12 : 9, 1, pp-pr_nput);
+		pool_totals.pt_nput += pp-pr_nput;
+		if (wide) {
+			PRWORD(ovflw,  %* PRIu64, 7, 1, pp-pr_nout);
+			pool_totals.pt_nout += pp-pr_nout;
+		}
+		if (wide) {
+			PRWORD(ovflw,  %* PRIu64, 6, 1, pp-pr_nitems);
+			pool_totals.pt_nitems += pp-pr_nitems;
+		}
+		PRWORD(ovflw,  %* PRIu64, wide ? 7 : 6, 1, pp-pr_npagealloc);
+		pool_totals.pt_npagealloc += pp-pr_npagealloc;
+		PRWORD(ovflw,  %* PRIu64, wide ? 7 : 6, 1, pp-pr_npagefree);
+		pool_totals.pt_npagefree += pp-pr_npagefree;
+		PRWORD(ovflw,  %* PRIu64, 6, 1, pp-pr_npages);
+		pool_totals.pt_npages += pp-pr_npages;
+		if (wide)
+			PRWORD(ovflw,  %* PRIu64, 7, 1, pp-pr_pagesize);
+		PRWORD(ovflw,  %* PRIu64, 6, 1, pp-pr_hiwat);
+		PRWORD(ovflw,  %* PRIu64, 6, 1, pp-pr_minpages);
+		PRWORD(ovflw,  %*s, 6, 1, maxp);
+		PRWORD(ovflw,  %* PRIu64, 5, 1, pp-pr_nidle);
+		if (wide)
+			PRWORD(ovflw,  0x%0* PRIx64, 4, 1,
+			pp-pr_flags);
+
+		this_inuse = pp-pr_nout * pp-pr_size;
+		this_total = pp-pr_npages * pp-pr_pagesize;
+		if (pp-pr_flags  PR_RECURSIVE) {
+			/*
+			 * Don't count in-use memory, since it's part
+			 * of another pool and will be accounted for
+			 * there.
+			 */
+			total += (this_total - this_inuse);
+		} else {
+			inuse += this_inuse;
+			total += this_total;
+		}
+		if (wide) {
+			if (this_total == 0)
+(void)printf(   ---);
+			else
+(void)printf( %5.1f%%,
+(100.0 * this_inuse) / this_total);
+		}
+		(void)printf(\n);
+	}
+	if (wide) {
+		snprintf(in_use, sizeof in_use, %7PRId64, pool_totals.pt_nout);
+		snprintf(avail, sizeof avail, %6PRId64, pool_totals.pt_nitems);
+	} else {
+		in_use[0] = '\0';
+		avail[0] = '\0';
+	}
+	(void)printf(
+	%-*s%*s%*PRId64%5PRId64%*PRId64%s%s%*PRId64%*PRId64%6PRId64\n,
+	wide ? 16 : 11, Totals,
+	wide ? 6 : 5, ,
+	wide ? 12 : 9, pool_totals.pt_nget,
+	pool_totals.pt_nfail,
+	wide ? 12 : 9, pool_totals.pt_nput,
+	in_use,
+	avail,
+	wide ? 7 : 6, 

CVS import: src/share/zoneinfo

2014-06-13 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Fri Jun 13 19:48:57 UTC 2014

Update of /cvsroot/src/share/zoneinfo
In directory ivanova.netbsd.org:/tmp/cvs-serv19905

Log Message:
Import tzdata2014e from ftp://ftp.iana.org/tz/releases/tzdata2014e.tar.gz

Summary of changes in tzdata2014e (2014-06-12 21:53:52 -0700):
  * Egypt's 2014 Ramadan-based transitions are June 26 and July 31 at 24:00.
(Thanks to Imed Chihi.)  Guess that from 2015 on Egypt will temporarily
switch to standard time at 24:00 the last Thursday before Ramadan, and
back to DST at 00:00 the first Friday after Ramadan.
  * Similarly, Morocco's are June 28 at 03:00 and August 2 at 02:00.  (Thanks
to Milamber Space Network.)  Guess that from 2015 on Morocco will
temporarily switch to standard time at 03:00 the last Saturday before
Ramadan, and back to DST at 02:00 the first Saturday after Ramadan.
  * The abbreviation MSM (Moscow Midsummer Time) is now used instead of
MSD for Moscow's double daylight time in summer 1921.  Also, a typo
VLASST has been repaired to be VLAST for Vladivostok summer time
in 1991.  (Thanks to Hank W. for reporting the problems.)
  * Changes affecting commentary.

Summary of changes in tzdata2014d (2014-05-27 21:34:40 -0700):
  * Changes affecting documentation.

Status:

Vendor Tag: TZDATA
Release Tags:   TZDATA2014E

U src/share/zoneinfo/antarctica
C src/share/zoneinfo/Makefile
U src/share/zoneinfo/README
U src/share/zoneinfo/africa
C src/share/zoneinfo/australasia
U src/share/zoneinfo/asia
U src/share/zoneinfo/northamerica
U src/share/zoneinfo/europe
U src/share/zoneinfo/leapseconds.awk
U src/share/zoneinfo/southamerica
U src/share/zoneinfo/pacificnew
U src/share/zoneinfo/etcetera
U src/share/zoneinfo/backward
U src/share/zoneinfo/systemv
U src/share/zoneinfo/factory
U src/share/zoneinfo/iso3166.tab
U src/share/zoneinfo/zone.tab
U src/share/zoneinfo/leapseconds
U src/share/zoneinfo/leap-seconds.list
U src/share/zoneinfo/yearistype.sh

2 conflicts created by this import.
Use the following command to help the merge:

cvs checkout -jTZDATA:yesterday -jTZDATA src/share/zoneinfo



CVS commit: src/share/zoneinfo

2014-06-13 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Fri Jun 13 19:54:04 UTC 2014

Modified Files:
src/share/zoneinfo: australasia

Log Message:
Merge tzdata2014e


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/share/zoneinfo/australasia

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/zoneinfo/australasia
diff -u src/share/zoneinfo/australasia:1.35 src/share/zoneinfo/australasia:1.36
--- src/share/zoneinfo/australasia:1.35	Thu May 15 16:01:18 2014
+++ src/share/zoneinfo/australasia	Fri Jun 13 19:54:04 2014
@@ -250,24 +250,14 @@ Zone Antarctica/Macquarie 0	-	zzz	1899 N
 Zone Indian/Christmas	7:02:52 -	LMT	1895 Feb
 			7:00	-	CXT	# Christmas Island Time
 
-# Cook Is
-# From Shanks  Pottenger:
-# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
-Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
-Rule	Cook	1979	1991	-	Mar	Sun=1	0:00	0	-
-Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
-# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
-Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
-			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
-			-10:00	Cook	CK%sT
-
-# Cocos
+# Cocos (Keeling) Is
 # These islands were ruled by the Ross family from about 1830 to 1978.
 # We don't know when standard time was introduced; for now, we guess 1900.
 # Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
 Zone	Indian/Cocos	6:27:40	-	LMT	1900
 			6:30	-	CCT	# Cocos Islands Time
 
+
 # Fiji
 
 # Milne gives 11:55:44 for Suva.
@@ -473,7 +463,8 @@ Rule	NZ	1934	1940	-	Apr	lastSun	2:00	0	M
 Rule	NZ	1934	1940	-	Sep	lastSun	2:00	0:30	S
 Rule	NZ	1946	only	-	Jan	 1	0:00	0	S
 # Since 1957 Chatham has been 45 minutes ahead of NZ, but there's no
-# convenient notation for this so we must duplicate the Rule lines.
+# convenient single notation for the date and time of this transition
+# so we must duplicate the Rule lines.
 Rule	NZ	1974	only	-	Nov	Sun=1	2:00s	1:00	D
 Rule	Chatham	1974	only	-	Nov	Sun=1	2:45s	1:00	D
 Rule	NZ	1975	only	-	Feb	lastSun	2:00s	0	S
@@ -511,6 +502,17 @@ Link Pacific/Auckland Antarctica/McMurdo
 # previously whalers, sealers, pastoralists, and scientific personnel wintered
 # was probably like Pacific/Auckland
 
+# Cook Is
+# From Shanks  Pottenger:
+# Rule	NAME	FROM	TO	TYPE	IN	ON	AT	SAVE	LETTER/S
+Rule	Cook	1978	only	-	Nov	12	0:00	0:30	HS
+Rule	Cook	1979	1991	-	Mar	Sun=1	0:00	0	-
+Rule	Cook	1979	1990	-	Oct	lastSun	0:00	0:30	HS
+# Zone	NAME		GMTOFF	RULES	FORMAT	[UNTIL]
+Zone Pacific/Rarotonga	-10:39:04 -	LMT	1901		# Avarua
+			-10:30	-	CKT	1978 Nov 12	# Cook Is Time
+			-10:00	Cook	CK%sT
+
 ###
 
 



CVS commit: src/share/zoneinfo

2014-06-13 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Fri Jun 13 19:56:19 UTC 2014

Modified Files:
src/share/zoneinfo: tzdata2netbsd

Log Message:
Update tzdata2netbsd for 2014e release.
* Rename work directory so there's a subdir per release.
* Slightly better detection of work that's already been done.
? update-work
cvs diff: Diffing .
Index: tzdata2netbsd
===
RCS file: /cvsroot/src/share/zoneinfo/tzdata2netbsd,v
retrieving revision 1.2
diff -d -p -u -r1.2 tzdata2netbsd
--- tzdata2netbsd   18 May 2014 16:53:56 -  1.2
+++ tzdata2netbsd   13 Jun 2014 19:54:55 -
@@ -1,10 +1,19 @@
 # $NetBSD: tzdata2netbsd,v 1.2 2014/05/18 16:53:56 apb Exp $
-#
+
 # For use by NetBSD developers when updating to new versions of tzdata.
 #
+# 0. Be in an up-to-date checkout of src/share/zoneinfo from NetBSD-current.
+# 1. Edit OLDVER and NEWVER below.
+# 3. Run this script.  You will be prompted for confirmation before
+#anything major (such as a cvs operation).
+# 4. If something fails, abort the script and fix it.
+# 5. Re-run this script until you are happy.  It's designed to
+#be re-run over and over, and later runs will try not to
+#redo non-trivial work done by earlier runs.
+#

-OLDVER=2013i
-NEWVER=2014c
+OLDVER=2014c
+NEWVER=2014e

 # Uppercase variants of OLDVER and NEWVER
 OLDVER_UC=$( echo ${OLDVER} | tr '[a-z]' '[A-Z]' )
@@ -23,8 +32,8 @@ NEWSURL=https://github.com/eggert/tz/ra

 # Directories
 REPODIR=src/share/zoneinfo   # relative to the NetSBD CVS repository
-WORKDIR=$(pwd)/update-work
-EXTRACTDIR=${WORKDIR}/extract/${NEWVER}
+WORKDIR=$(pwd)/update-work/${NEWVER}
+EXTRACTDIR=${WORKDIR}/extract

 # Files in the work directory
 DISTFILE=${WORKDIR}/${DISTURL##*/}
@@ -54,7 +63,7 @@ DOIT()
echo REALLY DOING IT NOW...
$@
else
-   echo NOT REALLY DOING: $@
+   echo NOT REALLY DOING THE ABOVE COMMAND
fi
 }

@@ -134,6 +143,7 @@ EOF

 extract()
 {
+   [ -f ${EXTRACTDIR}/zone.tab ]  return
mkdir -p ${EXTRACTDIR}
tar -z -xf ${DISTFILE} -C ${EXTRACTDIR}
 }
@@ -143,6 +153,7 @@ extract()
 #
 trimnews()
 {
+   [ -s ${NEWSTRIMFILE} ]  return
awk -v oldver=${OLDVER} -v newver=${NEWVER} \
'
BEGIN {inrange = 0}
cvs diff: Diffing datfiles


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/zoneinfo/tzdata2netbsd

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/zoneinfo/tzdata2netbsd
diff -u src/share/zoneinfo/tzdata2netbsd:1.2 src/share/zoneinfo/tzdata2netbsd:1.3
--- src/share/zoneinfo/tzdata2netbsd:1.2	Sun May 18 16:53:56 2014
+++ src/share/zoneinfo/tzdata2netbsd	Fri Jun 13 19:56:19 2014
@@ -1,10 +1,19 @@
-# $NetBSD: tzdata2netbsd,v 1.2 2014/05/18 16:53:56 apb Exp $
-#
+# $NetBSD: tzdata2netbsd,v 1.3 2014/06/13 19:56:19 apb Exp $
+
 # For use by NetBSD developers when updating to new versions of tzdata.
 #
+# 0. Be in an up-to-date checkout of src/share/zoneinfo from NetBSD-current.
+# 1. Edit OLDVER and NEWVER below.
+# 3. Run this script.  You will be prompted for confirmation before
+#anything major (such as a cvs operation).
+# 4. If something fails, abort the script and fix it.
+# 5. Re-run this script until you are happy.  It's designed to
+#be re-run over and over, and later runs will try not to
+#redo non-trivial work done by earlier runs.
+#
 
-OLDVER=2013i
-NEWVER=2014c
+OLDVER=2014c
+NEWVER=2014e
 
 # Uppercase variants of OLDVER and NEWVER
 OLDVER_UC=$( echo ${OLDVER} | tr '[a-z]' '[A-Z]' )
@@ -23,8 +32,8 @@ NEWSURL=https://github.com/eggert/tz/ra
 
 # Directories
 REPODIR=src/share/zoneinfo	# relative to the NetSBD CVS repository
-WORKDIR=$(pwd)/update-work
-EXTRACTDIR=${WORKDIR}/extract/${NEWVER}
+WORKDIR=$(pwd)/update-work/${NEWVER}
+EXTRACTDIR=${WORKDIR}/extract
 
 # Files in the work directory
 DISTFILE=${WORKDIR}/${DISTURL##*/}
@@ -54,7 +63,7 @@ DOIT()
 		echo REALLY DOING IT NOW...
 		$@
 	else
-		echo NOT REALLY DOING: $@
+		echo NOT REALLY DOING THE ABOVE COMMAND
 	fi
 }
 
@@ -134,6 +143,7 @@ EOF
 
 extract()
 {
+	[ -f ${EXTRACTDIR}/zone.tab ]  return
 	mkdir -p ${EXTRACTDIR}
 	tar -z -xf ${DISTFILE} -C ${EXTRACTDIR}
 }
@@ -143,6 +153,7 @@ extract()
 #
 trimnews()
 {
+	[ -s ${NEWSTRIMFILE} ]  return
 	awk -v oldver=${OLDVER} -v newver=${NEWVER} \
 	'
 		BEGIN {inrange = 0}



CVS commit: src/doc

2014-06-13 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Fri Jun 13 19:57:45 UTC 2014

Modified Files:
src/doc: 3RDPARTY

Log Message:
tzcode2014e/tzdata2014e have been released.  We have tzdata2014e.


To generate a diff of this commit:
cvs rdiff -u -r1.1119 -r1.1120 src/doc/3RDPARTY

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.1119 src/doc/3RDPARTY:1.1120
--- src/doc/3RDPARTY:1.1119	Fri Jun 13 02:09:20 2014
+++ src/doc/3RDPARTY	Fri Jun 13 19:57:45 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.1119 2014/06/13 02:09:20 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.1120 2014/06/13 19:57:45 apb Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -1271,8 +1271,8 @@ Notes:
 Added changes from a5 - a12 manually.
 
 Package:	tz
-Version:	tzcode2014d / tzdata2014c
-Current Vers:	tzcode2014d / tzdata2014d
+Version:	tzcode2014d / tzdata2014e
+Current Vers:	tzcode2014e / tzdata2014e
 Maintainer:	Paul Eggert egg...@cs.ucla.edu
 Archive Site:	ftp://ftp.iana.org/tz/releases/
 Archive Site:	ftp://munnari.oz.au/pub/oldtz/



CVS commit: src/doc

2014-06-13 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Fri Jun 13 19:58:22 UTC 2014

Modified Files:
src/doc: CHANGES

Log Message:
zoneinfo: Import tzdata2014e. [apb 20140613]


To generate a diff of this commit:
cvs rdiff -u -r1.1934 -r1.1935 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/CHANGES
diff -u src/doc/CHANGES:1.1934 src/doc/CHANGES:1.1935
--- src/doc/CHANGES:1.1934	Fri Jun 13 02:09:20 2014
+++ src/doc/CHANGES	Fri Jun 13 19:58:22 2014
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1934 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1935 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -429,3 +429,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	vmx(4): Add VMware VMXNET3 driver, from OpenBSD [hikaru 20140610]
 	etcupdate(8): Add destdir support.  [apb 20140612]
 	file(1): upgraded to 5.19 [christos 20140612]
+	zoneinfo: Import tzdata2014e. [apb 20140613]



CVS commit: src/sys/lib/libunwind

2014-06-13 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jun 13 21:31:20 UTC 2014

Modified Files:
src/sys/lib/libunwind: Makefile.inc

Log Message:
Split COPTS.libunwind.cxx into multiple lines.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/lib/libunwind/Makefile.inc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/lib/libunwind/Makefile.inc
diff -u src/sys/lib/libunwind/Makefile.inc:1.6 src/sys/lib/libunwind/Makefile.inc:1.7
--- src/sys/lib/libunwind/Makefile.inc:1.6	Fri Jun 13 01:17:46 2014
+++ src/sys/lib/libunwind/Makefile.inc	Fri Jun 13 21:31:20 2014
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.inc,v 1.6 2014/06/13 01:17:46 mrg Exp $
+#	$NetBSD: Makefile.inc,v 1.7 2014/06/13 21:31:20 matt Exp $
 
 .PATH:	${NETBSDSRCDIR}/sys/lib/libunwind
 
@@ -8,4 +8,6 @@ SRCS+=	libunwind.cxx \
 INCS+=	unwind.h
 
 COPTS.libunwind.cxx+=	${${ACTIVE_CXX} == gcc:? -std=c++0x : -std=c++11 }
-COPTS.libunwind.cxx+=	-funwind-tables -fno-rtti -fno-exceptions -fvisibility=hidden -Wno-old-style-cast
+COPTS.libunwind.cxx+=	-funwind-tables -fno-rtti
+COPTS.libunwind.cxx+=	-fno-exceptions -fvisibility=hidden
+COPTS.libunwind.cxx+=	-Wno-old-style-cast



CVS commit: src/lib/libc/gen

2014-06-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 13 22:05:15 UTC 2014

Modified Files:
src/lib/libc/gen: sysctl.3

Log Message:
Remove trailing whitespace. Use more markup. Merge sections describing
the same error code.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/lib/libc/gen/sysctl.3

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/gen/sysctl.3
diff -u src/lib/libc/gen/sysctl.3:1.201 src/lib/libc/gen/sysctl.3:1.202
--- src/lib/libc/gen/sysctl.3:1.201	Fri Jun 13 15:45:05 2014
+++ src/lib/libc/gen/sysctl.3	Fri Jun 13 22:05:15 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: sysctl.3,v 1.201 2014/06/13 15:45:05 joerg Exp $
+.\	$NetBSD: sysctl.3,v 1.202 2014/06/13 22:05:15 wiz Exp $
 .\
 .\ Copyright (c) 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -266,7 +266,7 @@ functions are wrappers for
 and
 .Fn sysctlbyname .
 They return memory allocated with
-.Xr malloc 3 
+.Xr malloc 3
 and resize the buffer in a loop until all data fits.
 .Sh DYNAMIC OPERATIONS
 Several meta-identifiers are provided to perform operations on the
@@ -687,9 +687,9 @@ unavailable.
 .It Bq Er EINVAL
 The
 .Fa name
-array is zero or greater than CTL_MAXNAME.
-.It Bq Er EINVAL
-A non-null
+array is zero or greater than
+.Dv CTL_MAXNAME ;
+or a non-null
 .Fa newp
 is given and its specified length in
 .Fa newlen
@@ -702,9 +702,8 @@ array specifies an intermediate rather t
 .It Bq Er ENOENT
 The
 .Fa name
-array specifies a node that does not exist in the tree.
-.It Bq Er ENOENT
-An attempt was made to destroy a node that does not exist, or to
+array specifies a node that does not exist in the tree;
+or an attempt was made to destroy a node that does not exist, or to
 create or destroy a node below a node that does not exist.
 .It Bq Er ENOMEM
 The length pointed to by
@@ -722,12 +721,10 @@ The
 array specifies a value that is unknown or a meta-operation was
 attempted that the requested node does not support.
 .It Bq Er EPERM
-An attempt is made to set a read-only value.
-.It Bq Er EPERM
-A process without appropriate privilege attempts to set a value or to
-create or destroy a node.
-.It Bq Er EPERM
-An attempt to change a value protected by the current kernel security
+An attempt is made to set a read-only value; or
+a process without appropriate privilege attempts to set a value or to
+create or destroy a node; or
+an attempt to change a value protected by the current kernel security
 level is made.
 .El
 .Sh SEE ALSO



CVS commit: src/share/man/man7

2014-06-13 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Jun 13 22:06:00 UTC 2014

Modified Files:
src/share/man/man7: sysctl.7

Log Message:
Remove trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/share/man/man7/sysctl.7

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/man/man7/sysctl.7
diff -u src/share/man/man7/sysctl.7:1.82 src/share/man/man7/sysctl.7:1.83
--- src/share/man/man7/sysctl.7:1.82	Fri Jun 13 19:09:07 2014
+++ src/share/man/man7/sysctl.7	Fri Jun 13 22:06:00 2014
@@ -1,4 +1,4 @@
-.\	$NetBSD: sysctl.7,v 1.82 2014/06/13 19:09:07 joerg Exp $
+.\	$NetBSD: sysctl.7,v 1.83 2014/06/13 22:06:00 wiz Exp $
 .\
 .\ Copyright (c) 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -852,7 +852,7 @@ pipes.
 .El
 .It Li kern.pool
 Provides statistics about the
-.Xr pool 9 
+.Xr pool 9
 and
 .Xr pool_cache 9
 subsystems.



CVS commit: src/usr.bin/vmstat

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jun 14 01:27:00 UTC 2014

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
Fix format string for ILP32.


To generate a diff of this commit:
cvs rdiff -u -r1.200 -r1.201 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.200 src/usr.bin/vmstat/vmstat.c:1.201
--- src/usr.bin/vmstat/vmstat.c:1.200	Fri Jun 13 19:10:01 2014
+++ src/usr.bin/vmstat/vmstat.c	Sat Jun 14 01:26:59 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.200 2014/06/13 19:10:01 joerg Exp $ */
+/* $NetBSD: vmstat.c,v 1.201 2014/06/14 01:26:59 joerg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)vmstat.c	8.2 (Berkeley) 3/1/95;
 #else
-__RCSID($NetBSD: vmstat.c,v 1.200 2014/06/13 19:10:01 joerg Exp $);
+__RCSID($NetBSD: vmstat.c,v 1.201 2014/06/14 01:26:59 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -1489,7 +1489,8 @@ dopool_sysctl(int verbose, int wide)
 	inuse /= KILO;
 	total /= KILO;
 	(void)printf(
-	\nIn use %ldK, total allocated %ldK; utilization %.1f%%\n,
+	\nIn use % PRIu64 K, 
+	total allocated % PRIu64 K; utilization %.1f%%\n,
 	inuse, total, (100.0 * inuse) / total);
 
 	free(data);



CVS commit: src/share/misc

2014-06-13 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Sat Jun 14 02:05:38 UTC 2014

Modified Files:
src/share/misc: acronyms.comp

Log Message:
PR/48902 - Nikolai Nifanov -- add XSI


To generate a diff of this commit:
cvs rdiff -u -r1.141 -r1.142 src/share/misc/acronyms.comp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/share/misc/acronyms.comp
diff -u src/share/misc/acronyms.comp:1.141 src/share/misc/acronyms.comp:1.142
--- src/share/misc/acronyms.comp:1.141	Sat Sep 28 18:01:49 2013
+++ src/share/misc/acronyms.comp	Sat Jun 14 02:05:38 2014
@@ -1,4 +1,4 @@
-$NetBSD: acronyms.comp,v 1.141 2013/09/28 18:01:49 dholland Exp $
+$NetBSD: acronyms.comp,v 1.142 2014/06/14 02:05:38 jnemeth Exp $
 3WHS	three-way handshake
 8VSB	8-state vestigial side band modulation
 AA	anti-aliasing
@@ -1353,6 +1353,7 @@ XIP	execute in place
 XML	Extensible Markup Language
 XOR	exclusive or
 XP	extreme programming
+XSI	X/Open System Interface
 XSL	extensible stylesheet language
 XSS	cross site scripting
 XT	extended technology



CVS commit: src/sys/arch/xen/include

2014-06-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jun 14 02:53:02 UTC 2014

Modified Files:
src/sys/arch/xen/include: hypervisor.h

Log Message:
Define a macro to check hypervisor version.  OK cherry@


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/xen/include/hypervisor.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/xen/include/hypervisor.h
diff -u src/sys/arch/xen/include/hypervisor.h:1.43 src/sys/arch/xen/include/hypervisor.h:1.44
--- src/sys/arch/xen/include/hypervisor.h:1.43	Sun Jan 13 21:01:05 2013
+++ src/sys/arch/xen/include/hypervisor.h	Sat Jun 14 02:53:02 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: hypervisor.h,v 1.43 2013/01/13 21:01:05 bouyer Exp $	*/
+/*	$NetBSD: hypervisor.h,v 1.44 2014/06/14 02:53:02 pgoyette Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -136,6 +136,15 @@ extern int xen_version;
 #define XEN_MAJOR(x) (((x)  0x)  16)
 #define XEN_MINOR(x) ((x)  0x)
 
+/*
+ * Does the hypervisor we're running on support an api
+ * call at the requested version number ?
+ */
+#define XEN_VERSION_SUPPORTED(major, minor)		\
+	(XEN_MAJOR(xen_version)  (major) ||		\
+	 (XEN_MAJOR(xen_version) == (major) 		\
+	  XEN_MINOR(xen_version) = (minor)))
+
 /* hypervisor_machdep.c */
 void hypervisor_send_event(struct cpu_info *, unsigned int);
 void hypervisor_unmask_event(unsigned int);



CVS commit: src/sys/arch/x86/x86

2014-06-13 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Sat Jun 14 02:54:47 UTC 2014

Modified Files:
src/sys/arch/x86/x86: pmap.c

Log Message:
Check hypervisor version before trying to call xen_copypage() or
xen_pagezero().  Fixes recent issue encountered running a -current
kernel on a pre-3.4 hypervisor.

OK cherry@


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/x86/x86/pmap.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/pmap.c
diff -u src/sys/arch/x86/x86/pmap.c:1.182 src/sys/arch/x86/x86/pmap.c:1.183
--- src/sys/arch/x86/x86/pmap.c:1.182	Tue May  6 04:26:23 2014
+++ src/sys/arch/x86/x86/pmap.c	Sat Jun 14 02:54:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.182 2014/05/06 04:26:23 cherry Exp $	*/
+/*	$NetBSD: pmap.c,v 1.183 2014/06/14 02:54:47 pgoyette Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
@@ -171,7 +171,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.182 2014/05/06 04:26:23 cherry Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.183 2014/06/14 02:54:47 pgoyette Exp $);
 
 #include opt_user_ldt.h
 #include opt_lockdebug.h
@@ -3013,9 +3013,11 @@ pmap_zero_page(paddr_t pa)
 {
 #if defined(__HAVE_DIRECT_MAP)
 	pagezero(PMAP_DIRECT_MAP(pa));
-#elif defined(XEN)
-	xen_pagezero(pa);
 #else
+#if defined(XEN)
+	if (XEN_VERSION_SUPPORTED(3, 4))
+		xen_pagezero(pa);
+#endif
 	pt_entry_t *zpte;
 	void *zerova;
 	int id;
@@ -3041,7 +3043,7 @@ pmap_zero_page(paddr_t pa)
 	pmap_pte_flush();
 #endif
 	kpreempt_enable();
-#endif
+#endif /* defined(__HAVE_DIRECT_MAP) */
 }
 
 /*
@@ -3096,9 +3098,13 @@ pmap_copy_page(paddr_t srcpa, paddr_t ds
 	vaddr_t dstva = PMAP_DIRECT_MAP(dstpa);
 
 	memcpy((void *)dstva, (void *)srcva, PAGE_SIZE);
-#elif defined(XEN)
-	xen_copy_page(srcpa, dstpa);
 #else
+#if defined(XEN)
+	if (XEN_VERSION_SUPPORTED(3, 4)) {
+		xen_copy_page(srcpa, dstpa);
+		return;
+	}
+#endif
 	pt_entry_t *spte;
 	pt_entry_t *dpte;
 	void *csrcva;
@@ -3128,7 +3134,7 @@ pmap_copy_page(paddr_t srcpa, paddr_t ds
 	pmap_pte_flush();
 #endif
 	kpreempt_enable();
-#endif
+#endif /* defined(__HAVE_DIRECT_MAP) */
 }
 
 static pt_entry_t *
@@ -4105,11 +4111,15 @@ pmap_get_physpage(vaddr_t va, int level,
 
 		if (!uvm_page_physget(paddrp))
 			panic(pmap_get_physpage: out of memory);
-#ifdef __HAVE_DIRECT_MAP
+#if defined(__HAVE_DIRECT_MAP)
 		pagezero(PMAP_DIRECT_MAP(*paddrp));
-#elif defined(XEN)
-		xen_pagezero(*paddrp);
 #else
+#if defined(XEN)
+		if (XEN_VERSION_SUPPORTED(3, 4)) {
+			xen_pagezero(*paddrp);
+			return true;
+		}
+#endif
 		kpreempt_disable();
 		pmap_pte_set(early_zero_pte,
 		pmap_pa2pte(*paddrp) | PG_V | PG_RW | PG_k);
@@ -4121,7 +4131,7 @@ pmap_get_physpage(vaddr_t va, int level,
 		pmap_pte_flush();
 #endif /* defined(DIAGNOSTIC) */
 		kpreempt_enable();
-#endif
+#endif /* defined(__HAVE_DIRECT_MAP) */
 	} else {
 		/* XXX */
 		ptp = uvm_pagealloc(NULL, 0, NULL,



CVS commit: src/usr.bin/vmstat

2014-06-13 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Jun 14 04:06:54 UTC 2014

Modified Files:
src/usr.bin/vmstat: vmstat.c

Log Message:
Init summary counters.


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/usr.bin/vmstat/vmstat.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/vmstat/vmstat.c
diff -u src/usr.bin/vmstat/vmstat.c:1.201 src/usr.bin/vmstat/vmstat.c:1.202
--- src/usr.bin/vmstat/vmstat.c:1.201	Sat Jun 14 01:26:59 2014
+++ src/usr.bin/vmstat/vmstat.c	Sat Jun 14 04:06:54 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: vmstat.c,v 1.201 2014/06/14 01:26:59 joerg Exp $ */
+/* $NetBSD: vmstat.c,v 1.202 2014/06/14 04:06:54 joerg Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2007 The NetBSD Foundation, Inc.
@@ -70,7 +70,7 @@ __COPYRIGHT(@(#) Copyright (c) 1980, 19
 #if 0
 static char sccsid[] = @(#)vmstat.c	8.2 (Berkeley) 3/1/95;
 #else
-__RCSID($NetBSD: vmstat.c,v 1.201 2014/06/14 01:26:59 joerg Exp $);
+__RCSID($NetBSD: vmstat.c,v 1.202 2014/06/14 04:06:54 joerg Exp $);
 #endif
 #endif /* not lint */
 
@@ -1377,6 +1377,7 @@ dopool_sysctl(int verbose, int wide)
 	if (data == NULL)
 		err(1, failed to reead kern.pool);
 
+	memset(pool_totals, 0, sizeof pool_totals);
 	total = inuse = 0;
 	len /= sizeof(*data);