CVS commit: src/usr.bin/find

2011-01-06 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jan  6 08:18:43 UTC 2011

Modified Files:
src/usr.bin/find: function.c

Log Message:
Fix -exec blah blah {} + so it only matches when the {} is last, as
per the standard. Per (brief) discussion on tech-userlevel.

There should really be a form where you can do the equivalent of
-exec blah {} blah +, but I think we're going to need to call it
something other than -exec. As it is it's sort of surprising that the
standards people didn't add a different name -- note what happens if
you try to do something like find ... -exec expr {} + 2 \;.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/usr.bin/find/function.c

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

Modified files:

Index: src/usr.bin/find/function.c
diff -u src/usr.bin/find/function.c:1.64 src/usr.bin/find/function.c:1.65
--- src/usr.bin/find/function.c:1.64	Thu Jul 19 07:49:30 2007
+++ src/usr.bin/find/function.c	Thu Jan  6 08:18:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: function.c,v 1.64 2007/07/19 07:49:30 daniel Exp $	*/
+/*	$NetBSD: function.c,v 1.65 2011/01/06 08:18:42 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = from: @(#)function.c	8.10 (Berkeley) 5/4/95;
 #else
-__RCSID($NetBSD: function.c,v 1.64 2007/07/19 07:49:30 daniel Exp $);
+__RCSID($NetBSD: function.c,v 1.65 2011/01/06 08:18:42 dholland Exp $);
 #endif
 #endif /* not lint */
 
@@ -646,6 +646,7 @@
 			errx(1, %s: no terminating \;\ or \+\,
 			isok ? -ok : -exec);
 		lastbrace = brace;
+		brace = 0;
 		if (strcmp(*ap, {}) == 0)
 			brace = 1;
 		if (strcmp(*ap, ;) == 0)



CVS commit: src/usr.bin/iconv

2011-01-06 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu Jan  6 08:30:09 UTC 2011

Modified Files:
src/usr.bin/iconv: iconv.1

Log Message:
fix typo, from Ryo HAYASAKA in PR 44332.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/usr.bin/iconv/iconv.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/iconv/iconv.1
diff -u src/usr.bin/iconv/iconv.1:1.3 src/usr.bin/iconv/iconv.1:1.4
--- src/usr.bin/iconv/iconv.1:1.3	Thu Mar 20 11:35:44 2008
+++ src/usr.bin/iconv/iconv.1	Thu Jan  6 08:30:09 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: iconv.1,v 1.3 2008/03/20 11:35:44 tnozaki Exp $
+.\ $NetBSD: iconv.1,v 1.4 2011/01/06 08:30:09 dholland Exp $
 .\
 .\ Copyright (c)2003 Citrus Project,
 .\ All rights reserved.
@@ -77,7 +77,7 @@
 .Dq invalid character
 specified by the
 .Ar to_name
-codeset when it encounts a character which is valid in the
+codeset when it encounters a character which is valid in the
 .Ar from_name
 codeset but does not have a corresponding character in the
 .Ar to_name



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

2011-01-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  6 10:20:57 UTC 2011

Modified Files:
src/sys/rump/librump/rumpvfs: rump_vfs.c

Log Message:
cwdi0 lock is now initialized in proc0_init()


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/rump/librump/rumpvfs/rump_vfs.c

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

Modified files:

Index: src/sys/rump/librump/rumpvfs/rump_vfs.c
diff -u src/sys/rump/librump/rumpvfs/rump_vfs.c:1.63 src/sys/rump/librump/rumpvfs/rump_vfs.c:1.64
--- src/sys/rump/librump/rumpvfs/rump_vfs.c:1.63	Tue Nov 30 15:41:35 2010
+++ src/sys/rump/librump/rumpvfs/rump_vfs.c	Thu Jan  6 10:20:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump_vfs.c,v 1.63 2010/11/30 15:41:35 pooka Exp $	*/
+/*	$NetBSD: rump_vfs.c,v 1.64 2011/01/06 10:20:57 pooka Exp $	*/
 
 /*
  * Copyright (c) 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.63 2010/11/30 15:41:35 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump_vfs.c,v 1.64 2011/01/06 10:20:57 pooka Exp $);
 
 #include sys/param.h
 #include sys/buf.h
@@ -118,7 +118,6 @@
 	root_device = rump_rootdev;
 
 	/* bootstrap cwdi (rest done in vfs_mountroot() */
-	rw_init(cwdi0.cwdi_lock);
 	proc0.p_cwdi = cwdi0;
 	proc0.p_cwdi = cwdinit();
 



CVS commit: src/sys/external/bsd/drm/dist/bsd-core

2011-01-06 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Jan  6 11:07:49 UTC 2011

Modified Files:
src/sys/external/bsd/drm/dist/bsd-core: drm_pciids.h

Log Message:
recognize Radeon HD 4200. This lets radeondrm(4) attach.
go ahead macallan@


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.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/external/bsd/drm/dist/bsd-core/drm_pciids.h
diff -u src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h:1.4 src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h:1.5
--- src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h:1.4	Sat Jun 26 23:00:19 2010
+++ src/sys/external/bsd/drm/dist/bsd-core/drm_pciids.h	Thu Jan  6 11:07:48 2011
@@ -393,6 +393,7 @@
 	{0x1002, 0x9552, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, ATI Mobility Radeon 4300 Series}, \
 	{0x1002, 0x9553, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, ATI Mobility Radeon 4500 Series}, \
 	{0x1002, 0x9555, CHIP_RV710|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP, ATI Mobility Radeon 4500 Series}, \
+	{0x1002, 0x9712, CHIP_RV620|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP, ATI Radeon Mobility HD 4200}, \
 	{0, 0, 0, NULL}
 
 #define r128_PCI_IDS \



CVS commit: src/sys/rump

2011-01-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  6 11:22:55 UTC 2011

Modified Files:
src/sys/rump: Makefile.rump
src/sys/rump/librump/rumpkern: Makefile.rumpkern emul.c locks.c
lwproc.c rump.c

Log Message:
Support LOCKDEBUG.  To use it, compile sys/rump with RUMP_LOCKDEBUG=yes.

requested by martin (sparc64 gdb cannot reliably produce a stack trace)


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/rump/Makefile.rump
cvs rdiff -u -r1.105 -r1.106 src/sys/rump/librump/rumpkern/Makefile.rumpkern
cvs rdiff -u -r1.147 -r1.148 src/sys/rump/librump/rumpkern/emul.c
cvs rdiff -u -r1.44 -r1.45 src/sys/rump/librump/rumpkern/locks.c
cvs rdiff -u -r1.7 -r1.8 src/sys/rump/librump/rumpkern/lwproc.c
cvs rdiff -u -r1.215 -r1.216 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/Makefile.rump
diff -u src/sys/rump/Makefile.rump:1.58 src/sys/rump/Makefile.rump:1.59
--- src/sys/rump/Makefile.rump:1.58	Mon Dec  6 09:12:34 2010
+++ src/sys/rump/Makefile.rump	Thu Jan  6 11:22:54 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rump,v 1.58 2010/12/06 09:12:34 pooka Exp $
+#	$NetBSD: Makefile.rump,v 1.59 2011/01/06 11:22:54 pooka Exp $
 #
 
 WARNS?=		3	# XXX: src/sys won't compile with -Wsign-compare yet
@@ -30,6 +30,10 @@
 LDFLAGS+=	-T ${RUMPTOP}/ldscript.rump
 #CPPFLAGS+=	-DDEBUG
 
+.ifdef RUMP_LOCKDEBUG
+CPPFLAGS+=	-DLOCKDEBUG
+.endif
+
 # kernel libs should not get linked against libc
 # XXX: actually, we would like to enable this but cannot, since it
 # also leaves out libgcc, it causes problems on some platforms.

Index: src/sys/rump/librump/rumpkern/Makefile.rumpkern
diff -u src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.105 src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.106
--- src/sys/rump/librump/rumpkern/Makefile.rumpkern:1.105	Tue Jan  4 16:23:36 2011
+++ src/sys/rump/librump/rumpkern/Makefile.rumpkern	Thu Jan  6 11:22:55 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.rumpkern,v 1.105 2011/01/04 16:23:36 pooka Exp $
+#	$NetBSD: Makefile.rumpkern,v 1.106 2011/01/06 11:22:55 pooka Exp $
 #
 
 .include ${RUMPTOP}/Makefile.rump
@@ -125,6 +125,10 @@
 #CPPFLAGS+=	-DRUMP_USE_UNREAL_ALLOCATORS
 SRCS+=		subr_kmem.c subr_percpu.c subr_pool.c subr_vmem.c
 
+.ifdef RUMP_LOCKDEBUG
+SRCS+=		subr_lockdebug.c
+.endif
+
 # no shlib_version because this is automatically in sync with lib/librump
 SHLIB_MAJOR=0
 SHLIB_MINOR=0

Index: src/sys/rump/librump/rumpkern/emul.c
diff -u src/sys/rump/librump/rumpkern/emul.c:1.147 src/sys/rump/librump/rumpkern/emul.c:1.148
--- src/sys/rump/librump/rumpkern/emul.c:1.147	Sun Nov 21 17:34:11 2010
+++ src/sys/rump/librump/rumpkern/emul.c	Thu Jan  6 11:22:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: emul.c,v 1.147 2010/11/21 17:34:11 pooka Exp $	*/
+/*	$NetBSD: emul.c,v 1.148 2011/01/06 11:22:55 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.147 2010/11/21 17:34:11 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: emul.c,v 1.148 2011/01/06 11:22:55 pooka Exp $);
 
 #include sys/param.h
 #include sys/null.h
@@ -52,6 +52,7 @@
 #include sys/reboot.h
 #include sys/syscallvar.h
 #include sys/xcall.h
+#include sys/sleepq.h
 
 #include dev/cons.h
 
@@ -293,3 +294,12 @@
 
 	/* nada */
 }
+
+#ifdef LOCKDEBUG
+void
+turnstile_print(volatile void *obj, void (*pr)(const char *, ...))
+{
+
+	/* nada */
+}
+#endif

Index: src/sys/rump/librump/rumpkern/locks.c
diff -u src/sys/rump/librump/rumpkern/locks.c:1.44 src/sys/rump/librump/rumpkern/locks.c:1.45
--- src/sys/rump/librump/rumpkern/locks.c:1.44	Wed Dec  1 17:22:51 2010
+++ src/sys/rump/librump/rumpkern/locks.c	Thu Jan  6 11:22:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locks.c,v 1.44 2010/12/01 17:22:51 pooka Exp $	*/
+/*	$NetBSD: locks.c,v 1.45 2011/01/06 11:22:55 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.44 2010/12/01 17:22:51 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.45 2011/01/06 11:22:55 pooka Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -41,6 +41,42 @@
 #include rump_private.h
 
 /*
+ * Simple lockdebug.  If it's compiled in, it's always active.
+ * Currently available only for mtx/rwlock.
+ */
+#ifdef LOCKDEBUG
+#include sys/lockdebug.h
+
+static lockops_t mutex_lockops = {
+	mutex,
+	LOCKOPS_SLEEP,
+	NULL
+};
+static lockops_t rw_lockops = {
+	mutex,
+	LOCKOPS_SLEEP,
+	NULL
+};
+
+#define ALLOCK(lock, ops)		\
+lockdebug_alloc(lock, ops, (uintptr_t)__builtin_return_address(0))
+#define FREELOCK(lock)			\
+lockdebug_free(lock)
+#define WANTLOCK(lock, shar, try)	\
+lockdebug_wantlock(lock, (uintptr_t)__builtin_return_address(0), shar, try)
+#define LOCKED(lock, shar)		\
+lockdebug_locked(lock, 

CVS commit: src/lib/libcurses

2011-01-06 Thread Brett Lymn
Module Name:src
Committed By:   blymn
Date:   Thu Jan  6 11:29:41 UTC 2011

Modified Files:
src/lib/libcurses: color.c

Log Message:
Back out change for assume_default_colors as it was not correct.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libcurses/color.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/libcurses/color.c
diff -u src/lib/libcurses/color.c:1.36 src/lib/libcurses/color.c:1.37
--- src/lib/libcurses/color.c:1.36	Sat Dec 25 10:05:08 2010
+++ src/lib/libcurses/color.c	Thu Jan  6 11:29:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: color.c,v 1.36 2010/12/25 10:05:08 blymn Exp $	*/
+/*	$NetBSD: color.c,v 1.37 2011/01/06 11:29:40 blymn Exp $	*/
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: color.c,v 1.36 2010/12/25 10:05:08 blymn Exp $);
+__RCSID($NetBSD: color.c,v 1.37 2011/01/06 11:29:40 blymn Exp $);
 #endif/* not lint */
 
 #include curses.h
@@ -437,24 +437,14 @@
  *	Set the default foreground and background colours.
  */
 int
-assume_default_colors(short arg_fore, short arg_back)
+assume_default_colors(short fore, short back)
 {
-	short fore, back;
-
-	fore = arg_fore;
-	back = arg_back;
-
 #ifdef DEBUG
 	__CTRACE(__CTRACE_COLOR, assume_default_colors: %d, %d\n,
 	fore, back);
 	__CTRACE(__CTRACE_COLOR, assume_default_colors: default_colour = %d, pair_number = %d\n, __default_color, PAIR_NUMBER(__default_color));
 #endif
 
-	if (arg_fore == -1)
-		fore = COLOR_WHITE;
-	if (arg_back == -1)
-		back = COLOR_BLACK;
-
 	/* Swap red/blue and yellow/cyan */
 	if (_cursesi_screen-color_type == COLOR_OTHER) {
 		switch (fore) {



CVS commit: src/sys/arch/hp300/hp300

2011-01-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan  6 13:03:47 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: locore.s machdep.c pmap_bootstrap.c

Log Message:
Move bootinfo address initialization to locore.s and machdep.c
to reduce MD quirks in pmap_bootstrap.c.
Also print bootinfo_pa in consinit() so that we can see
at least MMU is properly enabled after boot.

Tested on HP382.


To generate a diff of this commit:
cvs rdiff -u -r1.157 -r1.158 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.212 -r1.213 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.157 src/sys/arch/hp300/hp300/locore.s:1.158
--- src/sys/arch/hp300/hp300/locore.s:1.157	Mon Dec 27 15:39:07 2010
+++ src/sys/arch/hp300/hp300/locore.s	Thu Jan  6 13:03:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.157 2010/12/27 15:39:07 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.158 2011/01/06 13:03:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -114,7 +114,7 @@
  * VA 0.
  *
  * The bootloader places the bootinfo in this page, and we allocate
- * a VA for it and map it in pmap_bootstrap().
+ * a VA for it and map it later.
  */
 	.fill	PAGE_SIZE/4,4,0
 
@@ -420,14 +420,17 @@
 	moveq	#FC_USERD,%d0		| user space
 	movc	%d0,%sfc		|   as source
 	movc	%d0,%dfc		|   and destination of transfers
+/* save the first PA as bootinfo_pa to map it to a virtual address later. */
+	movl	%a5,%d0			| lowram value from ROM via boot
+	RELOC(bootinfo_pa, %a0)
+	movl	%d0,%a0@		| save the lowram as bootinfo PA
 /* initialize memory sizes (for pmap_bootstrap) */
 	movl	#MAXADDR,%d1		| last page
 	moveq	#PGSHIFT,%d2
 	lsrl	%d2,%d1			| convert to page (click) number
 	RELOC(maxmem, %a0)
 	movl	%d1,%a0@		| save as maxmem
-	movl	%a5,%d0			| lowram value from ROM via boot
-	lsrl	%d2,%d0			| convert to page number
+	lsrl	%d2,%d0			| convert the lowram to page number
 	subl	%d0,%d1			| compute amount of RAM present
 	RELOC(physmem, %a0)
 	movl	%d1,%a0@		| and physmem

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.212 src/sys/arch/hp300/hp300/machdep.c:1.213
--- src/sys/arch/hp300/hp300/machdep.c:1.212	Sat Oct 16 16:41:45 2010
+++ src/sys/arch/hp300/hp300/machdep.c	Thu Jan  6 13:03:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.212 2010/10/16 16:41:45 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.212 2010/10/16 16:41:45 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -249,6 +249,8 @@
 	 * exists by searching for the MAGIC record.  If it's not
 	 * there, disable bootinfo.
 	 */
+	bootinfo_va = virtual_avail;
+	virtual_avail += PAGE_SIZE;
 	pmap_enter(pmap_kernel(), bootinfo_va, bootinfo_pa,
 	VM_PROT_READ|VM_PROT_WRITE,
 	VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
@@ -260,6 +262,7 @@
 		pmap_remove(pmap_kernel(), bootinfo_va,
 		bootinfo_va + PAGE_SIZE);
 		pmap_update(pmap_kernel());
+		virtual_avail -= PAGE_SIZE;
 		bootinfo_va = 0;
 	}
 }
@@ -287,7 +290,9 @@
 	/*
 	 * Issue a warning if the boot loader didn't provide bootinfo.
 	 */
-	if (bootinfo_va == 0)
+	if (bootinfo_va != 0)
+		printf(bootinfo found at 0x%08lx\n, bootinfo_pa);
+	else
 		printf(WARNING: boot loader did not provide bootinfo\n);
 
 #if NKSYMS || defined(DDB) || defined(MODULAR)

Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c
diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.51 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52
--- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.51	Sun Jan  2 18:48:05 2011
+++ src/sys/arch/hp300/hp300/pmap_bootstrap.c	Thu Jan  6 13:03:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.51 2011/01/02 18:48:05 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.51 2011/01/02 18:48:05 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $);
 
 #include sys/param.h
 #include uvm/uvm_extern.h
@@ -52,8 +52,6 @@
 
 extern char *etext;
 extern vaddr_t CLKbase, MMUbase;
-extern paddr_t bootinfo_pa;
-extern vaddr_t bootinfo_va;
 
 extern int maxmem, physmem;
 extern paddr_t avail_start, avail_end;
@@ -339,16 +337,6 @@
 	epte = pte[nptpages * NPTEPG];
 	while (pte  epte)
 		*pte++ = PG_NV;
-
-	/*
-	 * The page of kernel text is zero-filled in locore.s,
-	 * and not mapped (at VA 0).  The boot loader places the
-	 * bootinfo here 

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

2011-01-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  6 13:09:17 UTC 2011

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

Log Message:
give the outside world some idea of if we have LOCKDEBUG or not


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/rump/librump/rumpkern/rump.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.216 src/sys/rump/librump/rumpkern/rump.c:1.217
--- src/sys/rump/librump/rumpkern/rump.c:1.216	Thu Jan  6 11:22:55 2011
+++ src/sys/rump/librump/rumpkern/rump.c	Thu Jan  6 13:09:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rump.c,v 1.216 2011/01/06 11:22:55 pooka Exp $	*/
+/*	$NetBSD: rump.c,v 1.217 2011/01/06 13:09:17 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.216 2011/01/06 11:22:55 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: rump.c,v 1.217 2011/01/06 13:09:17 pooka Exp $);
 
 #include sys/systm.h
 #define ELFSIZE ARCH_ELFSIZE
@@ -104,6 +104,12 @@
 
 static char rump_msgbuf[16*1024]; /* 16k should be enough for std rump needs */
 
+#ifdef LOCKDEBUG
+const int rump_lockdebug = 1;
+#else
+const int rump_lockdebug = 0;
+#endif
+
 static void
 rump_aiodone_worker(struct work *wk, void *dummy)
 {



CVS commit: src/tests/rump

2011-01-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  6 13:12:53 UTC 2011

Modified Files:
src/tests/rump/kernspace: Makefile kernspace.h
src/tests/rump/rumpkern: Makefile
Added Files:
src/tests/rump/kernspace: lockme.c
src/tests/rump/rumpkern: t_kern.c

Log Message:
Add some tests for lock errors.  Notably, some of them fare nicely
with just the pthread consistency checks (which are enabled by
default in rumpuser), but others require real LOCKDEBUG.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/rump/kernspace/Makefile
cvs rdiff -u -r1.2 -r1.3 src/tests/rump/kernspace/kernspace.h
cvs rdiff -u -r0 -r1.1 src/tests/rump/kernspace/lockme.c
cvs rdiff -u -r1.11 -r1.12 src/tests/rump/rumpkern/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/rump/rumpkern/t_kern.c

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

Modified files:

Index: src/tests/rump/kernspace/Makefile
diff -u src/tests/rump/kernspace/Makefile:1.3 src/tests/rump/kernspace/Makefile:1.4
--- src/tests/rump/kernspace/Makefile:1.3	Mon Jun 14 21:06:09 2010
+++ src/tests/rump/kernspace/Makefile	Thu Jan  6 13:12:52 2011
@@ -1,10 +1,10 @@
-#	$NetBSD: Makefile,v 1.3 2010/06/14 21:06:09 pooka Exp $
+#	$NetBSD: Makefile,v 1.4 2011/01/06 13:12:52 pooka Exp $
 #
 
 .include bsd.own.mk
 
 LIB=	kernspace
-SRCS=	thread.c busypage.c tsleep.c alloc.c
+SRCS=	thread.c busypage.c tsleep.c alloc.c lockme.c
 
 RUMPTOP=${NETBSDSRCDIR}/sys/rump
 

Index: src/tests/rump/kernspace/kernspace.h
diff -u src/tests/rump/kernspace/kernspace.h:1.2 src/tests/rump/kernspace/kernspace.h:1.3
--- src/tests/rump/kernspace/kernspace.h:1.2	Mon Jun 14 21:06:09 2010
+++ src/tests/rump/kernspace/kernspace.h	Thu Jan  6 13:12:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kernspace.h,v 1.2 2010/06/14 21:06:09 pooka Exp $	*/
+/*	$NetBSD: kernspace.h,v 1.3 2011/01/06 13:12:52 pooka Exp $	*/
 
 /*-
  * Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -30,10 +30,15 @@
 #ifndef _TESTS_RUMP_KERNSPACE_KERNSPACE_H_
 #define _TESTS_RUMP_KERNSPACE_KERNSPACE_H_
 
+enum locktest { LOCKME_MTX, LOCKME_RWDOUBLEX, LOCKME_RWRX, LOCKME_RWXR,
+	LOCKME_DESTROYHELD, LOCKME_DOUBLEINIT, LOCKME_DOUBLEFREE,
+	LOCKME_MEMFREE };
+
 void rumptest_busypage(void);
 void rumptest_threadjoin(void);
 void rumptest_thread(void);
 void rumptest_tsleep(void);
 void rumptest_alloc(size_t);
+void rumptest_lockme(enum locktest);
 
 #endif /* _TESTS_RUMP_KERNSPACE_KERNSPACE_H_ */

Index: src/tests/rump/rumpkern/Makefile
diff -u src/tests/rump/rumpkern/Makefile:1.11 src/tests/rump/rumpkern/Makefile:1.12
--- src/tests/rump/rumpkern/Makefile:1.11	Mon Dec 13 13:39:42 2010
+++ src/tests/rump/rumpkern/Makefile	Thu Jan  6 13:12:52 2011
@@ -1,10 +1,11 @@
-# $NetBSD: Makefile,v 1.11 2010/12/13 13:39:42 pooka Exp $
+# $NetBSD: Makefile,v 1.12 2011/01/06 13:12:52 pooka Exp $
 
 .include bsd.own.mk
 
 TESTSDIR=	${TESTSBASE}/rump/rumpkern
 
 TESTS_C=	t_copy
+TESTS_C+=	t_kern
 TESTS_C+=	t_lwproc
 TESTS_C+=	t_modcmd
 TESTS_C+=	t_modlinkset

Added files:

Index: src/tests/rump/kernspace/lockme.c
diff -u /dev/null src/tests/rump/kernspace/lockme.c:1.1
--- /dev/null	Thu Jan  6 13:12:53 2011
+++ src/tests/rump/kernspace/lockme.c	Thu Jan  6 13:12:52 2011
@@ -0,0 +1,92 @@
+/*	$NetBSD: lockme.c,v 1.1 2011/01/06 13:12:52 pooka Exp $	*/
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
+ * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+ * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+ * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+ * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+#if !defined(lint)
+__RCSID($NetBSD: lockme.c,v 1.1 2011/01/06 13:12:52 pooka Exp $);
+#endif /* !lint */
+
+#include sys/param.h
+#include sys/kmem.h
+#include sys/mutex.h
+#include 

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

2011-01-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  6 13:13:44 UTC 2011

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

Log Message:
+tp


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

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.211 src/distrib/sets/lists/tests/mi:1.212
--- src/distrib/sets/lists/tests/mi:1.211	Thu Jan  6 07:05:51 2011
+++ src/distrib/sets/lists/tests/mi	Thu Jan  6 13:13:44 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.211 2011/01/06 07:05:51 pooka Exp $
+# $NetBSD: mi,v 1.212 2011/01/06 13:13:44 pooka Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -471,6 +471,7 @@
 ./usr/libdata/debug/usr/tests/rump/modautoload/t_modautoload.debug	tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkerntests-syscall-debug
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_copy.debug		tests-syscall-debug	debug,atf
+./usr/libdata/debug/usr/tests/rump/rumpkern/t_kern.debug		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_lwproc.debug		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modcmd.debug		tests-syscall-debug	debug,atf
 ./usr/libdata/debug/usr/tests/rump/rumpkern/t_modlinkset.debug		tests-syscall-debug	debug,atf
@@ -1801,6 +1802,7 @@
 ./usr/tests/rump/rumpkern			tests-rump-tests
 ./usr/tests/rump/rumpkern/Atffile		tests-rump-tests	atf
 ./usr/tests/rump/rumpkern/t_copy			tests-rump-tests	atf
+./usr/tests/rump/rumpkern/t_kern		tests-rump-tests	atf
 ./usr/tests/rump/rumpkern/t_lwproc		tests-rump-tests	atf
 ./usr/tests/rump/rumpkern/t_modcmd		tests-rump-tests	atf
 ./usr/tests/rump/rumpkern/t_modlinkset		tests-rump-tests	atf



CVS commit: src/sys/arch/hp300/hp300

2011-01-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan  6 13:25:32 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: leds.c pmap_bootstrap.c

Log Message:
Move VA allocation of ledbase to leds.c just before pmap_enter(9)
to reduce MD quirk in pmap_bootstrap.c.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/hp300/leds.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/leds.c
diff -u src/sys/arch/hp300/hp300/leds.c:1.18 src/sys/arch/hp300/hp300/leds.c:1.19
--- src/sys/arch/hp300/hp300/leds.c:1.18	Sun Mar  4 05:59:49 2007
+++ src/sys/arch/hp300/hp300/leds.c	Thu Jan  6 13:25:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: leds.c,v 1.18 2007/03/04 05:59:49 christos Exp $	*/
+/*	$NetBSD: leds.c,v 1.19 2011/01/06 13:25:32 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: leds.c,v 1.18 2007/03/04 05:59:49 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: leds.c,v 1.19 2011/01/06 13:25:32 tsutsui Exp $);
 
 #include sys/param.h
 
@@ -85,7 +85,7 @@
 
 #include hp300/hp300/leds.h
 
-extern void *	ledbase;	/* kva of LED page */
+static vaddr_t	ledbase;	/* kva of LED page */
 uint8_t		*ledaddr;	/* actual address of LEDs */
 static volatile uint8_t currentleds; /* current LED status */
 
@@ -96,10 +96,11 @@
 ledinit(void)
 {
 
-	pmap_enter(pmap_kernel(), (vaddr_t)ledbase, (paddr_t)LED_ADDR,
+	ledbase = uvm_km_alloc(kernel_map, PAGE_SIZE, 0, UVM_KMF_VAONLY);
+	pmap_enter(pmap_kernel(), ledbase, (paddr_t)LED_ADDR,
 	VM_PROT_READ|VM_PROT_WRITE, VM_PROT_READ|VM_PROT_WRITE|PMAP_WIRED);
 	pmap_update(pmap_kernel());
-	ledaddr = (uint8_t *) ((long)ledbase | (LED_ADDR  PGOFSET));
+	ledaddr = (uint8_t *)(ledbase | (LED_ADDR  PGOFSET));
 }
 
 /*

Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c
diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53
--- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.52	Thu Jan  6 13:03:47 2011
+++ src/sys/arch/hp300/hp300/pmap_bootstrap.c	Thu Jan  6 13:25:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.52 2011/01/06 13:03:47 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $);
 
 #include sys/param.h
 #include uvm/uvm_extern.h
@@ -63,12 +63,10 @@
  *	CADDR1, CADDR2:	pmap zero/copy operations
  *	vmmap:		/dev/mem, crash dumps, parity error checking
  *	msgbufaddr:	kernel message buffer
- *	ledbase:	SPU LEDs
  */
 void *CADDR1, *CADDR2;
 char *vmmap;
 void *msgbufaddr;
-void *ledbase;
 
 void pmap_bootstrap(paddr_t, paddr_t);
 
@@ -483,8 +481,6 @@
 		va += PAGE_SIZE;
 		RELOC(vmmap, void *) = (void *)va;
 		va += PAGE_SIZE;
-		RELOC(ledbase, void *) = (void *)va;
-		va += PAGE_SIZE;
 		RELOC(msgbufaddr, void *) = (void *)va;
 		va += m68k_round_page(MSGBUFSIZE);
 		RELOC(virtual_avail, vaddr_t) = va;



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

2011-01-06 Thread Antti Kantee
Module Name:src
Committed By:   pooka
Date:   Thu Jan  6 13:36:49 UTC 2011

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

Log Message:
antipasto


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/rump/librump/rumpkern/locks.c

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

Modified files:

Index: src/sys/rump/librump/rumpkern/locks.c
diff -u src/sys/rump/librump/rumpkern/locks.c:1.45 src/sys/rump/librump/rumpkern/locks.c:1.46
--- src/sys/rump/librump/rumpkern/locks.c:1.45	Thu Jan  6 11:22:55 2011
+++ src/sys/rump/librump/rumpkern/locks.c	Thu Jan  6 13:36:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locks.c,v 1.45 2011/01/06 11:22:55 pooka Exp $	*/
+/*	$NetBSD: locks.c,v 1.46 2011/01/06 13:36:48 pooka Exp $	*/
 
 /*
  * Copyright (c) 2007, 2008 Antti Kantee.  All Rights Reserved.
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.45 2011/01/06 11:22:55 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: locks.c,v 1.46 2011/01/06 13:36:48 pooka Exp $);
 
 #include sys/param.h
 #include sys/kmem.h
@@ -53,7 +53,7 @@
 	NULL
 };
 static lockops_t rw_lockops = {
-	mutex,
+	rwlock,
 	LOCKOPS_SLEEP,
 	NULL
 };



CVS commit: src/sys/arch/m68k

2011-01-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan  6 13:49:17 UTC 2011

Modified Files:
src/sys/arch/m68k/include: pmap_motorola.h
src/sys/arch/m68k/m68k: pmap_motorola.c

Log Message:
Use #ifdef CACHE_HAVE_VAC rather than #ifdef M68K_MMU_HP where
the pmap code indends.
(though currently only MMU_HP machines have VAC in pmap_motorola ports)


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/m68k/include/pmap_motorola.h
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/m68k/m68k/pmap_motorola.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/m68k/include/pmap_motorola.h
diff -u src/sys/arch/m68k/include/pmap_motorola.h:1.31 src/sys/arch/m68k/include/pmap_motorola.h:1.32
--- src/sys/arch/m68k/include/pmap_motorola.h:1.31	Sun Jan  2 05:21:11 2011
+++ src/sys/arch/m68k/include/pmap_motorola.h	Thu Jan  6 13:49:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.h,v 1.31 2011/01/02 05:21:11 tsutsui Exp $	*/
+/*	$NetBSD: pmap_motorola.h,v 1.32 2011/01/06 13:49:16 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -246,7 +246,7 @@
 #if defined(M68040) || defined(M68060)
 extern u_int		protostfree;
 #endif
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 extern u_int		pmap_aliasmask;
 #endif
 

Index: src/sys/arch/m68k/m68k/pmap_motorola.c
diff -u src/sys/arch/m68k/m68k/pmap_motorola.c:1.58 src/sys/arch/m68k/m68k/pmap_motorola.c:1.59
--- src/sys/arch/m68k/m68k/pmap_motorola.c:1.58	Sun Jan  2 05:21:11 2011
+++ src/sys/arch/m68k/m68k/pmap_motorola.c	Thu Jan  6 13:49:17 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_motorola.c,v 1.58 2011/01/02 05:21:11 tsutsui Exp $*/
+/*	$NetBSD: pmap_motorola.c,v 1.59 2011/01/06 13:49:17 tsutsui Exp $*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -119,7 +119,7 @@
 #include opt_m68k_arch.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_motorola.c,v 1.58 2011/01/02 05:21:11 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_motorola.c,v 1.59 2011/01/06 13:49:17 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -270,7 +270,7 @@
 TAILQ_HEAD(pv_page_list, pv_page) pv_page_freelist;
 int		pv_nfree;
 
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 u_int		pmap_aliasmask;	/* seperation at which VA aliasing ok */
 #endif
 #if defined(M68040) || defined(M68060)
@@ -913,7 +913,7 @@
 	vaddr_t nssva;
 	pt_entry_t *pte;
 	int flags;
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	bool firstpage = true, needcflush = false;
 #endif
 
@@ -944,7 +944,7 @@
 			}
 
 			if (pmap_pte_v(pte)) {
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 if (pmap_aliasmask) {
 
 	/*
@@ -976,7 +976,7 @@
 		}
 	}
 
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 
 	/*
 	 * Didn't do anything, no need for cache flushes
@@ -,7 +,7 @@
 		pte = pmap_pte(pmap, sva);
 		while (sva  nssva) {
 			if (pmap_pte_v(pte)  pmap_pte_prot_chg(pte, isro)) {
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 
 /*
  * Purge kernel side of VAC to ensure we
@@ -1313,7 +1313,7 @@
 			npv-pv_ptpmap = NULL;
 			pv-pv_next = npv;
 
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 
 			/*
 			 * Since there is another logical mapping for the
@@ -1391,7 +1391,7 @@
 		pmap-pm_stats.wired_count++;
 
 validate:
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	/*
 	 * Purge kernel side of VAC to ensure we get correct state
 	 * of HW bits so we don't clobber them.
@@ -1448,7 +1448,7 @@
 	*pte = npte;
 	if (!wired  active_pmap(pmap))
 		TBIS(va);
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	/*
 	 * The following is executed if we are entering a second
 	 * (or greater) mapping for a physical page and the mappings
@@ -1537,14 +1537,14 @@
 	pt_entry_t *pte;
 	vaddr_t nssva;
 	vaddr_t eva = va + size;
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	bool firstpage, needcflush;
 #endif
 
 	PMAP_DPRINTF(PDB_FOLLOW|PDB_REMOVE|PDB_PROTECT,
 	(pmap_kremove(%lx, %lx)\n, va, size));
 
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	firstpage = true;
 	needcflush = false;
 #endif
@@ -1574,7 +1574,7 @@
 va += PAGE_SIZE;
 continue;
 			}
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 			if (pmap_aliasmask) {
 
 /*
@@ -1605,7 +1605,7 @@
 		}
 	}
 
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 
 	/*
 	 * In a couple of cases, we don't need to worry about flushing
@@ -1874,7 +1874,7 @@
 	PMAP_DPRINTF(PDB_FOLLOW, (pmap_zero_page(%lx)\n, phys));
 
 	npte = phys | PG_V;
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	if (pmap_aliasmask) {
 
 		/*
@@ -1932,7 +1932,7 @@
 
 	npte1 = src | PG_RO | PG_V;
 	npte2 = dst | PG_V;
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 	if (pmap_aliasmask) {
 
 		/*
@@ -2051,7 +2051,7 @@
 	return m68k_ptob(ppn);
 }
 
-#ifdef M68K_MMU_HP
+#ifdef CACHE_HAVE_VAC
 /*
  * pmap_prefer:			[ INTERFACE ]
  *
@@ -2074,7 +2074,7 @@
 		*vap = va + d;
 	}
 }
-#endif /* M68K_MMU_HP */
+#endif /* CACHE_HAVE_VAC */
 
 /*
  * Miscellaneous support routines follow
@@ 

CVS commit: src/sys/arch/hp300/hp300

2011-01-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan  6 14:19:54 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: machdep.c pmap_bootstrap.c

Log Message:
Move pmap_aliasmask initialization from pmap_bootstrap.c
to machdep.c:hp300_init() before the first pmap(9) use.


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/hp300/hp300/pmap_bootstrap.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/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.213 src/sys/arch/hp300/hp300/machdep.c:1.214
--- src/sys/arch/hp300/hp300/machdep.c:1.213	Thu Jan  6 13:03:47 2011
+++ src/sys/arch/hp300/hp300/machdep.c	Thu Jan  6 14:19:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.214 2011/01/06 14:19:54 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.213 2011/01/06 13:03:47 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.214 2011/01/06 14:19:54 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -221,6 +221,22 @@
 
 	extern paddr_t avail_start, avail_end;
 
+#ifdef CACHE_HAVE_VAC
+	/*
+	 * Determine VA aliasing distance if any
+	 */
+	switch (machineid) {
+	case HP_320:
+		pmap_aliasmask = 0x3fff;	/* 16KB */
+		break;
+	case HP_350:
+		pmap_aliasmask = 0x7fff;	/* 32KB */
+		break;
+	default:
+		break;
+	}
+#endif
+
 	/*
 	 * Tell the VM system about available physical memory.  The
 	 * hp300 only has one segment.

Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c
diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.54
--- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.53	Thu Jan  6 13:25:32 2011
+++ src/sys/arch/hp300/hp300/pmap_bootstrap.c	Thu Jan  6 14:19:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.54 2011/01/06 14:19:54 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.53 2011/01/06 13:25:32 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.54 2011/01/06 14:19:54 tsutsui Exp $);
 
 #include sys/param.h
 #include uvm/uvm_extern.h
@@ -457,18 +457,6 @@
 
 	RELOC(virtual_end, vaddr_t) = VM_MAX_KERNEL_ADDRESS;
 
-#ifdef M68K_MMU_HP
-	/*
-	 * Determine VA aliasing distance if any
-	 */
-	if (RELOC(ectype, int) == EC_VIRT) {
-		if (RELOC(machineid, int) == HP_320)
-			RELOC(pmap_aliasmask, int) = 0x3fff;	/* 16k */
-		else if (RELOC(machineid, int) == HP_350)
-			RELOC(pmap_aliasmask, int) = 0x7fff;	/* 32k */
-	}
-#endif
-
 	/*
 	 * Allocate some fixed, special purpose kernel virtual addresses
 	 */



CVS commit: src

2011-01-06 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Jan  6 15:19:10 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/fs/vfs: Makefile
Added Files:
src/tests/fs/vfs: t_unpriv.c

Log Message:
Start unprivileged filesystem tests. For now, only chown/chmod owner
checks.


To generate a diff of this commit:
cvs rdiff -u -r1.212 -r1.213 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.13 -r1.14 src/tests/fs/vfs/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/fs/vfs/t_unpriv.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.212 src/distrib/sets/lists/tests/mi:1.213
--- src/distrib/sets/lists/tests/mi:1.212	Thu Jan  6 13:13:44 2011
+++ src/distrib/sets/lists/tests/mi	Thu Jan  6 15:19:09 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.212 2011/01/06 13:13:44 pooka Exp $
+# $NetBSD: mi,v 1.213 2011/01/06 15:19:09 njoly Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -269,6 +269,7 @@
 ./usr/libdata/debug/usr/tests/fs/vfs/t_renamerace.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/vfs/t_rmdirrace.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/vfs/t_ro.debug			tests-fs-debug		debug,atf
+./usr/libdata/debug/usr/tests/fs/vfs/t_unpriv.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/vfs/t_vfsops.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/fs/vfs/t_vnops.debug			tests-fs-debug		debug,atf
 ./usr/libdata/debug/usr/tests/include	tests-ipf-tests
@@ -1222,6 +1223,7 @@
 ./usr/tests/fs/vfs/t_renamerace			tests-fs-tests		atf
 ./usr/tests/fs/vfs/t_rmdirrace			tests-fs-tests		atf
 ./usr/tests/fs/vfs/t_ro			tests-fs-tests		atf
+./usr/tests/fs/vfs/t_unpriv			tests-fs-tests		atf
 ./usr/tests/fs/vfs/t_vfsops			tests-fs-tests		atf
 ./usr/tests/fs/vfs/t_vnops			tests-fs-tests		atf
 ./usr/tests/gamestests-games-tests

Index: src/tests/fs/vfs/Makefile
diff -u src/tests/fs/vfs/Makefile:1.13 src/tests/fs/vfs/Makefile:1.14
--- src/tests/fs/vfs/Makefile:1.13	Fri Dec 31 18:20:32 2010
+++ src/tests/fs/vfs/Makefile	Thu Jan  6 15:19:10 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.13 2010/12/31 18:20:32 pooka Exp $
+#	$NetBSD: Makefile,v 1.14 2011/01/06 15:19:10 njoly Exp $
 #
 
 .include bsd.own.mk
@@ -11,6 +11,7 @@
 TESTS_C+=	t_renamerace
 TESTS_C+=	t_ro
 TESTS_C+=	t_rmdirrace
+TESTS_C+=	t_unpriv
 TESTS_C+=	t_vfsops
 TESTS_C+=	t_vnops
 

Added files:

Index: src/tests/fs/vfs/t_unpriv.c
diff -u /dev/null src/tests/fs/vfs/t_unpriv.c:1.1
--- /dev/null	Thu Jan  6 15:19:10 2011
+++ src/tests/fs/vfs/t_unpriv.c	Thu Jan  6 15:19:10 2011
@@ -0,0 +1,83 @@
+/*	$NetBSD: t_unpriv.c,v 1.1 2011/01/06 15:19:10 njoly Exp $	*/
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include atf-c.h
+#include unistd.h
+
+#include rump/rump_syscalls.h
+#include rump/rump.h
+
+#include ../common/h_fsmacros.h
+#include ../../h_macros.h
+
+#define USE_OWNER			 \
+	if (FSTYPE_SYSVBFS(tc) || FSTYPE_MSDOS(tc) || FSTYPE_RUMPFS(tc)) \
+	atf_tc_skip(owner not supported by file system)
+
+static void
+owner(const atf_tc_t *tc, const char *mp)
+{
+
+	USE_OWNER;
+
+	FSTEST_ENTER();
+
+	rump_pub_lwproc_rfork(RUMP_RFCFDG);
+	if (rump_sys_setuid(1) == -1)
+		atf_tc_fail_errno(setuid);
+if (rump_sys_chown(., 1, -1) != -1 || errno != EPERM)
+		atf_tc_fail_errno(chown);
+if (rump_sys_chmod(., ) != -1 || errno != EPERM) 
+atf_tc_fail_errno(chmod);
+	

CVS commit: src/lib/librt

2011-01-06 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Jan  6 15:22:21 UTC 2011

Modified Files:
src/lib/librt: aio_suspend.3

Log Message:
Fix macro (DV - Dv).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/lib/librt/aio_suspend.3

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

Modified files:

Index: src/lib/librt/aio_suspend.3
diff -u src/lib/librt/aio_suspend.3:1.4 src/lib/librt/aio_suspend.3:1.5
--- src/lib/librt/aio_suspend.3:1.4	Mon May 17 19:22:31 2010
+++ src/lib/librt/aio_suspend.3	Thu Jan  6 15:22:20 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: aio_suspend.3,v 1.4 2010/05/17 19:22:31 jruoho Exp $
+.\ $NetBSD: aio_suspend.3,v 1.5 2011/01/06 15:22:20 njoly Exp $
 .\
 .\ Copyright (c) 1999 Softweyr LLC.
 .\ All rights reserved.
@@ -67,7 +67,7 @@
 If
 .Fa timeout
 is a
-.DV NULL
+.Dv NULL
 pointer, the suspend blocks indefinitely.
 To effect a poll, the
 .Fa timeout



CVS commit: src/share/man/man4

2011-01-06 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Jan  6 15:24:33 UTC 2011

Modified Files:
src/share/man/man4: mpls.4

Log Message:
Fix macro, OS - Os.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/share/man/man4/mpls.4

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/mpls.4
diff -u src/share/man/man4/mpls.4:1.2 src/share/man/man4/mpls.4:1.3
--- src/share/man/man4/mpls.4:1.2	Tue Jun 29 15:05:43 2010
+++ src/share/man/man4/mpls.4	Thu Jan  6 15:24:33 2011
@@ -1,4 +1,4 @@
-.\ $NetBSD: mpls.4,v 1.2 2010/06/29 15:05:43 wiz Exp $
+.\ $NetBSD: mpls.4,v 1.3 2011/01/06 15:24:33 njoly Exp $
 .\
 .\ Copyright (c) 2010 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -26,7 +26,7 @@
 .\
 .Dd June 29, 2010
 .Dt MPLS 4
-.OS
+.Os
 .Sh NAME
 .Nm mpls
 .Nd Multiprotocol Label Switching



CVS commit: src/sbin/gpt

2011-01-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jan  6 16:30:40 UTC 2011

Modified Files:
src/sbin/gpt: add.c gpt.c show.c

Log Message:
UFS is called FFS in the NetBSD case.  Display as such and accept as input.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sbin/gpt/add.c
cvs rdiff -u -r1.13 -r1.14 src/sbin/gpt/gpt.c
cvs rdiff -u -r1.5 -r1.6 src/sbin/gpt/show.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/gpt/add.c
diff -u src/sbin/gpt/add.c:1.8 src/sbin/gpt/add.c:1.9
--- src/sbin/gpt/add.c:1.8	Sat Feb  7 18:12:22 2009
+++ src/sbin/gpt/add.c	Thu Jan  6 16:30:40 2011
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: add.c,v 1.8 2009/02/07 18:12:22 uebayasi Exp $);
+__RCSID($NetBSD: add.c,v 1.9 2011/01/06 16:30:40 jakllsch Exp $);
 #endif
 
 #include sys/types.h
@@ -213,10 +213,10 @@
 	if (argc == optind)
 		usage_add();
 
-	/* Create UFS partitions by default. */
+	/* Create NetBSD FFS partitions by default. */
 	if (uuid_is_nil(type, NULL)) {
-		uuid_t ufs = GPT_ENT_TYPE_NETBSD_FFS;
-		type = ufs;
+		uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS;
+		type = nb_ffs;
 	}
 
 	while (optind  argc) {

Index: src/sbin/gpt/gpt.c
diff -u src/sbin/gpt/gpt.c:1.13 src/sbin/gpt/gpt.c:1.14
--- src/sbin/gpt/gpt.c:1.13	Thu Jan  6 01:08:48 2011
+++ src/sbin/gpt/gpt.c	Thu Jan  6 16:30:40 2011
@@ -31,7 +31,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/gpt.c,v 1.16 2006/07/07 02:44:23 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: gpt.c,v 1.13 2011/01/06 01:08:48 jakllsch Exp $);
+__RCSID($NetBSD: gpt.c,v 1.14 2011/01/06 16:30:40 jakllsch Exp $);
 #endif
 
 #include sys/param.h
@@ -306,6 +306,13 @@
 			return (0);
 		}
 		break;
+	case 'f':
+		if (strcmp(s, ffs) == 0) {
+			uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS;
+			*uuid = nb_ffs;
+			return (0);
+		}
+		break;
 	case 'h':
 		if (strcmp(s, hfs) == 0) {
 			uuid_t hfs = GPT_ENT_TYPE_APPLE_HFS;

Index: src/sbin/gpt/show.c
diff -u src/sbin/gpt/show.c:1.5 src/sbin/gpt/show.c:1.6
--- src/sbin/gpt/show.c:1.5	Sun Feb 24 18:38:10 2008
+++ src/sbin/gpt/show.c	Thu Jan  6 16:30:40 2011
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/show.c,v 1.14 2006/06/22 22:22:32 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: show.c,v 1.5 2008/02/24 18:38:10 christos Exp $);
+__RCSID($NetBSD: show.c,v 1.6 2011/01/06 16:30:40 jakllsch Exp $);
 #endif
 
 #include sys/types.h
@@ -72,7 +72,7 @@
 	static uuid_t ufs = GPT_ENT_TYPE_FREEBSD_UFS;
 	static uuid_t vinum = GPT_ENT_TYPE_FREEBSD_VINUM;
 	static uuid_t nb_swap = GPT_ENT_TYPE_NETBSD_SWAP;
-	static uuid_t nb_ufs = GPT_ENT_TYPE_NETBSD_FFS;
+	static uuid_t nb_ffs = GPT_ENT_TYPE_NETBSD_FFS;
 	static uuid_t nb_lfs = GPT_ENT_TYPE_NETBSD_LFS;
 	static uuid_t nb_raid = GPT_ENT_TYPE_NETBSD_RAIDFRAME;
 	static uuid_t nb_ccd = GPT_ENT_TYPE_NETBSD_CCD;
@@ -89,8 +89,8 @@
 		return (BIOS Boot);
 	if (uuid_equal(t, nb_swap, NULL))
 		return (NetBSD swap);
-	if (uuid_equal(t, nb_ufs, NULL))
-		return (NetBSD UFS/UFS2);
+	if (uuid_equal(t, nb_ffs, NULL))
+		return (NetBSD FFSv1/FFSv2);
 	if (uuid_equal(t, nb_lfs, NULL))
 		return (NetBSD LFS);
 	if (uuid_equal(t, nb_raid, NULL))



CVS commit: src/share/man/man5

2011-01-06 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Thu Jan  6 16:37:36 UTC 2011

Modified Files:
src/share/man/man5: phones.5

Log Message:
Remove single-quote forgotten in previous cleanup.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/share/man/man5/phones.5

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/man5/phones.5
diff -u src/share/man/man5/phones.5:1.7 src/share/man/man5/phones.5:1.8
--- src/share/man/man5/phones.5:1.7	Thu Aug  7 10:31:17 2003
+++ src/share/man/man5/phones.5	Thu Jan  6 16:37:35 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: phones.5,v 1.7 2003/08/07 10:31:17 agc Exp $
+.\	$NetBSD: phones.5,v 1.8 2011/01/06 16:37:35 njoly Exp $
 .\
 .\ Copyright (c) 1983, 1991, 1993
 .\	The Regents of the University of California.  All rights reserved.
@@ -67,7 +67,7 @@
 indicators to the auto call units to pause and wait for a second dial
 tone (when going through an exchange).  The
 .Dq \=
-' is required by the
+is required by the
 .Tn DF02-AC
 and the
 .Dq \*



CVS commit: src

2011-01-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan  6 17:20:48 UTC 2011

Modified Files:
src/distrib/sets/lists/tests: mi
src/tests/lib/libc: Makefile
Added Files:
src/tests/lib/libc: t_mktime.c

Log Message:
Atf-ify test for mktime(3)


To generate a diff of this commit:
cvs rdiff -u -r1.213 -r1.214 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.21 -r1.22 src/tests/lib/libc/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/lib/libc/t_mktime.c

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.213 src/distrib/sets/lists/tests/mi:1.214
--- src/distrib/sets/lists/tests/mi:1.213	Thu Jan  6 15:19:09 2011
+++ src/distrib/sets/lists/tests/mi	Thu Jan  6 17:20:48 2011
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.213 2011/01/06 15:19:09 njoly Exp $
+# $NetBSD: mi,v 1.214 2011/01/06 17:20:48 pgoyette Exp $
 #
 # Note: don't delete entries from here - mark them as obsolete instead.
 #
@@ -388,6 +388,7 @@
 ./usr/libdata/debug/usr/tests/lib/libc/t_gdtoa.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/t_hsearch.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/t_inet.debug			tests-lib-debug		debug,atf
+./usr/libdata/debug/usr/tests/lib/libc/t_mktime.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/t_ptm.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/t_randomid.debug			tests-lib-debug		debug,atf
 ./usr/libdata/debug/usr/tests/lib/libc/t_strptime.debug			tests-lib-debug		debug,atf
@@ -1684,6 +1685,7 @@
 ./usr/tests/lib/libc/t_gdtoa			tests-lib-tests		atf
 ./usr/tests/lib/libc/t_hsearch			tests-lib-tests		atf
 ./usr/tests/lib/libc/t_inet			tests-lib-tests		atf
+./usr/tests/lib/libc/t_mktime			tests-lib-tests		atf
 ./usr/tests/lib/libc/t_nsdispatch		tests-lib-tests		atf
 ./usr/tests/lib/libc/t_protoent			tests-lib-tests		atf
 ./usr/tests/lib/libc/t_ptm			tests-lib-tests		atf

Index: src/tests/lib/libc/Makefile
diff -u src/tests/lib/libc/Makefile:1.21 src/tests/lib/libc/Makefile:1.22
--- src/tests/lib/libc/Makefile:1.21	Wed Jan  5 21:17:04 2011
+++ src/tests/lib/libc/Makefile	Thu Jan  6 17:20:48 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.21 2011/01/05 21:17:04 pgoyette Exp $
+# $NetBSD: Makefile,v 1.22 2011/01/06 17:20:48 pgoyette Exp $
 
 .include bsd.own.mk
 .include bsd.sys.mk
@@ -17,6 +17,7 @@
 TESTS_C+=	t_gdtoa
 TESTS_C+=	t_hsearch
 TESTS_C+=	t_inet
+TESTS_C+=	t_mktime
 TESTS_C+=	t_ptm
 TESTS_C+=	t_randomid
 TESTS_C+=	t_strptime

Added files:

Index: src/tests/lib/libc/t_mktime.c
diff -u /dev/null src/tests/lib/libc/t_mktime.c:1.1
--- /dev/null	Thu Jan  6 17:20:48 2011
+++ src/tests/lib/libc/t_mktime.c	Thu Jan  6 17:20:48 2011
@@ -0,0 +1,65 @@
+/* $NetBSD: t_mktime.c,v 1.1 2011/01/06 17:20:48 pgoyette Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by 
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include atf-c.h
+
+#include err.h
+#include errno.h
+#include string.h
+#include time.h
+
+ATF_TC(mktime);
+
+ATF_TC_HEAD(mktime, tc)
+{
+
+	atf_tc_set_md_var(tc, descr, Test mktime(3) with negative year);
+}
+
+ATF_TC_BODY(mktime, tc)
+{
+	struct tm tms;
+
+	(void)memset(tms, 0, sizeof(tms));
+	tms.tm_year = ~0;
+
+	errno = 0;
+
+	ATF_REQUIRE_ERRNO(errno, mktime(tms) != (time_t)-1);
+}
+
+ATF_TP_ADD_TCS(tp)
+{
+
+	ATF_TP_ADD_TC(tp, mktime);
+
+	return atf_no_error();
+}



CVS commit: src/regress/lib/libc

2011-01-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Thu Jan  6 17:22:15 UTC 2011

Modified Files:
src/regress/lib/libc: Makefile
Removed Files:
src/regress/lib/libc/time: Makefile Makefile.inc
src/regress/lib/libc/time/mktime: Makefile mktime.c

Log Message:
mktime test has been atf-ified


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/regress/lib/libc/Makefile
cvs rdiff -u -r1.3 -r0 src/regress/lib/libc/time/Makefile
cvs rdiff -u -r1.1 -r0 src/regress/lib/libc/time/Makefile.inc
cvs rdiff -u -r1.1 -r0 src/regress/lib/libc/time/mktime/Makefile \
src/regress/lib/libc/time/mktime/mktime.c

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

Modified files:

Index: src/regress/lib/libc/Makefile
diff -u src/regress/lib/libc/Makefile:1.73 src/regress/lib/libc/Makefile:1.74
--- src/regress/lib/libc/Makefile:1.73	Wed Jan  5 21:20:25 2011
+++ src/regress/lib/libc/Makefile	Thu Jan  6 17:22:14 2011
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.73 2011/01/05 21:20:25 pgoyette Exp $
+#	$NetBSD: Makefile,v 1.74 2011/01/06 17:22:14 pgoyette Exp $
 
-SUBDIR+= citrus db divrem getaddrinfo int_fmtio locale regex rpc sys time
+SUBDIR+= citrus db divrem getaddrinfo int_fmtio locale regex rpc sys
 
 .include bsd.own.mk
 .include bsd.sys.mk



CVS commit: src/sbin/gpt

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jan  6 17:51:28 UTC 2011

Modified Files:
src/sbin/gpt: add.c

Log Message:
Clarify the 'dkctl addwedge' usage message after creating a GPT
partition.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sbin/gpt/add.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/gpt/add.c
diff -u src/sbin/gpt/add.c:1.9 src/sbin/gpt/add.c:1.10
--- src/sbin/gpt/add.c:1.9	Thu Jan  6 16:30:40 2011
+++ src/sbin/gpt/add.c	Thu Jan  6 17:51:28 2011
@@ -29,7 +29,7 @@
 __FBSDID($FreeBSD: src/sbin/gpt/add.c,v 1.14 2006/06/22 22:05:28 marcel Exp $);
 #endif
 #ifdef __RCSID
-__RCSID($NetBSD: add.c,v 1.9 2011/01/06 16:30:40 jakllsch Exp $);
+__RCSID($NetBSD: add.c,v 1.10 2011/01/06 17:51:28 riz Exp $);
 #endif
 
 #include sys/types.h
@@ -163,8 +163,8 @@
 #endif
 #ifdef __NetBSD__
 	printf(Partition added, use:\n);
-	printf(\tdkctl %s addwedge dkN % PRIu64  % PRIu64  type\n,
-	device_arg, map-map_start, map-map_size);
+	printf(\tdkctl %s addwedge wedgename % PRIu64  % PRIu64
+	 type\n, device_arg, map-map_start, map-map_size);
 	printf(to create a wedge for it\n);
 #endif
 }



CVS commit: src/sbin/disklabel

2011-01-06 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  6 19:34:28 UTC 2011

Modified Files:
src/sbin/disklabel: main.c

Log Message:
match printf formats and types from Patrick Welche


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sbin/disklabel/main.c

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

Modified files:

Index: src/sbin/disklabel/main.c
diff -u src/sbin/disklabel/main.c:1.22 src/sbin/disklabel/main.c:1.23
--- src/sbin/disklabel/main.c:1.22	Tue Jan  5 10:45:26 2010
+++ src/sbin/disklabel/main.c	Thu Jan  6 14:34:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.22 2010/01/05 15:45:26 tsutsui Exp $	*/
+/*	$NetBSD: main.c,v 1.23 2011/01/06 19:34:28 christos Exp $	*/
 
 /*
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -76,7 +76,7 @@
 static char sccsid[] = @(#)disklabel.c	8.4 (Berkeley) 5/4/95;
 /* from static char sccsid[] = @(#)disklabel.c	1.2 (Symmetric) 11/28/85; */
 #else
-__RCSID($NetBSD: main.c,v 1.22 2010/01/05 15:45:26 tsutsui Exp $);
+__RCSID($NetBSD: main.c,v 1.23 2011/01/06 19:34:28 christos Exp $);
 #endif
 #endif	/* not lint */
 
@@ -1106,40 +1106,40 @@
 	if ((unsigned) lp-d_type  DKMAXTYPES)
 		(void) fprintf(f, %s:, dktypenames[lp-d_type]);
 	else
-		(void) fprintf(f, unknown%d:, lp-d_type);
+		(void) fprintf(f, unknown% PRIu16 :, lp-d_type);
 
-	(void) fprintf(f, se#%d:, lp-d_secsize);
-	(void) fprintf(f, ns#%d:, lp-d_nsectors);
-	(void) fprintf(f, nt#%d:, lp-d_ntracks);
-	(void) fprintf(f, sc#%d:, lp-d_secpercyl);
-	(void) fprintf(f, nc#%d:, lp-d_ncylinders);
+	(void) fprintf(f, se#% PRIu32 :, lp-d_secsize);
+	(void) fprintf(f, ns#% PRIu32 :, lp-d_nsectors);
+	(void) fprintf(f, nt#% PRIu32 :, lp-d_ntracks);
+	(void) fprintf(f, sc#% PRIu32 :, lp-d_secpercyl);
+	(void) fprintf(f, nc#% PRIu32 :, lp-d_ncylinders);
 
 	if ((lp-d_secpercyl * lp-d_ncylinders) != lp-d_secperunit) {
-		(void) fprintf(f, %ssu#%d:, did, lp-d_secperunit);
+		(void) fprintf(f, %ssu#% PRIu32 :, did, lp-d_secperunit);
 		did = ;
 	}
 	if (lp-d_rpm != 3600) {
-		(void) fprintf(f, %srm#%d:, did, lp-d_rpm);
+		(void) fprintf(f, %srm#% PRIu16 :, did, lp-d_rpm);
 		did = ;
 	}
 	if (lp-d_interleave != 1) {
-		(void) fprintf(f, %sil#%d:, did, lp-d_interleave);
+		(void) fprintf(f, %sil#% PRIu16 :, did, lp-d_interleave);
 		did = ;
 	}
 	if (lp-d_trackskew != 0) {
-		(void) fprintf(f, %ssk#%d:, did, lp-d_trackskew);
+		(void) fprintf(f, %ssk#% PRIu16 :, did, lp-d_trackskew);
 		did = ;
 	}
 	if (lp-d_cylskew != 0) {
-		(void) fprintf(f, %scs#%d:, did, lp-d_cylskew);
+		(void) fprintf(f, %scs#% PRIu16 :, did, lp-d_cylskew);
 		did = ;
 	}
 	if (lp-d_headswitch != 0) {
-		(void) fprintf(f, %shs#%d:, did, lp-d_headswitch);
+		(void) fprintf(f, %shs#% PRIu16 :, did, lp-d_headswitch);
 		did = ;
 	}
 	if (lp-d_trkseek != 0) {
-		(void) fprintf(f, %sts#%d:, did, lp-d_trkseek);
+		(void) fprintf(f, %sts#% PRIu32 :, did, lp-d_trkseek);
 		did = ;
 	}
 #ifdef notyet
@@ -1150,22 +1150,22 @@
 	if (i  0)
 		i = 0;
 	for (j = 0; j = i; j++)
-		(void) fprintf(f, %d , lp-d_drivedata[j]);
+		(void) fprintf(f, % PRIu32  , lp-d_drivedata[j]);
 #endif	/* notyet */
 	pp = lp-d_partitions;
 	for (i = 0; i  lp-d_npartitions; i++, pp++) {
 		if (pp-p_size) {
 			char c = 'a' + i;
 			(void) fprintf(f, \\\n\t:);
-			(void) fprintf(f, p%c#%d:, c, pp-p_size);
-			(void) fprintf(f, o%c#%d:, c, pp-p_offset);
+			(void) fprintf(f, p%c#% PRIu32 :, c, pp-p_size);
+			(void) fprintf(f, o%c#% PRIu32 :, c, pp-p_offset);
 			if (pp-p_fstype != FS_UNUSED) {
 if ((unsigned) pp-p_fstype  FSMAXTYPES)
 	(void) fprintf(f, t%c=%s:, c,
 	fstypenames[pp-p_fstype]);
 else
-	(void) fprintf(f, t%c=unknown%d:,
-	c, pp-p_fstype);
+	(void) fprintf(f, t%c=unknown% PRIu8
+	:, c, pp-p_fstype);
 			}
 			switch (pp-p_fstype) {
 
@@ -1177,9 +1177,10 @@
 			case FS_EX2FS:
 			case FS_ADOS:
 			case FS_APPLEUFS:
-(void) fprintf(f, b%c#%d:, c,
-pp-p_fsize * pp-p_frag);
-(void) fprintf(f, f%c#%d:, c, pp-p_fsize);
+(void) fprintf(f, b%c#% PRIu64 :, c,
+(uint64_t)pp-p_fsize * pp-p_frag);
+(void) fprintf(f, f%c#% PRIu32 :, c,
+pp-p_fsize);
 break;
 			default:
 break;
@@ -1709,34 +1710,34 @@
 
 	errors = 0;
 	if (lp-d_secsize == 0) {
-		warnx(sector size %d, lp-d_secsize);
+		warnx(sector size % PRIu32, lp-d_secsize);
 		return (1);
 	}
 	if (lp-d_nsectors == 0) {
-		warnx(sectors/track %d, lp-d_nsectors);
+		warnx(sectors/track % PRIu32, lp-d_nsectors);
 		return (1);
 	}
 	if (lp-d_ntracks == 0) {
-		warnx(tracks/cylinder %d, lp-d_ntracks);
+		warnx(tracks/cylinder % PRIu32, lp-d_ntracks);
 		return (1);
 	}
 	if  (lp-d_ncylinders == 0) {
-		warnx(cylinders/unit %d, lp-d_ncylinders);
+		warnx(cylinders/unit % PRIu32, lp-d_ncylinders);
 		errors++;
 	}
 	if (lp-d_rpm == 0)
-		warnx(warning, revolutions/minute %d, lp-d_rpm);
+		warnx(warning, revolutions/minute % PRIu16, 

CVS commit: src/doc

2011-01-06 Thread Jonathan A. Kollasch
Module Name:src
Committed By:   jakllsch
Date:   Thu Jan  6 19:49:37 UTC 2011

Modified Files:
src/doc: CHANGES

Log Message:
Note new GPT support in the x86 boot code.


To generate a diff of this commit:
cvs rdiff -u -r1.1485 -r1.1486 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.1485 src/doc/CHANGES:1.1486
--- src/doc/CHANGES:1.1485	Wed Jan  5 20:08:13 2011
+++ src/doc/CHANGES	Thu Jan  6 19:49:37 2011
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1485 $
+# LIST OF CHANGES FROM LAST RELEASE:			$Revision: 1.1486 $
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -819,3 +819,5 @@
 	resize_ffs(8): support byteswapped file systems, and support
 		growing ufs2 file systems. [riz 20110104]
 	acpipmtr(4): Add a driver for ACPI power meters. [jruoho 20110105]
+	amd64, i386: Booting from a disk with a GUID Partition Table is
+		now possible. [jakllsch 20110106]



CVS commit: src/sbin/disklabel

2011-01-06 Thread Alan Barrett
Module Name:src
Committed By:   apb
Date:   Thu Jan  6 21:39:01 UTC 2011

Modified Files:
src/sbin/disklabel: interact.c main.c printlabel.c

Log Message:
Change printf formats to match the data type of the values being
printed.  There's now a lot of PRIu16 and PRIu32, some PRIu8, some
SCNu32, and a few cases where %u and %d were reversed.  Multiplication
of 32-bit and 8-bit values is cast to uint64_t and printed with PRIu64.

Inspired by a report from Patrick Welche on current-users.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sbin/disklabel/interact.c
cvs rdiff -u -r1.23 -r1.24 src/sbin/disklabel/main.c
cvs rdiff -u -r1.15 -r1.16 src/sbin/disklabel/printlabel.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/disklabel/interact.c
diff -u src/sbin/disklabel/interact.c:1.34 src/sbin/disklabel/interact.c:1.35
--- src/sbin/disklabel/interact.c:1.34	Fri May 28 07:40:53 2010
+++ src/sbin/disklabel/interact.c	Thu Jan  6 21:39:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: interact.c,v 1.34 2010/05/28 07:40:53 dholland Exp $	*/
+/*	$NetBSD: interact.c,v 1.35 2011/01/06 21:39:01 apb Exp $	*/
 
 /*
  * Copyright (c) 1997 Christos Zoulas.  All rights reserved.
@@ -30,7 +30,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: interact.c,v 1.34 2010/05/28 07:40:53 dholland Exp $);
+__RCSID($NetBSD: interact.c,v 1.35 2011/01/06 21:39:01 apb Exp $);
 #endif /* lint */
 
 #include sys/param.h
@@ -203,13 +203,13 @@
 
 	/* d_npartitions */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_npartitions);
+		snprintf(def, sizeof(def), % PRIu16, lp-d_npartitions);
 		i = getinput(:, Number of partitions, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid number of partitions `%s'\n, line);
 			continue;
 		}
@@ -219,13 +219,13 @@
 
 	/* d_secsize */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_secsize);
+		snprintf(def, sizeof(def), % PRIu32, lp-d_secsize);
 		i = getinput(:, Sector size (bytes), def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid sector size `%s'\n, line);
 			continue;
 		}
@@ -235,13 +235,13 @@
 
 	/* d_nsectors */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_nsectors);
+		snprintf(def, sizeof(def), % PRIu32, lp-d_nsectors);
 		i = getinput(:, Number of sectors per track, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid number of sectors `%s'\n, line);
 			continue;
 		}
@@ -251,13 +251,13 @@
 
 	/* d_ntracks */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_ntracks);
+		snprintf(def, sizeof(def), % PRIu32, lp-d_ntracks);
 		i = getinput(:, Number of tracks per cylinder, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid number of tracks `%s'\n, line);
 			continue;
 		}
@@ -267,13 +267,13 @@
 
 	/* d_secpercyl */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_secpercyl);
+		snprintf(def, sizeof(def), % PRIu32, lp-d_secpercyl);
 		i = getinput(:, Number of sectors/cylinder, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid number of sector/cylinder `%s'\n,
 			line);
 			continue;
@@ -284,13 +284,13 @@
 
 	/* d_ncylinders */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_ncylinders);
+		snprintf(def, sizeof(def), % PRIu32, lp-d_ncylinders);
 		i = getinput(:, Total number of cylinders, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid sector size `%s'\n, line);
 			continue;
 		}
@@ -300,13 +300,13 @@
 
 	/* d_secperunit */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_secperunit);
+		snprintf(def, sizeof(def), % PRIu32, lp-d_secperunit);
 		i = getinput(:, Total number of sectors, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid number of sectors `%s'\n, line);
 			continue;
 		}
@@ -318,13 +318,13 @@
 
 	/* d_interleave */
 	for (;;) {
-		snprintf(def, sizeof(def), %u, lp-d_interleave);
+		snprintf(def, sizeof(def), % PRIu16, lp-d_interleave);
 		i = getinput(:, Hardware sectors interleave, def, line);
 		if (i == -1)
 			return;
 		else if (i == 0)
 			break;
-		if (sscanf(line, %u, u) != 1) {
+		if (sscanf(line, % SCNu32, u) != 1) {
 			printf(Invalid sector interleave `%s'\n, line);
 			continue;
 		}
@@ -334,13 +334,13 @@
 
 	/* 

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

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Thu Jan  6 23:46:13 UTC 2011

Modified Files:
src/dist/bind/lib/isc [netbsd-5]: backtrace.c

Log Message:
Apply revision 1.2 of external/bsd/bind/dist/lib/isc/backtrace.c, to
fix pullup ticket #1517.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.1 -r1.1.2.2 src/dist/bind/lib/isc/backtrace.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/lib/isc/backtrace.c
diff -u src/dist/bind/lib/isc/backtrace.c:1.1.2.1 src/dist/bind/lib/isc/backtrace.c:1.1.2.2
--- src/dist/bind/lib/isc/backtrace.c:1.1.2.1	Thu Jan  6 21:41:58 2011
+++ src/dist/bind/lib/isc/backtrace.c	Thu Jan  6 23:46:13 2011
@@ -1,4 +1,4 @@
-/*$NetBSD: backtrace.c,v 1.1.2.1 2011/01/06 21:41:58 riz Exp $  */
+/*$NetBSD: backtrace.c,v 1.1.2.2 2011/01/06 23:46:13 riz Exp $  */
 
 /*
  * Copyright (C) 2009  Internet Systems Consortium, Inc. (ISC)
@@ -187,7 +187,7 @@
 	 * first argument.  Note that the body of this function cannot be
 	 * inlined since it depends on the address of the function argument.
 	 */
-	sp = (void **)addrs - 2;
+	sp = (void **)(void *)addrs - 2;
 #endif
 
 	while (sp != NULL  i  maxaddrs) {



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-01-06 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Fri Jan  7 00:16:20 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixlvar.h

Log Message:
- add prottotype for rmixl_pcr_init_core()


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.18 -r1.1.2.19 src/sys/arch/mips/rmi/rmixlvar.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/mips/rmi/rmixlvar.h
diff -u src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.18 src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.19
--- src/sys/arch/mips/rmi/rmixlvar.h:1.1.2.18	Sat Apr 17 07:33:33 2010
+++ src/sys/arch/mips/rmi/rmixlvar.h	Fri Jan  7 00:16:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixlvar.h,v 1.1.2.18 2010/04/17 07:33:33 cliff Exp $	*/
+/*	$NetBSD: rmixlvar.h,v 1.1.2.19 2011/01/07 00:16:20 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -46,6 +46,8 @@
 
 #include dev/pci/pcivar.h
 
+extern void rmixl_pcr_init_core(void);
+
 static inline bool
 cpu_rmixl(const struct pridtab *ct)
 {



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-01-06 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Fri Jan  7 00:16:59 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpucore.c

Log Message:
- add cpucore_rmixl_hatch() for per-core initialization


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.6 -r1.1.2.7 src/sys/arch/mips/rmi/rmixl_cpucore.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/mips/rmi/rmixl_cpucore.c
diff -u src/sys/arch/mips/rmi/rmixl_cpucore.c:1.1.2.6 src/sys/arch/mips/rmi/rmixl_cpucore.c:1.1.2.7
--- src/sys/arch/mips/rmi/rmixl_cpucore.c:1.1.2.6	Sun Mar 21 21:24:19 2010
+++ src/sys/arch/mips/rmi/rmixl_cpucore.c	Fri Jan  7 00:16:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpucore.c,v 1.1.2.6 2010/03/21 21:24:19 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpucore.c,v 1.1.2.7 2011/01/07 00:16:59 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_cpucore.c,v 1.1.2.6 2010/03/21 21:24:19 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_cpucore.c,v 1.1.2.7 2011/01/07 00:16:59 cliff Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -50,6 +50,7 @@
 #include mips/rmi/rmixlvar.h
 #include mips/rmi/rmixl_cpunodevar.h
 #include mips/rmi/rmixl_cpucorevar.h
+#include mips/rmi/rmixl_fmnvar.h
 
 static int	cpucore_rmixl_match(device_t, cfdata_t, void *);
 static void	cpucore_rmixl_attach(device_t, device_t, void *);
@@ -87,6 +88,7 @@
 
 	sc-sc_dev = self;
 	sc-sc_core = na-na_core;
+	sc-sc_hatched = false;
 
 #ifdef MULTIPROCESSOR
 	/*
@@ -148,3 +150,24 @@
 
 	return (UNCONF);
 }
+
+#ifdef MULTIPROCESSOR
+/*
+ * cpucore_rmixl_hatch
+ *	called from cpu_rmixl_hatch for each cpu
+ *	the first call for each cpucore causes init of per-core features
+ */
+void
+cpucore_rmixl_hatch(device_t self)
+{
+	struct cpucore_softc * const sc = device_private(self);
+
+	if (sc-sc_hatched == false) {
+		/* PCRs for core#0 are set up in mach_init() */
+		if (sc-sc_core != 0)
+			rmixl_pcr_init_core();
+		rmixl_fmn_init_core();
+		sc-sc_hatched = true;
+	}
+}
+#endif	/* MULTIPROCESSOR */



CVS commit: [matt-nb5-mips64] src/sys/arch/mips/rmi

2011-01-06 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Fri Jan  7 00:17:22 UTC 2011

Modified Files:
src/sys/arch/mips/rmi [matt-nb5-mips64]: rmixl_cpu.c

Log Message:
- ifdef out guts of cpu_xls616_erratum(); the problem is still unknown.
- cpu_rmixl_hatch() calls cpucore_rmixl_hatch()


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.15 -r1.1.2.16 src/sys/arch/mips/rmi/rmixl_cpu.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/mips/rmi/rmixl_cpu.c
diff -u src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.15 src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.16
--- src/sys/arch/mips/rmi/rmixl_cpu.c:1.1.2.15	Mon Sep 20 19:39:10 2010
+++ src/sys/arch/mips/rmi/rmixl_cpu.c	Fri Jan  7 00:17:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rmixl_cpu.c,v 1.1.2.15 2010/09/20 19:39:10 cliff Exp $	*/
+/*	$NetBSD: rmixl_cpu.c,v 1.1.2.16 2011/01/07 00:17:22 cliff Exp $	*/
 
 /*
  * Copyright 2002 Wasabi Systems, Inc.
@@ -38,7 +38,7 @@
 #include locators.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.1.2.15 2010/09/20 19:39:10 cliff Exp $);
+__KERNEL_RCSID(0, $NetBSD: rmixl_cpu.c,v 1.1.2.16 2011/01/07 00:17:22 cliff Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -106,6 +106,7 @@
 static inline bool
 cpu_xls616_erratum(device_t parent, struct cpucore_attach_args *ca)
 {
+#if 0
 	if (mips_options.mips_cpu-cpu_pid == MIPS_XLS616) {
 		if (ca-ca_thread  0) {
 			aprint_error_dev(parent, XLS616 CLOCK ERRATUM: 
@@ -113,6 +114,7 @@
 			return true;
 		}
 	}
+#endif
 	return false;
 }
 
@@ -263,6 +265,7 @@
 void
 cpu_rmixl_hatch(struct cpu_info *ci)
 {
+	struct rmixl_cpu_softc * const sc = (void *)ci-ci_softc;
 	extern void rmixl_spl_init_cpu(void);
 
 	rmixl_spl_init_cpu();	/* spl initialization for this CPU */
@@ -276,8 +279,7 @@
 	KASSERT(curcpu() == ci);
 #endif
 
-	if (RMIXL_CPU_THREAD(ci-ci_cpuid) == 0)
-		rmixl_fmn_init_core();
+	cpucore_rmixl_hatch(device_parent(sc-sc_dev));
 }
 
 static int



CVS commit: [matt-nb5-mips64] src/sys/arch/evbmips/rmixl

2011-01-06 Thread Cliff Neighbors
Module Name:src
Committed By:   cliff
Date:   Fri Jan  7 00:17:42 UTC 2011

Modified Files:
src/sys/arch/evbmips/rmixl [matt-nb5-mips64]: machdep.c

Log Message:
- add rmixl_pcr_init_core() to initialize per-core processor control regs


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.31 -r1.1.2.32 src/sys/arch/evbmips/rmixl/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/evbmips/rmixl/machdep.c
diff -u src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.31 src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.32
--- src/sys/arch/evbmips/rmixl/machdep.c:1.1.2.31	Fri Dec 17 04:49:24 2010
+++ src/sys/arch/evbmips/rmixl/machdep.c	Fri Jan  7 00:17:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.1.2.31 2010/12/17 04:49:24 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.1.2.32 2011/01/07 00:17:42 cliff Exp $	*/
 
 /*
  * Copyright 2001, 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.31 2010/12/17 04:49:24 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.1.2.32 2011/01/07 00:17:42 cliff Exp $);
 
 #define __INTR_PRIVATE
 
@@ -284,25 +284,9 @@
 	struct rmixl_config *rcp = rmixl_configuration;
 	void *kernend;
 	uint64_t memsize;
-	uint32_t r;
 	extern char edata[], end[];
 
-#ifdef MULTIPROCESSOR
-	r = rmixl_mfcr(0x400);
-	r |= __BIT(0);			/* enable global TLB mode */
-	rmixl_mtcr(0x400, r);		/* enable MMU clock gating */
-	/* preserve MMU Thread Mode */
-	/* TLB is not paritioned (global) */
-#else
-	rmixl_mtcr(0, 1);		/* disable all threads except #0 */
-	rmixl_mtcr(0x400, 0);		/* enable MMU clock gating */
-	/* set single MMU Thread Mode */
-	/* TLB is partitioned (1 partition) */
-#endif
-
-	r = rmixl_mfcr(0x300);
-	r = ~__BIT(14);		/* disabled Unaligned Access */
-	rmixl_mtcr(0x300, r);
+	rmixl_pcr_init_core();
 
 	/*
 	 * Clear the BSS segment.
@@ -481,6 +465,31 @@
 #endif
 }
 
+/*
+ * set up Processor Control Regs for this core
+ */
+void
+rmixl_pcr_init_core()
+{
+	uint32_t r;
+
+#ifdef MULTIPROCESSOR
+	rmixl_mtcr(RMIXL_PCR_MMU_SETUP, __BITS(2,0));
+		/* enable MMU clock gating */
+		/* 4 threads active -- why needed if Global? */
+		/* enable global TLB mode */
+#else
+	rmixl_mtcr(RMIXL_PCR_THREADEN, 1);	/* disable all threads except #0 */
+	rmixl_mtcr(RMIXL_PCR_MMU_SETUP, 0);	/* enable MMU clock gating */
+		/* set single MMU Thread Mode */
+		/* TLB is partitioned (1 partition) */
+#endif
+
+	r = rmixl_mfcr(RMIXL_PCR_L1D_CONFIG0);
+	r = ~__BIT(14);			/* disable Unaligned Access */
+	rmixl_mtcr(RMIXL_PCR_L1D_CONFIG0, r);
+}
+
 #ifdef MULTIPROCESSOR
 static bool
 rmixl_fixup_cop0_oscratch(int32_t load_addr, uint32_t new_insns[2])



CVS commit: [netbsd-5] src/sys/arch/vax

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:01:44 UTC 2011

Modified Files:
src/sys/arch/vax/include [netbsd-5]: clock.h
src/sys/arch/vax/vax [netbsd-5]: clock.c

Log Message:
Pull up following revision(s) (requested by uwe in ticket #1500):
sys/arch/vax/vax/clock.c: revision 1.54
sys/arch/vax/include/clock.h: revision 1.8
Correct definition of leap year.  Make yeartonum and numtoyear use
full years so that year 2000 is correctly counted as a leap year.
Now NetBSD under SIMH picks up correct time-of-day clock value.  It
used to be a day behind, since 2000 - 1900 = 100 and naive leap year
test wouldn't count it as a leap year.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.70.1 src/sys/arch/vax/include/clock.h
cvs rdiff -u -r1.49.20.1 -r1.49.20.2 src/sys/arch/vax/vax/clock.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/vax/include/clock.h
diff -u src/sys/arch/vax/include/clock.h:1.6 src/sys/arch/vax/include/clock.h:1.6.70.1
--- src/sys/arch/vax/include/clock.h:1.6	Tue Sep  5 19:32:57 2006
+++ src/sys/arch/vax/include/clock.h	Fri Jan  7 01:01:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.h,v 1.6 2006/09/05 19:32:57 matt Exp $ */
+/*	$NetBSD: clock.h,v 1.6.70.1 2011/01/07 01:01:44 riz Exp $ */
 /*
  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -37,7 +37,7 @@
 /*
  * Time constants. These are unlikely to change.
  */
-#define IS_LEAPYEAR(y) (((y % 4) == 0)  (y % 100))
+#define IS_LEAPYEAR(y) y % 4) == 0)  ((y % 100) != 0)) || ((y % 400) == 0))
 
 #define SEC_PER_MIN	(60)
 #define SEC_PER_HOUR	(SEC_PER_MIN * 60)

Index: src/sys/arch/vax/vax/clock.c
diff -u src/sys/arch/vax/vax/clock.c:1.49.20.1 src/sys/arch/vax/vax/clock.c:1.49.20.2
--- src/sys/arch/vax/vax/clock.c:1.49.20.1	Wed Sep 16 04:46:14 2009
+++ src/sys/arch/vax/vax/clock.c	Fri Jan  7 01:01:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.49.20.1 2009/09/16 04:46:14 snj Exp $	 */
+/*	$NetBSD: clock.c,v 1.49.20.2 2011/01/07 01:01:44 riz Exp $	 */
 /*
  * Copyright (c) 1995 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.49.20.1 2009/09/16 04:46:14 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.49.20.2 2011/01/07 01:01:44 riz Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -194,18 +194,18 @@
 {
 	int n;
 
-	for (n = 0, y -= 1; y  69; y--)
+	for (n = 0, y -= 1; y  1969; y--)
 		n += SECPERYEAR(y);
 	return n;
 }
 
 /* 
- * Converts tick number to a year 70 -
+ * Converts tick number to a year 1970 -
  */
 int
 numtoyear(int num)
 {
-	int y = 70, j;
+	int y = 1970, j;
 	while(num = (j = SECPERYEAR(y))) {
 		y++;
 		num -= j;



CVS commit: [netbsd-5] src/etc/rc.d

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:06:34 UTC 2011

Modified Files:
src/etc/rc.d [netbsd-5]: named

Log Message:
Pull up following revision(s) (requested by tron in ticket #1519):
etc/rc.d/named: revision 1.21
etc/rc.d/named: revision 1.19
Adjust for new default location of the pid file.
handle new directory structure.


To generate a diff of this commit:
cvs rdiff -u -r1.18.28.1 -r1.18.28.2 src/etc/rc.d/named

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

Modified files:

Index: src/etc/rc.d/named
diff -u src/etc/rc.d/named:1.18.28.1 src/etc/rc.d/named:1.18.28.2
--- src/etc/rc.d/named:1.18.28.1	Sun Nov 15 06:05:52 2009
+++ src/etc/rc.d/named	Fri Jan  7 01:06:34 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: named,v 1.18.28.1 2009/11/15 06:05:52 snj Exp $
+# $NetBSD: named,v 1.18.28.2 2011/01/07 01:06:34 riz Exp $
 #
 
 # PROVIDE: named
@@ -13,7 +13,7 @@
 name=named
 rcvar=$name
 command=/usr/sbin/${name}
-pidfile=/var/run/${name}.pid
+pidfile=/var/run/${name}/${name}.pid
 start_precmd=named_precmd
 extra_commands=reload
 required_dirs=$named_chrootdir	# if it is set, it must exist
@@ -114,7 +114,12 @@
 		cmp -s /etc/localtime ${named_chrootdir}/etc/localtime || \
 		cp -p /etc/localtime ${named_chrootdir}/etc/localtime
 	fi
-	ln -fs ${named_chrootdir}${pidfile} ${pidfile}
+
+	local piddir=$(dirname ${pidfile})
+	mkdir -p ${named_chrootdir}${piddir} ${piddir}
+	chmod 755 ${named_chrootdir}${piddir} ${piddir}
+	chown named:named ${named_chrootdir}${piddir} ${piddir}
+	ln -fs ${named_chrootdir}${pidfile} ${pidfile}
 
 	#	Change run_rc_commands()'s internal copy of $named_flags
 	#



CVS commit: src/tests

2011-01-06 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Jan  7 01:07:31 UTC 2011

Modified Files:
src/tests: Makefile

Log Message:
Avoid double-inclusion of bsd.own.mk file.  This eliminates some harmless
but annoying warning messages.


To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/tests/Makefile

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

Modified files:

Index: src/tests/Makefile
diff -u src/tests/Makefile:1.27 src/tests/Makefile:1.28
--- src/tests/Makefile:1.27	Sun Jan  2 13:18:37 2011
+++ src/tests/Makefile	Fri Jan  7 01:07:31 2011
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.27 2011/01/02 13:18:37 pooka Exp $
+# $NetBSD: Makefile,v 1.28 2011/01/07 01:07:31 pgoyette Exp $
 
 .include bsd.own.mk
 
@@ -15,6 +15,8 @@
 . endif
 
 .include bsd.test.mk
-.endif
+
+.else
 
 .include bsd.subdir.mk
+.endif



CVS commit: [netbsd-5] src/doc

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:10:48 UTC 2011

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

Log Message:
Tickets 1500, 1519.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.40 -r1.1.2.41 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.40 src/doc/CHANGES-5.2:1.1.2.41
--- src/doc/CHANGES-5.2:1.1.2.40	Thu Jan  6 22:02:53 2011
+++ src/doc/CHANGES-5.2	Fri Jan  7 01:10:48 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.40 2011/01/06 22:02:53 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.41 2011/01/07 01:10:48 riz Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -3334,3 +3334,16 @@
 	Update bind to 9.7.2-P3.
 	[spz, ticket #1517]
 
+sys/arch/vax/include/clock.h			1.8
+sys/arch/vax/vax/clock.c			1.54
+
+	Correct definition of leap year.  Make yeartonum and numtoyear use
+	full years so that year 2000 is correctly counted as a leap year.
+	Now NetBSD under SIMH picks up correct time-of-day clock value.
+	[uwe, ticket #1500]
+
+etc/rc.d/named	1.19, 1.21
+
+	Adjust named startup for new BIND version.
+	[tron, ticket #1519]
+



CVS commit: src/doc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:11:03 UTC 2011

Modified Files:
src/doc: BRANCHES

Log Message:
Note matt-nb5-pq3 branch


To generate a diff of this commit:
cvs rdiff -u -r1.301 -r1.302 src/doc/BRANCHES

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

Modified files:

Index: src/doc/BRANCHES
diff -u src/doc/BRANCHES:1.301 src/doc/BRANCHES:1.302
--- src/doc/BRANCHES:1.301	Thu Dec 16 02:01:37 2010
+++ src/doc/BRANCHES	Fri Jan  7 01:11:03 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: BRANCHES,v 1.301 2010/12/16 02:01:37 uebayasi Exp $
+#	$NetBSD: BRANCHES,v 1.302 2011/01/07 01:11:03 matt Exp $
 #
 # This file contains a list of branches that exist in the NetBSD CVS
 # tree and their current state.
@@ -414,6 +414,16 @@
 Scope:		kernel  userland
 Notes:		
 
+Branch:		matt-nb5-pq3
+Description:	Rototill the powerpc code to support mpc85xx
+Status:		Active
+Start Date:	2010-12-20
+End Date:
+Base Tag:	matt-nb5-pq3-base
+Maintainer:	Matt Thomas m...@netbsd.org
+Scope:		kernel  userland
+Notes:		
+
 Branch:		mjf-devfs2
 Description:	device file system supporting dynamic device nodes
 Status:		Active



CVS commit: [matt-nb5-pq3] src/sys

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:11:13 UTC 2011

Modified Files:
src/sys/kern [matt-nb5-pq3]: kern_clock.c
src/sys/sys [matt-nb5-pq3]: cpu_data.h

Log Message:
Accumulate syscall, context switch, and other uvmexp counts in cpu_data
and merge into uvmexp.  (smaller less impact change than the one for HEAD).


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.126.20.1 src/sys/kern/kern_clock.c
cvs rdiff -u -r1.27 -r1.27.20.1 src/sys/sys/cpu_data.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_clock.c
diff -u src/sys/kern/kern_clock.c:1.126 src/sys/kern/kern_clock.c:1.126.20.1
--- src/sys/kern/kern_clock.c:1.126	Sun Oct  5 21:57:20 2008
+++ src/sys/kern/kern_clock.c	Fri Jan  7 01:11:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_clock.c,v 1.126 2008/10/05 21:57:20 pooka Exp $	*/
+/*	$NetBSD: kern_clock.c,v 1.126.20.1 2011/01/07 01:11:13 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -69,7 +69,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_clock.c,v 1.126 2008/10/05 21:57:20 pooka Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_clock.c,v 1.126.20.1 2011/01/07 01:11:13 matt Exp $);
 
 #include opt_ntp.h
 #include opt_perfctrs.h
@@ -321,13 +321,23 @@
 
 	ci = l-l_cpu;
 
-	/* Accumulate syscall and context switch counts. */
+	/*
+	 * Accumulate syscall, context switch, and other uvmexp counts.  There
+	 * is a small window where we could loose an counter increment but 
+	 * the overhead just isn't worth it to have perfect statistics.
+	 */
 	atomic_add_int((unsigned *)uvmexp.swtch, ci-ci_data.cpu_nswtch);
 	ci-ci_data.cpu_nswtch = 0;
 	atomic_add_int((unsigned *)uvmexp.syscalls, ci-ci_data.cpu_nsyscall);
 	ci-ci_data.cpu_nsyscall = 0;
 	atomic_add_int((unsigned *)uvmexp.traps, ci-ci_data.cpu_ntrap);
 	ci-ci_data.cpu_ntrap = 0;
+	atomic_add_int((unsigned *)uvmexp.intrs, ci-ci_data.cpu_nintr);
+	ci-ci_data.cpu_nintr = 0;
+	atomic_add_int((unsigned *)uvmexp.softs, ci-ci_data.cpu_nsoft);
+	ci-ci_data.cpu_nsoft = 0;
+	atomic_add_int((unsigned *)uvmexp.faults, ci-ci_data.cpu_nfault);
+	ci-ci_data.cpu_nfault = 0;
 
 	if ((l-l_flag  LW_IDLE) != 0)
 		return;

Index: src/sys/sys/cpu_data.h
diff -u src/sys/sys/cpu_data.h:1.27 src/sys/sys/cpu_data.h:1.27.20.1
--- src/sys/sys/cpu_data.h:1.27	Tue Jun  3 15:50:22 2008
+++ src/sys/sys/cpu_data.h	Fri Jan  7 01:11:13 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_data.h,v 1.27 2008/06/03 15:50:22 ad Exp $	*/
+/*	$NetBSD: cpu_data.h,v 1.27.20.1 2011/01/07 01:11:13 matt Exp $	*/
 
 /*-
  * Copyright (c) 2004, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -86,6 +86,9 @@
 	u_int		cpu_nsyscall;		/* syscall counter */
 	u_int		cpu_ntrap;		/* trap counter */
 	u_int		cpu_nswtch;		/* context switch counter */
+	u_int		cpu_nintr;		/* interrupt count */
+	u_int		cpu_nsoft;		/* soft interrupt count */
+	u_int		cpu_nfault;		/* pagefault counter */
 	void		*cpu_uvm;		/* uvm per-cpu data */
 	void		*cpu_softcpu;		/* soft interrupt table */
 	TAILQ_HEAD(,buf) cpu_biodone;		/* finished block xfers */



CVS commit: [matt-nb5-pq3] src/sys

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:13:05 UTC 2011

Modified Files:
src/sys/kern [matt-nb5-pq3]: subr_evcnt.c
src/sys/sys [matt-nb5-pq3]: evcnt.h

Log Message:
Add evcnt_attach_dynamic_nozero which doesn't zero it's contents.  This is
needed if the evcnt starts counting before it's attached (otherwise the
count would be zeroed and those events lost).


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.98.1 src/sys/kern/subr_evcnt.c
cvs rdiff -u -r1.5 -r1.5.32.1 src/sys/sys/evcnt.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/subr_evcnt.c
diff -u src/sys/kern/subr_evcnt.c:1.4 src/sys/kern/subr_evcnt.c:1.4.98.1
--- src/sys/kern/subr_evcnt.c:1.4	Sun Dec 11 12:24:30 2005
+++ src/sys/kern/subr_evcnt.c	Fri Jan  7 01:13:04 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_evcnt.c,v 1.4 2005/12/11 12:24:30 christos Exp $ */
+/* $NetBSD: subr_evcnt.c,v 1.4.98.1 2011/01/07 01:13:04 matt Exp $ */
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: subr_evcnt.c,v 1.4 2005/12/11 12:24:30 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: subr_evcnt.c,v 1.4.98.1 2011/01/07 01:13:04 matt Exp $);
 
 #include opt_ddb.h
 
@@ -143,17 +143,28 @@
  * and string pointers and then act like it was statically initialized.
  */
 void
-evcnt_attach_dynamic(struct evcnt *ev, int type, const struct evcnt *parent,
-const char *group, const char *name)
+evcnt_attach_dynamic_nozero(struct evcnt *ev, int type,
+const struct evcnt *parent, const char *group, const char *name)
 {
 
-	memset(ev, 0, sizeof *ev);
 	ev-ev_type = type;
 	ev-ev_parent = parent;
 	ev-ev_group = group;
 	ev-ev_name = name;
 	evcnt_attach_static(ev);
 }
+/*
+ * Attach a dynamically-initialized event.  Zero it, set up the type
+ * and string pointers and then act like it was statically initialized.
+ */
+void
+evcnt_attach_dynamic(struct evcnt *ev, int type, const struct evcnt *parent,
+const char *group, const char *name)
+{
+
+	memset(ev, 0, sizeof *ev);
+	evcnt_attach_dynamic_nozero(ev, type, parent, group, name);
+}
 
 /*
  * Detach an event.

Index: src/sys/sys/evcnt.h
diff -u src/sys/sys/evcnt.h:1.5 src/sys/sys/evcnt.h:1.5.32.1
--- src/sys/sys/evcnt.h:1.5	Sun Dec 16 20:45:59 2007
+++ src/sys/sys/evcnt.h	Fri Jan  7 01:13:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: evcnt.h,v 1.5 2007/12/16 20:45:59 dyoung Exp $	*/
+/*	$NetBSD: evcnt.h,v 1.5.32.1 2011/01/07 01:13:04 matt Exp $	*/
 
 /*
  * Copyright (c) 1996, 2000 Christopher G. Demetriou
@@ -129,6 +129,8 @@
 
 void	evcnt_init(void);
 void	evcnt_attach_static(struct evcnt *);
+void	evcnt_attach_dynamic_nozero(struct evcnt *, int, const struct evcnt *,
+	const char *, const char *);
 void	evcnt_attach_dynamic(struct evcnt *, int, const struct evcnt *,
 	const char *, const char *);
 void	evcnt_detach(struct evcnt *);



CVS commit: [matt-nb5-pq3] src/sys/sys

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:13:42 UTC 2011

Modified Files:
src/sys/sys [matt-nb5-pq3]: systm.h

Log Message:
Add critpollhooks.


To generate a diff of this commit:
cvs rdiff -u -r1.228.4.2 -r1.228.4.2.8.1 src/sys/sys/systm.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/systm.h
diff -u src/sys/sys/systm.h:1.228.4.2 src/sys/sys/systm.h:1.228.4.2.8.1
--- src/sys/sys/systm.h:1.228.4.2	Sun Mar 15 19:43:48 2009
+++ src/sys/sys/systm.h	Fri Jan  7 01:13:41 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: systm.h,v 1.228.4.2 2009/03/15 19:43:48 snj Exp $	*/
+/*	$NetBSD: systm.h,v 1.228.4.2.8.1 2011/01/07 01:13:41 matt Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1988, 1991, 1993
@@ -305,6 +305,14 @@
 void	setstatclockrate(int);
 
 /*
+ * Critical polling hooks.  Functions to be run while the kernel stays
+ * elevated IPL for a long time.  (watchdogs).
+ */
+void	*critpollhook_establish(void (*)(void *), void *);
+void	critpollhook_disestablish(void *);
+void	docritpollhooks(void);
+
+/*
  * Shutdown hooks.  Functions to be run with all interrupts disabled
  * immediately before the system is halted or rebooted.
  */



CVS commit: [matt-nb5-pq3] src/sys/lib/libkern

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:14:25 UTC 2011

Modified Files:
src/sys/lib/libkern [matt-nb5-pq3]: libkern.h

Log Message:
Fix KASSERTMSG.


To generate a diff of this commit:
cvs rdiff -u -r1.82.4.2 -r1.82.4.2.4.1 src/sys/lib/libkern/libkern.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/lib/libkern/libkern.h
diff -u src/sys/lib/libkern/libkern.h:1.82.4.2 src/sys/lib/libkern/libkern.h:1.82.4.2.4.1
--- src/sys/lib/libkern/libkern.h:1.82.4.2	Sun May  3 17:31:42 2009
+++ src/sys/lib/libkern/libkern.h	Fri Jan  7 01:14:24 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: libkern.h,v 1.82.4.2 2009/05/03 17:31:42 snj Exp $	*/
+/*	$NetBSD: libkern.h,v 1.82.4.2.4.1 2011/01/07 01:14:24 matt Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -208,7 +208,7 @@
 #else /* DIAGNOSTIC */
 #define _DIAGASSERT(a)	assert(a)
 #define	KASSERTMSG(e, msg) do {		\
-	if (__predict_false((e)))	\
+	if (__predict_false(!(e)))	\
 		panic msg;		\
 	} while (/*CONSTCOND*/ 0)
 #ifdef __STDC__



CVS commit: [matt-nb5-pq3] src/sys/uvm

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:16:44 UTC 2011

Modified Files:
src/sys/uvm [matt-nb5-pq3]: uvm_page.c

Log Message:
Improve panic message for non-power of 2 page size.


To generate a diff of this commit:
cvs rdiff -u -r1.140.6.3 -r1.140.6.3.8.1 src/sys/uvm/uvm_page.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/uvm/uvm_page.c
diff -u src/sys/uvm/uvm_page.c:1.140.6.3 src/sys/uvm/uvm_page.c:1.140.6.3.8.1
--- src/sys/uvm/uvm_page.c:1.140.6.3	Mon Mar  2 20:51:35 2009
+++ src/sys/uvm/uvm_page.c	Fri Jan  7 01:16:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_page.c,v 1.140.6.3 2009/03/02 20:51:35 snj Exp $	*/
+/*	$NetBSD: uvm_page.c,v 1.140.6.3.8.1 2011/01/07 01:16:44 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3 2009/03/02 20:51:35 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: uvm_page.c,v 1.140.6.3.8.1 2011/01/07 01:16:44 matt Exp $);
 
 #include opt_uvmhist.h
 #include opt_readahead.h
@@ -503,7 +503,8 @@
 	}
 	uvmexp.pagemask = uvmexp.pagesize - 1;
 	if ((uvmexp.pagemask  uvmexp.pagesize) != 0)
-		panic(uvm_setpagesize: page size not a power of two);
+		panic(uvm_setpagesize: page size %u (%#x) not a power of two,
+		uvmexp.pagesize, uvmexp.pagesize);
 	for (uvmexp.pageshift = 0; ; uvmexp.pageshift++)
 		if ((1  uvmexp.pageshift) == uvmexp.pagesize)
 			break;



CVS commit: [matt-nb5-pq3] src/sys/dev/i2c

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:19:16 UTC 2011

Modified Files:
src/sys/dev/i2c [matt-nb5-pq3]: files.i2c
Added Files:
src/sys/dev/i2c [matt-nb5-pq3]: motoi2c.c motoi2creg.h motoi2cvar.h

Log Message:
Add revamped support for motorola/freescale embedded i2c SoC controllers.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.23.14.1 src/sys/dev/i2c/files.i2c
cvs rdiff -u -r0 -r1.2.2.2 src/sys/dev/i2c/motoi2c.c \
src/sys/dev/i2c/motoi2creg.h src/sys/dev/i2c/motoi2cvar.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/i2c/files.i2c
diff -u src/sys/dev/i2c/files.i2c:1.23 src/sys/dev/i2c/files.i2c:1.23.14.1
--- src/sys/dev/i2c/files.i2c:1.23	Thu Oct 30 12:52:46 2008
+++ src/sys/dev/i2c/files.i2c	Fri Jan  7 01:19:15 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.i2c,v 1.23 2008/10/30 12:52:46 nakayama Exp $
+#	$NetBSD: files.i2c,v 1.23.14.1 2011/01/07 01:19:15 matt Exp $
 
 defflag	opt_i2cbus.hI2C_SCAN
 define	i2cbus { }
@@ -14,6 +14,12 @@
 file	dev/i2c/i2c_bitbang.c			i2c_bitbang
 
 #
+# I2C master devices
+#
+define	motoi2c
+file	dev/i2c/motoi2c.c			motoi2c
+
+#
 # I2C client devices
 #
 

Added files:

Index: src/sys/dev/i2c/motoi2c.c
diff -u /dev/null src/sys/dev/i2c/motoi2c.c:1.2.2.2
--- /dev/null	Fri Jan  7 01:19:16 2011
+++ src/sys/dev/i2c/motoi2c.c	Fri Jan  7 01:19:15 2011
@@ -0,0 +1,366 @@
+/* $NetBSD: motoi2c.c,v 1.2.2.2 2011/01/07 01:19:15 matt Exp $ */
+
+/*-
+ * Copyright (c) 2007, 2010 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Matt Thomas.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: motoi2c.c,v 1.2.2.2 2011/01/07 01:19:15 matt Exp $);
+
+#include sys/param.h
+#include sys/device.h
+#include sys/systm.h
+#include sys/mutex.h
+#include sys/bus.h
+#include sys/intr.h
+
+#include dev/i2c/i2cvar.h
+#include dev/i2c/motoi2creg.h
+#include dev/i2c/motoi2cvar.h
+
+#ifdef DEBUG
+static int motoi2c_debug = 0;
+#define	DPRINTF		if (motoi2c_debug) printf
+#else
+#define	DPRINTF		(void)
+#endif
+
+static int  motoi2c_acquire_bus(void *, int);
+static void motoi2c_release_bus(void *, int);
+static int  motoi2c_exec(void *, i2c_op_t, i2c_addr_t, const void *, size_t,
+		void *, size_t, int);
+static int  motoi2c_busy_wait(struct motoi2c_softc *, uint8_t);
+
+static const struct i2c_controller motoi2c = {
+	.ic_acquire_bus = motoi2c_acquire_bus,
+	.ic_release_bus = motoi2c_release_bus,
+	.ic_exec	= motoi2c_exec,
+};
+
+static const struct motoi2c_settings motoi2c_default_settings = {
+	.i2c_adr	= MOTOI2C_ADR_DEFAULT,
+	.i2c_fdr	= MOTOI2C_FDR_DEFAULT,
+	.i2c_dfsrr	= MOTOI2C_DFSRR_DEFAULT,
+};
+
+#define	I2C_READ(r)	((*sc-sc_iord)(sc, (r)))
+#define	I2C_WRITE(r,v)	((*sc-sc_iowr)(sc, (r), (v)))
+#define I2C_SETCLR(r, s, c) \
+	((*sc-sc_iowr)(sc, (r), ((*sc-sc_iord)(sc, (r)) | (s))  ~(c)))
+
+static uint8_t
+motoi2c_iord1(struct motoi2c_softc *sc, bus_size_t off)
+{
+	return bus_space_read_1(sc-sc_iot, sc-sc_ioh, off);
+}
+
+static void
+motoi2c_iowr1(struct motoi2c_softc *sc, bus_size_t off, uint8_t data)
+{
+	bus_space_write_1(sc-sc_iot, sc-sc_ioh, off, data);
+}
+
+void
+motoi2c_attach_common(device_t self, struct motoi2c_softc *sc,
+	const struct motoi2c_settings *i2c)
+{
+	struct i2cbus_attach_args iba;
+
+	mutex_init(sc-sc_buslock, MUTEX_DEFAULT, IPL_NONE);
+
+	if (i2c == NULL)
+		i2c = motoi2c_default_settings;
+
+	sc-sc_i2c = motoi2c;
+	sc-sc_i2c.ic_cookie = sc;
+	sc-sc_start = false;
+	if (sc-sc_iord == NULL)
+		sc-sc_iord = 

CVS commit: [matt-nb5-pq3] src/sys/arch

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:31:48 UTC 2011

Modified Files:
src/sys/arch/ibmnws/include [matt-nb5-pq3]: pci_machdep.h
src/sys/arch/ibmnws/pci [matt-nb5-pq3]: pci_machdep.c
src/sys/arch/powerpc/include [matt-nb5-pq3]: pci_machdep.h
src/sys/arch/powerpc/pci [matt-nb5-pq3]: pci_machdep_common.c
src/sys/arch/prep/include [matt-nb5-pq3]: pci_machdep.h
src/sys/arch/prep/pci [matt-nb5-pq3]: pci_machdep.c

Log Message:
Change bus_maxdevs to be passed pc-pc_conf_v instead pc (e.g. like the
rest of the conf calls).


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.22.1 src/sys/arch/ibmnws/include/pci_machdep.h
cvs rdiff -u -r1.5 -r1.5.22.1 src/sys/arch/ibmnws/pci/pci_machdep.c
cvs rdiff -u -r1.8 -r1.8.26.1 src/sys/arch/powerpc/include/pci_machdep.h
cvs rdiff -u -r1.8 -r1.8.26.1 src/sys/arch/powerpc/pci/pci_machdep_common.c
cvs rdiff -u -r1.15 -r1.15.26.1 src/sys/arch/prep/include/pci_machdep.h
cvs rdiff -u -r1.32 -r1.32.46.1 src/sys/arch/prep/pci/pci_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/ibmnws/include/pci_machdep.h
diff -u src/sys/arch/ibmnws/include/pci_machdep.h:1.6 src/sys/arch/ibmnws/include/pci_machdep.h:1.6.22.1
--- src/sys/arch/ibmnws/include/pci_machdep.h:1.6	Sat Jun 14 12:01:28 2008
+++ src/sys/arch/ibmnws/include/pci_machdep.h	Fri Jan  7 01:31:47 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.6 2008/06/14 12:01:28 mjf Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.6.22.1 2011/01/07 01:31:47 matt Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -36,7 +36,7 @@
  * ibmnws-specific PCI functions.
  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
  */
-int ibmnws_pci_bus_maxdevs(pci_chipset_tag_t, int);
+int ibmnws_pci_bus_maxdevs(void *, int);
 int ibmnws_pci_intr_map(struct pci_attach_args *, pci_intr_handle_t *);
 int ibmnws_pci_conf_hook(pci_chipset_tag_t, int, int, int, pcireg_t);
 

Index: src/sys/arch/ibmnws/pci/pci_machdep.c
diff -u src/sys/arch/ibmnws/pci/pci_machdep.c:1.5 src/sys/arch/ibmnws/pci/pci_machdep.c:1.5.22.1
--- src/sys/arch/ibmnws/pci/pci_machdep.c:1.5	Sat Jun 14 12:05:39 2008
+++ src/sys/arch/ibmnws/pci/pci_machdep.c	Fri Jan  7 01:31:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_machdep.c,v 1.5 2008/06/14 12:05:39 mjf Exp $	*/
+/*	$NetBSD: pci_machdep.c,v 1.5.22.1 2011/01/07 01:31:47 matt Exp $	*/
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
@@ -92,7 +92,7 @@
 }
 
 int
-ibmnws_pci_bus_maxdevs(pci_chipset_tag_t pct, int busno)
+ibmnws_pci_bus_maxdevs(void *v, int busno)
 {
 
 	/*

Index: src/sys/arch/powerpc/include/pci_machdep.h
diff -u src/sys/arch/powerpc/include/pci_machdep.h:1.8 src/sys/arch/powerpc/include/pci_machdep.h:1.8.26.1
--- src/sys/arch/powerpc/include/pci_machdep.h:1.8	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/pci_machdep.h	Fri Jan  7 01:31:47 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_machdep.h,v 1.8 2008/04/28 20:23:32 martin Exp $ */
+/* $NetBSD: pci_machdep.h,v 1.8.26.1 2011/01/07 01:31:47 matt Exp $ */
 
 /*-
  * Copyright (c) 2002,2007 The NetBSD Foundation, Inc.
@@ -66,9 +66,9 @@
  */
 struct genppc_pci_chipset {
 	void		*pc_conf_v;
-	void		(*pc_attach_hook)(struct device *,
-			struct device *, struct pcibus_attach_args *);
-	int		(*pc_bus_maxdevs)(pci_chipset_tag_t, int);
+	void		(*pc_attach_hook)(device_t, device_t,
+			struct pcibus_attach_args *);
+	int		(*pc_bus_maxdevs)(void *, int);
 	pcitag_t	(*pc_make_tag)(void *, int, int, int);
 	pcireg_t	(*pc_conf_read)(void *, pcitag_t, int);
 	void		(*pc_conf_write)(void *, pcitag_t, int, pcireg_t);
@@ -135,7 +135,7 @@
  * Generic PowerPC PCI functions.  Override if necc.
  */
 
-int genppc_pci_bus_maxdevs(pci_chipset_tag_t, int);
+int genppc_pci_bus_maxdevs(void *, int);
 const char *genppc_pci_intr_string(void *, pci_intr_handle_t);
 const struct evcnt *genppc_pci_intr_evcnt(void *, pci_intr_handle_t);
 void *genppc_pci_intr_establish(void *, pci_intr_handle_t, int, int (*)(void *),
@@ -146,7 +146,7 @@
 int genppc_pci_intr_map(struct pci_attach_args *pa, pci_intr_handle_t *ihp);
 
 /* generic indirect PCI functions */
-void genppc_pci_indirect_attach_hook(struct device *, struct device *,
+void genppc_pci_indirect_attach_hook(device_t, device_t,
 struct pcibus_attach_args *);
 pcitag_t genppc_pci_indirect_make_tag(void *, int, int, int);
 pcireg_t genppc_pci_indirect_conf_read(void *, pcitag_t, int);
@@ -154,7 +154,7 @@
 void genppc_pci_indirect_decompose_tag(void *, pcitag_t, int *, int *, int *);
 
 /* generic OFW method PCI functions */
-void genppc_pci_ofmethod_attach_hook(struct device *, struct device *,
+void genppc_pci_ofmethod_attach_hook(device_t, device_t,
 struct pcibus_attach_args *);
 pcitag_t genppc_pci_ofmethod_make_tag(void *, int, int, int);
 pcireg_t genppc_pci_ofmethod_conf_read(void *, pcitag_t, 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:34:24 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: spr.h
Added Files:
src/sys/arch/powerpc/include/ibm4xx [matt-nb5-pq3]: spr.h
src/sys/arch/powerpc/include/oea [matt-nb5-pq3]: spr.h

Log Message:
Split spr.h into generic PPC powerpc/spr.h and chip-specific
powerpc/XXX/spr.h (XXX=oea, ibm4xx, booke)


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.44.28.1 src/sys/arch/powerpc/include/spr.h
cvs rdiff -u -r0 -r1.2.4.2 src/sys/arch/powerpc/include/ibm4xx/spr.h
cvs rdiff -u -r0 -r1.1.8.2 src/sys/arch/powerpc/include/oea/spr.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/powerpc/include/spr.h
diff -u src/sys/arch/powerpc/include/spr.h:1.44 src/sys/arch/powerpc/include/spr.h:1.44.28.1
--- src/sys/arch/powerpc/include/spr.h:1.44	Sat Feb 23 19:54:54 2008
+++ src/sys/arch/powerpc/include/spr.h	Fri Jan  7 01:34:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: spr.h,v 1.44 2008/02/23 19:54:54 matt Exp $	*/
+/*	$NetBSD: spr.h,v 1.44.28.1 2011/01/07 01:34:23 matt Exp $	*/
 
 #ifndef _POWERPC_SPR_H_
 #define	_POWERPC_SPR_H_
@@ -17,524 +17,31 @@
 /*
  * Special Purpose Register declarations.
  *
- * The first column in the comments indicates which PowerPC
- * architectures the SPR is valid on - 4 for 4xx series,
- * 6 for 6xx/7xx series and 8 for 8xx and 8xxx series.
+ * The first column in the comments indicates which PowerPC architectures the
+ * SPR is valid on - E for BookE series, 4 for 4xx series,
+ * 6 for 6xx/7xx series and 8 for 8xx and 8xxx (but not 85xx) series.
  */
 
-#define	SPR_MQ			0x000	/* .6. 601 MQ register */
-#define	SPR_XER			0x001	/* 468 Fixed Point Exception Register */
-#define	SPR_RTCU_R		0x004	/* .6. 601 RTC Upper - Read */
-#define	SPR_RTCL_R		0x005	/* .6. 601 RTC Lower - Read */
-#define	SPR_LR			0x008	/* 468 Link Register */
-#define	SPR_CTR			0x009	/* 468 Count Register */
-#define	SPR_DSISR		0x012	/* .68 DSI exception source */
-#define	  DSISR_DIRECT		  0x8000 /* Direct-store error exception */
-#define	  DSISR_NOTFOUND	  0x4000 /* Translation not found */
-#define	  DSISR_PROTECT		  0x0800 /* Memory access not permitted */
-#define	  DSISR_INVRX		  0x0400 /* Reserve-indexed insn direct-store access */
-#define	  DSISR_STORE		  0x0200 /* Store operation */
-#define	  DSISR_DABR		  0x0040 /* DABR match */
-#define	  DSISR_SEGMENT		  0x0020 /* XXX; not in 6xx PEM */
-#define	  DSISR_EAR		  0x0010 /* eciwx/ecowx  EAR[E] == 0 */
-#define	SPR_DAR			0x013	/* .68 Data Address Register */
-#define	SPR_RTCU_W		0x014	/* .6. 601 RTC Upper - Write */
-#define	SPR_RTCL_W		0x015	/* .6. 601 RTC Lower - Write */
-#define	SPR_DEC			0x016	/* .68 DECrementer register */
-#define	SPR_SDR1		0x019	/* .68 Page table base address register */
-#define	SPR_SRR0		0x01a	/* 468 Save/Restore Register 0 */
-#define	SPR_SRR1		0x01b	/* 468 Save/Restore Register 1 */
-#define	SPR_44XPID		0x030	/* 4.. 440 Process ID */
-#define SPR_EIE			0x050	/* ..8 Exception Interrupt ??? */
-#define SPR_EID			0x051	/* ..8 Exception Interrupt ??? */
-#define SPR_NRI			0x052	/* ..8 Exception Interrupt ??? */
-#define	SPR_USPRG0		0x100	/* 4.. User SPR General 0 */
-#define	SPR_VRSAVE		0x100	/* .6. AltiVec VRSAVE */
-#define	SPR_SPRG0		0x110	/* 468 SPR General 0 */
-#define	SPR_SPRG1		0x111	/* 468 SPR General 1 */
-#define	SPR_SPRG2		0x112	/* 468 SPR General 2 */
-#define	SPR_SPRG3		0x113	/* 468 SPR General 3 */
-#define	SPR_SPRG4		0x114	/* 4.. SPR General 4 */
-#define	SPR_SPRG5		0x115	/* 4.. SPR General 5 */
-#define	SPR_SPRG6		0x116	/* 4.. SPR General 6 */
-#define	SPR_SPRG7		0x117	/* 4.. SPR General 7 */
-#define	SPR_ASR			0x118	/* ... Address Space Register (PPC64) */
-#define	SPR_EAR			0x11a	/* .68 External Access Register */
-#define	SPR_TBL			0x11c	/* 468 Time Base Lower */
-#define	SPR_TBU			0x11d	/* 468 Time Base Upper */
-#define	SPR_PVR			0x11f	/* 468 Processor Version Register */
-#define	  MPC601		  0x0001
-#define	  MPC603		  0x0003
-#define	  MPC604		  0x0004
-#define	  MPC602		  0x0005
-#define	  MPC603e		  0x0006
-#define	  MPC603ev		  0x0007
-#define	  MPC750		  0x0008
-#define	  MPC604e		  0x0009
-#define	  MPC604ev		  0x000a
-#define	  MPC7400		  0x000c
-#define	  MPC620		  0x0014
-#define	  IBM403		  0x0020
-#define	  IBM401A1		  0x0021
-#define	  IBM401B2		  0x0022
-#define	  IBM401C2		  0x0023
-#define	  IBM401D2		  0x0024
-#define	  IBM401E2		  0x0025
-#define	  IBM401F2		  0x0026
-#define	  IBM401G2		  0x0027
-#define   IBMRS64II		  0x0033
-#define   IBMRS64IIIp		  0x0034
-#define   IBMPOWER4		  0x0035
-#define   IBMRS64IIIi		  0x0036
-#define   IBMRS64IV		  0x0037
-#define   IBMPOWER4II		  0x0038
-#define   IBM970		  0x0039
-#define   IBMPOWER5GR		  0x003a
-#define   IBMPOWER5GS		  0x003b
-#define   IBM970FX		  0x003c
-#define   IBMPOWER6		  0x003e
-#define   

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

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:35:05 UTC 2011

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

Log Message:
Pull up following revision(s) (requested by pooka in ticket #1502):
sys/dev/rnd.c: revision 1.79
Don't allow goes to 11^H^Hhyperspace len field for RNDADDATA.


To generate a diff of this commit:
cvs rdiff -u -r1.71.4.2 -r1.71.4.3 src/sys/dev/rnd.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/rnd.c
diff -u src/sys/dev/rnd.c:1.71.4.2 src/sys/dev/rnd.c:1.71.4.3
--- src/sys/dev/rnd.c:1.71.4.2	Sun Nov 15 05:46:23 2009
+++ src/sys/dev/rnd.c	Fri Jan  7 01:35:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rnd.c,v 1.71.4.2 2009/11/15 05:46:23 snj Exp $	*/
+/*	$NetBSD: rnd.c,v 1.71.4.3 2011/01/07 01:35:05 riz Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rnd.c,v 1.71.4.2 2009/11/15 05:46:23 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: rnd.c,v 1.71.4.3 2011/01/07 01:35:05 riz Exp $);
 
 #include sys/param.h
 #include sys/ioctl.h
@@ -636,6 +636,9 @@
 	case RNDADDDATA:
 		rnddata = (rnddata_t *)addr;
 
+		if (rnddata-len  sizeof(rnddata-data))
+			return E2BIG;
+
 		mutex_enter(rndpool_mtx);
 		rndpool_add_data(rnd_pool, rnddata-data, rnddata-len,
 		rnddata-entropy);



CVS commit: [matt-nb5-pq3] src/sys/arch

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:36:12 UTC 2011

Modified Files:
src/sys/arch/amigappc/amigappc [matt-nb5-pq3]: locore.S
src/sys/arch/ibmnws/ibmnws [matt-nb5-pq3]: locore.S
src/sys/arch/macppc/dev [matt-nb5-pq3]: if_bm.c
src/sys/arch/macppc/macppc [matt-nb5-pq3]: cpu.c locore.S
src/sys/arch/ofppc/conf [matt-nb5-pq3]: GENERIC
src/sys/arch/ofppc/ofppc [matt-nb5-pq3]: cpu.c locore.S machdep.c
src/sys/arch/prep/prep [matt-nb5-pq3]: locore.S
src/sys/arch/prep/stand/boot [matt-nb5-pq3]: boot.c clock.c
src/sys/arch/rs6000/rs6000 [matt-nb5-pq3]: locore.S
src/sys/arch/rs6000/stand/boot [matt-nb5-pq3]: boot.c clock.c

Log Message:
Deal with split spr.h (and a few other misc fixes).


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.32.1 src/sys/arch/amigappc/amigappc/locore.S
cvs rdiff -u -r1.5 -r1.5.32.1 src/sys/arch/ibmnws/ibmnws/locore.S
cvs rdiff -u -r1.37 -r1.37.12.1 src/sys/arch/macppc/dev/if_bm.c
cvs rdiff -u -r1.48 -r1.48.40.1 src/sys/arch/macppc/macppc/cpu.c
cvs rdiff -u -r1.60 -r1.60.28.1 src/sys/arch/macppc/macppc/locore.S
cvs rdiff -u -r1.118 -r1.118.12.1 src/sys/arch/ofppc/conf/GENERIC
cvs rdiff -u -r1.11 -r1.11.24.1 src/sys/arch/ofppc/ofppc/cpu.c
cvs rdiff -u -r1.39 -r1.39.22.1 src/sys/arch/ofppc/ofppc/locore.S
cvs rdiff -u -r1.106 -r1.106.18.1 src/sys/arch/ofppc/ofppc/machdep.c
cvs rdiff -u -r1.10 -r1.10.28.1 src/sys/arch/prep/prep/locore.S
cvs rdiff -u -r1.15 -r1.15.86.1 src/sys/arch/prep/stand/boot/boot.c
cvs rdiff -u -r1.9 -r1.9.90.1 src/sys/arch/prep/stand/boot/clock.c
cvs rdiff -u -r1.2 -r1.2.28.1 src/sys/arch/rs6000/rs6000/locore.S
cvs rdiff -u -r1.2 -r1.2.40.1 src/sys/arch/rs6000/stand/boot/boot.c
cvs rdiff -u -r1.1 -r1.1.42.1 src/sys/arch/rs6000/stand/boot/clock.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/amigappc/amigappc/locore.S
diff -u src/sys/arch/amigappc/amigappc/locore.S:1.15 src/sys/arch/amigappc/amigappc/locore.S:1.15.32.1
--- src/sys/arch/amigappc/amigappc/locore.S:1.15	Tue Feb  5 22:31:48 2008
+++ src/sys/arch/amigappc/amigappc/locore.S	Fri Jan  7 01:36:12 2011
@@ -1,4 +1,4 @@
-/*  $NetBSD: locore.S,v 1.15 2008/02/05 22:31:48 garbled Exp $   */
+/*  $NetBSD: locore.S,v 1.15.32.1 2011/01/07 01:36:12 matt Exp $   */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -60,6 +60,7 @@
 #include amiga/amiga/custom.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 
 	.data
 GLOBAL(proc0paddr)

Index: src/sys/arch/ibmnws/ibmnws/locore.S
diff -u src/sys/arch/ibmnws/ibmnws/locore.S:1.5 src/sys/arch/ibmnws/ibmnws/locore.S:1.5.32.1
--- src/sys/arch/ibmnws/ibmnws/locore.S:1.5	Tue Feb  5 22:31:49 2008
+++ src/sys/arch/ibmnws/ibmnws/locore.S	Fri Jan  7 01:36:10 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.5 2008/02/05 22:31:49 garbled Exp $	*/
+/*	$NetBSD: locore.S,v 1.5.32.1 2011/01/07 01:36:10 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -50,6 +50,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 #include powerpc/oea/hid.h
 
 /*

Index: src/sys/arch/macppc/dev/if_bm.c
diff -u src/sys/arch/macppc/dev/if_bm.c:1.37 src/sys/arch/macppc/dev/if_bm.c:1.37.12.1
--- src/sys/arch/macppc/dev/if_bm.c:1.37	Fri Sep 26 03:39:23 2008
+++ src/sys/arch/macppc/dev/if_bm.c	Fri Jan  7 01:36:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_bm.c,v 1.37 2008/09/26 03:39:23 macallan Exp $	*/
+/*	$NetBSD: if_bm.c,v 1.37.12.1 2011/01/07 01:36:12 matt Exp $	*/
 
 /*-
  * Copyright (C) 1998, 1999, 2000 Tsubai Masanari.  All rights reserved.
@@ -27,7 +27,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_bm.c,v 1.37 2008/09/26 03:39:23 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_bm.c,v 1.37.12.1 2011/01/07 01:36:12 matt Exp $);
 
 #include opt_inet.h
 #include bpfilter.h
@@ -65,6 +65,7 @@
 #include dev/mii/mii_bitbang.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 
 #include machine/autoconf.h
 #include machine/pio.h

Index: src/sys/arch/macppc/macppc/cpu.c
diff -u src/sys/arch/macppc/macppc/cpu.c:1.48 src/sys/arch/macppc/macppc/cpu.c:1.48.40.1
--- src/sys/arch/macppc/macppc/cpu.c:1.48	Sat Nov 17 18:02:42 2007
+++ src/sys/arch/macppc/macppc/cpu.c	Fri Jan  7 01:36:12 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.48 2007/11/17 18:02:42 macallan Exp $	*/
+/*	$NetBSD: cpu.c,v 1.48.40.1 2011/01/07 01:36:12 matt Exp $	*/
 
 /*-
  * Copyright (c) 2001 Tsubai Masanari.
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.48 2007/11/17 18:02:42 macallan Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.48.40.1 2011/01/07 01:36:12 matt Exp $);
 
 #include opt_ppcparam.h
 #include opt_multiprocessor.h
@@ -54,6 +54,7 @@
 #include powerpc/openpic.h
 #include powerpc/atomic.h
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 #ifdef ALTIVEC
 #include powerpc/altivec.h
 #endif

CVS commit: [matt-nb5-pq3] src/sys/arch

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:37:43 UTC 2011

Modified Files:
src/sys/arch/bebox/bebox [matt-nb5-pq3]: locore.S
src/sys/arch/mvmeppc/mvmeppc [matt-nb5-pq3]: locore.S
src/sys/arch/mvmeppc/stand/libsa [matt-nb5-pq3]: srt0.S
src/sys/arch/sandpoint/sandpoint [matt-nb5-pq3]: locore.S
src/sys/arch/sandpoint/stand/netboot [matt-nb5-pq3]: entry.S

Log Message:
Deal with split spr.h


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.28.1 src/sys/arch/bebox/bebox/locore.S
cvs rdiff -u -r1.7 -r1.7.28.1 src/sys/arch/mvmeppc/mvmeppc/locore.S
cvs rdiff -u -r1.2 -r1.2.24.1 src/sys/arch/mvmeppc/stand/libsa/srt0.S
cvs rdiff -u -r1.13 -r1.13.20.1 src/sys/arch/sandpoint/sandpoint/locore.S
cvs rdiff -u -r1.3 -r1.3.44.1 src/sys/arch/sandpoint/stand/netboot/entry.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/bebox/bebox/locore.S
diff -u src/sys/arch/bebox/bebox/locore.S:1.16 src/sys/arch/bebox/bebox/locore.S:1.16.28.1
--- src/sys/arch/bebox/bebox/locore.S:1.16	Tue Feb  5 22:31:48 2008
+++ src/sys/arch/bebox/bebox/locore.S	Fri Jan  7 01:37:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.16 2008/02/05 22:31:48 garbled Exp $	*/
+/*	$NetBSD: locore.S,v 1.16.28.1 2011/01/07 01:37:43 matt Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -52,6 +52,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 
 /*
  * Some instructions gas doesn't understand (yet?)

Index: src/sys/arch/mvmeppc/mvmeppc/locore.S
diff -u src/sys/arch/mvmeppc/mvmeppc/locore.S:1.7 src/sys/arch/mvmeppc/mvmeppc/locore.S:1.7.28.1
--- src/sys/arch/mvmeppc/mvmeppc/locore.S:1.7	Tue Feb  5 22:31:49 2008
+++ src/sys/arch/mvmeppc/mvmeppc/locore.S	Fri Jan  7 01:37:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.7 2008/02/05 22:31:49 garbled Exp $	*/
+/*	$NetBSD: locore.S,v 1.7.28.1 2011/01/07 01:37:43 matt Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -51,6 +51,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 
 #include ksyms.h
 

Index: src/sys/arch/mvmeppc/stand/libsa/srt0.S
diff -u src/sys/arch/mvmeppc/stand/libsa/srt0.S:1.2 src/sys/arch/mvmeppc/stand/libsa/srt0.S:1.2.24.1
--- src/sys/arch/mvmeppc/stand/libsa/srt0.S:1.2	Mon Apr 28 20:23:30 2008
+++ src/sys/arch/mvmeppc/stand/libsa/srt0.S	Fri Jan  7 01:37:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: srt0.S,v 1.2 2008/04/28 20:23:30 martin Exp $	*/
+/*	$NetBSD: srt0.S,v 1.2.24.1 2011/01/07 01:37:43 matt Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -32,6 +32,7 @@
 #include machine/asm.h
 #include machine/psl.h
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 
 #define	STACK_SIZE	8192
 

Index: src/sys/arch/sandpoint/sandpoint/locore.S
diff -u src/sys/arch/sandpoint/sandpoint/locore.S:1.13 src/sys/arch/sandpoint/sandpoint/locore.S:1.13.20.1
--- src/sys/arch/sandpoint/sandpoint/locore.S:1.13	Sat Apr 19 02:01:03 2008
+++ src/sys/arch/sandpoint/sandpoint/locore.S	Fri Jan  7 01:37:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.13 2008/04/19 02:01:03 nisimura Exp $	*/
+/*	$NetBSD: locore.S,v 1.13.20.1 2011/01/07 01:37:43 matt Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -51,6 +51,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 #include powerpc/oea/hid.h
 
 #include ksyms.h

Index: src/sys/arch/sandpoint/stand/netboot/entry.S
diff -u src/sys/arch/sandpoint/stand/netboot/entry.S:1.3 src/sys/arch/sandpoint/stand/netboot/entry.S:1.3.44.1
--- src/sys/arch/sandpoint/stand/netboot/entry.S:1.3	Mon Nov  5 13:41:48 2007
+++ src/sys/arch/sandpoint/stand/netboot/entry.S	Fri Jan  7 01:37:43 2011
@@ -1,6 +1,7 @@
-/* $NetBSD: entry.S,v 1.3 2007/11/05 13:41:48 nisimura Exp $ */
+/* $NetBSD: entry.S,v 1.3.44.1 2011/01/07 01:37:43 matt Exp $ */
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 #include powerpc/oea/hid.h
 
 	.text



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc/pmppc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:41:47 UTC 2011

Modified Files:
src/sys/arch/evbppc/pmppc [matt-nb5-pq3]: machdep.c

Log Message:
cpu_initclocks should not be done this early.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.18.1 src/sys/arch/evbppc/pmppc/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/evbppc/pmppc/machdep.c
diff -u src/sys/arch/evbppc/pmppc/machdep.c:1.3 src/sys/arch/evbppc/pmppc/machdep.c:1.3.18.1
--- src/sys/arch/evbppc/pmppc/machdep.c:1.3	Mon Apr 28 20:23:17 2008
+++ src/sys/arch/evbppc/pmppc/machdep.c	Fri Jan  7 01:41:47 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.3 2008/04/28 20:23:17 martin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.3.18.1 2011/01/07 01:41:47 matt Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.3 2008/04/28 20:23:17 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.3.18.1 2011/01/07 01:41:47 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_ddb.h
@@ -211,7 +211,6 @@
 	ticks_per_sec = a_config.a_bus_freq;
 	ticks_per_sec /= 4;	/* 4 cycles per DEC tick */
 	cpu_timebase = ticks_per_sec;
-	cpu_initclocks();
 
 	/*
 	 * Initialize the BAT registers



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc/virtex/dev

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:42:39 UTC 2011

Modified Files:
src/sys/arch/evbppc/virtex/dev [matt-nb5-pq3]: if_temac.c

Log Message:
Remove unused variable.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.32.1 src/sys/arch/evbppc/virtex/dev/if_temac.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/evbppc/virtex/dev/if_temac.c
diff -u src/sys/arch/evbppc/virtex/dev/if_temac.c:1.4 src/sys/arch/evbppc/virtex/dev/if_temac.c:1.4.32.1
--- src/sys/arch/evbppc/virtex/dev/if_temac.c:1.4	Tue Feb 12 18:03:43 2008
+++ src/sys/arch/evbppc/virtex/dev/if_temac.c	Fri Jan  7 01:42:38 2011
@@ -1,4 +1,4 @@
-/* 	$NetBSD: if_temac.c,v 1.4 2008/02/12 18:03:43 dyoung Exp $ */
+/* 	$NetBSD: if_temac.c,v 1.4.32.1 2011/01/07 01:42:38 matt Exp $ */
 
 /*
  * Copyright (c) 2006 Jachym Holecek
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_temac.c,v 1.4 2008/02/12 18:03:43 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_temac.c,v 1.4.32.1 2011/01/07 01:42:38 matt Exp $);
 
 #include bpfilter.h
 
@@ -649,7 +649,6 @@
 temac_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
 	struct temac_softc 	*sc = (struct temac_softc *)ifp-if_softc;
-	struct ifreq 		*ifr = (struct ifreq *)data;
 	int 			s, ret;
 
 	s = splnet();



CVS commit: [netbsd-5] src/sys/arch/xen/conf

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:42:55 UTC 2011

Modified Files:
src/sys/arch/xen/conf [netbsd-5]: files.xen

Log Message:
Pull up following revision(s) (requested by bouyer in ticket #1503):
sys/arch/xen/conf/files.xen: revision 1.110
Make maxpartitions 16 on !i386. Fixes hardwiring root on device autoconf
index  0 on amd64. Problem reported and patch tested by Tobias Nygren.


To generate a diff of this commit:
cvs rdiff -u -r1.88.4.5 -r1.88.4.6 src/sys/arch/xen/conf/files.xen

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

Modified files:

Index: src/sys/arch/xen/conf/files.xen
diff -u src/sys/arch/xen/conf/files.xen:1.88.4.5 src/sys/arch/xen/conf/files.xen:1.88.4.6
--- src/sys/arch/xen/conf/files.xen:1.88.4.5	Sat Oct  3 23:54:04 2009
+++ src/sys/arch/xen/conf/files.xen	Fri Jan  7 01:42:55 2011
@@ -1,10 +1,14 @@
-#	$NetBSD: files.xen,v 1.88.4.5 2009/10/03 23:54:04 snj Exp $
+#	$NetBSD: files.xen,v 1.88.4.6 2011/01/07 01:42:55 riz Exp $
 #	NetBSD: files.x86,v 1.10 2003/10/08 17:30:00 bouyer Exp 
 #	NetBSD: files.i386,v 1.254 2004/03/25 23:32:10 jmc Exp 
 
 version 20071109
 
+ifdef i386
 maxpartitions 8
+else
+maxpartitions 16
+endif
 
 maxusers 2 16 128
 



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:43:08 UTC 2011

Modified Files:
src/sys/arch/evbppc/ev64260 [matt-nb5-pq3]: ev64260_locore.S
src/sys/arch/evbppc/explora [matt-nb5-pq3]: explora_start.S machdep.c
src/sys/arch/evbppc/obs405 [matt-nb5-pq3]: obs200_locore.S
obs200_machdep.c obs266_machdep.c
src/sys/arch/evbppc/pmppc [matt-nb5-pq3]: pmppc_locore.S
src/sys/arch/evbppc/virtex [matt-nb5-pq3]: machdep.c virtex_start.S
src/sys/arch/evbppc/walnut [matt-nb5-pq3]: machdep.c walnut_start.S

Log Message:
Deal with the splitting of spr.h


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.28.1 src/sys/arch/evbppc/ev64260/ev64260_locore.S
cvs rdiff -u -r1.5 -r1.5.22.1 src/sys/arch/evbppc/explora/explora_start.S
cvs rdiff -u -r1.23 -r1.23.12.1 src/sys/arch/evbppc/explora/machdep.c
cvs rdiff -u -r1.4 -r1.4.74.1 src/sys/arch/evbppc/obs405/obs200_locore.S
cvs rdiff -u -r1.5 -r1.5.74.1 src/sys/arch/evbppc/obs405/obs200_machdep.c
cvs rdiff -u -r1.6 -r1.6.74.1 src/sys/arch/evbppc/obs405/obs266_machdep.c
cvs rdiff -u -r1.3 -r1.3.32.1 src/sys/arch/evbppc/pmppc/pmppc_locore.S
cvs rdiff -u -r1.6 -r1.6.14.1 src/sys/arch/evbppc/virtex/machdep.c
cvs rdiff -u -r1.1 -r1.1.72.1 src/sys/arch/evbppc/virtex/virtex_start.S
cvs rdiff -u -r1.36 -r1.36.14.1 src/sys/arch/evbppc/walnut/machdep.c
cvs rdiff -u -r1.14 -r1.14.74.1 src/sys/arch/evbppc/walnut/walnut_start.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/evbppc/ev64260/ev64260_locore.S
diff -u src/sys/arch/evbppc/ev64260/ev64260_locore.S:1.9 src/sys/arch/evbppc/ev64260/ev64260_locore.S:1.9.28.1
--- src/sys/arch/evbppc/ev64260/ev64260_locore.S:1.9	Tue Feb  5 22:31:49 2008
+++ src/sys/arch/evbppc/ev64260/ev64260_locore.S	Fri Jan  7 01:43:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ev64260_locore.S,v 1.9 2008/02/05 22:31:49 garbled Exp $	*/
+/*	$NetBSD: ev64260_locore.S,v 1.9.28.1 2011/01/07 01:43:07 matt Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -51,6 +51,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 #include powerpc/oea/bat.h
 #include powerpc/oea/hid.h
 

Index: src/sys/arch/evbppc/explora/explora_start.S
diff -u src/sys/arch/evbppc/explora/explora_start.S:1.5 src/sys/arch/evbppc/explora/explora_start.S:1.5.22.1
--- src/sys/arch/evbppc/explora/explora_start.S:1.5	Mon Apr 28 20:23:17 2008
+++ src/sys/arch/evbppc/explora/explora_start.S	Fri Jan  7 01:43:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: explora_start.S,v 1.5 2008/04/28 20:23:17 martin Exp $	*/
+/*	$NetBSD: explora_start.S,v 1.5.22.1 2011/01/07 01:43:07 matt Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -49,6 +49,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/ibm4xx/spr.h
 #include powerpc/ibm4xx/dcr403cgx.h
 #include powerpc/ibm4xx/pmap.h
 

Index: src/sys/arch/evbppc/explora/machdep.c
diff -u src/sys/arch/evbppc/explora/machdep.c:1.23 src/sys/arch/evbppc/explora/machdep.c:1.23.12.1
--- src/sys/arch/evbppc/explora/machdep.c:1.23	Fri Aug  8 06:29:21 2008
+++ src/sys/arch/evbppc/explora/machdep.c	Fri Jan  7 01:43:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.23 2008/08/08 06:29:21 hannken Exp $	*/
+/*	$NetBSD: machdep.c,v 1.23.12.1 2011/01/07 01:43:07 matt Exp $	*/
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.23 2008/08/08 06:29:21 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.23.12.1 2011/01/07 01:43:07 matt Exp $);
 
 #include opt_explora.h
 #include ksyms.h
@@ -56,6 +56,7 @@
 #include machine/trap.h
 
 #include powerpc/spr.h
+#include powerpc/ibm4xx/spr.h
 #include powerpc/ibm4xx/dcr403cgx.h
 
 #if NKSYMS || defined(DDB) || defined(LKM)

Index: src/sys/arch/evbppc/obs405/obs200_locore.S
diff -u src/sys/arch/evbppc/obs405/obs200_locore.S:1.4 src/sys/arch/evbppc/obs405/obs200_locore.S:1.4.74.1
--- src/sys/arch/evbppc/obs405/obs200_locore.S:1.4	Mon Oct 16 18:14:35 2006
+++ src/sys/arch/evbppc/obs405/obs200_locore.S	Fri Jan  7 01:43:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: obs200_locore.S,v 1.4 2006/10/16 18:14:35 kiyohara Exp $	*/
+/*	$NetBSD: obs200_locore.S,v 1.4.74.1 2011/01/07 01:43:07 matt Exp $	*/
 /*	Original Tag: locore.S,v 1.1 2003/09/23 15:21:58 shige Exp	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
@@ -88,6 +88,7 @@
 #include machine/asm.h
 
 #include powerpc/spr.h
+#include powerpc/ibm4xx/spr.h
 #include powerpc/ibm4xx/dcr405gp.h
 #include powerpc/ibm4xx/pmap.h
 

Index: src/sys/arch/evbppc/obs405/obs200_machdep.c
diff -u src/sys/arch/evbppc/obs405/obs200_machdep.c:1.5 src/sys/arch/evbppc/obs405/obs200_machdep.c:1.5.74.1
--- src/sys/arch/evbppc/obs405/obs200_machdep.c:1.5	Wed Nov 29 19:56:47 2006
+++ src/sys/arch/evbppc/obs405/obs200_machdep.c	Fri Jan  7 

CVS commit: [netbsd-5] src/doc

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:43:55 UTC 2011

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

Log Message:
tickets 1502, 1503.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.42 -r1.1.2.43 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.42 src/doc/CHANGES-5.2:1.1.2.43
--- src/doc/CHANGES-5.2:1.1.2.42	Fri Jan  7 01:29:25 2011
+++ src/doc/CHANGES-5.2	Fri Jan  7 01:43:55 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.42 2011/01/07 01:29:25 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.43 2011/01/07 01:43:55 riz Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -4222,3 +4222,13 @@
 	Update postfix to 2.7.2.
 	[tron, ticket #1501]
 
+sys/dev/rnd.c	1.79
+
+	Prevent crash if len field is garbage in ioctl(RNDADDDATA). PR#44190.
+	[pooka, ticket #1502]
+
+sys/arch/xen/conf/files.xen			1.110 via patch
+
+	Make maxpartitions 16 on !i386.
+	[bouyer, ticket #1503]
+



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc/conf

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:44:17 UTC 2011

Modified Files:
src/sys/arch/evbppc/conf [matt-nb5-pq3]: PMPPC

Log Message:
Bump SYMTAB_SPACE


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.12.1 src/sys/arch/evbppc/conf/PMPPC

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/evbppc/conf/PMPPC
diff -u src/sys/arch/evbppc/conf/PMPPC:1.5 src/sys/arch/evbppc/conf/PMPPC:1.5.12.1
--- src/sys/arch/evbppc/conf/PMPPC:1.5	Thu Jul 31 07:41:01 2008
+++ src/sys/arch/evbppc/conf/PMPPC	Fri Jan  7 01:44:17 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: PMPPC,v 1.5 2008/07/31 07:41:01 simonb Exp $
+#	$NetBSD: PMPPC,v 1.5.12.1 2011/01/07 01:44:17 matt Exp $
 #
 #	PMPPC
 #
@@ -36,7 +36,7 @@
 options 	DDB		# in-kernel debugger
 options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
 #options 	TRAP_PANICWAIT
-options 	SYMTAB_SPACE=51	# size for embedded symbol table
+options 	SYMTAB_SPACE=55	# size for embedded symbol table
 
 #options 	KGDB		# remote debugger
 #options 	KGDB_DEVNAME=\com\,KGDB_DEVADDR=0xff600400,KGDB_DEVRATE=9600



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc/conf

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:44:44 UTC 2011

Added Files:
src/sys/arch/evbppc/conf [matt-nb5-pq3]: INSTALL_PMPPC

Log Message:
This is useful for testing OEA in gxemul.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1.2.1 src/sys/arch/evbppc/conf/INSTALL_PMPPC

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

Added files:

Index: src/sys/arch/evbppc/conf/INSTALL_PMPPC
diff -u /dev/null src/sys/arch/evbppc/conf/INSTALL_PMPPC:1.1.2.1
--- /dev/null	Fri Jan  7 01:44:44 2011
+++ src/sys/arch/evbppc/conf/INSTALL_PMPPC	Fri Jan  7 01:44:44 2011
@@ -0,0 +1,26 @@
+# 	$NetBSD: INSTALL_PMPPC,v 1.1.2.1 2011/01/07 01:44:44 matt Exp $
+
+include arch/evbppc/conf/PMPPC
+
+#ident 		INSTALL_PMPPC-$Revision: 1.1.2.1 $
+
+# DEBUG options turned on:
+
+options		PIPE_SOCKETPAIR		# smaller, but slower pipe(2)
+
+pseudo-device	md
+
+makeoptions	NEEDS_MDSETIMAGE=yes
+
+no config	netbsd
+config		netbsd root on md0a
+
+# Enable the hooks used for initializing the root memory-disk.
+options 	MEMORY_DISK_HOOKS
+options 	MEMORY_DISK_IS_ROOT	# force root on memory disk
+options 	MEMORY_DISK_SERVER=0	# no userspace memory disk support
+## The ramdisk size must be kept in sync manually with the size of
+## the `ramdisk' image (which is built in distrib/evbppc/ramdisk/ramdisk).
+options 	MEMORY_DISK_ROOT_SIZE=6144	# size of memory disk, in blocks
+options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
+



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc/conf

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:45:14 UTC 2011

Modified Files:
src/sys/arch/evbppc/conf [matt-nb5-pq3]: WALNUT

Log Message:
Bump up SYMTAB_SPACE


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.37.12.1 src/sys/arch/evbppc/conf/WALNUT

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/evbppc/conf/WALNUT
diff -u src/sys/arch/evbppc/conf/WALNUT:1.37 src/sys/arch/evbppc/conf/WALNUT:1.37.12.1
--- src/sys/arch/evbppc/conf/WALNUT:1.37	Thu Jul 31 07:41:01 2008
+++ src/sys/arch/evbppc/conf/WALNUT	Fri Jan  7 01:45:14 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: WALNUT,v 1.37 2008/07/31 07:41:01 simonb Exp $
+#	$NetBSD: WALNUT,v 1.37.12.1 2011/01/07 01:45:14 matt Exp $
 #
 #	GENERIC -- everything that's currently supported
 #
@@ -42,7 +42,7 @@
 options 	DDB		# in-kernel debugger
 options 	DDB_HISTORY_SIZE=512	# enable history editing in DDB
 options 	TRAP_PANICWAIT
-options 	SYMTAB_SPACE=40	# size for embedded symbol table
+options 	SYMTAB_SPACE=404000	# size for embedded symbol table
 
 makeoptions	DEBUG=-g	# compile full symbol table
 



CVS commit: [matt-nb5-pq3] src/sys/arch/evbppc/conf

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:45:39 UTC 2011

Modified Files:
src/sys/arch/evbppc/conf [matt-nb5-pq3]: OPENBLOCKS266
OPENBLOCKS266_OPT

Log Message:
Small fixes so these compile again.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.41.12.1 src/sys/arch/evbppc/conf/OPENBLOCKS266
cvs rdiff -u -r1.9.28.1 -r1.9.28.1.2.1 \
src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT

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/evbppc/conf/OPENBLOCKS266
diff -u src/sys/arch/evbppc/conf/OPENBLOCKS266:1.41 src/sys/arch/evbppc/conf/OPENBLOCKS266:1.41.12.1
--- src/sys/arch/evbppc/conf/OPENBLOCKS266:1.41	Thu Jul 31 07:41:01 2008
+++ src/sys/arch/evbppc/conf/OPENBLOCKS266	Fri Jan  7 01:45:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: OPENBLOCKS266,v 1.41 2008/07/31 07:41:01 simonb Exp $
+#	$NetBSD: OPENBLOCKS266,v 1.41.12.1 2011/01/07 01:45:39 matt Exp $
 #
 #	GENERIC -- everything that's currently supported
 #
@@ -7,7 +7,7 @@
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		OPENBLOCKS266-$Revision: 1.41 $
+#ident 		OPENBLOCKS266-$Revision: 1.41.12.1 $
 
 maxusers	32
 
@@ -182,6 +182,7 @@
 # MII/PHY support
 dmphy*	at mii? phy ?			# Davicom DM9101/9102 PHYs
 lxtphy*	at mii? phy ?			# Level One LXT-970 PHYs
+ukphy*	at mii? phy ?			# unknown PHYs
 options 	MIIVERBOSE		# verbose PHY autoconfig messages
 
 

Index: src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT
diff -u src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT:1.9.28.1 src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT:1.9.28.1.2.1
--- src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT:1.9.28.1	Sun Nov 21 03:05:07 2010
+++ src/sys/arch/evbppc/conf/OPENBLOCKS266_OPT	Fri Jan  7 01:45:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: OPENBLOCKS266_OPT,v 1.9.28.1 2010/11/21 03:05:07 riz Exp $
+#	$NetBSD: OPENBLOCKS266_OPT,v 1.9.28.1.2.1 2011/01/07 01:45:39 matt Exp $
 #
 
 include		arch/evbppc/conf/OPENBLOCKS266
@@ -182,6 +182,7 @@
 
 # USB audio
 uaudio*	at uhub? port ? configuration ?
+audio*	at uaudio?
 
 # USB MIDI
 umidi*	at uhub? port ? configuration ?
@@ -331,6 +332,7 @@
 # miscellaneous pseudo-devices
 pseudo-device	bcsp			# BlueCore Serial Protocol
 pseudo-device	btuart			# Bluetooth HCI UART (H4)
+pseudo-device	sysmon
 
 # wscons pseudo-devices
 pseudo-device	wsmux			# mouse  keyboard multiplexor



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:50:04 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: frame.h

Log Message:
intrframe is dead.  Just use a partially filled trapframe.
Add a ktrapframe which include the cf_sp/cf_lr of the callframe in addition
to the trapframe.  This allows the FRAME_XX+8 to just be FRAME_XX.
Cleanup and simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.20.16.1 src/sys/arch/powerpc/include/frame.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/powerpc/include/frame.h
diff -u src/sys/arch/powerpc/include/frame.h:1.20 src/sys/arch/powerpc/include/frame.h:1.20.16.1
--- src/sys/arch/powerpc/include/frame.h:1.20	Thu Oct 16 04:02:32 2008
+++ src/sys/arch/powerpc/include/frame.h	Fri Jan  7 01:50:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.20 2008/10/16 04:02:32 wrstuden Exp $	*/
+/*	$NetBSD: frame.h,v 1.20.16.1 2011/01/07 01:50:04 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -35,6 +35,12 @@
 
 #include machine/types.h
 
+#ifdef _KERNEL
+#ifdef _KERNEL_OPT
+#include opt_ppcarch.h
+#endif
+#endif
+
 /*
  * We have to save all registers on every trap, because
  *	1. user could attach this process every time
@@ -45,6 +51,14 @@
  *
  * Change ordering to cluster together these register_t's.		XXX
  */
+struct reg_sans_pc {
+	register_t r_fixreg[32];
+	register_t r_lr;
+	uint32_t r_cr;
+	uint32_t r_xer;
+	register_t r_ctr;
+};
+
 struct utrapframe {
 	register_t fixreg[32];
 	register_t lr;
@@ -58,26 +72,45 @@
 	int spare;
 };
 
+struct clockframe {
+	register_t cf_srr0;
+	register_t cf_srr1;
+	int cf_idepth;
+};
+
 struct trapframe {
-	register_t fixreg[32];
-	register_t lr;
-	int cr;
-	int xer;
-	register_t ctr;
-	register_t srr0;
-	register_t srr1;
-	/*
-	 * DAR is the OEA name.  On IBM4xx is DAR is really DEAR.
-	 */
-	register_t dar;		/* dar  dsisr are only filled on a DSI trap */
-	int dsisr;
-	int exc;
-	int tf_xtra[2];
-};
-#define	TF_VRSAVE	0
-#define	TF_MQ		1
-#define	TF_ESR		0
-#define	TF_PID		1
+	struct reg_sans_pc tf_ureg;
+	struct clockframe tf_cf;
+	uint32_t tf_exc;
+#if defined(PPC_OEA) || defined(PPC_OEA64) || defined(PPC_OEA64_BRIDGE)
+	register_t tf_dar;
+	uint32_t tf_dsisr;
+	uint32_t tf_vrsave;
+	uint32_t tf_mq;
+#endif
+#if defined(PPC_BOOKE) || defined(PPC_IBM4XX)
+	register_t tf_dear;
+	register_t tf_mcar;
+	register_t tf_sprg1;
+	uint32_t tf_esr;
+	uint32_t tf_mcsr;
+	uint32_t tf_pid;
+#endif
+};
+#define tf_fixreg	tf_ureg.r_fixreg
+#define tf_lr		tf_ureg.r_lr
+#define tf_cr		tf_ureg.r_cr
+#define tf_xer		tf_ureg.r_xer
+#define tf_ctr		tf_ureg.r_ctr
+#define tf_srr0		tf_cf.cf_srr0
+#define tf_srr1		tf_cf.cf_srr1
+#define tf_idepth	tf_cf.cf_idepth
+
+struct ktrapframe {
+	register_t ktf_sp;
+	register_t ktf_lr;
+	struct trapframe ktf_tf;
+};
 
 #if defined(_KERNEL) || defined(_LKM)
 #ifdef _LP64
@@ -99,24 +132,18 @@
 /*
  * This is to ensure alignment of the stackpointer
  */
-#define	FRAMELEN	roundup(sizeof(struct trapframe) + 2*sizeof(register_t), CALLFRAMELEN)
-#define	trapframe(l)	((struct trapframe *)((char *)(l)-l_addr + USPACE - FRAMELEN + 2*sizeof(register_t)))
+#define	FRAMELEN	roundup(sizeof(struct ktrapframe), CALLFRAMELEN)
+#define ktrapframe(l)	((struct ktrapframe *)((char *)(l)-l_addr + USPACE - FRAMELEN - CALLFRAMELEN))
+#define trapframe(l)	((ktrapframe(l)-ktf_tf))
 
 #define	SFRAMELEN	roundup(sizeof(struct switchframe), CALLFRAMELEN)
 struct switchframe {
-	register_t sp;
-	register_t lr;
-	register_t user_sr;		/* VSID on IBM4XX */
-	register_t cr;			/* why?  CR is volatile. */
-	register_t fixreg2;
-	register_t fixreg[19];		/* R13-R31 */
-};
-
-struct clockframe {
-	register_t srr1;
-	register_t srr0;
-	int pri;
-	int depth;
+	register_t sf_sp;
+	register_t sf_lr;
+	register_t sf_user_sr;		/* VSID on IBM4XX */
+	register_t sf_cr;		/* why?  CR is volatile. */
+	register_t sf_fixreg2;
+	register_t sf_fixreg[19];	/* R13-R31 */
 };
 
 /*
@@ -124,16 +151,18 @@
  */
 #define	CALLFRAMELEN	sizeof(struct callframe)
 struct callframe {
-	register_t sp;
-	register_t lr;
-	register_t r30;
-	register_t r31;
+	register_t cf_sp;
+	register_t cf_lr;
+	register_t cf_r30;
+	register_t cf_r31;
 };
 
 struct saframe {
-	register_t r1;		/* stack pointer */
-	register_t lr;		/* Callee lr save area */
-	register_t fill[2];	/* Pad to multiple of 16 bytes */
+	register_t saf_r1;	/* stack pointer */
+	register_t saf_lr;	/* Callee lr save area */
+#ifndef _LP64
+	register_t saf_fill[2];	/* Pad to multiple of 16 bytes */
+#endif
 };
 
 #define	IFRAMELEN	roundup(sizeof(struct intrframe), CALLFRAMELEN)



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:51:03 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: asm.h

Log Message:
Allow implementation to not have an interrupt stack (booke).
Use .ident for RCSID


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.26.1 src/sys/arch/powerpc/include/asm.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/powerpc/include/asm.h
diff -u src/sys/arch/powerpc/include/asm.h:1.26 src/sys/arch/powerpc/include/asm.h:1.26.26.1
--- src/sys/arch/powerpc/include/asm.h:1.26	Sat Feb 23 19:38:47 2008
+++ src/sys/arch/powerpc/include/asm.h	Fri Jan  7 01:51:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: asm.h,v 1.26 2008/02/23 19:38:47 matt Exp $	*/
+/*	$NetBSD: asm.h,v 1.26.26.1 2011/01/07 01:51:02 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -123,7 +123,7 @@
 
 #define	ASMSTR		.asciz
 
-#define RCSID(x)	.text; .asciz x
+#define RCSID(x)	.pushsection .ident; .asciz x; .popsection
 
 #ifdef __ELF__
 #define	WEAK_ALIAS(alias,sym)		\
@@ -159,6 +159,14 @@
  *	R4[er] = kernelend
  */
 
+#ifdef CI_INTSTK
+#define	INIT_CPUINFO_INTSTK(er,tmp1)	\
+	addi	er,er,INTSTK;		\
+	stptr	er,CI_INTSTK(tmp1)
+#else
+#define	INIT_CPUINFO_INTSTK(er,tmp1)	/* nothing */
+#endif
+
 #define	INIT_CPUINFO(er,sp,tmp1,tmp2) 	\
 	li	tmp1,PGOFSET;		\
 	add	er,er,tmp1;		\
@@ -166,13 +174,12 @@
 	lis	tmp1,_C_LABEL(cpu_info)@ha;\
 	addi	tmp1,tmp1,_C_LABEL(cpu_info)@l;\
 	mtsprg0	tmp1;			/* save for later use */	\
-	addi	er,er,INTSTK;		\
-	stptr	er,CI_INTSTK(tmp1);	\
+	INIT_CPUINFO_INTSTK(er,tmp1);	\
 	lis	tmp2,_C_LABEL(emptyidlespin)@h;\
 	ori	tmp2,tmp2,_C_LABEL(emptyidlespin)@l;			\
 	stptr	tmp2,CI_IDLESPIN(tmp1);	\
 	li	tmp2,-1;		\
-	stint	tmp2,CI_INTRDEPTH(tmp1);\
+	stint	tmp2,CI_IDEPTH(tmp1);	\
 	li	tmp2,0;			\
 	stptr	tmp2,-CALLFRAMELEN(er);	/* terminate idle stack chain */\
 	lis	tmp1,_C_LABEL(proc0paddr)@ha;\
@@ -182,7 +189,7 @@
 		/* er = end of mem reserved for kernel */		\
 	stptru	tmp2,-CALLFRAMELEN(sp)	/* end of stack chain */
 
-#endif
+#endif	/* KERNEL */
 
 /* Condition Register Bit Fields */
 



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:51:31 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: instr.h

Log Message:
Add fixup definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.104.1 src/sys/arch/powerpc/include/instr.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/powerpc/include/instr.h
diff -u src/sys/arch/powerpc/include/instr.h:1.4 src/sys/arch/powerpc/include/instr.h:1.4.104.1
--- src/sys/arch/powerpc/include/instr.h:1.4	Sun Dec 11 12:18:43 2005
+++ src/sys/arch/powerpc/include/instr.h	Fri Jan  7 01:51:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: instr.h,v 1.4 2005/12/11 12:18:43 christos Exp $ */
+/*	$NetBSD: instr.h,v 1.4.104.1 2011/01/07 01:51:31 matt Exp $ */
 
 /*
  * Copyright (c) 1992, 1993
@@ -40,6 +40,9 @@
  *	@(#)instr.h	8.1 (Berkeley) 6/11/93
  */
 
+#ifndef _POWERPC_INSTR_H_
+#define _POWERPC_INSTR_H_
+
 /*
  * An instruction.
  */
@@ -74,11 +77,11 @@
 	 */
 	struct {
 		u_int	i_opcd:6;
-		int	i_bo:5;
-		int	i_bi:5;
+		u_int	i_bo:5;
+		u_int	i_bi:5;
 		int	i_bd:14;
-		int	i_aa:1;
-		int	i_lk:1;
+		u_int	i_aa:1;
+		u_int	i_lk:1;
 	} i_b;
 
 	/*
@@ -307,6 +310,10 @@
 #define	OPC31_FPMASK	0x31f
 #define	OPC31_FPOP	0x217
 
+/* m[ft]spr are also opcode 31; ra/rb encode the spr */
+#define	OPC31_MFSPR	0x153
+#define OPC31_MTSPR	0x1d3
+
 /*
  * Opcode 59 sub-types:
  */
@@ -377,6 +384,12 @@
 #define	OPC63_FCFID	0x34e
 
 /*
+ * Branch instruction modifiers.
+ */
+#define	B_LK		0x01	/* Link flag (LR=CIA+4) */
+#define	B_AA		0x02	/* Absolute flag */
+
+/*
  * FPU data types.
  */
 #define FTYPE_LNG	-1	/* data = 64-bit signed long integer */		
@@ -391,3 +404,19 @@
 #define	  FSR_RD_RZ	1		/* round towards 0 */
 #define	  FSR_RD_RP	2		/* round towards +inf */
 #define	  FSR_RD_RM	3		/* round towards -inf */
+
+/*
+ * Convert an address to an offset used in a PowerPC branch instruction.
+ * We simply shift away the low bits since we are going convert the bl
+ * to a bla.
+ */
+#define	fixup_addr2offset(x)	((uintptr_t)(x)  2)
+struct powerpc_jump_fixup_info {
+	uint32_t jfi_stub;
+	uint32_t jfi_real;
+};
+ 
+void	powerpc_fixup_stubs(uint32_t *, uint32_t *);
+
+
+#endif /* !_POWERPC_INSTR_H_ */



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:52:40 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/ibm4xx [matt-nb5-pq3]: pmap.h
src/sys/arch/powerpc/include/oea [matt-nb5-pq3]: pmap.h

Log Message:
PMAP_NC - PMAP_NOCACHE.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.66.1 src/sys/arch/powerpc/include/ibm4xx/pmap.h
cvs rdiff -u -r1.13 -r1.13.30.1 src/sys/arch/powerpc/include/oea/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/powerpc/include/ibm4xx/pmap.h
diff -u src/sys/arch/powerpc/include/ibm4xx/pmap.h:1.13 src/sys/arch/powerpc/include/ibm4xx/pmap.h:1.13.66.1
--- src/sys/arch/powerpc/include/ibm4xx/pmap.h:1.13	Wed Feb 21 22:59:49 2007
+++ src/sys/arch/powerpc/include/ibm4xx/pmap.h	Fri Jan  7 01:52:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.13 2007/02/21 22:59:49 thorpej Exp $	*/
+/*	$NetBSD: pmap.h,v 1.13.66.1 2011/01/07 01:52:40 matt Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -128,9 +128,9 @@
  * Extra flags to pass to pmap_enter() -- make sure they don't conflict
  * w/PMAP_CANFAIL or PMAP_WIRED
  */
-#define	PME_NOCACHE	0x100
-#define	PME_WRITETHROUG	0x200
-#define	PMAP_NC		PME_NOCACHE	/* XXX: OEA pmap compat. for bus_dma */
+#define	PME_NOCACHE	0x100
+#define	PME_WRITETHROUG	0x200
+#define	PMAP_NOCACHE	PME_NOCACHE	/* XXX: OEA pmap compat. for bus_dma */
 
 #ifndef _LOCORE
 

Index: src/sys/arch/powerpc/include/oea/pmap.h
diff -u src/sys/arch/powerpc/include/oea/pmap.h:1.13 src/sys/arch/powerpc/include/oea/pmap.h:1.13.30.1
--- src/sys/arch/powerpc/include/oea/pmap.h:1.13	Thu Feb  7 00:36:57 2008
+++ src/sys/arch/powerpc/include/oea/pmap.h	Fri Jan  7 01:52:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.13 2008/02/07 00:36:57 matt Exp $	*/
+/*	$NetBSD: pmap.h,v 1.13.30.1 2011/01/07 01:52:39 matt Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -250,7 +250,7 @@
 int pmap_setup_segment0_map(int use_large_pages, ...);
 #endif
 
-#define	PMAP_NC			0x1000
+#define	PMAP_NOCACHE			0x100
 #define PMAP_STEAL_MEMORY
 #define PMAP_NEED_PROCWR
 



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include/ibm4xx

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:53:06 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/ibm4xx [matt-nb5-pq3]: Makefile

Log Message:
Add spr.h


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.102.1 src/sys/arch/powerpc/include/ibm4xx/Makefile

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/powerpc/include/ibm4xx/Makefile
diff -u src/sys/arch/powerpc/include/ibm4xx/Makefile:1.5 src/sys/arch/powerpc/include/ibm4xx/Makefile:1.5.102.1
--- src/sys/arch/powerpc/include/ibm4xx/Makefile:1.5	Sun Dec 11 12:18:43 2005
+++ src/sys/arch/powerpc/include/ibm4xx/Makefile	Fri Jan  7 01:53:06 2011
@@ -1,7 +1,7 @@
-#	$NetBSD: Makefile,v 1.5 2005/12/11 12:18:43 christos Exp $
+#	$NetBSD: Makefile,v 1.5.102.1 2011/01/07 01:53:06 matt Exp $
 
 INCSDIR= /usr/include/powerpc/ibm4xx
 
-INCS=	cpu.h pmap.h tlb.h
+INCS=	cpu.h pmap.h spr.h tlb.h
 
 .include bsd.kinc.mk



CVS commit: [netbsd-5] src

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:53:33 UTC 2011

Modified Files:
src/etc [netbsd-5]: rc.subr
src/etc/rc.d [netbsd-5]: network
src/share/man/man5 [netbsd-5]: ifconfig.if.5
src/share/man/man8 [netbsd-5]: rc.subr.8

Log Message:
Pull up following revision(s) (requested by enami in ticket #1504):
share/man/man8/rc.subr.8: revision 1.27
etc/rc.subr: revision 1.86
share/man/man5/ifconfig.if.5: revision 1.14
etc/rc.d/network: revision 1.61
Add a collapse_backslash_newline function to rc.subr.
Collapse abckslashnewline sequences in /etc/ifconfig.xxx files read
by /etc/rc.d/network.  Fixes PR 41662 by Christoph Badura, which was
also reported independently by Jeremy C. Reed.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.73.2.1 src/etc/rc.subr
cvs rdiff -u -r1.57.2.1 -r1.57.2.2 src/etc/rc.d/network
cvs rdiff -u -r1.11.2.2 -r1.11.2.3 src/share/man/man5/ifconfig.if.5
cvs rdiff -u -r1.21 -r1.21.2.1 src/share/man/man8/rc.subr.8

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

Modified files:

Index: src/etc/rc.subr
diff -u src/etc/rc.subr:1.73 src/etc/rc.subr:1.73.2.1
--- src/etc/rc.subr:1.73	Mon Jun 23 03:26:18 2008
+++ src/etc/rc.subr	Fri Jan  7 01:53:32 2011
@@ -1,4 +1,4 @@
-# $NetBSD: rc.subr,v 1.73 2008/06/23 03:26:18 dholland Exp $
+# $NetBSD: rc.subr,v 1.73.2.1 2011/01/07 01:53:32 riz Exp $
 #
 # Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -911,4 +911,26 @@
 	fi
 }
 
+#
+# collapse_backslash_newline
+#	Copy input to output, collapsing backslashnewline
+#	to nothing, but leaving other backslashes alone.
+#
+collapse_backslash_newline()
+{
+	local line
+	while read -r line ; do
+		case $line in
+		*\\)
+			# print it, without the backslash or newline
+			printf %s ${line%?}
+			;;
+		*)
+			# print it, with a newline
+			printf %s\n ${line}
+			;;
+		esac
+	done
+}
+
 _rc_subr_loaded=:

Index: src/etc/rc.d/network
diff -u src/etc/rc.d/network:1.57.2.1 src/etc/rc.d/network:1.57.2.2
--- src/etc/rc.d/network:1.57.2.1	Mon May 18 19:30:48 2009
+++ src/etc/rc.d/network	Fri Jan  7 01:53:33 2011
@@ -1,6 +1,6 @@
 #!/bin/sh
 #
-# $NetBSD: network,v 1.57.2.1 2009/05/18 19:30:48 bouyer Exp $
+# $NetBSD: network,v 1.57.2.2 2011/01/07 01:53:33 riz Exp $
 #
 
 # PROVIDE: network
@@ -259,6 +259,7 @@
 )
 ;;
 			esac |
+			collapse_backslash_newline |
 			while read -r args; do
 case $args in
 ''|#*|create)

Index: src/share/man/man5/ifconfig.if.5
diff -u src/share/man/man5/ifconfig.if.5:1.11.2.2 src/share/man/man5/ifconfig.if.5:1.11.2.3
--- src/share/man/man5/ifconfig.if.5:1.11.2.2	Thu Jan 22 19:53:44 2009
+++ src/share/man/man5/ifconfig.if.5	Fri Jan  7 01:53:32 2011
@@ -1,4 +1,4 @@
-.\	$NetBSD: ifconfig.if.5,v 1.11.2.2 2009/01/22 19:53:44 snj Exp $
+.\	$NetBSD: ifconfig.if.5,v 1.11.2.3 2011/01/07 01:53:32 riz Exp $
 .\
 .\ Copyright (c) 1996 Matthew R. Green
 .\ All rights reserved.
@@ -24,7 +24,7 @@
 .\ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\ SUCH DAMAGE.
 .\
-.Dd January 9, 2009
+.Dd September 26, 2010
 .Dt IFCONFIG.IF 5
 .Os
 .Sh NAME
@@ -63,6 +63,9 @@
 In the case of a variable, semicolons may be used instead of
 newlines, as described in
 .Xr rc.conf 5 .
+.Ao backslash Ac Ns Ao newline Ac
+sequences in files are ignored, so long logical lines may be
+made up of several shorter physical lines.
 .Pp
 Normally, a line will be evaluated as command line arguments to
 .Xr ifconfig 8 .

Index: src/share/man/man8/rc.subr.8
diff -u src/share/man/man8/rc.subr.8:1.21 src/share/man/man8/rc.subr.8:1.21.2.1
--- src/share/man/man8/rc.subr.8:1.21	Sun May 25 09:07:21 2008
+++ src/share/man/man8/rc.subr.8	Fri Jan  7 01:53:32 2011
@@ -1,4 +1,4 @@
-.\ 	$NetBSD: rc.subr.8,v 1.21 2008/05/25 09:07:21 wiz Exp $
+.\ 	$NetBSD: rc.subr.8,v 1.21.2.1 2011/01/07 01:53:32 riz Exp $
 .\
 .\ Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
 .\ All rights reserved.
@@ -46,6 +46,8 @@
 .It
 .Ic check_process Ar procname Op Ar interpreter
 .It
+.Ic collapse_backslash_newline
+.It
 .Ic err Ar exitval Ar message
 .It
 .Ic load_rc_config Ar command
@@ -205,6 +207,10 @@
 .Ar interpreter
 is handled as per
 .Ic check_pidfile .
+.It Ic collapse_backslash_newline
+Copy input to output, collapsing
+.Ao backslash Ac Ns Ao newline Ac
+to nothing, but leaving other backslashes alone.
 .It Ic err Ar exitval Ar message
 Display an error message to
 .Em stderr ,



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include/ibm4xx

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:53:34 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/ibm4xx [matt-nb5-pq3]: ibm4xx_intr.h

Log Message:
Remove CLKF_BASEPRI (it's obsolete).


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.16.26.1 \
src/sys/arch/powerpc/include/ibm4xx/ibm4xx_intr.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/powerpc/include/ibm4xx/ibm4xx_intr.h
diff -u src/sys/arch/powerpc/include/ibm4xx/ibm4xx_intr.h:1.16 src/sys/arch/powerpc/include/ibm4xx/ibm4xx_intr.h:1.16.26.1
--- src/sys/arch/powerpc/include/ibm4xx/ibm4xx_intr.h:1.16	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/include/ibm4xx/ibm4xx_intr.h	Fri Jan  7 01:53:34 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ibm4xx_intr.h,v 1.16 2008/04/28 20:23:32 martin Exp $	*/
+/*	$NetBSD: ibm4xx_intr.h,v 1.16.26.1 2011/01/07 01:53:34 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 2007 The NetBSD Foundation, Inc.
@@ -52,8 +52,6 @@
 
 #ifndef _LOCORE
 
-#define	CLKF_BASEPRI(frame)	((frame)-pri == 0)
-
 void 	*intr_establish(int, int, int, int (*)(void *), void *);
 void 	intr_disestablish(void *);
 void 	intr_init(void);



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

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:55:31 UTC 2011

Modified Files:
src/sys/dev/sysmon [netbsd-5]: sysmon_envsys_events.c

Log Message:
Pull up following revision(s) (requested by pgoyette in ticket #1505):
sys/dev/sysmon/sysmon_envsys_events.c: revision 1.94
Make this compile when options ENVSYS_OBJECTS_DEBUG is defined.


To generate a diff of this commit:
cvs rdiff -u -r1.58.4.4 -r1.58.4.5 src/sys/dev/sysmon/sysmon_envsys_events.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/sysmon/sysmon_envsys_events.c
diff -u src/sys/dev/sysmon/sysmon_envsys_events.c:1.58.4.4 src/sys/dev/sysmon/sysmon_envsys_events.c:1.58.4.5
--- src/sys/dev/sysmon/sysmon_envsys_events.c:1.58.4.4	Thu Nov 13 00:10:25 2008
+++ src/sys/dev/sysmon/sysmon_envsys_events.c	Fri Jan  7 01:55:31 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: sysmon_envsys_events.c,v 1.58.4.4 2008/11/13 00:10:25 snj Exp $ */
+/* $NetBSD: sysmon_envsys_events.c,v 1.58.4.5 2011/01/07 01:55:31 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.58.4.4 2008/11/13 00:10:25 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_envsys_events.c,v 1.58.4.5 2011/01/07 01:55:31 riz Exp $);
 
 #include sys/param.h
 #include sys/types.h
@@ -627,6 +627,11 @@
 			sysmon_penvsys_event(see-see_pes, sse[i].event);
 
 		see-see_evsent = edata-state;
+		DPRINTFOBJ((%s: (%s) desc=%s sensor=%d state=%d send_ev=%d\n,
+		__func__, see-see_sme-sme_name, edata-desc,
+		edata-sensor, edata-state,
+		(edata-state == ENVSYS_SVALID) ? PENVSYS_EVENT_NORMAL :
+			sse[i].event));
 
 		break;
 



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:55:37 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: userret.h

Log Message:
Deal with the trapframe changes.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.15.40.1 src/sys/arch/powerpc/include/userret.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/powerpc/include/userret.h
diff -u src/sys/arch/powerpc/include/userret.h:1.15 src/sys/arch/powerpc/include/userret.h:1.15.40.1
--- src/sys/arch/powerpc/include/userret.h:1.15	Tue Nov  6 02:52:53 2007
+++ src/sys/arch/powerpc/include/userret.h	Fri Jan  7 01:55:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: userret.h,v 1.15 2007/11/06 02:52:53 simonb Exp $	*/
+/*	$NetBSD: userret.h,v 1.15.40.1 2011/01/07 01:55:37 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -42,7 +42,7 @@
  * trap and syscall.
  */
 static __inline void
-userret(struct lwp *l, struct trapframe *frame)
+userret(struct lwp *l, struct trapframe *tf)
 {
 #if defined(PPC_HAVE_FPU) || defined(ALTIVEC)
 	struct cpu_info * const ci = curcpu();
@@ -51,10 +51,13 @@
 	struct pcb * const pcb = l-l_addr-u_pcb;
 #endif
 
+	KASSERTMSG((tf == trapframe(curlwp)),
+	(tf=%p, trapframe(curlwp)=%p\n, tf, trapframe(curlwp)));
+
 	/* Invoke MI userret code */
 	mi_userret(l);
 
-	frame-srr1 = PSL_USERSRR1;	/* clear SRR1 status bits */
+	tf-tf_srr1 = PSL_USERSRR1;	/* clear SRR1 status bits */
 
 	/*
 	 * If someone stole the fp or vector unit while we were away,
@@ -62,9 +65,9 @@
 	 * we don't own it.
 	 */
 #ifdef PPC_HAVE_FPU
-	if ((frame-srr1  PSL_FP) 
+	if ((tf-tf_srr1  PSL_FP) 
 	(l != ci-ci_fpulwp || pcb-pcb_fpcpu != ci)) {
-		frame-srr1 = ~(PSL_FP|PSL_FE0|PSL_FE1);
+		tf-tf_srr1 = ~(PSL_FP|PSL_FE0|PSL_FE1);
 	}
 #endif
 #ifdef ALTIVEC
@@ -72,12 +75,12 @@
 	 * We need to manually restore PSL_VEC each time we return
 	 * to user mode since PSL_VEC is not preserved in SRR1.
 	 */
-	if (frame-srr1  PSL_VEC) {
+	if (tf-tf_srr1  PSL_VEC) {
 		if (l != ci-ci_veclwp)
-			frame-srr1 = ~PSL_VEC;
+			tf-tf_srr1 = ~PSL_VEC;
 	} else {
 		if (l == ci-ci_veclwp)
-			frame-srr1 |= PSL_VEC;
+			tf-tf_srr1 |= PSL_VEC;
 	}
 
 	/*



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:56:06 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: reg.h

Log Message:
u_int32_t - uint32_t


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.9.134.1 src/sys/arch/powerpc/include/reg.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/powerpc/include/reg.h
diff -u src/sys/arch/powerpc/include/reg.h:1.9 src/sys/arch/powerpc/include/reg.h:1.9.134.1
--- src/sys/arch/powerpc/include/reg.h:1.9	Sat Feb  8 20:03:22 2003
+++ src/sys/arch/powerpc/include/reg.h	Fri Jan  7 01:56:05 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: reg.h,v 1.9 2003/02/08 20:03:22 matt Exp $	*/
+/*	$NetBSD: reg.h,v 1.9.134.1 2011/01/07 01:56:05 matt Exp $	*/
 
 #ifndef _POWERPC_REG_H_
 #define _POWERPC_REG_H_
@@ -63,7 +63,7 @@
 };
 
 struct vreg {/* Vector registers */
-	u_int32_t vreg[32][4];
+	uint32_t vreg[32][4];
 	register_t vrsave;		/* SPR 256 */
 	register_t spare[2];		/* filler */
 	register_t vscr;		/* Vector Status And Control Register */



CVS commit: [netbsd-5] src/doc

2011-01-06 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Jan  7 01:56:17 UTC 2011

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

Log Message:
Tickets 1504, 1505.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.43 -r1.1.2.44 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.43 src/doc/CHANGES-5.2:1.1.2.44
--- src/doc/CHANGES-5.2:1.1.2.43	Fri Jan  7 01:43:55 2011
+++ src/doc/CHANGES-5.2	Fri Jan  7 01:56:17 2011
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-5.2,v 1.1.2.43 2011/01/07 01:43:55 riz Exp $
+# $NetBSD: CHANGES-5.2,v 1.1.2.44 2011/01/07 01:56:17 riz Exp $
 
 A complete list of changes from the NetBSD 5.0 release to the NetBSD 5.1
 release:
@@ -4232,3 +4232,16 @@
 	Make maxpartitions 16 on !i386.
 	[bouyer, ticket #1503]
 
+etc/rc.d/network1.61
+etc/rc.subr	1.86 via patch
+share/man/man5/ifconfig.if.5			1.14
+share/man/man8/rc.subr.8			1.27
+
+	Add a collapse_backslash_newline function to rc.subr. PR#41662.
+	[enami, ticket #1504]
+
+sys/dev/sysmon/sysmon_envsys_events.c		1.94 via patch
+
+	Make this compile when options ENVSYS_OBJECTS_DEBUG is defined.
+	[pgoyette, ticket #1505]
+



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:56:44 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: cpu_counter.h

Log Message:
Add booke support


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.34.1 src/sys/arch/powerpc/include/cpu_counter.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/powerpc/include/cpu_counter.h
diff -u src/sys/arch/powerpc/include/cpu_counter.h:1.6 src/sys/arch/powerpc/include/cpu_counter.h:1.6.34.1
--- src/sys/arch/powerpc/include/cpu_counter.h:1.6	Tue Feb  5 22:31:49 2008
+++ src/sys/arch/powerpc/include/cpu_counter.h	Fri Jan  7 01:56:44 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_counter.h,v 1.6 2008/02/05 22:31:49 garbled Exp $	*/
+/*	$NetBSD: cpu_counter.h,v 1.6.34.1 2011/01/07 01:56:44 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Tsubai Masanari.  All rights reserved.
@@ -36,6 +36,9 @@
 #ifdef _KERNEL
 
 #include powerpc/spr.h
+#ifdef PPC_OEA601
+#include powerpc/oea/spr.h
+#endif
 
 #define cpu_hascounter()	(1)
 #define cpu_counter()		cpu_counter32()
@@ -60,15 +63,21 @@
 	add	%1,%2,%0	\n
 	b		2f		\n
 	1:\n
-#endif /* PPC_OEA601 */
-#ifdef PPC_IBM403
+#elif defined(PPC_IBM403)
 	mftblo	%1		\n
+#elif defined(PPC_BOOKE)
+	mfspr	%1,%3		\n
 #else
 	mftb	%1		\n
 #endif
 	2:\n
-	: =r(scratch), =r(rv), =r(rtcu)
-	: n(MPC601), n(SPR_RTCU_R), n(SPR_RTCL_R));
+		: =r(scratch), =r(rv), =r(rtcu)
+#ifdef PPC_OEA601
+		: n(MPC601), n(SPR_RTCU_R), n(SPR_RTCL_R)
+#elif defined(PPC_BOOKE)
+		: n(SPR_TBL)
+#endif
+	);
 
 	return rv;
 }



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:57:31 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: pcb.h

Log Message:
Extend faultbuf to include msr.  Add a holder for usprg0


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.104.1 src/sys/arch/powerpc/include/pcb.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/powerpc/include/pcb.h
diff -u src/sys/arch/powerpc/include/pcb.h:1.21 src/sys/arch/powerpc/include/pcb.h:1.21.104.1
--- src/sys/arch/powerpc/include/pcb.h:1.21	Sat Dec 24 20:07:28 2005
+++ src/sys/arch/powerpc/include/pcb.h	Fri Jan  7 01:57:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pcb.h,v 1.21 2005/12/24 20:07:28 perry Exp $	*/
+/*	$NetBSD: pcb.h,v 1.21.104.1 2011/01/07 01:57:31 matt Exp $	*/
 
 /*-
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -36,9 +36,13 @@
 #include powerpc/reg.h
 
 struct faultbuf {
-	register_t fb_pc;		/* PC */
 	register_t fb_sp;		/* R1 */
 	register_t fb_r2;		/* R2 (why?) */
+	/*
+	 * These are ordered so that one could use a stmw to save them.
+	 */
+	register_t fb_msr;		/* MSR */
+	register_t fb_pc;		/* PC */
 	register_t fb_cr;		/* CR */
 	register_t fb_fixreg[19];	/* R13-R31 */
 };
@@ -60,6 +64,7 @@
 	vaddr_t pcb_umapsr;	/* the user segment mapped in kernel */
 	struct fpreg pcb_fpu;	/* Floating point processor */
 	struct vreg pcb_vr __attribute__((aligned(16)));
+	register_t pcb_usprg0;	/* User Special-Purpose Register General 0 */
 };
 
 struct md_coredump {



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:58:09 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: types.h

Log Message:
Add PRIx{P,V}{ADDR,SIZE} and PRIxREGISTER


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.32.1 src/sys/arch/powerpc/include/types.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/powerpc/include/types.h
diff -u src/sys/arch/powerpc/include/types.h:1.33 src/sys/arch/powerpc/include/types.h:1.33.32.1
--- src/sys/arch/powerpc/include/types.h:1.33	Thu Jan 31 05:30:00 2008
+++ src/sys/arch/powerpc/include/types.h	Fri Jan  7 01:58:09 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: types.h,v 1.33 2008/01/31 05:30:00 matt Exp $	*/
+/*	$NetBSD: types.h,v 1.33.32.1 2011/01/07 01:58:09 matt Exp $	*/
 
 /*-
  * Copyright (C) 1995 Wolfgang Solfrank.
@@ -42,6 +42,12 @@
 #if defined(_NETBSD_SOURCE)
 typedef	unsigned long	paddr_t, vaddr_t;
 typedef	unsigned long	psize_t, vsize_t;
+#define	PRIxPADDR	lx
+#define	PRIxPSIZE	lx
+#define	PRIuPSIZE	lu
+#define	PRIxVADDR	lx
+#define	PRIxVSIZE	lx
+#define	PRIuVSIZE	lu
 #endif
 
 /*



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:58:43 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: pmap.h

Log Message:
Add booke support.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.82.1 src/sys/arch/powerpc/include/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/powerpc/include/pmap.h
diff -u src/sys/arch/powerpc/include/pmap.h:1.33 src/sys/arch/powerpc/include/pmap.h:1.33.82.1
--- src/sys/arch/powerpc/include/pmap.h:1.33	Sat Aug  5 21:26:49 2006
+++ src/sys/arch/powerpc/include/pmap.h	Fri Jan  7 01:58:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap.h,v 1.33 2006/08/05 21:26:49 sanjayl Exp $	*/
+/*	$NetBSD: pmap.h,v 1.33.82.1 2011/01/07 01:58:43 matt Exp $	*/
 
 #ifdef _KERNEL_OPT
 #include opt_ppcarch.h
@@ -6,6 +6,8 @@
 
 #ifdef PPC_IBM4XX
 #include powerpc/ibm4xx/pmap.h
+#elif defined(PPC_BOOKE)
+#include powerpc/booke/pmap.h
 #elif defined(PPC_OEA) || defined (PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
 #include powerpc/oea/pmap.h
 #else



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include/oea

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:59:02 UTC 2011

Modified Files:
src/sys/arch/powerpc/include/oea [matt-nb5-pq3]: Makefile

Log Message:
Add spr.h


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.1.132.1 src/sys/arch/powerpc/include/oea/Makefile

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/powerpc/include/oea/Makefile
diff -u src/sys/arch/powerpc/include/oea/Makefile:1.1 src/sys/arch/powerpc/include/oea/Makefile:1.1.132.1
--- src/sys/arch/powerpc/include/oea/Makefile:1.1	Mon Feb  3 17:10:05 2003
+++ src/sys/arch/powerpc/include/oea/Makefile	Fri Jan  7 01:59:02 2011
@@ -1,11 +1,11 @@
-#	$NetBSD: Makefile,v 1.1 2003/02/03 17:10:05 matt Exp $
+#	$NetBSD: Makefile,v 1.1.132.1 2011/01/07 01:59:02 matt Exp $
 
 INCSDIR= /usr/include/powerpc/oea
 
 INCS=	bat.h \
 	hid.h hid_601.h \
 	pmap.h pte.h \
-	sr_601.h \
+	spr.h sr_601.h \
 	vmparam.h
 
 .include bsd.kinc.mk



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/include

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 01:59:40 UTC 2011

Modified Files:
src/sys/arch/powerpc/include [matt-nb5-pq3]: cpu.h db_machdep.h psl.h

Log Message:
Add booke support.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.65.22.1 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.19 -r1.19.88.1 src/sys/arch/powerpc/include/db_machdep.h
cvs rdiff -u -r1.14 -r1.14.86.1 src/sys/arch/powerpc/include/psl.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/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.65 src/sys/arch/powerpc/include/cpu.h:1.65.22.1
--- src/sys/arch/powerpc/include/cpu.h:1.65	Wed Apr 30 23:21:29 2008
+++ src/sys/arch/powerpc/include/cpu.h	Fri Jan  7 01:59:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.65 2008/04/30 23:21:29 macallan Exp $	*/
+/*	$NetBSD: cpu.h,v 1.65.22.1 2011/01/07 01:59:40 matt Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -59,6 +59,7 @@
 struct cpu_info {
 	struct cpu_data ci_data;	/* MI per-cpu data */
 	struct device *ci_dev;		/* device of corresponding cpu */
+	struct cpu_softc *ci_softc;	/* private cpu info */
 	struct lwp *ci_curlwp;		/* current owner of the processor */
 
 	struct pcb *ci_curpcb;
@@ -69,16 +70,21 @@
 
 	volatile int ci_astpending;
 	int ci_want_resched;
+	volatile uint64_t ci_lastintr;
 	volatile u_long ci_lasttb;
 	volatile int ci_tickspending;
 	volatile int ci_cpl;
 	volatile int ci_iactive;
 	volatile int ci_idepth;
+#ifndef PPC_BOOKE
 	volatile int ci_ipending;
-	int ci_intrdepth;
+#endif
 	int ci_mtx_oldspl;
 	int ci_mtx_count;
+#ifndef PPC_BOOKE
 	char *ci_intstk;
+#endif
+#ifndef PPC_BOOKE
 #define	CPUSAVE_LEN	8
 	register_t ci_tempsave[CPUSAVE_LEN];
 	register_t ci_ddbsave[CPUSAVE_LEN];
@@ -87,21 +93,37 @@
 #define	CPUSAVE_R29	1		/* where r29 gets saved */
 #define	CPUSAVE_R30	2		/* where r30 gets saved */
 #define	CPUSAVE_R31	3		/* where r31 gets saved */
+#if defined(PPC_IBM4XX)
+#define	CPUSAVE_DEAR	4		/* where SPR_DAR gets saved */
+#define	CPUSAVE_ESR	5		/* where SPR_DSISR gets saved */
+	register_t ci_tlbmisssave[CPUSAVE_LEN];
+#else
 #define	CPUSAVE_DAR	4		/* where SPR_DAR gets saved */
 #define	CPUSAVE_DSISR	5		/* where SPR_DSISR gets saved */
-#define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
-#define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
 #define	DISISAVE_LEN	4
 	register_t ci_disisave[DISISAVE_LEN];
+#endif
+#define	CPUSAVE_SRR0	6		/* where SRR0 gets saved */
+#define	CPUSAVE_SRR1	7		/* where SRR1 gets saved */
+#else
+#define	CPUSAVE_LEN	128
+	register_t ci_savelifo[CPUSAVE_LEN];
+	struct pmap_segtab *ci_pmap_segtabs[2];
+#define	ci_pmap_kern_segtab	ci_pmap_segtabs[0]
+#define	ci_pmap_user_segtab	ci_pmap_segtabs[1]
+	struct pmap_tlb_info *ci_tlb_info;
+#endif
 	struct cache_info ci_ci;		
 	void *ci_sysmon_cookie;
 	void (*ci_idlespin)(void);
 	uint32_t ci_khz;
 	struct evcnt ci_ev_clock;	/* clock intrs */
 	struct evcnt ci_ev_statclock; 	/* stat clock */
+#ifndef PPC_BOOKE
 	struct evcnt ci_ev_softclock;	/* softclock intrs */
 	struct evcnt ci_ev_softnet;	/* softnet intrs */
 	struct evcnt ci_ev_softserial;	/* softserial intrs */
+#endif
 	struct evcnt ci_ev_traps;	/* calls to trap() */
 	struct evcnt ci_ev_kdsi;	/* kernel DSI traps */
 	struct evcnt ci_ev_udsi;	/* user DSI traps */
@@ -119,6 +141,9 @@
 	struct evcnt ci_ev_vecsw;	/* Altivec context switches */
 	struct evcnt ci_ev_umchk;	/* user MCHK events */
 	struct evcnt ci_ev_ipi;		/* IPIs received */
+	struct evcnt ci_ev_tlbmiss_soft; /* tlb miss (no trap) */
+	struct evcnt ci_ev_dtlbmiss_hard; /* data tlb miss (trap) */
+	struct evcnt ci_ev_itlbmiss_hard; /* instruction tlb miss (trap) */
 };
 
 #ifdef MULTIPROCESSOR
@@ -190,7 +215,8 @@
 static __inline void
 mtmsr(register_t msr)
 {
-
+	//KASSERT(msr  PSL_CE);
+	//KASSERT(msr  PSL_DE);
 	__asm volatile (mtmsr %0 : : r(msr));
 }
 
@@ -202,6 +228,8 @@
 	__asm volatile (
 #ifdef PPC_IBM403
 	mftblo %0	\n
+#elif defined(PPC_BOOKE)
+	mfspr %0,268	\n
 #else
 	mftbl %0	\n
 #endif
@@ -225,6 +253,10 @@
 1:	mftbhi %0	\n
 	mftblo %0+1	\n
 	mftbhi %1	\n
+#elif defined(PPC_BOOKE)
+1:	mfspr %0,269	\n
+	mfspr %0+1,268	\n
+	mfspr %1,269	\n
 #else
 1:	mftbu %0	\n
 	mftb %0+1	\n
@@ -297,16 +329,15 @@
 })
 #endif /* PPC_IBM4XX || PPC_IBM403 */
 
-#define	CLKF_USERMODE(frame)	(((frame)-srr1  PSL_PR) != 0)
-#define	CLKF_PC(frame)		((frame)-srr0)
-#define	CLKF_INTR(frame)	((frame)-depth  0)
+#define	CLKF_USERMODE(frame)	(((frame)-cf_srr1  PSL_PR) != 0)
+#define	CLKF_PC(frame)		((frame)-cf_srr0)
+#define	CLKF_INTR(frame)	((frame)-cf_idepth = 0)
+#define	LWP_PC(l)		(trapframe(l)-tf_srr0)
 
-#define	LWP_PC(l)		(trapframe(l)-srr0)
 
 #define	cpu_swapin(p)
 #define	cpu_swapout(p)
 #define	cpu_proc_fork(p1, p2)
-#define	cpu_idle()		(curcpu()-ci_idlespin())
 #define cpu_lwp_free2(l)
 
 extern int powersave;
@@ -314,15 +345,28 @@
 extern int 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:00:22 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: bus_dma.c bus_space.c

Log Message:
Add booke support.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.33.20.1 src/sys/arch/powerpc/powerpc/bus_dma.c
cvs rdiff -u -r1.20 -r1.20.24.1 src/sys/arch/powerpc/powerpc/bus_space.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/powerpc/powerpc/bus_dma.c
diff -u src/sys/arch/powerpc/powerpc/bus_dma.c:1.33 src/sys/arch/powerpc/powerpc/bus_dma.c:1.33.20.1
--- src/sys/arch/powerpc/powerpc/bus_dma.c:1.33	Wed Jun  4 12:41:41 2008
+++ src/sys/arch/powerpc/powerpc/bus_dma.c	Fri Jan  7 02:00:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_dma.c,v 1.33 2008/06/04 12:41:41 ad Exp $	*/
+/*	$NetBSD: bus_dma.c,v 1.33.20.1 2011/01/07 02:00:21 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -30,8 +30,9 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#define _POWERPC_BUS_DMA_PRIVATE
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.33 2008/06/04 12:41:41 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_dma.c,v 1.33.20.1 2011/01/07 02:00:21 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -43,10 +44,17 @@
 
 #include uvm/uvm_extern.h
 
-#define _POWERPC_BUS_DMA_PRIVATE
 #include machine/bus.h
 #include machine/intr.h
 
+#if defined(PPC_BOOKE)
+#define	EIEIO	__asm volatile(mbar\t0)
+#define	SYNC	__asm volatile(msync)
+#else
+#define	EIEIO	__asm volatile(eieio)
+#define	SYNC	__asm volatile(sync)
+#endif
+
 int	_bus_dmamap_load_buffer (bus_dma_tag_t, bus_dmamap_t, void *,
 	bus_size_t, struct vmspace *, int, paddr_t *, int *, int);
 
@@ -162,6 +170,9 @@
 	vaddr_t vaddr = (vaddr_t)buf;
 	int seg;
 
+//	printf(%s(%p,%p,%p,%u,%p,%#x,%p,%p,%u)\n, __func__,
+//	t, map, buf, buflen, vm, flags, lastaddrp, segp, first);
+
 	lastaddr = *lastaddrp;
 	bmask = ~(map-_dm_boundary - 1);
 
@@ -460,13 +471,16 @@
 	const int dcache_line_size = curcpu()-ci_ci.dcache_line_size;
 	const bus_dma_segment_t *ds = map-dm_segs;
 
+//	printf(%s(%p,%p,%#x,%u,%#x) from %p\n, __func__,
+//	t, map, offset, len, ops, __builtin_return_address(0));
+
 	if ((ops  (BUS_DMASYNC_PREREAD|BUS_DMASYNC_PREWRITE)) != 0 
 	(ops  (BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE)) != 0)
 		panic(_bus_dmamap_sync: invalid ops %#x, ops);
 
 #ifdef DIAGNOSTIC
 	if (offset + len  map-dm_mapsize)
-		panic(_bus_dmamap_sync: bad offset and/or length);
+		panic(%s: ops %#x mapsize %u: bad offset (%u) and/or length (%u), __func__, ops, map-dm_mapsize, offset, len);
 #endif
 
 	/*
@@ -476,7 +490,7 @@
 		offset -= ds-ds_len;
 		ds++;
 	}
-	__asm volatile(eieio);
+	EIEIO;
 	for (; len  0; ds++, offset = 0) {
 		bus_size_t seglen = ds-ds_len - offset;
 		bus_addr_t addr = BUS_MEM_TO_PHYS(t, ds-ds_addr) + offset;
@@ -536,7 +550,8 @@
  */
 seglen = ~(dcache_line_size - 1);
 			}
-			__asm volatile(sync; eieio); /* is this needed? */
+			SYNC;			/* is this needed? */
+			EIEIO;			/* is this needed? */
 			/* FALLTHROUGH */
 		case BUS_DMASYNC_POSTREAD|BUS_DMASYNC_POSTWRITE:
 		case BUS_DMASYNC_POSTREAD:
@@ -579,18 +594,18 @@
 	int *rsegs;
 	int flags;
 {
-	paddr_t avail_start = 0x, avail_end = 0;
+	paddr_t start = 0x, end = 0;
 	int bank;
 
 	for (bank = 0; bank  vm_nphysseg; bank++) {
-		if (avail_start  vm_physmem[bank].avail_start  PGSHIFT)
-			avail_start = vm_physmem[bank].avail_start  PGSHIFT;
-		if (avail_end  vm_physmem[bank].avail_end  PGSHIFT)
-			avail_end = vm_physmem[bank].avail_end  PGSHIFT;
+		if (start  vm_physmem[bank].avail_start  PGSHIFT)
+			start = vm_physmem[bank].avail_start  PGSHIFT;
+		if (end  vm_physmem[bank].avail_end  PGSHIFT)
+			end = vm_physmem[bank].avail_end  PGSHIFT;
 	}
 
 	return _bus_dmamem_alloc_range(t, size, alignment, boundary, segs,
-	nsegs, rsegs, flags, avail_start, avail_end - PAGE_SIZE);
+	nsegs, rsegs, flags, start, end - PAGE_SIZE);
 }
 
 /*
@@ -670,7 +685,7 @@
 			pmap_kenter_pa(va, addr,
 			VM_PROT_READ | VM_PROT_WRITE |
 			PMAP_WIRED |
-			((flags  BUS_DMA_NOCACHE) ? PMAP_NC : 0));
+			((flags  BUS_DMA_NOCACHE) ? PMAP_NOCACHE : 0));
 		}
 	}
 

Index: src/sys/arch/powerpc/powerpc/bus_space.c
diff -u src/sys/arch/powerpc/powerpc/bus_space.c:1.20 src/sys/arch/powerpc/powerpc/bus_space.c:1.20.24.1
--- src/sys/arch/powerpc/powerpc/bus_space.c:1.20	Mon Apr 28 20:23:32 2008
+++ src/sys/arch/powerpc/powerpc/bus_space.c	Fri Jan  7 02:00:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.20 2008/04/28 20:23:32 martin Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.20.24.1 2011/01/07 02:00:21 matt Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.20 2008/04/28 20:23:32 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:01:21 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: clock.c db_interface.c
db_trace.c

Log Message:
Add booke support


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.6.34.1 src/sys/arch/powerpc/powerpc/clock.c
cvs rdiff -u -r1.39 -r1.39.42.1 src/sys/arch/powerpc/powerpc/db_interface.c
cvs rdiff -u -r1.48 -r1.48.18.1 src/sys/arch/powerpc/powerpc/db_trace.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/powerpc/powerpc/clock.c
diff -u src/sys/arch/powerpc/powerpc/clock.c:1.6 src/sys/arch/powerpc/powerpc/clock.c:1.6.34.1
--- src/sys/arch/powerpc/powerpc/clock.c:1.6	Tue Feb  5 22:31:50 2008
+++ src/sys/arch/powerpc/powerpc/clock.c	Fri Jan  7 02:01:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: clock.c,v 1.6 2008/02/05 22:31:50 garbled Exp $	*/
+/*	$NetBSD: clock.c,v 1.6.34.1 2011/01/07 02:01:21 matt Exp $	*/
 /*  $OpenBSD: clock.c,v 1.3 1997/10/13 13:42:53 pefo Exp $	*/
 
 /*
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.6 2008/02/05 22:31:50 garbled Exp $);
+__KERNEL_RCSID(0, $NetBSD: clock.c,v 1.6.34.1 2011/01/07 02:01:21 matt Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -44,6 +44,15 @@
 #include uvm/uvm_extern.h
 
 #include powerpc/spr.h
+#if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
+#include powerpc/oea/spr.h
+#elif defined (PPC_BOOKE)
+#include powerpc/booke/spr.h
+#elif defined (PPC_IBM4XX)
+#include powerpc/ibm4xx/spr.h
+#else
+#error unknown powerpc variant
+#endif
 
 void decr_intr(struct clockframe *);
 void init_powerpc_tc(void);
@@ -106,7 +115,7 @@
 }
 
 void
-decr_intr(struct clockframe *frame)
+decr_intr(struct clockframe *cfp)
 {
 	struct cpu_info * const ci = curcpu();
 	int msr;
@@ -162,11 +171,9 @@
 		 * Do standard timer interrupt stuff.
 		 * Do softclock stuff only on the last iteration.
 		 */
-		frame-pri = pri | (1  SIR_CLOCK);
 		while (--nticks  0)
-			hardclock(frame);
-		frame-pri = pri;
-		hardclock(frame);
+			hardclock(cfp);
+		hardclock(cfp);
 	}
 	splx(pri);
 }

Index: src/sys/arch/powerpc/powerpc/db_interface.c
diff -u src/sys/arch/powerpc/powerpc/db_interface.c:1.39 src/sys/arch/powerpc/powerpc/db_interface.c:1.39.42.1
--- src/sys/arch/powerpc/powerpc/db_interface.c:1.39	Wed Oct 17 19:56:47 2007
+++ src/sys/arch/powerpc/powerpc/db_interface.c	Fri Jan  7 02:01:21 2011
@@ -1,8 +1,8 @@
-/*	$NetBSD: db_interface.c,v 1.39 2007/10/17 19:56:47 garbled Exp $ */
+/*	$NetBSD: db_interface.c,v 1.39.42.1 2011/01/07 02:01:21 matt Exp $ */
 /*	$OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $	*/
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.39 2007/10/17 19:56:47 garbled Exp $);
+__KERNEL_RCSID(0, $NetBSD: db_interface.c,v 1.39.42.1 2011/01/07 02:01:21 matt Exp $);
 
 #define USERACC
 
@@ -18,12 +18,26 @@
 
 #include machine/db_machdep.h
 #include machine/frame.h
+#include powerpc/spr.h
+#include powerpc/cpu.h
+#include powerpc/bat.h
+#include powerpc/pte.h
+
+#if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
+#include powerpc/oea/spr.h
+#endif
+
 #ifdef PPC_IBM4XX
+#include powerpc/ibm4xx/spr.h
 #include machine/tlb.h
-#include powerpc/spr.h
 #include uvm/uvm_extern.h
 #endif
 
+#ifdef PPC_BOOKE
+#include powerpc/booke/cpuvar.h
+#include powerpc/booke/spr.h
+#endif
+
 #ifdef DDB
 #include ddb/db_sym.h
 #include ddb/db_command.h
@@ -47,6 +61,11 @@
 
 void ddb_trap(void);/* Call into trap_subr.S */
 int ddb_trap_glue(struct trapframe *);		/* Called from trap_subr.S */
+static void db_ppc_msr(db_expr_t, bool, db_expr_t, const char *);
+#if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
+static void db_show_bat(db_expr_t, bool, db_expr_t, const char *);
+static void db_show_mmu(db_expr_t, bool, db_expr_t, const char *);
+#endif /* PPC_OEA || PPC_OEA64 || PPC_OEA64_BRIDGE */
 #ifdef PPC_IBM4XX
 static void db_ppc4xx_ctx(db_expr_t, bool, db_expr_t, const char *);
 static void db_ppc4xx_pv(db_expr_t, bool, db_expr_t, const char *);
@@ -61,32 +80,78 @@
 #endif
 #endif /* PPC_IBM4XX */
 
+#ifdef PPC_BOOKE
+static void db_ppcbooke_reset(db_expr_t, bool, db_expr_t, const char *);
+static void db_ppcbooke_tf(db_expr_t, bool, db_expr_t, const char *);
+static void db_ppcbooke_dumptlb(db_expr_t, bool, db_expr_t, const char *);
+#endif
+
 #ifdef DDB
+const struct db_command db_machine_command_table[] = {
+	{ DDB_ADD_CMD(msr,	db_ppc_msr,		0,	NULL,NULL,NULL) },
+#if defined (PPC_OEA) || defined(PPC_OEA64) || defined (PPC_OEA64_BRIDGE)
+	{ DDB_ADD_CMD(bat,	db_show_bat,		0,
+	  Print BAT register translations, NULL,NULL) },
+	{ DDB_ADD_CMD(mmu,	db_show_mmu,		0,
+	  Print MMU registers, NULL,NULL) },
+#endif /* PPC_OEA || PPC_OEA64 || PPC_OEA64_BRIDGE */
+#ifdef PPC_IBM4XX
+	{ DDB_ADD_CMD(ctx,	db_ppc4xx_ctx,		0,	

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:01:57 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: compat_13_machdep.c
compat_16_machdep.c sig_machdep.c

Log Message:
Adapt to new trapframe.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.20.1 \
src/sys/arch/powerpc/powerpc/compat_13_machdep.c
cvs rdiff -u -r1.11 -r1.11.20.1 \
src/sys/arch/powerpc/powerpc/compat_16_machdep.c
cvs rdiff -u -r1.32 -r1.32.20.1 src/sys/arch/powerpc/powerpc/sig_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/powerpc/powerpc/compat_13_machdep.c
diff -u src/sys/arch/powerpc/powerpc/compat_13_machdep.c:1.14 src/sys/arch/powerpc/powerpc/compat_13_machdep.c:1.14.20.1
--- src/sys/arch/powerpc/powerpc/compat_13_machdep.c:1.14	Thu Apr 24 18:39:21 2008
+++ src/sys/arch/powerpc/powerpc/compat_13_machdep.c	Fri Jan  7 02:01:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_13_machdep.c,v 1.14 2008/04/24 18:39:21 ad Exp $	*/
+/*	$NetBSD: compat_13_machdep.c,v 1.14.20.1 2011/01/07 02:01:57 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: compat_13_machdep.c,v 1.14 2008/04/24 18:39:21 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: compat_13_machdep.c,v 1.14.20.1 2011/01/07 02:01:57 matt Exp $);
 
 #include opt_ppcarch.h
 
@@ -74,16 +74,16 @@
 		return (EINVAL);
 
 	/* Restore register context. */
-	memcpy(tf-fixreg, sc.sc_frame.fixreg, sizeof(tf-fixreg));
-	tf-lr   = sc.sc_frame.lr;
-	tf-cr   = sc.sc_frame.cr;
-	tf-xer  = sc.sc_frame.xer;
-	tf-ctr  = sc.sc_frame.ctr;
-	tf-srr0 = sc.sc_frame.srr0;
-	tf-srr1 = sc.sc_frame.srr1;
+	memcpy(tf-tf_fixreg, sc.sc_frame.fixreg, sizeof(tf-tf_fixreg));
+	tf-tf_lr   = sc.sc_frame.lr;
+	tf-tf_cr   = sc.sc_frame.cr;
+	tf-tf_xer  = sc.sc_frame.xer;
+	tf-tf_ctr  = sc.sc_frame.ctr;
+	tf-tf_srr0 = sc.sc_frame.srr0;
+	tf-tf_srr1 = sc.sc_frame.srr1;
 #ifdef PPC_OEA
-	tf-tf_xtra[TF_VRSAVE] = sc.sc_frame.vrsave;
-	tf-tf_xtra[TF_MQ] = sc.sc_frame.mq;
+	tf-tf_vrsave = sc.sc_frame.vrsave;
+	tf-tf_mq = sc.sc_frame.mq;
 #endif
 
 	mutex_enter(p-p_lock);

Index: src/sys/arch/powerpc/powerpc/compat_16_machdep.c
diff -u src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.11 src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.11.20.1
--- src/sys/arch/powerpc/powerpc/compat_16_machdep.c:1.11	Thu Apr 24 18:39:21 2008
+++ src/sys/arch/powerpc/powerpc/compat_16_machdep.c	Fri Jan  7 02:01:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_machdep.c,v 1.11 2008/04/24 18:39:21 ad Exp $	*/
+/*	$NetBSD: compat_16_machdep.c,v 1.11.20.1 2011/01/07 02:01:57 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: compat_16_machdep.c,v 1.11 2008/04/24 18:39:21 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: compat_16_machdep.c,v 1.11.20.1 2011/01/07 02:01:57 matt Exp $);
 
 #include opt_compat_netbsd.h
 #include opt_altivec.h
@@ -78,17 +78,18 @@
 		fp = (struct sigcontext *)((char *)l-l_sigstk.ss_sp +
 		l-l_sigstk.ss_size);
 	else
-		fp = (struct sigcontext *)tf-fixreg[1];
+		fp = (struct sigcontext *)tf-tf_fixreg[1];
 	fp = (struct sigcontext *)((uintptr_t)(fp - 1)  ~0xf);
 
 	/* Save register context. */
-	memcpy(utf-fixreg, tf-fixreg, sizeof(utf-fixreg));
-	utf-lr   = tf-lr;
-	utf-cr   = tf-cr;
-	utf-xer  = tf-xer;
-	utf-ctr  = tf-ctr;
-	utf-srr0 = tf-srr0;
-	utf-srr1 = tf-srr1  PSL_USERSRR1;
+	memcpy(utf-fixreg, tf-tf_fixreg, sizeof(utf-fixreg));
+	utf-lr   = tf-tf_lr;
+	utf-cr   = tf-tf_cr;
+	utf-xer  = tf-tf_xer;
+	utf-ctr  = tf-tf_ctr;
+	utf-srr0 = tf-tf_srr0;
+	utf-srr1 = tf-tf_srr1  PSL_USERSRR1;
+
 #ifdef PPC_HAVE_FPU
 	utf-srr1 |= l-l_addr-u_pcb.pcb_flags  (PCB_FE0|PCB_FE1);
 #endif
@@ -96,8 +97,8 @@
 	utf-srr1 |= l-l_addr-u_pcb.pcb_flags  PCB_ALTIVEC ? PSL_VEC : 0;
 #endif
 #ifdef PPC_OEA
-	utf-vrsave = tf-tf_xtra[TF_VRSAVE];
-	utf-mq = tf-tf_xtra[TF_MQ];
+	utf-vrsave = tf-tf_vrsave;
+	utf-mq = tf-tf_mq;
 #endif
 
 	/* Save signal stack. */
@@ -136,22 +137,22 @@
 	switch (ps-sa_sigdesc[sig].sd_vers) {
 #if 1 /* COMPAT_16 */
 	case 0:		/* legacy on-stack sigtramp */
-		tf-fixreg[1] = (register_t)fp;
-		tf-lr = (register_t)catcher;
-		tf-fixreg[3] = (register_t)sig;
-		tf-fixreg[4] = (register_t)code;
-		tf-fixreg[5] = (register_t)fp;
-		tf-srr0 = (register_t)p-p_sigctx.ps_sigcode;
+		tf-tf_fixreg[1] = (register_t)fp;
+		tf-tf_lr = (register_t)catcher;
+		tf-tf_fixreg[3] = (register_t)sig;
+		tf-tf_fixreg[4] = (register_t)code;
+		tf-tf_fixreg[5] = (register_t)fp;
+		tf-tf_srr0 = (register_t)p-p_sigctx.ps_sigcode;
 		break;
 #endif /* COMPAT_16 */
 
 	case 1:
-		tf-fixreg[1] = (register_t)fp;
-		tf-lr = (register_t)catcher;
-		tf-fixreg[3] = (register_t)sig;
-		tf-fixreg[4] = (register_t)code;
-		tf-fixreg[5] = (register_t)fp;
-		tf-srr0 = 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:03:51 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: fpu.c ipkdb_glue.c
kgdb_machdep.c powerpc_machdep.c process_machdep.c syscall.c
vm_machdep.c

Log Message:
Deal with trapframe changes and booke changes.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.21.26.1 src/sys/arch/powerpc/powerpc/fpu.c
cvs rdiff -u -r1.9 -r1.9.70.1 src/sys/arch/powerpc/powerpc/ipkdb_glue.c
cvs rdiff -u -r1.20 -r1.20.30.1 src/sys/arch/powerpc/powerpc/kgdb_machdep.c
cvs rdiff -u -r1.39 -r1.39.16.1 \
src/sys/arch/powerpc/powerpc/powerpc_machdep.c
cvs rdiff -u -r1.26 -r1.26.42.1 \
src/sys/arch/powerpc/powerpc/process_machdep.c
cvs rdiff -u -r1.43 -r1.43.16.1 src/sys/arch/powerpc/powerpc/syscall.c
cvs rdiff -u -r1.74.4.1 -r1.74.4.1.4.1 \
src/sys/arch/powerpc/powerpc/vm_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/powerpc/powerpc/fpu.c
diff -u src/sys/arch/powerpc/powerpc/fpu.c:1.21 src/sys/arch/powerpc/powerpc/fpu.c:1.21.26.1
--- src/sys/arch/powerpc/powerpc/fpu.c:1.21	Tue Apr  8 02:33:03 2008
+++ src/sys/arch/powerpc/powerpc/fpu.c	Fri Jan  7 02:03:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu.c,v 1.21 2008/04/08 02:33:03 garbled Exp $	*/
+/*	$NetBSD: fpu.c,v 1.21.26.1 2011/01/07 02:03:51 matt Exp $	*/
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.21 2008/04/08 02:33:03 garbled Exp $);
+__KERNEL_RCSID(0, $NetBSD: fpu.c,v 1.21.26.1 2011/01/07 02:03:51 matt Exp $);
 
 #include opt_multiprocessor.h
 
@@ -69,7 +69,7 @@
 	 * If we own the CPU but FP is disabled, simply enable it and return.
 	 */
 	if (ci-ci_fpulwp == l) {
-		tf-srr1 |= PSL_FP | (pcb-pcb_flags  (PCB_FE0|PCB_FE1));
+		tf-tf_srr1 |= PSL_FP | (pcb-pcb_flags  (PCB_FE0|PCB_FE1));
 		return;
 	}
 	msr = mfmsr();
@@ -118,7 +118,7 @@
 		lfd	31,248(%0)\n
 	:: b(pcb-pcb_fpu.fpreg[0]));
 	__asm volatile (isync);
-	tf-srr1 |= PSL_FP | (pcb-pcb_flags  (PCB_FE0|PCB_FE1));
+	tf-tf_srr1 |= PSL_FP | (pcb-pcb_flags  (PCB_FE0|PCB_FE1));
 	ci-ci_fpulwp = l;
 	pcb-pcb_fpcpu = ci;
 	pcb-pcb_flags |= PCB_OWNFPU;

Index: src/sys/arch/powerpc/powerpc/ipkdb_glue.c
diff -u src/sys/arch/powerpc/powerpc/ipkdb_glue.c:1.9 src/sys/arch/powerpc/powerpc/ipkdb_glue.c:1.9.70.1
--- src/sys/arch/powerpc/powerpc/ipkdb_glue.c:1.9	Wed Jan 24 13:08:14 2007
+++ src/sys/arch/powerpc/powerpc/ipkdb_glue.c	Fri Jan  7 02:03:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipkdb_glue.c,v 1.9 2007/01/24 13:08:14 hubertf Exp $	*/
+/*	$NetBSD: ipkdb_glue.c,v 1.9.70.1 2011/01/07 02:03:51 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ipkdb_glue.c,v 1.9 2007/01/24 13:08:14 hubertf Exp $);
+__KERNEL_RCSID(0, $NetBSD: ipkdb_glue.c,v 1.9.70.1 2011/01/07 02:03:51 matt Exp $);
 
 #include sys/param.h
 
@@ -67,25 +67,25 @@
 }
 
 int
-ipkdb_trap_glue(struct trapframe *frame)
+ipkdb_trap_glue(struct trapframe *tf)
 {
-	if (!(frame-srr1  PSL_PR)
-	 (frame-exc == EXC_TRC
-		|| (frame-exc == EXC_PGM
-		 (frame-srr1  0x2))
-		|| frame-exc == EXC_BPT)) {
+	if (!(tf-tf_srr1  PSL_PR)
+	 (tf-tf_exc == EXC_TRC
+		|| (tf-tf_exc == EXC_PGM
+		 (tf-tf_srr1  0x2))
+		|| tf-tf_exc == EXC_BPT)) {
 #ifdef	IPKDBUSERHACK
 		/* XXX see above */
 		__asm (mfsr %0,%1 : =r(savesr) : n(USER_SR));
 #endif
 		ipkdbzero(ipkdbregs, sizeof ipkdbregs);
-		ipkdbcopy(frame-fixreg, ipkdbregs[FIX], NFIX * sizeof(int));
-		ipkdbregs[PC] = frame-srr0;
-		ipkdbregs[PS] = frame-srr1  ~PSL_BE;
-		ipkdbregs[CR] = frame-cr;
-		ipkdbregs[LR] = frame-lr;
-		ipkdbregs[CTR] = frame-ctr;
-		ipkdbregs[XER] = frame-xer;
+		ipkdbcopy(tf-tf_fixreg, ipkdbregs[FIX], NFIX * sizeof(int));
+		ipkdbregs[PC] = tf-tf_srr0;
+		ipkdbregs[PS] = tf-tf_srr1  ~PSL_BE;
+		ipkdbregs[CR] = tf-tf_cr;
+		ipkdbregs[LR] = tf-tf_lr;
+		ipkdbregs[CTR] = tf-tf_ctr;
+		ipkdbregs[XER] = tf-tf_xer;
 
 		switch (ipkdbcmds()) {
 		case 2:
@@ -96,13 +96,13 @@
 			ipkdbregs[PS] |= PSL_SE;
 			break;
 		}
-		ipkdbcopy(ipkdbregs[FIX], frame-fixreg, NFIX * sizeof(int));
-		frame-srr0 = ipkdbregs[PC];
-		frame-srr1 = ipkdbregs[PS];
-		frame-cr = ipkdbregs[CR];
-		frame-lr = ipkdbregs[LR];
-		frame-ctr = ipkdbregs[CTR];
-		frame-xer = ipkdbregs[XER];
+		ipkdbcopy(ipkdbregs[FIX], tf-tf_fixreg, NFIX * sizeof(int));
+		tf-tf_srr0 = ipkdbregs[PC];
+		tf-tf_srr1 = ipkdbregs[PS];
+		tf-tf_cr = ipkdbregs[CR];
+		tf-tf_lr = ipkdbregs[LR];
+		tf-tf_ctr = ipkdbregs[CTR];
+		tf-tf_xer = ipkdbregs[XER];
 #ifdef	IPKDBUSERHACK
 		__asm (mtsr %0,%1; isync :: n(USER_SR), r(savesr));
 #endif

Index: src/sys/arch/powerpc/powerpc/kgdb_machdep.c
diff -u src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.20 src/sys/arch/powerpc/powerpc/kgdb_machdep.c:1.20.30.1
--- 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:04:32 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: mach_machdep.c

Log Message:
More trapframe changes.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.26.16.1 src/sys/arch/powerpc/powerpc/mach_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/powerpc/powerpc/mach_machdep.c
diff -u src/sys/arch/powerpc/powerpc/mach_machdep.c:1.26 src/sys/arch/powerpc/powerpc/mach_machdep.c:1.26.16.1
--- src/sys/arch/powerpc/powerpc/mach_machdep.c:1.26	Wed Oct 15 06:51:18 2008
+++ src/sys/arch/powerpc/powerpc/mach_machdep.c	Fri Jan  7 02:04:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mach_machdep.c,v 1.26 2008/10/15 06:51:18 wrstuden Exp $ */
+/*	$NetBSD: mach_machdep.c,v 1.26.16.1 2011/01/07 02:04:32 matt Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mach_machdep.c,v 1.26 2008/10/15 06:51:18 wrstuden Exp $);
+__KERNEL_RCSID(0, $NetBSD: mach_machdep.c,v 1.26.16.1 2011/01/07 02:04:32 matt Exp $);
 
 #include opt_ppcarch.h
 #include sys/param.h
@@ -118,16 +118,16 @@
 	upcallret(l);
 
 	/* Set requested register context */
-	tf-srr0 = regs-srr0;
-	tf-srr1 = regs-srr1;
-	memcpy(tf-fixreg, regs-r0, 32 * sizeof(register_t));
-	tf-cr = regs-cr;
-	tf-xer = regs-xer;
-	tf-lr = regs-lr;
-	tf-ctr = regs-ctr;
+	tf-tf_srr0 = regs-srr0;
+	tf-tf_srr1 = regs-srr1;
+	memcpy(tf-tf_fixreg, regs-r0, 32 * sizeof(register_t));
+	tf-tf_cr = regs-cr;
+	tf-tf_xer = regs-xer;
+	tf-tf_lr = regs-lr;
+	tf-tf_ctr = regs-ctr;
 #ifdef PPC_OEA
-	tf-tf_xtra[TF_MQ] = regs-mq;
-	tf-tf_xtra[TF_VRSAVE] = regs-vrsave;
+	tf-tf_tf_mq = regs-mq;
+	tf-tf_tf_vrsave = regs-vrsave;
 #endif
 
 	/* Wakeup the parent */
@@ -156,13 +156,13 @@
 		struct mach_ppc_thread_state *mpts;
 
 		mpts = (struct mach_ppc_thread_state *)state;
-		mpts-srr0 = tf-srr0;
-		mpts-srr1 = tf-srr1  PSL_USERSRR1;
-		memcpy(mpts-gpreg, tf-fixreg, 32 * sizeof(register_t));
-		mpts-cr = tf-cr;
-		mpts-xer = tf-xer;
-		mpts-lr = tf-lr;
-		mpts-ctr = tf-ctr;
+		mpts-srr0 = tf-tf_srr0;
+		mpts-srr1 = tf-tf_srr1  PSL_USERSRR1;
+		memcpy(mpts-gpreg, tf-tf_fixreg, 32 * sizeof(register_t));
+		mpts-cr = tf-tf_cr;
+		mpts-xer = tf-tf_xer;
+		mpts-lr = tf-tf_lr;
+		mpts-ctr = tf-tf_ctr;
 		mpts-mq = 0; /* XXX */
 		mpts-vrsave = 0; /* XXX */
 
@@ -201,13 +201,13 @@
 		struct mach_ppc_thread_state *mpts;
 
 		mpts = (struct mach_ppc_thread_state *)state;
-		tf-srr0 = mpts-srr0;
-		tf-srr1 = mpts-srr1;
-		memcpy(tf-fixreg, mpts-gpreg, 32 * sizeof(register_t));
-		tf-cr = mpts-cr;
-		tf-xer = mpts-xer;
-		tf-lr = mpts-lr;
-		tf-ctr = mpts-ctr;
+		tf-tf_srr0 = mpts-srr0;
+		tf-tf_srr1 = mpts-srr1;
+		memcpy(tf-tf_fixreg, mpts-gpreg, 32 * sizeof(register_t));
+		tf-tf_cr = mpts-cr;
+		tf-tf_xer = mpts-xer;
+		tf-tf_lr = mpts-lr;
+		tf-tf_ctr = mpts-ctr;
   
   		break;
   	}



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:05:58 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: trap.c trap_subr.S

Log Message:
Deal with trapframe changes.  Rework trap_subr.S to take advantage of the
simplier world.


To generate a diff of this commit:
cvs rdiff -u -r1.128.4.1 -r1.128.4.1.4.1 src/sys/arch/powerpc/powerpc/trap.c
cvs rdiff -u -r1.65 -r1.65.16.1 src/sys/arch/powerpc/powerpc/trap_subr.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/powerpc/powerpc/trap.c
diff -u src/sys/arch/powerpc/powerpc/trap.c:1.128.4.1 src/sys/arch/powerpc/powerpc/trap.c:1.128.4.1.4.1
--- src/sys/arch/powerpc/powerpc/trap.c:1.128.4.1	Fri Aug 14 21:30:19 2009
+++ src/sys/arch/powerpc/powerpc/trap.c	Fri Jan  7 02:05:58 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.128.4.1 2009/08/14 21:30:19 snj Exp $	*/
+/*	$NetBSD: trap.c,v 1.128.4.1.4.1 2011/01/07 02:05:58 matt Exp $	*/
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.128.4.1 2009/08/14 21:30:19 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.128.4.1.4.1 2011/01/07 02:05:58 matt Exp $);
 
 #include opt_altivec.h
 #include opt_ddb.h
@@ -63,6 +63,7 @@
 #include machine/trap.h
 #include powerpc/altivec.h
 #include powerpc/spr.h
+#include powerpc/oea/spr.h
 #include powerpc/userret.h
 
 static int emulated_opcode(struct lwp *, struct trapframe *);
@@ -70,27 +71,65 @@
 static inline vaddr_t setusr(vaddr_t, size_t *);
 static inline void unsetusr(void);
 
+#if 1		/* XXX TMP DEBUG FIXME */
+#define TRAP_TRACE_NELM	1024
+struct trap_trace_elm {
+	int type;
+	struct trapframe *tf;
+	struct lwp *l;
+} trap_trace_log[TRAP_TRACE_NELM];
+static int trap_trace_index;
+static inline void
+trap_trace_enter(int type, struct trapframe *tf, struct lwp *l)
+{
+	if (trap_trace_index  TRAP_TRACE_NELM) {
+		struct trap_trace_elm *te =
+			trap_trace_log[trap_trace_index++];
+		te-type = type;
+		te-tf = tf;
+		te-l = l;
+	}
+}
+void trap_trace_print(void);
+void
+trap_trace_print()
+{
+	struct trap_trace_elm *te =
+		trap_trace_log[0];
+	printf(%s: %d\n, __func__, trap_trace_index);
+	for (int i=0; i  trap_trace_index; i++) {
+		printf(%d: %#x, %p, %p\n, 
+			i, te-type, te-tf, te-l);
+		te++;
+	}
+}
+#endif
 void trap(struct trapframe *);	/* Called from locore / trap_subr */
 /* Why are these not defined in a header? */
 int badaddr(void *, size_t);
 int badaddr_read(void *, size_t, int *);
 
 void
-trap(struct trapframe *frame)
+trap(struct trapframe *tf)
 {
 	struct cpu_info * const ci = curcpu();
 	struct lwp *l = curlwp;
 	struct proc *p = l ? l-l_proc : NULL;
 	struct pcb *pcb = curpcb;
 	struct vm_map *map;
-	struct faultbuf *onfault;
 	ksiginfo_t ksi;
-	int type = frame-exc;
+	int type = tf-tf_exc;
 	int ftype, rv;
 
 	ci-ci_ev_traps.ev_count++;
 
-	if (frame-srr1  PSL_PR) {
+#if 0
+	trap_trace_enter(type, tf, l);
+#endif
+	KASSERTMSG(!(tf-tf_srr1  PSL_PR) || tf == trapframe(l),
+	(trap: tf=%p is invalid: trapframe(%p)=%p, tf, l, trapframe(l)));
+
+	if (tf-tf_srr1  PSL_PR) {
 		type |= EXC_USER;
 #ifdef DIAGNOSTIC
 		if (l == NULL || p == NULL)
@@ -106,32 +145,33 @@
 	case EXC_RUNMODETRC|EXC_USER:
 		/* FALLTHROUGH */
 	case EXC_TRC|EXC_USER:
-		frame-srr1 = ~PSL_SE;
+		tf-tf_srr1 = ~PSL_SE;
 		if (p-p_raslist == NULL ||
-		ras_lookup(p, (void *)frame-srr0) == (void *) -1) {
+		ras_lookup(p, (void *)tf-tf_srr0) == (void *) -1) {
 			KSI_INIT_TRAP(ksi);
 			ksi.ksi_signo = SIGTRAP;
 			ksi.ksi_trap = EXC_TRC;
-			ksi.ksi_addr = (void *)frame-srr0;
+			ksi.ksi_addr = (void *)tf-tf_srr0;
 			ksi.ksi_code = TRAP_TRACE;
 			(*p-p_emul-e_trapsignal)(l, ksi);
 		}
 		break;
 	case EXC_DSI: {
 		struct faultbuf *fb;
-		vaddr_t va = frame-dar;
+		vaddr_t va = tf-tf_dar;
+		fb = pcb-pcb_onfault;
 		ci-ci_ev_kdsi.ev_count++;
 
 		/*
 		 * Only query UVM if no interrupts are active.
 		 */
-		if (ci-ci_intrdepth  0) {
+		if (ci-ci_idepth  0) {
 			if ((va  ADDR_SR_SHFT) == pcb-pcb_kmapsr) {
 va = ADDR_PIDX | ADDR_POFF;
 va |= pcb-pcb_umapsr  ADDR_SR_SHFT;
 map = p-p_vmspace-vm_map;
 #ifdef PPC_OEA64
-if ((frame-dsisr  DSISR_NOTFOUND) 
+if ((tf-tf_dsisr  DSISR_NOTFOUND) 
 vm_map_pmap(map)-pm_ste_evictions  0 
 pmap_ste_spill(vm_map_pmap(map),
 	trunc_page(va), false)) {
@@ -139,7 +179,7 @@
 }
 #endif
 
-if ((frame-dsisr  DSISR_NOTFOUND) 
+if ((tf-tf_dsisr  DSISR_NOTFOUND) 
 vm_map_pmap(map)-pm_evictions  0 
 pmap_pte_spill(vm_map_pmap(map),
 	trunc_page(va), false)) {
@@ -154,24 +194,23 @@
 			} else if ((va  ADDR_SR_SHFT) == USER_SR) {
 printf(trap: kernel %s DSI trap @ %#lx by %#lx
  (DSISR %#x): USER_SR unset\n,
-(frame-dsisr  DSISR_STORE)
+(tf-tf_dsisr  DSISR_STORE)
 	? write : read,
-va, frame-srr0, 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:06:37 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: setfault.S

Log Message:
Add booke support.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.5.104.1 src/sys/arch/powerpc/powerpc/setfault.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/powerpc/powerpc/setfault.S
diff -u src/sys/arch/powerpc/powerpc/setfault.S:1.5 src/sys/arch/powerpc/powerpc/setfault.S:1.5.104.1
--- src/sys/arch/powerpc/powerpc/setfault.S:1.5	Sun Dec 11 12:18:46 2005
+++ src/sys/arch/powerpc/powerpc/setfault.S	Fri Jan  7 02:06:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: setfault.S,v 1.5 2005/12/11 12:18:46 christos Exp $	*/
+/*	$NetBSD: setfault.S,v 1.5.104.1 2011/01/07 02:06:37 matt Exp $	*/
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -66,6 +66,7 @@
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #define _NOREGNAMES
+#include opt_ppcarch.h
 #include assym.h
 #include machine/asm.h
 
@@ -85,14 +86,20 @@
  */
 	.globl	_C_LABEL(setfault)
 _C_LABEL(setfault):
-	mflr	%r0
+	mflr	%r11
 	mfcr	%r12
 	GET_CPUINFO(%r4)
 	ldptr	%r4,CI_CURPCB(%r4)
-	stptr	%r3,PCB_FAULT(%r4)
-	streg	%r0,FB_PC(%r3)			/* LR */
+	stptr	%r3,PCB_ONFAULT(%r4)
 	streg	%r1,FB_SP(%r3)			/* SP (R1) */
 	streg	%r2,FB_R2(%r3)			/* why?? */
+#ifdef PPC_BOOKE
+	mfmsr	%r10
+	andi.	%r0,%r10,psl...@l
+	twnei	%r0,0
+	stmw	%r10,FB_MSR(%r3)		/* MSR, LR, CR, R13-R31 */
+#else
+	streg	%r11,FB_PC(%r3)			/* LR */
 	streg	%r12,FB_CR(%r3)			/* CR */
 	streg	%r13,FB_R13(%r3)		/* R13-R31 */
 	streg	%r14,FB_R14(%r3)
@@ -113,5 +120,6 @@
 	streg	%r29,FB_R29(%r3)
 	streg	%r30,FB_R30(%r3)
 	streg	%r31,FB_R31(%r3)
+#endif
 	li	%r3,0
 	blr



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:06:50 UTC 2011

Modified Files:
src/sys/arch/powerpc/powerpc [matt-nb5-pq3]: pio_subr.S

Log Message:
Add booke support


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.12.24.1 src/sys/arch/powerpc/powerpc/pio_subr.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/powerpc/powerpc/pio_subr.S
diff -u src/sys/arch/powerpc/powerpc/pio_subr.S:1.12 src/sys/arch/powerpc/powerpc/pio_subr.S:1.12.24.1
--- src/sys/arch/powerpc/powerpc/pio_subr.S:1.12	Sun May 25 15:56:12 2008
+++ src/sys/arch/powerpc/powerpc/pio_subr.S	Fri Jan  7 02:06:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pio_subr.S,v 1.12 2008/05/25 15:56:12 chs Exp $	*/
+/*	$NetBSD: pio_subr.S,v 1.12.24.1 2011/01/07 02:06:50 matt Exp $	*/
 
 /*
  * Copyright (c) 2003 Matt Thomas
@@ -39,6 +39,10 @@
 #else
 #define	DBGSYNC	/* nothing */
 #endif
+
+#undef DBGSYNC
+#define	DBGSYNC	msync
+#define	eieio	mbar 0
 /* LINTSTUB: include sys/param.h */
 /* LINTSTUB: include sys/types.h */
 /* LINTSTUB: include machine/bus.h */



CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc/fpu

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:08:55 UTC 2011

Modified Files:
src/sys/arch/powerpc/fpu [matt-nb5-pq3]: fpu_emu.c

Log Message:
Adapt to new trapframe.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.104.1 src/sys/arch/powerpc/fpu/fpu_emu.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/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.14 src/sys/arch/powerpc/fpu/fpu_emu.c:1.14.104.1
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.14	Sun Dec 11 12:18:42 2005
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Fri Jan  7 02:08:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.14 2005/12/11 12:18:42 christos Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.14.104.1 2011/01/07 02:08:55 matt Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: fpu_emu.c,v 1.14 2005/12/11 12:18:42 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: fpu_emu.c,v 1.14.104.1 2011/01/07 02:08:55 matt Exp $);
 
 #include opt_ddb.h
 
@@ -183,7 +183,7 @@
  * (Typically: zero, SIGFPE, SIGILL, SIGSEGV)
  */
 int
-fpu_emulate(struct trapframe *frame, struct fpreg *fpf)
+fpu_emulate(struct trapframe *tf, struct fpreg *fpf)
 {
 	static union instr insn;
 	static struct fpemu fe;
@@ -196,7 +196,7 @@
 
 	/* always set this (to avoid a warning) */
 
-	if (copyin((void *) (frame-srr0), insn.i_int, sizeof (insn.i_int))) {
+	if (copyin((void *) (tf-tf_srr0), insn.i_int, sizeof (insn.i_int))) {
 #ifdef DEBUG
 		printf(fpu_emulate: fault reading opcode\n);
 #endif
@@ -204,7 +204,7 @@
 	}
 
 	DPRINTF(FPE_EX, (fpu_emulate: emulating insn %x at %p\n,
-	insn.i_int, (void *)frame-srr0));
+	insn.i_int, (void *)tf-tf_srr0));
 
 
 	if ((insn.i_any.i_opcd == OPC_TWI) ||
@@ -215,10 +215,10 @@
 		return (SIGTRAP);
 	}
 	sig = 0;
-	switch (fpu_execute(frame, fe, insn)) {
+	switch (fpu_execute(tf, fe, insn)) {
 	case 0:
 		DPRINTF(FPE_EX, (fpu_emulate: success\n));
-		frame-srr0 += 4;
+		tf-tf_srr0 += 4;
 		break;
 
 	case FPE:
@@ -237,21 +237,21 @@
 #ifdef DEBUG
 		if (fpe_debug  FPE_EX) {
 			printf(fpu_emulate:  illegal insn %x at %p:,
-			insn.i_int, (void *) (frame-srr0));
-			opc_disasm((vaddr_t)(frame-srr0), insn.i_int);
+			insn.i_int, (void *) (tf-tf_srr0));
+			opc_disasm((vaddr_t)(tf-tf_srr0), insn.i_int);
 		}
 #endif
 		/*
 		*  retry an illegal insn once due to cache issues.
 		*/
-		if (lastill == frame-srr0) {
+		if (lastill == tf-tf_srr0) {
 			sig = SIGILL;
 #ifdef DEBUG
 			if (fpe_debug  FPE_EX)
 Debugger();
 #endif
 		}
-		lastill = frame-srr0;
+		lastill = tf-tf_srr0;
 		break;
 	}
 
@@ -293,7 +293,7 @@
 
 #if defined(DDB)  defined(DEBUG)
 	if (fpe_debug  FPE_EX) {
-		vaddr_t loc = tf-srr0;
+		vaddr_t loc = tf-tf_srr0;
 
 		printf(Trying to emulate: %p , (void *)loc);
 		opc_disasm(loc, instr.i_int);
@@ -327,11 +327,11 @@
 ra = instr.i_x.i_ra;
 rb = instr.i_x.i_rb;
 DPRINTF(FPE_INSN, (reg %d has %lx reg %d has %lx\n,
-	ra, tf-fixreg[ra], rb, tf-fixreg[rb]));
+	ra, tf-tf_fixreg[ra], rb, tf-tf_fixreg[rb]));
 
-addr = tf-fixreg[rb];
+addr = tf-tf_fixreg[rb];
 if (ra != 0)
-	addr += tf-fixreg[ra];
+	addr += tf-tf_fixreg[ra];
 rt = instr.i_x.i_rt;
 a = (int *)fs-fpreg[rt];
 DPRINTF(FPE_INSN,
@@ -357,10 +357,10 @@
 			ra = instr.i_x.i_ra;
 			rb = instr.i_x.i_rb;
 			DPRINTF(FPE_INSN, (reg %d has %lx reg %d has %lx\n,
-ra, tf-fixreg[ra], rb, tf-fixreg[rb]));
-			addr = tf-fixreg[rb];
+ra, tf-tf_fixreg[ra], rb, tf-tf_fixreg[rb]));
+			addr = tf-tf_fixreg[rb];
 			if (ra != 0)
-addr += tf-fixreg[ra];
+addr += tf-tf_fixreg[ra];
 			rt = instr.i_x.i_rt;
 		} else {
 			store = instr.i_d.i_opcd  0x4;
@@ -374,9 +374,9 @@
 			ra = instr.i_d.i_ra;
 			addr = instr.i_d.i_d;
 			DPRINTF(FPE_INSN, (reg %d has %lx displ %lx\n,
-ra, tf-fixreg[ra], addr));
+ra, tf-tf_fixreg[ra], addr));
 			if (ra != 0)
-addr += tf-fixreg[ra];
+addr += tf-tf_fixreg[ra];
 			rt = instr.i_d.i_rt;
 		}
 
@@ -415,7 +415,7 @@
 			}
 		}
 		if (update) 
-			tf-fixreg[ra] = addr;
+			tf-tf_fixreg[ra] = addr;
 		/* Complete. */
 		return (0);
 #ifdef notyet
@@ -515,8 +515,8 @@
 	(FPSR_EX_MSK | (0xf  (28 - ra)));
 fe-fe_fpscr = fe-fe_cx;
 /* Now shove them in the right part of cr */
-tf-cr = ~(0xf  (28 - rt));
-tf-cr |= (mask  (28 - rt));
+tf-tf_cr = ~(0xf  (28 - rt));
+tf-tf_cr |= (mask  (28 - rt));
 break;
 			case	OPC63_MTFSB0:
 FPU_EMU_EVCNT_INCR(mtfsb0);
@@ -763,8 +763,8 @@
 		/* Isolate condition codes */
 		cond = 28;
 		/* Move fpu condition codes to cr[1] */
-		tf-cr = (0x0f00);
-		tf-cr |= (cond24);
+		tf-tf_cr = (0x0f00);
+		tf-tf_cr |= (cond24);
 		DPRINTF(FPE_INSN, (fpu_execute: cr[1] = %x\n, cond));
 	}
 
@@ -773,9 +773,9 @@
 		/* Isolate condition codes */
 		cond = 16;
 		/* Move fpu condition codes to cr[1] 

CVS commit: [matt-nb5-pq3] src/sys/arch/powerpc

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:11:36 UTC 2011

Modified Files:
src/sys/arch/powerpc [matt-nb5-pq3]: Makefile
Added Files:
src/sys/arch/powerpc/include/booke [matt-nb5-pq3]: Makefile

Log Message:
Descend into the booke include diretory


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.26.1 src/sys/arch/powerpc/Makefile
cvs rdiff -u -r0 -r1.1.8.2 src/sys/arch/powerpc/include/booke/Makefile

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/powerpc/Makefile
diff -u src/sys/arch/powerpc/Makefile:1.10 src/sys/arch/powerpc/Makefile:1.10.26.1
--- src/sys/arch/powerpc/Makefile:1.10	Wed Apr 30 21:15:33 2008
+++ src/sys/arch/powerpc/Makefile	Fri Jan  7 02:11:36 2011
@@ -1,5 +1,5 @@
-#	$NetBSD: Makefile,v 1.10 2008/04/30 21:15:33 garbled Exp $
+#	$NetBSD: Makefile,v 1.10.26.1 2011/01/07 02:11:36 matt Exp $
 
-SUBDIR=	include .WAIT include/ibm4xx include/oea stand
+SUBDIR=	include .WAIT include/booke include/ibm4xx include/oea stand
 
 .include bsd.kinc.mk

Added files:

Index: src/sys/arch/powerpc/include/booke/Makefile
diff -u /dev/null src/sys/arch/powerpc/include/booke/Makefile:1.1.8.2
--- /dev/null	Fri Jan  7 02:11:36 2011
+++ src/sys/arch/powerpc/include/booke/Makefile	Fri Jan  7 02:11:36 2011
@@ -0,0 +1,7 @@
+#	$NetBSD: Makefile,v 1.1.8.2 2011/01/07 02:11:36 matt Exp $
+
+INCSDIR= /usr/include/powerpc/ibm4xx
+
+INCS=	cpuvar.h intr.h pmap.h pte.h spr.h
+
+.include bsd.kinc.mk



CVS commit: [matt-nb5-pq3] src/sys/kern

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:18:07 UTC 2011

Modified Files:
src/sys/kern [matt-nb5-pq3]: kern_subr.c

Log Message:
Add critpoll hooks.


To generate a diff of this commit:
cvs rdiff -u -r1.192.4.1 -r1.192.4.1.8.1 src/sys/kern/kern_subr.c

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

Modified files:

Index: src/sys/kern/kern_subr.c
diff -u src/sys/kern/kern_subr.c:1.192.4.1 src/sys/kern/kern_subr.c:1.192.4.1.8.1
--- src/sys/kern/kern_subr.c:1.192.4.1	Mon Nov 17 18:56:05 2008
+++ src/sys/kern/kern_subr.c	Fri Jan  7 02:18:07 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_subr.c,v 1.192.4.1 2008/11/17 18:56:05 snj Exp $	*/
+/*	$NetBSD: kern_subr.c,v 1.192.4.1.8.1 2011/01/07 02:18:07 matt Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc.
@@ -79,7 +79,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: kern_subr.c,v 1.192.4.1 2008/11/17 18:56:05 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: kern_subr.c,v 1.192.4.1.8.1 2011/01/07 02:18:07 matt Exp $);
 
 #include opt_ddb.h
 #include opt_md.h
@@ -603,6 +603,33 @@
 	}
 }
 
+static hook_list_t critpollhook_list = LIST_HEAD_INITIALIZER(critpollhook_list);
+
+void *
+critpollhook_establish(void (*fn)(void *), void *arg)
+{
+	return hook_establish(critpollhook_list, fn, arg);
+}
+
+void
+critpollhook_disestablish(void *vhook)
+{
+	hook_disestablish(critpollhook_list, vhook);
+}
+
+/*
+ * Run critical polling hooks.
+ */
+void
+docritpollhooks(void)
+{
+	struct hook_desc *hd;
+
+	LIST_FOREACH(hd, critpollhook_list, hk_list) {
+		(*hd-hk_fn)(hd-hk_arg);
+	}
+}
+
 /*
  * Power hook types, functions, and variables.
  * The list of power hooks is kept ordered with the last registered hook



CVS commit: [matt-nb5-pq3] src/sys/dev/mii

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:19:45 UTC 2011

Modified Files:
src/sys/dev/mii [matt-nb5-pq3]: miidevs

Log Message:
Add fresh miidevs from HEAD.


To generate a diff of this commit:
cvs rdiff -u -r1.78.4.4 -r1.78.4.4.2.1 src/sys/dev/mii/miidevs

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/mii/miidevs
diff -u src/sys/dev/mii/miidevs:1.78.4.4 src/sys/dev/mii/miidevs:1.78.4.4.2.1
--- src/sys/dev/mii/miidevs:1.78.4.4	Fri Nov 19 23:58:41 2010
+++ src/sys/dev/mii/miidevs	Fri Jan  7 02:19:45 2011
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.78.4.4 2010/11/19 23:58:41 riz Exp $
+$NetBSD: miidevs,v 1.78.4.4.2.1 2011/01/07 02:19:45 matt Exp $
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -46,9 +46,10 @@
  */
 
 /*
-* Use make -f Makefile.miidevs to regenerate miidevs.h and miidevs_data.h
-*/
+ * Use make -f Makefile.miidevs to regenerate miidevs.h and miidevs_data.h
+ */
 
+oui AGERE			0x00053d	Agere
 oui ALTIMA			0x0010a9	Altima Communications
 oui AMD0x1a	Advanced Micro Devices
 oui ATHEROS			0x001374	Atheros
@@ -107,6 +108,11 @@
  * List of known models.  Grouped by oui.
  */
 
+/*
+ * Agere PHYs
+ */
+model AGERE ET1011		0x0004 Agere ET1011 10/100/1000baseT PHY
+
 /* Atheros PHYs */
 model ATHEROS F1		0x0001 F1 10/100/1000 PHY
 model ATHEROS F2		0x0002 F2 10/100 PHY
@@ -114,6 +120,7 @@
 /* Attansic PHYs */
 model ATTANSIC L1		0x0001 L1 10/100/1000 PHY
 model ATTANSIC L2		0x0002 L2 10/100 PHY
+model ATTANSIC AR8021		0x0004 Atheros AR8021 10/100/1000 PHY
 
 /* Altima Communications PHYs */
 /* Don't know the model for ACXXX */
@@ -157,6 +164,8 @@
 model BROADCOM BCM5780		0x0035 BCM5780 1000BASE-T media interface
 model BROADCOM BCM5708C		0x0036 BCM5708C 1000BASE-T media interface
 model BROADCOM2 BCM5906		0x0004 BCM5906 10/100baseTX media interface
+model BROADCOM2 BCM5481		0x000a BCM5481 1000BASE-T media interface
+model BROADCOM2 BCM5482		0x000b BCM5482 1000BASE-T media interface
 model BROADCOM2 BCM5755		0x000c BCM5755 1000BASE-T media interface
 model BROADCOM2 BCM5754		0x000e BCM5754/5787 1000BASE-T media interface
 model BROADCOM2 BCM5709CAX	0x002c BCM5709CAX 10/100/1000baseT PHY
@@ -164,12 +173,16 @@
 model BROADCOM2 BCM5784		0x003a BCM5784 10/100/1000baseT PHY
 model BROADCOM2 BCM5709C	0x003c BCM5709 10/100/1000baseT PHY
 model BROADCOM2 BCM5761		0x003d BCM5761 10/100/1000baseT PHY
+model BROADCOM2 BCM5709S	0x003f BCM5709S 1000/2500baseSX PHY
 model xxBROADCOM_ALT1 BCM5906	0x0004 BCM5906 10/100baseTX media interface
  
 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */
 model CICADA CS8201		0x0001 Cicada CS8201 10/100/1000TX PHY
+model CICADA CS8204		0x0004 Cicada CS8204 10/100/1000TX PHY
+model CICADA VSC8211		0x000b Cicada VSC8211 10/100/1000TX PHY
 model CICADA CS8201A		0x0020 Cicada CS8201 10/100/1000TX PHY
 model CICADA CS8201B		0x0021 Cicada CS8201 10/100/1000TX PHY
+model CICADA CS8244		0x002c Cicada CS8244 10/100/1000TX PHY
 model xxCICADA CS8201B		0x0021 Cicada CS8201 10/100/1000TX PHY
 
 /* Davicom Semiconductor PHYs */
@@ -195,6 +208,7 @@
 model yyINTEL I82562ET		0x0033 i82562ET 10/100 media interface
 model yyINTEL I82553		0x0035 i82553 10/100 media interface
 model yyINTEL I82566		0x0039 i82566 10/100/1000 media interface
+model INTEL I82577		0x0005 i82577 10/100/1000 media interface
 model xxMARVELL I82563		0x000a i82563 10/100/1000 media interface
 
 model yyINTEL IGP01E1000	0x0038 Intel IGP01E1000 Gigabit PHY
@@ -217,8 +231,11 @@
 model xxMARVELL E1000_3		0x0003 Marvell 88E1000 Gigabit PHY
 model xxMARVELL E1000_5		0x0005 Marvell 88E1000 Gigabit PHY
 model xxMARVELL E6060		0x0008 Marvell 88E6060 10/100 5-port PHY switch
+model xxMARVELL E1149		0x000b Marvell 88E1149 Gigabit PHY
 model xxMARVELL E		0x000c Marvell 88E Gigabit PHY
+model xxMARVELL E1145		0x000d Marvell 88E1145 Quad Gigabit PHY
 model xxMARVELL E1116		0x0021 Marvell 88E1116 Gigabit PHY
+model xxMARVELL E1116R		0x0024 Marvell 88E1116R Gigabit PHY
 
 /* Myson Technology PHYs */
 model xxMYSON MTD972		0x MTD972 10/100 media interface
@@ -231,6 +248,7 @@
 model xxNATSEMI DP83847		0x0003 DP83847 10/100 media interface
 model xxNATSEMI DP83891		0x0005 DP83891 1000BASE-T media interface
 model xxNATSEMI DP83861		0x0006 DP83861 1000BASE-T media interface
+model xxNATSEMI DP83865		0x0007 DP83865 1000BASE-T media interface
 
 /* PMC Sierra PHYs */
 model xxPMCSIERRA PM8351	0x PM8351 OctalPHY Gigabit interface



CVS commit: [matt-nb5-pq3] src/sys/dev/mii

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:20:07 UTC 2011

Modified Files:
src/sys/dev/mii [matt-nb5-pq3]: miidevs.h miidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.81.4.4 -r1.81.4.4.2.1 src/sys/dev/mii/miidevs.h
cvs rdiff -u -r1.71.4.4 -r1.71.4.4.2.1 src/sys/dev/mii/miidevs_data.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/mii/miidevs.h
diff -u src/sys/dev/mii/miidevs.h:1.81.4.4 src/sys/dev/mii/miidevs.h:1.81.4.4.2.1
--- src/sys/dev/mii/miidevs.h:1.81.4.4	Fri Nov 19 23:59:22 2010
+++ src/sys/dev/mii/miidevs.h	Fri Jan  7 02:20:06 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: miidevs.h,v 1.81.4.4 2010/11/19 23:59:22 riz Exp $	*/
+/*	$NetBSD: miidevs.h,v 1.81.4.4.2.1 2011/01/07 02:20:06 matt Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: miidevs,v 1.78.4.4 2010/11/19 23:58:41 riz Exp
+ *	NetBSD: miidevs,v 1.78.4.4.2.1 2011/01/07 02:19:45 matt Exp
  */
 
 /*-
@@ -53,9 +53,10 @@
  */
 
 /*
-* Use make -f Makefile.miidevs to regenerate miidevs.h and miidevs_data.h
-*/
+ * Use make -f Makefile.miidevs to regenerate miidevs.h and miidevs_data.h
+ */
 
+#define	MII_OUI_AGERE	0x00053d	/* Agere */
 #define	MII_OUI_ALTIMA	0x0010a9	/* Altima Communications */
 #define	MII_OUI_AMD	0x1a	/* Advanced Micro Devices */
 #define	MII_OUI_ATHEROS	0x001374	/* Atheros */
@@ -114,6 +115,12 @@
  * List of known models.  Grouped by oui.
  */
 
+/*
+ * Agere PHYs
+ */
+#define	MII_MODEL_AGERE_ET1011	0x0004
+#define	MII_STR_AGERE_ET1011	Agere ET1011 10/100/1000baseT PHY
+
 /* Atheros PHYs */
 #define	MII_MODEL_ATHEROS_F1	0x0001
 #define	MII_STR_ATHEROS_F1	F1 10/100/1000 PHY
@@ -125,6 +132,8 @@
 #define	MII_STR_ATTANSIC_L1	L1 10/100/1000 PHY
 #define	MII_MODEL_ATTANSIC_L2	0x0002
 #define	MII_STR_ATTANSIC_L2	L2 10/100 PHY
+#define	MII_MODEL_ATTANSIC_AR8021	0x0004
+#define	MII_STR_ATTANSIC_AR8021	Atheros AR8021 10/100/1000 PHY
 
 /* Altima Communications PHYs */
 /* Don't know the model for ACXXX */
@@ -202,6 +211,10 @@
 #define	MII_STR_BROADCOM_BCM5708C	BCM5708C 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM2_BCM5906	0x0004
 #define	MII_STR_BROADCOM2_BCM5906	BCM5906 10/100baseTX media interface
+#define	MII_MODEL_BROADCOM2_BCM5481	0x000a
+#define	MII_STR_BROADCOM2_BCM5481	BCM5481 1000BASE-T media interface
+#define	MII_MODEL_BROADCOM2_BCM5482	0x000b
+#define	MII_STR_BROADCOM2_BCM5482	BCM5482 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM2_BCM5755	0x000c
 #define	MII_STR_BROADCOM2_BCM5755	BCM5755 1000BASE-T media interface
 #define	MII_MODEL_BROADCOM2_BCM5754	0x000e
@@ -216,16 +229,24 @@
 #define	MII_STR_BROADCOM2_BCM5709C	BCM5709 10/100/1000baseT PHY
 #define	MII_MODEL_BROADCOM2_BCM5761	0x003d
 #define	MII_STR_BROADCOM2_BCM5761	BCM5761 10/100/1000baseT PHY
+#define	MII_MODEL_BROADCOM2_BCM5709S	0x003f
+#define	MII_STR_BROADCOM2_BCM5709S	BCM5709S 1000/2500baseSX PHY
 #define	MII_MODEL_xxBROADCOM_ALT1_BCM5906	0x0004
 #define	MII_STR_xxBROADCOM_ALT1_BCM5906	BCM5906 10/100baseTX media interface
  
 /* Cicada Semiconductor PHYs (now owned by Vitesse?) */
 #define	MII_MODEL_CICADA_CS8201	0x0001
 #define	MII_STR_CICADA_CS8201	Cicada CS8201 10/100/1000TX PHY
+#define	MII_MODEL_CICADA_CS8204	0x0004
+#define	MII_STR_CICADA_CS8204	Cicada CS8204 10/100/1000TX PHY
+#define	MII_MODEL_CICADA_VSC8211	0x000b
+#define	MII_STR_CICADA_VSC8211	Cicada VSC8211 10/100/1000TX PHY
 #define	MII_MODEL_CICADA_CS8201A	0x0020
 #define	MII_STR_CICADA_CS8201A	Cicada CS8201 10/100/1000TX PHY
 #define	MII_MODEL_CICADA_CS8201B	0x0021
 #define	MII_STR_CICADA_CS8201B	Cicada CS8201 10/100/1000TX PHY
+#define	MII_MODEL_CICADA_CS8244	0x002c
+#define	MII_STR_CICADA_CS8244	Cicada CS8244 10/100/1000TX PHY
 #define	MII_MODEL_xxCICADA_CS8201B	0x0021
 #define	MII_STR_xxCICADA_CS8201B	Cicada CS8201 10/100/1000TX PHY
 
@@ -267,6 +288,8 @@
 #define	MII_STR_yyINTEL_I82553	i82553 10/100 media interface
 #define	MII_MODEL_yyINTEL_I82566	0x0039
 #define	MII_STR_yyINTEL_I82566	i82566 10/100/1000 media interface
+#define	MII_MODEL_INTEL_I82577	0x0005
+#define	MII_STR_INTEL_I82577	i82577 10/100/1000 media interface
 #define	MII_MODEL_xxMARVELL_I82563	0x000a
 #define	MII_STR_xxMARVELL_I82563	i82563 10/100/1000 media interface
 
@@ -304,10 +327,16 @@
 #define	MII_STR_xxMARVELL_E1000_5	Marvell 88E1000 Gigabit PHY
 #define	MII_MODEL_xxMARVELL_E6060	0x0008
 #define	MII_STR_xxMARVELL_E6060	Marvell 88E6060 10/100 5-port PHY switch
+#define	MII_MODEL_xxMARVELL_E1149	0x000b
+#define	MII_STR_xxMARVELL_E1149	Marvell 88E1149 Gigabit PHY
 #define	MII_MODEL_xxMARVELL_E	0x000c
 #define	MII_STR_xxMARVELL_E	Marvell 88E Gigabit PHY
+#define	MII_MODEL_xxMARVELL_E1145	0x000d
+#define	MII_STR_xxMARVELL_E1145	Marvell 88E1145 Quad Gigabit PHY
 #define	MII_MODEL_xxMARVELL_E1116	0x0021
 #define	MII_STR_xxMARVELL_E1116	Marvell 88E1116 Gigabit PHY
+#define	

CVS commit: [matt-nb5-pq3] src/sys/dev/mii

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:20:28 UTC 2011

Modified Files:
src/sys/dev/mii [matt-nb5-pq3]: atphy.c makphy.c

Log Message:
Match some more phys.


To generate a diff of this commit:
cvs rdiff -u -r1.5.2.2 -r1.5.2.2.4.1 src/sys/dev/mii/atphy.c
cvs rdiff -u -r1.28 -r1.28.18.1 src/sys/dev/mii/makphy.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/mii/atphy.c
diff -u src/sys/dev/mii/atphy.c:1.5.2.2 src/sys/dev/mii/atphy.c:1.5.2.2.4.1
--- src/sys/dev/mii/atphy.c:1.5.2.2	Sun May  3 23:45:47 2009
+++ src/sys/dev/mii/atphy.c	Fri Jan  7 02:20:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: atphy.c,v 1.5.2.2 2009/05/03 23:45:47 snj Exp $ */
+/*	$NetBSD: atphy.c,v 1.5.2.2.4.1 2011/01/07 02:20:27 matt Exp $ */
 /*	$OpenBSD: atphy.c,v 1.1 2008/09/25 20:47:16 brad Exp $	*/
 
 /*-
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: atphy.c,v 1.5.2.2 2009/05/03 23:45:47 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: atphy.c,v 1.5.2.2.4.1 2011/01/07 02:20:27 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -94,6 +94,8 @@
 	  MII_STR_ATHEROS_F1 },
 	{ MII_OUI_ATTANSIC,	MII_MODEL_ATTANSIC_L1,
 	  MII_STR_ATTANSIC_L1 },
+	{ MII_OUI_ATTANSIC,	MII_MODEL_ATTANSIC_AR8021,
+	  MII_STR_ATTANSIC_AR8021 },
 	{ 0,			0,
 	  NULL },
 };

Index: src/sys/dev/mii/makphy.c
diff -u src/sys/dev/mii/makphy.c:1.28 src/sys/dev/mii/makphy.c:1.28.18.1
--- src/sys/dev/mii/makphy.c:1.28	Sun May  4 17:06:09 2008
+++ src/sys/dev/mii/makphy.c	Fri Jan  7 02:20:27 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: makphy.c,v 1.28 2008/05/04 17:06:09 xtraeme Exp $	*/
+/*	$NetBSD: makphy.c,v 1.28.18.1 2011/01/07 02:20:27 matt Exp $	*/
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: makphy.c,v 1.28 2008/05/04 17:06:09 xtraeme Exp $);
+__KERNEL_RCSID(0, $NetBSD: makphy.c,v 1.28.18.1 2011/01/07 02:20:27 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -112,6 +112,9 @@
 	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1116,
 	  MII_STR_xxMARVELL_E1116 },
 
+	{ MII_OUI_xxMARVELL,		MII_MODEL_xxMARVELL_E1145,
+	  MII_STR_xxMARVELL_E1145 },
+
 	{ 0,0,
 	  NULL },
 };



CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:21:52 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: pcidevs

Log Message:
Add some devices (not synced to HEAD).


To generate a diff of this commit:
cvs rdiff -u -r1.962.4.15 -r1.962.4.15.2.1 src/sys/dev/pci/pcidevs

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/pcidevs
diff -u src/sys/dev/pci/pcidevs:1.962.4.15 src/sys/dev/pci/pcidevs:1.962.4.15.2.1
--- src/sys/dev/pci/pcidevs:1.962.4.15	Mon Nov 22 03:39:08 2010
+++ src/sys/dev/pci/pcidevs	Fri Jan  7 02:21:52 2011
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.962.4.15 2010/11/22 03:39:08 riz Exp $
+$NetBSD: pcidevs,v 1.962.4.15.2.1 2011/01/07 02:21:52 matt Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -531,6 +531,7 @@
 vendor USR2		0x16ec	US Robotics
 vendor PICTUREEL	0x12c5	Picture Elements
 vendor NVIDIA_SGS	0x12d2	Nvidia  SGS-Thomson Microelectronics
+vendor PERICOM		0x12d8	Pericom Semiconductors
 vendor RAINBOW		0x12de	Rainbow Technologies
 vendor AUREAL		0x12eb	Aureal Semiconductor
 vendor ADMTEK		0x1317	ADMtek
@@ -602,6 +603,7 @@
 vendor LINKSYS2		0x17fe	Linksys
 vendor RALINK		0x1814	Ralink Technologies
 vendor BBELEC		0x1896	B  B Electronics
+vendor FREESCALE	0x1957	Freescale Semiconductor
 vendor ATTANSIC		0x1969	Attansic Technologies
 vendor EVE		0x1adb	EVE
 vendor SYMPHONY2	0x1c1c	Symphony Labs (2nd PCI Vendor ID)
@@ -1062,6 +1064,7 @@
 /* Attansic Technology Corp. */
 product ATTANSIC ETHERNET_L1E	0x1026	L1E Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_GIGA	0x1048	L1 Gigabit Ethernet Adapter
+product ATTANSIC AR8131		0x1063	Atheros AR8131 Gigabit Ethernet Adapter
 product ATTANSIC ETHERNET_100	0x2048	L2 100 Mbit Ethernet Adapter
 
 /* ATI products */
@@ -1927,6 +1930,19 @@
 product EFFICIENTNETS ENI25P	0x0003	SpeedStream ENI-25p
 product EFFICIENTNETS SS3000	0x0005	SpeedStream 3000
 
+/* Freescale Semiconductor products */
+product FREESCALE MPC8548E	0x0012	MPC8548E
+product FREESCALE MPC8548	0x0013	MPC8548
+product FREESCALE MPC8543E	0x0014	MPC8543E
+product FREESCALE MPC8543	0x0015	MPC8543
+product FREESCALE MPC8547E	0x0018	MPC8547E
+product FREESCALE MPC8545E	0x0019	MPC8545E
+product FREESCALE MPC8545	0x001a	MPC8545
+product FREESCALE MPC8544E	0x0032	MPC8544E
+product FREESCALE MPC8544	0x0033	MPC8544
+product FREESCALE MPC8572E	0x0040	MPC8572E
+product FREESCALE MPC8572	0x0041	MPC8572
+
 /* Marvell products */
 product MARVELL GT64010A	0x0146	GT-64010A System Controller
 product MARVELL 88W8300_1	0x1fa6	Libertas 88W8300
@@ -2896,6 +2912,10 @@
 product MOT MPC8240	0x0003	MPC8240 \Kahlua\ Host Bridge
 product MOT MPC107	0x0004	MPC107 \Chaparral\ Host Bridge
 product MOT MPC8245	0x0006	MPC8245 \Kahlua II\ Host Bridge
+product MOT MPC8555E	0x000a	MPC8555E
+product MOT MPC8541	0x000c	MPC8541
+product MOT MPC8548E	0x0012  MPC8548E
+product MOT MPC8548	0x0013  MPC8548
 product MOT RAVEN	0x4801	Raven Host Bridge  Multi-Processor Interrupt Controller
 product MOT FALCON	0x4802	Falcon ECC Memory Controller Chip Set
 product MOT HAWK	0x4803	Hawk System Memory Controller  PCI Host Bridge
@@ -3073,6 +3093,7 @@
 product NETMOS NM9835	0x9835	Dual UART and 1284 Printer port
 product NETMOS NM9845	0x9845	Quad UART and 1284 Printer port
 product NETMOS NM9855	0x9855	9855 Quad UART and 1284 Printer port
+product NETMOS MCS9990	0x9990	MCS9990 Quad USB 2.0 Port
 
 /* Network Security Technologies */
 product NETSEC 7751		0x7751	7751
@@ -3443,7 +3464,11 @@
 product PCTECH RZ1000	0x1000	RZ1000
 
 /* Peak System Technik products */
-product PEAK PCAN	0x0001	PCAN	CAN controller
+product PEAK PCAN	0x0001	PCAN CAN Controller
+
+/* Pericom Semiconductor products */
+product PERICOM P17C9X110	0xe110	P17C9X110 PCIe to PCI Bridge
+product PERICOM P17C9X	0xe111	P17C9X PCIe to PCI Bridge
 
 /* Planex products */
 product PLANEX FNW_3603_TX	0xab06	FNW-3603-TX 10/100 Ethernet



CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:22:31 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: pcidevs.h pcidevs_data.h

Log Message:
Regen.


To generate a diff of this commit:
cvs rdiff -u -r1.963.4.15 -r1.963.4.15.2.1 src/sys/dev/pci/pcidevs.h
cvs rdiff -u -r1.962.4.15 -r1.962.4.15.2.1 src/sys/dev/pci/pcidevs_data.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/pci/pcidevs.h
diff -u src/sys/dev/pci/pcidevs.h:1.963.4.15 src/sys/dev/pci/pcidevs.h:1.963.4.15.2.1
--- src/sys/dev/pci/pcidevs.h:1.963.4.15	Mon Nov 22 03:40:00 2010
+++ src/sys/dev/pci/pcidevs.h	Fri Jan  7 02:22:19 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: pcidevs.h,v 1.963.4.15 2010/11/22 03:40:00 riz Exp $	*/
+/*	$NetBSD: pcidevs.h,v 1.963.4.15.2.1 2011/01/07 02:22:19 matt Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD
+ *	NetBSD: pcidevs,v 1.962.4.15.2.1 2011/01/07 02:21:52 matt Exp
  */
 
 /*
@@ -538,6 +538,7 @@
 #define	PCI_VENDOR_USR2	0x16ec		/* US Robotics */
 #define	PCI_VENDOR_PICTUREEL	0x12c5		/* Picture Elements */
 #define	PCI_VENDOR_NVIDIA_SGS	0x12d2		/* Nvidia  SGS-Thomson Microelectronics */
+#define	PCI_VENDOR_PERICOM	0x12d8		/* Pericom Semiconductors */
 #define	PCI_VENDOR_RAINBOW	0x12de		/* Rainbow Technologies */
 #define	PCI_VENDOR_AUREAL	0x12eb		/* Aureal Semiconductor */
 #define	PCI_VENDOR_ADMTEK	0x1317		/* ADMtek */
@@ -609,6 +610,7 @@
 #define	PCI_VENDOR_LINKSYS2	0x17fe		/* Linksys */
 #define	PCI_VENDOR_RALINK	0x1814		/* Ralink Technologies */
 #define	PCI_VENDOR_BBELEC	0x1896		/* B  B Electronics */
+#define	PCI_VENDOR_FREESCALE	0x1957		/* Freescale Semiconductor */
 #define	PCI_VENDOR_ATTANSIC	0x1969		/* Attansic Technologies */
 #define	PCI_VENDOR_EVE	0x1adb		/* EVE */
 #define	PCI_VENDOR_SYMPHONY2	0x1c1c		/* Symphony Labs (2nd PCI Vendor ID) */
@@ -1069,6 +1071,7 @@
 /* Attansic Technology Corp. */
 #define	PCI_PRODUCT_ATTANSIC_ETHERNET_L1E	0x1026		/* L1E Gigabit Ethernet Adapter */
 #define	PCI_PRODUCT_ATTANSIC_ETHERNET_GIGA	0x1048		/* L1 Gigabit Ethernet Adapter */
+#define	PCI_PRODUCT_ATTANSIC_AR8131	0x1063		/* Atheros AR8131 Gigabit Ethernet Adapter */
 #define	PCI_PRODUCT_ATTANSIC_ETHERNET_100	0x2048		/* L2 100 Mbit Ethernet Adapter */
 
 /* ATI products */
@@ -1934,6 +1937,19 @@
 #define	PCI_PRODUCT_EFFICIENTNETS_ENI25P	0x0003		/* SpeedStream ENI-25p */
 #define	PCI_PRODUCT_EFFICIENTNETS_SS3000	0x0005		/* SpeedStream 3000 */
 
+/* Freescale Semiconductor products */
+#define	PCI_PRODUCT_FREESCALE_MPC8548E	0x0012		/* MPC8548E */
+#define	PCI_PRODUCT_FREESCALE_MPC8548	0x0013		/* MPC8548 */
+#define	PCI_PRODUCT_FREESCALE_MPC8543E	0x0014		/* MPC8543E */
+#define	PCI_PRODUCT_FREESCALE_MPC8543	0x0015		/* MPC8543 */
+#define	PCI_PRODUCT_FREESCALE_MPC8547E	0x0018		/* MPC8547E */
+#define	PCI_PRODUCT_FREESCALE_MPC8545E	0x0019		/* MPC8545E */
+#define	PCI_PRODUCT_FREESCALE_MPC8545	0x001a		/* MPC8545 */
+#define	PCI_PRODUCT_FREESCALE_MPC8544E	0x0032		/* MPC8544E */
+#define	PCI_PRODUCT_FREESCALE_MPC8544	0x0033		/* MPC8544 */
+#define	PCI_PRODUCT_FREESCALE_MPC8572E	0x0040		/* MPC8572E */
+#define	PCI_PRODUCT_FREESCALE_MPC8572	0x0041		/* MPC8572 */
+
 /* Marvell products */
 #define	PCI_PRODUCT_MARVELL_GT64010A	0x0146		/* GT-64010A System Controller */
 #define	PCI_PRODUCT_MARVELL_88W8300_1	0x1fa6		/* Libertas 88W8300 */
@@ -2903,6 +2919,10 @@
 #define	PCI_PRODUCT_MOT_MPC8240	0x0003		/* MPC8240 \Kahlua\ Host Bridge */
 #define	PCI_PRODUCT_MOT_MPC107	0x0004		/* MPC107 \Chaparral\ Host Bridge */
 #define	PCI_PRODUCT_MOT_MPC8245	0x0006		/* MPC8245 \Kahlua II\ Host Bridge */
+#define	PCI_PRODUCT_MOT_MPC8555E	0x000a		/* MPC8555E */
+#define	PCI_PRODUCT_MOT_MPC8541	0x000c		/* MPC8541 */
+#define	PCI_PRODUCT_MOT_MPC8548E	0x0012		/* MPC8548E */
+#define	PCI_PRODUCT_MOT_MPC8548	0x0013		/* MPC8548 */
 #define	PCI_PRODUCT_MOT_RAVEN	0x4801		/* Raven Host Bridge  Multi-Processor Interrupt Controller */
 #define	PCI_PRODUCT_MOT_FALCON	0x4802		/* Falcon ECC Memory Controller Chip Set */
 #define	PCI_PRODUCT_MOT_HAWK	0x4803		/* Hawk System Memory Controller  PCI Host Bridge */
@@ -3080,6 +3100,7 @@
 #define	PCI_PRODUCT_NETMOS_NM9835	0x9835		/* Dual UART and 1284 Printer port */
 #define	PCI_PRODUCT_NETMOS_NM9845	0x9845		/* Quad UART and 1284 Printer port */
 #define	PCI_PRODUCT_NETMOS_NM9855	0x9855		/* 9855 Quad UART and 1284 Printer port */
+#define	PCI_PRODUCT_NETMOS_MCS9990	0x9990		/* MCS9990 Quad USB 2.0 Port */
 
 /* Network Security Technologies */
 #define	PCI_PRODUCT_NETSEC_7751	0x7751		/* 7751 */
@@ -3450,7 +3471,11 @@
 #define	PCI_PRODUCT_PCTECH_RZ1000	0x1000		/* RZ1000 */
 
 /* Peak System Technik products */
-#define	PCI_PRODUCT_PEAK_PCAN	0x0001		/* PCAN CAN controller */
+#define	PCI_PRODUCT_PEAK_PCAN	0x0001		/* PCAN CAN Controller */
+
+/* Pericom Semiconductor products */
+#define	PCI_PRODUCT_PERICOM_P17C9X110	0xe110		/* 

CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:23:57 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: files.pci

Log Message:
arcmsr needs sysmon_envsys


To generate a diff of this commit:
cvs rdiff -u -r1.308.2.6 -r1.308.2.6.4.1 src/sys/dev/pci/files.pci

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/files.pci
diff -u src/sys/dev/pci/files.pci:1.308.2.6 src/sys/dev/pci/files.pci:1.308.2.6.4.1
--- src/sys/dev/pci/files.pci:1.308.2.6	Wed Oct 28 09:03:42 2009
+++ src/sys/dev/pci/files.pci	Fri Jan  7 02:23:57 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.pci,v 1.308.2.6 2009/10/28 09:03:42 bouyer Exp $
+#	$NetBSD: files.pci,v 1.308.2.6.4.1 2011/01/07 02:23:57 matt Exp $
 #
 # Config file and device description for machine-independent PCI code.
 # Included by ports that need it.  Requires that the SCSI files be
@@ -73,7 +73,7 @@
 file	dev/pci/ld_amr.c		ld_amr
 
 # Areca SATA RAID Controllers
-device	arcmsr: scsi
+device	arcmsr: scsi, sysmon_envsys
 attach	arcmsr at pci
 file	dev/pci/arcmsr.c		arcmsr
 



CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:24:49 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: ehci_pci.c usb_pci.h

Log Message:
Deal with multifunction pci devices better in choosing companion devices.


To generate a diff of this commit:
cvs rdiff -u -r1.38.10.1 -r1.38.10.1.4.1 src/sys/dev/pci/ehci_pci.c
cvs rdiff -u -r1.5 -r1.5.26.1 src/sys/dev/pci/usb_pci.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/pci/ehci_pci.c
diff -u src/sys/dev/pci/ehci_pci.c:1.38.10.1 src/sys/dev/pci/ehci_pci.c:1.38.10.1.4.1
--- src/sys/dev/pci/ehci_pci.c:1.38.10.1	Wed Jun 17 20:33:39 2009
+++ src/sys/dev/pci/ehci_pci.c	Fri Jan  7 02:24:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci_pci.c,v 1.38.10.1 2009/06/17 20:33:39 bouyer Exp $	*/
+/*	$NetBSD: ehci_pci.c,v 1.38.10.1.4.1 2011/01/07 02:24:49 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci_pci.c,v 1.38.10.1 2009/06/17 20:33:39 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci_pci.c,v 1.38.10.1.4.1 2011/01/07 02:24:49 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -228,13 +228,17 @@
 	 * Find companion controllers.  According to the spec they always
 	 * have lower function numbers so they should be enumerated already.
 	 */
+	const u_int maxncomp = EHCI_HCS_N_CC(EREAD4(sc-sc, EHCI_HCSPARAMS));
+	KASSERT(maxncomp = EHCI_COMPANION_MAX);
 	ncomp = 0;
 	TAILQ_FOREACH(up, ehci_pci_alldevs, next) {
-		if (up-bus == pa-pa_bus  up-device == pa-pa_device) {
+		if (up-bus == pa-pa_bus  up-device == pa-pa_device
+		 !up-claimed) {
 			DPRINTF((ehci_pci_attach: companion %s\n,
  device_xname(up-usb)));
 			sc-sc.sc_comps[ncomp++] = up-usb;
-			if (ncomp = EHCI_COMPANION_MAX)
+			up-claimed = true;
+			if (ncomp == maxncomp)
 break;
 		}
 	}

Index: src/sys/dev/pci/usb_pci.h
diff -u src/sys/dev/pci/usb_pci.h:1.5 src/sys/dev/pci/usb_pci.h:1.5.26.1
--- src/sys/dev/pci/usb_pci.h:1.5	Mon Apr 28 20:23:55 2008
+++ src/sys/dev/pci/usb_pci.h	Fri Jan  7 02:24:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usb_pci.h,v 1.5 2008/04/28 20:23:55 martin Exp $	*/
+/*	$NetBSD: usb_pci.h,v 1.5.26.1 2011/01/07 02:24:49 matt Exp $	*/
 
 /*
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -41,6 +41,7 @@
 	u_int		device;
 	u_int		function;
 	device_t	usb;
+	bool		claimed;
 };
 
 TAILQ_HEAD(usb_pci_alldevs, usb_pci);



CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:25:52 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: pciconf.c

Log Message:
Use kmem.  Fix prefetchable setting.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.30.56.1 src/sys/dev/pci/pciconf.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/pciconf.c
diff -u src/sys/dev/pci/pciconf.c:1.30 src/sys/dev/pci/pciconf.c:1.30.56.1
--- src/sys/dev/pci/pciconf.c:1.30	Thu May 24 15:57:58 2007
+++ src/sys/dev/pci/pciconf.c	Fri Jan  7 02:25:52 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pciconf.c,v 1.30 2007/05/24 15:57:58 briggs Exp $	*/
+/*	$NetBSD: pciconf.c,v 1.30.56.1 2011/01/07 02:25:52 matt Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pciconf.c,v 1.30 2007/05/24 15:57:58 briggs Exp $);
+__KERNEL_RCSID(0, $NetBSD: pciconf.c,v 1.30.56.1 2011/01/07 02:25:52 matt Exp $);
 
 #include opt_pci.h
 
@@ -74,6 +74,7 @@
 #include sys/queue.h
 #include sys/systm.h
 #include sys/malloc.h
+#include sys/kmem.h
 
 #include dev/pci/pcivar.h
 #include dev/pci/pciconf.h
@@ -320,7 +321,7 @@
 	pcireg_t	io, pmem;
 	pciconf_win_t	*pi, *pm;
 
-	pb = malloc (sizeof (pciconf_bus_t), M_DEVBUF, M_NOWAIT);
+	pb = kmem_zalloc(sizeof (pciconf_bus_t), KM_NOSLEEP);
 	if (!pb)
 		panic(Unable to allocate memory for PCI configuration.);
 
@@ -419,7 +420,7 @@
 
 	return pb;
 err:
-	free(pb, M_DEVBUF);
+	kmem_free(pb, sizeof(*pb));
 	return NULL;
 }
 
@@ -441,8 +442,10 @@
 	class = pci_conf_read(pb-pc, tag, PCI_CLASS_REG);
 
 	cmd = pci_conf_read(pb-pc, tag, PCI_COMMAND_STATUS_REG);
+	bhlc = pci_conf_read(pb-pc, tag, PCI_BHLC_REG);
 
-	if (PCI_CLASS(class) != PCI_CLASS_BRIDGE) {
+	if (PCI_CLASS(class) != PCI_CLASS_BRIDGE
+	 PCI_HDRTYPE_TYPE(bhlc) != PCI_HDRTYPE_PPB) {
 		cmd = ~(PCI_COMMAND_MASTER_ENABLE |
 		PCI_COMMAND_IO_ENABLE | PCI_COMMAND_MEM_ENABLE);
 		pci_conf_write(pb-pc, tag, PCI_COMMAND_STATUS_REG, cmd);
@@ -457,7 +460,6 @@
 	if ((cmd  PCI_STATUS_66MHZ_SUPPORT) == 0)
 		pb-freq_66 = 0;
 
-	bhlc = pci_conf_read(pb-pc, tag, PCI_BHLC_REG);
 	switch (PCI_HDRTYPE_TYPE(bhlc)) {
 	case PCI_HDRTYPE_DEVICE:
 		reg_start = PCI_MAPREG_START;
@@ -919,14 +921,14 @@
 	/*
 	 * XXX -- 64-bit systems need a lot more than just this...
 	 */
-	if (sizeof(u_long)  4) {
-		mem_base  = (int64_t) mem_base   32;
-		mem_limit = (int64_t) mem_limit  32;
-	}
-	pci_conf_write(pb-pc, pd-tag, PCI_BRIDGE_PREFETCHBASE32_REG,
-	mem_base  0x);
-	pci_conf_write(pb-pc, pd-tag, PCI_BRIDGE_PREFETCHLIMIT32_REG,
-	mem_limit  0x);
+	if (PCI_BRIDGE_PREFETCHMEM_64BITS(mem)) {
+		mem_base  = (uint64_t) mem_base   32;
+		mem_limit = (uint64_t) mem_limit  32;
+		pci_conf_write(pb-pc, pd-tag, PCI_BRIDGE_PREFETCHBASE32_REG,
+		mem_base  0x);
+		pci_conf_write(pb-pc, pd-tag, PCI_BRIDGE_PREFETCHLIMIT32_REG,
+		mem_limit  0x);
+	}
 
 	rv = configure_bus(pb);
 
@@ -1100,7 +1102,7 @@
 	pciconf_bus_t	*pb;
 	int		rv;
 
-	pb = malloc (sizeof (pciconf_bus_t), M_DEVBUF, M_NOWAIT);
+	pb = kmem_zalloc(sizeof (pciconf_bus_t), KM_NOSLEEP);
 	pb-busno = firstbus;
 	pb-next_busno = pb-busno + 1;
 	pb-last_busno = 255;
@@ -1128,6 +1130,6 @@
 	/*
 	 * All done!
 	 */
-	free(pb, M_DEVBUF);
+	kmem_free(pb, sizeof(*pb));
 	return rv;
 }



CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:26:15 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: pci_subr.c pcireg.h pcivar.h

Log Message:
Add/define some MSI support


To generate a diff of this commit:
cvs rdiff -u -r1.75.10.1 -r1.75.10.1.8.1 src/sys/dev/pci/pci_subr.c
cvs rdiff -u -r1.57.20.1 -r1.57.20.1.2.1 src/sys/dev/pci/pcireg.h
cvs rdiff -u -r1.83 -r1.83.18.1 src/sys/dev/pci/pcivar.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/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.75.10.1 src/sys/dev/pci/pci_subr.c:1.75.10.1.8.1
--- src/sys/dev/pci/pci_subr.c:1.75.10.1	Tue Feb 24 03:50:48 2009
+++ src/sys/dev/pci/pci_subr.c	Fri Jan  7 02:26:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pci_subr.c,v 1.75.10.1 2009/02/24 03:50:48 snj Exp $	*/
+/*	$NetBSD: pci_subr.c,v 1.75.10.1.8.1 2011/01/07 02:26:15 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Zubin D. Dittia.  All rights reserved.
@@ -40,7 +40,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pci_subr.c,v 1.75.10.1 2009/02/24 03:50:48 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: pci_subr.c,v 1.75.10.1.8.1 2011/01/07 02:26:15 matt Exp $);
 
 #ifdef _KERNEL_OPT
 #include opt_pci.h
@@ -433,8 +433,9 @@
 
 #define	i2o(i)	((i) * 4)
 #define	o2i(o)	((o) / 4)
-#define	onoff(str, bit)			\
-	printf(  %s: %s\n, (str), (rval  (bit)) ? on : off);
+#define	onoff2(str, bit, onstr, offstr)	\
+	printf(  %s: %s\n, (str), (rval  (bit)) ? onstr : offstr);
+#define	onoff(str, bit)	onoff2(str, bit, on, off)
 
 static void
 pci_conf_print_common(
@@ -477,6 +478,7 @@
 	onoff(Interrupt disable, PCI_COMMAND_INTERRUPT_DISABLE);
 
 	printf(Status register: 0x%04x\n, (rval  16)  0x);
+	onoff2(Interrupt status, PCI_STATUS_INT_STATUS, active, inactive);
 	onoff(Capability List support, PCI_STATUS_CAPLIST_SUPPORT);
 	onoff(66 MHz capable, PCI_STATUS_66MHZ_SUPPORT);
 	onoff(User Definable Features (UDF) support, PCI_STATUS_UDF_SUPPORT);
@@ -819,6 +821,29 @@
 		printf(Slot implemented\n);
 	printf(Interrupt Message Number: %x\n,
 	(unsigned int)((regs[o2i(capoff)]  0x4e00)  27));
+	printf(Link Capabilities Register: 0x%08x\n,
+	regs[o2i(capoff + 0x0c)]);
+	printf(  Maximum Link Speed: );
+	if ((regs[o2i(capoff + 0x0c)]  0x000f) != 1) {
+		printf(unknown %u value\n, 
+		(regs[o2i(capoff + 0x0c)]  0x000f));
+	} else {
+		printf(2.5Gb/s\n);
+	}
+	printf(  Maximum Link Width: x%u lanes\n,
+	(regs[o2i(capoff + 0x0c)]  0x03f0)  4);
+	printf(  Port Number: %u\n, regs[o2i(capoff + 0x0c)]  24);
+	printf(Link Status Register: 0x%04x\n,
+	regs[o2i(capoff + 0x10)]  16);
+	printf(  Negotiated Link Speed: );
+	if (((regs[o2i(capoff + 0x10)]  16)  0x000f) != 1) {
+		printf(unknown %u value\n, 
+		(regs[o2i(capoff + 0x10)]  16)  0x000f);
+	} else {
+		printf(2.5Gb/s\n);
+	}
+	printf(  Negotiated Link Width: x%u lanes\n,
+	(regs[o2i(capoff + 0x10)]  20)  0x003f);
 	if ((regs[o2i(capoff + 0x18)]  0x07ff) != 0) {
 		printf(Slot Control Register:\n);
 		if ((regs[o2i(capoff + 0x18)]  0x0001) != 0)
@@ -934,6 +959,41 @@
 }
 
 static void
+pci_conf_print_msi_cap(const pcireg_t *regs, int capoff)
+{
+	uint32_t ctl, mmc, mme;
+
+	regs += o2i(capoff);
+	ctl = *regs++;
+	mmc = (ctl  PCI_MSI_CTL_MMC_SHIFT)  PCI_MSI_CTL_MMC_MASK;
+	mme = (ctl  PCI_MSI_CTL_MME_SHIFT)  PCI_MSI_CTL_MME_MASK;
+
+	printf(\n  PCI Message Signaled Interrupt\n);
+
+	printf(Message Control register: 0x%04x\n, ctl  16);
+	printf(  MSI Enabled: %s\n,
+	ctl  PCI_MSI_CTL_MSI_ENABLE ? yes : no);
+	printf(  Multiple Message Capable: %s (%d vector%s)\n,
+	mmc  0 ? yes : no, 1  mmc, mmc  0 ? s : );
+	printf(  Multiple Message Enabled: %s (%d vector%s)\n,
+	mme  0 ? on : off, 1  mme, mme  0 ? s : );
+	printf(  64 Bit Address Capable: %s\n,
+	ctl  PCI_MSI_CTL_64BIT_ADDR ? yes : no);
+	printf(  Per-Vector Masking Capable: %s\n,
+	ctl  PCI_MSI_CTL_PERVEC_MASK ? yes : no);
+	printf(Message Address %sregister: 0x%08x\n,
+	ctl  PCI_MSI_CTL_64BIT_ADDR ? (lower)  : , *regs++);
+	if (ctl  PCI_MSI_CTL_64BIT_ADDR) {
+		printf(Message Address %sregister: 0x%08x\n,
+		(upper) , *regs++);
+	}
+	printf(Message Data register: 0x%08x\n, *regs++);
+	if (ctl  PCI_MSI_CTL_PERVEC_MASK) {
+		printf(Vector Mask register: 0x%08x\n, *regs++);
+		printf(Vector Pending register: 0x%08x\n, *regs++);
+	}
+}
+static void
 pci_conf_print_caplist(
 #ifdef _KERNEL
 pci_chipset_tag_t pc, pcitag_t tag,
@@ -942,7 +1002,7 @@
 {
 	int off;
 	pcireg_t rval;
-	int pcie_off = -1, pcipm_off = -1;
+	int pcie_off = -1, pcipm_off = -1, msi_off = -1;
 
 	for (off = PCI_CAPLIST_PTR(regs[o2i(capoff)]);
 	 off != 0;
@@ -973,6 +1033,7 @@
 			break;
 		case PCI_CAP_MSI:
 			printf(MSI);
+			msi_off = off;
 			break;
 		case PCI_CAP_CPCI_HOTSWAP:
 			printf(CompactPCI 

CVS commit: [matt-nb5-pq3] src/sys/dev/pci

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:27:15 UTC 2011

Modified Files:
src/sys/dev/pci [matt-nb5-pq3]: ppb.c

Log Message:
On powerpc systems, match powerpc processors which are really PCIe PPBs.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.22.1 src/sys/dev/pci/ppb.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/ppb.c
diff -u src/sys/dev/pci/ppb.c:1.39 src/sys/dev/pci/ppb.c:1.39.22.1
--- src/sys/dev/pci/ppb.c:1.39	Sat May  3 05:44:06 2008
+++ src/sys/dev/pci/ppb.c	Fri Jan  7 02:27:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppb.c,v 1.39 2008/05/03 05:44:06 cegger Exp $	*/
+/*	$NetBSD: ppb.c,v 1.39.22.1 2011/01/07 02:27:15 matt Exp $	*/
 
 /*
  * Copyright (c) 1996, 1998 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.39 2008/05/03 05:44:06 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: ppb.c,v 1.39.22.1 2011/01/07 02:27:15 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -68,6 +68,17 @@
 	PCI_SUBCLASS(pa-pa_class) == PCI_SUBCLASS_BRIDGE_PCI)
 		return 1;
 
+#ifdef __powerpc__
+	if (PCI_CLASS(pa-pa_class) == PCI_CLASS_PROCESSOR 
+	PCI_SUBCLASS(pa-pa_class) == PCI_SUBCLASS_PROCESSOR_POWERPC) {
+		pcireg_t bhlc = pci_conf_read(pa-pa_pc, pa-pa_tag,
+		PCI_BHLC_REG);
+		if (PCI_VENDOR(pa-pa_id) == PCI_VENDOR_FREESCALE
+		 PCI_HDRTYPE(bhlc) == PCI_HDRTYPE_RC)
+		return 1;
+	}
+#endif
+
 	return 0;
 }
 



CVS commit: [matt-nb5-pq3] src/sys/dev

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:27:43 UTC 2011

Modified Files:
src/sys/dev [matt-nb5-pq3]: cons.c

Log Message:
Add critpollhooks.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.65.32.1 src/sys/dev/cons.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/cons.c
diff -u src/sys/dev/cons.c:1.65 src/sys/dev/cons.c:1.65.32.1
--- src/sys/dev/cons.c:1.65	Thu Jan 24 17:32:52 2008
+++ src/sys/dev/cons.c	Fri Jan  7 02:27:42 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cons.c,v 1.65 2008/01/24 17:32:52 ad Exp $	*/
+/*	$NetBSD: cons.c,v 1.65.32.1 2011/01/07 02:27:42 matt Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cons.c,v 1.65 2008/01/24 17:32:52 ad Exp $);
+__KERNEL_RCSID(0, $NetBSD: cons.c,v 1.65.32.1 2011/01/07 02:27:42 matt Exp $);
 
 #include sys/param.h
 #include sys/proc.h
@@ -279,7 +279,15 @@
 {
 	if (cn_tab == NULL)
 		return (0);
-	return ((*cn_tab-cn_getc)(cn_tab-cn_dev));
+	int s = splserial();
+	for (;;) {
+		const int rv = (*cn_tab-cn_getc)(cn_tab-cn_dev);
+		if (rv = 0) {
+			splx(s);
+			return rv;
+		}
+		docritpollhooks();
+	}
 }
 
 int
@@ -337,8 +345,10 @@
 
 	if (c) {
 		(*cn_tab-cn_putc)(cn_tab-cn_dev, c);
-		if (c == '\n')
+		if (c == '\n') {
+			docritpollhooks();
 			(*cn_tab-cn_putc)(cn_tab-cn_dev, '\r');
+		}
 	}
 }
 



CVS commit: [matt-nb5-pq3] src/sys/dev/ic

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:28:45 UTC 2011

Modified Files:
src/sys/dev/ic [matt-nb5-pq3]: com.c

Log Message:
Let's cons.c poll and so don't loop until a chacater becomes available.


To generate a diff of this commit:
cvs rdiff -u -r1.286 -r1.286.14.1 src/sys/dev/ic/com.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/ic/com.c
diff -u src/sys/dev/ic/com.c:1.286 src/sys/dev/ic/com.c:1.286.14.1
--- src/sys/dev/ic/com.c:1.286	Sat Oct 25 17:50:29 2008
+++ src/sys/dev/ic/com.c	Fri Jan  7 02:28:45 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: com.c,v 1.286 2008/10/25 17:50:29 matt Exp $ */
+/* $NetBSD: com.c,v 1.286.14.1 2011/01/07 02:28:45 matt Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2004, 2008 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: com.c,v 1.286 2008/10/25 17:50:29 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: com.c,v 1.286.14.1 2011/01/07 02:28:45 matt Exp $);
 
 #include opt_com.h
 #include opt_ddb.h
@@ -2090,9 +2090,11 @@
 		return (c);
 	}
 
-	/* block until a character becomes available */
-	while (!ISSET(stat = CSR_READ_1(regsp, COM_REG_LSR), LSR_RXRDY))
-		;
+	/* don't block until a character becomes available */
+	if (!ISSET(stat = CSR_READ_1(regsp, COM_REG_LSR), LSR_RXRDY)) {
+		splx(s);
+		return -1;
+	}
 
 	c = CSR_READ_1(regsp, COM_REG_RXDATA);
 	stat = CSR_READ_1(regsp, COM_REG_IIR);



CVS commit: [matt-nb5-pq3] src/sys/dev/ic

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:29:43 UTC 2011

Modified Files:
src/sys/dev/ic [matt-nb5-pq3]: cpc700.c

Log Message:
pci_chipset_tag_t can't be NULL.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.14.22.1 src/sys/dev/ic/cpc700.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/ic/cpc700.c
diff -u src/sys/dev/ic/cpc700.c:1.14 src/sys/dev/ic/cpc700.c:1.14.22.1
--- src/sys/dev/ic/cpc700.c:1.14	Mon Apr 28 20:23:49 2008
+++ src/sys/dev/ic/cpc700.c	Fri Jan  7 02:29:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpc700.c,v 1.14 2008/04/28 20:23:49 martin Exp $	*/
+/*	$NetBSD: cpc700.c,v 1.14.22.1 2011/01/07 02:29:43 matt Exp $	*/
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -50,7 +50,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpc700.c,v 1.14 2008/04/28 20:23:49 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpc700.c,v 1.14.22.1 2011/01/07 02:29:43 matt Exp $);
 
 #include pci.h
 #include opt_pci.h
@@ -173,7 +173,7 @@
 	aa.pba.pba_iot = pciio;
 	aa.pba.pba_memt = mem;
 	aa.pba.pba_dmat = dma;
-	aa.pba.pba_pc = 0;
+	aa.pba.pba_pc = pc;
 	aa.pba.pba_flags = PCI_FLAGS_MEM_ENABLED | PCI_FLAGS_IO_ENABLED;
 	aa.pba.pba_bus = 0;
 



CVS commit: [matt-nb5-pq3] src/sys/dev/ic

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:30:16 UTC 2011

Modified Files:
src/sys/dev/ic [matt-nb5-pq3]: mk48txx.c mk48txxreg.h mk48txxvar.h

Log Message:
Add DS1553 support


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.25.26.1 src/sys/dev/ic/mk48txx.c
cvs rdiff -u -r1.10 -r1.10.26.1 src/sys/dev/ic/mk48txxreg.h
cvs rdiff -u -r1.6 -r1.6.26.1 src/sys/dev/ic/mk48txxvar.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/mk48txx.c
diff -u src/sys/dev/ic/mk48txx.c:1.25 src/sys/dev/ic/mk48txx.c:1.25.26.1
--- src/sys/dev/ic/mk48txx.c:1.25	Mon Apr 28 20:23:50 2008
+++ src/sys/dev/ic/mk48txx.c	Fri Jan  7 02:30:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mk48txx.c,v 1.25 2008/04/28 20:23:50 martin Exp $ */
+/*	$NetBSD: mk48txx.c,v 1.25.26.1 2011/01/07 02:30:16 matt Exp $ */
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -33,7 +33,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mk48txx.c,v 1.25 2008/04/28 20:23:50 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: mk48txx.c,v 1.25.26.1 2011/01/07 02:30:16 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -50,7 +50,7 @@
 uint8_t mk48txx_def_nvrd(struct mk48txx_softc *, int);
 void mk48txx_def_nvwr(struct mk48txx_softc *, int, uint8_t);
 
-struct {
+const struct {
 	const char *name;
 	bus_size_t nvramsz;
 	bus_size_t clkoff;
@@ -61,6 +61,7 @@
 	{ mk48t08, MK48T08_CLKSZ, MK48T08_CLKOFF, 0 },
 	{ mk48t18, MK48T18_CLKSZ, MK48T18_CLKOFF, 0 },
 	{ mk48t59, MK48T59_CLKSZ, MK48T59_CLKOFF, MK48TXX_EXT_REGISTERS },
+	{ ds1553, DS1553_CLKSZ, DS1553_CLKOFF, MK48TXX_EXT_REGISTERS },
 };
 
 void
@@ -127,10 +128,14 @@
 	dt-dt_mon = FROMBCD((*sc-sc_nvrd)(sc, clkoff + MK48TXX_IMON));
 	year = FROMBCD((*sc-sc_nvrd)(sc, clkoff + MK48TXX_IYEAR));
 
-	year += sc-sc_year0;
-	if (year  POSIX_BASE_YEAR 
-	(sc-sc_flag  MK48TXX_NO_CENT_ADJUST) == 0)
-		year += 100;
+	if (sc-sc_flag  MK48TXX_HAVE_CENT_REG) {
+		year += 100*FROMBCD(csr  MK48TXX_CSR_CENT_MASK);
+	} else {
+		year += sc-sc_year0;
+		if (year  POSIX_BASE_YEAR 
+		(sc-sc_flag  MK48TXX_NO_CENT_ADJUST) == 0)
+			year += 100;
+	}
 
 	dt-dt_year = year;
 
@@ -154,14 +159,21 @@
 	bus_size_t clkoff;
 	uint8_t csr;
 	int year;
+	int cent;
 
 	sc = handle-cookie;
 	clkoff = sc-sc_clkoffset;
 
-	year = dt-dt_year - sc-sc_year0;
-	if (year  99 
-	(sc-sc_flag  MK48TXX_NO_CENT_ADJUST) == 0)
-		year -= 100;
+	if ((sc-sc_flag  MK48TXX_HAVE_CENT_REG) == 0) {
+		cent = 0;
+		year = dt-dt_year - sc-sc_year0;
+		if (year  99 
+		(sc-sc_flag  MK48TXX_NO_CENT_ADJUST) == 0)
+			year -= 100;
+	} else {
+		cent = dt-dt_year / 100;
+		year = dt-dt_year % 100;
+	}
 
 	todr_wenable(handle, 1);
 	/* enable write */
@@ -177,6 +189,17 @@
 	(*sc-sc_nvwr)(sc, clkoff + MK48TXX_IMON, TOBCD(dt-dt_mon));
 	(*sc-sc_nvwr)(sc, clkoff + MK48TXX_IYEAR, TOBCD(year));
 
+	/*
+	 * If we have a century register and the century has changed
+	 * update it.
+	 */
+	if ((sc-sc_flag  MK48TXX_HAVE_CENT_REG)
+	 (csr  MK48TXX_CSR_CENT_MASK) != TOBCD(cent)) {
+		csr = ~MK48TXX_CSR_CENT_MASK;
+		csr |= MK48TXX_CSR_CENT_MASK  TOBCD(cent);
+		(*sc-sc_nvwr)(sc, clkoff + MK48TXX_ICSR, csr);
+	}
+
 	/* load them up */
 	csr = (*sc-sc_nvrd)(sc, clkoff + MK48TXX_ICSR);
 	csr = ~MK48TXX_CSR_WRITE;

Index: src/sys/dev/ic/mk48txxreg.h
diff -u src/sys/dev/ic/mk48txxreg.h:1.10 src/sys/dev/ic/mk48txxreg.h:1.10.26.1
--- src/sys/dev/ic/mk48txxreg.h:1.10	Mon Apr 28 20:23:50 2008
+++ src/sys/dev/ic/mk48txxreg.h	Fri Jan  7 02:30:16 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mk48txxreg.h,v 1.10 2008/04/28 20:23:50 martin Exp $ */
+/*	$NetBSD: mk48txxreg.h,v 1.10.26.1 2011/01/07 02:30:16 matt Exp $ */
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -57,7 +57,7 @@
 #define MK48TXX_IADAY	5	/* alarm day (1..31; BCD) */
 #define MK48TXX_IINTR	6	/* interrupts */
 #define MK48TXX_IWDOG	7	/* watchdog */
-#define MK48TXX_ICSR	8	/* control register */
+#define MK48TXX_ICSR	8	/* control register / century (DS1553) */
 #define MK48TXX_ISEC	9	/* seconds (0..59; BCD) */
 #define MK48TXX_IMIN	10	/* minutes (0..59; BCD) */
 #define MK48TXX_IHOUR	11	/* hour (0..23; BCD) */
@@ -88,6 +88,7 @@
 /* Bits in the control register */
 #define MK48TXX_CSR_WRITE	0x80	/* want to write */
 #define MK48TXX_CSR_READ	0x40	/* want to read (freeze clock) */
+#define MK48TXX_CSR_CENT_MASK	0x3f	/* century mask */
 
 /* Bit in the weekday register */
 #define MK48TXX_WDAY_FT		0x40	/* freq test: toggle sec[0] at 512Hz */
@@ -109,3 +110,6 @@
 
 #define MK48T59_CLKSZ		8192
 #define MK48T59_CLKOFF		0x1ff0
+
+#define	DS1553_CLKSZ		8192
+#define	DS1553_CLKOFF		0x1ff0

Index: src/sys/dev/ic/mk48txxvar.h
diff -u src/sys/dev/ic/mk48txxvar.h:1.6 src/sys/dev/ic/mk48txxvar.h:1.6.26.1
--- src/sys/dev/ic/mk48txxvar.h:1.6	Mon Apr 28 20:23:50 2008
+++ src/sys/dev/ic/mk48txxvar.h	Fri Jan  7 02:30:16 2011
@@ 

CVS commit: [matt-nb5-pq3] src/sys/dev/sysmon

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:31:01 UTC 2011

Modified Files:
src/sys/dev/sysmon [matt-nb5-pq3]: sysmon_wdog.c sysmonvar.h

Log Message:
Allow kernel ticklers to turn themselves on at boot.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.36.1 src/sys/dev/sysmon/sysmon_wdog.c
cvs rdiff -u -r1.27 -r1.27.20.1 src/sys/dev/sysmon/sysmonvar.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_wdog.c
diff -u src/sys/dev/sysmon/sysmon_wdog.c:1.24 src/sys/dev/sysmon/sysmon_wdog.c:1.24.36.1
--- src/sys/dev/sysmon/sysmon_wdog.c:1.24	Sun Dec 16 21:07:45 2007
+++ src/sys/dev/sysmon/sysmon_wdog.c	Fri Jan  7 02:31:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmon_wdog.c,v 1.24 2007/12/16 21:07:45 dyoung Exp $	*/
+/*	$NetBSD: sysmon_wdog.c,v 1.24.36.1 2011/01/07 02:31:00 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sysmon_wdog.c,v 1.24 2007/12/16 21:07:45 dyoung Exp $);
+__KERNEL_RCSID(0, $NetBSD: sysmon_wdog.c,v 1.24.36.1 2011/01/07 02:31:00 matt Exp $);
 
 #include sys/param.h
 #include sys/conf.h
@@ -64,11 +64,13 @@
 static struct sysmon_wdog *sysmon_armed_wdog;
 static callout_t sysmon_wdog_callout;
 static void *sysmon_wdog_sdhook;
+static void *sysmon_wdog_cphook;
 
 struct sysmon_wdog *sysmon_wdog_find(const char *);
 void	sysmon_wdog_release(struct sysmon_wdog *);
 int	sysmon_wdog_setmode(struct sysmon_wdog *, int, u_int);
 void	sysmon_wdog_ktickle(void *);
+void	sysmon_wdog_critpoll(void *);
 void	sysmon_wdog_shutdown(void *);
 void	sysmon_wdog_ref(struct sysmon_wdog *);
 
@@ -78,6 +80,13 @@
 	mutex_init(sysmon_wdog_list_mtx, MUTEX_DEFAULT, IPL_NONE);
 	mutex_init(sysmon_wdog_mtx, MUTEX_DEFAULT, IPL_SOFTCLOCK);
 	cv_init(sysmon_wdog_cv, wdogref);
+	sysmon_wdog_sdhook = shutdownhook_establish(sysmon_wdog_shutdown, NULL);
+	if (sysmon_wdog_sdhook == NULL)
+		printf(WARNING: unable to register watchdog shutdown hook\n);
+	sysmon_wdog_cphook = critpollhook_establish(sysmon_wdog_critpoll, NULL);
+	if (sysmon_wdog_cphook == NULL)
+		printf(WARNING: unable to register watchdog critpoll hook\n);
+	callout_init(sysmon_wdog_callout, 0);
 }
 
 /*
@@ -89,17 +98,6 @@
 sysmonopen_wdog(dev_t dev, int flag, int mode, struct lwp *l)
 {
 
-	mutex_enter(sysmon_wdog_list_mtx);
-	if (sysmon_wdog_sdhook == NULL) {
-		sysmon_wdog_sdhook =
-		shutdownhook_establish(sysmon_wdog_shutdown, NULL);
-		if (sysmon_wdog_sdhook == NULL)
-			printf(WARNING: unable to register watchdog 
-			shutdown hook\n);
-		callout_init(sysmon_wdog_callout, 0);
-	}
-	mutex_exit(sysmon_wdog_list_mtx);
-
 	return 0;
 }
 
@@ -323,6 +321,27 @@
 }
 
 /*
+ * sysmon_wdog_critpoll:
+ *
+ *	Perform critical operations during long polling periods
+ */
+void
+sysmon_wdog_critpoll(void *arg)
+{
+	struct sysmon_wdog *smw = sysmon_armed_wdog;
+
+	if (smw == NULL)
+		return;
+
+	if ((smw-smw_mode  WDOG_MODE_MASK) == WDOG_MODE_KTICKLE) {
+		if ((*smw-smw_tickle)(smw) != 0) {
+			printf(WARNING: KERNEL TICKLE OF WATCHDOG %s 
+			FAILED!\n, smw-smw_name);
+		}
+	}
+}
+
+/*
  * sysmon_wdog_find:
  *
  *	Find a watchdog device.  We increase the reference

Index: src/sys/dev/sysmon/sysmonvar.h
diff -u src/sys/dev/sysmon/sysmonvar.h:1.27 src/sys/dev/sysmon/sysmonvar.h:1.27.20.1
--- src/sys/dev/sysmon/sysmonvar.h:1.27	Tue Jun  3 15:00:57 2008
+++ src/sys/dev/sysmon/sysmonvar.h	Fri Jan  7 02:31:00 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sysmonvar.h,v 1.27 2008/06/03 15:00:57 jmcneill Exp $	*/
+/*	$NetBSD: sysmonvar.h,v 1.27.20.1 2011/01/07 02:31:00 matt Exp $	*/
 
 /*-
  * Copyright (c) 2000 Zembu Labs, Inc.
@@ -150,6 +150,7 @@
 int	sysmonclose_wdog(dev_t, int, int, struct lwp *);
 int	sysmonioctl_wdog(dev_t, u_long, void *, int, struct lwp *);
 
+int sysmon_wdog_setmode(struct sysmon_wdog *, int, u_int);
 int sysmon_wdog_register(struct sysmon_wdog *);
 int sysmon_wdog_unregister(struct sysmon_wdog *);
 



CVS commit: [matt-nb5-pq3] src/sys/dev/ata

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:31:56 UTC 2011

Modified Files:
src/sys/dev/ata [matt-nb5-pq3]: sata_subr.c

Log Message:
small fixes (constification + comment type).


To generate a diff of this commit:
cvs rdiff -u -r1.11.10.1 -r1.11.10.1.8.1 src/sys/dev/ata/sata_subr.c

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

Modified files:

Index: src/sys/dev/ata/sata_subr.c
diff -u src/sys/dev/ata/sata_subr.c:1.11.10.1 src/sys/dev/ata/sata_subr.c:1.11.10.1.8.1
--- src/sys/dev/ata/sata_subr.c:1.11.10.1	Sat Nov 22 04:48:41 2008
+++ src/sys/dev/ata/sata_subr.c	Fri Jan  7 02:31:56 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sata_subr.c,v 1.11.10.1 2008/11/22 04:48:41 snj Exp $	*/
+/*	$NetBSD: sata_subr.c,v 1.11.10.1.8.1 2011/01/07 02:31:56 matt Exp $	*/
 
 /*-
  * Copyright (c) 2004 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
  * Common functions for Serial ATA.
  */
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sata_subr.c,v 1.11.10.1 2008/11/22 04:48:41 snj Exp $);
+__KERNEL_RCSID(0, $NetBSD: sata_subr.c,v 1.11.10.1.8.1 2011/01/07 02:31:56 matt Exp $);
 
 #include sys/param.h
 #include sys/kernel.h
@@ -51,7 +51,7 @@
 const char *
 sata_speed(uint32_t sstatus)
 {
-	static const char *sata_speedtab[] = {
+	static const char * const sata_speedtab[] = {
 		no negotiated speed,
 		1.5Gb/s,
 		3.0Gb/s,
@@ -85,7 +85,7 @@
 	int i;
 
 	/* bring the PHYs online.
-	 * The work-around for errata #1 for the 31244 says that we must
+	 * The work-around for errata #1 for the 3124 says that we must
 	 * write 0 to the port first to be sure of correctly initializing
 	 * the device. It doesn't hurt for other devices.
 	 */



CVS commit: [matt-nb5-pq3] src/sys/dev/usb

2011-01-06 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Fri Jan  7 02:33:22 UTC 2011

Modified Files:
src/sys/dev/usb [matt-nb5-pq3]: ohci.c

Log Message:
move/change a few debug printfs


To generate a diff of this commit:
cvs rdiff -u -r1.196 -r1.196.14.1 src/sys/dev/usb/ohci.c

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

Modified files:

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.196 src/sys/dev/usb/ohci.c:1.196.14.1
--- src/sys/dev/usb/ohci.c:1.196	Wed Aug 13 09:43:56 2008
+++ src/sys/dev/usb/ohci.c	Fri Jan  7 02:33:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.196 2008/08/13 09:43:56 drochner Exp $	*/
+/*	$NetBSD: ohci.c,v 1.196.14.1 2011/01/07 02:33:21 matt Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.196 2008/08/13 09:43:56 drochner Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.196.14.1 2011/01/07 02:33:21 matt Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -930,7 +930,7 @@
 	usb_callout_init(sc-sc_tmo_rhsc);
 
 	/* Finally, turn on interrupts. */
-	DPRINTFN(1,(ohci_init: enabling\n));
+	DPRINTFN(1,(ohci_init: enabling %#x\n, sc-sc_eintrs | OHCI_MIE));
 	OWRITE4(sc, OHCI_INTERRUPT_ENABLE, sc-sc_eintrs | OHCI_MIE);
 
 	return (USBD_NORMAL_COMPLETION);
@@ -1185,15 +1185,15 @@
 
 	OWRITE4(sc, OHCI_INTERRUPT_STATUS, intrs  ~(OHCI_MIE|OHCI_WDH)); /* Acknowledge */
 	eintrs = intrs  sc-sc_eintrs;
+	DPRINTFN(7, (ohci_intr: sc=%p intrs=%#x(%#x) eintrs=%#x(%#x)\n,
+		 sc, (u_int)intrs, OREAD4(sc, OHCI_INTERRUPT_STATUS),
+		 (u_int)eintrs, sc-sc_eintrs));
+
 	if (!eintrs)
 		return (0);
 
 	sc-sc_bus.intr_context++;
 	sc-sc_bus.no_intrs++;
-	DPRINTFN(7, (ohci_intr: sc=%p intrs=0x%x(0x%x) eintrs=0x%x\n,
-		 sc, (u_int)intrs, OREAD4(sc, OHCI_INTERRUPT_STATUS),
-		 (u_int)eintrs));
-
 	if (eintrs  OHCI_SO) {
 		sc-sc_overrun_cnt++;
 		if (usbd_ratecheck(sc-sc_overrun_ntc)) {



  1   2   >