CVS commit: src/sys/arch

2012-10-17 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Wed Oct 17 14:49:02 UTC 2012

Modified Files:
src/sys/arch/mac68k/conf: SMALLRAM
src/sys/arch/zaurus/conf: INSTALL

Log Message:
Add no options COMPAT_60 to all kernel configuration files
that already had no options COMPAT_50.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/mac68k/conf/SMALLRAM
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/zaurus/conf/INSTALL

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/mac68k/conf/SMALLRAM
diff -u src/sys/arch/mac68k/conf/SMALLRAM:1.39 src/sys/arch/mac68k/conf/SMALLRAM:1.40
--- src/sys/arch/mac68k/conf/SMALLRAM:1.39	Mon Oct  3 19:22:59 2011
+++ src/sys/arch/mac68k/conf/SMALLRAM	Wed Oct 17 14:48:41 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: SMALLRAM,v 1.39 2011/10/03 19:22:59 hauke Exp $
+#	$NetBSD: SMALLRAM,v 1.40 2012/10/17 14:48:41 apb Exp $
 #
 # This is an example of how to configure a small, efficient kernel for
 # a system with limited RAM. Even so it's capable of doing quite a
@@ -42,6 +42,7 @@ no options 	COMPAT_30
 no options 	COMPAT_40
 no options 	COMPAT_43
 no options 	COMPAT_50
+no options 	COMPAT_60
 
 no options 	COMPAT_AOUT_M68K
 no options 	EXEC_AOUT

Index: src/sys/arch/zaurus/conf/INSTALL
diff -u src/sys/arch/zaurus/conf/INSTALL:1.17 src/sys/arch/zaurus/conf/INSTALL:1.18
--- src/sys/arch/zaurus/conf/INSTALL:1.17	Fri Aug 17 20:11:41 2012
+++ src/sys/arch/zaurus/conf/INSTALL	Wed Oct 17 14:49:02 2012
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.17 2012/08/17 20:11:41 abs Exp $
+# $NetBSD: INSTALL,v 1.18 2012/10/17 14:49:02 apb Exp $
 #
 # INSTALL config file (GENERIC with memory disk root)
 #
@@ -40,6 +40,7 @@ no options		COMPAT_20
 no options		COMPAT_30
 no options		COMPAT_40
 no options		COMPAT_50
+no options		COMPAT_60
 no options		COMPAT_43
 
 no options 		COMPAT_OSSAUDIO



CVS commit: src/sys/arch

2012-10-17 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Wed Oct 17 14:49:41 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: RPI
src/sys/arch/hp300/conf: INSTALL
src/sys/arch/luna68k/conf: INSTALL
src/sys/arch/news68k/conf: INSTALL

Log Message:
Add commented out #options COMPAT_60 to all kernel configuration files
that already had commented out #options COMPAT_50.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/evbarm/conf/RPI
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/hp300/conf/INSTALL
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/luna68k/conf/INSTALL
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/news68k/conf/INSTALL

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/evbarm/conf/RPI
diff -u src/sys/arch/evbarm/conf/RPI:1.9 src/sys/arch/evbarm/conf/RPI:1.10
--- src/sys/arch/evbarm/conf/RPI:1.9	Wed Oct  3 20:54:23 2012
+++ src/sys/arch/evbarm/conf/RPI	Wed Oct 17 14:49:40 2012
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: RPI,v 1.9 2012/10/03 20:54:23 skrll Exp $
+#	$NetBSD: RPI,v 1.10 2012/10/17 14:49:40 apb Exp $
 #
 #	RPi -- Raspberry Pi
 #
@@ -89,6 +89,7 @@ options		NFS_BOOT_RWSIZE=1024
 # Compatibility options
 
 #options 	COMPAT_43	# 4.3BSD compatibility.
+#options 	COMPAT_60	# NetBSD 6.0 compatibility.
 #options 	COMPAT_50	# NetBSD 5.0 compatibility.
 #options 	COMPAT_40	# NetBSD 4.0 compatibility.
 #options 	COMPAT_30	# NetBSD 3.0 compatibility.

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.49 src/sys/arch/hp300/conf/INSTALL:1.50
--- src/sys/arch/hp300/conf/INSTALL:1.49	Fri Aug 17 20:11:39 2012
+++ src/sys/arch/hp300/conf/INSTALL	Wed Oct 17 14:49:41 2012
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.49 2012/08/17 20:11:39 abs Exp $
+# $NetBSD: INSTALL,v 1.50 2012/10/17 14:49:41 apb Exp $
 #
 # INSTALL machine description file
 #
@@ -56,6 +56,7 @@ maxusers	32
 #options 	COMPAT_30	# compatibility with NetBSD 3.0
 #options 	COMPAT_40	# compatibility with NetBSD 4.0
 #options 	COMPAT_50	# compatibility with NetBSD 5.0
+#options 	COMPAT_60	# NetBSD 6.0 compatibility.
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 #options 	SYSVSHM		# System V-style shared memory

Index: src/sys/arch/luna68k/conf/INSTALL
diff -u src/sys/arch/luna68k/conf/INSTALL:1.7 src/sys/arch/luna68k/conf/INSTALL:1.8
--- src/sys/arch/luna68k/conf/INSTALL:1.7	Fri Aug 17 20:11:40 2012
+++ src/sys/arch/luna68k/conf/INSTALL	Wed Oct 17 14:49:41 2012
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.7 2012/08/17 20:11:40 abs Exp $
+# $NetBSD: INSTALL,v 1.8 2012/10/17 14:49:41 apb Exp $
 #
 # config for installation ramdisk kernel
 # 
@@ -54,6 +54,7 @@ options 	PIPE_SOCKETPAIR		# smaller, but
 #options 	COMPAT_30	# NetBSD 3.0 compatibility.
 #options 	COMPAT_40	# NetBSD 4.0 compatibility.
 #options 	COMPAT_50	# NetBSD 5.0 compatibility.
+#options 	COMPAT_60	# NetBSD 6.0 compatibility.
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.
 #options 	COMPAT_AOUT_M68K # support for NetBSD a.out executables
 #options 	EXEC_AOUT	# support for a.out executables

Index: src/sys/arch/news68k/conf/INSTALL
diff -u src/sys/arch/news68k/conf/INSTALL:1.56 src/sys/arch/news68k/conf/INSTALL:1.57
--- src/sys/arch/news68k/conf/INSTALL:1.56	Sun Dec 18 05:49:30 2011
+++ src/sys/arch/news68k/conf/INSTALL	Wed Oct 17 14:49:41 2012
@@ -1,4 +1,4 @@
-# 	$NetBSD: INSTALL,v 1.56 2011/12/18 05:49:30 dholland Exp $
+# 	$NetBSD: INSTALL,v 1.57 2012/10/17 14:49:41 apb Exp $
 
 #	config for bootable floppy kernel
 #
@@ -47,6 +47,7 @@ options 	PIPE_SOCKETPAIR		# smaller, but
 #options 	COMPAT_30		# NetBSD 3.0 binary compatibility.
 #options 	COMPAT_40		# NetBSD 4.0 binary compatibility.
 #options 	COMPAT_50		# NetBSD 5.0 binary compatibility.
+#options 	COMPAT_60		# NetBSD 6.0 compatibility.
 options 	COMPAT_BSDPTY		# /dev/[pt]ty?? ptys.
 
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.



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

2012-10-17 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Oct 17 16:13:01 UTC 2012

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

Log Message:
recognize the P1GB and RDTSCP which were AMD-only on Intel HW too


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/x86/include/specialreg.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/specialreg.h
diff -u src/sys/arch/x86/include/specialreg.h:1.59 src/sys/arch/x86/include/specialreg.h:1.60
--- src/sys/arch/x86/include/specialreg.h:1.59	Sat May  5 15:08:29 2012
+++ src/sys/arch/x86/include/specialreg.h	Wed Oct 17 16:13:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: specialreg.h,v 1.59 2012/05/05 15:08:29 jym Exp $	*/
+/*	$NetBSD: specialreg.h,v 1.60 2012/10/17 16:13:01 drochner Exp $	*/
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -157,9 +157,12 @@
 /* Intel Fn8001 extended features - %edx */
 #define CPUID_SYSCALL	0x0800	/* SYSCALL/SYSRET */
 #define CPUID_XD	0x0010	/* Execute Disable (like CPUID_NOX) */
+#define	CPUID_P1GB	0x0400	/* 1GB Large Page Support */
+#define	CPUID_RDTSCP	0x0800	/* Read TSC Pair Instruction */
 #define CPUID_EM64T	0x2000	/* Intel EM64T */
 
-#define CPUID_INTEL_EXT_FLAGS	\20\14SYSCALL/SYSRET\25XD\36EM64T
+#define CPUID_INTEL_EXT_FLAGS	\20\14SYSCALL/SYSRET\25XD\33P1GB\34RDTSCP \
+\36EM64T
 
 /* Intel Fn8001 extended features - %ecx */
 #define	CPUID_LAHF	0x0001	/* LAHF/SAHF in IA-32e mode, 64bit sub*/
@@ -173,8 +176,8 @@
 #define CPUID_NOX	0x0010	/* No Execute Page Protection */
 #define CPUID_MMXX	0x0040	/* AMD MMX Extensions */
 #define CPUID_FFXSR	0x0200	/* FXSAVE/FXSTOR Extensions */
-#define CPUID_P1GB	0x0400	/* 1GB Large Page Support */
-#define CPUID_RDTSCP	0x0800	/* Read TSC Pair Instruction */
+/*	CPUID_P1GB			   1GB Large Page Support */
+/*	CPUID_RDTSCP			   Read TSC Pair Instruction */
 /*	CPUID_EM64T			   Long mode */
 #define CPUID_3DNOW2	0x4000	/* 3DNow! Instruction Extension */
 #define CPUID_3DNOW	0x8000	/* 3DNow! Instructions */



CVS commit: src/sys/arch/arm/arm32

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 16:16:24 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
When setting pmap_needs_pte_sync to 1 be sure to sync pte that caused
the issue.


To generate a diff of this commit:
cvs rdiff -u -r1.238 -r1.239 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.238 src/sys/arch/arm/arm32/pmap.c:1.239
--- src/sys/arch/arm/arm32/pmap.c:1.238	Wed Sep 26 18:18:08 2012
+++ src/sys/arch/arm/arm32/pmap.c	Wed Oct 17 16:16:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.238 2012/09/26 18:18:08 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.239 2012/10/17 16:16:23 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include arm/cpuconf.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.238 2012/09/26 18:18:08 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.239 2012/10/17 16:16:23 matt Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -4009,6 +4009,7 @@ pmap_fault_fixup(pmap_t pm, vaddr_t va, 
 	 */
 	if (rv == 0  pm-pm_l1-l1_domain_use_count == 1
 	 pmap_needs_pte_sync == 0) {
+		PTE_SYNC(ptep);
 		pmap_needs_pte_sync = 1;
 		rv = 1;
 	}



CVS commit: src/sys/dev/usb

2012-10-17 Thread Michael van Elst
Module Name:src
Committed By:   mlelstv
Date:   Wed Oct 17 17:05:16 UTC 2012

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

Log Message:
Don't rely on TS_BUSY to determine wether there is a buffer
available. Instead handle a possible buffer shortage.
Also aquire lock when modifying t_state.


To generate a diff of this commit:
cvs rdiff -u -r1.99 -r1.100 src/sys/dev/usb/ucom.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/ucom.c
diff -u src/sys/dev/usb/ucom.c:1.99 src/sys/dev/usb/ucom.c:1.100
--- src/sys/dev/usb/ucom.c:1.99	Tue Mar  6 03:35:29 2012
+++ src/sys/dev/usb/ucom.c	Wed Oct 17 17:05:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ucom.c,v 1.99 2012/03/06 03:35:29 mrg Exp $	*/
+/*	$NetBSD: ucom.c,v 1.100 2012/10/17 17:05:15 mlelstv Exp $	*/
 
 /*
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.99 2012/03/06 03:35:29 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ucom.c,v 1.100 2012/10/17 17:05:15 mlelstv Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -1002,7 +1002,10 @@ ucomstart(struct tty *tp)
 		goto out;
 
 	ub = SIMPLEQ_FIRST(sc-sc_obuff_free);
-	KASSERT(ub != NULL);
+	if (ub == NULL) {
+		SET(tp-t_state, TS_BUSY);
+		goto out;
+	}
 	SIMPLEQ_REMOVE_HEAD(sc-sc_obuff_free, ub_link);
 
 	if (SIMPLEQ_FIRST(sc-sc_obuff_free) == NULL)
@@ -1070,11 +1073,13 @@ ucom_write_status(struct ucom_softc *sc,
 		SIMPLEQ_INSERT_TAIL(sc-sc_obuff_free, ub, ub_link);
 		cc -= sc-sc_opkthdrlen;
 
+		mutex_spin_enter(tty_lock);
 		CLR(tp-t_state, TS_BUSY);
 		if (ISSET(tp-t_state, TS_FLUSH))
 			CLR(tp-t_state, TS_FLUSH);
 		else
 			ndflush(tp-t_outq, cc);
+		mutex_spin_exit(tty_lock);
 
 		if (err != USBD_CANCELLED  err != USBD_IOERROR 
 		!sc-sc_dying) {



CVS commit: src/sys/sys

2012-10-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 17 17:48:48 UTC 2012

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

Log Message:
Correct spelling: entrie - entry.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/sys/module.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/module.h
diff -u src/sys/sys/module.h:1.31 src/sys/sys/module.h:1.32
--- src/sys/sys/module.h:1.31	Tue Aug  7 01:19:06 2012
+++ src/sys/sys/module.h	Wed Oct 17 17:48:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: module.h,v 1.31 2012/08/07 01:19:06 jnemeth Exp $	*/
+/*	$NetBSD: module.h,v 1.32 2012/10/17 17:48:48 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -89,7 +89,7 @@ typedef struct module {
 	modsrc_t		mod_source;
 	time_t			mod_autotime;
 	void 			*mod_ctf;
-	u_int			mod_fbtentries;	/* DTrace FBT entrie count */
+	u_int			mod_fbtentries;	/* DTrace FBT entry count */
 	int			mod_flags;
 #define MODFLG_MUST_FORCE	0x01
 #define MODFLG_AUTO_LOADED	0x02



CVS commit: src/sys/dev/marvell

2012-10-17 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Wed Oct 17 18:13:00 UTC 2012

Modified Files:
src/sys/dev/marvell: if_mvgbe.c

Log Message:
Fix a bug that kernel panics when the system get a packet while calling
mvgbe_stop (via ifconfig down).


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/dev/marvell/if_mvgbe.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/marvell/if_mvgbe.c
diff -u src/sys/dev/marvell/if_mvgbe.c:1.25 src/sys/dev/marvell/if_mvgbe.c:1.26
--- src/sys/dev/marvell/if_mvgbe.c:1.25	Tue Oct 16 19:49:41 2012
+++ src/sys/dev/marvell/if_mvgbe.c	Wed Oct 17 18:12:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mvgbe.c,v 1.25 2012/10/16 19:49:41 msaitoh Exp $	*/
+/*	$NetBSD: if_mvgbe.c,v 1.26 2012/10/17 18:12:59 msaitoh Exp $	*/
 /*
  * Copyright (c) 2007, 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mvgbe.c,v 1.25 2012/10/16 19:49:41 msaitoh Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mvgbe.c,v 1.26 2012/10/17 18:12:59 msaitoh Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -885,6 +885,9 @@ mvgbe_intr(void *arg)
 
 		claimed = 1;
 
+		if (!(ifp-if_flags  IFF_RUNNING))
+			break;
+
 		if (ice  MVGBE_ICE_LINKCHG) {
 			if (MVGBE_READ(sc, MVGBE_PS)  MVGBE_PS_LINKUP) {
 /* Enable port RX and TX. */
@@ -1127,6 +1130,7 @@ static void
 mvgbe_stop(struct ifnet *ifp, int disable)
 {
 	struct mvgbe_softc *sc = ifp-if_softc;
+	struct mvgbec_softc *csc = device_private(device_parent(sc-sc_dev));
 	struct mvgbe_chain_data *cdata = sc-sc_cdata;
 	uint32_t reg;
 	int i, cnt;
@@ -1199,7 +1203,16 @@ mvgbe_stop(struct ifnet *ifp, int disabl
 	reg = MVGBE_READ(sc, MVGBE_PSC);
 	MVGBE_WRITE(sc, MVGBE_PSC, reg  ~MVGBE_PSC_PORTEN);
 
-	/* Disable interrupts */
+	/*
+	 * Disable and clear interrupts
+	 * 0) controller interrupt
+	 * 1) port interrupt cause
+	 * 2) port interrupt mask
+	 */
+	MVGBE_WRITE(csc, MVGBE_EUIM, 0);
+	MVGBE_WRITE(csc, MVGBE_EUIC, 0);
+	MVGBE_WRITE(sc, MVGBE_IC, 0);
+	MVGBE_WRITE(sc, MVGBE_ICE, 0);
 	MVGBE_WRITE(sc, MVGBE_PIM, 0);
 	MVGBE_WRITE(sc, MVGBE_PEIM, 0);
 



CVS commit: src/sys/arch/arm/arm32

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 18:29:10 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: pmap.c

Log Message:
Need to set pmap_needs_pte_sync before calling PTE_SYNC


To generate a diff of this commit:
cvs rdiff -u -r1.239 -r1.240 src/sys/arch/arm/arm32/pmap.c

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.239 src/sys/arch/arm/arm32/pmap.c:1.240
--- src/sys/arch/arm/arm32/pmap.c:1.239	Wed Oct 17 16:16:23 2012
+++ src/sys/arch/arm/arm32/pmap.c	Wed Oct 17 18:29:10 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.239 2012/10/17 16:16:23 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.240 2012/10/17 18:29:10 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include arm/cpuconf.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.239 2012/10/17 16:16:23 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.240 2012/10/17 18:29:10 matt Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -4009,8 +4009,8 @@ pmap_fault_fixup(pmap_t pm, vaddr_t va, 
 	 */
 	if (rv == 0  pm-pm_l1-l1_domain_use_count == 1
 	 pmap_needs_pte_sync == 0) {
-		PTE_SYNC(ptep);
 		pmap_needs_pte_sync = 1;
+		PTE_SYNC(ptep);
 		rv = 1;
 	}
 



CVS commit: src/usr.bin/calendar/calendars

2012-10-17 Thread John Nemeth
Module Name:src
Committed By:   jnemeth
Date:   Wed Oct 17 18:30:33 UTC 2012

Modified Files:
src/usr.bin/calendar/calendars: calendar.netbsd

Log Message:
note NetBSD 6.0 release


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.21 src/usr.bin/calendar/calendars/calendar.netbsd:1.22
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.21	Sat May  5 01:29:56 2012
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Wed Oct 17 18:30:33 2012
@@ -77,6 +77,7 @@
 10/14	NetBSD 4.0.1 released, 2008
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 10/31	NetBSD 2.0.3 released, 2005



CVS commit: src/sys/arch/arm

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 18:52:16 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: pmap.c
src/sys/arch/arm/conf: files.arm
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add a PMAP_NEEDS_ALLOC_POOLPAGE / PMAP_ALLOC_POOLPAGE hook so systems can
allocate pool pages from a specific VM freelist.


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/arm/include/arm32/pmap.h

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

Modified files:

Index: src/sys/arch/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.240 src/sys/arch/arm/arm32/pmap.c:1.241
--- src/sys/arch/arm/arm32/pmap.c:1.240	Wed Oct 17 18:29:10 2012
+++ src/sys/arch/arm/arm32/pmap.c	Wed Oct 17 18:52:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.c,v 1.240 2012/10/17 18:29:10 matt Exp $	*/
+/*	$NetBSD: pmap.c,v 1.241 2012/10/17 18:52:15 matt Exp $	*/
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include arm/cpuconf.h
 #include arm/arm32/katelib.h
 
-__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.240 2012/10/17 18:29:10 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap.c,v 1.241 2012/10/17 18:52:15 matt Exp $);
 
 #ifdef PMAP_DEBUG
 
@@ -257,6 +257,9 @@ int pmapdebug = 0; 
  */
 static struct pmap	kernel_pmap_store;
 struct pmap		*const kernel_pmap_ptr = kernel_pmap_store;
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+int			arm_poolpage_vmfreelist = VM_FREELIST_DEFAULT;
+#endif
 
 /*
  * Which pmap is currently 'live' in the cache
@@ -6853,3 +6856,19 @@ SYSCTL_SETUP(sysctl_machdep_pmap_setup, 
 			NULL, 0, pmap_kmpages, 0,
 			CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 }
+
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+struct vm_page *
+arm_pmap_alloc_poolpage(int flags)
+{
+	/*
+	 * On some systems, only some pages may be coherent for dma and we
+	 * want to use those for pool pages (think mbufs).
+	 */
+	if (arm_poolpage_vmfreelist != VM_FREELIST_DEFAULT)
+		return uvm_pagealloc_strat(NULL, 0, NULL, flags,
+		UVM_PGA_STRAT_ONLY, arm_poolpage_vmfreelist);
+
+	return uvm_pagealloc(NULL, 0, NULL, flags);
+}
+#endif

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.111 src/sys/arch/arm/conf/files.arm:1.112
--- src/sys/arch/arm/conf/files.arm:1.111	Tue Sep 18 05:09:47 2012
+++ src/sys/arch/arm/conf/files.arm	Wed Oct 17 18:52:16 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.arm,v 1.111 2012/09/18 05:09:47 matt Exp $
+#	$NetBSD: files.arm,v 1.112 2012/10/17 18:52:16 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflagARM32
@@ -61,7 +61,7 @@ defflagPMAP_DEBUG
 
 # New PMAP options
 defflag	opt_arm32_pmap.h	ARM32_NEW_VM_LAYOUT PMAPCOUNTERS
-PMAP_STEAL_MEMORY
+PMAP_STEAL_MEMORY PMAP_NEED_ALLOC_POOLPAGE
 
 # MI console support
 file	dev/cons.c

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.112 src/sys/arch/arm/include/arm32/pmap.h:1.113
--- src/sys/arch/arm/include/arm32/pmap.h:1.112	Sat Sep 22 00:33:38 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Oct 17 18:52:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.112 2012/09/22 00:33:38 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.113 2012/10/17 18:52:15 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -269,6 +269,7 @@ extern pv_addr_t kernel_l1pt;
  * Commonly referenced structures
  */
 extern int		pmap_debug_level; /* Only exists if PMAP_DEBUG */
+extern int		arm_poolpage_vmfreelist;
 
 /*
  * Macros that we need to export
@@ -885,6 +886,10 @@ extern void (*pmap_zero_page_func)(paddr
  * Hooks for the pool allocator.
  */
 #define	POOL_VTOPHYS(va)	vtophys((vaddr_t) (va))
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+#define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
+struct vm_page *arm_pmap_alloc_poolpage(int);
+#endif
 
 #ifndef _LOCORE
 



CVS commit: src/sys/arch/arm/arm32

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 18:53:45 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: arm32_boot.c

Log Message:
Change the semantics of the boot_physmem array to select a freelist to use
with uvm_page_physload.  Reduces duplication of work.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/arm32/arm32_boot.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/arm/arm32/arm32_boot.c
diff -u src/sys/arch/arm/arm32/arm32_boot.c:1.1 src/sys/arch/arm/arm32/arm32_boot.c:1.2
--- src/sys/arch/arm/arm32/arm32_boot.c:1.1	Fri Aug 31 23:59:51 2012
+++ src/sys/arch/arm/arm32/arm32_boot.c	Wed Oct 17 18:53:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_boot.c,v 1.1 2012/08/31 23:59:51 matt Exp $	*/
+/*	$NetBSD: arm32_boot.c,v 1.2 2012/10/17 18:53:45 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -123,7 +123,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.1 2012/08/31 23:59:51 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: arm32_boot.c,v 1.2 2012/10/17 18:53:45 matt Exp $);
 
 #include sys/param.h
 #include sys/reboot.h
@@ -215,27 +215,42 @@ initarm_common(vaddr_t kvm_base, vsize_t
 #ifdef VERBOSE_INIT_ARM
 	printf(pmap_physload );
 #endif
+	KASSERT(bp != NULL || nbp == 0);
+	KASSERT(bp == NULL || nbp != 0);
 
-	if (bp == NULL) {
-		KASSERT(nbp == 0);
-		for (size_t i = 0; i  bmi-bmi_nfreeblocks; i++) {
-			pv_addr_t * const pv = bmi-bmi_freeblocks[i];
-			const paddr_t start = atop(pv-pv_pa);
-			const paddr_t end = start + atop(pv-pv_size);
-
-			uvm_page_physload(start, end, start, end,
-			VM_FREELIST_DEFAULT);
-		}
-	}
-
-	for (; nbp--  0; bp++) {
-		const paddr_t start = bp-bp_start;
-		const paddr_t end = start + bp-bp_pages;
-
-		if (start  end) {
-			KASSERT(bp-bp_freelist  VM_NFREELIST);
-			uvm_page_physload(start, end, start, end,
-			bp-bp_freelist);
+	for (size_t i = 0; i  bmi-bmi_nfreeblocks; i++) {
+		pv_addr_t * const pv = bmi-bmi_freeblocks[i];
+		paddr_t start = atop(pv-pv_pa);
+		const paddr_t end = start + atop(pv-pv_size);
+
+		while (start  end) {
+			int vm_freelist = VM_FREELIST_DEFAULT;
+			paddr_t segend = end;
+			/*
+			 * This assumes the bp list is sorted in ascending
+			 * order.
+			 */
+			for (size_t j = 0; j  nbp; j++) {
+paddr_t bp_start = bp[j].bp_start;
+paddr_t bp_end = bp_start + bp[j].bp_pages;
+if (start  bp_start) {
+	if (segend  bp_start) {
+		segend = bp_start;
+	}
+	break;
+}
+if (start  bp_end) {
+	if (segend  bp_end) {
+		segend = bp_end;
+	}
+	vm_freelist = bp[j].bp_freelist;
+	break;
+}
+			}
+	
+			uvm_page_physload(start, segend, start, segend,
+			vm_freelist);
+			start = segend;
 		}
 	}
 



CVS commit: src/sys/arch/arm/arm

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 18:55:43 UTC 2012

Modified Files:
src/sys/arch/arm/arm: cpufunc_asm_armv7.S

Log Message:
Add a few more DSBs before flushing cache lines.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/arm/cpufunc_asm_armv7.S

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

Modified files:

Index: src/sys/arch/arm/arm/cpufunc_asm_armv7.S
diff -u src/sys/arch/arm/arm/cpufunc_asm_armv7.S:1.7 src/sys/arch/arm/arm/cpufunc_asm_armv7.S:1.8
--- src/sys/arch/arm/arm/cpufunc_asm_armv7.S:1.7	Sun Oct  7 18:47:07 2012
+++ src/sys/arch/arm/arm/cpufunc_asm_armv7.S	Wed Oct 17 18:55:43 2012
@@ -139,6 +139,7 @@ ENTRY(armv7_dcache_wb_range)
 	and	r3, r0, ip		@ get offset into cache line
 	add	r1, r1, r3		@ add to length
 	bic	r0, r0, ip		@ clear offset from start.
+	dsb
 1:
 	mcr	p15, 0, r0, c7, c10, 1	@ wb the D-Cache to PoC
 	add	r0, r0, r2
@@ -158,6 +159,7 @@ ENTRY(armv7_dcache_wbinv_range)
 	and	r3, r0, ip		@ get offset into cache line
 	add	r1, r1, r3		@ add to length
 	bic	r0, r0, ip		@ clear offset from start.
+	dsb
 1:
 	mcr	p15, 0, r0, c7, c14, 1	@ wb and inv the D-Cache line
 	add	r0, r0, r2
@@ -198,6 +200,7 @@ ENTRY(armv7_idcache_wbinv_range)
 	and	r3, r0, ip		@ get offset into cache line
 	add	r1, r1, r3		@ add to length
 	bic	r0, r0, ip		@ clear offset from start.
+	dsb
 1:
 	mcr	p15, 0, r0, c7, c5, 1	@ invalidate the I-Cache line
 	mcr	p15, 0, r0, c7, c14, 1 	@ wb and inv the D-Cache line



CVS commit: src/sys/arch/arm/include/arm32

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:15:41 UTC 2012

Modified Files:
src/sys/arch/arm/include/arm32: pmap.h

Log Message:
Add PMAP_MAP_POOLPAGE / PMAP_UNMAP_POOLPAGE if PMAP_NEED_ALLOC_POOLPAGE is
defined.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.114 src/sys/arch/arm/include/arm32/pmap.h

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

Modified files:

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.113 src/sys/arch/arm/include/arm32/pmap.h:1.114
--- src/sys/arch/arm/include/arm32/pmap.h:1.113	Wed Oct 17 18:52:15 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Oct 17 20:15:41 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.113 2012/10/17 18:52:15 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.114 2012/10/17 20:15:41 matt Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -887,8 +887,13 @@ extern void (*pmap_zero_page_func)(paddr
  */
 #define	POOL_VTOPHYS(va)	vtophys((vaddr_t) (va))
 #ifdef PMAP_NEED_ALLOC_POOLPAGE
-#define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
+extern paddr_t physical_start;
 struct vm_page *arm_pmap_alloc_poolpage(int);
+#define	PMAP_ALLOC_POOLPAGE	arm_pmap_alloc_poolpage
+#define	PMAP_MAP_POOLPAGE(pa) \
+((vaddr_t)((paddr_t)(pa) - physical_start + KERNEL_BASE))
+#define PMAP_UNMAP_POOLPAGE(va) \
+((paddr_t)((vaddr_t)(va) - KERNEL_BASE + physical_start))
 #endif
 
 #ifndef _LOCORE



CVS commit: src/sys/conf

2012-10-17 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Oct 17 20:16:59 UTC 2012

Modified Files:
src/sys/conf: files

Log Message:
defopt COMPAT_60, it is already being used


To generate a diff of this commit:
cvs rdiff -u -r1.1058 -r1.1059 src/sys/conf/files

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

Modified files:

Index: src/sys/conf/files
diff -u src/sys/conf/files:1.1058 src/sys/conf/files:1.1059
--- src/sys/conf/files:1.1058	Thu Sep 27 18:28:56 2012
+++ src/sys/conf/files	Wed Oct 17 20:16:59 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files,v 1.1058 2012/09/27 18:28:56 alnsn Exp $
+#	$NetBSD: files,v 1.1059 2012/10/17 20:16:59 drochner Exp $
 #	@(#)files.newconf	7.5 (Berkeley) 5/10/93
 
 version 	20100430
@@ -119,7 +119,8 @@ defparam opt_wapbl.h		WAPBL_DEBUG_PRINT
 # compatibility options
 #
 defflag opt_compat_netbsd.h	COMPAT_NETBSD
-defflag	opt_compat_netbsd.h	COMPAT_50: COMPAT_NETBSD
+defflag	opt_compat_netbsd.h	COMPAT_60: COMPAT_NETBSD
+defflag	opt_compat_netbsd.h	COMPAT_50: COMPAT_60, COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_40: COMPAT_50, COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_30: COMPAT_40, COMPAT_NETBSD
 defflag	opt_compat_netbsd.h	COMPAT_20: COMPAT_30, COMPAT_NETBSD



CVS commit: src/sys/arch/arm

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:17:19 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: bus_dma.c
src/sys/arch/arm/include: bus_defs.h

Log Message:
Add per-segment and per-ragne flag (to store _BUS_DMAMAP_COHERENT).
Use the per-range flag to set the per-segment flag.
This allows bus_dma to skip flushing for known coherent memory regions.


To generate a diff of this commit:
cvs rdiff -u -r1.60 -r1.61 src/sys/arch/arm/arm32/bus_dma.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/arm/include/bus_defs.h

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

Modified files:

Index: src/sys/arch/arm/arm32/bus_dma.c
diff -u src/sys/arch/arm/arm32/bus_dma.c:1.60 src/sys/arch/arm/arm32/bus_dma.c:1.61
--- src/sys/arch/arm/arm32/bus_dma.c:1.60	Sat Oct  6 02:58:39 2012
+++ src/sys/arch/arm/arm32/bus_dma.c	Wed Oct 17 20:17:18 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.60 2012/10/06 02:58:39 matt Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.61 2012/10/17 20:17:18 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define _ARM32_BUS_DMA_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.60 2012/10/06 02:58:39 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.61 2012/10/17 20:17:18 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -139,7 +139,7 @@ _bus_dma_busaddr_to_paddr(bus_dma_tag_t 
  */
 static int
 _bus_dmamap_load_paddr(bus_dma_tag_t t, bus_dmamap_t map,
-bus_addr_t paddr, bus_size_t size)
+bus_addr_t paddr, bus_size_t size, bool coherent)
 {
 	bus_dma_segment_t * const segs = map-dm_segs;
 	int nseg = map-dm_nsegs;
@@ -147,6 +147,7 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 	bus_addr_t bmask = ~(map-_dm_boundary - 1);
 	bus_addr_t curaddr;
 	bus_size_t sgsize;
+	uint32_t _ds_flags = coherent ? _BUS_DMAMAP_COHERENT : 0;
 
 	if (nseg  0)
 		lastaddr = segs[nseg-1].ds_addr + segs[nseg-1].ds_len;
@@ -163,7 +164,16 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 		_bus_dma_paddr_inrange(t-_ranges, t-_nranges, paddr);
 		if (dr == NULL)
 			return (EINVAL);
-		
+
+		/*
+		 * If this region is coherent, mark the segment as coherent.
+		 */
+		_ds_flags |= dr-dr_flags  _BUS_DMAMAP_COHERENT;
+#if 0
+		printf(%p: %#lx: range %#lx/%#lx/%#lx/%#x: %#x\n,
+		t, paddr, dr-dr_sysbase, dr-dr_busbase,
+		dr-dr_len, dr-dr_flags, _ds_flags);
+#endif
 		/*
 		 * In a valid DMA range.  Translate the physical
 		 * memory address to an address in the DMA window.
@@ -189,6 +199,7 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 	 */
 	if (nseg  0  curaddr == lastaddr 
 	segs[nseg-1].ds_len + sgsize = map-dm_maxsegsz 
+	((segs[nseg-1]._ds_flags ^ _ds_flags)  _BUS_DMAMAP_COHERENT) == 0 
 	(map-_dm_boundary == 0 ||
 	 (segs[nseg-1].ds_addr  bmask) == (curaddr  bmask))) {
 	 	/* coalesce */
@@ -199,6 +210,7 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 		/* new segment */
 		segs[nseg].ds_addr = curaddr;
 		segs[nseg].ds_len = sgsize;
+		segs[nseg]._ds_flags = _ds_flags;
 		nseg++;
 	}
 
@@ -208,7 +220,8 @@ _bus_dmamap_load_paddr(bus_dma_tag_t t, 
 	size -= sgsize;
 	if (size  0)
 		goto again;
-	
+
+	map-_dm_flags = (_ds_flags  _BUS_DMAMAP_COHERENT);
 	map-dm_nsegs = nseg;
 	return (0);
 }
@@ -511,11 +524,8 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 	if (m0-m_pkthdr.len  map-_dm_size)
 		return (EINVAL);
 
-	/*
-	 * Mbuf chains should almost never have coherent (i.e.
-	 * un-cached) mappings, so clear that flag now.
-	 */
-	map-_dm_flags = ~_BUS_DMAMAP_COHERENT;
+	/* _bus_dmamap_load_paddr() clears this if we're not... */
+	map-_dm_flags |= _BUS_DMAMAP_COHERENT;
 
 	error = 0;
 	for (m = m0; m != NULL  error == 0; m = m-m_next) {
@@ -541,7 +551,8 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 			paddr = m-m_ext.ext_paddr +
 			(m-m_data - m-m_ext.ext_buf);
 			size = m-m_len;
-			error = _bus_dmamap_load_paddr(t, map, paddr, size);
+			error = _bus_dmamap_load_paddr(t, map, paddr, size,
+			false);
 			break;
 		
 		case M_EXT|M_EXT_PAGES:
@@ -570,7 +581,7 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 paddr = VM_PAGE_TO_PHYS(pg) + offset;
 
 error = _bus_dmamap_load_paddr(t, map,
-paddr, size);
+paddr, size, false);
 if (error)
 	break;
 offset = 0;
@@ -582,7 +593,8 @@ _bus_dmamap_load_mbuf(bus_dma_tag_t t, b
 			paddr = m-m_paddr + M_BUFOFFSET(m) +
 			(m-m_data - M_BUFADDR(m));
 			size = m-m_len;
-			error = _bus_dmamap_load_paddr(t, map, paddr, size);
+			error = _bus_dmamap_load_paddr(t, map, paddr, size,
+			false);
 			break;
 
 		default:
@@ -766,7 +778,9 @@ _bus_dmamap_sync_linear(bus_dma_tag_t t,
 		paddr_t pa = _bus_dma_busaddr_to_paddr(t, ds-ds_addr + offset);
 		size_t seglen = min(len, ds-ds_len - offset);
 
-		_bus_dmamap_sync_segment(va + offset, pa, seglen, ops, false);
+		if ((ds-_ds_flags  _BUS_DMAMAP_COHERENT) == 0)
+			

CVS commit: src/sys/arch/arm/broadcom

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:18:55 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_board.c bcm53xx_eth.c bcm53xx_pax.c
bcm53xx_var.h

Log Message:
Add a coherent bus dma tag which marks the first 256MB as having coherent
dma (but only for PCIe and ethernet).  Make the ethernet and PCIe attachments
use this tag instead of the default non-coherent one.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/broadcom/bcm53xx_board.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/arm/broadcom/bcm53xx_eth.c
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcm53xx_pax.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/arm/broadcom/bcm53xx_var.h

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

Modified files:

Index: src/sys/arch/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.5 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.6
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.5	Sun Oct  7 19:16:39 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Wed Oct 17 20:18:55 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.5 2012/10/07 19:16:39 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.6 2012/10/17 20:18:55 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: bcm53xx_board.c,v 1.5 2012/10/07 19:16:39 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: bcm53xx_board.c,v 1.6 2012/10/17 20:18:55 matt Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -75,6 +75,14 @@ struct arm32_bus_dma_tag bcm53xx_dma_tag
 	_BUS_DMATAG_FUNCS,
 };
 
+struct arm32_dma_range bcm53xx_coherent_dma_ranges[2];
+
+struct arm32_bus_dma_tag bcm53xx_coherent_dma_tag = {
+	_BUS_DMAMAP_FUNCS,
+	_BUS_DMAMEM_FUNCS,
+	_BUS_DMATAG_FUNCS,
+};
+
 #ifdef BCM53XX_CONSOLE_EARLY
 #include dev/ic/ns16550reg.h
 #include dev/ic/comreg.h
@@ -504,6 +512,19 @@ bcm53xx_dma_bootstrap(psize_t memsize)
 		bcm53xx_dma_ranges[1].dr_len = memsize - 0x1000;
 		bcm53xx_dma_tag._ranges = bcm53xx_dma_ranges;
 		bcm53xx_dma_tag._nranges = __arraycount(bcm53xx_dma_ranges);
+		bcm53xx_coherent_dma_ranges[0] = bcm53xx_dma_ranges[0];
+		bcm53xx_coherent_dma_ranges[0].dr_flags = _BUS_DMAMAP_COHERENT;
+		bcm53xx_coherent_dma_ranges[1] = bcm53xx_dma_ranges[1];
+		bcm53xx_coherent_dma_tag._ranges = bcm53xx_coherent_dma_ranges;
+		bcm53xx_coherent_dma_tag._nranges =
+		__arraycount(bcm53xx_coherent_dma_ranges);
+	} else {
+		bcm53xx_coherent_dma_ranges[0].dr_sysbase = 0x8000;
+		bcm53xx_coherent_dma_ranges[0].dr_busbase = 0x8000;
+		bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
+		bcm53xx_coherent_dma_ranges[0].dr_flags = _BUS_DMAMAP_COHERENT;
+		bcm53xx_coherent_dma_tag._ranges = bcm53xx_coherent_dma_ranges;
+		bcm53xx_coherent_dma_tag._nranges = 1;
 	}
 }
 

Index: src/sys/arch/arm/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.10 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.11
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.10	Fri Oct 12 23:25:15 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Wed Oct 17 20:18:55 2012
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: bcm53xx_eth.c,v 1.10 2012/10/12 23:25:15 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: bcm53xx_eth.c,v 1.11 2012/10/17 20:18:55 matt Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -210,13 +210,6 @@ static void bcmeth_worker(struct work *,
 static int bcmeth_mediachange(struct ifnet *);
 static void bcmeth_mediastatus(struct ifnet *, struct ifmediareq *);
 
-static struct arm32_dma_range bcmeth_dma_ranges[2];
-static struct arm32_bus_dma_tag bcmeth_dma_tag = {
-	_BUS_DMAMAP_FUNCS,
-	_BUS_DMAMEM_FUNCS,
-	_BUS_DMATAG_FUNCS,
-};
-
 static inline uint32_t
 bcmeth_read_4(struct bcmeth_softc *sc, bus_size_t o)
 {
@@ -267,23 +260,9 @@ bcmeth_ccb_attach(device_t parent, devic
 	loc-loc_offset, loc-loc_size, sc-sc_bsh);
 
 	/*
-	 * Initialize a bus_dma_tag to prefer memory over 256MB.
+	 * We need to use the coherent dma tag for the GMAC.
 	 */
-	if (bcmeth_dma_tag._nranges != sc-sc_dmat-_nranges) {
-		KASSERT(sc-sc_dmat-_nranges == 2);
-		bcmeth_dma_ranges[0] = sc-sc_dmat-_ranges[1];
-		bcmeth_dma_ranges[1] = sc-sc_dmat-_ranges[0];
-		bcmeth_dma_tag._ranges = bcmeth_dma_ranges;
-		bcmeth_dma_tag._nranges = sc-sc_dmat-_nranges;
-	}
-
-	/*
-	 * If we initialized our dma tag, then use it.
-	 */
-	if (bcmeth_dma_tag._nranges  0) {
-		sc-sc_dmat = bcmeth_dma_tag;
-		KASSERT(sc-sc_dmat-_ranges[0].dr_busbase - sc-sc_dmat-_ranges[1].dr_busbase == 0x1000);
-	}
+	sc-sc_dmat = bcm53xx_coherent_dma_tag;
 
 	prop_data_t eaprop = prop_dictionary_get(dict, mac-address);
 if (eaprop == NULL) {
@@ -861,6 +840,7 @@ bcmeth_rx_buf_alloc(
 		bcmeth_mapcache_put(sc, sc-sc_rx_mapcache, map);
 		return NULL;
 	}
+	KASSERT(map-_dm_flags  _BUS_DMAMAP_COHERENT);
 	KASSERT(map-dm_mapsize 

CVS commit: src/sys

2012-10-17 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Oct 17 20:19:55 UTC 2012

Modified Files:
src/sys/arch/x86/include: cpu_ucode.h
src/sys/arch/x86/x86: cpu_ucode.c cpu_ucode_amd.c cpu_ucode_intel.c
src/sys/arch/xen/xen: xen_ucode.c
src/sys/kern: kern_cpu.c
src/sys/sys: cpu.h

Log Message:
put binary compatibility support for the old AMD-only CPU microcode
update API inside COMPAT_60


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/include/cpu_ucode.h
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/x86/x86/cpu_ucode.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/x86/x86/cpu_ucode_amd.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/x86/x86/cpu_ucode_intel.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/xen/xen/xen_ucode.c
cvs rdiff -u -r1.58 -r1.59 src/sys/kern/kern_cpu.c
cvs rdiff -u -r1.36 -r1.37 src/sys/sys/cpu.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/cpu_ucode.h
diff -u src/sys/arch/x86/include/cpu_ucode.h:1.2 src/sys/arch/x86/include/cpu_ucode.h:1.3
--- src/sys/arch/x86/include/cpu_ucode.h:1.2	Wed Aug 29 17:13:22 2012
+++ src/sys/arch/x86/include/cpu_ucode.h	Wed Oct 17 20:19:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode.h,v 1.2 2012/08/29 17:13:22 drochner Exp $ */
+/* $NetBSD: cpu_ucode.h,v 1.3 2012/10/17 20:19:55 drochner Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -48,8 +48,9 @@ struct cpu_ucode_version_intel1 {
 #include dev/firmload.h
 
 int cpu_ucode_amd_get_version(struct cpu_ucode_version *);
-/* XXX COMPAT */
+#ifdef COMPAT_60
 int compat6_cpu_ucode_amd_get_version(struct compat6_cpu_ucode *);
+#endif
 int cpu_ucode_amd_firmware_open(firmware_handle_t *, const char *);
 int cpu_ucode_amd_apply(struct cpu_ucode_softc *, int);
 

Index: src/sys/arch/x86/x86/cpu_ucode.c
diff -u src/sys/arch/x86/x86/cpu_ucode.c:1.2 src/sys/arch/x86/x86/cpu_ucode.c:1.3
--- src/sys/arch/x86/x86/cpu_ucode.c:1.2	Wed Aug 29 17:13:22 2012
+++ src/sys/arch/x86/x86/cpu_ucode.c	Wed Oct 17 20:19:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode.c,v 1.2 2012/08/29 17:13:22 drochner Exp $ */
+/* $NetBSD: cpu_ucode.c,v 1.3 2012/10/17 20:19:55 drochner Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,9 +29,10 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_ucode.c,v 1.2 2012/08/29 17:13:22 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_ucode.c,v 1.3 2012/10/17 20:19:55 drochner Exp $);
 
 #include opt_cpu_ucode.h
+#include opt_compat_netbsd.h
 
 #include sys/param.h
 #include sys/cpuio.h
@@ -62,7 +63,7 @@ cpu_ucode_get_version(struct cpu_ucode_v
 	return 0;
 }
 
-/* XXX COMPAT */
+#ifdef COMPAT_60
 int
 compat6_cpu_ucode_get_version(struct compat6_cpu_ucode *data)
 {
@@ -76,6 +77,7 @@ compat6_cpu_ucode_get_version(struct com
 
 	return 0;
 }
+#endif
 
 int
 cpu_ucode_md_open(firmware_handle_t *fwh, int loader_version, const char *fwname)
@@ -120,7 +122,7 @@ cpu_ucode_apply(const struct cpu_ucode *
 	return error;
 }
 
-/* XXX COMPAT */
+#ifdef COMPAT_60
 int
 compat6_cpu_ucode_apply(const struct compat6_cpu_ucode *data)
 {
@@ -143,3 +145,4 @@ compat6_cpu_ucode_apply(const struct com
 	sc-sc_blobsize = 0;
 	return error;
 }
+#endif

Index: src/sys/arch/x86/x86/cpu_ucode_amd.c
diff -u src/sys/arch/x86/x86/cpu_ucode_amd.c:1.4 src/sys/arch/x86/x86/cpu_ucode_amd.c:1.5
--- src/sys/arch/x86/x86/cpu_ucode_amd.c:1.4	Wed Aug 29 17:13:22 2012
+++ src/sys/arch/x86/x86/cpu_ucode_amd.c	Wed Oct 17 20:19:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_amd.c,v 1.4 2012/08/29 17:13:22 drochner Exp $ */
+/* $NetBSD: cpu_ucode_amd.c,v 1.5 2012/10/17 20:19:55 drochner Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,10 +29,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu_ucode_amd.c,v 1.4 2012/08/29 17:13:22 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu_ucode_amd.c,v 1.5 2012/10/17 20:19:55 drochner Exp $);
 
 #include opt_xen.h
 #include opt_cpu_ucode.h
+#include opt_compat_netbsd.h
 
 #include sys/param.h
 #include sys/conf.h
@@ -115,6 +116,7 @@ cpu_ucode_amd_get_version(struct cpu_uco
 	return copyout(data, ucode-data, sizeof(data));
 }
 
+#ifdef COMPAT_60
 int
 compat6_cpu_ucode_amd_get_version(struct compat6_cpu_ucode *ucode)
 {
@@ -127,6 +129,7 @@ compat6_cpu_ucode_amd_get_version(struct
 	ucode-version = uclevel;
 	return 0;
 }
+#endif
 
 int
 cpu_ucode_amd_firmware_open(firmware_handle_t *fwh, const char *fwname)

Index: src/sys/arch/x86/x86/cpu_ucode_intel.c
diff -u src/sys/arch/x86/x86/cpu_ucode_intel.c:1.1 src/sys/arch/x86/x86/cpu_ucode_intel.c:1.2
--- src/sys/arch/x86/x86/cpu_ucode_intel.c:1.1	Wed Aug 29 17:13:22 2012
+++ src/sys/arch/x86/x86/cpu_ucode_intel.c	Wed Oct 17 20:19:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_intel.c,v 1.1 2012/08/29 17:13:22 drochner Exp $ */
+/* $NetBSD: 

CVS commit: src/sys/arch/evbarm/bcm53xx

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:20:54 UTC 2012

Modified Files:
src/sys/arch/evbarm/bcm53xx: bcm53xx_machdep.c

Log Message:
If there is more than 256MB of ram, add the first 256MB into a separate
VM freelist and specifiy that PMAP_ALLOC_POOLPAGE allocate using that freelist.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/evbarm/bcm53xx/bcm53xx_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/evbarm/bcm53xx/bcm53xx_machdep.c
diff -u src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.4 src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.5
--- src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c:1.4	Sun Oct  7 19:17:24 2012
+++ src/sys/arch/evbarm/bcm53xx/bcm53xx_machdep.c	Wed Oct 17 20:20:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_machdep.c,v 1.4 2012/10/07 19:17:24 matt Exp $	*/
+/*	$NetBSD: bcm53xx_machdep.c,v 1.5 2012/10/17 20:20:54 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #define IDM_PRIVATE
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.4 2012/10/07 19:17:24 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: bcm53xx_machdep.c,v 1.5 2012/10/17 20:20:54 matt Exp $);
 
 #include opt_evbarm_boardtype.h
 #include opt_broadcom.h
@@ -172,6 +172,13 @@ static const struct pmap_devmap devmap[]
 	{ 0, 0, 0, 0, 0 }
 };
 
+static const struct boot_physmem bp_first256 = {
+	.bp_start = 0x8000 / NBPG,
+	.bp_pages = 0x1000 / NBPG,
+	.bp_freelist = VM_FREELIST_ISADMA,
+	.bp_flags = 0,
+};
+
 /*
  * u_int initarm(...)
  *
@@ -238,6 +245,7 @@ initarm(void *arg)
 
 	psize_t memsize = bcm53xx_memprobe();
 	//memsize = 512*1024*1024;
+	const bool bigmem_p = (memsize  20)  256; 
 
 	arm32_bootmem_init(KERN_VTOPHYS(KERNEL_BASE), memsize,
 	(paddr_t)KERNEL_BASE_phys);
@@ -259,8 +267,19 @@ initarm(void *arg)
 	cpu_reset_address = bcm53xx_system_reset;
 	/* we've a specific device_register routine */
 	evbarm_device_register = bcm53xx_device_register;
+	if (bigmem_p) {
+		/*
+		 * If we have more than 256MB
+		 */
+		arm_poolpage_vmfreelist = bp_first256.bp_freelist;
+	}
 
-	return initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE, NULL, 0);
+	/*
+	 * If we have more than 256MB of RAM, set aside the first 256MB for
+	 * non-default VM allocations.
+	 */
+	return initarm_common(KERNEL_VM_BASE, KERNEL_VM_SIZE,
+	(bigmem_p ? bp_first256 : NULL), (bigmem_p ? 1 : 0));
 }
 
 void



CVS commit: src/sys/arch/evbarm/conf

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:21:26 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: std.bcm53xx

Log Message:
Add PMAP_NEEDS_ALLOC_POOLPAGE


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/evbarm/conf/std.bcm53xx

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/evbarm/conf/std.bcm53xx
diff -u src/sys/arch/evbarm/conf/std.bcm53xx:1.6 src/sys/arch/evbarm/conf/std.bcm53xx:1.7
--- src/sys/arch/evbarm/conf/std.bcm53xx:1.6	Fri Oct  5 06:04:43 2012
+++ src/sys/arch/evbarm/conf/std.bcm53xx	Wed Oct 17 20:21:26 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: std.bcm53xx,v 1.6 2012/10/05 06:04:43 matt Exp $
+#	$NetBSD: std.bcm53xx,v 1.7 2012/10/17 20:21:26 matt Exp $
 #
 # standard NetBSD/evbarm for BEAGLEBAORD options
 
@@ -17,6 +17,7 @@ options 	ARM32
 options 	FPU_VFP
 options 	CORTEX_PMC
 #options 	_ARM32_NEED_BUS_DMA_BOUNCE
+options 	PMAP_NEED_ALLOC_POOLPAGE
 options 	__HAVE_FAST_SOFTINTS		# should be in types.h
 options 	__HAVE_CPU_UAREA_ALLOC_IDLELWP
 options 	__HAVE_CPU_COUNTER



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

2012-10-17 Thread Matthias Drochner
Module Name:src
Committed By:   drochner
Date:   Wed Oct 17 20:22:16 UTC 2012

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

Log Message:
avoid dummy structure definition, include a system header instead,
looks just cleaner


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/cpuctl/arch/noarch.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/noarch.c
diff -u src/usr.sbin/cpuctl/arch/noarch.c:1.4 src/usr.sbin/cpuctl/arch/noarch.c:1.5
--- src/usr.sbin/cpuctl/arch/noarch.c:1.4	Fri Aug 31 07:27:27 2012
+++ src/usr.sbin/cpuctl/arch/noarch.c	Wed Oct 17 20:22:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: noarch.c,v 1.4 2012/08/31 07:27:27 drochner Exp $	*/
+/*	$NetBSD: noarch.c,v 1.5 2012/10/17 20:22:15 drochner Exp $	*/
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -27,18 +27,15 @@
  */
 
 #include sys/cdefs.h
-#include sys/types.h
 
 #ifndef lint
-__RCSID($NetBSD: noarch.c,v 1.4 2012/08/31 07:27:27 drochner Exp $);
+__RCSID($NetBSD: noarch.c,v 1.5 2012/10/17 20:22:15 drochner Exp $);
 #endif /* not lint */
 
+#include sys/types.h
+#include sys/cpuio.h
 #include stdio.h
 
-struct cpu_ucode {
-	int dummy;
-};
-
 #include ../cpuctl.h
 
 void



CVS commit: src/sys/arch/evbarm/conf

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:22:23 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: BCM5301X

Log Message:
Make sure the L2 cache is enabled
Restrict the PCIe interface to negotiate at Gen1 speeds.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/BCM5301X

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/evbarm/conf/BCM5301X
diff -u src/sys/arch/evbarm/conf/BCM5301X:1.8 src/sys/arch/evbarm/conf/BCM5301X:1.9
--- src/sys/arch/evbarm/conf/BCM5301X:1.8	Wed Oct 17 14:48:11 2012
+++ src/sys/arch/evbarm/conf/BCM5301X	Wed Oct 17 20:22:23 2012
@@ -1,5 +1,5 @@
 #
-#	$NetBSD: BCM5301X,v 1.8 2012/10/17 14:48:11 apb Exp $
+#	$NetBSD: BCM5301X,v 1.9 2012/10/17 20:22:23 matt Exp $
 #
 #	BCM5301X -- Broadcom BCM5301X Eval Board Kernel
 #
@@ -186,7 +186,7 @@ cpu0		at mainbus?
 # The MPCore interrupt controller and global timer
 armperiph0	at mainbus?		# A9 On-Chip Peripherals
 armgic0		at armperiph?		# ARM Generic Interrupt Controller
-arml2cc0	at armperiph? flags 1	# ARM PL310 L2CC
+arml2cc0	at armperiph? flags 0	# ARM PL310 L2CC
 a9tmr0		at armperiph?		# A9 Global Timer
 a9wdt0		at armperiph? flags 1	# A9 Watchdog Timer
 
@@ -198,7 +198,7 @@ com*		at bcmcca? channel 1
 
 # ChipCommonB Peripherals
 bcmccb0		at mainbus?		# ChipCommonB
-bcmpax*		at bcmccb? port ?
+bcmpax*		at bcmccb? port ? flags 1
 pci*		at bcmpax?
 ppb*		at pci? dev ? function ?
 pci*		at ppb?



CVS commit: [netbsd-5] src/bin/pax

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:44:14 UTC 2012

Modified Files:
src/bin/pax [netbsd-5]: ftree.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #1799):
bin/pax/ftree.c: revision 1.42
deal properly with empty lines in spec file


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.6.1 src/bin/pax/ftree.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/pax/ftree.c
diff -u src/bin/pax/ftree.c:1.39 src/bin/pax/ftree.c:1.39.6.1
--- src/bin/pax/ftree.c:1.39	Mon Apr 28 20:22:51 2008
+++ src/bin/pax/ftree.c	Wed Oct 17 20:44:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftree.c,v 1.39 2008/04/28 20:22:51 martin Exp $	*/
+/*	$NetBSD: ftree.c,v 1.39.6.1 2012/10/17 20:44:14 bouyer Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)ftree.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: ftree.c,v 1.39 2008/04/28 20:22:51 martin Exp $);
+__RCSID($NetBSD: ftree.c,v 1.39.6.1 2012/10/17 20:44:14 bouyer Exp $);
 #endif
 #endif /* not lint */
 
@@ -347,7 +347,7 @@ ftree_arg(void)
 			 * the user didn't supply any args, get the file trees
 			 * to process from stdin;
 			 */
-			for (i = 0; i  PAXPATHLEN + 2; i++) {
+			for (i = 0; i  PAXPATHLEN + 2;) {
 c = getchar();
 if (c == EOF)
 	break;
@@ -355,7 +355,7 @@ ftree_arg(void)
 	if (i != 0)
 		break;
 } else
-	farray[0][i] = c;
+	farray[0][i++] = c;
 			}
 			if (i == 0)
 return -1;



CVS commit: src/sys/arch/arm/arm32

2012-10-17 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Oct 17 20:44:48 UTC 2012

Modified Files:
src/sys/arch/arm/arm32: arm32_kvminit.c

Log Message:
Fix two off-by-one loops. Saves a whole two pages.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/arm/arm32/arm32_kvminit.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/arm/arm32/arm32_kvminit.c
diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.7 src/sys/arch/arm/arm32/arm32_kvminit.c:1.8
--- src/sys/arch/arm/arm32/arm32_kvminit.c:1.7	Mon Oct 15 12:26:06 2012
+++ src/sys/arch/arm/arm32/arm32_kvminit.c	Wed Oct 17 20:44:48 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: arm32_kvminit.c,v 1.7 2012/10/15 12:26:06 skrll Exp $	*/
+/*	$NetBSD: arm32_kvminit.c,v 1.8 2012/10/17 20:44:48 skrll Exp $	*/
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -122,7 +122,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.7 2012/10/15 12:26:06 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: arm32_kvminit.c,v 1.8 2012/10/17 20:44:48 skrll Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -452,7 +452,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 #ifdef VERBOSE_INIT_ARM
 	printf( kernel);
 #endif
-	for (size_t idx = 0; idx = KERNEL_L2PT_KERNEL_NUM; ++idx) {
+	for (size_t idx = 0; idx  KERNEL_L2PT_KERNEL_NUM; ++idx) {
 		valloc_pages(bmi, kernel_l2pt[idx], L2_TABLE_SIZE / PAGE_SIZE,
 		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
 		add_pages(bmi, kernel_l2pt[idx]);
@@ -460,7 +460,7 @@ arm32_kernel_vm_init(vaddr_t kernel_vm_b
 #ifdef VERBOSE_INIT_ARM
 	printf( vm);
 #endif
-	for (size_t idx = 0; idx = KERNEL_L2PT_VMDATA_NUM; ++idx) {
+	for (size_t idx = 0; idx  KERNEL_L2PT_VMDATA_NUM; ++idx) {
 		valloc_pages(bmi, vmdata_l2pt[idx], L2_TABLE_SIZE / PAGE_SIZE,
 		VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE);
 		add_pages(bmi, vmdata_l2pt[idx]);



CVS commit: src/sys/arch/arm/cortex

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 20:45:49 UTC 2012

Modified Files:
src/sys/arch/arm/cortex: pl310.c

Log Message:
Add a missing mutex exit.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/cortex/pl310.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/arm/cortex/pl310.c
diff -u src/sys/arch/arm/cortex/pl310.c:1.6 src/sys/arch/arm/cortex/pl310.c:1.7
--- src/sys/arch/arm/cortex/pl310.c:1.6	Sat Sep 22 00:33:37 2012
+++ src/sys/arch/arm/cortex/pl310.c	Wed Oct 17 20:45:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: pl310.c,v 1.6 2012/09/22 00:33:37 matt Exp $	*/
+/*	$NetBSD: pl310.c,v 1.7 2012/10/17 20:45:49 matt Exp $	*/
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pl310.c,v 1.6 2012/09/22 00:33:37 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: pl310.c,v 1.7 2012/10/17 20:45:49 matt Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -289,8 +289,10 @@ arml2cc_cache_range_op(paddr_t pa, psize
 		psize_t seglen = min(len, PAGE_SIZE - off);
 
 		mutex_spin_enter(sc-sc_lock);
-		if (!sc-sc_enabled)
+		if (!sc-sc_enabled) {
+			mutex_spin_exit(sc-sc_lock);
 			return;
+		}
 		for (paddr_t segend = pa + seglen; pa  segend; pa += line_size) {
 			arml2cc_cache_op(sc, cache_op, pa);
 		}



CVS commit: [netbsd-5] src/sys/dev/pci

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:46:37 UTC 2012

Modified Files:
src/sys/dev/pci [netbsd-5]: if_wm.c

Log Message:
Apply patch, requested by msaitoh in ticket 1800:
sys/dev/pci/if_wm.c:revision 1.231 via patch
Add workaround for QEMU and the variants that fail on
EEPROM access.
This problem was discovered a few years ago, but some variants
and cloud services still have the bug. This problem is not
NetBSD's bug but qemus' bug. For NetBSD users, existence of
buggy virtual machines is sad thing, so we add a workaroud.


To generate a diff of this commit:
cvs rdiff -u -r1.162.4.16 -r1.162.4.17 src/sys/dev/pci/if_wm.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_wm.c
diff -u src/sys/dev/pci/if_wm.c:1.162.4.16 src/sys/dev/pci/if_wm.c:1.162.4.17
--- src/sys/dev/pci/if_wm.c:1.162.4.16	Wed Jan 25 18:02:17 2012
+++ src/sys/dev/pci/if_wm.c	Wed Oct 17 20:46:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_wm.c,v 1.162.4.16 2012/01/25 18:02:17 riz Exp $	*/
+/*	$NetBSD: if_wm.c,v 1.162.4.17 2012/10/17 20:46:37 bouyer Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002, 2003, 2004 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.16 2012/01/25 18:02:17 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_wm.c,v 1.162.4.17 2012/10/17 20:46:37 bouyer Exp $);
 
 #include bpfilter.h
 #include rnd.h
@@ -4362,6 +4362,22 @@ wm_read_eeprom_uwire(struct wm_softc *sc
 		reg = CSR_READ(sc, WMREG_EECD)  ~(EECD_SK | EECD_DI);
 		CSR_WRITE(sc, WMREG_EECD, reg);
 
+		/*
+		 * XXX: workaround for a bug in qemu-0.12.x and prior
+		 * and Xen.
+		 *
+		 * We use this workaround only for 82540 because qemu's
+		 * e1000 act as 82540.
+		 */
+		if (sc-sc_type == WM_T_82540) {
+			reg |= EECD_SK;
+			CSR_WRITE(sc, WMREG_EECD, reg);
+			reg = ~EECD_SK;
+			CSR_WRITE(sc, WMREG_EECD, reg);
+			delay(2);
+		}
+		/* XXX: end of workaround */
+		
 		/* Set CHIP SELECT. */
 		reg |= EECD_CS;
 		CSR_WRITE(sc, WMREG_EECD, reg);



CVS commit: [netbsd-5-1] src/dist/bind

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:50:04 UTC 2012

Modified Files:
src/dist/bind [netbsd-5-1]: CHANGES version
src/dist/bind/bin/named [netbsd-5-1]: query.c

Log Message:
Apply patch, requested by spz in ticket #1801:
dist/bind/CHANGES:  patch
dist/bind/version:  patch
dist/bind/bin/named/query.c:patch

fix CVE-2012-5166: Specially crafted DNS data can cause a lockup in named


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.11.4.2.2.6 -r1.1.1.11.4.2.2.7 src/dist/bind/CHANGES \
src/dist/bind/version
cvs rdiff -u -r1.8.4.2.2.4 -r1.8.4.2.2.5 src/dist/bind/bin/named/query.c

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

Modified files:

Index: src/dist/bind/CHANGES
diff -u src/dist/bind/CHANGES:1.1.1.11.4.2.2.6 src/dist/bind/CHANGES:1.1.1.11.4.2.2.7
--- src/dist/bind/CHANGES:1.1.1.11.4.2.2.6	Thu Sep 13 23:59:45 2012
+++ src/dist/bind/CHANGES	Wed Oct 17 20:50:03 2012
@@ -1,7 +1,8 @@
-	--- 9.7.3-P4 released ---
+	--- 9.7.6-P4 released ---
 
-3331.	[security]	dns_rdataslab_fromrdataset could produce bad
-			rdataslabs. [RT #29644]
+3383.	[security]	A certain combination of records in the RBT could
+cause named to hang while populating the additional
+section of a response. [RT #31090]
 
 	--- 9.7.6-P3 released ---
 
Index: src/dist/bind/version
diff -u src/dist/bind/version:1.1.1.11.4.2.2.6 src/dist/bind/version:1.1.1.11.4.2.2.7
--- src/dist/bind/version:1.1.1.11.4.2.2.6	Thu Sep 13 23:59:46 2012
+++ src/dist/bind/version	Wed Oct 17 20:50:03 2012
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=7
 PATCHVER=6
 RELEASETYPE=-P
-RELEASEVER=3
+RELEASEVER=4

Index: src/dist/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.8.4.2.2.4 src/dist/bind/bin/named/query.c:1.8.4.2.2.5
--- src/dist/bind/bin/named/query.c:1.8.4.2.2.4	Wed Jul 25 12:10:01 2012
+++ src/dist/bind/bin/named/query.c	Wed Oct 17 20:50:03 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.8.4.2.2.4 2012/07/25 12:10:01 jdc Exp $	*/
+/*	$NetBSD: query.c,v 1.8.4.2.2.5 2012/10/17 20:50:03 bouyer Exp $	*/
 
 /*
  * Copyright (C) 2004-2012  Internet Systems Consortium, Inc. (ISC)
@@ -1027,13 +1027,6 @@ query_isduplicate(ns_client_t *client, d
 		mname = NULL;
 	}
 
-	/*
-	 * If the dns_name_t we're looking up is already in the message,
-	 * we don't want to trigger the caller's name replacement logic.
-	 */
-	if (name == mname)
-		mname = NULL;
-
 	if (mnamep != NULL)
 	*mnamep = mname;
 
@@ -1232,6 +1225,7 @@ query_addadditional(void *arg, dns_name_
 	if (dns_rdataset_isassociated(rdataset) 
 	!query_isduplicate(client, fname, type, mname)) {
 		if (mname != NULL) {
+			INSIST(mname != fname);
 			query_releasename(client, fname);
 			fname = mname;
 		} else
@@ -1301,11 +1295,13 @@ query_addadditional(void *arg, dns_name_
 #endif
 			if (!query_isduplicate(client, fname,
 	   dns_rdatatype_a, mname)) {
-if (mname != NULL) {
-	query_releasename(client, fname);
-	fname = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		query_releasename(client, fname);
+		fname = mname;
+	} else
+		need_addname = ISC_TRUE;
+}
 ISC_LIST_APPEND(fname-list, rdataset, link);
 added_something = ISC_TRUE;
 if (sigrdataset != NULL 
@@ -1358,11 +1354,13 @@ query_addadditional(void *arg, dns_name_
 #endif
 			if (!query_isduplicate(client, fname,
 	   dns_rdatatype_, mname)) {
-if (mname != NULL) {
-	query_releasename(client, fname);
-	fname = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		query_releasename(client, fname);
+		fname = mname;
+	} else
+		need_addname = ISC_TRUE;
+}
 ISC_LIST_APPEND(fname-list, rdataset, link);
 added_something = ISC_TRUE;
 if (sigrdataset != NULL 
@@ -1885,22 +1883,24 @@ query_addadditional2(void *arg, dns_name
 		crdataset-type == dns_rdatatype_) {
 			if (!query_isduplicate(client, fname, crdataset-type,
 	   mname)) {
-if (mname != NULL) {
-	/*
-	 * A different type of this name is
-	 * already stored in the additional
-	 * section.  We'll reuse the name.
-	 * Note that this should happen at most
-	 * once.  Otherwise, fname-link could
-	 * leak below.
-	 */
-	INSIST(mname0 == NULL);
-
-	query_releasename(client, fname);
-	fname = mname;
-	mname0 = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		/*
+		 * A different type of this name is
+		 * already stored in the additional
+		 * section.  We'll reuse the name.
+		 * Note that this should happen at most
+		 * once.  Otherwise, fname-link could
+		 * leak below.
+		 */
+	

CVS commit: [netbsd-5-0] src/dist/bind

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:50:14 UTC 2012

Modified Files:
src/dist/bind [netbsd-5-0]: CHANGES version
src/dist/bind/bin/named [netbsd-5-0]: query.c

Log Message:
Apply patch, requested by spz in ticket #1801:
dist/bind/CHANGES:  patch
dist/bind/version:  patch
dist/bind/bin/named/query.c:patch

fix CVE-2012-5166: Specially crafted DNS data can cause a lockup in named


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.11.8.8 -r1.1.1.11.8.9 src/dist/bind/CHANGES \
src/dist/bind/version
cvs rdiff -u -r1.8.8.6 -r1.8.8.7 src/dist/bind/bin/named/query.c

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

Modified files:

Index: src/dist/bind/CHANGES
diff -u src/dist/bind/CHANGES:1.1.1.11.8.8 src/dist/bind/CHANGES:1.1.1.11.8.9
--- src/dist/bind/CHANGES:1.1.1.11.8.8	Fri Sep 14 00:00:41 2012
+++ src/dist/bind/CHANGES	Wed Oct 17 20:50:13 2012
@@ -1,7 +1,8 @@
-	--- 9.7.3-P4 released ---
+	--- 9.7.6-P4 released ---
 
-3331.	[security]	dns_rdataslab_fromrdataset could produce bad
-			rdataslabs. [RT #29644]
+3383.	[security]	A certain combination of records in the RBT could
+cause named to hang while populating the additional
+section of a response. [RT #31090]
 
 	--- 9.7.6-P3 released ---
 
Index: src/dist/bind/version
diff -u src/dist/bind/version:1.1.1.11.8.8 src/dist/bind/version:1.1.1.11.8.9
--- src/dist/bind/version:1.1.1.11.8.8	Fri Sep 14 00:00:42 2012
+++ src/dist/bind/version	Wed Oct 17 20:50:14 2012
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=7
 PATCHVER=6
 RELEASETYPE=-P
-RELEASEVER=3
+RELEASEVER=4

Index: src/dist/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.8.8.6 src/dist/bind/bin/named/query.c:1.8.8.7
--- src/dist/bind/bin/named/query.c:1.8.8.6	Wed Jul 25 12:02:52 2012
+++ src/dist/bind/bin/named/query.c	Wed Oct 17 20:50:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.8.8.6 2012/07/25 12:02:52 jdc Exp $	*/
+/*	$NetBSD: query.c,v 1.8.8.7 2012/10/17 20:50:14 bouyer Exp $	*/
 
 /*
  * Copyright (C) 2004-2012  Internet Systems Consortium, Inc. (ISC)
@@ -1027,13 +1027,6 @@ query_isduplicate(ns_client_t *client, d
 		mname = NULL;
 	}
 
-	/*
-	 * If the dns_name_t we're looking up is already in the message,
-	 * we don't want to trigger the caller's name replacement logic.
-	 */
-	if (name == mname)
-		mname = NULL;
-
 	if (mnamep != NULL)
 	*mnamep = mname;
 
@@ -1232,6 +1225,7 @@ query_addadditional(void *arg, dns_name_
 	if (dns_rdataset_isassociated(rdataset) 
 	!query_isduplicate(client, fname, type, mname)) {
 		if (mname != NULL) {
+			INSIST(mname != fname);
 			query_releasename(client, fname);
 			fname = mname;
 		} else
@@ -1301,11 +1295,13 @@ query_addadditional(void *arg, dns_name_
 #endif
 			if (!query_isduplicate(client, fname,
 	   dns_rdatatype_a, mname)) {
-if (mname != NULL) {
-	query_releasename(client, fname);
-	fname = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		query_releasename(client, fname);
+		fname = mname;
+	} else
+		need_addname = ISC_TRUE;
+}
 ISC_LIST_APPEND(fname-list, rdataset, link);
 added_something = ISC_TRUE;
 if (sigrdataset != NULL 
@@ -1358,11 +1354,13 @@ query_addadditional(void *arg, dns_name_
 #endif
 			if (!query_isduplicate(client, fname,
 	   dns_rdatatype_, mname)) {
-if (mname != NULL) {
-	query_releasename(client, fname);
-	fname = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		query_releasename(client, fname);
+		fname = mname;
+	} else
+		need_addname = ISC_TRUE;
+}
 ISC_LIST_APPEND(fname-list, rdataset, link);
 added_something = ISC_TRUE;
 if (sigrdataset != NULL 
@@ -1885,22 +1883,24 @@ query_addadditional2(void *arg, dns_name
 		crdataset-type == dns_rdatatype_) {
 			if (!query_isduplicate(client, fname, crdataset-type,
 	   mname)) {
-if (mname != NULL) {
-	/*
-	 * A different type of this name is
-	 * already stored in the additional
-	 * section.  We'll reuse the name.
-	 * Note that this should happen at most
-	 * once.  Otherwise, fname-link could
-	 * leak below.
-	 */
-	INSIST(mname0 == NULL);
-
-	query_releasename(client, fname);
-	fname = mname;
-	mname0 = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		/*
+		 * A different type of this name is
+		 * already stored in the additional
+		 * section.  We'll reuse the name.
+		 * Note that this should happen at most
+		 * once.  Otherwise, fname-link could
+		 * leak below.
+		 */
+		INSIST(mname0 == NULL);
+
+		

CVS commit: [netbsd-5] src/dist/bind

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:50:24 UTC 2012

Modified Files:
src/dist/bind [netbsd-5]: CHANGES version
src/dist/bind/bin/named [netbsd-5]: query.c

Log Message:
Apply patch, requested by spz in ticket #1801:
dist/bind/CHANGES:  patch
dist/bind/version:  patch
dist/bind/bin/named/query.c:patch

fix CVE-2012-5166: Specially crafted DNS data can cause a lockup in named


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.11.4.8 -r1.1.1.11.4.9 src/dist/bind/CHANGES \
src/dist/bind/version
cvs rdiff -u -r1.8.4.6 -r1.8.4.7 src/dist/bind/bin/named/query.c

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

Modified files:

Index: src/dist/bind/CHANGES
diff -u src/dist/bind/CHANGES:1.1.1.11.4.8 src/dist/bind/CHANGES:1.1.1.11.4.9
--- src/dist/bind/CHANGES:1.1.1.11.4.8	Thu Sep 13 23:58:51 2012
+++ src/dist/bind/CHANGES	Wed Oct 17 20:50:23 2012
@@ -1,7 +1,8 @@
-	--- 9.7.3-P4 released ---
+	--- 9.7.6-P4 released ---
 
-3331.	[security]	dns_rdataslab_fromrdataset could produce bad
-			rdataslabs. [RT #29644]
+3383.	[security]	A certain combination of records in the RBT could
+cause named to hang while populating the additional
+section of a response. [RT #31090]
 
 	--- 9.7.6-P3 released ---
 
Index: src/dist/bind/version
diff -u src/dist/bind/version:1.1.1.11.4.8 src/dist/bind/version:1.1.1.11.4.9
--- src/dist/bind/version:1.1.1.11.4.8	Thu Sep 13 23:58:52 2012
+++ src/dist/bind/version	Wed Oct 17 20:50:24 2012
@@ -7,4 +7,4 @@ MAJORVER=9
 MINORVER=7
 PATCHVER=6
 RELEASETYPE=-P
-RELEASEVER=3
+RELEASEVER=4

Index: src/dist/bind/bin/named/query.c
diff -u src/dist/bind/bin/named/query.c:1.8.4.6 src/dist/bind/bin/named/query.c:1.8.4.7
--- src/dist/bind/bin/named/query.c:1.8.4.6	Wed Jul 25 11:57:25 2012
+++ src/dist/bind/bin/named/query.c	Wed Oct 17 20:50:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: query.c,v 1.8.4.6 2012/07/25 11:57:25 jdc Exp $	*/
+/*	$NetBSD: query.c,v 1.8.4.7 2012/10/17 20:50:24 bouyer Exp $	*/
 
 /*
  * Copyright (C) 2004-2012  Internet Systems Consortium, Inc. (ISC)
@@ -1027,13 +1027,6 @@ query_isduplicate(ns_client_t *client, d
 		mname = NULL;
 	}
 
-	/*
-	 * If the dns_name_t we're looking up is already in the message,
-	 * we don't want to trigger the caller's name replacement logic.
-	 */
-	if (name == mname)
-		mname = NULL;
-
 	if (mnamep != NULL)
 	*mnamep = mname;
 
@@ -1232,6 +1225,7 @@ query_addadditional(void *arg, dns_name_
 	if (dns_rdataset_isassociated(rdataset) 
 	!query_isduplicate(client, fname, type, mname)) {
 		if (mname != NULL) {
+			INSIST(mname != fname);
 			query_releasename(client, fname);
 			fname = mname;
 		} else
@@ -1301,11 +1295,13 @@ query_addadditional(void *arg, dns_name_
 #endif
 			if (!query_isduplicate(client, fname,
 	   dns_rdatatype_a, mname)) {
-if (mname != NULL) {
-	query_releasename(client, fname);
-	fname = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		query_releasename(client, fname);
+		fname = mname;
+	} else
+		need_addname = ISC_TRUE;
+}
 ISC_LIST_APPEND(fname-list, rdataset, link);
 added_something = ISC_TRUE;
 if (sigrdataset != NULL 
@@ -1358,11 +1354,13 @@ query_addadditional(void *arg, dns_name_
 #endif
 			if (!query_isduplicate(client, fname,
 	   dns_rdatatype_, mname)) {
-if (mname != NULL) {
-	query_releasename(client, fname);
-	fname = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		query_releasename(client, fname);
+		fname = mname;
+	} else
+		need_addname = ISC_TRUE;
+}
 ISC_LIST_APPEND(fname-list, rdataset, link);
 added_something = ISC_TRUE;
 if (sigrdataset != NULL 
@@ -1885,22 +1883,24 @@ query_addadditional2(void *arg, dns_name
 		crdataset-type == dns_rdatatype_) {
 			if (!query_isduplicate(client, fname, crdataset-type,
 	   mname)) {
-if (mname != NULL) {
-	/*
-	 * A different type of this name is
-	 * already stored in the additional
-	 * section.  We'll reuse the name.
-	 * Note that this should happen at most
-	 * once.  Otherwise, fname-link could
-	 * leak below.
-	 */
-	INSIST(mname0 == NULL);
-
-	query_releasename(client, fname);
-	fname = mname;
-	mname0 = mname;
-} else
-	need_addname = ISC_TRUE;
+if (mname != fname) {
+	if (mname != NULL) {
+		/*
+		 * A different type of this name is
+		 * already stored in the additional
+		 * section.  We'll reuse the name.
+		 * Note that this should happen at most
+		 * once.  Otherwise, fname-link could
+		 * leak below.
+		 */
+		INSIST(mname0 == NULL);
+
+		query_releasename(client, 

CVS commit: [netbsd-6] src

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 20:53:29 UTC 2012

Modified Files:
src/gnu/usr.bin/groff/tmac [netbsd-6]: mdoc.local
src/sys/sys [netbsd-6]: param.h

Log Message:
Welcome to 6.0_STABLE


To generate a diff of this commit:
cvs rdiff -u -r1.66.2.1 -r1.66.2.2 src/gnu/usr.bin/groff/tmac/mdoc.local
cvs rdiff -u -r1.408.2.6 -r1.408.2.7 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/gnu/usr.bin/groff/tmac/mdoc.local
diff -u src/gnu/usr.bin/groff/tmac/mdoc.local:1.66.2.1 src/gnu/usr.bin/groff/tmac/mdoc.local:1.66.2.2
--- src/gnu/usr.bin/groff/tmac/mdoc.local:1.66.2.1	Wed Feb 15 23:45:50 2012
+++ src/gnu/usr.bin/groff/tmac/mdoc.local	Wed Oct 17 20:53:29 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: mdoc.local,v 1.66.2.1 2012/02/15 23:45:50 riz Exp $
+.\ $NetBSD: mdoc.local,v 1.66.2.2 2012/10/17 20:53:29 riz Exp $
 .\
 .\ Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -44,9 +44,9 @@
 .as doc-str-St--ieee1275-94  (\*[Lq]\*[doc-Tn-font-size]Open Firmware\*[doc-str-St]\*[Rq])
 .
 .\ Default .Os value
-.ds doc-operating-system NetBSD\~6.0
+.ds doc-operating-system NetBSD\~6.1
 .\ Default footer operating system value
-.ds doc-default-operating-system NetBSD\~6.0
+.ds doc-default-operating-system NetBSD\~6.1
 .\ Other known versions, not yet in groff distribution
 .ds doc-operating-system-NetBSD-1.3.3  1.3.3
 .ds doc-operating-system-NetBSD-1.6.3  1.6.3
@@ -59,6 +59,7 @@
 .ds doc-operating-system-NetBSD-5.05.0
 .ds doc-operating-system-NetBSD-5.15.1
 .ds doc-operating-system-NetBSD-6.06.0
+.ds doc-operating-system-NetBSD-6.16.1
 .ds doc-operating-system-FreeBSD-4.11  4.11
 .ds doc-operating-system-FreeBSD-5.4   5.4
 .ds doc-operating-system-FreeBSD-5.5   5.5

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.408.2.6 src/sys/sys/param.h:1.408.2.7
--- src/sys/sys/param.h:1.408.2.6	Fri Oct 12 22:10:14 2012
+++ src/sys/sys/param.h	Wed Oct 17 20:53:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.408.2.6 2012/10/12 22:10:14 riz Exp $	*/
+/*	$NetBSD: param.h,v 1.408.2.7 2012/10/17 20:53:29 riz Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	6	/* NetBSD 6.0 */
+#define	__NetBSD_Version__	6	/* NetBSD 6.0_STABLE */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) = __NetBSD_Version__)



CVS commit: [netbsd-5] src/usr.bin/calendar/calendars

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:54:04 UTC 2012

Modified Files:
src/usr.bin/calendar/calendars [netbsd-5]: calendar.netbsd

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #1802):
usr.bin/calendar/calendars/calendar.netbsd: revision 1.22
note NetBSD 6.0 release


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.4.1 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.16 src/usr.bin/calendar/calendars/calendar.netbsd:1.16.4.1
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.16	Tue Sep  9 18:47:19 2008
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Wed Oct 17 20:54:03 2012
@@ -71,6 +71,7 @@
 10/13   NetBSD/iyonix port started, 2004
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 11/02   NetBSD 2.1 released, 2005



CVS commit: [netbsd-6] src/doc

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 20:54:06 UTC 2012

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

Log Message:
Welcome to 6.0_STABLE!


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

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

Added files:

Index: src/doc/CHANGES-6.1
diff -u /dev/null src/doc/CHANGES-6.1:1.1.2.1
--- /dev/null	Wed Oct 17 20:54:06 2012
+++ src/doc/CHANGES-6.1	Wed Oct 17 20:54:06 2012
@@ -0,0 +1,9 @@
+# $NetBSD: CHANGES-6.1,v 1.1.2.1 2012/10/17 20:54:06 riz Exp $
+
+A complete list of changes from the 6.0 release until the 6.1 release:
+
+gnu/usr.bin/groff/tmac/mdoc.local		patched by hand
+sys/sys/param.h	patched by hand
+
+	Welcome to 6.0_STABLE!
+



CVS commit: [netbsd-5-1] src/usr.bin/calendar/calendars

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:54:07 UTC 2012

Modified Files:
src/usr.bin/calendar/calendars [netbsd-5-1]: calendar.netbsd

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #1802):
usr.bin/calendar/calendars/calendar.netbsd: revision 1.22
note NetBSD 6.0 release


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.12.1 \
src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.16 src/usr.bin/calendar/calendars/calendar.netbsd:1.16.12.1
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.16	Tue Sep  9 18:47:19 2008
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Wed Oct 17 20:54:07 2012
@@ -71,6 +71,7 @@
 10/13   NetBSD/iyonix port started, 2004
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 11/02   NetBSD 2.1 released, 2005



CVS commit: [netbsd-5-0] src/usr.bin/calendar/calendars

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:54:12 UTC 2012

Modified Files:
src/usr.bin/calendar/calendars [netbsd-5-0]: calendar.netbsd

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #1802):
usr.bin/calendar/calendars/calendar.netbsd: revision 1.22
note NetBSD 6.0 release


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.8.1 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.16 src/usr.bin/calendar/calendars/calendar.netbsd:1.16.8.1
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.16	Tue Sep  9 18:47:19 2008
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Wed Oct 17 20:54:12 2012
@@ -71,6 +71,7 @@
 10/13   NetBSD/iyonix port started, 2004
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 11/02   NetBSD 2.1 released, 2005



CVS commit: [netbsd-5-1] src/doc

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:57:02 UTC 2012

Modified Files:
src/doc [netbsd-5-1]: CHANGES-5.1.3

Log Message:
tickets 1801, 1802


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

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-5.1.3
diff -u src/doc/CHANGES-5.1.3:1.1.2.24 src/doc/CHANGES-5.1.3:1.1.2.25
--- src/doc/CHANGES-5.1.3:1.1.2.24	Sun Sep 30 18:13:29 2012
+++ src/doc/CHANGES-5.1.3	Wed Oct 17 20:57:02 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.1.3,v 1.1.2.24 2012/09/30 18:13:29 bouyer Exp $
+# $NetBSD: CHANGES-5.1.3,v 1.1.2.25 2012/10/17 20:57:02 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.1.2 release to the NetBSD 5.1.3
 release:
@@ -2206,3 +2206,17 @@ share/zoneinfo/australasia			1.27 via pa
 	  January 20 this year.  (Thanks to Steffen Thorsen.)
 	[apb, ticket #1798]
 
+dist/bind/CHANGESpatch
+dist/bind/versionpatch
+dist/bind/bin/named/query.c			patch   
+
+	fix CVE-2012-5166: Specially crafted DNS data can cause a
+	lockup in named.
+	[spz, ticket #1801]
+
+
+usr.bin/calendar/calendars/calendar.netbsd	1.22
+
+	note NetBSD 6.0 release
+	[jnemeth, ticket #1802]
+



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

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:57:15 UTC 2012

Modified Files:
src/doc [netbsd-5-0]: CHANGES-5.0.3

Log Message:
tickets 1801, 1802


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.83 -r1.1.2.84 src/doc/CHANGES-5.0.3

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-5.0.3
diff -u src/doc/CHANGES-5.0.3:1.1.2.83 src/doc/CHANGES-5.0.3:1.1.2.84
--- src/doc/CHANGES-5.0.3:1.1.2.83	Sun Sep 30 18:13:27 2012
+++ src/doc/CHANGES-5.0.3	Wed Oct 17 20:57:15 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.0.3,v 1.1.2.83 2012/09/30 18:13:27 bouyer Exp $
+# $NetBSD: CHANGES-5.0.3,v 1.1.2.84 2012/10/17 20:57:15 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.0.2 release to the NetBSD 5.0.3
 release:
@@ -5120,3 +5120,16 @@ share/zoneinfo/australasia			1.27 via pa
 	  January 20 this year.  (Thanks to Steffen Thorsen.)
 	[apb, ticket #1798]
 
+dist/bind/CHANGES   patch
+dist/bind/version   patch
+dist/bind/bin/named/query.c patch
+
+	fix CVE-2012-5166: Specially crafted DNS data can cause a
+	lockup in named.
+	[spz, ticket #1801]
+
+usr.bin/calendar/calendars/calendar.netbsd	1.22
+
+	note NetBSD 6.0 release
+	[jnemeth, ticket #1802]
+



CVS commit: [netbsd-5] src/doc

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 20:57:41 UTC 2012

Modified Files:
src/doc [netbsd-5]: CHANGES-5.2

Log Message:
tickets 1799, 1800, 1801, 1802


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.186 -r1.1.2.187 src/doc/CHANGES-5.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-5.2
diff -u src/doc/CHANGES-5.2:1.1.2.186 src/doc/CHANGES-5.2:1.1.2.187
--- src/doc/CHANGES-5.2:1.1.2.186	Sun Sep 30 18:19:34 2012
+++ src/doc/CHANGES-5.2	Wed Oct 17 20:57:41 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.186 2012/09/30 18:19:34 bouyer Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.187 2012/10/17 20:57:41 bouyer Exp $
 
 A complete list of changes from the NetBSD 5.1 release to the NetBSD 5.2
 release:
@@ -8650,3 +8650,26 @@ gnu/dist/binutils/binutils/arsup.c		patc
 	Fix buffer overflow in ar(1), from toolchain/46827
 	[christos, ticket #1793]
 
+bin/pax/ftree.c	1.42
+
+	deal properly with empty lines in spec file
+	[msaitoh, ticket #1799]
+
+sys/dev/pci/if_wm.c1.231 via patch
+
+	Add workaround for QEMU and the variants that fail on EEPROM access.
+	[msaitoh, ticket #1800]
+
+dist/bind/CHANGES   patch
+dist/bind/version   patch
+dist/bind/bin/named/query.c patch
+
+	fix CVE-2012-5166: Specially crafted DNS data can cause a
+	lockup in named.
+	[spz, ticket #1801]
+
+usr.bin/calendar/calendars/calendar.netbsd	1.22
+
+	note NetBSD 6.0 release
+	[jnemeth, ticket #1802]
+



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 20:59:08 UTC 2012

Removed Files:
src/usr.sbin/tcpdump [netbsd-6]: Makefile

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #541):
usr.sbin/tcpdump/Makefile: file removal
The movers came, a long time ago. Closes PR 44860.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r0 src/usr.sbin/tcpdump/Makefile

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



CVS commit: [netbsd-4] src/usr.bin/calendar/calendars

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 21:02:46 UTC 2012

Modified Files:
src/usr.bin/calendar/calendars [netbsd-4]: calendar.netbsd

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #1802):
usr.bin/calendar/calendars/calendar.netbsd: revision 1.22
note NetBSD 6.0 release


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.6.1 src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.14 src/usr.bin/calendar/calendars/calendar.netbsd:1.14.6.1
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.14	Mon Jan  9 18:45:00 2006
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Wed Oct 17 21:02:46 2012
@@ -71,6 +71,7 @@
 10/13   NetBSD/iyonix port started, 2004
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 11/02   NetBSD 2.1 released, 2005



CVS commit: [netbsd-4] src/doc

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 21:03:59 UTC 2012

Modified Files:
src/doc [netbsd-4]: CHANGES-4.1

Log Message:
ticket #1460


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.250 -r1.1.2.251 src/doc/CHANGES-4.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-4.1
diff -u src/doc/CHANGES-4.1:1.1.2.250 src/doc/CHANGES-4.1:1.1.2.251
--- src/doc/CHANGES-4.1:1.1.2.250	Sun Sep 30 18:23:06 2012
+++ src/doc/CHANGES-4.1	Wed Oct 17 21:03:59 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.1,v 1.1.2.250 2012/09/30 18:23:06 bouyer Exp $
+#	$NetBSD: CHANGES-4.1,v 1.1.2.251 2012/10/17 21:03:59 bouyer Exp $
 
 A complete list of changes from the NetBSD 4.0 release to the NetBSD 4.1
 release:
@@ -4764,3 +4764,8 @@ share/zoneinfo/australasia			1.27 via pa
 	  January 20 this year.  (Thanks to Steffen Thorsen.)
 	[apb, ticket #1458]
 
+usr.bin/calendar/calendars/calendar.netbsd	1.22
+
+	note NetBSD 6.0 release
+	[jnemeth, ticket #1460]
+



CVS commit: [netbsd-4-0] src/usr.bin/calendar/calendars

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 21:04:40 UTC 2012

Modified Files:
src/usr.bin/calendar/calendars [netbsd-4-0]: calendar.netbsd

Log Message:
Pull up following revision(s) (requested by jnemeth in ticket #1460):
usr.bin/calendar/calendars/calendar.netbsd: revision 1.22
note NetBSD 6.0 release


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.10.1 \
src/usr.bin/calendar/calendars/calendar.netbsd

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/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.14 src/usr.bin/calendar/calendars/calendar.netbsd:1.14.10.1
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.14	Mon Jan  9 18:45:00 2006
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Wed Oct 17 21:04:39 2012
@@ -71,6 +71,7 @@
 10/13   NetBSD/iyonix port started, 2004
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 11/02   NetBSD 2.1 released, 2005



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

2012-10-17 Thread Manuel Bouyer
Module Name:src
Committed By:   bouyer
Date:   Wed Oct 17 21:05:02 UTC 2012

Modified Files:
src/doc [netbsd-4-0]: CHANGES-4.0.2

Log Message:
ticket #1460


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.109 -r1.1.2.110 src/doc/CHANGES-4.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-4.0.2
diff -u src/doc/CHANGES-4.0.2:1.1.2.109 src/doc/CHANGES-4.0.2:1.1.2.110
--- src/doc/CHANGES-4.0.2:1.1.2.109	Sun Sep 30 18:23:53 2012
+++ src/doc/CHANGES-4.0.2	Wed Oct 17 21:05:01 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: CHANGES-4.0.2,v 1.1.2.109 2012/09/30 18:23:53 bouyer Exp $
+#	$NetBSD: CHANGES-4.0.2,v 1.1.2.110 2012/10/17 21:05:01 bouyer Exp $
 
 A complete list of changes from the NetBSD 4.0.1 release to the NetBSD 4.0.2
 release:
@@ -1481,3 +1481,8 @@ share/zoneinfo/australasia			1.27 via pa
 	  January 20 this year.  (Thanks to Steffen Thorsen.)
 	[apb, ticket #1458]
 
+usr.bin/calendar/calendars/calendar.netbsd	1.22
+
+	note NetBSD 6.0 release
+	[jnemeth, ticket #1460]
+



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:06:56 UTC 2012

Modified Files:
src/sys/dev/sysmon [netbsd-6]: sysmon_envsys.c sysmon_envsys_events.c
sysmon_envsysvar.h

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #544):
sys/dev/sysmon/sysmon_envsysvar.h: revision 1.42
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.99
sys/dev/sysmon/sysmon_envsys.c: revision 1.119
When unregistering a sensor device, make sure we unregister and delete
all the associated events.


To generate a diff of this commit:
cvs rdiff -u -r1.117 -r1.117.8.1 src/sys/dev/sysmon/sysmon_envsys.c
cvs rdiff -u -r1.98 -r1.98.8.1 src/sys/dev/sysmon/sysmon_envsys_events.c
cvs rdiff -u -r1.40 -r1.40.8.1 src/sys/dev/sysmon/sysmon_envsysvar.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/sysmon/sysmon_envsys.c
diff -u src/sys/dev/sysmon/sysmon_envsys.c:1.117 src/sys/dev/sysmon/sysmon_envsys.c:1.117.8.1
--- src/sys/dev/sysmon/sysmon_envsys.c:1.117	Mon Aug  1 12:28:53 2011
+++ src/sys/dev/sysmon/sysmon_envsys.c	Wed Oct 17 21:06:56 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_envsys.c,v 1.117 2011/08/01 12:28:53 mbalmer Exp $	*/
+/*	$NetBSD: sysmon_envsys.c,v 1.117.8.1 2012/10/17 21:06:56 riz Exp $	*/
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys.c,v 1.117 2011/08/01 12:28:53 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys.c,v 1.117.8.1 2012/10/17 21:06:56 riz Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -602,6 +602,7 @@ sysmon_envsys_sensor_detach(struct sysmo
 	/*
 	 * remove it and decrement the sensors count.
 	 */
+	sme_event_unregister_sensor(sme, edata);
 	TAILQ_REMOVE(sme-sme_sensors_list, edata, sensors_head);
 	sme-sme_nsensors--;
 	sysmon_envsys_release(sme, true);

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.98 src/sys/dev/sysmon/sysmon_envsys_events.c:1.98.8.1
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.98	Wed Jun  8 16:14:57 2011
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Wed Oct 17 21:06:55 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.98 2011/06/08 16:14:57 pgoyette Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.98.8.1 2012/10/17 21:06:55 riz Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.98 2011/06/08 16:14:57 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.98.8.1 2012/10/17 21:06:55 riz Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -77,6 +77,8 @@ static bool sme_battery_check(void);
 static bool sme_battery_critical(envsys_data_t *);
 static bool sme_acadapter_check(void);
 
+static void sme_remove_event(sme_event_t *, struct sysmon_envsys *);
+
 /*
  * sme_event_register:
  *
@@ -334,11 +336,11 @@ sme_event_unregister_all(struct sysmon_e
 			break;
 
 		if (strcmp(see-see_pes.pes_dvname, sme-sme_name) == 0) {
-			LIST_REMOVE(see, see_list);
 			DPRINTF((%s: event %s %d removed (%s)\n, __func__,
 			see-see_pes.pes_sensname, see-see_type,
 			sme-sme_name));
-			kmem_free(see, sizeof(*see));
+			sme_remove_event(see, sme);
+
 			evcounter--;
 		}
 	}
@@ -386,6 +388,56 @@ sme_event_unregister(struct sysmon_envsy
 
 	DPRINTF((%s: removed dev=%s sensor=%s type=%d\n,
 	__func__, see-see_pes.pes_dvname, sensor, type));
+
+	sme_remove_event(see, sme);
+
+	mutex_exit(sme-sme_mtx);
+	return 0;
+}
+
+/*
+ * sme_event_unregister_sensor:
+ *
+ *	+ Unregisters any event associated with a specific sensor
+ *	  The caller must already own the sme_mtx.
+ */
+int
+sme_event_unregister_sensor(struct sysmon_envsys *sme, envsys_data_t *edata)
+{
+	sme_event_t *see;
+	bool found = false;
+
+	KASSERT(mutex_owned(sme-sme_mtx));
+	LIST_FOREACH(see, sme-sme_events_list, see_list) {
+		if (see-see_edata == edata) {
+			found = true;
+			break;
+		}
+	}
+	if (!found)
+		return EINVAL;
+
+	/*
+	 * Wait for the event to finish its work, remove from the list
+	 * and release resouces.
+	 */
+	while (see-see_flags  SEE_EVENT_WORKING)
+		cv_wait(sme-sme_condvar, sme-sme_mtx);
+
+	DPRINTF((%s: removed dev=%s sensor=%s\n,
+	__func__, see-see_pes.pes_dvname, edata-desc));
+
+	sme_remove_event(see, sme);
+
+	return 0;
+}
+
+static void
+sme_remove_event(sme_event_t *see, struct sysmon_envsys *sme)
+{
+
+	KASSERT(mutex_owned(sme-sme_mtx));
+
 	LIST_REMOVE(see, see_list);
 	/*
 	 * So the events list is empty, we'll do the following:
@@ -395,10 +447,8 @@ sme_event_unregister(struct sysmon_envsy
 	 */
 	if (LIST_EMPTY(sme-sme_events_list))
 		sme_events_destroy(sme);
-	mutex_exit(sme-sme_mtx);
 
 	kmem_free(see, sizeof(*see));
-	return 0;
 }
 
 /*

Index: src/sys/dev/sysmon/sysmon_envsysvar.h
diff -u 

CVS commit: [netbsd-6] src

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:13:39 UTC 2012

Modified Files:
src/share/man/man4 [netbsd-6]: swsensor.4
src/sys/dev/sysmon [netbsd-6]: swsensor.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #546):
sys/dev/sysmon/swsensor.c: revision 1.13
share/man/man4/swsensor.4: revision 1.11
share/man/man4/swsensor.4: revision 1.12
Add hw.swsensor.state variable for additional control capability.
Mention the new sysctl variable just created.
Drop trailing whitespace.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.4.1 src/share/man/man4/swsensor.4
cvs rdiff -u -r1.12 -r1.12.8.1 src/sys/dev/sysmon/swsensor.c

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

Modified files:

Index: src/share/man/man4/swsensor.4
diff -u src/share/man/man4/swsensor.4:1.10 src/share/man/man4/swsensor.4:1.10.4.1
--- src/share/man/man4/swsensor.4:1.10	Sun Jun 19 07:17:18 2011
+++ src/share/man/man4/swsensor.4	Wed Oct 17 21:13:39 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: swsensor.4,v 1.10 2011/06/19 07:17:18 wiz Exp $
+.\	$NetBSD: swsensor.4,v 1.10.4.1 2012/10/17 21:13:39 riz Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation
 .\ All rights reserved.
@@ -27,7 +27,7 @@
 .\ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\ POSSIBILITY OF SUCH DAMAGE.
 .\
-.Dd June 19, 2011
+.Dd August 27, 2012
 .Dt SWSENSOR 4
 .Os
 .Sh NAME
@@ -112,10 +112,13 @@ while
 .Dl Ic modload -i mode=1 -i limit=50 swsensor
 will create a sensor which has an initial, device-provided limit of 50.
 .Pp
-The sensor's raw value can be manually updated by modifying the
+The sensor's raw value and state can be manually updated by modifying the
 .Xr sysctl 8
-variable
-.Dq hw.swsensor.cur_value .
+variables
+.Dq hw.swsensor.cur_value
+and
+.Dq hw.swsensor.state
+variables respectively.
 .Sh SEE ALSO
 .Xr modctl 2 ,
 .Xr envstat 8 ,

Index: src/sys/dev/sysmon/swsensor.c
diff -u src/sys/dev/sysmon/swsensor.c:1.12 src/sys/dev/sysmon/swsensor.c:1.12.8.1
--- src/sys/dev/sysmon/swsensor.c:1.12	Sun Jun 19 15:52:48 2011
+++ src/sys/dev/sysmon/swsensor.c	Wed Oct 17 21:13:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: swsensor.c,v 1.12 2011/06/19 15:52:48 pgoyette Exp $ */
+/*	$NetBSD: swsensor.c,v 1.12.8.1 2012/10/17 21:13:38 riz Exp $ */
 /*
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: swsensor.c,v 1.12 2011/06/19 15:52:48 pgoyette Exp $);
+__KERNEL_RCSID(0, $NetBSD: swsensor.c,v 1.12.8.1 2012/10/17 21:13:38 riz Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -48,11 +48,13 @@ int swsensorattach(int);
 static struct sysctllog *swsensor_sysctllog = NULL;
 
 static int sensor_value_sysctl = 0;
+static int sensor_state_sysctl = 0;
 
 static struct sysmon_envsys *swsensor_sme;
 static envsys_data_t swsensor_edata;
 
 static int32_t sw_sensor_value;
+static int32_t sw_sensor_state;
 static int32_t sw_sensor_limit;
 static int32_t sw_sensor_mode;
 static int32_t sw_sensor_defprops;
@@ -71,6 +73,7 @@ sysctl_swsensor_setup(void)
 	int ret;
 	int node_sysctl_num;
 	const struct sysctlnode *me = NULL;
+	const struct sysctlnode *me2;
 
 	KASSERT(swsensor_sysctllog == NULL);
 
@@ -83,14 +86,24 @@ sysctl_swsensor_setup(void)
 		return;
 
 	node_sysctl_num = me-sysctl_num;
-	ret = sysctl_createv(swsensor_sysctllog, 0, NULL, me,
+	ret = sysctl_createv(swsensor_sysctllog, 0, NULL, me2,
 			 CTLFLAG_READWRITE,
 			 CTLTYPE_INT, cur_value, NULL,
 			 NULL, 0, sw_sensor_value, 0,
 			 CTL_HW, node_sysctl_num, CTL_CREATE, CTL_EOL);
 
 	if (ret == 0)
-		sensor_value_sysctl = me-sysctl_num;
+		sensor_value_sysctl = me2-sysctl_num;
+
+	node_sysctl_num = me-sysctl_num;
+	ret = sysctl_createv(swsensor_sysctllog, 0, NULL, me2,
+			 CTLFLAG_READWRITE,
+			 CTLTYPE_INT, state, NULL,
+			 NULL, 0, sw_sensor_state, 0,
+			 CTL_HW, node_sysctl_num, CTL_CREATE, CTL_EOL);
+
+	if (ret == 0)
+		sensor_state_sysctl = me2-sysctl_num;
 }
 
 /*
@@ -115,8 +128,12 @@ swsensor_refresh(struct sysmon_envsys *s
 	/*
 	 * Set state.  If we're handling the limits ourselves, do the
 	 * compare; otherwise just assume the value is valid.
+	 * If sensor state has been set from userland (via sysctl),
+	 * just report that value.
 	 */
-	if ((sw_sensor_mode == 2)  (edata-upropset  PROP_CRITMIN) 
+	if (sw_sensor_state != ENVSYS_SVALID)
+		edata-state = sw_sensor_state;
+	else if ((sw_sensor_mode == 2)  (edata-upropset  PROP_CRITMIN) 
 	(edata-upropset  PROP_DRIVER_LIMITS) 
 	(edata-value_cur  edata-limits.sel_critmin))
 		edata-state = ENVSYS_SCRITUNDER;
@@ -321,6 +338,7 @@ swsensor_init(void *arg)
 
 	/* Wait for refresh to validate the sensor value */
 	swsensor_edata.state = ENVSYS_SINVALID;
+	sw_sensor_state = ENVSYS_SVALID;
 
 	error = sysmon_envsys_sensor_attach(swsensor_sme, 

CVS commit: [netbsd-6] src

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:21:44 UTC 2012

Modified Files:
src/etc/powerd/scripts [netbsd-6]: sensor_indicator
src/sys/dev/sysmon [netbsd-6]: sysmon_envsys_events.c
sysmon_envsys_tables.c sysmon_envsysvar.h
src/sys/sys [netbsd-6]: envsys.h

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #545):
etc/powerd/scripts/sensor_indicator: revision 1.5
sys/dev/sysmon/sysmon_envsys_tables.c: revision 1.11
sys/sys/envsys.h: revision 1.32
sys/dev/sysmon/sysmon_envsysvar.h: revision 1.43
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.104
Provide names for the values associated with INDICATOR sensors.
1. Enable use of FMONSTCHANGED events for INDICATOR sensors
2. Update handling of FMONCRITICAL event reporting.   The state
transition does not require a corresponding change in value.
With these changes, you can now have an INDICATOR sensor that
reports the presence or absence of a device, and (if the device
is present) separately monitor it for proper functioning.
Should address the concerns expressed recently with the commit
of changes to wmi(4) BBU handling.
Handle any reports of state changes for INDICATORs


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.32.1 src/etc/powerd/scripts/sensor_indicator
cvs rdiff -u -r1.98.8.1 -r1.98.8.2 src/sys/dev/sysmon/sysmon_envsys_events.c
cvs rdiff -u -r1.10 -r1.10.8.1 src/sys/dev/sysmon/sysmon_envsys_tables.c
cvs rdiff -u -r1.40.8.1 -r1.40.8.2 src/sys/dev/sysmon/sysmon_envsysvar.h
cvs rdiff -u -r1.31 -r1.31.16.1 src/sys/sys/envsys.h

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

Modified files:

Index: src/etc/powerd/scripts/sensor_indicator
diff -u src/etc/powerd/scripts/sensor_indicator:1.4 src/etc/powerd/scripts/sensor_indicator:1.4.32.1
--- src/etc/powerd/scripts/sensor_indicator:1.4	Thu Oct 11 00:30:47 2007
+++ src/etc/powerd/scripts/sensor_indicator	Wed Oct 17 21:21:43 2012
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: sensor_indicator,v 1.4 2007/10/11 00:30:47 xtraeme Exp $
+#	$NetBSD: sensor_indicator,v 1.4.32.1 2012/10/17 21:21:43 riz Exp $
 #
 # Generic script for indicator and integer sensors.
 #
@@ -33,6 +33,10 @@ warning-over)
 	logger -p warning ${0}: ($1) warning limit exceeded [${3}] 1
 	exit 0
 	;;
+state-changed)
+	logger -p warning ${0}: ($1) state changed [${3}] : ${4} 1
+	exit 0
+	;;
 *)
 	logger -p warning ${0}: unsupported event ${2} on device ${1} 1
 	exit 1

Index: src/sys/dev/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.98.8.1 src/sys/dev/sysmon/sysmon_envsys_events.c:1.98.8.2
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.98.8.1	Wed Oct 17 21:06:55 2012
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Wed Oct 17 21:21:43 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.98.8.1 2012/10/17 21:06:55 riz Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.98.8.2 2012/10/17 21:21:43 riz Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.98.8.1 2012/10/17 21:06:55 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.98.8.2 2012/10/17 21:21:43 riz Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -206,26 +206,28 @@ sme_event_register(prop_dictionary_t sdi
 		see-see_pes.pes_type = powertype;
 
 		switch (crittype) {
-		case PENVSYS_EVENT_LIMITS:
-			see-see_evsent = ENVSYS_SVALID;
-			break;
 		case PENVSYS_EVENT_CAPACITY:
-			see-see_evsent = ENVSYS_BATTERY_CAPACITY_NORMAL;
+			see-see_evstate = ENVSYS_BATTERY_CAPACITY_NORMAL;
 			break;
 		case PENVSYS_EVENT_STATE_CHANGED:
 			if (edata-units == ENVSYS_BATTERY_CAPACITY)
-see-see_evsent = ENVSYS_BATTERY_CAPACITY_NORMAL;
+see-see_evstate = 
+ENVSYS_BATTERY_CAPACITY_NORMAL;
 			else if (edata-units == ENVSYS_DRIVE)
-see-see_evsent = ENVSYS_DRIVE_EMPTY;
+see-see_evstate = ENVSYS_DRIVE_EMPTY;
+			else if (edata-units == ENVSYS_INDICATOR)
+see-see_evstate = ENVSYS_SVALID;
 			else
 panic(%s: bad units for 
   PENVSYS_EVENT_STATE_CHANGED, __func__);
 			break;
 		case PENVSYS_EVENT_CRITICAL:
+		case PENVSYS_EVENT_LIMITS:
 		default:
-			see-see_evsent = 0;
+			see-see_evstate = ENVSYS_SVALID;
 			break;
 		}
+		see-see_evvalue = 0;
 
 		(void)strlcpy(see-see_pes.pes_dvname, sme-sme_name,
 		sizeof(see-see_pes.pes_dvname));
@@ -832,7 +834,7 @@ sme_deliver_event(sme_event_t *see)
 		/*
 		 * Send event if state has changed
 		 */
-		if (edata-state == see-see_evsent)
+		if (edata-state == see-see_evstate)
 			break;
 
 		for (i = 0; sse[i].state != -1; i++)
@@ -848,7 +850,7 @@ sme_deliver_event(sme_event_t *see)
 		else
 			sysmon_penvsys_event(see-see_pes, sse[i].event);
 
-		see-see_evsent = edata-state;
+		see-see_evstate = edata-state;
 		DPRINTFOBJ((%s: (%s) 

CVS commit: [netbsd-6] src/sys

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:27:12 UTC 2012

Modified Files:
src/sys/kern [netbsd-6]: kern_rndq.c subr_cprng.c
src/sys/sys [netbsd-6]: rnd.h

Log Message:
Pull up following revision(s) (requested by tls in ticket #558):
sys/sys/rnd.h: revision 1.33
sys/kern/subr_cprng.c: revision 1.10
sys/kern/kern_rndq.c: revision 1.4
sys/kern/subr_cprng.c: revision 1.11
sys/kern/kern_rndq.c: revision 1.5
Try to help embedded systems a _little_ bit: stir in the system boot time
as early as possible.  On systems with no cycle counter (or very very
predictable cycle counts early in boot) at least this will cause some
difference across boots.
Don't wait until the pool *fills* to rekey anything that was keyed with
insufficient entropy at boot: key it as soon as it makes any request after
we hit the minimum entropy threshold.
This too should help avoid predictable output at boot time.
Fix kern/46911: note that we rekeyed the cprng so we don't keep doing so.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/sys/kern/kern_rndq.c
cvs rdiff -u -r1.5.2.3 -r1.5.2.4 src/sys/kern/subr_cprng.c
cvs rdiff -u -r1.29.2.2 -r1.29.2.3 src/sys/sys/rnd.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/kern/kern_rndq.c
diff -u src/sys/kern/kern_rndq.c:1.1.2.2 src/sys/kern/kern_rndq.c:1.1.2.3
--- src/sys/kern/kern_rndq.c:1.1.2.2	Fri Apr 20 23:35:20 2012
+++ src/sys/kern/kern_rndq.c	Wed Oct 17 21:27:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_rndq.c,v 1.1.2.2 2012/04/20 23:35:20 riz Exp $	*/
+/*	$NetBSD: kern_rndq.c,v 1.1.2.3 2012/10/17 21:27:12 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.1.2.2 2012/04/20 23:35:20 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_rndq.c,v 1.1.2.3 2012/10/17 21:27:12 riz Exp $);
 
 #include sys/param.h
 #include sys/ioctl.h
@@ -168,7 +168,7 @@ static	  void	rnd_add_data_ts(krndso
 	uint32_t, uint32_t, uint32_t);
 
 int			rnd_ready = 0;
-static int		rnd_have_entropy = 0;
+int			rnd_initial_entropy = 0;
 
 #ifdef DIAGNOSTIC
 static int		rnd_tested = 0;
@@ -255,11 +255,11 @@ rnd_wakeup_readers(void)
 	 */
 	if (rndpool_get_entropy_count(rnd_pool)  RND_ENTROPY_THRESHOLD * 8) {
 #ifdef RND_VERBOSE
-		if (!rnd_have_entropy)
+		if (!rnd_initial_entropy)
 			printf(rnd: have initial entropy (%u)\n,
 			   rndpool_get_entropy_count(rnd_pool));
 #endif
-		rnd_have_entropy = 1;
+		rnd_initial_entropy = 1;
 		mutex_spin_exit(rndpool_mtx);
 	} else {
 		mutex_spin_exit(rndpool_mtx);
@@ -447,7 +447,7 @@ rnd_init(void)
 	 RND_POOLBITS / 2));
 		if (rndpool_get_entropy_count(rnd_pool) 
 		RND_ENTROPY_THRESHOLD * 8) {
-	rnd_have_entropy = 1;
+	rnd_initial_entropy = 1;
 		}
 mutex_spin_exit(rndpool_mtx);
 #ifdef RND_VERBOSE
@@ -904,9 +904,17 @@ rnd_timeout(void *arg)
 u_int32_t
 rnd_extract_data_locked(void *p, u_int32_t len, u_int32_t flags)
 {
+	static int timed_in;
 
 	KASSERT(mutex_owned(rndpool_mtx));
-	if (!rnd_have_entropy) {
+	if (__predict_false(!timed_in)) {
+		if (boottime.tv_sec) {
+			rndpool_add_data(rnd_pool, boottime,
+	 sizeof(boottime), 0);
+		}
+		timed_in++;
+	}
+	if (__predict_false(!rnd_initial_entropy)) {
 		u_int32_t c;
 
 #ifdef RND_VERBOSE

Index: src/sys/kern/subr_cprng.c
diff -u src/sys/kern/subr_cprng.c:1.5.2.3 src/sys/kern/subr_cprng.c:1.5.2.4
--- src/sys/kern/subr_cprng.c:1.5.2.3	Mon May 21 16:49:54 2012
+++ src/sys/kern/subr_cprng.c	Wed Oct 17 21:27:12 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_cprng.c,v 1.5.2.3 2012/05/21 16:49:54 jdc Exp $ */
+/*	$NetBSD: subr_cprng.c,v 1.5.2.4 2012/10/17 21:27:12 riz Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -46,7 +46,7 @@
 
 #include sys/cprng.h
 
-__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.3 2012/05/21 16:49:54 jdc Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_cprng.c,v 1.5.2.4 2012/10/17 21:27:12 riz Exp $);
 
 void
 cprng_init(void)
@@ -171,7 +171,7 @@ cprng_strong_create(const char *const na
 	c-reseed.state = RSTATE_IDLE;
 	c-reseed.cb = cprng_strong_reseed;
 	c-reseed.arg = c;
-	c-entropy_serial = rnd_filled;
+	c-entropy_serial = rnd_initial_entropy ? rnd_filled : -1;
 	mutex_init(c-reseed.mtx, MUTEX_DEFAULT, IPL_VM);
 	strlcpy(c-reseed.name, name, sizeof(c-reseed.name));
 
@@ -228,8 +228,15 @@ cprng_strong(cprng_strong_t *const c, vo
 	}
 	mutex_enter(c-mtx);
 
+	/* If we were initialized with the pool empty, rekey ASAP */
+	if (__predict_false(c-entropy_serial == -1)  rnd_initial_entropy) {
+		c-entropy_serial = 0;
+		goto rekeyany;		/* We have _some_ entropy, use it. */
+	}
+		
 	if (nist_ctr_drbg_generate(c-drbg, p, len, cc, sizeof(cc))) {
 		/* A generator failure really means we hit the hard limit. */
+rekeyany:
 		if 

CVS commit: [netbsd-6] src/external/gpl3/gcc/dist/gcc/config/i386

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:30:33 UTC 2012

Modified Files:
src/external/gpl3/gcc/dist/gcc/config/i386 [netbsd-6]: i386.c i386.h
netbsd-elf.h netbsd64.h

Log Message:
Pull up following revision(s) (requested by joerg in ticket #560):
external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h: revision 1.3
external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h: revision 1.2
external/gpl3/gcc/dist/gcc/config/i386/i386.c: revision 1.2
external/gpl3/gcc/dist/gcc/config/i386/i386.h: revision 1.2
Fix GCC to correctly implement the i386 psABI on NetBSD.
This consists of two parts:
- for NetBSD/i386 and NetBSD/AMD64 with -m32, use a default stack
  alignment of 23bit as specified by the ABI
- ensure that double and long long variables on the stack are by default
  only aligned to 32bit, if there is nothing else in the function
  needing a larger stack alignment
The combination ensures that SSE variables on the stack trigger the
realignment logic, but just using double or long long doesn't.
PR 46978: ICE on spilling MMX registers
GCC/i386 has code to lower the required alignment for long long to 32bit
as the CPU doesn't need more. It is also using the same mode for setting
up the MMX registers and in turn, the stack slots reserved for spilling
require 32bit alignment. The actual vector types used keep the original
64bit alignment, so when the compiler wants to spill a MMX register, it
hits an assertion. Fix this by using the vector type as raw type for MMX
registers.


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r1.1.1.1.4.1 \
src/external/gpl3/gcc/dist/gcc/config/i386/i386.c \
src/external/gpl3/gcc/dist/gcc/config/i386/i386.h \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h
cvs rdiff -u -r1.2 -r1.2.2.1 \
src/external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.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/gpl3/gcc/dist/gcc/config/i386/i386.c
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.1.1.1.4.1
--- src/external/gpl3/gcc/dist/gcc/config/i386/i386.c:1.1.1.1	Tue Jun 21 01:22:07 2011
+++ src/external/gpl3/gcc/dist/gcc/config/i386/i386.c	Wed Oct 17 21:30:32 2012
@@ -20104,7 +20104,9 @@ ix86_local_alignment (tree exp, enum mac
   if (!TARGET_64BIT
align == 64
ix86_preferred_stack_boundary  64
-   (mode == DImode || (type  TYPE_MODE (type) == DImode))
+   (mode == DImode || (type  TYPE_MODE (type) == DImode)
+  || mode == DFmode || (type  TYPE_MODE (type) == DFmode)
+  || mode == DCmode || (type  TYPE_MODE (type) == DCmode))
(!type || !TYPE_USER_ALIGN (type))
(!decl || !DECL_USER_ALIGN (decl)))
 align = 32;
@@ -20150,7 +20152,8 @@ ix86_local_alignment (tree exp, enum mac
 	|| TREE_CODE (type) == QUAL_UNION_TYPE)
 	TYPE_FIELDS (type))
 {
-  if (DECL_MODE (TYPE_FIELDS (type)) == DFmode  align  64)
+  if (DECL_MODE (TYPE_FIELDS (type)) == DFmode  align  64
+   (TARGET_64BIT || ix86_preferred_stack_boundary = 64))
 	return 64;
   if (ALIGN_MODE_128 (DECL_MODE (TYPE_FIELDS (type)))  align  128)
 	return 128;
@@ -20159,7 +20162,8 @@ ix86_local_alignment (tree exp, enum mac
 	   || TREE_CODE (type) == INTEGER_TYPE)
 {
 
-  if (TYPE_MODE (type) == DFmode  align  64)
+  if (TYPE_MODE (type) == DFmode  align  64
+   (TARGET_64BIT || ix86_preferred_stack_boundary = 64))
 	return 64;
   if (ALIGN_MODE_128 (TYPE_MODE (type))  align  128)
 	return 128;
Index: src/external/gpl3/gcc/dist/gcc/config/i386/i386.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/i386.h:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/i386/i386.h:1.1.1.1.4.1
--- src/external/gpl3/gcc/dist/gcc/config/i386/i386.h:1.1.1.1	Tue Jun 21 01:22:05 2011
+++ src/external/gpl3/gcc/dist/gcc/config/i386/i386.h	Wed Oct 17 21:30:33 2012
@@ -1081,6 +1081,7 @@ enum target_cpu_default
 
 #define HARD_REGNO_CALLER_SAVE_MODE(REGNO, NREGS, MODE)			\
   (CC_REGNO_P (REGNO) ? VOIDmode	\
+   : MMX_REGNO_P (REGNO) ? V8QImode	\
: (MODE) == VOIDmode  (NREGS) != 1 ? VOIDmode			\
: (MODE) == VOIDmode ? choose_hard_reg_mode ((REGNO), (NREGS), false) \
: (MODE) == HImode  !TARGET_PARTIAL_REG_STALL ? SImode		\
Index: src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h
diff -u src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.1.1.1 src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.1.1.1.4.1
--- src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h:1.1.1.1	Tue Jun 21 01:22:04 2011
+++ src/external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h	Wed Oct 17 21:30:31 2012
@@ -70,3 +70,7 @@ along with GCC; see the file COPYING3.  
 #define ENABLE_EXECUTE_STACK NETBSD_ENABLE_EXECUTE_STACK
 
 #define TARGET_VERSION fprintf (stderr,  (NetBSD/x86_64 ELF));
+
+/* 

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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:33:17 UTC 2012

Modified Files:
src/sys/arch/amd64/conf [netbsd-6]: XEN3_DOM0
src/sys/arch/i386/conf [netbsd-6]: XEN3_DOM0

Log Message:
Pull up following revision(s) (requested by khorben in ticket #572):
sys/arch/i386/conf/XEN3_DOM0: revision 1.70
sys/arch/amd64/conf/XEN3_DOM0: revision 1.88
Enable support for synaptics touchpads when running Xen as domain 0; helps
usability on laptops. Fixes PR port-xen/44055.
ok bouyer@ riz@


To generate a diff of this commit:
cvs rdiff -u -r1.77.2.6 -r1.77.2.7 src/sys/arch/amd64/conf/XEN3_DOM0
cvs rdiff -u -r1.60.2.5 -r1.60.2.6 src/sys/arch/i386/conf/XEN3_DOM0

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/conf/XEN3_DOM0
diff -u src/sys/arch/amd64/conf/XEN3_DOM0:1.77.2.6 src/sys/arch/amd64/conf/XEN3_DOM0:1.77.2.7
--- src/sys/arch/amd64/conf/XEN3_DOM0:1.77.2.6	Wed Aug 15 15:32:59 2012
+++ src/sys/arch/amd64/conf/XEN3_DOM0	Wed Oct 17 21:33:17 2012
@@ -1,4 +1,4 @@
-# $NetBSD: XEN3_DOM0,v 1.77.2.6 2012/08/15 15:32:59 sborrill Exp $
+# $NetBSD: XEN3_DOM0,v 1.77.2.7 2012/10/17 21:33:17 riz Exp $
 
 include 	arch/amd64/conf/std.xen
 
@@ -534,6 +534,7 @@ pckbc0		at isa?			# pc keyboard controll
 pckbd*		at pckbc?		# PC keyboard
 pms*		at pckbc?		# PS/2 mouse for wsmouse
 #options 	PMS_DISABLE_POWERHOOK	# Disable PS/2 reset on resume
+options 	PMS_SYNAPTICS_TOUCHPAD	# Enable support for Synaptics Touchpads
 #vga0		at isa?
 vga*		at pci? dev ? function ?
 #pcdisplay0	at isa?			# CGA, MDA, EGA, HGA

Index: src/sys/arch/i386/conf/XEN3_DOM0
diff -u src/sys/arch/i386/conf/XEN3_DOM0:1.60.2.5 src/sys/arch/i386/conf/XEN3_DOM0:1.60.2.6
--- src/sys/arch/i386/conf/XEN3_DOM0:1.60.2.5	Wed Aug 15 15:33:00 2012
+++ src/sys/arch/i386/conf/XEN3_DOM0	Wed Oct 17 21:33:16 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: XEN3_DOM0,v 1.60.2.5 2012/08/15 15:33:00 sborrill Exp $
+#	$NetBSD: XEN3_DOM0,v 1.60.2.6 2012/10/17 21:33:16 riz Exp $
 #
 #	XEN3_0: Xen 3.0 domain0 kernel
 
@@ -512,6 +512,7 @@ pckbc0		at isa?			# PC keyboard controll
 pckbd*		at pckbc?		# PC keyboard
 pms*		at pckbc?		# PS/2 mouse for wsmouse
 #options 	PMS_DISABLE_POWERHOOK	# Disable PS/2 reset on resume
+options 	PMS_SYNAPTICS_TOUCHPAD	# Enable support for Synaptics Touchpads
 #vga0		at isa?
 vga*		at pci? dev ? function ?
 #pcdisplay0	at isa?			# CGA, MDA, EGA, HGA



CVS commit: src/sys

2012-10-17 Thread David Young
Module Name:src
Committed By:   dyoung
Date:   Wed Oct 17 21:35:39 UTC 2012

Modified Files:
src/sys/arch/x86/x86: mpbios.c
src/sys/dev/gpio: gpio.c

Log Message:
Quiet down autoconfiguration by changing some printf() calls to
aprint_normal() calls.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/x86/x86/mpbios.c
cvs rdiff -u -r1.50 -r1.51 src/sys/dev/gpio/gpio.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/mpbios.c
diff -u src/sys/arch/x86/x86/mpbios.c:1.58 src/sys/arch/x86/x86/mpbios.c:1.59
--- src/sys/arch/x86/x86/mpbios.c:1.58	Wed Aug  4 10:02:12 2010
+++ src/sys/arch/x86/x86/mpbios.c	Wed Oct 17 21:35:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mpbios.c,v 1.58 2010/08/04 10:02:12 jruoho Exp $	*/
+/*	$NetBSD: mpbios.c,v 1.59 2012/10/17 21:35:38 dyoung Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -96,7 +96,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mpbios.c,v 1.58 2010/08/04 10:02:12 jruoho Exp $);
+__KERNEL_RCSID(0, $NetBSD: mpbios.c,v 1.59 2012/10/17 21:35:38 dyoung Exp $);
 
 #include acpica.h
 #include lapic.h
@@ -221,7 +221,7 @@ mp_cpuprint(void *aux, const char *pnp)
 
 	if (pnp)
 		aprint_normal(cpu at %s, pnp);
-	printf( apid %d, caa-cpu_number);
+	aprint_normal( apid %d, caa-cpu_number);
 	return (UNCONF);
 }
 
@@ -232,7 +232,7 @@ mp_ioapicprint(void *aux, const char *pn
 
 	if (pnp)
 		aprint_normal(ioapic at %s, pnp);
-	printf( apid %d, aaa-apic_id);
+	aprint_normal( apid %d, aaa-apic_id);
 	return (UNCONF);
 }
 
@@ -506,13 +506,13 @@ mpbios_scan(device_t self, int *ncpup)
 
 	switch (mp_fps-spec_rev) {
 	case 1:
-		printf((Version 1.1));
+		aprint_normal((Version 1.1));
 		break;
 	case 4:
-		printf((Version 1.4));
+		aprint_normal((Version 1.4));
 		break;
 	default:
-		printf((unrecognized rev %d), mp_fps-spec_rev);
+		aprint_normal((unrecognized rev %d), mp_fps-spec_rev);
 	}
 
 	/*

Index: src/sys/dev/gpio/gpio.c
diff -u src/sys/dev/gpio/gpio.c:1.50 src/sys/dev/gpio/gpio.c:1.51
--- src/sys/dev/gpio/gpio.c:1.50	Fri Nov 25 13:49:43 2011
+++ src/sys/dev/gpio/gpio.c	Wed Oct 17 21:35:39 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: gpio.c,v 1.50 2011/11/25 13:49:43 mbalmer Exp $ */
+/* $NetBSD: gpio.c,v 1.51 2012/10/17 21:35:39 dyoung Exp $ */
 /*	$OpenBSD: gpio.c,v 1.6 2006/01/14 12:33:49 grange Exp $	*/
 
 /*
@@ -19,7 +19,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: gpio.c,v 1.50 2011/11/25 13:49:43 mbalmer Exp $);
+__KERNEL_RCSID(0, $NetBSD: gpio.c,v 1.51 2012/10/17 21:35:39 dyoung Exp $);
 
 /*
  * General Purpose Input/Output framework.
@@ -198,7 +198,7 @@ gpio_attach(device_t parent, device_t se
 	sc-sc_pins = gba-gba_pins;
 	sc-sc_npins = gba-gba_npins;
 
-	printf(: %d pins\n, sc-sc_npins);
+	aprint_normal(: %d pins\n, sc-sc_npins);
 
 	if (!pmf_device_register(self, NULL, gpio_resume))
 		aprint_error_dev(self, couldn't establish power handler\n);



CVS commit: [netbsd-6] src

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:37:12 UTC 2012

Modified Files:
src/usr.bin/nbperf [netbsd-6]: nbperf-bdz.c nbperf.1
Added Files:
src/tests/usr.bin/nbperf [netbsd-6]: h_nbperf.sh hash_driver.c
t_nbperf.sh

Log Message:
Pull up following revision(s) (requested by joerg in ticket #574):
tests/usr.bin/nbperf/hash_driver.c: revision 1.2
tests/usr.bin/nbperf/h_nbperf.sh: revision 1.2
tests/usr.bin/nbperf/t_nbperf.sh: revision 1.2
usr.bin/nbperf/nbperf.1: revision 1.5
usr.bin/nbperf/nbperf-bdz.c: revision 1.5
Simplify the BDZ compression function, making it smaller at the same
time. Fixes a bug where non-minimal hash functions could be created.
Add regression tests for BDZ, including the map output functionality.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.2.2.2 src/tests/usr.bin/nbperf/h_nbperf.sh \
src/tests/usr.bin/nbperf/hash_driver.c \
src/tests/usr.bin/nbperf/t_nbperf.sh
cvs rdiff -u -r1.4 -r1.4.4.1 src/usr.bin/nbperf/nbperf-bdz.c
cvs rdiff -u -r1.3.4.1 -r1.3.4.2 src/usr.bin/nbperf/nbperf.1

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/nbperf/nbperf-bdz.c
diff -u src/usr.bin/nbperf/nbperf-bdz.c:1.4 src/usr.bin/nbperf/nbperf-bdz.c:1.4.4.1
--- src/usr.bin/nbperf/nbperf-bdz.c:1.4	Fri Oct 21 23:47:11 2011
+++ src/usr.bin/nbperf/nbperf-bdz.c	Wed Oct 17 21:37:11 2012
@@ -1,6 +1,6 @@
-/*	$NetBSD: nbperf-bdz.c,v 1.4 2011/10/21 23:47:11 joerg Exp $	*/
+/*	$NetBSD: nbperf-bdz.c,v 1.4.4.1 2012/10/17 21:37:11 riz Exp $	*/
 /*-
- * Copyright (c) 2009 The NetBSD Foundation, Inc.
+ * Copyright (c) 2009, 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
@@ -36,7 +36,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: nbperf-bdz.c,v 1.4 2011/10/21 23:47:11 joerg Exp $);
+__RCSID($NetBSD: nbperf-bdz.c,v 1.4.4.1 2012/10/17 21:37:11 riz Exp $);
 
 #include err.h
 #include inttypes.h
@@ -72,10 +72,7 @@ struct state {
 	struct graph3 graph;
 	uint32_t *visited;
 	uint32_t *holes64k;
-	uint16_t *holes256;
-	uint8_t *holes256_64;
-	uint8_t *holes256_128;
-	uint8_t *holes256_192;
+	uint16_t *holes64;
 	uint8_t *g;
 	uint32_t *result_map;
 };
@@ -123,17 +120,8 @@ assign_nodes(struct state *state)
 		if (i % 65536 == 0)
 			state-holes64k[i  16] = holes;
 
-		if (i % 256 == 0)
-			state-holes256[i  8] = holes - state-holes64k[i  16];
-
-		if (i % 256 == 64)
-			state-holes256_64[i  8] = holes - state-holes256[i  8] - state-holes64k[i  16];
-
-		if (i % 256 == 128)
-			state-holes256_128[i  8] = holes - state-holes256[i  8] - state-holes64k[i  16];
-
-		if (i % 256 == 192)
-			state-holes256_192[i  8] = holes - state-holes256[i  8] - state-holes64k[i  16];
+		if (i % 64 == 0)
+			state-holes64[i  6] = holes - state-holes64k[i  16];
 
 		if (state-visited[i]  1) {
 			j = state-visited[i] - 2;
@@ -143,28 +131,13 @@ assign_nodes(struct state *state)
 		if (state-g[i] == 3)
 			++holes;
 	}
-
-	if (i % 65536 != 0)
-		state-holes64k[(i  16) + 1] = holes;
-
-	if (i % 256 != 0)
-		state-holes256[(i  8) + 1] = holes - state-holes64k[((i  8) + 1)  8];
-
-	if (i % 256 != 64)
-		state-holes256_64[(i  8) + 1] = holes - state-holes256[(i  8) + 1] - state-holes64k[((i  8) + 1)  8];
-
-	if (i % 256 != 128)
-		state-holes256_128[(i  8) + 1] = holes - state-holes256[(i  8) + 1] - state-holes64k[((i  8) + 1)  8];
-
-	if (i % 256 != 192)
-		state-holes256_192[(i  8) + 1] = holes - state-holes256[(i  8) + 1] - state-holes64k[((i  8) + 1)  8];
 }
 
 static void
 print_hash(struct nbperf *nbperf, struct state *state)
 {
-	size_t i, j;
-	uint32_t sum;
+	uint64_t sum;
+	size_t i;
 
 	fprintf(nbperf-output, #include stdlib.h\n);
 	fprintf(nbperf-output, #include strings.h\n\n);
@@ -175,19 +148,50 @@ print_hash(struct nbperf *nbperf, struct
 	%s(const void * __restrict key, size_t keylen)\n,
 	nbperf-hash_name);
 	fprintf(nbperf-output, {\n);
+
 	fprintf(nbperf-output,
-	\tstatic const uint32_t g[% PRId32 ] = {\n,
-	(state-graph.v + 15) / 16);
-	for (i = 0; i  state-graph.v; i += 16) {
-		for (j = 0, sum = 0; j  16; ++j)
-			sum |= (uint32_t)state-g[i + j]  (2 * j);
+	\tstatic const uint64_t g1[% PRId32 ] = {\n,
+	(state-graph.v + 63) / 64);
+	sum = 0;
+	for (i = 0; i  state-graph.v; ++i) {
+		sum |= ((uint64_t)state-g[i]  1)  (i  63);
+		if (i % 64 == 63) {
+			fprintf(nbperf-output, %s0x%016 PRIx64 ULL,%s,
+			(i / 64 % 2 == 0 ? \t :  ),
+			sum,
+			(i / 64 % 2 == 1 ? \n : ));
+			sum = 0;
+		}
+	}
+	if (i % 64 != 0) {
+		fprintf(nbperf-output, %s0x%016 PRIx64 ULL,%s,
+		(i / 64 % 2 == 0 ? \t :  ),
+		sum,
+		(i / 64 % 2 == 1 ? \n : ));
+	}
+	fprintf(nbperf-output, %s\t};\n, (i % 2 ? \n : ));
 
-		fprintf(nbperf-output, %s0x%08 PRIx32 ULL,%s,
-		(i / 16 % 4 == 0 ? \t :  ),
+	

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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:39:17 UTC 2012

Modified Files:
src/lib/libc/cdb [netbsd-6]: cdbr.c

Log Message:
Pull up following revision(s) (requested by joerg in ticket #577):
lib/libc/cdb/cdbr.c: revision 1.4
Don't refuse the open databases without entries or keys, just protect
the divisions. cdbr_find and cdbr_get already have the appropiate
checks.


To generate a diff of this commit:
cvs rdiff -u -r1.2.8.1 -r1.2.8.2 src/lib/libc/cdb/cdbr.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/cdb/cdbr.c
diff -u src/lib/libc/cdb/cdbr.c:1.2.8.1 src/lib/libc/cdb/cdbr.c:1.2.8.2
--- src/lib/libc/cdb/cdbr.c:1.2.8.1	Sat Jun 23 22:54:58 2012
+++ src/lib/libc/cdb/cdbr.c	Wed Oct 17 21:39:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cdbr.c,v 1.2.8.1 2012/06/23 22:54:58 riz Exp $	*/
+/*	$NetBSD: cdbr.c,v 1.2.8.2 2012/10/17 21:39:17 riz Exp $	*/
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,7 +36,7 @@
 #endif
 
 #include sys/cdefs.h
-__RCSID($NetBSD: cdbr.c,v 1.2.8.1 2012/06/23 22:54:58 riz Exp $);
+__RCSID($NetBSD: cdbr.c,v 1.2.8.2 2012/10/17 21:39:17 riz Exp $);
 
 #include namespace.h
 
@@ -152,17 +152,21 @@ cdbr_open(const char *path, int flags)
 	cdbr-data_base  cdbr-mmap_base ||
 	cdbr-data_base + cdbr-data_size  cdbr-mmap_base ||
 	cdbr-data_base + cdbr-data_size 
-	cdbr-mmap_base + cdbr-mmap_size ||
-	cdbr-entries == 0 || cdbr-entries_index == 0) {
+	cdbr-mmap_base + cdbr-mmap_size) {
 		errno = EINVAL;
 		cdbr_close(cdbr);
 		return NULL;
 	}
 
-	fast_divide32_prepare(cdbr-entries, cdbr-entries_m,
-	cdbr-entries_s1, cdbr-entries_s2);
-	fast_divide32_prepare(cdbr-entries_index, cdbr-entries_index_m,
-	cdbr-entries_index_s1, cdbr-entries_index_s2);
+	if (cdbr-entries) {
+		fast_divide32_prepare(cdbr-entries, cdbr-entries_m,
+		cdbr-entries_s1, cdbr-entries_s2);
+	}
+	if (cdbr-entries_index) {
+		fast_divide32_prepare(cdbr-entries_index,
+		cdbr-entries_index_m,
+		cdbr-entries_index_s1, cdbr-entries_index_s2);
+	}
 
 	return cdbr;
 }



CVS commit: [netbsd-6] src/bin/pax

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:50:16 UTC 2012

Modified Files:
src/bin/pax [netbsd-6]: ftree.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #586):
bin/pax/ftree.c: revision 1.42
deal properly with empty lines in spec file


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.40.8.1 src/bin/pax/ftree.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/pax/ftree.c
diff -u src/bin/pax/ftree.c:1.40 src/bin/pax/ftree.c:1.40.8.1
--- src/bin/pax/ftree.c:1.40	Sat Feb 14 08:10:06 2009
+++ src/bin/pax/ftree.c	Wed Oct 17 21:50:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ftree.c,v 1.40 2009/02/14 08:10:06 lukem Exp $	*/
+/*	$NetBSD: ftree.c,v 1.40.8.1 2012/10/17 21:50:15 riz Exp $	*/
 
 /*-
  * Copyright (c) 1992 Keith Muller.
@@ -71,7 +71,7 @@
 #if 0
 static char sccsid[] = @(#)ftree.c	8.2 (Berkeley) 4/18/94;
 #else
-__RCSID($NetBSD: ftree.c,v 1.40 2009/02/14 08:10:06 lukem Exp $);
+__RCSID($NetBSD: ftree.c,v 1.40.8.1 2012/10/17 21:50:15 riz Exp $);
 #endif
 #endif /* not lint */
 
@@ -347,7 +347,7 @@ ftree_arg(void)
 			 * the user didn't supply any args, get the file trees
 			 * to process from stdin;
 			 */
-			for (i = 0; i  PAXPATHLEN + 2; i++) {
+			for (i = 0; i  PAXPATHLEN + 2;) {
 c = getchar();
 if (c == EOF)
 	break;
@@ -355,7 +355,7 @@ ftree_arg(void)
 	if (i != 0)
 		break;
 } else
-	farray[0][i] = c;
+	farray[0][i++] = c;
 			}
 			if (i == 0)
 return -1;



CVS commit: [netbsd-6] src/doc

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:51:14 UTC 2012

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

Log Message:
+   [msaitoh, ticket #541]
+   [pgoyette, ticket #544]
+   [pgoyette, ticket #546]
+   [pgoyette, ticket #545]
+   [tls, ticket #558]
+   [joerg, ticket #560]
+   [khorben, ticket #572]
+   [joerg, ticket #574]
+   [joerg, ticket #577]
+   [roy, ticket #585]
+   [msaitoh, ticket #586]


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 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.1 src/doc/CHANGES-6.1:1.1.2.2
--- src/doc/CHANGES-6.1:1.1.2.1	Wed Oct 17 20:54:06 2012
+++ src/doc/CHANGES-6.1	Wed Oct 17 21:51:14 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.1 2012/10/17 20:54:06 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.2 2012/10/17 21:51:14 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -7,3 +7,109 @@ sys/sys/param.h	patched by hand
 
 	Welcome to 6.0_STABLE!
 
+usr.sbin/tcpdump/Makefile			delete
+
+	Remove long-unused usr.sbin/tcpdump. PR#44860.
+	[msaitoh, ticket #541]
+
+sys/dev/sysmon/sysmon_envsys.c			1.119 via patch
+sys/dev/sysmon/sysmon_envsys_events.c		1.99 via patch
+sys/dev/sysmon/sysmon_envsysvar.h		1.42 via patch
+
+	When unregistering a sensor device, make sure we unregister and delete
+	all the associated events.
+	[pgoyette, ticket #544]
+
+share/man/man4/swsensor.4			1.11-1.12
+sys/dev/sysmon/swsensor.c			1.13
+
+	Add hw.swsensor.state variable for additional control capability.
+	[pgoyette, ticket #546]
+
+etc/powerd/scripts/sensor_indicator		1.5
+sys/dev/sysmon/sysmon_envsys_events.c		1.104
+sys/dev/sysmon/sysmon_envsys_tables.c		1.11
+sys/dev/sysmon/sysmon_envsysvar.h		1.43
+sys/sys/envsys.h1.32
+
+	Correct the operation of INDICATOR sensors.
+	[pgoyette, ticket #545]
+
+sys/kern/kern_rndq.c1.4-1.5
+sys/kern/subr_cprng.c1.10-1.11
+sys/sys/rnd.h	1.33
+
+	Improve boot-time entropy situation. Fix PR#46911.
+	[tls, ticket #558]
+
+external/gpl3/gcc/dist/gcc/config/i386/i386.c	1.2
+external/gpl3/gcc/dist/gcc/config/i386/i386.h	1.2
+external/gpl3/gcc/dist/gcc/config/i386/netbsd-elf.h 1.3
+external/gpl3/gcc/dist/gcc/config/i386/netbsd64.h 1.2
+
+	Fix GCC to correctly implement the i386 psABI on NetBSD.
+	Also, fix PR#46978: ICE on spilling MMX registers.
+	[joerg, ticket #560]
+
+sys/arch/amd64/conf/XEN3_DOM0			1.88
+sys/arch/i386/conf/XEN3_DOM0			1.70
+
+	Enable support for Synaptics touchpads when running Xen as
+	domain 0; helps usability on laptops. PR#44055.
+	[khorben, ticket #572]
+
+tests/usr.bin/nbperf/h_nbperf.sh		1.1-1.2
+tests/usr.bin/nbperf/hash_driver.c		1.1-1.2
+tests/usr.bin/nbperf/t_nbperf.sh		1.1-1.2
+usr.bin/nbperf/nbperf-bdz.c			1.5
+usr.bin/nbperf/nbperf.11.5
+
+	Simplify the BDZ compression function, and add regression tests.
+	[joerg, ticket #574]
+
+lib/libc/cdb/cdbr.c1.4
+
+	Don't refuse the open databases without entries or keys.
+	[joerg, ticket #577]
+
+external/bsd/dhcpcd/dist/bind.cpatch
+external/bsd/dhcpcd/dist/common.h			patch
+external/bsd/dhcpcd/dist/configure.c			patch
+external/bsd/dhcpcd/dist/defs.hpatch
+external/bsd/dhcpcd/dist/dhcp.cpatch
+external/bsd/dhcpcd/dist/dhcp.hpatch
+external/bsd/dhcpcd/dist/dhcpcd-run-hooks.8.in		patch
+external/bsd/dhcpcd/dist/dhcpcd-run-hooks.in		patch
+external/bsd/dhcpcd/dist/dhcpcd.8.in			patch
+external/bsd/dhcpcd/dist/dhcpcd.c			patch
+external/bsd/dhcpcd/dist/dhcpcd.conf.5.in		patch
+external/bsd/dhcpcd/dist/dhcpcd.h			patch
+external/bsd/dhcpcd/dist/if-bsd.c			patch
+external/bsd/dhcpcd/dist/if-options.c			patch
+external/bsd/dhcpcd/dist/if-options.h			patch
+external/bsd/dhcpcd/dist/ipv6.cpatch
+external/bsd/dhcpcd/dist/ipv6.hpatch
+external/bsd/dhcpcd/dist/ipv6ns.c			patch
+external/bsd/dhcpcd/dist/ipv6ns.h			patch
+external/bsd/dhcpcd/dist/ipv6rs.c			patch
+external/bsd/dhcpcd/dist/ipv6rs.h			patch
+external/bsd/dhcpcd/dist/net.cpatch
+external/bsd/dhcpcd/dist/net.hpatch
+external/bsd/dhcpcd/dist/platform-bsd.c			patch
+external/bsd/dhcpcd/dist/platform.h			patch
+external/bsd/dhcpcd/dist/dhcpcd-hooks/01-test		patch
+external/bsd/dhcpcd/dist/dhcpcd-hooks/10-mtu		patch
+external/bsd/dhcpcd/dist/dhcpcd-hooks/20-resolv.conf	patch
+external/bsd/dhcpcd/dist/dhcpcd-hooks/30-hostname	patch
+external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ntp.conf	patch
+external/bsd/dhcpcd/dist/dhcpcd-hooks/50-ypbind		patch
+external/bsd/dhcpcd/sbin/dhcpcd/Makefile		patch
+
+	Update dhcpcd to version 5.6.2.
+	[roy, ticket #585]
+
+bin/pax/ftree.c	1.42
+
+	Deal properly with empty lines in spec file.
+	[msaitoh, ticket #586]
+



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:53:59 UTC 2012

Modified Files:
src/sys/arch/evbarm/iq80310 [netbsd-6]: i80312_mainbus.c iq80310_intr.c
iq80310var.h

Log Message:
Pull up following revision(s) (requested by chs in ticket #591):
sys/arch/evbarm/iq80310/i80312_mainbus.c: revision 1.15
sys/arch/evbarm/iq80310/iq80310var.h: revision 1.8
sys/arch/evbarm/iq80310/iq80310_intr.c: revision 1.32
defer evcnt attachment correctly.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.8.1 src/sys/arch/evbarm/iq80310/i80312_mainbus.c
cvs rdiff -u -r1.29.8.1 -r1.29.8.2 src/sys/arch/evbarm/iq80310/iq80310_intr.c
cvs rdiff -u -r1.7 -r1.7.152.1 src/sys/arch/evbarm/iq80310/iq80310var.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/evbarm/iq80310/i80312_mainbus.c
diff -u src/sys/arch/evbarm/iq80310/i80312_mainbus.c:1.14 src/sys/arch/evbarm/iq80310/i80312_mainbus.c:1.14.8.1
--- src/sys/arch/evbarm/iq80310/i80312_mainbus.c:1.14	Fri Jul  1 20:41:16 2011
+++ src/sys/arch/evbarm/iq80310/i80312_mainbus.c	Wed Oct 17 21:53:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i80312_mainbus.c,v 1.14 2011/07/01 20:41:16 dyoung Exp $	*/
+/*	$NetBSD: i80312_mainbus.c,v 1.14.8.1 2012/10/17 21:53:58 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i80312_mainbus.c,v 1.14 2011/07/01 20:41:16 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: i80312_mainbus.c,v 1.14.8.1 2012/10/17 21:53:58 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -98,6 +98,7 @@ i80312_mainbus_attach(struct device *par
 	psize_t memsize;
 
 	i80312_mainbus_found = 1;
+	iq80310_intr_evcnt_attach();
 
 	/*
 	 * Fill in the space tag for the i80312's own devices,

Index: src/sys/arch/evbarm/iq80310/iq80310_intr.c
diff -u src/sys/arch/evbarm/iq80310/iq80310_intr.c:1.29.8.1 src/sys/arch/evbarm/iq80310/iq80310_intr.c:1.29.8.2
--- src/sys/arch/evbarm/iq80310/iq80310_intr.c:1.29.8.1	Mon Aug 20 19:39:27 2012
+++ src/sys/arch/evbarm/iq80310/iq80310_intr.c	Wed Oct 17 21:53:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: iq80310_intr.c,v 1.29.8.1 2012/08/20 19:39:27 riz Exp $	*/
+/*	$NetBSD: iq80310_intr.c,v 1.29.8.2 2012/10/17 21:53:58 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iq80310_intr.c,v 1.29.8.1 2012/08/20 19:39:27 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: iq80310_intr.c,v 1.29.8.2 2012/10/17 21:53:58 riz Exp $);
 
 #ifndef EVBARM_SPL_NOINLINE
 #define	EVBARM_SPL_NOINLINE
@@ -350,6 +350,19 @@ iq80310_intr_init(void)
 	enable_interrupts(I32_bit);
 }
 
+void
+iq80310_intr_evcnt_attach(void)
+{
+	struct intrq *iq;
+	int i;
+
+	for (i = 0; i  NIRQ; i++) {
+		iq = intrq[i];
+		evcnt_attach_dynamic(iq-iq_ev, EVCNT_TYPE_INTR,
+		NULL, iq80310, iq-iq_name);
+	}
+}
+
 void *
 iq80310_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
 {
@@ -377,8 +390,6 @@ iq80310_intr_establish(int irq, int ipl,
 	oldirqstate = disable_interrupts(I32_bit);
 
 	TAILQ_INSERT_TAIL(iq-iq_list, ih, ih_list);
-	evcnt_attach_dynamic(iq-iq_ev, EVCNT_TYPE_INTR,
-	NULL, iq80310, iq-iq_name);
 
 	iq80310_intr_calculate_masks();
 

Index: src/sys/arch/evbarm/iq80310/iq80310var.h
diff -u src/sys/arch/evbarm/iq80310/iq80310var.h:1.7 src/sys/arch/evbarm/iq80310/iq80310var.h:1.7.152.1
--- src/sys/arch/evbarm/iq80310/iq80310var.h:1.7	Tue Oct  8 17:39:17 2002
+++ src/sys/arch/evbarm/iq80310/iq80310var.h	Wed Oct 17 21:53:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: iq80310var.h,v 1.7 2002/10/08 17:39:17 thorpej Exp $	*/
+/*	$NetBSD: iq80310var.h,v 1.7.152.1 2012/10/17 21:53:58 riz Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 Wasabi Systems, Inc.
@@ -94,6 +94,7 @@ void	iq80310_7seg_snake(void);
 void	iq80310_pci_init(pci_chipset_tag_t, void *);
 
 void	iq80310_intr_init(void);
+void	iq80310_intr_evcnt_attach(void);
 void	*iq80310_intr_establish(int, int, int (*)(void *), void *);
 void	iq80310_intr_disestablish(void *);
 



CVS commit: [netbsd-6] src/sbin/route

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 21:57:08 UTC 2012

Modified Files:
src/sbin/route [netbsd-6]: route.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #592):
sbin/route/route.c: revision 1.139
Fix fallout from 1.129 that converted sou::so_foo from unions to
pointers but missed (char *)soup-so_foo = (char *)soup-so_foo in
mask_addr().  It worked by luck - unless it didn't: due to pointer
numerology on amd64 route add -net ClassC without explicit /24 prefix
length specification would result into /16 destination instead of /24.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.136.2.1 src/sbin/route/route.c

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

Modified files:

Index: src/sbin/route/route.c
diff -u src/sbin/route/route.c:1.136 src/sbin/route/route.c:1.136.2.1
--- src/sbin/route/route.c:1.136	Mon Dec 26 00:20:43 2011
+++ src/sbin/route/route.c	Wed Oct 17 21:57:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: route.c,v 1.136 2011/12/26 00:20:43 christos Exp $	*/
+/*	$NetBSD: route.c,v 1.136.2.1 2012/10/17 21:57:07 riz Exp $	*/
 
 /*
  * Copyright (c) 1983, 1989, 1991, 1993
@@ -39,7 +39,7 @@ __COPYRIGHT(@(#) Copyright (c) 1983, 19
 #if 0
 static char sccsid[] = @(#)route.c	8.6 (Berkeley) 4/28/95;
 #else
-__RCSID($NetBSD: route.c,v 1.136 2011/12/26 00:20:43 christos Exp $);
+__RCSID($NetBSD: route.c,v 1.136.2.1 2012/10/17 21:57:07 riz Exp $);
 #endif
 #endif /* not lint */
 
@@ -1648,11 +1648,11 @@ static void
 mask_addr(struct sou *soup)
 {
 	int olen = soup-so_mask-sa.sa_len;
-	char *cp1 = olen + (char *)soup-so_mask, *cp2;
+	char *cp1 = olen + (char *)soup-so_mask, *cp2;
 
-	for (soup-so_mask-sa.sa_len = 0; cp1  (char *)soup-so_mask; )
+	for (soup-so_mask-sa.sa_len = 0; cp1  (char *)soup-so_mask; )
 		if (*--cp1 != 0) {
-			soup-so_mask-sa.sa_len = 1 + cp1 - (char *)soup-so_mask;
+			soup-so_mask-sa.sa_len = 1 + cp1 - (char *)soup-so_mask;
 			break;
 		}
 	if ((rtm_addrs  RTA_DST) == 0)
@@ -1674,11 +1674,11 @@ mask_addr(struct sou *soup)
 		break;
 #endif /* SMALL */
 	}
-	cp1 = soup-so_mask-sa.sa_len + 1 + (char *)soup-so_dst;
-	cp2 = soup-so_dst-sa.sa_len + 1 + (char *)soup-so_dst;
+	cp1 = soup-so_mask-sa.sa_len + 1 + (char *)soup-so_dst;
+	cp2 = soup-so_dst-sa.sa_len + 1 + (char *)soup-so_dst;
 	while (cp2  cp1)
 		*--cp2 = 0;
-	cp2 = soup-so_mask-sa.sa_len + 1 + (char *)soup-so_mask;
+	cp2 = soup-so_mask-sa.sa_len + 1 + (char *)soup-so_mask;
 	while (cp1  soup-so_dst-sa.sa_data)
 		*--cp1 = *--cp2;
 #ifndef SMALL



CVS commit: [netbsd-6] src/tools/gdb

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:03:19 UTC 2012

Modified Files:
src/tools/gdb [netbsd-6]: Makefile

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #596):
tools/gdb/Makefile: revision 1.22
At last on some linux distros, gmake is needed to build the cross-gdb.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.2.1 src/tools/gdb/Makefile

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

Modified files:

Index: src/tools/gdb/Makefile
diff -u src/tools/gdb/Makefile:1.21 src/tools/gdb/Makefile:1.21.2.1
--- src/tools/gdb/Makefile:1.21	Thu Feb  9 15:15:58 2012
+++ src/tools/gdb/Makefile	Wed Oct 17 22:03:19 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.21 2012/02/09 15:15:58 skrll Exp $
+#	$NetBSD: Makefile,v 1.21.2.1 2012/10/17 22:03:19 riz Exp $
 
 .include bsd.own.mk
 
@@ -15,7 +15,7 @@ MAKE_ARGS=	MACHINE= MAKEINFO=${TOOL_MAKE
 ALL_TARGET=	all-gdb
 INSTALL_TARGET=	install-gdb
 
-.include ${.CURDIR}/../Makefile.gnuhost
+.include ${.CURDIR}/../Makefile.gmakehost
 
 CCADDFLAGS=	--sysroot=${DESTDIR} -L${DESTDIR}/lib -L${DESTDIR}/usr/lib -B${DESTDIR}/usr/lib/ -I${.OBJDIR}/.native/gcc/include
 



CVS commit: [netbsd-6] src/doc

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:06:44 UTC 2012

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

Log Message:
Tickets 591,592,596


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 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.2 src/doc/CHANGES-6.1:1.1.2.3
--- src/doc/CHANGES-6.1:1.1.2.2	Wed Oct 17 21:51:14 2012
+++ src/doc/CHANGES-6.1	Wed Oct 17 22:06:43 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.2 2012/10/17 21:51:14 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.3 2012/10/17 22:06:43 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -113,3 +113,22 @@ bin/pax/ftree.c	1.42
 	Deal properly with empty lines in spec file.
 	[msaitoh, ticket #586]
 
+sys/arch/evbarm/iq80310/i80312_mainbus.c	1.15
+sys/arch/evbarm/iq80310/iq80310_intr.c		1.32
+sys/arch/evbarm/iq80310/iq80310var.h		1.8
+
+	Defer evcnt attachment correctly.
+	[chs, ticket #591]
+
+sbin/route/route.c1.139
+
+	Fix a regression in route.c that affected adding
+	certain classful networks without explicit prefix length.
+	[uwe, ticket #592]
+
+tools/gdb/Makefile1.22
+
+	On some Linux distributions (and possibly other platforms),
+	gmake is needed to build the cross-gdb.
+	[bouyer, ticket #596]
+



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:21:08 UTC 2012

Modified Files:
src/sys/arch/arm/xscale [netbsd-6]: ixp425_intr.c ixp425var.h
src/sys/arch/evbarm/ixdp425 [netbsd-6]: ixdp425_mainbus.c
src/sys/arch/evbarm/nslu2 [netbsd-6]: nslu2_mainbus.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #600):
sys/arch/arm/xscale/ixp425_intr.c: revision 1.24
sys/arch/evbarm/ixdp425/ixdp425_mainbus.c: revision 1.8
sys/arch/evbarm/nslu2/nslu2_mainbus.c: revision 1.3
sys/arch/arm/xscale/ixp425var.h: revision 1.14
Defer attaching interrupt evcnts in the same way as i80321.c by matt@


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.8.1 src/sys/arch/arm/xscale/ixp425_intr.c
cvs rdiff -u -r1.13 -r1.13.8.1 src/sys/arch/arm/xscale/ixp425var.h
cvs rdiff -u -r1.7 -r1.7.8.1 src/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c
cvs rdiff -u -r1.2 -r1.2.40.1 src/sys/arch/evbarm/nslu2/nslu2_mainbus.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/arm/xscale/ixp425_intr.c
diff -u src/sys/arch/arm/xscale/ixp425_intr.c:1.23 src/sys/arch/arm/xscale/ixp425_intr.c:1.23.8.1
--- src/sys/arch/arm/xscale/ixp425_intr.c:1.23	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/ixp425_intr.c	Wed Oct 17 22:21:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425_intr.c,v 1.23 2011/07/01 20:32:51 dyoung Exp $ */
+/*	$NetBSD: ixp425_intr.c,v 1.23.8.1 2012/10/17 22:21:07 riz Exp $ */
 
 /*
  * Copyright (c) 2003
@@ -62,7 +62,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ixp425_intr.c,v 1.23 2011/07/01 20:32:51 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ixp425_intr.c,v 1.23.8.1 2012/10/17 22:21:07 riz Exp $);
 
 #ifndef EVBARM_SPL_NOINLINE
 #define	EVBARM_SPL_NOINLINE
@@ -308,8 +308,6 @@ ixp425_intr_init(void)
 		TAILQ_INIT(iq-iq_list);
 
 		sprintf(iq-iq_name, irq %d, i);
-		evcnt_attach_dynamic(iq-iq_ev, EVCNT_TYPE_INTR,
- NULL, ixp425, iq-iq_name);
 	}
 
 	ixp425_intr_calculate_masks();
@@ -318,6 +316,19 @@ ixp425_intr_init(void)
 	enable_interrupts(I32_bit);
 }
 
+void
+ixp425_intr_evcnt_attach(void)
+{
+	struct intrq *iq;
+	int i;
+
+	for (i = 0; i  NIRQ; i++) {
+		iq = intrq[i];
+		evcnt_attach_dynamic(iq-iq_ev, EVCNT_TYPE_INTR,
+		NULL, ixp425, iq-iq_name);
+	}
+}
+
 void *
 ixp425_intr_establish(int irq, int ipl, int (*func)(void *), void *arg)
 {

Index: src/sys/arch/arm/xscale/ixp425var.h
diff -u src/sys/arch/arm/xscale/ixp425var.h:1.13 src/sys/arch/arm/xscale/ixp425var.h:1.13.8.1
--- src/sys/arch/arm/xscale/ixp425var.h:1.13	Fri Jul  1 20:32:51 2011
+++ src/sys/arch/arm/xscale/ixp425var.h	Wed Oct 17 22:21:07 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixp425var.h,v 1.13 2011/07/01 20:32:51 dyoung Exp $ */
+/*	$NetBSD: ixp425var.h,v 1.13.8.1 2012/10/17 22:21:07 riz Exp $ */
 
 /*
  * Copyright (c) 2003
@@ -146,6 +146,7 @@ void	ixp425_attach(struct ixp425_softc *
 void	ixp425_icu_init(void);
 void	ixp425_clk_bootstrap(bus_space_tag_t);
 void	ixp425_intr_init(void);
+void	ixp425_intr_evcnt_attach(void);
 void	*ixp425_intr_establish(int, int, int (*)(void *), void *);
 voidixp425_intr_disestablish(void *);
 

Index: src/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c
diff -u src/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c:1.7 src/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c:1.7.8.1
--- src/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c:1.7	Fri Jul  1 20:42:36 2011
+++ src/sys/arch/evbarm/ixdp425/ixdp425_mainbus.c	Wed Oct 17 22:21:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ixdp425_mainbus.c,v 1.7 2011/07/01 20:42:36 dyoung Exp $ */
+/*	$NetBSD: ixdp425_mainbus.c,v 1.7.8.1 2012/10/17 22:21:08 riz Exp $ */
 
 /*
  * Copyright (c) 2003
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ixdp425_mainbus.c,v 1.7 2011/07/01 20:42:36 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: ixdp425_mainbus.c,v 1.7.8.1 2012/10/17 22:21:08 riz Exp $);
 
 /*
  * front-end for the ixp425 NetworkProcessor.
@@ -65,5 +65,6 @@ ixp425_mainbus_attach(struct device *par
 {
 	struct ixp425_softc *sc = (void *) self;
 
+	ixp425_intr_evcnt_attach();
 	ixp425_attach(sc);
 }

Index: src/sys/arch/evbarm/nslu2/nslu2_mainbus.c
diff -u src/sys/arch/evbarm/nslu2/nslu2_mainbus.c:1.2 src/sys/arch/evbarm/nslu2/nslu2_mainbus.c:1.2.40.1
--- src/sys/arch/evbarm/nslu2/nslu2_mainbus.c:1.2	Mon Apr 28 20:23:17 2008
+++ src/sys/arch/evbarm/nslu2/nslu2_mainbus.c	Wed Oct 17 22:21:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: nslu2_mainbus.c,v 1.2 2008/04/28 20:23:17 martin Exp $	*/
+/*	$NetBSD: nslu2_mainbus.c,v 1.2.40.1 2012/10/17 22:21:08 riz Exp $	*/
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: nslu2_mainbus.c,v 1.2 2008/04/28 20:23:17 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: nslu2_mainbus.c,v 1.2.40.1 2012/10/17 22:21:08 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ 

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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:26:06 UTC 2012

Modified Files:
src/sys/arch/x68k/dev [netbsd-6]: mha.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #601):
sys/arch/x68k/dev/mha.c: revision 1.53
Fix device_t/softc split botches that could be fatal.  From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html
Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.52.18.1 src/sys/arch/x68k/dev/mha.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/x68k/dev/mha.c
diff -u src/sys/arch/x68k/dev/mha.c:1.52 src/sys/arch/x68k/dev/mha.c:1.52.18.1
--- src/sys/arch/x68k/dev/mha.c:1.52	Mon Nov 23 00:11:45 2009
+++ src/sys/arch/x68k/dev/mha.c	Wed Oct 17 22:26:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mha.c,v 1.52 2009/11/23 00:11:45 rmind Exp $	*/
+/*	$NetBSD: mha.c,v 1.52.18.1 2012/10/17 22:26:05 riz Exp $	*/
 
 /*-
  * Copyright (c) 1996-1999 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mha.c,v 1.52 2009/11/23 00:11:45 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: mha.c,v 1.52.18.1 2012/10/17 22:26:05 riz Exp $);
 
 #include opt_ddb.h
 
@@ -337,7 +337,7 @@ mhaattach(device_t parent, device_t self
 	/*
 	 * Fill in the adapter.
 	 */
-	sc-sc_adapter.adapt_dev = sc-sc_dev;
+	sc-sc_adapter.adapt_dev = self;
 	sc-sc_adapter.adapt_nchannels = 1;
 	sc-sc_adapter.adapt_openings = 7;
 	sc-sc_adapter.adapt_max_periph = 1;
@@ -674,7 +674,7 @@ mha_scsi_request(struct scsipi_channel *
 {
 	struct scsipi_xfer *xs;
 	struct scsipi_periph *periph;
-	struct mha_softc *sc = (void *)chan-chan_adapter-adapt_dev;
+	struct mha_softc *sc = device_private(chan-chan_adapter-adapt_dev);
 	struct acb *acb;
 	int s, flags;
 
@@ -1949,7 +1949,7 @@ mha_timeout(void *arg)
 	struct scsipi_xfer *xs = acb-xs;
 	struct scsipi_periph *periph = xs-xs_periph;
 	struct mha_softc *sc =
-	(void *)periph-periph_channel-chan_adapter-adapt_dev;
+	device_private(periph-periph_channel-chan_adapter-adapt_dev);
 	int s;
 
 	s = splbio();



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:30:09 UTC 2012

Modified Files:
src/sys/arch/sparc/dev [netbsd-6]: fd.c
src/sys/arch/sparc/sparc [netbsd-6]: memecc.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #602):
sys/arch/sparc/dev/fd.c: revision 1.151
sys/arch/sparc/sparc/memecc.c: revision 1.15
Fix device_t/softc split botches that could be fatal.  From
Chuck Silvers' patch posted current-users and tech-kern:
http://mail-index.netbsd.org/current-users/2012/10/09/msg021233.html
Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.150 -r1.150.8.1 src/sys/arch/sparc/dev/fd.c
cvs rdiff -u -r1.13 -r1.13.8.1 src/sys/arch/sparc/sparc/memecc.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/sparc/dev/fd.c
diff -u src/sys/arch/sparc/dev/fd.c:1.150 src/sys/arch/sparc/dev/fd.c:1.150.8.1
--- src/sys/arch/sparc/dev/fd.c:1.150	Sun Jul 17 23:18:23 2011
+++ src/sys/arch/sparc/dev/fd.c	Wed Oct 17 22:30:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.150 2011/07/17 23:18:23 mrg Exp $	*/
+/*	$NetBSD: fd.c,v 1.150.8.1 2012/10/17 22:30:08 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -101,7 +101,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fd.c,v 1.150 2011/07/17 23:18:23 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: fd.c,v 1.150.8.1 2012/10/17 22:30:08 riz Exp $);
 
 #include opt_ddb.h
 #include opt_md.h
@@ -174,7 +174,7 @@ enum fdc_state {
 
 /* software state, per controller */
 struct fdc_softc {
-	struct device	*sc_dev;
+	device_t	sc_dev;
 	bus_space_tag_t	sc_bustag;
 
 	struct callout sc_timo_ch;	/* timeout callout */
@@ -259,7 +259,7 @@ struct fd_type fd_types[] = {
 
 /* software state, per disk (with up to 4 disks per ctlr) */
 struct fd_softc {
-	struct device	*sc_dv;		/* generic device info */
+	device_t	sc_dv;		/* generic device info */
 	struct disk	sc_dk;		/* generic disk info */
 
 	struct fd_type *sc_deftype;	/* default type descriptor */
@@ -342,7 +342,7 @@ void	fdcretry(struct fdc_softc *);
 void	fdfinish(struct fd_softc *, struct buf *);
 int	fdformat(dev_t, struct ne7_fd_formb *, struct proc *);
 void	fd_do_eject(struct fd_softc *);
-void	fd_mountroot_hook(struct device *);
+void	fd_mountroot_hook(device_t);
 static int fdconf(struct fdc_softc *);
 static void establish_chip_type(
 		struct fdc_softc *,
@@ -547,7 +547,7 @@ fdcattach_mainbus(device_t parent, devic
 			ma-ma_size,
 			BUS_SPACE_MAP_LINEAR,
 			fdc-sc_handle) != 0) {
-		printf(%s: cannot map registers\n, self-dv_xname);
+		printf(%s: cannot map registers\n, device_xname(self));
 		return;
 	}
 
@@ -580,7 +580,7 @@ fdcattach_obio(device_t parent, device_t
 			 sa-sa_slot, sa-sa_offset, sa-sa_size,
 			 BUS_SPACE_MAP_LINEAR, fdc-sc_handle) != 0) {
 		printf(%s: cannot map control registers\n,
-			self-dv_xname);
+			device_xname(self));
 		return;
 	}
 
@@ -890,7 +890,7 @@ fdstrategy(struct buf *bp)
 		fdstart(fd);
 #ifdef DIAGNOSTIC
 	else {
-		struct fdc_softc *fdc = (void *)device_parent(fd-sc_dv);
+		struct fdc_softc *fdc = device_private(device_parent(fd-sc_dv));
 		if (fdc-sc_state == DEVIDLE) {
 			printf(fdstrategy: controller inactive\n);
 			fdcstart(fdc);
@@ -1012,7 +1012,7 @@ fd_motor_off(void *arg)
 
 	s = splbio();
 	fd-sc_flags = ~(FD_MOTOR | FD_MOTOR_WAIT);
-	fd_set_motor((struct fdc_softc *)device_parent(fd-sc_dv));
+	fd_set_motor(device_private(device_parent(fd-sc_dv)));
 	splx(s);
 }
 
@@ -2305,7 +2305,7 @@ fd_do_eject(struct fd_softc *fd)
 
 /* ARGSUSED */
 void
-fd_mountroot_hook(struct device *dev)
+fd_mountroot_hook(device_t dev)
 {
 	int c;
 

Index: src/sys/arch/sparc/sparc/memecc.c
diff -u src/sys/arch/sparc/sparc/memecc.c:1.13 src/sys/arch/sparc/sparc/memecc.c:1.13.8.1
--- src/sys/arch/sparc/sparc/memecc.c:1.13	Sun Jul 17 23:18:23 2011
+++ src/sys/arch/sparc/sparc/memecc.c	Wed Oct 17 22:30:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: memecc.c,v 1.13 2011/07/17 23:18:23 mrg Exp $	*/
+/*	$NetBSD: memecc.c,v 1.13.8.1 2012/10/17 22:30:09 riz Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: memecc.c,v 1.13 2011/07/17 23:18:23 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: memecc.c,v 1.13.8.1 2012/10/17 22:30:09 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -75,7 +75,7 @@ memecc_match(device_t parent, cfdata_t c
 void
 memecc_attach(device_t parent, device_t self, void *aux)
 {
-	struct memecc_softc *sc = (struct memecc_softc *)self;
+	struct memecc_softc *sc = device_private(self);
 	struct mainbus_attach_args *ma = aux;
 	int node;
 	uint32_t reg;



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:34:15 UTC 2012

Modified Files:
src/sys/arch/amd64/amd64 [netbsd-6]: db_machdep.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #604):
sys/arch/amd64/amd64/db_machdep.c: revision 1.4
Use db_read_value to read the trapframe fields in db_nextframe.
Fixes SIGSEGV on bt in crash(8) when the stack trace ends in syscall,
and probably other problems as well.
ok christos


To generate a diff of this commit:
cvs rdiff -u -r1.1.16.1 -r1.1.16.2 src/sys/arch/amd64/amd64/db_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/amd64/amd64/db_machdep.c
diff -u src/sys/arch/amd64/amd64/db_machdep.c:1.1.16.1 src/sys/arch/amd64/amd64/db_machdep.c:1.1.16.2
--- src/sys/arch/amd64/amd64/db_machdep.c:1.1.16.1	Thu Feb 23 18:36:06 2012
+++ src/sys/arch/amd64/amd64/db_machdep.c	Wed Oct 17 22:34:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: db_machdep.c,v 1.1.16.1 2012/02/23 18:36:06 riz Exp $	*/
+/*	$NetBSD: db_machdep.c,v 1.1.16.2 2012/10/17 22:34:15 riz Exp $	*/
 
 /* 
  * Mach Operating System
@@ -26,7 +26,7 @@
  * rights to redistribute these changes.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.1.16.1 2012/02/23 18:36:06 riz Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_machdep.c,v 1.1.16.2 2012/10/17 22:34:15 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -134,17 +134,20 @@ db_nextframe(long **nextframe, long **re
 		tf = (struct trapframe *)argp;
 		switch (is_trap) {
 		case TRAP:
-			(*pr)(--- trap (number %d) ---\n, tf-tf_trapno);
+			(*pr)(--- trap (number %DDB_EXPR_FMTu) ---\n,
+db_get_value((long)tf-tf_trapno, 8, false));
 			break;
 		case SYSCALL:
-			(*pr)(--- syscall (number %ld) ---\n, tf-tf_rax);
+			(*pr)(--- syscall (number %DDB_EXPR_FMTu) ---\n,
+db_get_value((long)tf-tf_rax, 8, false));
 			break;
 		case INTERRUPT:
 			(*pr)(--- interrupt ---\n);
 			break;
 		}
-		*ip = (db_addr_t)tf-tf_rip;
-		fp = (struct x86_64_frame *)tf-tf_rbp;
+		*ip = (db_addr_t)db_get_value((long)tf-tf_rip, 8, false);
+		fp = (struct x86_64_frame *)
+			db_get_value((long)tf-tf_rbp, 8, false);
 		if (fp == NULL)
 			return 0;
 		*nextframe = (long *)fp-f_frame;



CVS commit: [netbsd-6] src/libexec/ld.elf_so

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:36:59 UTC 2012

Modified Files:
src/libexec/ld.elf_so [netbsd-6]: rtld.c

Log Message:
Pull up following revision(s) (requested by riastradh in ticket #605):
libexec/ld.elf_so/rtld.c: revision 1.159
On failure in _rtld_dlcheck, call _rtld_error, not xwarnx.
Callers need not call _rtld_error themselves now.
Fixes PR lib/41760.  Should add the test case from the PR too.


To generate a diff of this commit:
cvs rdiff -u -r1.155 -r1.155.2.1 src/libexec/ld.elf_so/rtld.c

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

Modified files:

Index: src/libexec/ld.elf_so/rtld.c
diff -u src/libexec/ld.elf_so/rtld.c:1.155 src/libexec/ld.elf_so/rtld.c:1.155.2.1
--- src/libexec/ld.elf_so/rtld.c:1.155	Fri Nov 25 21:27:15 2011
+++ src/libexec/ld.elf_so/rtld.c	Wed Oct 17 22:36:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rtld.c,v 1.155 2011/11/25 21:27:15 joerg Exp $	 */
+/*	$NetBSD: rtld.c,v 1.155.2.1 2012/10/17 22:36:59 riz Exp $	 */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: rtld.c,v 1.155 2011/11/25 21:27:15 joerg Exp $);
+__RCSID($NetBSD: rtld.c,v 1.155.2.1 2012/10/17 22:36:59 riz Exp $);
 #endif /* not lint */
 
 #include sys/param.h
@@ -735,7 +735,7 @@ _rtld_dlcheck(void *handle)
 			break;
 
 	if (obj == NULL || obj-dl_refcount == 0) {
-		xwarnx(Invalid shared object handle %p, handle);
+		_rtld_error(Invalid shared object handle %p, handle);
 		return NULL;
 	}
 	return obj;
@@ -1295,7 +1295,6 @@ dlinfo(void *handle, int req, void *v)
 		}
 	} else {
 		if ((obj = _rtld_dlcheck(handle)) == NULL) {
-			_rtld_error(Invalid handle);
 			_rtld_shared_exit();
 			return -1;
 		}



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

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:39:26 UTC 2012

Modified Files:
src/sys/arch/x86/include [netbsd-6]: lock.h

Log Message:
Pull up following revision(s) (requested by apb in ticket #606):
sys/arch/x86/include/lock.h: revision 1.26
Change =r to =qQ in a register constraint in an asm statement
for a register that is used with the xchgb instruction in the
definition of __cpu_simple_lock_try().  This fixes PR 45673, or at
least works around the gcc bug that might be behind PR 45673.
The output from objdump -d before and after this change is
identical, for the amd64 GENERIC kernel, the i386 GENERIC kernel,
and the i386 MONOLITHIC kernel.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.20.1 src/sys/arch/x86/include/lock.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/lock.h
diff -u src/sys/arch/x86/include/lock.h:1.25 src/sys/arch/x86/include/lock.h:1.25.20.1
--- src/sys/arch/x86/include/lock.h:1.25	Thu Jan 15 01:20:31 2009
+++ src/sys/arch/x86/include/lock.h	Wed Oct 17 22:39:26 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: lock.h,v 1.25 2009/01/15 01:20:31 pooka Exp $	*/
+/*	$NetBSD: lock.h,v 1.25.20.1 2012/10/17 22:39:26 riz Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2006 The NetBSD Foundation, Inc.
@@ -106,7 +106,7 @@ __cpu_simple_lock_try(__cpu_simple_lock_
 
 	val = __SIMPLELOCK_LOCKED;
 	__asm volatile (xchgb %0,(%2) : 
-	=r (val)
+	=qQ (val)
 	:0 (val), r (lockp));
 	__insn_barrier();
 	return val == __SIMPLELOCK_UNLOCKED;



CVS commit: [netbsd-6] src/doc

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:41:41 UTC 2012

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

Log Message:
Tickets 600-602,604-606.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 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.3 src/doc/CHANGES-6.1:1.1.2.4
--- src/doc/CHANGES-6.1:1.1.2.3	Wed Oct 17 22:06:43 2012
+++ src/doc/CHANGES-6.1	Wed Oct 17 22:41:41 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.3 2012/10/17 22:06:43 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.4 2012/10/17 22:41:41 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -132,3 +132,38 @@ tools/gdb/Makefile1.22
 	gmake is needed to build the cross-gdb.
 	[bouyer, ticket #596]
 
+sys/arch/arm/xscale/ixp425_intr.c		1.24
+sys/arch/arm/xscale/ixp425var.h			1.14
+sys/arch/evbarm/ixdp425/ixdp425_mainbus.c	1.8
+sys/arch/evbarm/nslu2/nslu2_mainbus.c		1.3
+
+	Prevent an early crash with DIAGNOSTIC on some boards.
+	[tsutsui, ticket #600]
+
+sys/arch/x68k/dev/mha.c1.53
+
+	Prevent panic for users of mha(4).
+	[tsutsui, ticket #601]
+
+sys/arch/sparc/dev/fd.c1.151
+sys/arch/sparc/sparc/memecc.c			1.15
+
+	Prevent a potential crash with QUEUEDEBUG enabled.
+	[tsutsui, ticket #602]
+
+sys/arch/amd64/amd64/db_machdep.c		1.4
+
+	Read kernel memory correctly so we don't crash crash(8).
+	[riastradh, ticket #604]
+
+libexec/ld.elf_so/rtld.c			1.159
+
+	Make the dl* functions store errors in dlerror() as they should.
+	PR#41760.
+	[riastradh, ticket #605]
+
+sys/arch/x86/include/lock.h			1.26
+
+	Work around a possible gcc bug.  Fixes PR#45673.
+	[apb, ticket #606]
+



CVS commit: [netbsd-6-0] src

2012-10-17 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Wed Oct 17 22:44:47 UTC 2012

Modified Files:
src/gnu/usr.bin/groff/tmac [netbsd-6-0]: mdoc.local
src/sys/sys [netbsd-6-0]: param.h
Added Files:
src/doc [netbsd-6-0]: CHANGES-6.0.1

Log Message:
Welcome to 6.0.0_PATCH.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/doc/CHANGES-6.0.1
cvs rdiff -u -r1.66.2.1 -r1.66.2.1.4.1 src/gnu/usr.bin/groff/tmac/mdoc.local
cvs rdiff -u -r1.408.2.6 -r1.408.2.6.2.1 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/gnu/usr.bin/groff/tmac/mdoc.local
diff -u src/gnu/usr.bin/groff/tmac/mdoc.local:1.66.2.1 src/gnu/usr.bin/groff/tmac/mdoc.local:1.66.2.1.4.1
--- src/gnu/usr.bin/groff/tmac/mdoc.local:1.66.2.1	Wed Feb 15 23:45:50 2012
+++ src/gnu/usr.bin/groff/tmac/mdoc.local	Wed Oct 17 22:44:46 2012
@@ -1,4 +1,4 @@
-.\ $NetBSD: mdoc.local,v 1.66.2.1 2012/02/15 23:45:50 riz Exp $
+.\ $NetBSD: mdoc.local,v 1.66.2.1.4.1 2012/10/17 22:44:46 riz Exp $
 .\
 .\ Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -44,9 +44,9 @@
 .as doc-str-St--ieee1275-94  (\*[Lq]\*[doc-Tn-font-size]Open Firmware\*[doc-str-St]\*[Rq])
 .
 .\ Default .Os value
-.ds doc-operating-system NetBSD\~6.0
+.ds doc-operating-system NetBSD\~6.0.1
 .\ Default footer operating system value
-.ds doc-default-operating-system NetBSD\~6.0
+.ds doc-default-operating-system NetBSD\~6.0.1
 .\ Other known versions, not yet in groff distribution
 .ds doc-operating-system-NetBSD-1.3.3  1.3.3
 .ds doc-operating-system-NetBSD-1.6.3  1.6.3
@@ -59,6 +59,7 @@
 .ds doc-operating-system-NetBSD-5.05.0
 .ds doc-operating-system-NetBSD-5.15.1
 .ds doc-operating-system-NetBSD-6.06.0
+.ds doc-operating-system-NetBSD-6.0.1  6.0.1
 .ds doc-operating-system-FreeBSD-4.11  4.11
 .ds doc-operating-system-FreeBSD-5.4   5.4
 .ds doc-operating-system-FreeBSD-5.5   5.5

Index: src/sys/sys/param.h
diff -u src/sys/sys/param.h:1.408.2.6 src/sys/sys/param.h:1.408.2.6.2.1
--- src/sys/sys/param.h:1.408.2.6	Fri Oct 12 22:10:14 2012
+++ src/sys/sys/param.h	Wed Oct 17 22:44:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: param.h,v 1.408.2.6 2012/10/12 22:10:14 riz Exp $	*/
+/*	$NetBSD: param.h,v 1.408.2.6.2.1 2012/10/17 22:44:46 riz Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1989, 1993
@@ -63,7 +63,7 @@
  *	2.99.9		(299000900)
  */
 
-#define	__NetBSD_Version__	6	/* NetBSD 6.0 */
+#define	__NetBSD_Version__	6	/* NetBSD 6.0.0_PATCH */
 
 #define __NetBSD_Prereq__(M,m,p) (M) * 1) + \
 (m) * 100) + (p) * 100) = __NetBSD_Version__)

Added files:

Index: src/doc/CHANGES-6.0.1
diff -u /dev/null src/doc/CHANGES-6.0.1:1.1.2.1
--- /dev/null	Wed Oct 17 22:44:47 2012
+++ src/doc/CHANGES-6.0.1	Wed Oct 17 22:44:47 2012
@@ -0,0 +1,11 @@
+# $NetBSD: CHANGES-6.0.1,v 1.1.2.1 2012/10/17 22:44:47 riz Exp $
+
+A complete list of changes from the NetBSD 6.0 release to the NetBSD 6.0.1
+release:
+
+gnu/usr.bin/groff/tmac/mdoc.local		patched by hand
+sys/sys/param.h	patched by hand
+
+	Welcome to 6.0.0_PATCH.
+	[riz]
+



CVS commit: src/sys/dev/ic

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Wed Oct 17 23:40:42 UTC 2012

Modified Files:
src/sys/dev/ic: ahcisatareg.h

Log Message:
Fix an errant define.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/dev/ic/ahcisatareg.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/ic/ahcisatareg.h
diff -u src/sys/dev/ic/ahcisatareg.h:1.11 src/sys/dev/ic/ahcisatareg.h:1.12
--- src/sys/dev/ic/ahcisatareg.h:1.11	Wed Nov  2 16:54:50 2011
+++ src/sys/dev/ic/ahcisatareg.h	Wed Oct 17 23:40:42 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ahcisatareg.h,v 1.11 2011/11/02 16:54:50 jakllsch Exp $	*/
+/*	$NetBSD: ahcisatareg.h,v 1.12 2012/10/17 23:40:42 matt Exp $	*/
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -256,7 +256,7 @@ struct ahci_r_fis {
 #define		AHCI_P_SIG_LBAL_MASK	0xff00
 #define		AHCI_P_SIG_LBAL_SHIFT	8
 #define		AHCI_P_SIG_SC_MASK	0x00ff
-#define		AHCI_P_SIG_SC_SHIFT	8
+#define		AHCI_P_SIG_SC_SHIFT	0
 
 #define AHCI_P_SSTS(p)	(0x128 + AHCI_P_OFFSET(p)) /* Serial ATA status */
 



CVS commit: src/sys/arch/arm/broadcom

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Oct 18 02:34:34 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_eth.c

Log Message:
Make an ASSERT more flexible.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/arm/broadcom/bcm53xx_eth.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/arm/broadcom/bcm53xx_eth.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.11 src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.12
--- src/sys/arch/arm/broadcom/bcm53xx_eth.c:1.11	Wed Oct 17 20:18:55 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_eth.c	Thu Oct 18 02:34:34 2012
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: bcm53xx_eth.c,v 1.11 2012/10/17 20:18:55 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: bcm53xx_eth.c,v 1.12 2012/10/18 02:34:34 matt Exp $);
 
 #include sys/param.h
 #include sys/atomic.h
@@ -840,7 +840,7 @@ bcmeth_rx_buf_alloc(
 		bcmeth_mapcache_put(sc, sc-sc_rx_mapcache, map);
 		return NULL;
 	}
-	KASSERT(map-_dm_flags  _BUS_DMAMAP_COHERENT);
+	KASSERT(((map-_dm_flags ^ sc-sc_dmat-_ranges[0].dr_flags)  _BUS_DMAMAP_COHERENT) == 0);
 	KASSERT(map-dm_mapsize == MCLBYTES);
 	*mtod(m, uint32_t *) = BCMETH_RCVMAGIC;
 	bus_dmamap_sync(sc-sc_dmat, map, 0, sizeof(uint32_t),



CVS commit: src/sys/arch/arm/broadcom

2012-10-17 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Thu Oct 18 02:36:37 UTC 2012

Modified Files:
src/sys/arch/arm/broadcom: bcm53xx_board.c

Log Message:
Rearrange some code.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/arm/broadcom/bcm53xx_board.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/arm/broadcom/bcm53xx_board.c
diff -u src/sys/arch/arm/broadcom/bcm53xx_board.c:1.6 src/sys/arch/arm/broadcom/bcm53xx_board.c:1.7
--- src/sys/arch/arm/broadcom/bcm53xx_board.c:1.6	Wed Oct 17 20:18:55 2012
+++ src/sys/arch/arm/broadcom/bcm53xx_board.c	Thu Oct 18 02:36:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bcm53xx_board.c,v 1.6 2012/10/17 20:18:55 matt Exp $	*/
+/*	$NetBSD: bcm53xx_board.c,v 1.7 2012/10/18 02:36:37 matt Exp $	*/
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 #include sys/cdefs.h
 
-__KERNEL_RCSID(1, $NetBSD: bcm53xx_board.c,v 1.6 2012/10/17 20:18:55 matt Exp $);
+__KERNEL_RCSID(1, $NetBSD: bcm53xx_board.c,v 1.7 2012/10/18 02:36:37 matt Exp $);
 
 #include sys/param.h
 #include sys/bus.h
@@ -513,19 +513,17 @@ bcm53xx_dma_bootstrap(psize_t memsize)
 		bcm53xx_dma_tag._ranges = bcm53xx_dma_ranges;
 		bcm53xx_dma_tag._nranges = __arraycount(bcm53xx_dma_ranges);
 		bcm53xx_coherent_dma_ranges[0] = bcm53xx_dma_ranges[0];
-		bcm53xx_coherent_dma_ranges[0].dr_flags = _BUS_DMAMAP_COHERENT;
 		bcm53xx_coherent_dma_ranges[1] = bcm53xx_dma_ranges[1];
-		bcm53xx_coherent_dma_tag._ranges = bcm53xx_coherent_dma_ranges;
 		bcm53xx_coherent_dma_tag._nranges =
 		__arraycount(bcm53xx_coherent_dma_ranges);
 	} else {
 		bcm53xx_coherent_dma_ranges[0].dr_sysbase = 0x8000;
 		bcm53xx_coherent_dma_ranges[0].dr_busbase = 0x8000;
 		bcm53xx_coherent_dma_ranges[0].dr_len = memsize;
-		bcm53xx_coherent_dma_ranges[0].dr_flags = _BUS_DMAMAP_COHERENT;
-		bcm53xx_coherent_dma_tag._ranges = bcm53xx_coherent_dma_ranges;
 		bcm53xx_coherent_dma_tag._nranges = 1;
 	}
+	bcm53xx_coherent_dma_ranges[0].dr_flags = _BUS_DMAMAP_COHERENT;
+	bcm53xx_coherent_dma_tag._ranges = bcm53xx_coherent_dma_ranges;
 }
 
 #ifdef MULTIPROCESSOR