CVS commit: src/sys/dev/pci

2013-03-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 31 10:51:38 UTC 2013

Modified Files:
src/sys/dev/pci: if_athn_pci.c

Log Message:
Fix obvious copypasto


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/if_athn_pci.c

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

Modified files:

Index: src/sys/dev/pci/if_athn_pci.c
diff -u src/sys/dev/pci/if_athn_pci.c:1.1 src/sys/dev/pci/if_athn_pci.c:1.2
--- src/sys/dev/pci/if_athn_pci.c:1.1	Sat Mar 30 02:53:02 2013
+++ src/sys/dev/pci/if_athn_pci.c	Sun Mar 31 10:51:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_pci.c,v 1.1 2013/03/30 02:53:02 christos Exp $	*/
+/*	$NetBSD: if_athn_pci.c,v 1.2 2013/03/31 10:51:38 martin Exp $	*/
 /*	$OpenBSD: if_athn_pci.c,v 1.11 2011/01/08 10:02:32 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_athn_pci.c,v 1.1 2013/03/30 02:53:02 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_athn_pci.c,v 1.2 2013/03/31 10:51:38 martin Exp $);
 
 #include opt_inet.h
 
@@ -113,7 +113,7 @@ athn_pci_match(device_t parent, cfdata_t
 
 	for (i = 0; i  __arraycount(athn_pci_devices); i++) {
 		if (PCI_VENDOR(pa-pa_id) == athn_pci_devices[i].apd_vendor 
-		PCI_VENDOR(pa-pa_id) == athn_pci_devices[i].apd_product)
+		PCI_PRODUCT(pa-pa_id) == athn_pci_devices[i].apd_product)
 			return 1;
 	}
 	return 0;



CVS commit: src/sys/dev/pci

2013-03-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 31 11:12:30 UTC 2013

Modified Files:
src/sys/dev/pci: if_athn_pci.c

Log Message:
Initialize sc_dev


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/pci/if_athn_pci.c

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

Modified files:

Index: src/sys/dev/pci/if_athn_pci.c
diff -u src/sys/dev/pci/if_athn_pci.c:1.2 src/sys/dev/pci/if_athn_pci.c:1.3
--- src/sys/dev/pci/if_athn_pci.c:1.2	Sun Mar 31 10:51:38 2013
+++ src/sys/dev/pci/if_athn_pci.c	Sun Mar 31 11:12:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_pci.c,v 1.2 2013/03/31 10:51:38 martin Exp $	*/
+/*	$NetBSD: if_athn_pci.c,v 1.3 2013/03/31 11:12:30 martin Exp $	*/
 /*	$OpenBSD: if_athn_pci.c,v 1.11 2011/01/08 10:02:32 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_athn_pci.c,v 1.2 2013/03/31 10:51:38 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_athn_pci.c,v 1.3 2013/03/31 11:12:30 martin Exp $);
 
 #include opt_inet.h
 
@@ -131,6 +131,7 @@ athn_pci_attach(device_t parent, device_
 	pci_product_id_t subsysid;
 	int error;
 
+	sc-sc_dev = self;
 	sc-sc_dmat = pa-pa_dmat;
 	psc-psc_pc = pa-pa_pc;
 	psc-psc_tag = pa-pa_tag;



CVS commit: src/sys/dev/pci

2013-03-31 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Mar 31 11:38:37 UTC 2013

Modified Files:
src/sys/dev/pci: if_athn_pci.c

Log Message:
setup interface backpointer


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/pci/if_athn_pci.c

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

Modified files:

Index: src/sys/dev/pci/if_athn_pci.c
diff -u src/sys/dev/pci/if_athn_pci.c:1.3 src/sys/dev/pci/if_athn_pci.c:1.4
--- src/sys/dev/pci/if_athn_pci.c:1.3	Sun Mar 31 11:12:30 2013
+++ src/sys/dev/pci/if_athn_pci.c	Sun Mar 31 11:38:36 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_athn_pci.c,v 1.3 2013/03/31 11:12:30 martin Exp $	*/
+/*	$NetBSD: if_athn_pci.c,v 1.4 2013/03/31 11:38:36 martin Exp $	*/
 /*	$OpenBSD: if_athn_pci.c,v 1.11 2011/01/08 10:02:32 damien Exp $	*/
 
 /*-
@@ -22,7 +22,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_athn_pci.c,v 1.3 2013/03/31 11:12:30 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_athn_pci.c,v 1.4 2013/03/31 11:38:36 martin Exp $);
 
 #include opt_inet.h
 
@@ -208,6 +208,7 @@ athn_pci_attach(device_t parent, device_
 	}
 	aprint_verbose_dev(self, interrupting at %s\n, intrstr);
 
+	ic-ic_ifp = sc-sc_if;
 	if (athn_attach(sc) != 0)
 		goto fail2;
 



CVS commit: src/sys/kern

2013-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 31 16:45:06 UTC 2013

Modified Files:
src/sys/kern: kern_time.c

Log Message:
always return immediately on error, and if we passed negative seconds,
return with 0.


To generate a diff of this commit:
cvs rdiff -u -r1.177 -r1.178 src/sys/kern/kern_time.c

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

Modified files:

Index: src/sys/kern/kern_time.c
diff -u src/sys/kern/kern_time.c:1.177 src/sys/kern/kern_time.c:1.178
--- src/sys/kern/kern_time.c:1.177	Fri Mar 29 06:34:12 2013
+++ src/sys/kern/kern_time.c	Sun Mar 31 12:45:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_time.c,v 1.177 2013/03/29 10:34:12 martin Exp $	*/
+/*	$NetBSD: kern_time.c,v 1.178 2013/03/31 16:45:06 christos Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2005, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_time.c,v 1.177 2013/03/29 10:34:12 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_time.c,v 1.178 2013/03/31 16:45:06 christos Exp $);
 
 #include sys/param.h
 #include sys/resourcevar.h
@@ -328,10 +328,8 @@ nanosleep1(struct lwp *l, clockid_t cloc
 	struct timespec rmtstart;
 	int error, timo;
 
-	if ((error = ts2timo(clock_id, flags, rqt, timo, rmtstart)) != 0) {
-		if (error == ETIMEDOUT)
-			timo = 0;
-	}
+	if ((error = ts2timo(clock_id, flags, rqt, timo, rmtstart)) != 0)
+		return error == ETIMEDOUT ? 0 : error;
 
 	/*
 	 * Avoid inadvertently sleeping forever



CVS commit: src/sys/kern

2013-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 31 16:46:29 UTC 2013

Modified Files:
src/sys/kern: subr_time.c

Log Message:
instead of doing the tests twice fix the *fix() routines to return ETIMEDOUT
if seconds are negative. Accorting to TOG, this is not an error as linux
claims. Also make an assert stricter.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/kern/subr_time.c

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

Modified files:

Index: src/sys/kern/subr_time.c
diff -u src/sys/kern/subr_time.c:1.11 src/sys/kern/subr_time.c:1.12
--- src/sys/kern/subr_time.c:1.11	Fri Mar 29 06:34:12 2013
+++ src/sys/kern/subr_time.c	Sun Mar 31 12:46:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_time.c,v 1.11 2013/03/29 10:34:12 martin Exp $	*/
+/*	$NetBSD: subr_time.c,v 1.12 2013/03/31 16:46:29 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_time.c,v 1.11 2013/03/29 10:34:12 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_time.c,v 1.12 2013/03/31 16:46:29 christos Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -167,22 +167,26 @@ int
 itimerfix(struct timeval *tv)
 {
 
-	if (tv-tv_sec  0 || tv-tv_usec  0 || tv-tv_usec = 100)
-		return (EINVAL);
+	if (tv-tv_usec  0 || tv-tv_usec = 100)
+		return EINVAL;
+	if (tv-tv_sec  0)
+		return ETIMEDOUT;
 	if (tv-tv_sec == 0  tv-tv_usec != 0  tv-tv_usec  tick)
 		tv-tv_usec = tick;
-	return (0);
+	return 0;
 }
 
 int
 itimespecfix(struct timespec *ts)
 {
 
-	if (ts-tv_sec  0 || ts-tv_nsec  0 || ts-tv_nsec = 10)
-		return (EINVAL);
+	if (ts-tv_nsec  0 || ts-tv_nsec = 10)
+		return EINVAL;
+	if (ts-tv_sec  0)
+		return ETIMEDOUT;
 	if (ts-tv_sec == 0  ts-tv_nsec != 0  ts-tv_nsec  tick * 1000)
 		ts-tv_nsec = tick * 1000;
-	return (0);
+	return 0;
 }
 
 int
@@ -252,14 +256,11 @@ ts2timo(clockid_t clock_id, int flags, s
 	if (flags)
 		timespecsub(ts, start, ts);
 
-	if (ts-tv_sec  0 || (ts-tv_sec == 0  ts-tv_nsec = 0))
-		return ETIMEDOUT;
-
-	if ((error = itimespecfix(ts)) !=  0)
+	if ((error = itimespecfix(ts)) != 0)
 		return error;
 
 	*timo = tstohz(ts);
-	KASSERT(*timo != 0);
+	KASSERT(*timo  0);
 
 	return 0;
 }



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

2013-03-31 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Mar 31 16:47:16 UTC 2013

Modified Files:
src/tests/lib/libc/sys: t_nanosleep.c

Log Message:
add more test cases for nanosleep


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libc/sys/t_nanosleep.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/sys/t_nanosleep.c
diff -u src/tests/lib/libc/sys/t_nanosleep.c:1.2 src/tests/lib/libc/sys/t_nanosleep.c:1.3
--- src/tests/lib/libc/sys/t_nanosleep.c:1.2	Sat Mar 31 07:41:33 2012
+++ src/tests/lib/libc/sys/t_nanosleep.c	Sun Mar 31 12:47:16 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: t_nanosleep.c,v 1.2 2012/03/31 11:41:33 jruoho Exp $ */
+/* $NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__RCSID($NetBSD: t_nanosleep.c,v 1.2 2012/03/31 11:41:33 jruoho Exp $);
+__RCSID($NetBSD: t_nanosleep.c,v 1.3 2013/03/31 16:47:16 christos Exp $);
 
 #include sys/time.h
 #include sys/wait.h
@@ -104,12 +104,21 @@ ATF_TC_BODY(nanosleep_err, tc)
 {
 	struct timespec ts;
 
-	ts.tv_sec = -1;
-	ts.tv_nsec = 1000;
+	ts.tv_sec = 1;
+	ts.tv_nsec = -1;
+	errno = 0;
+	ATF_REQUIRE_ERRNO(EINVAL, nanosleep(ts, NULL) == -1);
 
+	ts.tv_sec = 1;
+	ts.tv_nsec = 10;
 	errno = 0;
 	ATF_REQUIRE_ERRNO(EINVAL, nanosleep(ts, NULL) == -1);
 
+	ts.tv_sec = -1;
+	ts.tv_nsec = 0;
+	errno = 0;
+	ATF_REQUIRE_ERRNO(0, nanosleep(ts, NULL) == 0);
+
 	errno = 0;
 	ATF_REQUIRE_ERRNO(EFAULT, nanosleep((void *)-1, NULL) == -1);
 }



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

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 17:30:20 UTC 2013

Modified Files:
src/sys/sys [netbsd-6]: ptree.h

Log Message:
Pull up following revision(s) (requested by rmind in ticket #851):
sys/sys/ptree.h: revision 1.5
Cast constants to the appropriate type.


To generate a diff of this commit:
cvs rdiff -u -r1.4.8.3 -r1.4.8.4 src/sys/sys/ptree.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/ptree.h
diff -u src/sys/sys/ptree.h:1.4.8.3 src/sys/sys/ptree.h:1.4.8.4
--- src/sys/sys/ptree.h:1.4.8.3	Sat Nov 24 18:15:22 2012
+++ src/sys/sys/ptree.h	Sun Mar 31 17:30:20 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptree.h,v 1.4.8.3 2012/11/24 18:15:22 jdc Exp $	*/
+/*	$NetBSD: ptree.h,v 1.4.8.4 2013/03/31 17:30:20 riz Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -54,9 +54,9 @@ typedef struct pt_node {
 #define	PT_SLOT_ROOT			0u
 #define	PT_SLOT_OTHER			1u
 #define	PT_SLOT_ODDMAN			1u
-#define	PT_TYPE_LEAF			0xu
-#define	PT_TYPE_BRANCH			0x0001u
-#define	PT_TYPE_MASK			0x0001u
+#define	PT_TYPE_LEAF			((uintptr_t)0xu)
+#define	PT_TYPE_BRANCH			((uintptr_t)0x0001u)
+#define	PT_TYPE_MASK			((uintptr_t)0x0001u)
 #endif /* _PT_PRIVATE */
 
 	uint32_t ptn_nodedata;



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

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 17:30:35 UTC 2013

Modified Files:
src/sys/sys [netbsd-6-0]: ptree.h

Log Message:
Pull up following revision(s) (requested by rmind in ticket #851):
sys/sys/ptree.h: revision 1.5
Cast constants to the appropriate type.


To generate a diff of this commit:
cvs rdiff -u -r1.4.8.2 -r1.4.8.2.4.1 src/sys/sys/ptree.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/ptree.h
diff -u src/sys/sys/ptree.h:1.4.8.2 src/sys/sys/ptree.h:1.4.8.2.4.1
--- src/sys/sys/ptree.h:1.4.8.2	Mon Jul 16 22:10:47 2012
+++ src/sys/sys/ptree.h	Sun Mar 31 17:30:34 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ptree.h,v 1.4.8.2 2012/07/16 22:10:47 riz Exp $	*/
+/*	$NetBSD: ptree.h,v 1.4.8.2.4.1 2013/03/31 17:30:34 riz Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -54,9 +54,9 @@ typedef struct pt_node {
 #define	PT_SLOT_ROOT			0u
 #define	PT_SLOT_OTHER			1u
 #define	PT_SLOT_ODDMAN			1u
-#define	PT_TYPE_LEAF			0xu
-#define	PT_TYPE_BRANCH			0x0001u
-#define	PT_TYPE_MASK			0x0001u
+#define	PT_TYPE_LEAF			((uintptr_t)0xu)
+#define	PT_TYPE_BRANCH			((uintptr_t)0x0001u)
+#define	PT_TYPE_MASK			((uintptr_t)0x0001u)
 #endif /* _PT_PRIVATE */
 
 	uint32_t ptn_nodedata;



CVS commit: [netbsd-6-0] src/doc

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 17:30:52 UTC 2013

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

Log Message:
Ticket 851


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.25 -r1.1.2.26 src/doc/CHANGES-6.0.2

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.0.2
diff -u src/doc/CHANGES-6.0.2:1.1.2.25 src/doc/CHANGES-6.0.2:1.1.2.26
--- src/doc/CHANGES-6.0.2:1.1.2.25	Fri Mar 29 00:52:23 2013
+++ src/doc/CHANGES-6.0.2	Sun Mar 31 17:30:52 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.2,v 1.1.2.25 2013/03/29 00:52:23 msaitoh Exp $
+# $NetBSD: CHANGES-6.0.2,v 1.1.2.26 2013/03/31 17:30:52 riz Exp $
 
 A complete list of changes from the NetBSD 6.0.1 release to the NetBSD 6.0.2
 release:
@@ -187,3 +187,8 @@ sys/kern/subr_cprng.c1.16
 	is mixed in before users can obtain any output, it doesn't look as
 	dangerous in practice as I'd feared it might be.
 	[tls, ticket #859]
+sys/sys/ptree.h	1.5
+
+	Cast constants to appropriate types to fix crashes in ptree(9).
+	[rmind, ticket #851]
+



CVS commit: [netbsd-6] src/usr.sbin/npf/npfctl

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 17:43:16 UTC 2013

Modified Files:
src/usr.sbin/npf/npfctl [netbsd-6]: npf.conf.5 npf_parse.y npfctl.c

Log Message:
Pull up following revision(s) (requested by rmind in ticket #852):
usr.sbin/npf/npfctl/npf.conf.5: revision 1.28
usr.sbin/npf/npfctl/npf_parse.y: revision 1.19
usr.sbin/npf/npfctl/npf_parse.y: revision 1.20
usr.sbin/npf/npfctl/npfctl.c: revision 1.32
Fix the example (deja vu?).
deal with strings as interfaces
centralize error handling and print what went wrong instead of quot;ioctlquot;
handle port quot;ftp-dataquot;


To generate a diff of this commit:
cvs rdiff -u -r1.9.2.8 -r1.9.2.9 src/usr.sbin/npf/npfctl/npf.conf.5
cvs rdiff -u -r1.3.2.11 -r1.3.2.12 src/usr.sbin/npf/npfctl/npf_parse.y
cvs rdiff -u -r1.10.2.15 -r1.10.2.16 src/usr.sbin/npf/npfctl/npfctl.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/npf/npfctl/npf.conf.5
diff -u src/usr.sbin/npf/npfctl/npf.conf.5:1.9.2.8 src/usr.sbin/npf/npfctl/npf.conf.5:1.9.2.9
--- src/usr.sbin/npf/npfctl/npf.conf.5:1.9.2.8	Mon Feb 11 21:49:47 2013
+++ src/usr.sbin/npf/npfctl/npf.conf.5	Sun Mar 31 17:43:16 2013
@@ -1,4 +1,4 @@
-.\$NetBSD: npf.conf.5,v 1.9.2.8 2013/02/11 21:49:47 riz Exp $
+.\$NetBSD: npf.conf.5,v 1.9.2.9 2013/03/31 17:43:16 riz Exp $
 .\
 .\ Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -283,7 +283,7 @@ $localnet = { 10.1.1.0/24 }
 # Note: if $ext_if has multiple IP address (e.g. IPv6 as well),
 # then the translation address has to be specified explicitly.
 map $ext_if dynamic 10.1.1.0/24 - $ext_if
-map $ext_if dynamic 10.1.1.2 port 22 - $ext_if 9022
+map $ext_if dynamic 10.1.1.2 port 22 - $ext_if port 9022
 
 procedure log {
 	# Note: npf_ext_log kernel module should be loaded, if not built-in.

Index: src/usr.sbin/npf/npfctl/npf_parse.y
diff -u src/usr.sbin/npf/npfctl/npf_parse.y:1.3.2.11 src/usr.sbin/npf/npfctl/npf_parse.y:1.3.2.12
--- src/usr.sbin/npf/npfctl/npf_parse.y:1.3.2.11	Mon Feb 11 21:49:47 2013
+++ src/usr.sbin/npf/npfctl/npf_parse.y	Sun Mar 31 17:43:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npf_parse.y,v 1.3.2.11 2013/02/11 21:49:47 riz Exp $	*/
+/*	$NetBSD: npf_parse.y,v 1.3.2.12 2013/03/31 17:43:16 riz Exp $	*/
 
 /*-
  * Copyright (c) 2011-2012 The NetBSD Foundation, Inc.
@@ -152,7 +152,7 @@ yyerror(const char *fmt, ...)
 %token	str		TABLE_ID
 %token	str		VAR_ID
 
-%type	str		addr, some_name, list_elem, table_store
+%type	str		addr, some_name, list_elem, table_store, string
 %type	str		proc_param_val, opt_apply
 %type	num		ifindex, port, opt_final, on_ifindex
 %type	num		afamily, opt_family
@@ -621,10 +621,17 @@ addr_or_ifnet
 	| VAR_ID
 	{
 		npfvar_t *vp = npfvar_lookup($1);
-		const int type = npfvar_get_type(vp, 0);
+		int type = npfvar_get_type(vp, 0);
 		ifnet_addr_t *ifna;
 
+again:
 		switch (type) {
+		case NPFVAR_IDENTIFIER:
+		case NPFVAR_STRING:
+			vp = npfctl_parse_ifnet(npfvar_expand_string(vp),
+			AF_UNSPEC);
+			type = npfvar_get_type(vp, 0);
+			goto again;
 		case NPFVAR_FAM:
 			$$ = vp;
 			break;
@@ -670,6 +677,7 @@ port_range
 port
 	: NUM		{ $$ = $1; }
 	| IDENTIFIER	{ $$ = npfctl_portno($1); }
+	| STRING	{ $$ = npfctl_portno($1); }
 	;
 
 icmp_type_and_code
@@ -727,15 +735,42 @@ icmp_type
 	}
 	;
 
+string
+	: IDENTIFIER
+	{
+		$$ = $1;
+	}
+	| VAR_ID
+	{
+		npfvar_t *vp = npfvar_lookup($1);
+		const int type = npfvar_get_type(vp, 0);
+
+		switch (type) {
+		case NPFVAR_STRING:
+		case NPFVAR_IDENTIFIER:
+			$$ = npfvar_expand_string(vp);
+			break;
+		case -1:
+			yyerror(undefined variable '%s' for interface, $1);
+			break;
+		default:
+			yyerror(wrong variable '%s' type '%s' for string,
+			$1, npfvar_type(type));
+			break;
+		}
+	}
+	;
+
 ifnet
-	: IFNET PAR_OPEN IDENTIFIER PAR_CLOSE
+	: IFNET PAR_OPEN string PAR_CLOSE
 	{
 		$$ = npfctl_parse_ifnet($3, AF_UNSPEC);
 	}
-	| afamily PAR_OPEN IDENTIFIER PAR_CLOSE
+	| afamily PAR_OPEN string PAR_CLOSE
 	{
 		$$ = npfctl_parse_ifnet($3, $1);
 	}
+	;
 
 ifindex
 	: some_name

Index: src/usr.sbin/npf/npfctl/npfctl.c
diff -u src/usr.sbin/npf/npfctl/npfctl.c:1.10.2.15 src/usr.sbin/npf/npfctl/npfctl.c:1.10.2.16
--- src/usr.sbin/npf/npfctl/npfctl.c:1.10.2.15	Mon Feb 18 18:26:14 2013
+++ src/usr.sbin/npf/npfctl/npfctl.c	Sun Mar 31 17:43:16 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: npfctl.c,v 1.10.2.15 2013/02/18 18:26:14 riz Exp $	*/
+/*	$NetBSD: npfctl.c,v 1.10.2.16 2013/03/31 17:43:16 riz Exp $	*/
 
 /*-
  * Copyright (c) 2009-2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__RCSID($NetBSD: npfctl.c,v 1.10.2.15 2013/02/18 18:26:14 riz Exp $);
+__RCSID($NetBSD: npfctl.c,v 1.10.2.16 2013/03/31 17:43:16 riz Exp $);
 
 #include sys/ioctl.h
 #include sys/stat.h
@@ -339,7 +339,7 @@ again:
 		}
 		/* FALLTHROUGH */
 	default:
-		err(EXIT_FAILURE, ioctl);
+		err(EXIT_FAILURE, 

CVS commit: [netbsd-6] src/doc

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 17:47:11 UTC 2013

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

Log Message:
Tickets 851, 852


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.115 -r1.1.2.116 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.115 src/doc/CHANGES-6.1:1.1.2.116
--- src/doc/CHANGES-6.1:1.1.2.115	Sat Mar 30 23:12:24 2013
+++ src/doc/CHANGES-6.1	Sun Mar 31 17:47:10 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.115 2013/03/30 23:12:24 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.116 2013/03/31 17:47:10 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -8760,3 +8760,15 @@ xsrc/external/mit/xf86-input-keyboard/di
 	Correct some issues with wsmux hotplugging.
 	[jmcneill, ticket #848]
 
+sys/sys/ptree.h	1.5
+
+	Cast constants to appropriate types to fix crashes in ptree(9).
+	[rmind, ticket #851]
+
+usr.sbin/npf/npfctl/npf.conf.5			1.28
+usr.sbin/npf/npfctl/npf_parse.y			1.19-1.20
+usr.sbin/npf/npfctl/npfctl.c			1.32
+
+	Minor npfctl(5) fixes in parsing and error handling.
+	[rmind, ticket #852]
+



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

2013-03-31 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Mar 31 19:34:25 UTC 2013

Modified Files:
src/sys/arch/x86/acpi: acpi_machdep.c

Log Message:
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the flags field
as well as redir since apic_set_redir() uses both.  fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/x86/acpi/acpi_machdep.c

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

Modified files:

Index: src/sys/arch/x86/acpi/acpi_machdep.c
diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.5 src/sys/arch/x86/acpi/acpi_machdep.c:1.6
--- src/sys/arch/x86/acpi/acpi_machdep.c:1.5	Mon Mar 25 01:30:37 2013
+++ src/sys/arch/x86/acpi/acpi_machdep.c	Sun Mar 31 19:34:24 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.5 2013/03/25 01:30:37 chs Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.6 2013/03/31 19:34:24 chs Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_machdep.c,v 1.5 2013/03/25 01:30:37 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_machdep.c,v 1.6 2013/03/31 19:34:24 chs Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -163,12 +163,14 @@ acpi_md_OsInstallInterruptHandler(uint32
 		if (polarity == ACPI_MADT_POLARITY_ACTIVE_HIGH ||
 		(!sci  polarity == ACPI_MADT_POLARITY_CONFORMS)) {
 			mpflags = ~MPS_INTPO_ACTLO;
+			mpflags |= MPS_INTPO_ACTHI;
 			redir = ~IOAPIC_REDLO_ACTLO;
 		}
 		if (trigger == ACPI_MADT_TRIGGER_EDGE ||
 		(!sci  trigger == ACPI_MADT_TRIGGER_CONFORMS)) {
 			type = IST_EDGE;
 			mpflags = ~(MPS_INTTR_LEVEL  2);
+			mpflags |= (MPS_INTTR_EDGE  2);
 			redir = ~IOAPIC_REDLO_LEVEL;
 		}
 	}
@@ -200,6 +202,7 @@ acpi_md_OsInstallInterruptHandler(uint32
 			mipp = sc-sc_pins[pin].ip_map;
 			*mipp = tmpmap;
 			tmpmap.redir = redir;
+			tmpmap.flags = mpflags;
 		}
 	} else
 #endif



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

2013-03-31 Thread Chuck Silvers
Module Name:src
Committed By:   chs
Date:   Sun Mar 31 19:45:06 UTC 2013

Modified Files:
src/sys/arch/x86/include: mpacpi.h

Log Message:
remove unused variable declaration.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x86/include/mpacpi.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/x86/include/mpacpi.h
diff -u src/sys/arch/x86/include/mpacpi.h:1.9 src/sys/arch/x86/include/mpacpi.h:1.10
--- src/sys/arch/x86/include/mpacpi.h:1.9	Fri Apr 17 21:07:58 2009
+++ src/sys/arch/x86/include/mpacpi.h	Sun Mar 31 19:45:06 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpacpi.h,v 1.9 2009/04/17 21:07:58 dyoung Exp $	*/
+/*	$NetBSD: mpacpi.h,v 1.10 2013/03/31 19:45:06 chs Exp $	*/
 
 #ifndef _X86_MPACPI_H_
 #define _X86_MPACPI_H_
@@ -13,6 +13,4 @@ int mpacpi_pci_attach_hook(device_t, dev
 struct mp_intr_map;
 int mpacpi_findintr_linkdev(struct mp_intr_map *);
 
-extern struct mp_intr_map *mpacpi_sci_override;
-
 #endif /* _X86_MPACPI_H_ */



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

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:20:08 UTC 2013

Modified Files:
src/sys/netinet6 [netbsd-6]: udp6_output.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #853):
sys/netinet6/udp6_output.c: revision 1.44
PR/47408: Anthony Mallet: sendto(2) issue with IPv6 UDP datagrams
- don't connect when the local port is 0, just set the local port number.
- remove redundant assignment
XXX: pullup-6


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.8.1 src/sys/netinet6/udp6_output.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/netinet6/udp6_output.c
diff -u src/sys/netinet6/udp6_output.c:1.43 src/sys/netinet6/udp6_output.c:1.43.8.1
--- src/sys/netinet6/udp6_output.c:1.43	Sat Sep 24 17:22:14 2011
+++ src/sys/netinet6/udp6_output.c	Sun Mar 31 20:20:07 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp6_output.c,v 1.43 2011/09/24 17:22:14 christos Exp $	*/
+/*	$NetBSD: udp6_output.c,v 1.43.8.1 2013/03/31 20:20:07 riz Exp $	*/
 /*	$KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: udp6_output.c,v 1.43 2011/09/24 17:22:14 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: udp6_output.c,v 1.43.8.1 2013/03/31 20:20:07 riz Exp $);
 
 #include opt_inet.h
 
@@ -177,8 +177,6 @@ udp6_output(struct in6pcb * const in6p, 
 
 
 	if (sin6) {
-		faddr = sin6-sin6_addr;
-
 		/*
 		 * IPv4 version of udp_output calls in_pcbconnect in this case,
 		 * which needs splnet and affects performance.
@@ -292,10 +290,12 @@ udp6_output(struct in6pcb * const in6p, 
 			if (error)
 goto release;
 
-			error = in6_pcbconnect(in6p, addr6, l);
+			error = in6_pcbsetport(lsin6, in6p, l);
 
-			if (error)
+			if (error) {
+in6p-in6p_laddr = in6addr_any;
 goto release;
+			}
 		}
 	} else {
 		if (IN6_IS_ADDR_UNSPECIFIED(in6p-in6p_faddr)) {



CVS commit: [netbsd-6-0] src/sys/netinet6

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:20:31 UTC 2013

Modified Files:
src/sys/netinet6 [netbsd-6-0]: udp6_output.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #853):
sys/netinet6/udp6_output.c: revision 1.44
PR/47408: Anthony Mallet: sendto(2) issue with IPv6 UDP datagrams
- don't connect when the local port is 0, just set the local port number.
- remove redundant assignment
XXX: pullup-6


To generate a diff of this commit:
cvs rdiff -u -r1.43 -r1.43.14.1 src/sys/netinet6/udp6_output.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/netinet6/udp6_output.c
diff -u src/sys/netinet6/udp6_output.c:1.43 src/sys/netinet6/udp6_output.c:1.43.14.1
--- src/sys/netinet6/udp6_output.c:1.43	Sat Sep 24 17:22:14 2011
+++ src/sys/netinet6/udp6_output.c	Sun Mar 31 20:20:31 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: udp6_output.c,v 1.43 2011/09/24 17:22:14 christos Exp $	*/
+/*	$NetBSD: udp6_output.c,v 1.43.14.1 2013/03/31 20:20:31 riz Exp $	*/
 /*	$KAME: udp6_output.c,v 1.43 2001/10/15 09:19:52 itojun Exp $	*/
 
 /*
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: udp6_output.c,v 1.43 2011/09/24 17:22:14 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: udp6_output.c,v 1.43.14.1 2013/03/31 20:20:31 riz Exp $);
 
 #include opt_inet.h
 
@@ -177,8 +177,6 @@ udp6_output(struct in6pcb * const in6p, 
 
 
 	if (sin6) {
-		faddr = sin6-sin6_addr;
-
 		/*
 		 * IPv4 version of udp_output calls in_pcbconnect in this case,
 		 * which needs splnet and affects performance.
@@ -292,10 +290,12 @@ udp6_output(struct in6pcb * const in6p, 
 			if (error)
 goto release;
 
-			error = in6_pcbconnect(in6p, addr6, l);
+			error = in6_pcbsetport(lsin6, in6p, l);
 
-			if (error)
+			if (error) {
+in6p-in6p_laddr = in6addr_any;
 goto release;
+			}
 		}
 	} else {
 		if (IN6_IS_ADDR_UNSPECIFIED(in6p-in6p_faddr)) {



CVS commit: [netbsd-6] src/lib/libc/rpc

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:26:33 UTC 2013

Modified Files:
src/lib/libc/rpc [netbsd-6]: clnt_vc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #854):
lib/libc/rpc/clnt_vc.c: revision 1.19
PR/13082: Thorsten Brehm: Fix wrong memcpy that caused possible memory
corruption. XXX: pullup to 6.


To generate a diff of this commit:
cvs rdiff -u -r1.17.8.1 -r1.17.8.2 src/lib/libc/rpc/clnt_vc.c

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

Modified files:

Index: src/lib/libc/rpc/clnt_vc.c
diff -u src/lib/libc/rpc/clnt_vc.c:1.17.8.1 src/lib/libc/rpc/clnt_vc.c:1.17.8.2
--- src/lib/libc/rpc/clnt_vc.c:1.17.8.1	Thu Mar 14 22:03:09 2013
+++ src/lib/libc/rpc/clnt_vc.c	Sun Mar 31 20:26:33 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: clnt_vc.c,v 1.17.8.1 2013/03/14 22:03:09 riz Exp $	*/
+/*	$NetBSD: clnt_vc.c,v 1.17.8.2 2013/03/31 20:26:33 riz Exp $	*/
 
 /*
  * Copyright (c) 2010, Oracle America, Inc.
@@ -38,7 +38,7 @@ static char *sccsid = @(#)clnt_tcp.c 1.
 static char *sccsid = @(#)clnt_tcp.c	2.2 88/08/01 4.0 RPCSRC;
 static char sccsid[] = @(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro;
 #else
-__RCSID($NetBSD: clnt_vc.c,v 1.17.8.1 2013/03/14 22:03:09 riz Exp $);
+__RCSID($NetBSD: clnt_vc.c,v 1.17.8.2 2013/03/31 20:26:33 riz Exp $);
 #endif
 #endif
  
@@ -264,8 +264,8 @@ clnt_vc_create(fd, raddr, prog, vers, se
 	ct-ct_addr.buf = malloc((size_t)raddr-maxlen);
 	if (ct-ct_addr.buf == NULL)
 		goto fooy;
-	memcpy(ct-ct_addr.buf, raddr-buf, (size_t)raddr-len);
-	ct-ct_addr.len = raddr-maxlen;
+	memcpy(ct-ct_addr.buf, raddr-buf, (size_t)raddr-len);
+	ct-ct_addr.len = raddr-len;
 	ct-ct_addr.maxlen = raddr-maxlen;
 
 	/*



CVS commit: [netbsd-6-0] src/lib/libc/rpc

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:26:59 UTC 2013

Modified Files:
src/lib/libc/rpc [netbsd-6-0]: clnt_vc.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #854):
lib/libc/rpc/clnt_vc.c: revision 1.19
PR/13082: Thorsten Brehm: Fix wrong memcpy that caused possible memory
corruption. XXX: pullup to 6.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.17.12.1 src/lib/libc/rpc/clnt_vc.c

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

Modified files:

Index: src/lib/libc/rpc/clnt_vc.c
diff -u src/lib/libc/rpc/clnt_vc.c:1.17 src/lib/libc/rpc/clnt_vc.c:1.17.12.1
--- src/lib/libc/rpc/clnt_vc.c:1.17	Wed Dec  8 02:06:38 2010
+++ src/lib/libc/rpc/clnt_vc.c	Sun Mar 31 20:26:59 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: clnt_vc.c,v 1.17 2010/12/08 02:06:38 joerg Exp $	*/
+/*	$NetBSD: clnt_vc.c,v 1.17.12.1 2013/03/31 20:26:59 riz Exp $	*/
 
 /*
  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
@@ -36,7 +36,7 @@ static char *sccsid = @(#)clnt_tcp.c 1.
 static char *sccsid = @(#)clnt_tcp.c	2.2 88/08/01 4.0 RPCSRC;
 static char sccsid[] = @(#)clnt_vc.c 1.19 89/03/16 Copyr 1988 Sun Micro;
 #else
-__RCSID($NetBSD: clnt_vc.c,v 1.17 2010/12/08 02:06:38 joerg Exp $);
+__RCSID($NetBSD: clnt_vc.c,v 1.17.12.1 2013/03/31 20:26:59 riz Exp $);
 #endif
 #endif
  
@@ -262,8 +262,8 @@ clnt_vc_create(fd, raddr, prog, vers, se
 	ct-ct_addr.buf = malloc((size_t)raddr-maxlen);
 	if (ct-ct_addr.buf == NULL)
 		goto fooy;
-	memcpy(ct-ct_addr.buf, raddr-buf, (size_t)raddr-len);
-	ct-ct_addr.len = raddr-maxlen;
+	memcpy(ct-ct_addr.buf, raddr-buf, (size_t)raddr-len);
+	ct-ct_addr.len = raddr-len;
 	ct-ct_addr.maxlen = raddr-maxlen;
 
 	/*



CVS commit: [netbsd-6] src/sys/arch/x86

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:32:01 UTC 2013

Modified Files:
src/sys/arch/x86/acpi [netbsd-6]: acpi_machdep.c
src/sys/arch/x86/x86 [netbsd-6]: mpacpi.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #855):
sys/arch/x86/acpi/acpi_machdep.c: revision 1.5
sys/arch/x86/acpi/acpi_machdep.c: revision 1.6
sys/arch/x86/x86/mpacpi.c: revision 1.97
redo the ACPI interrupt handler setup again, this time handling
MADT overrides that change the pin as well as the polarity.
fixes PR 47648.
yet more fixes for PR 47648 / PR 47016:
when using a temporary mp_intr_map, initialize the flags field
as well as redir since apic_set_redir() uses both.  fix how
the flags field is change when applying an override, the trigger
and polarity sub-fields aren't just one bit like they are in redir.


To generate a diff of this commit:
cvs rdiff -u -r1.3.2.1 -r1.3.2.2 src/sys/arch/x86/acpi/acpi_machdep.c
cvs rdiff -u -r1.92.8.1 -r1.92.8.2 src/sys/arch/x86/x86/mpacpi.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/acpi/acpi_machdep.c
diff -u src/sys/arch/x86/acpi/acpi_machdep.c:1.3.2.1 src/sys/arch/x86/acpi/acpi_machdep.c:1.3.2.2
--- src/sys/arch/x86/acpi/acpi_machdep.c:1.3.2.1	Thu Nov 22 00:39:00 2012
+++ src/sys/arch/x86/acpi/acpi_machdep.c	Sun Mar 31 20:32:01 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: acpi_machdep.c,v 1.3.2.1 2012/11/22 00:39:00 riz Exp $ */
+/* $NetBSD: acpi_machdep.c,v 1.3.2.2 2013/03/31 20:32:01 riz Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: acpi_machdep.c,v 1.3.2.1 2012/11/22 00:39:00 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: acpi_machdep.c,v 1.3.2.2 2013/03/31 20:32:01 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -93,6 +93,31 @@ acpi_md_OsGetRootPointer(void)
 	return PhysicalAddress;
 }
 
+struct acpi_md_override {
+	int irq;
+	int pin;
+	int flags;
+};
+
+static ACPI_STATUS
+acpi_md_findoverride(ACPI_SUBTABLE_HEADER *hdrp, void *aux)
+{
+	ACPI_MADT_INTERRUPT_OVERRIDE *iop;
+	struct acpi_md_override *ovrp;
+
+	if (hdrp-Type != ACPI_MADT_TYPE_INTERRUPT_OVERRIDE) {
+		return AE_OK;
+	}
+
+	iop = (void *)hdrp;
+	ovrp = aux;
+	if (iop-SourceIrq == ovrp-irq) {
+		ovrp-pin = iop-GlobalIrq;
+		ovrp-flags = iop-IntiFlags;
+	}
+	return AE_OK;
+}
+
 ACPI_STATUS
 acpi_md_OsInstallInterruptHandler(uint32_t InterruptNumber,
 ACPI_OSD_HANDLER ServiceRoutine, void *Context, void **cookiep)
@@ -101,41 +126,63 @@ acpi_md_OsInstallInterruptHandler(uint32
 	struct pic *pic;
 #if NIOAPIC  0
 	struct ioapic_softc *sc;
+	struct acpi_md_override ovr;
+	struct mp_intr_map tmpmap, *mip, **mipp = NULL;
 #endif
-	int irq, pin, trigger;
+	int irq, pin, type, redir, mpflags;
+
+	/*
+	 * ACPI interrupts default to level-triggered active-low.
+	 */
+
+	type = IST_LEVEL;
+	mpflags = (MPS_INTTR_LEVEL  2) | MPS_INTPO_ACTLO;
+	redir = IOAPIC_REDLO_LEVEL | IOAPIC_REDLO_ACTLO;
 
 #if NIOAPIC  0
+
 	/*
-	 * Can only match on ACPI global interrupt numbers if the ACPI
-	 * interrupt info was extracted, which is in the ACPI case.
+	 * Apply any MADT override setting.
 	 */
-	if (mpacpi_sci_override != NULL) {
-		pic = mpacpi_sci_override-ioapic;
-		pin = mpacpi_sci_override-ioapic_pin;
-		if (mpacpi_sci_override-redir  IOAPIC_REDLO_LEVEL)
-			trigger = IST_LEVEL;
-		else
-			trigger = IST_EDGE;
-		if (pic-pic_type == PIC_IOAPIC)
-			irq = -1;
-		else
-			irq = (int)InterruptNumber;
-		goto sci_override;
+
+	ovr.irq = InterruptNumber;
+	ovr.pin = -1;
+	if (acpi_madt_map() == AE_OK) {
+		acpi_madt_walk(acpi_md_findoverride, ovr);
+		acpi_madt_unmap();
+	} else {
+		aprint_debug(acpi_madt_map() failed, can't check for MADT override\n);
+	}
+
+	if (ovr.pin != -1) {
+		bool sci = InterruptNumber == AcpiGbl_FADT.SciInterrupt;
+		int polarity = ovr.flags  ACPI_MADT_POLARITY_MASK;
+		int trigger = ovr.flags  ACPI_MADT_TRIGGER_MASK;
+
+		InterruptNumber = ovr.pin;
+		if (polarity == ACPI_MADT_POLARITY_ACTIVE_HIGH ||
+		(!sci  polarity == ACPI_MADT_POLARITY_CONFORMS)) {
+			mpflags = ~MPS_INTPO_ACTLO;
+			mpflags |= MPS_INTPO_ACTHI;
+			redir = ~IOAPIC_REDLO_ACTLO;
+		}
+		if (trigger == ACPI_MADT_TRIGGER_EDGE ||
+		(!sci  trigger == ACPI_MADT_TRIGGER_CONFORMS)) {
+			type = IST_EDGE;
+			mpflags = ~(MPS_INTTR_LEVEL  2);
+			mpflags |= (MPS_INTTR_EDGE  2);
+			redir = ~IOAPIC_REDLO_LEVEL;
+		}
 	}
-#endif
 
 	/*
-	 * There was no ACPI interrupt source override,
-	 *
-	 * If the interrupt is handled via IOAPIC, mark it
-	 * as level-triggered, active low in the table.
+	 * If the interrupt is handled via IOAPIC, update the map.
+	 * If the map isn't set up yet, install a temporary one.
 	 */
 
-#if NIOAPIC  0
 	sc = ioapic_find_bybase(InterruptNumber);
 	if (sc != NULL) {
 		pic = sc-sc_pic;
-		struct mp_intr_map *mip;
 
 		if (pic-pic_type == 

CVS commit: [netbsd-6] src/sys/arch/x86/x86

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:34:27 UTC 2013

Modified Files:
src/sys/arch/x86/x86 [netbsd-6]: intr.c

Log Message:
Pull up following revision(s) (requested by chs in ticket #856):
sys/arch/x86/x86/intr.c: revision 1.75
only use db_printf() if we're actually called from DDB.
this prevents the boot-time one from pausing the boot process.


To generate a diff of this commit:
cvs rdiff -u -r1.72 -r1.72.8.1 src/sys/arch/x86/x86/intr.c

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

Modified files:

Index: src/sys/arch/x86/x86/intr.c
diff -u src/sys/arch/x86/x86/intr.c:1.72 src/sys/arch/x86/x86/intr.c:1.72.8.1
--- src/sys/arch/x86/x86/intr.c:1.72	Mon Aug  1 10:42:24 2011
+++ src/sys/arch/x86/x86/intr.c	Sun Mar 31 20:34:27 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $	*/
+/*	$NetBSD: intr.c,v 1.72.8.1 2013/03/31 20:34:27 riz Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -133,7 +133,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.72 2011/08/01 10:42:24 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: intr.c,v 1.72.8.1 2013/03/31 20:34:27 riz Exp $);
 
 #include opt_intrdebug.h
 #include opt_multiprocessor.h
@@ -1063,10 +1063,6 @@ cpu_intr_init(struct cpu_info *ci)
 
 #if defined(INTRDEBUG) || defined(DDB)
 
-#ifdef DDB
-#define printf db_printf
-#endif
-
 void
 intr_printconfig(void)
 {
@@ -1075,30 +1071,45 @@ intr_printconfig(void)
 	struct intrsource *isp;
 	struct cpu_info *ci;
 	CPU_INFO_ITERATOR cii;
+	void (*pr)(const char *, ...);
+
+	pr = printf;
+#ifdef DDB
+	extern int db_active;
+	if (db_active) {
+		pr = db_printf;
+	}
+#endif
 
 	for (CPU_INFO_FOREACH(cii, ci)) {
-		printf(%s: interrupt masks:\n, device_xname(ci-ci_dev));
+		(*pr)(%s: interrupt masks:\n, device_xname(ci-ci_dev));
 		for (i = 0; i  NIPL; i++)
-			printf(IPL %d mask %lx unmask %lx\n, i,
+			(*pr)(IPL %d mask %lx unmask %lx\n, i,
 			(u_long)ci-ci_imask[i], (u_long)ci-ci_iunmask[i]);
 		for (i = 0; i  MAX_INTR_SOURCES; i++) {
 			isp = ci-ci_isources[i];
 			if (isp == NULL)
 continue;
-			printf(%s source %d is pin %d from pic %s maxlevel %d\n,
+			(*pr)(%s source %d is pin %d from pic %s type %d maxlevel %d\n,
 			device_xname(ci-ci_dev), i, isp-is_pin,
-			isp-is_pic-pic_name, isp-is_maxlevel);
+			isp-is_pic-pic_name, isp-is_type, isp-is_maxlevel);
 			for (ih = isp-is_handlers; ih != NULL;
 			 ih = ih-ih_next)
-printf(\thandler %p level %d\n,
+(*pr)(\thandler %p level %d\n,
 ih-ih_fun, ih-ih_level);
+#if NIOAPIC  0
+			if (isp-is_pic-pic_type == PIC_IOAPIC) {
+struct ioapic_softc *sc;
+sc = isp-is_pic-pic_ioapic;
+(*pr)(\tioapic redir 0x%x\n,
+sc-sc_pins[isp-is_pin].ip_map-redir);
+			}
+#endif
 
 		}
 	}
 }
-#ifdef DDB
-#undef printf
-#endif
+
 #endif
 
 void



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

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:36:23 UTC 2013

Modified Files:
src/sys/dev/mscp [netbsd-6]: mscp_subr.c

Log Message:
Pull up following revision(s) (requested by martin in ticket #857):
sys/dev/mscp/mscp_subr.c: revision 1.45
Fix device_t split glitch


To generate a diff of this commit:
cvs rdiff -u -r1.41.18.2 -r1.41.18.3 src/sys/dev/mscp/mscp_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/mscp/mscp_subr.c
diff -u src/sys/dev/mscp/mscp_subr.c:1.41.18.2 src/sys/dev/mscp/mscp_subr.c:1.41.18.3
--- src/sys/dev/mscp/mscp_subr.c:1.41.18.2	Thu Jul 12 17:17:27 2012
+++ src/sys/dev/mscp/mscp_subr.c	Sun Mar 31 20:36:23 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mscp_subr.c,v 1.41.18.2 2012/07/12 17:17:27 riz Exp $	*/
+/*	$NetBSD: mscp_subr.c,v 1.41.18.3 2013/03/31 20:36:23 riz Exp $	*/
 /*
  * Copyright (c) 1988 Regents of the University of California.
  * All rights reserved.
@@ -75,7 +75,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mscp_subr.c,v 1.41.18.2 2012/07/12 17:17:27 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: mscp_subr.c,v 1.41.18.3 2013/03/31 20:36:23 riz Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -549,7 +549,7 @@ mscp_print(void *aux, const char *name)
 void
 mscp_strategy(struct buf *bp, device_t usc)
 {
-	struct	mscp_softc *mi = (void *)usc;
+	struct	mscp_softc *mi = device_private(usc);
 	int s = spluba();
 
 	bufq_put(mi-mi_resq, bp);



CVS commit: [netbsd-6] src/usr.bin/cap_mkdb

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:39:39 UTC 2013

Modified Files:
src/usr.bin/cap_mkdb [netbsd-6]: cap_mkdb.c

Log Message:
Pull up following revision(s) (requested by gdt in ticket #858):
usr.bin/cap_mkdb/cap_mkdb.c: revision 1.28
usr.bin/cap_mkdb/cap_mkdb.c: revision 1.29
Move assignment out of assertion in cap_mkdb.
PR/32591: JuanRP: Also remove the file we are going to be building to prevent
it from being used as input.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.27.4.1 src/usr.bin/cap_mkdb/cap_mkdb.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/cap_mkdb/cap_mkdb.c
diff -u src/usr.bin/cap_mkdb/cap_mkdb.c:1.27 src/usr.bin/cap_mkdb/cap_mkdb.c:1.27.4.1
--- src/usr.bin/cap_mkdb/cap_mkdb.c:1.27	Mon Aug 29 13:56:17 2011
+++ src/usr.bin/cap_mkdb/cap_mkdb.c	Sun Mar 31 20:39:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: cap_mkdb.c,v 1.27 2011/08/29 13:56:17 joerg Exp $	*/
+/*	$NetBSD: cap_mkdb.c,v 1.27.4.1 2013/03/31 20:39:38 riz Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -40,7 +40,7 @@ __COPYRIGHT(@(#) Copyright (c) 1992, 19
 #if 0
 static char sccsid[] = @(#)cap_mkdb.c	8.2 (Berkeley) 4/27/95;
 #endif
-__RCSID($NetBSD: cap_mkdb.c,v 1.27 2011/08/29 13:56:17 joerg Exp $);
+__RCSID($NetBSD: cap_mkdb.c,v 1.27.4.1 2013/03/31 20:39:38 riz Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -63,7 +63,7 @@ static int	count_records(char **);
 
 static DB *capdbp;
 static int verbose;
-static char *capname, buf[8 * 1024];
+static char *capname, outfile[MAXPATHLEN];
 
 static HASHINFO openinfo = {
 	4096,		/* bsize */
@@ -126,13 +126,17 @@ main(int argc, char *argv[])
 	 * The database file is the first argument if no name is specified.
 	 * Make arrangements to unlink it if exit badly.
 	 */
-	(void)snprintf(buf, sizeof(buf), %s.db.tmp,
+	(void)snprintf(outfile, sizeof(outfile), %s.db.tmp,
 	capname ? capname : *argv);
-	if ((capname = strdup(buf)) == NULL)
+	if ((capname = strdup(outfile)) == NULL)
 		err(1, strdup);
+	p = strrchr(outfile, '.');
+	assert(p != NULL);
+	*p = '\0';
+	(void)unlink(outfile);
 	if ((capdbp = dbopen(capname, O_CREAT | O_TRUNC | O_RDWR,
 	DEFFILEMODE, DB_HASH, openinfo)) == NULL)
-		err(1, %s, buf);
+		err(1, %s, outfile);
 
 	if (atexit(dounlink))
 		err(1, atexit);
@@ -141,9 +145,7 @@ main(int argc, char *argv[])
 
 	if (capdbp-close(capdbp)  0)
 		err(1, %s, capname);
-	assert((p = strrchr(buf, '.')) != NULL);
-	*p = '\0';
-	if (rename(capname, buf) == -1)
+	if (rename(capname, outfile) == -1)
 		err(1, rename);
 	free(capname);
 	capname = NULL;
@@ -154,7 +156,7 @@ static void
 dounlink(void)
 {
 	if (capname != NULL)
-		(void)unlink(capname);
+		unlink(capname);
 }
 
 /*



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

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:52:29 UTC 2013

Modified Files:
src/sys/netinet [netbsd-6]: ip_icmp.c

Log Message:
Pull up following revision(s) (requested by fair in ticket #860):
sys/netinet/ip_icmp.c: revision 1.130
PR/47693: Erik E. Fair: Add missing code to icmp handling.
- While there, add the rest of the missing codes
- Merge groups
- Fix indentation


To generate a diff of this commit:
cvs rdiff -u -r1.128 -r1.128.2.1 src/sys/netinet/ip_icmp.c

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

Modified files:

Index: src/sys/netinet/ip_icmp.c
diff -u src/sys/netinet/ip_icmp.c:1.128 src/sys/netinet/ip_icmp.c:1.128.2.1
--- src/sys/netinet/ip_icmp.c:1.128	Mon Jan  9 14:31:22 2012
+++ src/sys/netinet/ip_icmp.c	Sun Mar 31 20:52:29 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ip_icmp.c,v 1.128 2012/01/09 14:31:22 liamjfoy Exp $	*/
+/*	$NetBSD: ip_icmp.c,v 1.128.2.1 2013/03/31 20:52:29 riz Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -94,7 +94,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ip_icmp.c,v 1.128 2012/01/09 14:31:22 liamjfoy Exp $);
+__KERNEL_RCSID(0, $NetBSD: ip_icmp.c,v 1.128.2.1 2013/03/31 20:52:29 riz Exp $);
 
 #include opt_ipsec.h
 
@@ -457,45 +457,42 @@ icmp_input(struct mbuf *m, ...)
 
 	case ICMP_UNREACH:
 		switch (code) {
-			case ICMP_UNREACH_NET:
-code = PRC_UNREACH_NET;
-break;
-
-			case ICMP_UNREACH_HOST:
-code = PRC_UNREACH_HOST;
-break;
-
-			case ICMP_UNREACH_PROTOCOL:
-code = PRC_UNREACH_PROTOCOL;
-break;
+		case ICMP_UNREACH_PROTOCOL:
+			code = PRC_UNREACH_PROTOCOL;
+			break;
 
-			case ICMP_UNREACH_PORT:
-code = PRC_UNREACH_PORT;
-break;
+		case ICMP_UNREACH_PORT:
+			code = PRC_UNREACH_PORT;
+			break;
 
-			case ICMP_UNREACH_SRCFAIL:
-code = PRC_UNREACH_SRCFAIL;
-break;
+		case ICMP_UNREACH_SRCFAIL:
+			code = PRC_UNREACH_SRCFAIL;
+			break;
 
-			case ICMP_UNREACH_NEEDFRAG:
-code = PRC_MSGSIZE;
-break;
+		case ICMP_UNREACH_NEEDFRAG:
+			code = PRC_MSGSIZE;
+			break;
 
-			case ICMP_UNREACH_NET_UNKNOWN:
-			case ICMP_UNREACH_NET_PROHIB:
-			case ICMP_UNREACH_TOSNET:
-code = PRC_UNREACH_NET;
-break;
+		case ICMP_UNREACH_NET:
+		case ICMP_UNREACH_NET_UNKNOWN:
+		case ICMP_UNREACH_NET_PROHIB:
+		case ICMP_UNREACH_TOSNET:
+			code = PRC_UNREACH_NET;
+			break;
 
-			case ICMP_UNREACH_HOST_UNKNOWN:
-			case ICMP_UNREACH_ISOLATED:
-			case ICMP_UNREACH_HOST_PROHIB:
-			case ICMP_UNREACH_TOSHOST:
-code = PRC_UNREACH_HOST;
-break;
+		case ICMP_UNREACH_HOST:
+		case ICMP_UNREACH_HOST_UNKNOWN:
+		case ICMP_UNREACH_ISOLATED:
+		case ICMP_UNREACH_HOST_PROHIB:
+		case ICMP_UNREACH_TOSHOST:
+		case ICMP_UNREACH_ADMIN_PROHIBIT:
+		case ICMP_UNREACH_HOST_PREC:
+		case ICMP_UNREACH_PREC_CUTOFF:
+			code = PRC_UNREACH_HOST;
+			break;
 
-			default:
-goto badcode;
+		default:
+			goto badcode;
 		}
 		goto deliver;
 



CVS commit: [netbsd-6] src/share/terminfo

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 20:55:54 UTC 2013

Modified Files:
src/share/terminfo [netbsd-6]: terminfo

Log Message:
Pull up following revision(s) (requested by uwe in ticket #861):
share/terminfo/terminfo: revision 1.6
Pull in fix for PR misc/47674 from ncurses:


To generate a diff of this commit:
cvs rdiff -u -r1.4.4.1 -r1.4.4.2 src/share/terminfo/terminfo

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

Modified files:

Index: src/share/terminfo/terminfo
diff -u src/share/terminfo/terminfo:1.4.4.1 src/share/terminfo/terminfo:1.4.4.2
--- src/share/terminfo/terminfo:1.4.4.1	Sun Jun 24 18:04:40 2012
+++ src/share/terminfo/terminfo	Sun Mar 31 20:55:54 2013
@@ -6,8 +6,8 @@
 # Report bugs and new terminal descriptions to
 #	bug-ncur...@gnu.org
 #
-#	$Revision: 1.4.4.1 $
-#	$Date: 2012/06/24 18:04:40 $
+#	$Revision: 1.4.4.2 $
+#	$Date: 2013/03/31 20:55:54 $
 #
 # The original header is preserved below for reference.  It is noted that there
 # is a newer version which differs in some cosmetic details (but actually
@@ -2418,7 +2418,7 @@ vt220|vt200|dec vt220,
 	flash=\E[?5h$200/\E[?5l, home=\E[H, ht=^I, hts=\EH,
 	ich=\E[%p1%d@, if=/usr/share/tabset/vt100,
 	il=\E[%p1%dL, il1=\E[L, ind=\ED,
-	is2=\E[?7h\E[\E[?1h\E F\E[?4l, kbs=^H, kcub1=\E[D,
+	is2=\E[?7h\E[\E[?1l\E F\E[?4l, kbs=^H, kcub1=\E[D,
 	kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf1=\EOP, kf10=\E[21~,
 	kf11=\E[23~, kf12=\E[24~, kf13=\E[25~, kf14=\E[26~,
 	kf17=\E[31~, kf18=\E[32~, kf19=\E[33~, kf2=\EOQ,
@@ -2448,7 +2448,7 @@ vt220-8bit|vt220-8|vt200-8bit|vt200-8|de
 	flash=\233?5h$200/\233?5l, home=\233H, ht=^I, hts=\EH,
 	ich=\233%p1%d@, if=/usr/share/tabset/vt100,
 	il=\233%p1%dL, il1=\233L, ind=\ED,
-	is2=\233?7h\233\233?1h\E F\233?4l, kbs=^H,
+	is2=\233?7h\233\233?1l\E F\233?4l, kbs=^H,
 	kcub1=\233D, kcud1=\233B, kcuf1=\233C, kcuu1=\233A,
 	kf1=\EOP, kf10=\23321~, kf11=\23323~, kf12=\23324~,
 	kf13=\23325~, kf14=\23326~, kf17=\23331~, kf18=\23332~,
@@ -2503,7 +2503,7 @@ vt200-js|vt220-js|dec vt200 series with 
 	cub1=^H, cud1=^J, cuf1=\E[C, cup=\E[%i%p1%d;%p2%dH,
 	cuu1=\E[A, dch1=\E[P, dl1=\E[M, ed=\E[J, el=\E[K, home=\E[H,
 	ht=^I, il1=\E[L, ind=\ED,
-	is2=\E[61p\E[H\E[?3l\E[?4l\E[?1l\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E\E[m,
+	is2=\E[61p\E[H\E[?3l\E[?4l\E[?1h\E[?5l\E[?6l\E[?7h\E[?8h\E[?25h\E\E[m,
 	kbs=^H, kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA,
 	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, nel=^M\ED, rc=\E8,
 	rf=/usr/share/tabset/vt100, ri=\EM, rmdc=, rmir=\E[4l,
@@ -5231,7 +5231,7 @@ news-unk|SONY NEWS vt100 emulator common
 	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, dl=\E[%p1%dM, dl1=\E[M,
 	ed=\E[J, el=\E[K, home=\E[H, ht=^I,
 	if=/usr/share/tabset/vt100, il=\E[%p1%dL, il1=\E[L,
-	is2=\E[?7h\E[?1l\E[?3l\E7\E8, kbs=^H, kcub1=\EOD,
+	is2=\E[?7h\E[?1h\E[?3l\E7\E8, kbs=^H, kcub1=\EOD,
 	kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf0=\EOY, kf1=\EOP,
 	kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\EOT, kf6=\EOU, kf7=\EOV,
 	kf8=\EOW, kf9=\EOX, rc=\E8, rev=\E[7m, ri=\EM,
@@ -5279,7 +5279,7 @@ news-old-unk|SONY NEWS vt100 emulator co
 	cr=^M, csr=\E[%i%p1%d;%p2%dr, cub1=^H, cud1=^J, cuf1=\E[C,
 	cup=\E[%i%p1%d;%p2%dH, cuu1=\E[A, ed=\E[J, el=\E[K,
 	home=\E[H, ht=^I, if=/usr/share/tabset/vt100, kbs=^H,
-	kcub1=\EOD, kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kf1=\EOP,
+	kcub1=\E[D, kcud1=\E[B, kcuf1=\E[C, kcuu1=\E[A, kf1=\EOP,
 	kf2=\EOQ, kf3=\EOR, kf4=\EOS, rc=\E8, rev=\E[7m, ri=\EM,
 	rmkx=\E[?1l\E, rmso=\E[m, rmul=\E[m,
 	rs2=\E\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h, sc=\E7,
@@ -9727,7 +9727,7 @@ vt320-k3|MS-Kermit 3.00's vt320 emulatio
 	flash=\E[?5h\E[?5l\E[?5h\E[?5l\E[?5h\E[?5l,
 	fsl=\E[0$}, home=\E[H, hpa=\E[%i%p1%dG, ht=^I, hts=\EH,
 	ich=\E[%p1%d@, il=\E[%p1%dL, il1=\E[L, ind=^J,
-	is2=\E\E F\E[?1l\E[?7h\E[r\E[2$~, kbs=^H, kcub1=\EOD,
+	is2=\E\E F\E[?1h\E[?7h\E[r\E[2$~, kbs=^H, kcub1=\EOD,
 	kcud1=\EOB, kcuf1=\EOC, kcuu1=\EOA, kdl1=\E[3~, kf0=\E[21~,
 	kf1=\EOP, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf6=\E[17~,
 	kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, kich1=\E[2~, knp=\E[6~,
@@ -22357,4 +22357,8 @@ v3220|LANPAR Vision II model 3220/3221/3
 # 2011-02-20
 #	* add cons25-debian entry (Brian M Carlson, Debina #607662).
 #
+# 2013-03-23
+#	* change initialization for vt220, similar entries for consistency
+#	  with cursor-key strings (NetBSD #47674) -TD
+#
  SHANTIH!  SHANTIH!  SHANTIH!



CVS commit: [netbsd-6] src

2013-03-31 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sun Mar 31 22:24:11 UTC 2013

Modified Files:
src/doc [netbsd-6]: CHANGES-6.1
src/sys/sys [netbsd-6]: param.h

Log Message:
Welcome to 6.1_RC3!


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.116 -r1.1.2.117 src/doc/CHANGES-6.1
cvs rdiff -u -r1.408.2.9 -r1.408.2.10 src/sys/sys/param.h

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.116 src/doc/CHANGES-6.1:1.1.2.117
--- src/doc/CHANGES-6.1:1.1.2.116	Sun Mar 31 17:47:10 2013
+++ src/doc/CHANGES-6.1	Sun Mar 31 22:24:11 2013
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.116 2013/03/31 17:47:10 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.117 2013/03/31 22:24:11 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -8772,3 +8772,52 @@ usr.sbin/npf/npfctl/npfctl.c			1.32
 	Minor npfctl(5) fixes in parsing and error handling.
 	[rmind, ticket #852]
 
+sys/netinet6/udp6_output.c			1.44
+
+	Fix sendto(2) issue with IPv6 UDP datagrams.  PR#47408.
+	[christos, ticket #853]
+
+lib/libc/rpc/clnt_vc.c1.19
+
+	Wrong memcpy() can cause memory corruption.  PR#13082.
+	[christos, ticket #854]
+
+sys/arch/x86/acpi/acpi_machdep.c		1.5-1.6
+sys/arch/x86/x86/mpacpi.c			1.97
+
+	Address ACPI issues on some AMD systems, that were introduced
+	post-6.0. PR#47016, PR#47648.
+	[chs, ticket #855]
+
+sys/arch/x86/x86/intr.c1.75
+
+	Only use db_printf() if we're actually called from DDB.
+	This prevents the boot-time one from pausing the boot process.
+	[chs, ticket #856]
+
+sys/dev/mscp/mscp_subr.c			1.45
+
+	Prevent a crash when accessing any disk devices on the VAX mscp bus.
+	[martin, ticket #857]
+
+usr.bin/cap_mkdb/cap_mkdb.c			1.28-1.29
+
+	Make cap_mkdb work when a db file already existed, rather than
+	repeat the old values.  Fixes bin/32591.
+	[gdt, ticket #858]
+
+sys/netinet/ip_icmp.c1.130
+
+	Add missing codes to ICMP handling.  PR#47693.
+	[fair, ticket #860]
+
+share/terminfo/terminfo1.6
+
+	Fix initialization for vt220.  PR#47674.
+	[uwe, ticket #861]
+
+sys/sys/param.h	patched by hand
+
+	Welcome to 6.1_RC3!
+	[riz]
+

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.408.2.9 src/sys/sys/param.h:1.408.2.10
--- src/sys/sys/param.h:1.408.2.9	Fri Mar 15 23:26:27 2013
+++ src/sys/sys/param.h	Sun Mar 31 22:24:10 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.408.2.9 2013/03/15 23:26:27 riz Exp $	*/
+/*	$NetBSD: param.h,v 1.408.2.10 2013/03/31 22:24:10 riz Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	60100	/* NetBSD 6.1_RC2 */
+#define	__NetBSD_Version__	60100	/* NetBSD 6.1_RC3 */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) = __NetBSD_Version__)



CVS commit: [agc-symver] src

2013-03-31 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sun Mar 31 23:06:44 UTC 2013

Modified Files:
src/external/cddl/osnet/lib/libzpool [agc-symver]: Makefile
src/external/cddl/osnet/sbin/zpool [agc-symver]: Makefile
Added Files:
src/lib/libpthread [agc-symver]: Version.map

Log Message:
add symbol versioning information for libpthread


To generate a diff of this commit:
cvs rdiff -u -r1.6.18.1 -r1.6.18.2 \
src/external/cddl/osnet/lib/libzpool/Makefile
cvs rdiff -u -r1.4.18.1 -r1.4.18.2 \
src/external/cddl/osnet/sbin/zpool/Makefile
cvs rdiff -u -r0 -r1.1.2.1 src/lib/libpthread/Version.map

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/Makefile
diff -u src/external/cddl/osnet/lib/libzpool/Makefile:1.6.18.1 src/external/cddl/osnet/lib/libzpool/Makefile:1.6.18.2
--- src/external/cddl/osnet/lib/libzpool/Makefile:1.6.18.1	Tue Mar 26 01:59:13 2013
+++ src/external/cddl/osnet/lib/libzpool/Makefile	Sun Mar 31 23:06:42 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.6.18.1 2013/03/26 01:59:13 agc Exp $
+#	$NetBSD: Makefile,v 1.6.18.2 2013/03/31 23:06:42 agc Exp $
 
 .include bsd.own.mk
 
@@ -12,9 +12,8 @@
 .PATH: ${.CURDIR}/../../dist/uts/common/os
 
 LIB=		zpool
-DPADD=		${LIBPTHREAD}
-LDADD=		-lpthread
 LIBDPLIBS+=	z		${NETBSDSRCDIR}/lib/libz
+LIBDPLIBS+=	pthread		${NETBSDSRCDIR}/lib/libpthread
 CPPFLAGS+=	-std=c99
 #CPPFLAGS+=-Wall -Wno-unknown-pragmas
 

Index: src/external/cddl/osnet/sbin/zpool/Makefile
diff -u src/external/cddl/osnet/sbin/zpool/Makefile:1.4.18.1 src/external/cddl/osnet/sbin/zpool/Makefile:1.4.18.2
--- src/external/cddl/osnet/sbin/zpool/Makefile:1.4.18.1	Tue Mar 26 01:59:13 2013
+++ src/external/cddl/osnet/sbin/zpool/Makefile	Sun Mar 31 23:06:43 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.4.18.1 2013/03/26 01:59:13 agc Exp $
+#	$NetBSD: Makefile,v 1.4.18.2 2013/03/31 23:06:43 agc Exp $
 
 .include bsd.own.mk
 
@@ -31,9 +31,10 @@ LDADD+= -L${LIBUMEM_OBJDIR} -lum
 LIBZPOOL_OBJDIR!=  cd ${LIBZPOOL_SRCDIR}  ${PRINTOBJDIR}
 LDADD+= -L${LIBZPOOL_OBJDIR} -lzpool
 
-LDADD+= -lm -lutil -lpthread
+LDADD+= -lm -lutil
 
-PROGDPLIBS+= z   ${NETBSDSRCDIR}/lib/libz
+PROGDPLIBS+= z		${NETBSDSRCDIR}/lib/libz
+PROGDPLIBS+= pthread	${NETBSDSRCDIR}/lib/libpthread
 
 .PATH: ${ZFSDIR}/dist/cmd/zpool
 

Added files:

Index: src/lib/libpthread/Version.map
diff -u /dev/null src/lib/libpthread/Version.map:1.1.2.1
--- /dev/null	Sun Mar 31 23:06:44 2013
+++ src/lib/libpthread/Version.map	Sun Mar 31 23:06:43 2013
@@ -0,0 +1,246 @@
+LIBPTHREAD_private_1.1.0.0 {
+};
+
+LIBPTHREAD_1.1.0.0 {
+global:
+	___msync13;
+	___nanosleep50;
+	__aio_suspend50;
+	__kevent50;
+	__libc_cond_broadcast;
+	__libc_cond_destroy;
+	__libc_cond_init;
+	__libc_cond_signal;
+	__libc_cond_timedwait;
+	__libc_cond_wait;
+	__libc_mutex_destroy;
+	__libc_mutex_init;
+	__libc_mutex_lock;
+	__libc_mutex_trylock;
+	__libc_mutex_unlock;
+	__libc_mutexattr_destroy;
+	__libc_mutexattr_init;
+	__libc_mutexattr_settype;
+	__libc_rwlock_destroy;
+	__libc_rwlock_init;
+	__libc_rwlock_rdlock;
+	__libc_rwlock_tryrdlock;
+	__libc_rwlock_trywrlock;
+	__libc_rwlock_unlock;
+	__libc_rwlock_wrlock;
+	__libc_thr_create;
+	__libc_thr_curcpu;
+	__libc_thr_equal;
+	__libc_thr_errno;
+	__libc_thr_exit;
+	__libc_thr_getspecific;
+	__libc_thr_init;
+	__libc_thr_keycreate;
+	__libc_thr_keydelete;
+	__libc_thr_once;
+	__libc_thr_self;
+	__libc_thr_setcancelstate;
+	__libc_thr_setspecific;
+	__libc_thr_sigsetmask;
+	__libc_thr_yield;
+	__mq_timedreceive50;
+	__mq_timedsend50;
+	__msync13;
+	__nanosleep50;
+	__pollts50;
+	__pselect50;
+	__res_get_state;
+	__res_put_state;
+	__res_state;
+	__select50;
+	__sigprocmask14;
+	__sigsuspend14;
+	__sigtimedwait50;
+	__uselibcstub;
+	__wait450;
+	_close;
+	_fcntl;
+	_fdatasync;
+	_fini;
+	_fsync;
+	_fsync_range;
+	_init;
+	_mq_receive;
+	_mq_send;
+	_msgrcv;
+	_msgsnd;
+	_open;
+	_poll;
+	_pread;
+	_pthread_attr_get_np;
+	_pthread_cond_has_waiters_np;
+	_pthread_mutex_held_np;
+	_pthread_mutex_owner_np;
+	_pthread_rwlock_held_np;
+	_pthread_rwlock_rdheld_np;
+	_pthread_rwlock_wrheld_np;
+	_pwrite;
+	_read;
+	_readv;
+	_sigwait;
+	_write;
+	_writev;
+	accept;
+	close;
+	connect;
+	fcntl;
+	fdatasync;
+	fsync;
+	fsync_range;
+	mq_receive;
+	mq_send;
+	msgrcv;
+	msgsnd;
+	open;
+	poll;
+	pread;
+	pthread__allqueue;
+	pthread__alltree_lock;
+	pthread__cancel_stub_binder;
+	pthread__cleanup_pop;
+	pthread__cleanup_push;
+	pthread__concurrency;
+	pthread__dbg;
+	pthread__deadqueue;
+	pthread__deadqueue_lock;
+	pthread__errno;
+	pthread__init;
+	pthread__lock_ops;
+	pthread__lock_ras_end;
+	pthread__lock_ras_start;
+	pthread__nspins;
+	pthread__pagesize;
+	pthread__sched_yield;
+	pthread__stacksize;
+	pthread__started;
+	pthread__static_lib_binder;
+	pthread__tsd_destructors;
+	pthread__tsd_list;
+	pthread__unpark_max;
+	pthread_attr_destroy;
+	

CVS commit: [agc-symver] src/lib/libpthread_dbg

2013-03-31 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Mon Apr  1 03:43:42 UTC 2013

Added Files:
src/lib/libpthread_dbg [agc-symver]: Version.map

Log Message:
add symbol versioning info for libpthread_dbg


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/lib/libpthread_dbg/Version.map

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

Added files:

Index: src/lib/libpthread_dbg/Version.map
diff -u /dev/null src/lib/libpthread_dbg/Version.map:1.1.2.1
--- /dev/null	Mon Apr  1 03:43:42 2013
+++ src/lib/libpthread_dbg/Version.map	Mon Apr  1 03:43:42 2013
@@ -0,0 +1,27 @@
+LIBPTHREAD_DBG_private_2.0.0.0 {
+};
+
+LIBPTHREAD_DBG_2.0.0.0 {
+global:
+	_fini;
+	_init;
+	td_close;
+	td_map_id2thr;
+	td_map_pth2thr;
+	td_open;
+	td_thr_getname;
+	td_thr_getregs;
+	td_thr_info;
+	td_thr_iter;
+	td_thr_resume;
+	td_thr_setregs;
+	td_thr_suspend;
+	td_thr_tsd;
+	td_tsd_iter;
+};
+
+NetBSD_6.99.18.0 {
+local:
+	*;
+} LIBPTHREAD_DBG_2.0.0.0;
+