CVS commit: src/sys/dev/usb

2013-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan  2 09:49:15 UTC 2013

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

Log Message:
KNF a comment.


To generate a diff of this commit:
cvs rdiff -u -r1.193 -r1.194 src/sys/dev/usb/ehci.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/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.193 src/sys/dev/usb/ehci.c:1.194
--- src/sys/dev/usb/ehci.c:1.193	Sun Nov  4 12:01:55 2012
+++ src/sys/dev/usb/ehci.c	Wed Jan  2 09:49:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.193 2012/11/04 12:01:55 matt Exp $ */
+/*	$NetBSD: ehci.c,v 1.194 2013/01/02 09:49:14 skrll Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.193 2012/11/04 12:01:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.194 2013/01/02 09:49:14 skrll Exp $");
 
 #include "ohci.h"
 #include "uhci.h"
@@ -3393,8 +3393,10 @@ ehci_device_request(usbd_xfer_handle xfe
 	sqh = epipe->sqh;
 	epipe->u.ctl.length = len;
 
-	/* Update device address and length since they may have changed
-	   during the setup of the control pipe in usbd_new_device(). */
+	/*
+	 * Update device address and length since they may have changed
+	 * during the setup of the control pipe in usbd_new_device().
+	 */
 	/* XXX This only needs to be done once, but it's too early in open. */
 	/*  Should not touch ED here! */
 	sqh->qh.qh_endp =



CVS commit: src/sys/dev/usb

2013-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan  2 09:50:26 UTC 2013

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

Log Message:
Correct a comment


To generate a diff of this commit:
cvs rdiff -u -r1.226 -r1.227 src/sys/dev/usb/ohci.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.226 src/sys/dev/usb/ohci.c:1.227
--- src/sys/dev/usb/ohci.c:1.226	Sun Dec 23 17:00:13 2012
+++ src/sys/dev/usb/ohci.c	Wed Jan  2 09:50:26 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.226 2012/12/23 17:00:13 skrll Exp $	*/
+/*	$NetBSD: ohci.c,v 1.227 2013/01/02 09:50:26 skrll Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.226 2012/12/23 17:00:13 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.227 2013/01/02 09:50:26 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -3255,7 +3255,7 @@ ohci_device_intr_start(usbd_xfer_handle 
 	return (USBD_IN_PROGRESS);
 }
 
-/* Abort a device control request. */
+/* Abort a device interrupt request. */
 Static void
 ohci_device_intr_abort(usbd_xfer_handle xfer)
 {



CVS commit: src/sys/dev/usb

2013-01-02 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Jan  2 09:53:58 UTC 2013

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

Log Message:
Use NULL not 0 for pointer assignment.


To generate a diff of this commit:
cvs rdiff -u -r1.184 -r1.185 src/sys/dev/usb/usb_subr.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/usb_subr.c
diff -u src/sys/dev/usb/usb_subr.c:1.184 src/sys/dev/usb/usb_subr.c:1.185
--- src/sys/dev/usb/usb_subr.c:1.184	Tue Dec 11 12:59:03 2012
+++ src/sys/dev/usb/usb_subr.c	Wed Jan  2 09:53:58 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_subr.c,v 1.184 2012/12/11 12:59:03 skrll Exp $	*/
+/*	$NetBSD: usb_subr.c,v 1.185 2013/01/02 09:53:58 skrll Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.184 2012/12/11 12:59:03 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.185 2013/01/02 09:53:58 skrll Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_usbverbose.h"
@@ -751,7 +751,7 @@ usbd_setup_pipe(usbd_device_handle dev, 
 	p->endpoint = ep;
 	ep->refcnt++;
 	p->refcnt = 1;
-	p->intrxfer = 0;
+	p->intrxfer = NULL;
 	p->running = 0;
 	p->aborting = 0;
 	p->repeat = 0;



CVS commit: src/external/cddl/osnet/sys/sys

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 10:33:19 UTC 2013

Modified Files:
src/external/cddl/osnet/sys/sys: zfs_context.h

Log Message:
Replace alloca(256) with an array.
The code ended up using alloca() from libc - which 'just can't work' (tm).
It is also pointless!


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/cddl/osnet/sys/sys/zfs_context.h

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

Modified files:

Index: src/external/cddl/osnet/sys/sys/zfs_context.h
diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.12 src/external/cddl/osnet/sys/sys/zfs_context.h:1.13
--- src/external/cddl/osnet/sys/sys/zfs_context.h:1.12	Mon Nov 21 17:51:03 2011
+++ src/external/cddl/osnet/sys/sys/zfs_context.h	Wed Jan  2 10:33:19 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: zfs_context.h,v 1.12 2011/11/21 17:51:03 christos Exp $	*/
+/*	$NetBSD: zfs_context.h,v 1.13 2013/01/02 10:33:19 dsl Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -146,7 +146,7 @@ extern void vcmn_err(int, const char *, 
 	const TYPE __left = (TYPE)(LEFT); \
 	const TYPE __right = (TYPE)(RIGHT); \
 	if (!(__left OP __right)) { \
-		char *__buf = alloca(256); \
+		char __buf[256]; \
 		(void) snprintf(__buf, 256, "%s %s %s (0x%llx %s 0x%llx)", \
 			#LEFT, #OP, #RIGHT, \
 			(u_longlong_t)__left, #OP, (u_longlong_t)__right); \



CVS commit: src/external/cddl/osnet/dist/cmd/zpool

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 10:33:49 UTC 2013

Modified Files:
src/external/cddl/osnet/dist/cmd/zpool: zpool_main.c

Log Message:
Explicitly include sys/ioctl.h


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.2 -r1.2 \
src/external/cddl/osnet/dist/cmd/zpool/zpool_main.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/cddl/osnet/dist/cmd/zpool/zpool_main.c
diff -u src/external/cddl/osnet/dist/cmd/zpool/zpool_main.c:1.1.1.2 src/external/cddl/osnet/dist/cmd/zpool/zpool_main.c:1.2
--- src/external/cddl/osnet/dist/cmd/zpool/zpool_main.c:1.1.1.2	Sat Feb 27 22:29:26 2010
+++ src/external/cddl/osnet/dist/cmd/zpool/zpool_main.c	Wed Jan  2 10:33:49 2013
@@ -43,6 +43,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 



CVS commit: src/usr.bin/pkill

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 10:36:07 UTC 2013

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

Log Message:
Explicitly include sys/resource.h


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/usr.bin/pkill/pkill.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/pkill/pkill.c
diff -u src/usr.bin/pkill/pkill.c:1.28 src/usr.bin/pkill/pkill.c:1.29
--- src/usr.bin/pkill/pkill.c:1.28	Tue Nov 20 22:52:01 2012
+++ src/usr.bin/pkill/pkill.c	Wed Jan  2 10:36:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pkill.c,v 1.28 2012/11/20 22:52:01 christos Exp $	*/
+/*	$NetBSD: pkill.c,v 1.29 2013/01/02 10:36:07 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: pkill.c,v 1.28 2012/11/20 22:52:01 christos Exp $");
+__RCSID("$NetBSD: pkill.c,v 1.29 2013/01/02 10:36:07 dsl Exp $");
 #endif /* !lint */
 
 #include 
@@ -39,6 +39,7 @@ __RCSID("$NetBSD: pkill.c,v 1.28 2012/11
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 



CVS commit: src/usr.sbin/pstat

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 10:43:11 UTC 2013

Modified Files:
src/usr.sbin/pstat: Makefile

Log Message:
pstat is a kmem groveller, set -D_KMEMUSER in CPPFLAGS


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/pstat/Makefile

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

Modified files:

Index: src/usr.sbin/pstat/Makefile
diff -u src/usr.sbin/pstat/Makefile:1.15 src/usr.sbin/pstat/Makefile:1.16
--- src/usr.sbin/pstat/Makefile:1.15	Mon May 28 12:06:39 2007
+++ src/usr.sbin/pstat/Makefile	Wed Jan  2 10:43:11 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2007/05/28 12:06:39 tls Exp $
+#	$NetBSD: Makefile,v 1.16 2013/01/02 10:43:11 dsl Exp $
 #	from: @(#)Makefile	8.1 (Berkeley) 6/6/93
 
 .include 
@@ -15,6 +15,8 @@ LDADD=	-lkvm
 
 CPPFLAGS+=-I${NETBSDSRCDIR}/sbin/swapctl
 
+CPPFLAGS+=-D_KMEMUSER
+
 .PATH: ${NETBSDSRCDIR}/sbin/swapctl
 
 .include 



CVS commit: src/tests/lib/libc/gen

2013-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Wed Jan  2 11:28:49 UTC 2013

Modified Files:
src/tests/lib/libc/gen: t_glob.c

Log Message:
Remove check for GLOB_NOCHECK - the behaviour has been changed again, so it
will return a modified pattern.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/gen/t_glob.c

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

Modified files:

Index: src/tests/lib/libc/gen/t_glob.c
diff -u src/tests/lib/libc/gen/t_glob.c:1.2 src/tests/lib/libc/gen/t_glob.c:1.3
--- src/tests/lib/libc/gen/t_glob.c:1.2	Tue Dec 18 01:37:28 2012
+++ src/tests/lib/libc/gen/t_glob.c	Wed Jan  2 11:28:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_glob.c,v 1.2 2012/12/18 01:37:28 christos Exp $	*/
+/*	$NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__RCSID("$NetBSD: t_glob.c,v 1.2 2012/12/18 01:37:28 christos Exp $");
+__RCSID("$NetBSD: t_glob.c,v 1.3 2013/01/02 11:28:48 martin Exp $");
 
 #include 
 
@@ -238,6 +238,7 @@ ATF_TC_BODY(glob_star_not, tc)
 	run("a/**", 0, glob_star_not, __arraycount(glob_star_not));
 }
 
+#if 0
 ATF_TC(glob_nocheck);
 ATF_TC_HEAD(glob_nocheck, tc)
 {
@@ -255,12 +256,18 @@ ATF_TC_BODY(glob_nocheck, tc)
 	};
 	run(pattern, GLOB_NOCHECK, glob_nocheck, __arraycount(glob_nocheck));
 }
+#endif
 
 ATF_TP_ADD_TCS(tp)
 {
 	ATF_TP_ADD_TC(tp, glob_star);
 	ATF_TP_ADD_TC(tp, glob_star_not);
-	ATF_TP_ADD_TC(tp, glob_nocheck);
+/*
+ * Remove this test for now - the GLOB_NOCHECK return value has been
+ * re-defined to return a modified pattern in revision 1.33 of glob.c
+ *
+ *	ATF_TP_ADD_TC(tp, glob_nocheck);
+ */
 
 	return atf_no_error();
 }



CVS commit: src/external/historical/nawk/dist

2013-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  2 13:46:17 UTC 2013

Modified Files:
src/external/historical/nawk/dist: b.c

Log Message:
we define HAS_ISBLANK in the Makefile


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/historical/nawk/dist/b.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/historical/nawk/dist/b.c
diff -u src/external/historical/nawk/dist/b.c:1.4 src/external/historical/nawk/dist/b.c:1.5
--- src/external/historical/nawk/dist/b.c:1.4	Fri Dec 28 21:44:26 2012
+++ src/external/historical/nawk/dist/b.c	Wed Jan  2 08:46:17 2013
@@ -843,7 +843,7 @@ Node *unary(Node *np)
  * to nelson beebe for the suggestion; let's see if it works everywhere.
  */
 
-#define HAS_ISBLANK
+/* #define HAS_ISBLANK */
 
 static const struct charclass {
 	const char *cc_name;



CVS commit: src/usr.bin/units

2013-01-02 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Wed Jan  2 14:05:04 UTC 2013

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

Log Message:
Really expand the name, not the definition, as the comment says.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/usr.bin/units/units.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/units/units.c
diff -u src/usr.bin/units/units.c:1.22 src/usr.bin/units/units.c:1.23
--- src/usr.bin/units/units.c:1.22	Tue Jan  1 12:45:06 2013
+++ src/usr.bin/units/units.c	Wed Jan  2 14:05:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: units.c,v 1.22 2013/01/01 12:45:06 apb Exp $	*/
+/*	$NetBSD: units.c,v 1.23 2013/01/02 14:05:04 apb Exp $	*/
 
 /*
  * units.c   Copyright (c) 1993 by Adrian Mariano (adr...@cam.cornell.edu)
@@ -771,7 +771,7 @@ listunits(int expand)
 			 * will be interpreted as multiplication.
 			 */
 			initializeunit(&theunit);
-			if (addunit(&theunit, thedefn/*XXX*/, 0) != 0
+			if (addunit(&theunit, thename, 0) != 0
 			|| completereduce(&theunit) != 0) {
 errors++;
 printexpansion = 0;



CVS commit: src/common/lib/libc/arch/arm/string

2013-01-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan  2 15:24:21 UTC 2013

Added Files:
src/common/lib/libc/arch/arm/string: strlen.S
Removed Files:
src/common/lib/libc/arch/arm/string: strlen_armv6.S

Log Message:
Rename strlen_armv6.S to strlen.S since this is no longer armv6 dependent.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/common/lib/libc/arch/arm/string/strlen.S
cvs rdiff -u -r1.3 -r0 src/common/lib/libc/arch/arm/string/strlen_armv6.S

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

Added files:

Index: src/common/lib/libc/arch/arm/string/strlen.S
diff -u /dev/null src/common/lib/libc/arch/arm/string/strlen.S:1.1
--- /dev/null	Wed Jan  2 15:24:21 2013
+++ src/common/lib/libc/arch/arm/string/strlen.S	Wed Jan  2 15:24:21 2013
@@ -0,0 +1,121 @@
+/*-
+ * Copyright (c) 2012 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas of 3am Software Foundry.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include 
+
+RCSID("$NetBSD: strlen.S,v 1.1 2013/01/02 15:24:21 matt Exp $")
+
+#ifdef __ARMEL__
+#define	BYTE0	0x00ff
+#define	BYTE1	0xff00
+#define	BYTE2	0x00ff
+#define	BYTE3	0xff00
+#else
+#define	BYTE0	0xff00
+#define	BYTE1	0x00ff
+#define	BYTE2	0xff00
+#define	BYTE3	0x00ff
+#endif
+
+	.text
+ENTRY(strlen)
+	add	ip, r0, #4		/* for the final post-inc */
+1:	tst	r0, #3			/* test for word alignment */
+	beq	.Lpre_main_loop		/*   finally word aligned */
+	ldrb	r3, [r0], #1		/* load a byte */
+	teq	r3, #0			/* is it 0? */
+	bne	1b			/*   no, try next byte */
+	sub	ip, ip, #3		/* subtract (4 - the NUL) */
+	sub	r0, r0, ip		/* subtract start */
+	RET/* return */
+.Lpre_main_loop:
+#if defined(_ARM_ARCH_6)
+#if defined(_ARM_ARCH_7)
+	movw	r1, #0xfefe		/* magic constant; 254 in each byte */
+#else
+	mov	r1, #0xfe		/* put 254 in low byte */
+	orr	r1, r1, r1, lsl #8	/* move to next byte */
+#endif
+	orr	r1, r1, r1, lsl #16	/* move to next halfword */
+#endif /* _ARM_ARCH_6 */
+.Lmain_loop:
+	ldr	r3, [r0], #4		/* load next word */
+#if defined(_ARM_ARCH_6)
+	/*
+	 * Add 254 to each byte using the UQADD8 (unsigned saturating add 8)
+	 * instruction.  For every non-NUL byte, the result for that byte will
+	 * become 255.  For NUL, it will be 254.  When we complement the
+	 * result, if the result is non-0 then we must have encountered a NUL.
+	 */
+	uqadd8	r3, r3, r1		/* magic happens here */
+	mvns	r3, r3			/* is the complemented result non-0? */
+	beq	.Lmain_loop		/*no, then we encountered no NULs */
+#else
+	/*
+	 * No fancy shortcuts so just test each byte lane for a NUL.
+	 * (other tests for NULs in a word take more instructions/cycles).
+	 */
+	tst	r3, #BYTE0		/* is this byte 0? */
+	tstne	r3, #BYTE1		/*   no, is this byte 0? */
+	tstne	r3, #BYTE2		/*   no, is this byte 0? */
+	tstne	r3, #BYTE3		/*   no, is this byte 0? */
+	bne	.Lmain_loop		/*   no, then get next word */
+#endif
+#if defined(_ARM_ARCH_6)
+	/*
+	 * We encountered a NUL.  Find out where by doing a CLZ and then
+	 * shifting right by 3.  That will be the number of non-NUL bytes.
+	 */
+#ifdef __ARMEL__
+	rev	r3, r3			/* we want this in BE for the CLZ */
+#endif
+	clz	r3, r3			/* count how many leading zeros */
+	add	r0, r0, r3, lsr #3	/* divide that by 8 and add to count */
+#else
+	/*
+	 * We encountered a NUL.
+	 */
+	tst	r3, #BYTE0		/* 1st byte was NUL? */
+	beq	1f			/*   yes, done adding */
+	add	r0, r0, #1		/* we have one more non-NUL byte */
+	tst	r3, #BYTE1		/* 2nd byte was NUL? */
+	beq	1f			/*   yes, done adding */
+	add	r0, r

CVS commit: src/common/lib/libc/arch/arm/string

2013-01-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan  2 15:38:03 UTC 2013

Modified Files:
src/common/lib/libc/arch/arm/string: strcpy.S

Log Message:
Deal with _LIBC (aliases, etc).
Add missing #endif.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/arch/arm/string/strcpy.S

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

Modified files:

Index: src/common/lib/libc/arch/arm/string/strcpy.S
diff -u src/common/lib/libc/arch/arm/string/strcpy.S:1.1 src/common/lib/libc/arch/arm/string/strcpy.S:1.2
--- src/common/lib/libc/arch/arm/string/strcpy.S:1.1	Wed Jan  2 05:54:58 2013
+++ src/common/lib/libc/arch/arm/string/strcpy.S	Wed Jan  2 15:38:03 2013
@@ -29,9 +29,12 @@
 
 #include 
 
-RCSID("$NetBSD: strcpy.S,v 1.1 2013/01/02 05:54:58 matt Exp $")
+RCSID("$NetBSD: strcpy.S,v 1.2 2013/01/02 15:38:03 matt Exp $")
 
 #ifdef STRLCPY
+#ifdef _LIBC
+WEAK_ALIAS(strlcpy, _strlcpy)
+#endif
 #define	FUNCNAME	strlcpy
 #elif defined(STRNCPY)
 #define	FUNCNAME	strncpy
@@ -39,6 +42,10 @@ RCSID("$NetBSD: strcpy.S,v 1.1 2013/01/0
 #define	FUNCNAME	strcpy
 #endif
 
+#ifdef _LIBC
+#include "namespace.h"
+#endif
+
 #ifdef __ARMEL__
 #define	lslo	lsr		/* shift to lower address */
 #define	lshi	lsl		/* shift to higher address */
@@ -80,7 +87,7 @@ ENTRY(FUNCNAME)
 	moveq	r3, #0			/*   = 1? load NUL */
 	streqb	r3, [r0]		/*   = 1? write NUL to dst */
 	mov	r0, r1			/* move src to r0 */
-	b	_C_LABEL(strlen)	/* and tailcall strlen */
+	b	PLT_SYM(_C_LABEL(strlen)) /* and tailcall strlen */
 1:
 	sub	r2, r2, #1		/* leave one byte for NUL */
 #endif
@@ -376,6 +383,7 @@ ENTRY(FUNCNAME)
 	strb	ip, [r0]		/*   yes, write trailing NUL */
 	b	.Lend_of_string		/*   yes, and we are the end */
 1:
+#endif
 #if defined(STRLCPY) || defined(STRNCPY)
 	cmp	r2, ip, lsr #3		/* is there enough room? */
 	movlt	ip, r2, lsl #3		/*   no, only fill remaining space */
@@ -491,7 +499,7 @@ ENTRY(FUNCNAME)
 	cmp	r2, #16			/* some, but not a lot? */
 	ble	1f
 	mov	r4, lr			/* preserve lr */
-	bl	_C_LABEL(memset)	/*   yes, and let memset do it */
+	bl	PLT_SYM(_C_LABEL(memset)) /*   yes, and let memset do it */
 	mov	lr, r4			/* restore lr */
 	b	3f			/* return */
 1:	add	ip, r0, r2		/* calculate stopping point */



CVS commit: src/external/bsd/ipf/bin

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 15:50:34 UTC 2013

Modified Files:
src/external/bsd/ipf/bin/ipresend: Makefile
src/external/bsd/ipf/bin/ipsend: Makefile

Log Message:
# There is some very dubious code to locate the values of
# tcb.rcv_adv, tcb.snd_nxt and tcb.rcv_nxt for a socket.
so add: CPPFLAGS+= -D_KMEMUSER


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/bin/ipresend/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/bin/ipsend/Makefile

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

Modified files:

Index: src/external/bsd/ipf/bin/ipresend/Makefile
diff -u src/external/bsd/ipf/bin/ipresend/Makefile:1.2 src/external/bsd/ipf/bin/ipresend/Makefile:1.3
--- src/external/bsd/ipf/bin/ipresend/Makefile:1.2	Sat Mar 24 02:08:34 2012
+++ src/external/bsd/ipf/bin/ipresend/Makefile	Wed Jan  2 15:50:34 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2012/03/24 02:08:34 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2013/01/02 15:50:34 dsl Exp $
 
 .include 
 .include "../Makefile.inc"
@@ -10,6 +10,10 @@ MAN=		ipresend.1
 CPPFLAGS+=	-I. -I${.CURDIR}/../ipsend -I${NETBSDSRCDIR}/sys 
 .PATH:		${UDIST}/ipsend
 
+# There is some very dubious code to locate the values of
+# tcb.rcv_adv, tcb.snd_nxt and tcb.rcv_nxt for a socket.
+CPPFLAGS+=	-D_KMEMUSER
+
 #.BEGIN:
 #	rm -f machine x86
 #	ln -s ${NETBSDSRCDIR}/sys/arch/${MACHINE}/include machine

Index: src/external/bsd/ipf/bin/ipsend/Makefile
diff -u src/external/bsd/ipf/bin/ipsend/Makefile:1.2 src/external/bsd/ipf/bin/ipsend/Makefile:1.3
--- src/external/bsd/ipf/bin/ipsend/Makefile:1.2	Sat Mar 24 02:08:34 2012
+++ src/external/bsd/ipf/bin/ipsend/Makefile	Wed Jan  2 15:50:34 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2012/03/24 02:08:34 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2013/01/02 15:50:34 dsl Exp $
 
 .include 
 .include "../Makefile.inc"
@@ -14,6 +14,10 @@ CPPFLAGS+=	-I${UDIST}/ipsend
 CPPFLAGS+=	-I${UDIST}/iplang
 CPPFLAGS+=	-I${.CURDIR} -I.
 
+# There is some very dubious code to locate the values of
+# tcb.rcv_adv, tcb.snd_nxt and tcb.rcv_nxt for a socket.
+CPPFLAGS+=	-D_KMEMUSER
+
 CLEANFILES+=	iplang_y.c iplang_y.h
 
 DPSRCS+=	iplang_y.h



CVS commit: src/external/cddl/osnet

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 16:31:25 UTC 2013

Modified Files:
src/external/cddl/osnet/lib/libzpool: kernel.c
src/external/cddl/osnet/sys/sys: zfs_context.h

Log Message:
I've NFI why this code has userspace stuff playing with 'struct proc *'
  nor why it uses &p0 as a magic constant (rather than NULL).
Re-instate the definition of p0, but enable the 'fake' definition
  of 'struct proc' if the relevant part of sys/proc.h seems to have
  been #if'ed away.
Should fix the build.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/external/cddl/osnet/lib/libzpool/kernel.c
cvs rdiff -u -r1.13 -r1.14 src/external/cddl/osnet/sys/sys/zfs_context.h

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

Modified files:

Index: src/external/cddl/osnet/lib/libzpool/kernel.c
diff -u src/external/cddl/osnet/lib/libzpool/kernel.c:1.6 src/external/cddl/osnet/lib/libzpool/kernel.c:1.7
--- src/external/cddl/osnet/lib/libzpool/kernel.c:1.6	Tue Jan  1 19:03:26 2013
+++ src/external/cddl/osnet/lib/libzpool/kernel.c	Wed Jan  2 16:31:24 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: kernel.c,v 1.6 2013/01/01 19:03:26 dsl Exp $  */
+/* $NetBSD: kernel.c,v 1.7 2013/01/02 16:31:24 dsl Exp $  */
 
 /*
  * CDDL HEADER START
@@ -29,7 +29,7 @@
 #pragma ident	"%Z%%M%	%I%	%E% SMI"
 
 #include 
-__RCSID("$NetBSD: kernel.c,v 1.6 2013/01/01 19:03:26 dsl Exp $");
+__RCSID("$NetBSD: kernel.c,v 1.7 2013/01/02 16:31:24 dsl Exp $");
 
 #include 
 #include 
@@ -65,7 +65,7 @@ struct utsname utsname = {
 };
 
 /* this only exists to have its address taken */
-// struct proc p0;
+struct proc p0;
 
 /*
  * =

Index: src/external/cddl/osnet/sys/sys/zfs_context.h
diff -u src/external/cddl/osnet/sys/sys/zfs_context.h:1.13 src/external/cddl/osnet/sys/sys/zfs_context.h:1.14
--- src/external/cddl/osnet/sys/sys/zfs_context.h:1.13	Wed Jan  2 10:33:19 2013
+++ src/external/cddl/osnet/sys/sys/zfs_context.h	Wed Jan  2 16:31:24 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: zfs_context.h,v 1.13 2013/01/02 10:33:19 dsl Exp $	*/
+/*	$NetBSD: zfs_context.h,v 1.14 2013/01/02 16:31:24 dsl Exp $	*/
 
 /*
  * CDDL HEADER START
@@ -212,11 +212,13 @@ typedef pthread_t kthread_t;
 	
 extern kthread_t *zk_thread_create(void (*func)(), void *arg);
 
-/* In NetBSD struct proc is visible in userspace therefore we use it's original
+/* In NetBSD struct proc may be visible in userspace therefore we use it's original
definition. */
-/* struct proc {
+#if !defined(p_startzero)
+struct proc {
 	uintptr_t   this_is_never_used_dont_dereference_it;
-	}; */
+	};
+#endif
 
 extern struct proc p0;
 	



CVS commit: src/sys/sys

2013-01-02 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Jan  2 17:02:13 UTC 2013

Modified Files:
src/sys/sys: cdefs.h

Log Message:
Don't define __BIT/__BITS if __ASSEMBLER__ is defined.
(since they use C syntax they won't work anyways).


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/sys/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/sys/cdefs.h
diff -u src/sys/sys/cdefs.h:1.103 src/sys/sys/cdefs.h:1.104
--- src/sys/sys/cdefs.h:1.103	Sun Oct 28 17:06:40 2012
+++ src/sys/sys/cdefs.h	Wed Jan  2 17:02:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdefs.h,v 1.103 2012/10/28 17:06:40 joerg Exp $	*/
+/*	$NetBSD: cdefs.h,v 1.104 2013/01/02 17:02:13 matt Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -512,6 +512,7 @@
  */
 #define	__arraycount(__x)	(sizeof(__x) / sizeof(__x[0]))
 
+#ifndef __ASSEMBLER__
 /* __BIT(n): nth bit, where __BIT(0) == 0x1. */
 #define	__BIT(__n)	\
 (((uintmax_t)(__n) >= NBBY * sizeof(uintmax_t)) ? 0 : ((uintmax_t)1 << (uintmax_t)(__n)))
@@ -519,6 +520,7 @@
 /* __BITS(m, n): bits m through n, m < n. */
 #define	__BITS(__m, __n)	\
 	((__BIT(MAX((__m), (__n)) + 1) - 1) ^ (__BIT(MIN((__m), (__n))) - 1))
+#endif /* !__ASSEMBLER__ */
 
 /* find least significant bit that is set */
 #define	__LOWEST_SET_BIT(__mask) __mask) - 1) & (__mask)) ^ (__mask))



CVS commit: src/tests/usr.sbin/mtree

2013-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  2 18:11:44 UTC 2013

Modified Files:
src/tests/usr.sbin/mtree: Makefile t_mtree.sh
Added Files:
src/tests/usr.sbin/mtree: mtree_d_create.out netbsd6_d_create.out
Removed Files:
src/tests/usr.sbin/mtree: d_create.out

Log Message:
Test the netbsd and mtree flavors.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.sbin/mtree/Makefile
cvs rdiff -u -r1.1 -r0 src/tests/usr.sbin/mtree/d_create.out
cvs rdiff -u -r0 -r1.1 src/tests/usr.sbin/mtree/mtree_d_create.out \
src/tests/usr.sbin/mtree/netbsd6_d_create.out
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.sbin/mtree/t_mtree.sh

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

Modified files:

Index: src/tests/usr.sbin/mtree/Makefile
diff -u src/tests/usr.sbin/mtree/Makefile:1.1 src/tests/usr.sbin/mtree/Makefile:1.2
--- src/tests/usr.sbin/mtree/Makefile:1.1	Sat Mar 17 12:33:16 2012
+++ src/tests/usr.sbin/mtree/Makefile	Wed Jan  2 13:11:44 2013
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2012/03/17 16:33:16 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2013/01/02 18:11:44 christos Exp $
 
 NOMAN=		# defined
 
@@ -9,12 +9,14 @@ TESTSDIR=	${TESTSBASE}/usr.sbin/mtree
 TESTS_SH=	t_mtree
 
 FILESDIR=	${TESTSDIR}
+
 FILES+=		d_convert.in
 FILES+=		d_convert_C.out
 FILES+=		d_convert_C_S.out
 FILES+=		d_convert_D.out
 FILES+=		d_convert_D_S.out
-FILES+=		d_create.out
+FILES+=		netbsd6_d_create.out
+FILES+=		mtree_d_create.out
 FILES+=		d_merge.in
 FILES+=		d_merge_C_M.out
 FILES+=		d_merge_C_M_S.out

Index: src/tests/usr.sbin/mtree/t_mtree.sh
diff -u src/tests/usr.sbin/mtree/t_mtree.sh:1.4 src/tests/usr.sbin/mtree/t_mtree.sh:1.5
--- src/tests/usr.sbin/mtree/t_mtree.sh:1.4	Sun Mar 25 12:10:13 2012
+++ src/tests/usr.sbin/mtree/t_mtree.sh	Wed Jan  2 13:11:44 2013
@@ -1,4 +1,4 @@
-# $NetBSD: t_mtree.sh,v 1.4 2012/03/25 16:10:13 christos Exp $
+# $NetBSD: t_mtree.sh,v 1.5 2013/01/02 18:11:44 christos Exp $
 #
 # Copyright (c) 2009, 2012 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -28,6 +28,7 @@
 # Postprocess mtree output, canonicalising portions that
 # are expected to differ from one run to another.
 #
+
 h_postprocess()
 {
 	sed -e '
@@ -43,7 +44,9 @@ h_check()
 diff -Nru "$1" "$2" || atf_fail "files $1 and $2 differ"
 }
 
-atf_test_case create
+
+atf_test_case mtree_create
+atf_test_case netbsd6_create
 create_head()
 {
 	atf_set "descr" "Create a specfile describing a directory tree"
@@ -52,6 +55,7 @@ create_head()
 create_setup()
 {
 	# create some directories
+	rm -fr create
 	mkdir -p create/a/1 create/a/2 create/b
 	# create some files
 	for file in create/top.file.1 \
@@ -80,13 +84,33 @@ create_body()
 	create_setup
 
 	# run mtree and check output
-	( cd create && mtree -c -k type,nlink,link,size,sha256 ) >output.raw \
+	( cd create && mtree -F ${FLAVOR} -c -k type,nlink,link,size,sha256 ) >output.raw \
 	|| atf_fail "mtree exit status $?"
 	h_postprocess output
-	h_check "$(atf_get_srcdir)/d_create.out" output
+	h_check "$(atf_get_srcdir)/${FLAVOR}_d_create.out" output
+}
+
+mtree_create_head() 
+{
+	FLAVOR=mtree create_head
+}
+netbsd6_create_head() 
+{
+	FLAVOR=netbsd6 create_head
 }
 
-atf_test_case check
+mtree_create_body() 
+{
+	FLAVOR=mtree create_body
+}
+netbsd6_create_body() 
+{
+	FLAVOR=netbsd6 create_body
+}
+
+
+atf_test_case mtree_check
+atf_test_case netbsd6_check
 check_head()
 {
 	atf_set "descr" "Check a directory tree against a specfile"
@@ -98,12 +122,32 @@ check_body()
 	create_setup
 
 	# run mtree and check output
-	( cd create && mtree ) <"$(atf_get_srcdir)/d_create.out" >output \
+	( cd create && mtree -F ${FLAVOR}  ) <"$(atf_get_srcdir)/${FLAVOR}_d_create.out" >output \
 	|| atf_fail "mtree exit status $?"
 	h_check /dev/null output
 }
 
-atf_test_case convert_C
+mtree_check_head() 
+{
+	FLAVOR=mtree check_head
+}
+netbsd6_check_head() 
+{
+	FLAVOR=netbsd6 check_head
+}
+
+mtree_check_body() 
+{
+	FLAVOR=mtree check_body
+}
+netbsd6_check_body() 
+{
+	FLAVOR=netbsd6 check_body
+}
+
+
+atf_test_case mtree_convert_C
+atf_test_case netbsd6_convert_C
 convert_C_head()
 {
 	atf_set "descr" "Convert a specfile to mtree -C format, unsorted"
@@ -111,11 +155,31 @@ convert_C_head()
 
 convert_C_body()
 {
-	mtree -C -K all <"$(atf_get_srcdir)/d_convert.in" >output
+	mtree -F ${FLAVOR} -C -K all <"$(atf_get_srcdir)/d_convert.in" >output
 	h_check "$(atf_get_srcdir)/d_convert_C.out" output
 }
 
-atf_test_case convert_C_S
+mtree_convert_C_head() 
+{
+	FLAVOR=mtree convert_C_head
+}
+netbsd6_convert_C_head() 
+{
+	FLAVOR=netbsd6 convert_C_head
+}
+
+mtree_convert_C_body() 
+{
+	FLAVOR=mtree convert_C_body
+}
+netbsd6_convert_C_body() 
+{
+	FLAVOR=netbsd6 convert_C_body
+}
+
+
+atf_test_case mtree_convert_C_S
+atf_test_case netbsd6_convert_C_S
 convert_C_S_head()
 {
 	atf_set "descr" "Convert a specfile to mtree -C format, sorted"
@@ -123,11 +187,31 @@ convert_C_S_

CVS commit: src/distrib/sets/lists/tests

2013-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Jan  2 18:12:58 UTC 2013

Modified Files:
src/distrib/sets/lists/tests: mi

Log Message:
fix mtree sets


To generate a diff of this commit:
cvs rdiff -u -r1.512 -r1.513 src/distrib/sets/lists/tests/mi

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/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.512 src/distrib/sets/lists/tests/mi:1.513
--- src/distrib/sets/lists/tests/mi:1.512	Tue Dec  4 01:57:44 2012
+++ src/distrib/sets/lists/tests/mi	Wed Jan  2 13:12:57 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.512 2012/12/04 06:57:44 jruoho Exp $
+# $NetBSD: mi,v 1.513 2013/01/02 18:12:57 christos Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -3360,7 +3360,9 @@
 ./usr/tests/usr.sbin/mtree/d_convert_C_S.out	tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/d_convert_D.out	tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/d_convert_D_S.out	tests-usr.sbin-tests	atf
-./usr/tests/usr.sbin/mtree/d_create.out		tests-usr.sbin-tests	atf
+./usr/tests/usr.sbin/mtree/d_create.out		tests-obsolete		obsolete
+./usr/tests/usr.sbin/mtree/mtree_d_create.out	tests-usr.sbin-tests	atf
+./usr/tests/usr.sbin/mtree/netbsd6_d_create.out	tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/d_merge.in		tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/d_merge_C_M.out	tests-usr.sbin-tests	atf
 ./usr/tests/usr.sbin/mtree/d_merge_C_M_S.out	tests-usr.sbin-tests	atf



CVS commit: src/external/bsd/ipf/bin/iptest

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 18:41:50 UTC 2013

Modified Files:
src/external/bsd/ipf/bin/iptest: Makefile

Log Message:
There is some very dubious code to locate the values of
tcb.rcv_adv, tcb.snd_nxt and tcb.rcv_nxt for a socket.
so set CPPFLAGS+=  -D_KMEMUSER


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/ipf/bin/iptest/Makefile

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

Modified files:

Index: src/external/bsd/ipf/bin/iptest/Makefile
diff -u src/external/bsd/ipf/bin/iptest/Makefile:1.2 src/external/bsd/ipf/bin/iptest/Makefile:1.3
--- src/external/bsd/ipf/bin/iptest/Makefile:1.2	Sat Mar 24 02:08:34 2012
+++ src/external/bsd/ipf/bin/iptest/Makefile	Wed Jan  2 18:41:49 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2012/03/24 02:08:34 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2013/01/02 18:41:49 dsl Exp $
 
 .include 
 .include "../Makefile.inc"
@@ -10,4 +10,8 @@ MAN=		iptest.1
 CPPFLAGS+=	-I${.CURDIR}/../ipsend -I${NETBSDSRCDIR}/sys
 .PATH:		${UDIST}/ipsend
 
+# There is some very dubious code to locate the values of
+# tcb.rcv_adv, tcb.snd_nxt and tcb.rcv_nxt for a socket.
+CPPFLAGS+=  -D_KMEMUSER
+
 .include 



CVS commit: src/external/gpl3/gdb/dist/gdb

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 18:44:46 UTC 2013

Modified Files:
src/external/gpl3/gdb/dist/gdb: amd64bsd-nat.c

Log Message:
amd64's machine/reg now includes fpu.h (to define 'struct fxsave64)
so no need to include signal.h here - which shouldn't result in
the definitions in fpu.h being included anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/gpl3/gdb/dist/gdb/amd64bsd-nat.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/gpl3/gdb/dist/gdb/amd64bsd-nat.c
diff -u src/external/gpl3/gdb/dist/gdb/amd64bsd-nat.c:1.2 src/external/gpl3/gdb/dist/gdb/amd64bsd-nat.c:1.3
--- src/external/gpl3/gdb/dist/gdb/amd64bsd-nat.c:1.2	Sat Oct  8 21:43:35 2011
+++ src/external/gpl3/gdb/dist/gdb/amd64bsd-nat.c	Wed Jan  2 18:44:46 2013
@@ -23,10 +23,7 @@
 #include "regcache.h"
 #include "target.h"
 
-/* We include  to make sure `struct fxsave64' is defined on
-   NetBSD, since NetBSD's  needs it.  */
 #include "gdb_assert.h"
-#include 
 #include 
 #include 
 #include 



CVS commit: src/sys/compat/osf1

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 18:48:22 UTC 2013

Modified Files:
src/sys/compat/osf1: osf1_errno.c osf1_signo.c

Log Message:
These files don't need compat/osf1/osf1_cvt.h


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/compat/osf1/osf1_errno.c
cvs rdiff -u -r1.1 -r1.2 src/sys/compat/osf1/osf1_signo.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/osf1/osf1_errno.c
diff -u src/sys/compat/osf1/osf1_errno.c:1.5 src/sys/compat/osf1/osf1_errno.c:1.6
--- src/sys/compat/osf1/osf1_errno.c:1.5	Sun Mar 31 22:22:48 2002
+++ src/sys/compat/osf1/osf1_errno.c	Wed Jan  2 18:48:22 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: osf1_errno.c,v 1.5 2002/03/31 22:22:48 christos Exp $ */
+/* $NetBSD: osf1_errno.c,v 1.6 2013/01/02 18:48:22 dsl Exp $ */
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -31,10 +31,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osf1_errno.c,v 1.5 2002/03/31 22:22:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_errno.c,v 1.6 2013/01/02 18:48:22 dsl Exp $");
 
 #include 
-#include 
 
 /*
  * This table is used to translate NetBSD errnos to OSF/1 errnos

Index: src/sys/compat/osf1/osf1_signo.c
diff -u src/sys/compat/osf1/osf1_signo.c:1.1 src/sys/compat/osf1/osf1_signo.c:1.2
--- src/sys/compat/osf1/osf1_signo.c:1.1	Sun Mar 31 22:22:48 2002
+++ src/sys/compat/osf1/osf1_signo.c	Wed Jan  2 18:48:22 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: osf1_signo.c,v 1.1 2002/03/31 22:22:48 christos Exp $	*/
+/*	$NetBSD: osf1_signo.c,v 1.2 2013/01/02 18:48:22 dsl Exp $	*/
 
 /*
  * Copyright (c) 1999 Christopher G. Demetriou.  All rights reserved.
@@ -31,13 +31,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: osf1_signo.c,v 1.1 2002/03/31 22:22:48 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: osf1_signo.c,v 1.2 2013/01/02 18:48:22 dsl Exp $");
 
 #include 
 #include 
 
 #include 
-#include 
 
 /*
  * These tables are used to translate between NetBSD and OSF/1 signal



CVS commit: src/sys/compat

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 18:50:08 UTC 2013

Modified Files:
src/sys/compat/ibcs2: ibcs2_signal.h
src/sys/compat/svr4: svr4_signal.h

Log Message:
Put the kernel function prototypes inside #ifdef _KERNEL


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/compat/ibcs2/ibcs2_signal.h
cvs rdiff -u -r1.31 -r1.32 src/sys/compat/svr4/svr4_signal.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/ibcs2/ibcs2_signal.h
diff -u src/sys/compat/ibcs2/ibcs2_signal.h:1.20 src/sys/compat/ibcs2/ibcs2_signal.h:1.21
--- src/sys/compat/ibcs2/ibcs2_signal.h:1.20	Wed Dec  5 00:31:01 2007
+++ src/sys/compat/ibcs2/ibcs2_signal.h	Wed Jan  2 18:50:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibcs2_signal.h,v 1.20 2007/12/05 00:31:01 dsl Exp $	*/
+/*	$NetBSD: ibcs2_signal.h,v 1.21 2013/01/02 18:50:07 dsl Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Scott Bartram
@@ -121,10 +121,12 @@ struct ibcs2_sigaltstack {
 #define	IBCS2_SS_DISABLE	0x0002
 #define	IBCS2_SS_ALLBITS	0x0003
 
+#ifdef _KERNEL
 extern const int native_to_ibcs2_signo[];
 void ibcs2_to_native_sigset(const ibcs2_sigset_t *, sigset_t *);
 void native_to_ibcs2_sigset(const sigset_t *, ibcs2_sigset_t *);
 
 void	ibcs2_sendsig(const struct ksiginfo *, const sigset_t *);
+#endif
 
 #endif /* _IBCS2_SIGNAL_H */

Index: src/sys/compat/svr4/svr4_signal.h
diff -u src/sys/compat/svr4/svr4_signal.h:1.31 src/sys/compat/svr4/svr4_signal.h:1.32
--- src/sys/compat/svr4/svr4_signal.h:1.31	Mon Apr 28 20:23:45 2008
+++ src/sys/compat/svr4/svr4_signal.h	Wed Jan  2 18:50:08 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: svr4_signal.h,v 1.31 2008/04/28 20:23:45 martin Exp $	 */
+/*	$NetBSD: svr4_signal.h,v 1.32 2013/01/02 18:50:08 dsl Exp $	 */
 
 /*-
  * Copyright (c) 1994 The NetBSD Foundation, Inc.
@@ -126,6 +126,7 @@ struct svr4_sigaltstack {
 #define SVR4_SS_DISABLE		0x0002
 #define SVR4_SS_ALLBITS		0x0003
 
+#ifdef _KERNEL
 extern const int native_to_svr4_signo[];
 extern const int svr4_to_native_signo[];
 void native_to_svr4_sigset(const sigset_t *, svr4_sigset_t *);
@@ -133,6 +134,7 @@ void svr4_to_native_sigset(const svr4_si
 void native_to_svr4_sigaltstack(const struct sigaltstack *, struct svr4_sigaltstack *);
 void svr4_to_native_sigaltstack(const struct svr4_sigaltstack *, struct sigaltstack *);
 void svr4_sendsig(const struct ksiginfo *, const sigset_t *);
+#endif
 
 /* sys_context() function codes */
 #define	SVR4_GETCONTEXT		0



CVS commit: src/sys/sys

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 18:51:53 UTC 2013

Modified Files:
src/sys/sys: errno.h

Log Message:
Expose the pseudo-errors if _KMEMUSER is defined (as well as _KERNEL).
CVS :--


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/sys/errno.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/sys/errno.h
diff -u src/sys/sys/errno.h:1.39 src/sys/sys/errno.h:1.40
--- src/sys/sys/errno.h:1.39	Tue Oct 31 00:38:07 2006
+++ src/sys/sys/errno.h	Wed Jan  2 18:51:53 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: errno.h,v 1.39 2006/10/31 00:38:07 cbiere Exp $	*/
+/*	$NetBSD: errno.h,v 1.40 2013/01/02 18:51:53 dsl Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -174,7 +174,7 @@
 
 #define	ELAST		96		/* Must equal largest errno */
 
-#ifdef _KERNEL
+#if defined(_KERNEL) || defined(_KMEMUSER)
 /* pseudo-errors returned inside kernel to modify return to process */
 #define	EJUSTRETURN	-2		/* don't modify regs, just return */
 #define	ERESTART	-3		/* restart syscall */



CVS commit: src/usr.sbin/cpuctl/arch

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 19:24:31 UTC 2013

Modified Files:
src/usr.sbin/cpuctl/arch: i386.c

Log Message:
#include sys/ioctl.h


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/usr.sbin/cpuctl/arch/i386.c

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.32 src/usr.sbin/cpuctl/arch/i386.c:1.33
--- src/usr.sbin/cpuctl/arch/i386.c:1.32	Wed Aug 29 17:13:23 2012
+++ src/usr.sbin/cpuctl/arch/i386.c	Wed Jan  2 19:24:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.32 2012/08/29 17:13:23 drochner Exp $	*/
+/*	$NetBSD: i386.c,v 1.33 2013/01/02 19:24:30 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,13 +57,14 @@
 
 #include 
 #ifndef lint
-__RCSID("$NetBSD: i386.c,v 1.32 2012/08/29 17:13:23 drochner Exp $");
+__RCSID("$NetBSD: i386.c,v 1.33 2013/01/02 19:24:30 dsl Exp $");
 #endif /* not lint */
 
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 



CVS commit: src/sys/sys

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 19:29:40 UTC 2013

Modified Files:
src/sys/sys: sysctl.h

Log Message:
Only define 'struct kinfo_proc' if _KERNEL or _KMEMUSER is defined.
All 'normal' programs should be using kinfo_proc2 instead.


To generate a diff of this commit:
cvs rdiff -u -r1.204 -r1.205 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/sys/sys/sysctl.h
diff -u src/sys/sys/sysctl.h:1.204 src/sys/sys/sysctl.h:1.205
--- src/sys/sys/sysctl.h:1.204	Sat Dec  1 11:41:50 2012
+++ src/sys/sys/sysctl.h	Wed Jan  2 19:29:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysctl.h,v 1.204 2012/12/01 11:41:50 mbalmer Exp $	*/
+/*	$NetBSD: sysctl.h,v 1.205 2013/01/02 19:29:40 dsl Exp $	*/
 
 /*
  * Copyright (c) 1989, 1993
@@ -70,6 +70,8 @@
  * respective subsystem header files.
  */
 
+struct sysctlnode;
+
 #define	CTL_MAXNAME	12	/* largest number of components supported */
 #define SYSCTL_NAMELEN	32	/* longest name allowed for a node */
 
@@ -411,6 +413,8 @@ struct ki_ucred {
 	gid_t		cr_groups[NGROUPS];	/* groups */
 };
 
+#if defined(_KERNEL) || defined(_KMEMUSER)
+
 /*
  * KERN_PROC subtype ops return arrays of augmented proc structures:
  */
@@ -434,14 +438,13 @@ struct kinfo_proc {
 		short	e_xrssize;		/* text rss */
 		short	e_xccount;		/* text references */
 		short	e_xswrss;
-		long	e_flag;
-#define	EPROC_CTTY	0x01	/* controlling tty vnode active */
-#define	EPROC_SLEADER	0x02	/* session leader */
+		long	e_flag;			/* see p_eflag  below */
 		char	e_login[MAXLOGNAME];	/* setlogin() name */
 		pid_t	e_sid;			/* session id */
 		long	e_spare[3];
 	} kp_eproc;
 };
+#endif /* defined(_KERNEL) || defined(_KMEMUSER) */
 
 /*
  * Convert pointer to 64 bit unsigned integer for struct
@@ -486,6 +489,8 @@ struct kinfo_proc2 {
 	uint64_t p_ru;			/* PTR: Exit information. XXX */
 
 	int32_t	p_eflag;		/* LONG: extra kinfo_proc2 flags */
+#define	EPROC_CTTY	0x01	/* controlling tty vnode active */
+#define	EPROC_SLEADER	0x02	/* session leader */
 	int32_t	p_exitsig;		/* INT: signal to sent to parent on exit */
 	int32_t	p_flag;			/* INT: P_* flags. */
 



CVS commit: src/sys/sys

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 19:35:44 UTC 2013

Modified Files:
src/sys/sys: file.h

Log Message:
Expose the DTYPE_xxx (names) defines even if _KERNEL isn't defined.
There is no other excuse for including this file in userspace.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/sys/file.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/sys/file.h
diff -u src/sys/sys/file.h:1.74 src/sys/sys/file.h:1.75
--- src/sys/sys/file.h:1.74	Sun Apr 24 18:46:24 2011
+++ src/sys/sys/file.h	Wed Jan  2 19:35:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.74 2011/04/24 18:46:24 rmind Exp $	*/
+/*	$NetBSD: file.h,v 1.75 2013/01/02 19:35:43 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -116,6 +116,8 @@ struct file {
 	SLIST_ENTRY(file) f_unplist;	/* deferred close: see uipc_usrreq.c */
 };
 
+#endif
+
 /*
  * Descriptor types.
  */
@@ -133,6 +135,8 @@ struct file {
 "0", "file", "socket", "pipe", "kqueue", "misc", "crypto", "mqueue", \
 "semaphore"
 
+#ifdef _KERNEL
+
 /*
  * Flags for fo_read and fo_write and do_fileread/write/v
  */



CVS commit: src

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 19:39:04 UTC 2013

Modified Files:
src/sys/sys: lwp.h proc.h
src/usr.bin/kdump: kdump.c

Log Message:
Only expose the bulk of sys/proc.h and sys/lwp.h if _KERNEL or _KMEMUSER
is defined.
i386 and amd64 build ok.


To generate a diff of this commit:
cvs rdiff -u -r1.166 -r1.167 src/sys/sys/lwp.h
cvs rdiff -u -r1.318 -r1.319 src/sys/sys/proc.h
cvs rdiff -u -r1.115 -r1.116 src/usr.bin/kdump/kdump.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/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.166 src/sys/sys/lwp.h:1.167
--- src/sys/sys/lwp.h:1.166	Wed Dec 26 18:30:22 2012
+++ src/sys/sys/lwp.h	Wed Jan  2 19:39:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: lwp.h,v 1.166 2012/12/26 18:30:22 matt Exp $	*/
+/*	$NetBSD: lwp.h,v 1.167 2013/01/02 19:39:04 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010
@@ -33,6 +33,8 @@
 #ifndef _SYS_LWP_H_
 #define _SYS_LWP_H_
 
+#if defined(_KERNEL) || defined(_KMEMUSER)
+
 #include 
 #include 
 #include 
@@ -67,7 +69,6 @@
  * Fields are clustered together by usage (to increase the likelyhood
  * of cache hits) and by size (to reduce dead space in the structure).
  */
-#if defined(_KERNEL) || defined(_KMEMUSER)
 
 #include 
 
@@ -196,7 +197,6 @@ struct lwp {
 
 	struct kdtrace_thread *l_dtrace; /* (: DTrace-specific data. */
 };
-#endif /* _KERNEL || _KMEMUSER */
 
 /*
  * UAREA_PCB_OFFSET: an offset of PCB structure in the uarea.  MD code may
@@ -220,6 +220,8 @@ extern int		maxlwp __read_mostly;	/* max
 #endif
 #endif
 
+#endif /* _KERNEL || _KMEMUSER */
+
 /* These flags are kept in l_flag. */
 #define	LW_IDLE		0x0001 /* Idle lwp. */
 #define	LW_LWPCTL	0x0002 /* Adjust lwpctl in userret */

Index: src/sys/sys/proc.h
diff -u src/sys/sys/proc.h:1.318 src/sys/sys/proc.h:1.319
--- src/sys/sys/proc.h:1.318	Wed Dec  5 08:05:54 2012
+++ src/sys/sys/proc.h	Wed Jan  2 19:39:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: proc.h,v 1.318 2012/12/05 08:05:54 msaitoh Exp $	*/
+/*	$NetBSD: proc.h,v 1.319 2013/01/02 19:39:04 dsl Exp $	*/
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,6 +68,10 @@
 #ifndef _SYS_PROC_H_
 #define	_SYS_PROC_H_
 
+#include 
+
+#if defined(_KMEMUSER) || defined(_KERNEL)
+
 #if defined(_KERNEL_OPT)
 #include "opt_multiprocessor.h"
 #include "opt_kstack.h"
@@ -81,7 +85,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -324,6 +327,8 @@ struct proc {
 #define	p_session	p_pgrp->pg_session
 #define	p_pgid		p_pgrp->pg_id
 
+#endif	/* _KMEMUSER || _KERNEL */
+
 /*
  * Status values.
  */
@@ -390,6 +395,8 @@ struct proc {
 #define	PL_SIGCOMPAT	0x0200 /* Has used compat signal trampoline */
 #define	PL_ORPHANPG	0x2000 /* Member of an orphaned pgrp */
 
+#if defined(_KMEMUSER) || defined(_KERNEL)
+
 /*
  * Macro to compute the exit signal to be delivered.
  */
@@ -538,8 +545,6 @@ extern struct emul emul_netbsd;
 
 #endif	/* _KERNEL */
 
-#if defined(_KMEMUSER) || defined(_KERNEL)
-
 /*
  * Kernel stack parameters.
  *

Index: src/usr.bin/kdump/kdump.c
diff -u src/usr.bin/kdump/kdump.c:1.115 src/usr.bin/kdump/kdump.c:1.116
--- src/usr.bin/kdump/kdump.c:1.115	Wed Sep 28 16:28:27 2011
+++ src/usr.bin/kdump/kdump.c	Wed Jan  2 19:39:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kdump.c,v 1.115 2011/09/28 16:28:27 christos Exp $	*/
+/*	$NetBSD: kdump.c,v 1.116 2013/01/02 19:39:04 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1988, 1993
@@ -39,16 +39,15 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
 #if 0
 static char sccsid[] = "@(#)kdump.c	8.4 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: kdump.c,v 1.115 2011/09/28 16:28:27 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.116 2013/01/02 19:39:04 dsl Exp $");
 #endif
 #endif /* not lint */
 
 #include 
-#include  /* XXX #include  fails without this header */
-#define _KERNEL
 #include 
+#define _KMEMUSER/* To get the pseudo errors defined */
 #include 
-#undef _KERNEL
+#undef _KMEMUSER
 #include 
 #include 
 #include 



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

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 19:40:23 UTC 2013

Modified Files:
src/sys/arch/amd64/include: signal.h

Log Message:
This is included into user-programs by signal.h, it shouldn't be
pulling in machine/fpu.h - which doesn't describe anything userspace
(directly) needs.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/amd64/include/signal.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/amd64/include/signal.h
diff -u src/sys/arch/amd64/include/signal.h:1.11 src/sys/arch/amd64/include/signal.h:1.12
--- src/sys/arch/amd64/include/signal.h:1.11	Wed Nov 19 18:35:58 2008
+++ src/sys/arch/amd64/include/signal.h	Wed Jan  2 19:40:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: signal.h,v 1.11 2008/11/19 18:35:58 ad Exp $	*/
+/*	$NetBSD: signal.h,v 1.12 2013/01/02 19:40:23 dsl Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991 Regents of the University of California.
@@ -45,7 +45,6 @@ typedef int sig_atomic_t;
  * Get the "code" values
  */
 #include 
-#include 
 #include 
 
 #ifdef _KERNEL_OPT



CVS commit: src/external/ibm-public/postfix

2013-01-02 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Jan  2 19:45:49 UTC 2013

Modified Files:
src/external/ibm-public/postfix/lib/global: Makefile
src/external/ibm-public/postfix/lib/util: Makefile
src/external/ibm-public/postfix/libexec/postscreen: Makefile
src/external/ibm-public/postfix/sbin/postconf: Makefile

Log Message:
Fix build of Postfix 2.9.5.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/external/ibm-public/postfix/lib/global/Makefile
cvs rdiff -u -r1.4 -r1.5 src/external/ibm-public/postfix/lib/util/Makefile
cvs rdiff -u -r1.1 -r1.2 \
src/external/ibm-public/postfix/libexec/postscreen/Makefile
cvs rdiff -u -r1.3 -r1.4 \
src/external/ibm-public/postfix/sbin/postconf/Makefile

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

Modified files:

Index: src/external/ibm-public/postfix/lib/global/Makefile
diff -u src/external/ibm-public/postfix/lib/global/Makefile:1.3 src/external/ibm-public/postfix/lib/global/Makefile:1.4
--- src/external/ibm-public/postfix/lib/global/Makefile:1.3	Sun Mar  4 16:12:24 2012
+++ src/external/ibm-public/postfix/lib/global/Makefile	Wed Jan  2 19:45:48 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2012/03/04 16:12:24 tron Exp $
+#	$NetBSD: Makefile,v 1.4 2013/01/02 19:45:48 tron Exp $
 
 LIBISPRIVATE=	yes
 
@@ -13,8 +13,8 @@ SRCS=	abounce.c anvil_clnt.c been_here.c
 	canon_addr.c cfg_parser.c cleanup_strerror.c cleanup_strflags.c \
 	clnt_stream.c conv_time.c db_common.c debug_peer.c debug_process.c \
 	defer.c deliver_completed.c deliver_flock.c deliver_pass.c \
-	deliver_request.c dict_ldap.c dict_mysql.c dict_pgsql.c \
-	dict_proxy.c dict_sqlite.c \
+	deliver_request.c dict_ldap.c dict_memcache.c dict_mysql.c \
+	dict_pgsql.c dict_proxy.c dict_sqlite.c \
 	domain_list.c dot_lockfile.c dot_lockfile_as.c \
 	dsb_scan.c dsn.c dsn_buf.c dsn_mask.c dsn_print.c dsn_util.c \
 	ehlo_mask.c ext_prop.c file_id.c flush_clnt.c header_opts.c \
@@ -41,6 +41,7 @@ SRCS=	abounce.c anvil_clnt.c been_here.c
 	verp_sender.c wildcard_inet_addr.c xtext.c data_redirect.c \
 	delivered_hdr.c fold_addr.c mkmap_proxy.c header_body_checks.c \
 	mail_conf_nint.c match_service.c match_service.h mail_conf_nbool.c \
-	smtp_reply_footer.c
+	smtp_reply_footer.c memcache_proto.c mkmap_fail.c safe_ultostr.c \
+	server_acl.c verify_sender_addr.c mail_version.c
 
 .include 

Index: src/external/ibm-public/postfix/lib/util/Makefile
diff -u src/external/ibm-public/postfix/lib/util/Makefile:1.4 src/external/ibm-public/postfix/lib/util/Makefile:1.5
--- src/external/ibm-public/postfix/lib/util/Makefile:1.4	Wed Mar  2 22:24:55 2011
+++ src/external/ibm-public/postfix/lib/util/Makefile	Wed Jan  2 19:45:49 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4 2011/03/02 22:24:55 tron Exp $
+#	$NetBSD: Makefile,v 1.5 2013/01/02 19:45:49 tron Exp $
 
 LIBISPRIVATE=	yes
 
@@ -43,7 +43,8 @@ SRCS=	alldig.c allprint.c argv.c argv_sp
 	allascii.c load_file.c killme_after.c vstream_tweak.c edit_file.c \
 	inet_windowsize.c unix_pass_fd_fix.c dict_cache.c dict_thash.c \
 	ip_match.c nbbio.c stream_pass_connect.c unix_pass_listen.c \
-	unix_pass_trigger.c valid_utf_8.c myrand.c
+	unix_pass_trigger.c valid_utf_8.c myrand.c base32_code.c dict_fail.c \
+	dict_surrogate.c dict_test.c msg_rate_delay.c warn_stat.c
 
 COPTS.unix_recv_fd.c = -Wno-stack-protector
 COPTS.unix_send_fd.c = -Wno-stack-protector

Index: src/external/ibm-public/postfix/libexec/postscreen/Makefile
diff -u src/external/ibm-public/postfix/libexec/postscreen/Makefile:1.1 src/external/ibm-public/postfix/libexec/postscreen/Makefile:1.2
--- src/external/ibm-public/postfix/libexec/postscreen/Makefile:1.1	Wed Mar  2 22:24:55 2011
+++ src/external/ibm-public/postfix/libexec/postscreen/Makefile	Wed Jan  2 19:45:49 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.1 2011/03/02 22:24:55 tron Exp $
+#	$NetBSD: Makefile,v 1.2 2013/01/02 19:45:49 tron Exp $
 
 NOMAN=	# defined
 
@@ -9,7 +9,7 @@ PROG=	postscreen
 DIST=	${NETBSDSRCDIR}/external/ibm-public/postfix/dist/src/${PROG}
 .PATH:	${DIST}
 
-SRCS=	postscreen.c postscreen_access.c postscreen_dict.c postscreen_dnsbl.c \
+SRCS=	postscreen.c postscreen_dict.c postscreen_dnsbl.c \
 	postscreen_early.c postscreen_expand.c postscreen_misc.c \
 	postscreen_send.c postscreen_smtpd.c postscreen_starttls.c \
 	postscreen_state.c postscreen_tests.c

Index: src/external/ibm-public/postfix/sbin/postconf/Makefile
diff -u src/external/ibm-public/postfix/sbin/postconf/Makefile:1.3 src/external/ibm-public/postfix/sbin/postconf/Makefile:1.4
--- src/external/ibm-public/postfix/sbin/postconf/Makefile:1.3	Wed Mar  2 22:24:56 2011
+++ src/external/ibm-public/postfix/sbin/postconf/Makefile	Wed Jan  2 19:45:49 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2011/03/02 22:24:56 tron Exp $
+#	$NetBSD: Makefile,v 1.4 2013/01/02 19:45:49 tron Exp $
 
 # XXX Note we aren't building ../conf/main.cf.default
 # The shipped make

CVS commit: src/external/cddl/osnet/dist/lib/libdtrace/common

2013-01-02 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Jan  2 21:19:13 UTC 2013

Modified Files:
src/external/cddl/osnet/dist/lib/libdtrace/common: dt_subr.c

Log Message:
Include "sys/ioctl.h" for the prototype of ioctl(2) which fixes the build.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.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/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c
diff -u src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c:1.5 src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c:1.6
--- src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c:1.5	Wed Oct 19 11:03:52 2011
+++ src/external/cddl/osnet/dist/lib/libdtrace/common/dt_subr.c	Wed Jan  2 21:19:13 2013
@@ -39,6 +39,7 @@
 #if defined(sun)
 #include 
 #else
+#include 
 #include 
 #endif
 #include 



CVS commit: src/bin/sh

2013-01-02 Thread David Laight
Module Name:src
Committed By:   dsl
Date:   Wed Jan  2 22:28:42 UTC 2013

Modified Files:
src/bin/sh: eval.c

Log Message:
include limits.h for CHAR_MIN


To generate a diff of this commit:
cvs rdiff -u -r1.104 -r1.105 src/bin/sh/eval.c

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

Modified files:

Index: src/bin/sh/eval.c
diff -u src/bin/sh/eval.c:1.104 src/bin/sh/eval.c:1.105
--- src/bin/sh/eval.c:1.104	Thu Jun 14 18:56:54 2012
+++ src/bin/sh/eval.c	Wed Jan  2 22:28:42 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: eval.c,v 1.104 2012/06/14 18:56:54 joerg Exp $	*/
+/*	$NetBSD: eval.c,v 1.105 2013/01/02 22:28:42 dsl Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c	8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.104 2012/06/14 18:56:54 joerg Exp $");
+__RCSID("$NetBSD: eval.c,v 1.105 2013/01/02 22:28:42 dsl Exp $");
 #endif
 #endif /* not lint */
 
@@ -46,6 +46,7 @@ __RCSID("$NetBSD: eval.c,v 1.104 2012/06
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 



CVS commit: src

2013-01-02 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Jan  2 22:33:21 UTC 2013

Modified Files:
src/distrib/sets/lists/man: mi
src/distrib/sets/lists/misc: mi
src/external/ibm-public/postfix/man/man5: Makefile
src/external/ibm-public/postfix/share/README_FILES: Makefile
src/external/ibm-public/postfix/share/html: Makefile

Log Message:
Install documentation and manual pages for Postfix's memcache client support.


To generate a diff of this commit:
cvs rdiff -u -r1.1413 -r1.1414 src/distrib/sets/lists/man/mi
cvs rdiff -u -r1.177 -r1.178 src/distrib/sets/lists/misc/mi
cvs rdiff -u -r1.3 -r1.4 src/external/ibm-public/postfix/man/man5/Makefile
cvs rdiff -u -r1.2 -r1.3 \
src/external/ibm-public/postfix/share/README_FILES/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/ibm-public/postfix/share/html/Makefile

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/man/mi
diff -u src/distrib/sets/lists/man/mi:1.1413 src/distrib/sets/lists/man/mi:1.1414
--- src/distrib/sets/lists/man/mi:1.1413	Mon Dec 17 20:38:00 2012
+++ src/distrib/sets/lists/man/mi	Wed Jan  2 22:33:19 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1413 2012/12/17 20:38:00 mbalmer Exp $
+# $NetBSD: mi,v 1.1414 2013/01/02 22:33:19 tron Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -2009,6 +2009,7 @@
 ./usr/share/man/cat5/map3270.0			man-obsolete		obsolete
 ./usr/share/man/cat5/master.0			man-postfix-catman	postfix,.cat
 ./usr/share/man/cat5/master.passwd.0		man-sys-catman		.cat
+./usr/share/man/cat5/memcache_table.0		man-postfix-catman	postfix,.cat
 ./usr/share/man/cat5/mixerctl.conf.0		man-audio-catman	.cat
 ./usr/share/man/cat5/moduli.0			man-secsh-catman	crypto,.cat
 ./usr/share/man/cat5/monthly.0			man-sys-catman		.cat
@@ -4846,6 +4847,7 @@
 ./usr/share/man/html5/map3270.html		man-obsolete		obsolete
 ./usr/share/man/html5/master.html		man-postfix-htmlman	postfix,html
 ./usr/share/man/html5/master.passwd.html	man-sys-htmlman		html
+./usr/share/man/html5/memcache_table.html		man-postfix-htmlman	postfix,html
 ./usr/share/man/html5/mixerctl.conf.html	man-audio-htmlman	html
 ./usr/share/man/html5/moduli.html		man-secsh-htmlman	crypto,html
 ./usr/share/man/html5/monthly.conf.html		man-sys-htmlman		html
@@ -7629,6 +7631,7 @@
 ./usr/share/man/man5/map3270.5			man-obsolete		obsolete
 ./usr/share/man/man5/master.5			man-postfix-man		postfix,.man
 ./usr/share/man/man5/master.passwd.5		man-sys-man		.man
+./usr/share/man/man5/memcache_table.5		man-postfix-man		postfix,.man
 ./usr/share/man/man5/mixerctl.conf.5		man-audio-man		.man
 ./usr/share/man/man5/moduli.5			man-secsh-man		crypto,.man
 ./usr/share/man/man5/monthly.5			man-sys-man		.man

Index: src/distrib/sets/lists/misc/mi
diff -u src/distrib/sets/lists/misc/mi:1.177 src/distrib/sets/lists/misc/mi:1.178
--- src/distrib/sets/lists/misc/mi:1.177	Sat Sep 15 17:33:28 2012
+++ src/distrib/sets/lists/misc/mi	Wed Jan  2 22:33:20 2013
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.177 2012/09/15 17:33:28 plunky Exp $
+# $NetBSD: mi,v 1.178 2013/01/02 22:33:20 tron Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -361,6 +361,7 @@
 ./usr/share/doc/html/postfix/mailq.1.html	misc-postfix-htmldoc	postfix,doc
 ./usr/share/doc/html/postfix/master.5.html	misc-postfix-htmldoc	postfix,doc
 ./usr/share/doc/html/postfix/master.8.html	misc-postfix-htmldoc	postfix,doc
+./usr/share/doc/html/postfix/memcache_table.5.html	misc-postfix-htmldoc	postfix,doc
 ./usr/share/doc/html/postfix/motivation.html	misc-obsolete		obsolete
 ./usr/share/doc/html/postfix/mysql_table.5.html	misc-postfix-htmldoc	postfix,doc
 ./usr/share/doc/html/postfix/newaliases.1.html	misc-postfix-htmldoc	postfix,doc
@@ -806,6 +807,7 @@
 ./usr/share/examples/postfix/LMTP_README	misc-obsolete	obsolete
 ./usr/share/examples/postfix/LOCAL_RECIPIENT_README	misc-postfix-examples	postfix,doc
 ./usr/share/examples/postfix/MAILDROP_README	misc-postfix-examples	postfix,doc
+./usr/share/examples/postfix/MEMCACHE_README	misc-postfix-examples	postfix,doc
 ./usr/share/examples/postfix/MILTER_README	misc-postfix-examples	postfix,doc
 ./usr/share/examples/postfix/MULTI_INSTANCE_README	misc-postfix-examples	postfix,doc
 ./usr/share/examples/postfix/MYSQL_README	misc-postfix-examples	postfix,doc

Index: src/external/ibm-public/postfix/man/man5/Makefile
diff -u src/external/ibm-public/postfix/man/man5/Makefile:1.3 src/external/ibm-public/postfix/man/man5/Makefile:1.4
--- src/external/ibm-public/postfix/man/man5/Makefile:1.3	Sun Mar  4 16:12:25 2012
+++ src/external/ibm-public/postfix/man/man5/Makefile	Wed Jan  2 22:33:20 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.3 2012/03/04 16:12:25 tron Exp $
+#	$NetBSD: Makefile,v 1.4 2013/01/02 22:33:20 tron Exp $
 
 .include 
 
@@ -8,7 +8,7 @@ DIST=	${NETBSDSRCDIR}/external/ibm-publi
 MAN=	access.5 aliases.5 bounce.5 c

CVS commit: src/doc

2013-01-02 Thread Matthias Scheler
Module Name:src
Committed By:   tron
Date:   Wed Jan  2 22:34:05 UTC 2013

Modified Files:
src/doc: 3RDPARTY CHANGES

Log Message:
Note that Postfix 2.9.5 was imported.


To generate a diff of this commit:
cvs rdiff -u -r1.993 -r1.994 src/doc/3RDPARTY
cvs rdiff -u -r1.1774 -r1.1775 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.993 src/doc/3RDPARTY:1.994
--- src/doc/3RDPARTY:1.993	Mon Dec 31 16:05:39 2012
+++ src/doc/3RDPARTY	Wed Jan  2 22:34:05 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: 3RDPARTY,v 1.993 2012/12/31 16:05:39 christos Exp $
+#	$NetBSD: 3RDPARTY,v 1.994 2013/01/02 22:34:05 tron Exp $
 #
 # This file contains a list of the software that has been integrated into
 # NetBSD where we are not the primary maintainer.
@@ -991,8 +991,8 @@ and more. Vern's ping is gone. We are to
 now to do a new import.
 
 Package:	Postfix
-Version:	2.8.13
-Current Vers:	2.8.13/2.9.5
+Version:	2.9.5
+Current Vers:	2.9.5
 Maintainer:	Wietse Venema 
 Archive Site:	ftp://postfix.cloud9.net/official/
 Home Page:	http://www.postfix.org/

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1774 src/doc/CHANGES:1.1775
--- src/doc/CHANGES:1.1774	Tue Jan  1 11:53:28 2013
+++ src/doc/CHANGES	Wed Jan  2 22:34:05 2013
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1774 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1775 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -163,3 +163,4 @@ Changes from NetBSD 6.0 to NetBSD 7.0:
 	arm: support NEON in userland [matt 20121226]
 	kernel: allow MD kernel code to use PCUs [matt 20121226]
 	units(1): add -l and -L options.  [apb 20130101]
+	postfix(1): Import version 2.9.5 [tron 20130102]



CVS commit: [netbsd-6] src/sys/kern

2013-01-02 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan  2 23:23:15 UTC 2013

Modified Files:
src/sys/kern [netbsd-6]: vfs_wapbl.c

Log Message:
Pull up following revision(s) (requested by hannken in ticket #758):
sys/kern/vfs_wapbl.c: revision 1.53
sys/kern/vfs_wapbl.c: revision 1.54
wapbl_biodone: Release the buffer before reclaiming the log.
   wapbl_flush() may wait for the log to become empty and
   all buffers should be unbusy before it returns.
Try to coalesce writes to the journal in MAXPHYS sized and aligned blocks.
Speeds up wapbl_flush() on raid5 by a factor of 3-4.
Discussed on tech-kern.
Needs pullup to NetBSD-6.


To generate a diff of this commit:
cvs rdiff -u -r1.51.2.1 -r1.51.2.2 src/sys/kern/vfs_wapbl.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_wapbl.c
diff -u src/sys/kern/vfs_wapbl.c:1.51.2.1 src/sys/kern/vfs_wapbl.c:1.51.2.2
--- src/sys/kern/vfs_wapbl.c:1.51.2.1	Mon May  7 03:01:13 2012
+++ src/sys/kern/vfs_wapbl.c	Wed Jan  2 23:23:15 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_wapbl.c,v 1.51.2.1 2012/05/07 03:01:13 riz Exp $	*/
+/*	$NetBSD: vfs_wapbl.c,v 1.51.2.2 2013/01/02 23:23:15 riz Exp $	*/
 
 /*-
  * Copyright (c) 2003, 2008, 2009 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
 #define WAPBL_INTERNAL
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.51.2.1 2012/05/07 03:01:13 riz Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_wapbl.c,v 1.51.2.2 2013/01/02 23:23:15 riz Exp $");
 
 #include 
 #include 
@@ -184,6 +184,10 @@ struct wapbl {
 
 	SIMPLEQ_HEAD(, wapbl_entry) wl_entries; /* On disk transaction
 		   accounting */
+
+	u_char *wl_buffer;	/* l:   buffer for wapbl_buffered_write() */
+	daddr_t wl_buffer_dblk;	/* l:   buffer disk block address */
+	size_t wl_buffer_used;	/* l:   buffer current use */
 };
 
 #ifdef WAPBL_DEBUG_PRINT
@@ -489,6 +493,9 @@ wapbl_start(struct wapbl ** wlp, struct 
 	wl->wl_dealloclens = wapbl_alloc(sizeof(*wl->wl_dealloclens) *
 	wl->wl_dealloclim);
 
+	wl->wl_buffer = wapbl_alloc(MAXPHYS);
+	wl->wl_buffer_used = 0;
+
 	wapbl_inodetrk_init(wl, WAPBL_INODETRK_SIZE);
 
 	/* Initialize the commit header */
@@ -537,6 +544,7 @@ wapbl_start(struct wapbl ** wlp, struct 
 	sizeof(*wl->wl_deallocblks) * wl->wl_dealloclim);
 	wapbl_free(wl->wl_dealloclens,
 	sizeof(*wl->wl_dealloclens) * wl->wl_dealloclim);
+	wapbl_free(wl->wl_buffer, MAXPHYS);
 	wapbl_inodetrk_free(wl);
 	wapbl_free(wl, sizeof(*wl));
 
@@ -716,6 +724,7 @@ wapbl_stop(struct wapbl *wl, int force)
 	sizeof(*wl->wl_deallocblks) * wl->wl_dealloclim);
 	wapbl_free(wl->wl_dealloclens,
 	sizeof(*wl->wl_dealloclens) * wl->wl_dealloclim);
+	wapbl_free(wl->wl_buffer, MAXPHYS);
 	wapbl_inodetrk_free(wl);
 
 	cv_destroy(&wl->wl_reclaimable_cv);
@@ -791,6 +800,81 @@ wapbl_read(void *data, size_t len, struc
 }
 
 /*
+ * Flush buffered data if any.
+ */
+static int
+wapbl_buffered_flush(struct wapbl *wl)
+{
+	int error;
+
+	if (wl->wl_buffer_used == 0)
+		return 0;
+
+	error = wapbl_doio(wl->wl_buffer, wl->wl_buffer_used,
+	wl->wl_devvp, wl->wl_buffer_dblk, B_WRITE);
+	wl->wl_buffer_used = 0;
+
+	return error;
+}
+
+/*
+ * Write data to the log.
+ * Try to coalesce writes and emit MAXPHYS aligned blocks.
+ */
+static int
+wapbl_buffered_write(void *data, size_t len, struct wapbl *wl, daddr_t pbn)
+{
+	int error;
+	size_t resid;
+
+	/*
+	 * If not adjacent to buffered data flush first.  Disk block
+	 * address is always valid for non-empty buffer.
+	 */
+	if (wl->wl_buffer_used > 0 &&
+	pbn != wl->wl_buffer_dblk + btodb(wl->wl_buffer_used)) {
+		error = wapbl_buffered_flush(wl);
+		if (error)
+			return error;
+	}
+	/*
+	 * If this write goes to an empty buffer we have to
+	 * save the disk block address first.
+	 */
+	if (wl->wl_buffer_used == 0)
+		wl->wl_buffer_dblk = pbn;
+	/*
+	 * Remaining space so this buffer ends on a MAXPHYS boundary.
+	 *
+	 * Cannot become less or equal zero as the buffer would have been
+	 * flushed on the last call then.
+	 */
+	resid = MAXPHYS - dbtob(wl->wl_buffer_dblk % btodb(MAXPHYS)) -
+	wl->wl_buffer_used;
+	KASSERT(resid > 0);
+	KASSERT(dbtob(btodb(resid)) == resid);
+	if (len >= resid) {
+		memcpy(wl->wl_buffer + wl->wl_buffer_used, data, resid);
+		wl->wl_buffer_used += resid;
+		error = wapbl_doio(wl->wl_buffer, wl->wl_buffer_used,
+		wl->wl_devvp, wl->wl_buffer_dblk, B_WRITE);
+		data = (uint8_t *)data + resid;
+		len -= resid;
+		wl->wl_buffer_dblk = pbn + btodb(resid);
+		wl->wl_buffer_used = 0;
+		if (error)
+			return error;
+	}
+	KASSERT(len < MAXPHYS);
+	if (len > 0) {
+		memcpy(wl->wl_buffer + wl->wl_buffer_used, data, len);
+		wl->wl_buffer_used += len;
+	}
+
+	return 0;
+}
+
+/*
  * Off is byte offset returns new offset for next write
  * handles log wraparound
  */
@@ -813,7 +897,7 @@ wapbl_circ_write(struct wapbl *wl, void 
 #ifdef _KERNEL
 		pbn = btodb(pbn << wl->wl_log_dev_bshi

CVS commit: [netbsd-6] src/sys/dev/sdmmc

2013-01-02 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan  2 23:34:56 UTC 2013

Modified Files:
src/sys/dev/sdmmc [netbsd-6]: sdhc.c sdhcreg.h

Log Message:
sys/dev/sdmmc/sdhc.cpatch
sys/dev/sdmmc/sdhcreg.h patch

Support SDHC version 3 clocks.
[skrll, ticket #759]


To generate a diff of this commit:
cvs rdiff -u -r1.10.2.3 -r1.10.2.4 src/sys/dev/sdmmc/sdhc.c
cvs rdiff -u -r1.5.2.1 -r1.5.2.2 src/sys/dev/sdmmc/sdhcreg.h

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

Modified files:

Index: src/sys/dev/sdmmc/sdhc.c
diff -u src/sys/dev/sdmmc/sdhc.c:1.10.2.3 src/sys/dev/sdmmc/sdhc.c:1.10.2.4
--- src/sys/dev/sdmmc/sdhc.c:1.10.2.3	Thu Aug  9 06:36:48 2012
+++ src/sys/dev/sdmmc/sdhc.c	Wed Jan  2 23:34:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: sdhc.c,v 1.10.2.3 2012/08/09 06:36:48 jdc Exp $	*/
+/*	$NetBSD: sdhc.c,v 1.10.2.4 2013/01/02 23:34:56 riz Exp $	*/
 /*	$OpenBSD: sdhc.c,v 1.25 2009/01/13 19:44:20 grange Exp $	*/
 
 /*
@@ -23,7 +23,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.10.2.3 2012/08/09 06:36:48 jdc Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdhc.c,v 1.10.2.4 2013/01/02 23:34:56 riz Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_sdmmc.h"
@@ -79,6 +79,8 @@ struct sdhc_host {
 	struct kmutex intr_mtx;
 	struct kcondvar intr_cv;
 
+	int specver;			/* spec. version */
+
 	uint32_t flags;			/* flags for this host */
 #define SHF_USE_DMA		0x0001
 #define SHF_USE_4BIT_MODE	0x0002
@@ -223,26 +225,8 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	struct sdmmcbus_attach_args saa;
 	struct sdhc_host *hp;
 	uint32_t caps;
-#ifdef SDHC_DEBUG
 	uint16_t sdhcver;
 
-	sdhcver = bus_space_read_2(iot, ioh, SDHC_HOST_CTL_VERSION);
-	aprint_normal_dev(sc->sc_dev, "SD Host Specification/Vendor Version ");
-	switch (SDHC_SPEC_VERSION(sdhcver)) {
-	case 0x00:
-		aprint_normal("1.0/%u\n", SDHC_VENDOR_VERSION(sdhcver));
-		break;
-
-	case 0x01:
-		aprint_normal("2.0/%u\n", SDHC_VENDOR_VERSION(sdhcver));
-		break;
-
-	default:
-		aprint_normal(">2.0/%u\n", SDHC_VENDOR_VERSION(sdhcver));
-		break;
-	}
-#endif
-
 	/* Allocate one more host structure. */
 	hp = malloc(sizeof(struct sdhc_host), M_DEVBUF, M_WAITOK|M_ZERO);
 	if (hp == NULL) {
@@ -262,6 +246,29 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	mutex_init(&hp->intr_mtx, MUTEX_DEFAULT, IPL_SDMMC);
 	cv_init(&hp->intr_cv, "sdhcintr");
 
+	sdhcver = HREAD2(hp, SDHC_HOST_CTL_VERSION);
+	aprint_normal_dev(sc->sc_dev, "SD Host Specification ");
+	hp->specver = SDHC_SPEC_VERSION(sdhcver);
+	switch (SDHC_SPEC_VERSION(sdhcver)) {
+	case SDHC_SPEC_VERS_100:
+		aprint_normal("1.0");
+		break;
+
+	case SDHC_SPEC_VERS_200:
+		aprint_normal("2.0");
+		break;
+
+	case SDHC_SPEC_VERS_300:
+		aprint_normal("3.0");
+		break;
+
+	default:
+		aprint_normal("unknown version(0x%x)",
+		SDHC_SPEC_VERSION(sdhcver));
+		break;
+	}
+	aprint_normal(", rev.%u\n", SDHC_VENDOR_VERSION(sdhcver));
+
 	/*
 	 * Reset the host controller and enable interrupts.
 	 */
@@ -289,8 +296,11 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	/*
 	 * Determine the base clock frequency. (2.2.24)
 	 */
-	if (SDHC_BASE_FREQ_KHZ(caps) != 0)
+	if (hp->specver == SDHC_SPEC_VERS_300) {
+		hp->clkbase = SDHC_BASE_V3_FREQ_KHZ(caps);
+	} else {
 		hp->clkbase = SDHC_BASE_FREQ_KHZ(caps);
+	}
 	if (hp->clkbase == 0) {
 		if (sc->sc_clkbase == 0) {
 			/* The attachment driver must tell us. */
@@ -370,12 +380,16 @@ sdhc_host_found(struct sdhc_softc *sc, b
 	saa.saa_sct = &sdhc_functions;
 	saa.saa_sch = hp;
 	saa.saa_dmat = hp->dmat;
-	saa.saa_clkmin = hp->clkbase / 256;
 	saa.saa_clkmax = hp->clkbase;
 	if (ISSET(sc->sc_flags, SDHC_FLAG_HAVE_CGM))
-		saa.saa_clkmin /= 2046;
+		saa.saa_clkmin = hp->clkbase / 256 / 2046;
 	else if (ISSET(sc->sc_flags, SDHC_FLAG_HAVE_DVS))
-		saa.saa_clkmin /= 16;
+		saa.saa_clkmin = hp->clkbase / 256 / 16;
+	else if (hp->specver == SDHC_SPEC_VERS_300)
+		saa.saa_clkmin = hp->clkbase / 0x3ff;
+	else
+		saa.saa_clkmin = hp->clkbase / 256;
+
 	saa.saa_caps = SMC_CAPS_4BIT_MODE|SMC_CAPS_AUTO_STOP;
 	if (ISSET(sc->sc_flags, SDHC_FLAG_8BIT_MODE))
 		saa.saa_caps |= SMC_CAPS_8BIT_MODE;
@@ -725,16 +739,29 @@ sdhc_clock_divisor(struct sdhc_host *hp,
 			 */
 			roundup |= dvs & 1;
 		}
-		panic("%s: can't find divisor for freq %u", HDEVNAME(hp), freq);
+		/* No divisor found. */
+		return false;
+	}
+	if (hp->specver == SDHC_SPEC_VERS_300) {
+		div = howmany(hp->clkbase, freq);
+		if (div > 0x3ff)
+			return false;
+		*divp = (((div >> 8) & SDHC_SDCLK_XDIV_MASK)
+			 << SDHC_SDCLK_XDIV_SHIFT) |
+			(((div >> 0) & SDHC_SDCLK_DIV_MASK)
+			 << SDHC_SDCLK_DIV_SHIFT);
+		return true;
 	} else {
 		for (div = 1; div <= 256; div *= 2) {
 			if ((hp->clkbase / div) <= freq) {
 *divp = (div / 2) << SDHC_SDCLK_DIV_SHIFT;
+//freq = hp->clkbase / div;
 return true;
 			}
 		}
+		/* No divisor found. */
+		return false;
 	}
-
 	/* No divisor found. */
 

CVS commit: [netbsd-6] src/doc

2013-01-02 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Jan  2 23:36:12 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.1

Log Message:
Tickets 758, 759


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.66 -r1.1.2.67 src/doc/CHANGES-6.1

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

Modified files:

Index: src/doc/CHANGES-6.1
diff -u src/doc/CHANGES-6.1:1.1.2.66 src/doc/CHANGES-6.1:1.1.2.67
--- src/doc/CHANGES-6.1:1.1.2.66	Mon Dec 17 00:32:05 2012
+++ src/doc/CHANGES-6.1	Wed Jan  2 23:36:11 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.66 2012/12/17 00:32:05 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.67 2013/01/02 23:36:11 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -7900,3 +7900,15 @@ sys/compat/netbsd32/netbsd32_fs.c		1.64
 	Fix inverted error check.
 	[matt, ticket #756]
 
+sys/kern/vfs_wapbl.c1.53-1.54
+
+	Coalesce writes to the journal to speed up wapbl_flush() on
+	raid5 by a factor of 3-4.
+	[hannken, ticket #758]
+
+sys/dev/sdmmc/sdhc.cpatch
+sys/dev/sdmmc/sdhcreg.hpatch
+
+	Support SDHC version 3 clocks.
+	[skrll, ticket #759]
+



CVS commit: src/sys/arch/sparc64/sparc64

2013-01-02 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan  3 07:51:49 UTC 2013

Modified Files:
src/sys/arch/sparc64/sparc64: db_interface.c

Log Message:
There is no point in trying to tell userland access from kernel access by
looking at the address on sparc64 - so, let us believe the comment and always
deal with kernel access here.
While there, fix write access to kernel text for bigger kernels.


To generate a diff of this commit:
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/sparc64/sparc64/db_interface.c

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

Modified files:

Index: src/sys/arch/sparc64/sparc64/db_interface.c
diff -u src/sys/arch/sparc64/sparc64/db_interface.c:1.130 src/sys/arch/sparc64/sparc64/db_interface.c:1.131
--- src/sys/arch/sparc64/sparc64/db_interface.c:1.130	Sat Feb 18 15:56:30 2012
+++ src/sys/arch/sparc64/sparc64/db_interface.c	Thu Jan  3 07:51:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_interface.c,v 1.130 2012/02/18 15:56:30 christos Exp $ */
+/*	$NetBSD: db_interface.c,v 1.131 2013/01/03 07:51:48 martin Exp $ */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath.  All rights reserved.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.130 2012/02/18 15:56:30 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.131 2013/01/03 07:51:48 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -358,10 +358,7 @@ db_read_bytes(db_addr_t addr, size_t siz
 
 	src = (char *)(uintptr_t)addr;
 	while (size-- > 0) {
-		if (src >= (char *)VM_MIN_KERNEL_ADDRESS)
-			*data++ = probeget((paddr_t)(u_long)src++, ASI_P, 1);
-		else
-			*data++ = fubyte(src++);
+		*data++ = probeget((paddr_t)(u_long)src++, ASI_P, 1);
 	}
 }
 
@@ -374,17 +371,16 @@ db_write_bytes(db_addr_t addr, size_t si
 {
 	char *dst;
 	extern paddr_t pmap_kextract(vaddr_t va);
+	extern vaddr_t ektext;
 
 	dst = (char *)(uintptr_t)addr;
 	while (size-- > 0) {
-		if ((dst >= (char *)VM_MIN_KERNEL_ADDRESS+0x40))
-			*dst = *data;
-		else if ((dst >= (char *)VM_MIN_KERNEL_ADDRESS) &&
-			 (dst < (char *)VM_MIN_KERNEL_ADDRESS+0x40))
+		if ((dst >= (char *)VM_MIN_KERNEL_ADDRESS) &&
+			 (dst < (char *)ektext))
 			/* Read Only mapping -- need to do a bypass access */
 			stba(pmap_kextract((vaddr_t)dst), ASI_PHYS_CACHED, *data);
 		else
-			subyte(dst, *data);
+			*dst = *data;
 		dst++, data++;
 	}