CVS commit: src/sys/kern

2012-04-05 Thread Juergen Hannken-Illjes
Module Name:src
Committed By:   hannken
Date:   Thu Apr  5 07:26:37 UTC 2012

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

Log Message:
Fix vn_lock() to return an invalid (dead, clean) vnode
only if the caller requested it by setting LK_RETRY.

Should fix PR #46221: Kernel panic in NFS server code


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/kern/vfs_vnops.c

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

Modified files:

Index: src/sys/kern/vfs_vnops.c
diff -u src/sys/kern/vfs_vnops.c:1.183 src/sys/kern/vfs_vnops.c:1.184
--- src/sys/kern/vfs_vnops.c:1.183	Fri Oct 14 09:23:31 2011
+++ src/sys/kern/vfs_vnops.c	Thu Apr  5 07:26:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: vfs_vnops.c,v 1.183 2011/10/14 09:23:31 hannken Exp $	*/
+/*	$NetBSD: vfs_vnops.c,v 1.184 2012/04/05 07:26:36 hannken Exp $	*/
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.183 2011/10/14 09:23:31 hannken Exp $);
+__KERNEL_RCSID(0, $NetBSD: vfs_vnops.c,v 1.184 2012/04/05 07:26:36 hannken Exp $);
 
 #include veriexec.h
 
@@ -805,6 +805,15 @@ vn_lock(struct vnode *vp, int flags)
 		} else {
 			mutex_exit(vp-v_interlock);
 			error = VOP_LOCK(vp, (flags  ~LK_RETRY));
+			if (error == 0  (flags  LK_RETRY) == 0) {
+mutex_enter(vp-v_interlock);
+if ((vp-v_iflag  VI_CLEAN)) {
+	mutex_exit(vp-v_interlock);
+	VOP_UNLOCK(vp);
+	return ENOENT;
+}
+mutex_exit(vp-v_interlock);
+			}
 			if (error == 0 || error == EDEADLK || error == EBUSY)
 return (error);
 		}



CVS commit: src/etc

2012-04-05 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Thu Apr  5 09:09:27 UTC 2012

Modified Files:
src/etc: security
src/etc/defaults: security.conf

Log Message:
change security so that there is a configuration value for the list of
users who will not be considered for duplicate uid check.
Seed it with 'toor' in defaults/security.conf.


To generate a diff of this commit:
cvs rdiff -u -r1.110 -r1.111 src/etc/security
cvs rdiff -u -r1.23 -r1.24 src/etc/defaults/security.conf

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

Modified files:

Index: src/etc/security
diff -u src/etc/security:1.110 src/etc/security:1.111
--- src/etc/security:1.110	Wed Mar  2 17:00:28 2011
+++ src/etc/security	Thu Apr  5 09:09:27 2012
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: security,v 1.110 2011/03/02 17:00:28 christos Exp $
+#	$NetBSD: security,v 1.111 2012/04/05 09:09:27 spz Exp $
 #	from: @(#)security	8.1 (Berkeley) 6/9/93
 #
 
@@ -287,14 +287,18 @@ if checkyesno check_passwd; then
 		column $OUTPUT
 	fi
 
-# To not exclude 'toor', a standard duplicate root account, from the duplicate
-# account test, uncomment the line below (without egrep in it)and comment
-# out the line (with egrep in it) below it.
-#
-#	 $MPBYUID uniq -d -f 1 | awk '{ print $2 }'  $TMP2
-	 $MPBYUID egrep -v '^toor ' | uniq -d -f 1 | awk '{ print $2 }'  $TMP2
+	awk -v permit_dups_list=$check_passwd_permit_dups \
+	'
+	BEGIN {
+		split(permit_dups_list, a);
+		for (i in a) permit_dups[a[i]]++;
+	}
+	{
+		if (!permit_dups[$1])
+			print $2;
+	}'  $MPBYUID | uniq -d  $TMP2
 	if [ -s $TMP2 ] ; then
-		printf \n$MP has duplicate user id's.\n
+		printf \n$MP has duplicate user ids.\n
 		while read uid; do
 			grep -w $uid $MPBYUID
 		done  $TMP2 | column

Index: src/etc/defaults/security.conf
diff -u src/etc/defaults/security.conf:1.23 src/etc/defaults/security.conf:1.24
--- src/etc/defaults/security.conf:1.23	Fri Feb  5 16:29:02 2010
+++ src/etc/defaults/security.conf	Thu Apr  5 09:09:27 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: security.conf,v 1.23 2010/02/05 16:29:02 jmmv Exp $
+#	$NetBSD: security.conf,v 1.24 2012/04/05 09:09:27 spz Exp $
 #
 # /etc/defaults/security.conf --
 #	default configuration of /etc/security.conf
@@ -41,6 +41,7 @@ check_mtree_follow_symlinks=NO
 
 check_passwd_nowarn_shells=/sbin/nologin
 check_passwd_nowarn_users=
+check_passwd_permit_dups=toor
 check_passwd_permit_star=NO
 check_passwd_permit_nonalpha=NO
 max_loginlen=16



CVS commit: src/share/man/man5

2012-04-05 Thread S.P.Zeidler
Module Name:src
Committed By:   spz
Date:   Thu Apr  5 09:10:21 UTC 2012

Modified Files:
src/share/man/man5: security.conf.5

Log Message:
add a description for the new check_passwd_permit_dups variable


To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/share/man/man5/security.conf.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/security.conf.5
diff -u src/share/man/man5/security.conf.5:1.37 src/share/man/man5/security.conf.5:1.38
--- src/share/man/man5/security.conf.5:1.37	Fri Feb  5 17:23:47 2010
+++ src/share/man/man5/security.conf.5	Thu Apr  5 09:10:21 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: security.conf.5,v 1.37 2010/02/05 17:23:47 wiz Exp $
+.\	$NetBSD: security.conf.5,v 1.38 2012/04/05 09:10:21 spz Exp $
 .\
 .\ Copyright (c) 1996 Matthew R. Green
 .\ All rights reserved.
@@ -221,6 +221,10 @@ This is of particular value when those s
 If
 .Sy check_passwd
 is enabled, suppress warnings for these users.
+.It Sy check_passwd_permit_dups
+If
+.Sy check_passwd
+is enabled, do not warn about duplicate uids for the listed login names.
 .It Sy check_passwd_permit_nonalpha
 If
 .Sy check_passwd



CVS commit: src/share/man/man5

2012-04-05 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Thu Apr  5 09:15:56 UTC 2012

Modified Files:
src/share/man/man5: security.conf.5

Log Message:
Bump date for previous.


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/share/man/man5/security.conf.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/security.conf.5
diff -u src/share/man/man5/security.conf.5:1.38 src/share/man/man5/security.conf.5:1.39
--- src/share/man/man5/security.conf.5:1.38	Thu Apr  5 09:10:21 2012
+++ src/share/man/man5/security.conf.5	Thu Apr  5 09:15:56 2012
@@ -1,4 +1,4 @@
-.\	$NetBSD: security.conf.5,v 1.38 2012/04/05 09:10:21 spz Exp $
+.\	$NetBSD: security.conf.5,v 1.39 2012/04/05 09:15:56 wiz 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 February 5, 2010
+.Dd April 5, 2012
 .Dt SECURITY.CONF 5
 .Os
 .Sh NAME



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

2012-04-05 Thread Christoph Egger
Module Name:src
Committed By:   cegger
Date:   Thu Apr  5 11:05:54 UTC 2012

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

Log Message:
report l3 cache information on AMD Family 10h and newer processors


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

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

Modified files:

Index: src/usr.sbin/cpuctl/arch/i386.c
diff -u src/usr.sbin/cpuctl/arch/i386.c:1.29 src/usr.sbin/cpuctl/arch/i386.c:1.30
--- src/usr.sbin/cpuctl/arch/i386.c:1.29	Fri Mar  2 16:29:31 2012
+++ src/usr.sbin/cpuctl/arch/i386.c	Thu Apr  5 11:05:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i386.c,v 1.29 2012/03/02 16:29:31 sborrill Exp $	*/
+/*	$NetBSD: i386.c,v 1.30 2012/04/05 11:05:53 cegger Exp $	*/
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
 
 #include sys/cdefs.h
 #ifndef lint
-__RCSID($NetBSD: i386.c,v 1.29 2012/03/02 16:29:31 sborrill Exp $);
+__RCSID($NetBSD: i386.c,v 1.30 2012/04/05 11:05:53 cegger Exp $);
 #endif /* not lint */
 
 #include sys/types.h
@@ -1769,9 +1769,9 @@ amd_cpu_cacheinfo(struct cpu_info *ci)
 		cai-cai_associativity = 0;	/* XXX Unknown/reserved */
 
 	/*
-	 * Determine L3 cache info on AMD Family 10h processors
+	 * Determine L3 cache info on AMD Family 10h and newer processors
 	 */
-	if (family == 0x10) {
+	if (family = 0x10) {
 		cai = ci-ci_cinfo[CAI_L3CACHE];
 		cai-cai_totalsize = AMD_L3_EDX_C_SIZE(descs[3]);
 		cai-cai_associativity = AMD_L3_EDX_C_ASSOC(descs[3]);



CVS commit: src/sys/arch/x68k/stand/mboot

2012-04-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Apr  5 12:01:37 UTC 2012

Modified Files:
src/sys/arch/x68k/stand/mboot: Makefile mboot.c

Log Message:
Use common library libiocs.a.  suggested by tsutsui@.
o Originally, mboot had an IOCS_S_READEXT() inline function but
  its expansion corrupted (from somewhere after branching netbsd-5).
  This solves PR#46293 by using the common library.
  This problem was reported by Y.Sugahara at NetBSD booth at
  Open Source Conference (OSC) 2012 Ehime in March.
o As a side effect, it also correct the different problem that
  IOCS_S_READ() calls _S_READEXT not _S_READ.
Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/x68k/stand/mboot/Makefile
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/stand/mboot/mboot.c

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

Modified files:

Index: src/sys/arch/x68k/stand/mboot/Makefile
diff -u src/sys/arch/x68k/stand/mboot/Makefile:1.15 src/sys/arch/x68k/stand/mboot/Makefile:1.16
--- src/sys/arch/x68k/stand/mboot/Makefile:1.15	Mon Jan 12 07:56:31 2009
+++ src/sys/arch/x68k/stand/mboot/Makefile	Thu Apr  5 12:01:36 2012
@@ -1,4 +1,7 @@
-#	$NetBSD: Makefile,v 1.15 2009/01/12 07:56:31 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.16 2012/04/05 12:01:36 isaki Exp $
+
+NOMAN=		# defined
+.include bsd.own.mk
 
 BOOT=		mboot
 VERSION=	0.1
@@ -10,7 +13,6 @@ TEXTSZ=		1024
 PROG=		${BOOT}
 BINDIR=		/usr/mdec
 BINMODE=	444
-NOMAN=		# defined
 STRIPFLAG=
 
 STRIP?=		/usr/bin/strip
@@ -20,17 +22,19 @@ KERN!=		cd ${.CURDIR}/../../../..; pwd
 
 CPPFLAGS+=	-D_STANDALONE
 CPPFLAGS+=	-nostdinc -I${KERN} -I${.CURDIR} -I.
-#CPPFLAGS+=	-I${.CURDIR}/../libiocs
+CPPFLAGS+=	-I${.CURDIR}/../libiocs
 CPPFLAGS+=	-DTEXTADDR=0x${TEXT} 
 CPPFLAGS+=	-DBOOT=\${BOOT}\ -DBOOT_VERS=\${VERSION}\
 CFLAGS=		-Wno-main -Os -m68000
 
 LINKFLAGS=	-N -static -Ttext ${TEXT}
+LIBIOCS!=	cd ${.CURDIR}/../libiocs  ${PRINTOBJDIR}
+LDLIBS+=	${LIBIOCS}/libiocs.a
 
 .include ../Makefile.booters
 
 realall: ${PROG}
-${BOOT}:	${OBJS}
+${BOOT}:	${OBJS} ${LDLIBS}
 	${_MKTARGET_LINK}
 	${LD} ${LINKFLAGS} -o ${BOOT}.x ${OBJS} ${LDLIBS}
 #	${STRIP} ${BOOT}.x

Index: src/sys/arch/x68k/stand/mboot/mboot.c
diff -u src/sys/arch/x68k/stand/mboot/mboot.c:1.9 src/sys/arch/x68k/stand/mboot/mboot.c:1.10
--- src/sys/arch/x68k/stand/mboot/mboot.c:1.9	Sat Oct  1 15:59:01 2011
+++ src/sys/arch/x68k/stand/mboot/mboot.c	Thu Apr  5 12:01:36 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mboot.c,v 1.9 2011/10/01 15:59:01 chs Exp $	*/
+/*	$NetBSD: mboot.c,v 1.10 2012/04/05 12:01:36 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -32,105 +32,14 @@
 #include sys/types.h
 #include machine/disklabel.h
 
-int bootmain(int);
-
-struct iocs_readcap {
-	unsigned long	block;
-	unsigned long	size;
-};
-static inline int
-IOCS_BITSNS (int row)
-{
-	register unsigned int reg_d0 __asm (%d0);
-
-	__asm volatile (movel %1,%%d1\n\t
-			  movel #0x04,%0\n\t
-			  trap #15
-			  : =d (reg_d0)
-			  : ri ((int) row)
-			  : %d1);
-
-	return reg_d0;
-}
-static inline void
-IOCS_B_PRINT (const char *str)
-{
-	__asm volatile (moval %0,%%a1\n\t
-			  movel #0x21,%%d0\n\t
-			  trap #15\n\t
-			  :
-			  : a ((int) str)
-			  : %a1, %d0);
-	return;
-}
-static inline int
-IOCS_S_READCAP (int id, struct iocs_readcap *cap)
-{
-	register int reg_d0 __asm (%d0);
+#include iocs.h
 
-	__asm volatile (moveml %%d4,%%sp@-\n\t
-			  movel %2,%%d4\n\t
-			  moval %3,%%a1\n\t
-			  movel #0x25,%%d1\n\t
-			  movel #0xf5,%%d0\n\t
-			  trap #15\n\t
-			  moveml %%sp@+,%%d4
-			  : =d (reg_d0), =m (*cap)
-			  : ri (id), g ((int) cap)
-			  : %d1, %a1);
-
-	return reg_d0;
-}
-static inline int
-IOCS_S_READ (int pos, int blk, int id, int size, void *buf)
-{
-	register int reg_d0 __asm (%d0);
-
-	__asm volatile (moveml %%d3-%%d5,%%sp@-\n\t
-			  movel %2,%%d2\n\t
-			  movel %3,%%d3\n\t
-			  movel %4,%%d4\n\t
-			  movel %5,%%d5\n\t
-			  moval %6,%%a1\n\t
-			  movel #0x26,%%d1\n\t
-			  movel #0xf5,%%d0\n\t
-			  trap #15\n\t
-			  moveml %%sp@+,%%d3-%%d5
-			  : =d (reg_d0), =m (*(char*) buf)
-			  : ri (pos), ri (blk), ri (id), ri (size), g ((int) buf)
-			  : %d1, %d2, %a1);
-
-	return reg_d0;
-}
-
-static inline int
-IOCS_S_READEXT (int pos, int blk, int id, int size, void *buf)
-{
-	register int reg_d0 __asm (%d0);
-
-	__asm volatile (moveml %%d3-%%d5,%%sp@-\n\t
-			  movel %2,%%d2\n\t
-			  movel %3,%%d3\n\t
-			  movel %4,%%d4\n\t
-			  movel %5,%%d5\n\t
-			  moval %6,%%a1\n\t
-			  movel #0x26,%%d1\n\t
-			  movel #0xf5,%%d0\n\t
-			  trap #15\n\t
-			  moveml %%sp@+,%%d3-%%d5
-			  : =d (reg_d0), =m (*(char*) buf)
-			  : ri (pos), ri (blk), ri (id), ri (size), g ((int) buf)
-			  : %d1, %d2, %a1);
-
-	return reg_d0;
-}
+int bootmain(int);
 
 #define PART_BOOTABLE	0
 #define PART_UNUSED	1
 #define PART_INUSE	2
 
-
-
 int
 bootmain(int scsiid)
 {



CVS commit: src/sys/arch/x68k/stand

2012-04-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Apr  5 12:12:57 UTC 2012

Modified Files:
src/sys/arch/x68k/stand: Makefile

Log Message:
mboot now depends on libiocs. noticed by tsutsui@.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/x68k/stand/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/x68k/stand/Makefile
diff -u src/sys/arch/x68k/stand/Makefile:1.8 src/sys/arch/x68k/stand/Makefile:1.9
--- src/sys/arch/x68k/stand/Makefile:1.8	Sun Jan 27 01:07:00 2002
+++ src/sys/arch/x68k/stand/Makefile	Thu Apr  5 12:12:57 2012
@@ -1,6 +1,6 @@
-#	$NetBSD: Makefile,v 1.8 2002/01/27 01:07:00 minoura Exp $
+#	$NetBSD: Makefile,v 1.9 2012/04/05 12:12:57 isaki Exp $
 
-SUBDIR= mboot newdisk aout2hux libdos libiocs .WAIT loadbsd # common
-SUBDIR+= libsa .WAIT boot boot_ufs boot_ustar installboot
+SUBDIR= newdisk aout2hux libdos libiocs .WAIT loadbsd # common
+SUBDIR+= libsa .WAIT mboot boot boot_ufs boot_ustar installboot
 
 .include bsd.subdir.mk



CVS commit: src/sys/arch/hppa/hppa

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 16:13:47 UTC 2012

Added Files:
src/sys/arch/hppa/hppa: ipifuncs.c

Log Message:
Commit work in progress ipi functions.


To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 src/sys/arch/hppa/hppa/ipifuncs.c

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/hppa/hppa/ipifuncs.c
diff -u /dev/null src/sys/arch/hppa/hppa/ipifuncs.c:1.1
--- /dev/null	Thu Apr  5 16:13:47 2012
+++ src/sys/arch/hppa/hppa/ipifuncs.c	Thu Apr  5 16:13:46 2012
@@ -0,0 +1,211 @@
+/*	$NetBSD: ipifuncs.c,v 1.1 2012/04/05 16:13:46 skrll Exp $	*/
+/*	$OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $	*/
+
+/*
+ * Copyright (c) 2010 Joel Sing js...@openbsd.org
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED AS IS AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include sys/param.h
+#include sys/types.h
+#include sys/systm.h
+#include sys/mutex.h
+#include sys/device.h
+#include sys/atomic.h
+#include sys/xcall.h
+
+#include machine/cpu.h
+#include machine/cpufunc.h
+#if 0
+#include machine/fpu.h
+#endif
+#include machine/iomod.h
+#include machine/intr.h
+#include machine/mutex.h
+#include machine/reg.h
+#include machine/int_fmtio.h
+
+#include hppa/hppa/cpuvar.h
+
+void hppa_ipi_nop(void);
+void hppa_ipi_halt(void);
+void hppa_ipi_xcall(void);
+
+void (*ipifunc[HPPA_NIPI])(void) =
+{
+	hppa_ipi_nop,
+	hppa_ipi_halt,
+	hppa_ipi_xcall
+};
+
+const char *ipinames[HPPA_NIPI] = {
+	nop ipi,
+	halt ipi,
+	xcall ipi
+};
+
+void
+hppa_ipi_init(struct cpu_info *ci)
+{
+	struct cpu_softc *sc = ci-ci_softc;
+	int i;
+
+	evcnt_attach_dynamic(sc-sc_evcnt_ipi, EVCNT_TYPE_INTR,
+	NULL, device_xname(sc-sc_dev), ipi);
+
+	for (i = 0; i  HPPA_NIPI; i++) {
+		evcnt_attach_dynamic(sc-sc_evcnt_which_ipi[i],
+		EVCNT_TYPE_INTR, NULL, device_xname(sc-sc_dev),
+		ipinames[i]);
+	}
+}
+
+int
+hppa_ipi_intr(void *arg)
+{
+	struct cpu_info *ci = curcpu();
+	struct cpu_softc *sc = ci-ci_softc;
+	u_long ipi_pending;
+	int bit = 0;
+
+printf_nolog(%s: ci %p\n,__func__, curcpu());
+
+	/* Handle an IPI. */
+	ipi_pending = atomic_swap_ulong(ci-ci_ipi, 0);
+
+	KASSERT(ipi_pending);
+
+	sc-sc_evcnt_ipi.ev_count++;
+
+	while (ipi_pending) {
+		if (ipi_pending  (1L  bit)) {
+			sc-sc_evcnt_which_ipi[bit].ev_count++;
+			(*ipifunc[bit])();
+		}
+		ipi_pending = ~(1L  bit);
+		bit++;
+	}
+
+	return 1;
+}
+
+int
+hppa_ipi_send(struct cpu_info *ci, u_long ipi)
+{
+	struct iomod *cpu;
+printf_nolog(%s: made it\n, __func__);
+	KASSERT(ci-ci_flags  CPUF_RUNNING);
+
+	atomic_or_ulong(ci-ci_ipi, (1L  ipi));
+printf_nolog(%s: after atomic\n,__func__);
+
+	/* Send an IPI to the specified CPU by triggering EIR{1} (irq 30). */
+	cpu = (struct iomod *)(ci-ci_hpa);
+	cpu-io_eir = 1;
+	membar_sync();
+printf_nolog(%s: after io_eir ci %p\n,__func__, curcpu());
+
+	return 0;
+}
+
+int
+hppa_ipi_broadcast(u_long ipi)
+{
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
+	int count = 0;
+
+	for (CPU_INFO_FOREACH(cii, ci)) {
+		if (ci != curcpu()  (ci-ci_flags  CPUF_RUNNING))
+			if (hppa_ipi_send(ci, ipi))
+count++;
+	}
+	
+	return count;	
+}
+
+void
+hppa_ipi_nop(void)
+{
+}
+
+void
+hppa_ipi_halt(void)
+{
+	struct cpu_info *ci = curcpu();
+	
+	/* Turn off interrupts and halt CPU. */
+// 	hppa_intr_disable();
+	ci-ci_flags = ~CPUF_RUNNING;
+
+	for (;;)
+		;
+}
+
+#if 0
+void
+hppa_ipi_fpu_save(void)
+{
+	fpu_cpu_save(1);
+}
+
+void
+hppa_ipi_fpu_flush(void)
+{
+	fpu_cpu_save(0);
+}
+
+#endif
+
+void
+hppa_ipi_xcall(void)
+{
+	
+	xc_ipi_handler();
+}
+
+void
+xc_send_ipi(struct cpu_info *ci)
+{
+	
+	KASSERT(kpreempt_disabled());
+	KASSERT(curcpu() != ci);
+Debugger();
+	if (ci) {
+		/* Unicast: remote CPU. */
+		hppa_ipi_send(ci, HPPA_IPI_XCALL);
+	} else {
+		/* Broadcast: all, but local CPU (caller will handle it). */
+		hppa_ipi_broadcast(HPPA_IPI_XCALL);
+	}
+}
+	
+void hppa_ipi_counts(void);
+void
+hppa_ipi_counts(void)
+{
+	CPU_INFO_ITERATOR cii;
+	struct cpu_info *ci;
+	struct cpu_softc *sc;
+
+	for (CPU_INFO_FOREACH(cii, ci)) {
+		if ((ci-ci_flags  CPUF_RUNNING)) {
+			sc = ci-ci_softc;
+			printf(%s: ci %p cpuid %d total ipis % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_ipi.ev_count);
+			printf(%s: ci %p cpuid %d ipis bit 0 % PRIu64 \n, __func__, ci, 

CVS commit: src/sys/arch/hppa/hppa

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 16:16:01 UTC 2012

Modified Files:
src/sys/arch/hppa/hppa: ipifuncs.c

Log Message:
bah, remove a load of old (debug) code.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hppa/hppa/ipifuncs.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/hppa/hppa/ipifuncs.c
diff -u src/sys/arch/hppa/hppa/ipifuncs.c:1.1 src/sys/arch/hppa/hppa/ipifuncs.c:1.2
--- src/sys/arch/hppa/hppa/ipifuncs.c:1.1	Thu Apr  5 16:13:46 2012
+++ src/sys/arch/hppa/hppa/ipifuncs.c	Thu Apr  5 16:16:01 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ipifuncs.c,v 1.1 2012/04/05 16:13:46 skrll Exp $	*/
+/*	$NetBSD: ipifuncs.c,v 1.2 2012/04/05 16:16:01 skrll Exp $	*/
 /*	$OpenBSD: ipi.c,v 1.4 2011/01/14 13:20:06 jsing Exp $	*/
 
 /*
@@ -79,8 +79,6 @@ hppa_ipi_intr(void *arg)
 	u_long ipi_pending;
 	int bit = 0;
 
-printf_nolog(%s: ci %p\n,__func__, curcpu());
-
 	/* Handle an IPI. */
 	ipi_pending = atomic_swap_ulong(ci-ci_ipi, 0);
 
@@ -104,17 +102,14 @@ int
 hppa_ipi_send(struct cpu_info *ci, u_long ipi)
 {
 	struct iomod *cpu;
-printf_nolog(%s: made it\n, __func__);
 	KASSERT(ci-ci_flags  CPUF_RUNNING);
 
 	atomic_or_ulong(ci-ci_ipi, (1L  ipi));
-printf_nolog(%s: after atomic\n,__func__);
 
 	/* Send an IPI to the specified CPU by triggering EIR{1} (irq 30). */
 	cpu = (struct iomod *)(ci-ci_hpa);
 	cpu-io_eir = 1;
 	membar_sync();
-printf_nolog(%s: after io_eir ci %p\n,__func__, curcpu());
 
 	return 0;
 }
@@ -153,21 +148,6 @@ hppa_ipi_halt(void)
 		;
 }
 
-#if 0
-void
-hppa_ipi_fpu_save(void)
-{
-	fpu_cpu_save(1);
-}
-
-void
-hppa_ipi_fpu_flush(void)
-{
-	fpu_cpu_save(0);
-}
-
-#endif
-
 void
 hppa_ipi_xcall(void)
 {
@@ -181,7 +161,7 @@ xc_send_ipi(struct cpu_info *ci)
 	
 	KASSERT(kpreempt_disabled());
 	KASSERT(curcpu() != ci);
-Debugger();
+
 	if (ci) {
 		/* Unicast: remote CPU. */
 		hppa_ipi_send(ci, HPPA_IPI_XCALL);
@@ -190,22 +170,3 @@ Debugger();
 		hppa_ipi_broadcast(HPPA_IPI_XCALL);
 	}
 }
-	
-void hppa_ipi_counts(void);
-void
-hppa_ipi_counts(void)
-{
-	CPU_INFO_ITERATOR cii;
-	struct cpu_info *ci;
-	struct cpu_softc *sc;
-
-	for (CPU_INFO_FOREACH(cii, ci)) {
-		if ((ci-ci_flags  CPUF_RUNNING)) {
-			sc = ci-ci_softc;
-			printf(%s: ci %p cpuid %d total ipis % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_ipi.ev_count);
-			printf(%s: ci %p cpuid %d ipis bit 0 % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_which_ipi[0].ev_count);
-			printf(%s: ci %p cpuid %d ipis bit 1 % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_which_ipi[1].ev_count);
-			printf(%s: ci %p cpuid %d ipis bit 2 % PRIu64 \n, __func__, ci, ci-ci_cpuid, sc-sc_evcnt_which_ipi[2].ev_count);
-		}
-	}
-}



CVS commit: src/sys/dev/usb

2012-04-05 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Apr  5 16:31:53 UTC 2012

Modified Files:
src/sys/dev/usb: if_cdce.c ubt.c uhso.c

Log Message:
no need to device_pmf_is_registered() before unregister


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/if_cdce.c
cvs rdiff -u -r1.45 -r1.46 src/sys/dev/usb/ubt.c
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/uhso.c

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

Modified files:

Index: src/sys/dev/usb/if_cdce.c
diff -u src/sys/dev/usb/if_cdce.c:1.36 src/sys/dev/usb/if_cdce.c:1.37
--- src/sys/dev/usb/if_cdce.c:1.36	Fri Feb 24 06:48:24 2012
+++ src/sys/dev/usb/if_cdce.c	Thu Apr  5 16:31:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_cdce.c,v 1.36 2012/02/24 06:48:24 mrg Exp $ */
+/*	$NetBSD: if_cdce.c,v 1.37 2012/04/05 16:31:53 plunky Exp $ */
 
 /*
  * Copyright (c) 1997, 1998, 1999, 2000-2003 Bill Paul wp...@windriver.com
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_cdce.c,v 1.36 2012/02/24 06:48:24 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_cdce.c,v 1.37 2012/04/05 16:31:53 plunky Exp $);
 
 #if defined(_KERNEL_OPT)
 #include opt_inet.h
@@ -309,8 +309,7 @@ cdce_detach(device_t self, int flags)
 	struct ifnet	*ifp = GET_IFP(sc);
 	int		 s;
 
-	if (device_pmf_is_registered(self))
-		pmf_device_deregister(self);
+	pmf_device_deregister(self);
 
 	s = splusb();
 

Index: src/sys/dev/usb/ubt.c
diff -u src/sys/dev/usb/ubt.c:1.45 src/sys/dev/usb/ubt.c:1.46
--- src/sys/dev/usb/ubt.c:1.45	Tue Mar  6 03:35:29 2012
+++ src/sys/dev/usb/ubt.c	Thu Apr  5 16:31:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ubt.c,v 1.45 2012/03/06 03:35:29 mrg Exp $	*/
+/*	$NetBSD: ubt.c,v 1.46 2012/04/05 16:31:53 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -67,7 +67,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ubt.c,v 1.45 2012/03/06 03:35:29 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ubt.c,v 1.46 2012/04/05 16:31:53 plunky Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -533,8 +533,10 @@ ubt_attach(device_t parent, device_t sel
 	}
 
 	sc-sc_ok = 1;
+
 	if (!pmf_device_register(self, NULL, NULL))
 		aprint_error_dev(self, couldn't establish power handler\n);
+
 	return;
 }
 
@@ -546,8 +548,7 @@ ubt_detach(device_t self, int flags)
 
 	DPRINTF(sc=%p flags=%d\n, sc, flags);
 
-	if (device_pmf_is_registered(self))
-		pmf_device_deregister(self);
+	pmf_device_deregister(self);
 
 	sc-sc_dying = 1;
 

Index: src/sys/dev/usb/uhso.c
diff -u src/sys/dev/usb/uhso.c:1.8 src/sys/dev/usb/uhso.c:1.9
--- src/sys/dev/usb/uhso.c:1.8	Tue Mar  6 03:35:29 2012
+++ src/sys/dev/usb/uhso.c	Thu Apr  5 16:31:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhso.c,v 1.8 2012/03/06 03:35:29 mrg Exp $	*/
+/*	$NetBSD: uhso.c,v 1.9 2012/04/05 16:31:53 plunky Exp $	*/
 
 /*-
  * Copyright (c) 2009 Iain Hibbert
@@ -37,7 +37,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uhso.c,v 1.8 2012/03/06 03:35:29 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: uhso.c,v 1.9 2012/04/05 16:31:53 plunky Exp $);
 
 #include opt_inet.h
 
@@ -537,8 +537,7 @@ uhso_detach(device_t self, int flags)
 	unsigned int i;
 	int s;
 
-	if (device_pmf_is_registered(self))
-		pmf_device_deregister(self);
+	pmf_device_deregister(self);
 
 	for (i = 0; i  UHSO_PORT_MAX; i++) {
 		hp = sc-sc_port[i];



CVS commit: src/sys/arch

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 19:42:14 UTC 2012

Modified Files:
src/sys/arch/hp700/hp700: locore.S
src/sys/arch/hppa/hppa: trap.S

Log Message:
Use CR_ control regsiter definition for consistency.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/hp700/hp700/locore.S
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/hppa/hppa/trap.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/hp700/hp700/locore.S
diff -u src/sys/arch/hp700/hp700/locore.S:1.58 src/sys/arch/hp700/hp700/locore.S:1.59
--- src/sys/arch/hp700/hp700/locore.S:1.58	Tue Jan  3 06:11:21 2012
+++ src/sys/arch/hp700/hp700/locore.S	Thu Apr  5 19:42:13 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.58 2012/01/03 06:11:21 skrll Exp $	*/
+/*	$NetBSD: locore.S,v 1.59 2012/04/05 19:42:13 skrll Exp $	*/
 /*	$OpenBSD: locore.S,v 1.158 2008/07/28 19:08:46 miod Exp $	*/
 
 /*
@@ -79,9 +79,6 @@
 /* Some aliases for the macros in assym.h. */
 #define	TRAPFRAME_SIZEOF	trapframe_SIZEOF
 
-#define	ccr	cr10
-#define	rctr	cr0
-
 /*
  * Very crude debugging macros that write to com1.
  */
@@ -244,7 +241,7 @@ L$start_zero_tf:
 	/*
 	 * disable all coprocessors
 	 */
-	mtctl	%r0, %ccr
+	mtctl	%r0, CR_CCR
 
 #ifdef MULTIPROCESSOR
 
@@ -446,7 +443,7 @@ LEAF_ENTRY_NOPROFILE(hw_cpu_spinup_tramp
 	/*
 	 * disable all coprocessors
 	 */
-	mtctl   %r0, %ccr
+	mtctl   %r0, CR_CCR
 
 	/*
 	 * to keep the spl() routines consistent we need to put the correct
@@ -1054,13 +1051,13 @@ ALTENTRY(hppa_fpu_nop1)
 	 * states.
 	 */
 	GET_CURCPU(%t1)
-	mfctl	%ccr, %r1
+	mfctl	CR_CCR, %r1
 	mfctl	CR_FPPADDR, %t2
 	ldw	CI_FPU_STATE(%t1), %t1
 	depi	0, 25, 2, %r1		; disables the FPU
 	comb,,n %t1, %t2, 0		; nullify if LWPs different
 	depi	3, 25, 2, %r1		; enables the FPU
-	mtctl	%r1, %ccr
+	mtctl	%r1, CR_CCR
 
 switch_return:
 	copy	%arg0, %ret0

Index: src/sys/arch/hppa/hppa/trap.S
diff -u src/sys/arch/hppa/hppa/trap.S:1.63 src/sys/arch/hppa/hppa/trap.S:1.64
--- src/sys/arch/hppa/hppa/trap.S:1.63	Sun Feb 26 08:28:57 2012
+++ src/sys/arch/hppa/hppa/trap.S	Thu Apr  5 19:42:14 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.S,v 1.63 2012/02/26 08:28:57 skrll Exp $	*/
+/*	$NetBSD: trap.S,v 1.64 2012/04/05 19:42:14 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -513,7 +513,7 @@ syscall_return:
 	mtctl	%t2, CR_FPPADDR
 
 	ldw	TF_CR0(%sr3, %t3), %t1
-	mtctl	%t1, %rctr
+	mtctl	%t1, CR_RCTR
 
 	GET_CURCPU_SPACE(%sr3, %t3)
 
@@ -939,7 +939,7 @@ ALTENTRY(hppa_fpu_nop0)
 	 * We have a hardware FPU.  If it is enabled,  branch to emulate the
 	 * instruction.
 	 */
-	mfctl	%ccr, %arg0
+	mfctl	CR_CCR, %arg0
 	extru,= %arg0, 25, 2, %r1
 	b,n	L$emulate_fpu
 
@@ -1055,10 +1055,10 @@ ALTENTRY(hppa_fpu_swap)
 	 * 
 	 * Also, branch if there's no FPU state to swap out.
 	 */
-	mfctl	%ccr, %r1
+	mfctl	CR_CCR, %r1
 	depi	3, 25, 2, %r1
 	comb,=	%r0, %arg0, L$fpu_swap_in
-	mtctl	%r1, %ccr
+	mtctl	%r1,CR_CCR 
 
 	/*
 	 * Swap out the current FPU state.
@@ -1186,10 +1186,10 @@ L$fpu_swap_done:
 L$fpu_no_swap_in:
 
 	/* We didn't swap any FPU state in, so disable the FPU. */
-	mfctl	%ccr, %r1
+	mfctl	CR_CCR, %r1
 	depi	0, 25, 2, %r1
 	b	L$fpu_swap_done
-	mtctl	%r1, %ccr
+	mtctl	%r1, CR_CCR 
 EXIT(hppa_fpu_swapout)
 
 	/* Construct the virtual address tag. */
@@ -2053,7 +2053,7 @@ L$trap_have_stack:
 	stw	%r1, CI_TRAPSAVE + TF_FLAGS(%t3)
 
 	/* gotta get it before R is up */
-	mfctl	%rctr, %t1
+	mfctl	CR_RCTR, %t1
 
 	copy	%sp, %t3
 	ldo	HPPA_FRAME_SIZE+TRAPFRAME_SIZEOF(%sp), %sp
@@ -2073,7 +2073,7 @@ trapnowvirt:
 	 * %sp is loaded w/ the right VA (we did not need it being physical)
 	 */
 
-	mfctl	%ccr, %t2
+	mfctl	CR_CCR, %t2
 	stw	%t1, TF_CR0(%sr3, %t3)
 	stw	%t2, TF_CR10(%sr3, %t3)
 



CVS commit: src/sys/arch/hppa/hppa

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 19:44:29 UTC 2012

Modified Files:
src/sys/arch/hppa/hppa: trap.S

Log Message:
Whitespace in previous


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/hppa/hppa/trap.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/hppa/hppa/trap.S
diff -u src/sys/arch/hppa/hppa/trap.S:1.64 src/sys/arch/hppa/hppa/trap.S:1.65
--- src/sys/arch/hppa/hppa/trap.S:1.64	Thu Apr  5 19:42:14 2012
+++ src/sys/arch/hppa/hppa/trap.S	Thu Apr  5 19:44:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.S,v 1.64 2012/04/05 19:42:14 skrll Exp $	*/
+/*	$NetBSD: trap.S,v 1.65 2012/04/05 19:44:29 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -1058,7 +1058,7 @@ ALTENTRY(hppa_fpu_swap)
 	mfctl	CR_CCR, %r1
 	depi	3, 25, 2, %r1
 	comb,=	%r0, %arg0, L$fpu_swap_in
-	mtctl	%r1,CR_CCR 
+	mtctl	%r1, CR_CCR
 
 	/*
 	 * Swap out the current FPU state.
@@ -1189,7 +1189,7 @@ L$fpu_no_swap_in:
 	mfctl	CR_CCR, %r1
 	depi	0, 25, 2, %r1
 	b	L$fpu_swap_done
-	mtctl	%r1, CR_CCR 
+	mtctl	%r1, CR_CCR
 EXIT(hppa_fpu_swapout)
 
 	/* Construct the virtual address tag. */



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

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 19:53:35 UTC 2012

Modified Files:
src/sys/arch/hppa/conf: files.hppa

Log Message:
Hook in ipifuncs.c


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hppa/conf/files.hppa

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/hppa/conf/files.hppa
diff -u src/sys/arch/hppa/conf/files.hppa:1.16 src/sys/arch/hppa/conf/files.hppa:1.17
--- src/sys/arch/hppa/conf/files.hppa:1.16	Tue Mar  2 20:40:15 2010
+++ src/sys/arch/hppa/conf/files.hppa	Thu Apr  5 19:53:35 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hppa,v 1.16 2010/03/02 20:40:15 skrll Exp $
+#	$NetBSD: files.hppa,v 1.17 2012/04/05 19:53:35 skrll Exp $
 #
 #	$OpenBSD: files.hppa,v 1.31 2001/06/26 02:41:25 mickey Exp $
 #
@@ -16,6 +16,7 @@ file	arch/hppa/hppa/db_memrw.c		ddb | kg
 file	arch/hppa/hppa/db_trace.c		ddb
 file	arch/hppa/hppa/db_machdep.c		ddb
 file	arch/hppa/hppa/fpu.c
+file	arch/hppa/hppa/ipifuncs.c		multiprocessor
 file	arch/hppa/hppa/kgdb_hppa.c		kgdb
 file	arch/hppa/hppa/kobj_machdep.c		modular
 file	arch/hppa/hppa/hppa_machdep.c



CVS commit: src/sys/arch/hp700/hp700

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 20:12:09 UTC 2012

Modified Files:
src/sys/arch/hp700/hp700: machdep.c

Log Message:
Replace #ifdef DEBUG/BTLBDEBUG with DPRINTF{,N}


To generate a diff of this commit:
cvs rdiff -u -r1.109 -r1.110 src/sys/arch/hp700/hp700/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/hp700/hp700/machdep.c
diff -u src/sys/arch/hp700/hp700/machdep.c:1.109 src/sys/arch/hp700/hp700/machdep.c:1.110
--- src/sys/arch/hp700/hp700/machdep.c:1.109	Sun Feb 26 07:52:52 2012
+++ src/sys/arch/hp700/hp700/machdep.c	Thu Apr  5 20:12:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.109 2012/02/26 07:52:52 skrll Exp $	*/
+/*	$NetBSD: machdep.c,v 1.110 2012/04/05 20:12:09 skrll Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -58,7 +58,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.109 2012/02/26 07:52:52 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.110 2012/04/05 20:12:09 skrll Exp $);
 
 #include opt_cputype.h
 #include opt_ddb.h
@@ -133,6 +133,24 @@ __KERNEL_RCSID(0, $NetBSD: machdep.c,v 
 #include ksyms.h
 #include lcd.h
 
+#ifdef MACHDEPDEBUG
+
+#define	DPRINTF(s)	do {		\
+	if (machdepdebug)		\
+		printf s;		\
+} while(0)
+
+#define	DPRINTFN(l,s)	do {		\
+	if (machdepdebug = (1))	\
+		printf s;		\
+} while(0)
+
+int machdepdebug = 1;
+#else
+#define	DPRINTF(s)	/* */
+#define	DPRINTFN(l,s)	/* */
+#endif
+
 /*
  * Different kinds of flags used throughout the kernel.
  */
@@ -466,9 +484,7 @@ hppa_init(paddr_t start, void *bi)
 	/* cache parameters */
 	error = pdcproc_cache(pdc_cache);
 	if (error  0) {
-#ifdef DEBUG
-		printf(WARNING: PDC_CACHE error %d\n, error);
-#endif
+		DPRINTF((WARNING: PDC_CACHE error %d\n, error));
 	}
 
 	dcache_line_mask = pdc_cache.dc_conf.cc_line * 16 - 1;
@@ -477,9 +493,7 @@ hppa_init(paddr_t start, void *bi)
 	icache_stride = pdc_cache.ic_stride;
 
 	error = pdcproc_cache_spidbits(pdc_spidbits);
-#ifdef DEBUG
-	printf(SPID bits: 0x%x, error = %d\n, pdc_spidbits.spidbits, error);
-#endif
+	DPRINTF((SPID bits: 0x%x, error = %d\n, pdc_spidbits.spidbits, error));
 
 	/* Calculate the OS_HPMC handler checksums. */
 	p = os_hpmc;
@@ -568,15 +582,12 @@ do {	\
 	 * WITHOUT TAKING SPECIAL MEASURES.
 	 */
 
-#ifdef DEBUG
-	printf(%s: PDC_CHASSIS\n, __func__);
-#endif
+	DPRINTF((%s: PDC_CHASSIS\n, __func__));
+
 	/* they say PDC_COPROC might turn fault light on */
 	pdcproc_chassis_display(PDC_OSTAT(PDC_OSTAT_RUN) | 0xCEC0);
 
-#ifdef DEBUG
-	printf(%s: intr bootstrap\n, __func__);
-#endif
+	DPRINTF((%s: intr bootstrap\n, __func__));
 	/* Bootstrap interrupt masking and dispatching. */
 	hp700_intr_bootstrap();
 
@@ -658,39 +669,34 @@ cpuid(void)
 	/* identify system type */
 	error = pdcproc_model_info(pdc_model);
 	if (error  0) {
-#ifdef DEBUG
-		printf(WARNING: PDC_MODEL_INFO error %d\n, error);
-#endif
+		DPRINTF((WARNING: PDC_MODEL_INFO error %d\n, error));
+		
 		pdc_model.hwmodel = 0;
 		pdc_model.hv = 0;
 	} else {
-#ifdef DEBUG
-		printf(pdc_model.hwmodel/hv %x/%x\n, pdc_model.hwmodel,
-		pdc_model.hv);
-#endif
+		DPRINTF((pdc_model.hwmodel/hv %x/%x\n, pdc_model.hwmodel,
+		pdc_model.hv));
 	}
 	cpu_modelno = pdc_model.hwmodel;
 	model = hppa_mod_info(HPPA_TYPE_BOARD, cpu_modelno);
-#ifdef DEBUG
-	printf(%s: model %s\n, __func__, model);
-#endif
+
+	DPRINTF((%s: model %s\n, __func__, model));
+
 	pdc_settype(cpu_modelno);
 
 	memset(pdc_cpuid, 0, sizeof(pdc_cpuid));
 	error = pdcproc_model_cpuid(pdc_cpuid);
 	if (error  0) {
-#ifdef DEBUG
-		printf(WARNING: PDC_MODEL_CPUID error %d. 
-		Using cpu_modelno based cpu_type.\n, error);
-#endif
+		DPRINTF((WARNING: PDC_MODEL_CPUID error %d. 
+		Using cpu_modelno based cpu_type.\n, error));
+
 		cpu_type = cpu_model_cpuid(cpu_modelno);
 	} else {
-#ifdef DEBUG
-		printf(%s: cpuid.version  = %x\n, __func__,
-		pdc_cpuid.version);
-		printf(%s: cpuid.revision = %x\n, __func__,
-		pdc_cpuid.revision);
-#endif
+		DPRINTF((%s: cpuid.version  = %x\n, __func__,
+		pdc_cpuid.version));
+		DPRINTF((%s: cpuid.revision = %x\n, __func__,
+		pdc_cpuid.revision));
+
 		cpu_version = pdc_cpuid.version;
 
 		/* XXXNH why? */
@@ -704,62 +710,50 @@ cpuid(void)
 	memset(pdc_coproc, 0, sizeof(pdc_coproc));
 	error = pdcproc_coproc(pdc_coproc);
 	if (error  0) {
-		printf(WARNING: PDC_COPROC error %d\n, error);
+		DPRINTF((WARNING: PDC_COPROC error %d\n, error));
 		pdc_coproc.ccr_enable = 0;
 	} else {
-#ifdef DEBUG
-		printf(pdc_coproc: 0x%x, 0x%x; model %x rev %x\n,
+		DPRINTF((pdc_coproc: 0x%x, 0x%x; model %x rev %x\n,
 		pdc_coproc.ccr_enable, pdc_coproc.ccr_present,
-		pdc_coproc.fpu_model, pdc_coproc.fpu_revision);
+		pdc_coproc.fpu_model, pdc_coproc.fpu_revision));
 
-#endif
 		/* a kludge to detect PCXW */
 		if (pdc_coproc.fpu_model == HPPA_FPU_PCXW)
 			cpu_version = 

CVS commit: src/sys/dev

2012-04-05 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Apr  5 20:13:35 UTC 2012

Modified Files:
src/sys/dev: midi.c
src/sys/dev/isa: midi_pcppi.c

Log Message:
move the pmf_device_register() for midi.c and midi_pcppi.c to midi_attach()
for symmetry, since it is removed in midi detach code

and don't need to call device_pmf_is_registered() before registering it


To generate a diff of this commit:
cvs rdiff -u -r1.75 -r1.76 src/sys/dev/midi.c
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/isa/midi_pcppi.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/midi.c
diff -u src/sys/dev/midi.c:1.75 src/sys/dev/midi.c:1.76
--- src/sys/dev/midi.c:1.75	Tue Jan 10 17:53:51 2012
+++ src/sys/dev/midi.c	Thu Apr  5 20:13:34 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi.c,v 1.75 2012/01/10 17:53:51 njoly Exp $	*/
+/*	$NetBSD: midi.c,v 1.76 2012/04/05 20:13:34 plunky Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.75 2012/01/10 17:53:51 njoly Exp $);
+__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.76 2012/04/05 20:13:34 plunky Exp $);
 
 #include midi.h
 #include sequencer.h
@@ -166,10 +166,6 @@ midiattach(device_t parent, device_t sel
 	sc-hw_if = hwp;
 	sc-hw_hdl = hdlp;
 	midi_attach(sc, parent);
-if (!device_pmf_is_registered(self))
-		if (!pmf_device_register(self, NULL, NULL))
-			aprint_error_dev(self,
-			couldn't establish power handler\n); 
 }
 
 static int
@@ -296,6 +292,9 @@ midi_attach(struct midi_softc *sc, devic
 	
 	aprint_naive(\n);
 	aprint_normal(: %s\n, mi.name);
+
+	if (!pmf_device_register(sc-dev, NULL, NULL))
+		aprint_error_dev(sc-dev, couldn't establish power handler\n); 
 }
 
 void

Index: src/sys/dev/isa/midi_pcppi.c
diff -u src/sys/dev/isa/midi_pcppi.c:1.24 src/sys/dev/isa/midi_pcppi.c:1.25
--- src/sys/dev/isa/midi_pcppi.c:1.24	Wed Nov 23 23:07:32 2011
+++ src/sys/dev/isa/midi_pcppi.c	Thu Apr  5 20:13:35 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi_pcppi.c,v 1.24 2011/11/23 23:07:32 jmcneill Exp $	*/
+/*	$NetBSD: midi_pcppi.c,v 1.25 2012/04/05 20:13:35 plunky Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: midi_pcppi.c,v 1.24 2011/11/23 23:07:32 jmcneill Exp $);
+__KERNEL_RCSID(0, $NetBSD: midi_pcppi.c,v 1.25 2012/04/05 20:13:35 plunky Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -106,10 +106,6 @@ midi_pcppi_attach(device_t parent, devic
 
 	midisyn_attach(sc-sc_mididev, ms);
 	midi_attach(sc-sc_mididev, parent);
-if (!device_pmf_is_registered(self))
-		if (!pmf_device_register(self, NULL, NULL))
-			aprint_error_dev(self,
-			couldn't establish power handler\n); 
 }
 
 static int



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

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 20:17:24 UTC 2012

Modified Files:
src/sys/arch/hp700/include: intr.h

Log Message:
Add the IPI routinte prototypes.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp700/include/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/hp700/include/intr.h
diff -u src/sys/arch/hp700/include/intr.h:1.19 src/sys/arch/hp700/include/intr.h:1.20
--- src/sys/arch/hp700/include/intr.h:1.19	Tue Nov 16 08:59:30 2010
+++ src/sys/arch/hp700/include/intr.h	Thu Apr  5 20:17:24 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.19 2010/11/16 08:59:30 uebayasi Exp $	*/
+/*	$NetBSD: intr.h,v 1.20 2012/04/05 20:17:24 skrll Exp $	*/
 /*	$OpenBSD: intr.h,v 1.26 2009/12/29 13:11:40 jsing Exp $	*/
 
 /*-
@@ -93,6 +93,13 @@ splraiseipl(ipl_cookie_t icookie)
 
 #define	setsoftast(l)	((l)-l_md.md_astpending = 1)
 
+#ifdef MULTIPROCESSOR
+void	 hppa_ipi_init(struct cpu_info *);
+int	 hppa_ipi_intr(void *arg);
+int	 hppa_ipi_send(struct cpu_info *, u_long);
+int	 hppa_ipi_broadcast(u_long);
+#endif
+
 #endif /* !_LOCORE */
 
 #endif /* !_HP700_INTR_H_ */



CVS commit: src/sys/dev

2012-04-05 Thread Iain Hibbert
Module Name:src
Committed By:   plunky
Date:   Thu Apr  5 20:25:53 UTC 2012

Modified Files:
src/sys/dev: midi.c midivar.h

Log Message:
midi_attach() does not actually ever use the parent device
pointer, so no need to store it in sc_dev. Further, remove
the sc_dev field entirely since it is easily confused with
the dev field, which is the 'self' device pointer. Fix the
comment.


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/dev/midi.c
cvs rdiff -u -r1.18 -r1.19 src/sys/dev/midivar.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/midi.c
diff -u src/sys/dev/midi.c:1.76 src/sys/dev/midi.c:1.77
--- src/sys/dev/midi.c:1.76	Thu Apr  5 20:13:34 2012
+++ src/sys/dev/midi.c	Thu Apr  5 20:25:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: midi.c,v 1.76 2012/04/05 20:13:34 plunky Exp $	*/
+/*	$NetBSD: midi.c,v 1.77 2012/04/05 20:25:53 plunky Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.76 2012/04/05 20:13:34 plunky Exp $);
+__KERNEL_RCSID(0, $NetBSD: midi.c,v 1.77 2012/04/05 20:25:53 plunky Exp $);
 
 #include midi.h
 #include sequencer.h
@@ -261,7 +261,6 @@ midi_attach(struct midi_softc *sc, devic
 
 	sc-dying = 0;
 	sc-isopen = 0;
-	sc-sc_dev = parent;
 
 	mutex_enter(hwif_softc_lock);
 	mutex_enter(sc-lock);

Index: src/sys/dev/midivar.h
diff -u src/sys/dev/midivar.h:1.18 src/sys/dev/midivar.h:1.19
--- src/sys/dev/midivar.h:1.18	Wed Nov 23 23:07:31 2011
+++ src/sys/dev/midivar.h	Thu Apr  5 20:25:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: midivar.h,v 1.18 2011/11/23 23:07:31 jmcneill Exp $	*/
+/*	$NetBSD: midivar.h,v 1.19 2012/04/05 20:25:53 plunky Exp $	*/
 
 /*
  * Copyright (c) 1998, 2008 The NetBSD Foundation, Inc.
@@ -179,11 +179,10 @@ struct midi_state {
 };
 
 struct midi_softc {
-	device_t dev;
+	device_t dev;		/* Hardware device struct */
 	void	*hw_hdl;	/* Hardware driver handle */
 	const struct	midi_hw_if *hw_if; /* Hardware interface */
 	const struct	midi_hw_if_ext *hw_if_ext; /* see midi_if.h */
-	device_t sc_dev;	/* Hardware device struct */
 	int	isopen;		/* Open indicator */
 	int	flags;		/* Open flags */
 	int	dying;



CVS commit: src/sys/arch

2012-04-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Thu Apr  5 21:00:30 UTC 2012

Modified Files:
src/sys/arch/hp700/dev: cpu.c
src/sys/arch/hp700/include: cpu.h intr.h
Added Files:
src/sys/arch/hp700/include: intrdefs.h
src/sys/arch/hppa/hppa: cpuvar.h

Log Message:
Split out cpu_softc into cpuvar.h

Split out the interrupt definitions into intrdefs.h and add the IPI
definitions

Add the required field to cpu_info for the IPI functions.

Makes a MULTIPROCESSOR kernel compiles.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp700/dev/cpu.c
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/hp700/include/cpu.h
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp700/include/intr.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp700/include/intrdefs.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/hppa/hppa/cpuvar.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/hp700/dev/cpu.c
diff -u src/sys/arch/hp700/dev/cpu.c:1.21 src/sys/arch/hp700/dev/cpu.c:1.22
--- src/sys/arch/hp700/dev/cpu.c:1.21	Tue Apr  3 11:44:32 2012
+++ src/sys/arch/hp700/dev/cpu.c	Thu Apr  5 21:00:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.21 2012/04/03 11:44:32 skrll Exp $	*/
+/*	$NetBSD: cpu.c,v 1.22 2012/04/05 21:00:29 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.c,v 1.29 2009/02/08 18:33:28 miod Exp $	*/
 
@@ -29,7 +29,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.21 2012/04/03 11:44:32 skrll Exp $);
+__KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.22 2012/04/05 21:00:29 skrll Exp $);
 
 #include opt_multiprocessor.h
 
@@ -46,16 +46,11 @@ __KERNEL_RCSID(0, $NetBSD: cpu.c,v 1.21
 #include machine/iomod.h
 #include machine/autoconf.h
 
+#include hppa/hppa/cpuvar.h
 #include hp700/hp700/intr.h
 #include hp700/hp700/machdep.h
 #include hp700/dev/cpudevs.h
 
-struct cpu_softc {
-	device_t sc_dev;
-	hppa_hpa_t sc_hpa;
-	void *sc_ih;
-};
-
 #ifdef MULTIPROCESSOR
 
 int hppa_ncpu;
@@ -175,7 +170,7 @@ cpuattach(device_t parent, device_t self
 		return;
 	}
 	
-	sc-sc_ih = hp700_intr_establish(IPL_CLOCK, clock_intr,
+	sc-sc_ihclk = hp700_intr_establish(IPL_CLOCK, clock_intr,
 	NULL /*clockframe*/, ir_cpu, 31);
 
 #ifdef MULTIPROCESSOR

Index: src/sys/arch/hp700/include/cpu.h
diff -u src/sys/arch/hp700/include/cpu.h:1.68 src/sys/arch/hp700/include/cpu.h:1.69
--- src/sys/arch/hp700/include/cpu.h:1.68	Fri Jan 20 06:51:19 2012
+++ src/sys/arch/hp700/include/cpu.h	Thu Apr  5 21:00:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.68 2012/01/20 06:51:19 skrll Exp $	*/
+/*	$NetBSD: cpu.h,v 1.69 2012/04/05 21:00:29 skrll Exp $	*/
 
 /*	$OpenBSD: cpu.h,v 1.55 2008/07/23 17:39:35 kettenis Exp $	*/
 
@@ -280,6 +280,9 @@ struct cpu_info {
 #define	CPUF_PRIMARY	0x0001		/* ... is monarch/primary */
 #define	CPUF_RUNNING	0x0002 		/* ... is running. */
 
+	volatile u_long	ci_ipi;		/* IPIs pending */
+
+	struct cpu_softc *ci_softc;
 #endif
 
 #endif /* !_KMEMUSER */

Index: src/sys/arch/hp700/include/intr.h
diff -u src/sys/arch/hp700/include/intr.h:1.20 src/sys/arch/hp700/include/intr.h:1.21
--- src/sys/arch/hp700/include/intr.h:1.20	Thu Apr  5 20:17:24 2012
+++ src/sys/arch/hp700/include/intr.h	Thu Apr  5 21:00:29 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.20 2012/04/05 20:17:24 skrll Exp $	*/
+/*	$NetBSD: intr.h,v 1.21 2012/04/05 21:00:29 skrll Exp $	*/
 /*	$OpenBSD: intr.h,v 1.26 2009/12/29 13:11:40 jsing Exp $	*/
 
 /*-
@@ -34,23 +34,7 @@
 #define _HP700_INTR_H_
 
 #include machine/psl.h
-
-/* Interrupt priority `levels'. */
-#define	IPL_NONE	7	/* nothing */
-#define	IPL_SOFTCLOCK	6	/* timeouts */
-#define	IPL_SOFTBIO	5	/* block I/o */
-#define	IPL_SOFTNET	4	/* protocol stacks */
-#define	IPL_SOFTSERIAL	3	/* serial */
-#define	IPL_VM		2	/* memory allocation, low I/O */
-#define	IPL_SCHED	1	/* clock, medium I/O */
-#define	IPL_HIGH	0	/* everything */
-#define	NIPL		8
-
-/* Interrupt sharing types. */
-#define	IST_NONE	0	/* none */
-#define	IST_PULSE	1	/* pulsed */
-#define	IST_EDGE	2	/* edge-triggered */
-#define	IST_LEVEL	3	/* level-triggered */
+#include machine/intrdefs.h
 
 #ifndef _LOCORE
 
@@ -94,6 +78,9 @@ splraiseipl(ipl_cookie_t icookie)
 #define	setsoftast(l)	((l)-l_md.md_astpending = 1)
 
 #ifdef MULTIPROCESSOR
+
+struct cpu_info;
+
 void	 hppa_ipi_init(struct cpu_info *);
 int	 hppa_ipi_intr(void *arg);
 int	 hppa_ipi_send(struct cpu_info *, u_long);

Added files:

Index: src/sys/arch/hp700/include/intrdefs.h
diff -u /dev/null src/sys/arch/hp700/include/intrdefs.h:1.1
--- /dev/null	Thu Apr  5 21:00:30 2012
+++ src/sys/arch/hp700/include/intrdefs.h	Thu Apr  5 21:00:29 2012
@@ -0,0 +1,30 @@
+/*	$NetBSD: intrdefs.h,v 1.1 2012/04/05 21:00:29 skrll Exp $	*/
+
+#ifndef _HPPA_INTRDEFS_H_
+#define _HPPA_INTRDEFS_H_
+
+/* Interrupt priority `levels'. */
+#define	IPL_NONE	7	/* nothing */
+#define	IPL_SOFTCLOCK	6	/* timeouts */
+#define	IPL_SOFTBIO	5	/* block I/O */
+#define	IPL_SOFTNET	4	/* protocol stacks */
+#define	

CVS commit: [jmcneill-usbmp] src/sys

2012-04-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr  5 21:33:53 UTC 2012

Modified Files:
src/sys/arch/alpha/include [jmcneill-usbmp]: limits.h
src/sys/arch/amd64/conf [jmcneill-usbmp]: GENERIC
src/sys/arch/amd64/include [jmcneill-usbmp]: limits.h
src/sys/arch/amiga/dev [jmcneill-usbmp]: grf.c
src/sys/arch/amiga/include [jmcneill-usbmp]: limits.h
src/sys/arch/arm/conf [jmcneill-usbmp]: Makefile.arm
src/sys/arch/arm/include [jmcneill-usbmp]: limits.h
src/sys/arch/atari/include [jmcneill-usbmp]: limits.h
src/sys/arch/dreamcast/include [jmcneill-usbmp]: limits.h
src/sys/arch/evbarm/conf [jmcneill-usbmp]: IGEPV2 MARVELL_NAS MINI2440
MV2120 SHEEVAPLUG TWINTAIL
src/sys/arch/evbarm/g42xxeb [jmcneill-usbmp]: g42xxeb_kmkbd.c
src/sys/arch/evbarm/marvell [jmcneill-usbmp]: marvell_machdep.c
src/sys/arch/evbppc/mpc85xx [jmcneill-usbmp]: machdep.c
src/sys/arch/evbsh3/include [jmcneill-usbmp]: limits.h
src/sys/arch/hp300/include [jmcneill-usbmp]: limits.h
src/sys/arch/hp700/dev [jmcneill-usbmp]: apic.c cpu.c dino.c lasi.c
siop_sgc.c wax.c
src/sys/arch/hp700/hp700 [jmcneill-usbmp]: intr.c locore.S machdep.c
mainbus.c
src/sys/arch/hp700/include [jmcneill-usbmp]: cpu.h intr.h
src/sys/arch/hpcarm/conf [jmcneill-usbmp]: INSTALL_WZERO3 NETBOOKPRO
WZERO3 files.hpcarm files.pxa2x0
src/sys/arch/hpcarm/hpcarm [jmcneill-usbmp]: hpc_machdep.c locore.S
pxa2x0_hpc_machdep.c sa11x0_hpc_machdep.c
src/sys/arch/hpcsh/include [jmcneill-usbmp]: limits.h
src/sys/arch/hppa/conf [jmcneill-usbmp]: files.hppa
src/sys/arch/hppa/hppa [jmcneill-usbmp]: db_machdep.c lock_stubs.S
trap.S
src/sys/arch/hppa/include [jmcneill-usbmp]: cpufunc.h limits.h psl.h
src/sys/arch/i386/conf [jmcneill-usbmp]: GENERIC
src/sys/arch/i386/include [jmcneill-usbmp]: limits.h
src/sys/arch/i386/stand [jmcneill-usbmp]: Makefile.inc
src/sys/arch/ia64/include [jmcneill-usbmp]: limits.h
src/sys/arch/landisk/include [jmcneill-usbmp]: limits.h
src/sys/arch/landisk/landisk [jmcneill-usbmp]: bus_dma.c
src/sys/arch/luna68k/include [jmcneill-usbmp]: limits.h
src/sys/arch/m68k/include [jmcneill-usbmp]: limits.h profile.h
src/sys/arch/mac68k/include [jmcneill-usbmp]: limits.h
src/sys/arch/macppc/conf [jmcneill-usbmp]: GENERIC GENERIC_MD INSTALL
src/sys/arch/macppc/dev [jmcneill-usbmp]: ofb.c
src/sys/arch/macppc/macppc [jmcneill-usbmp]: machdep.c pic_heathrow.c
pic_ohare.c
src/sys/arch/mips/include [jmcneill-usbmp]: cachectl.h ecoff_machdep.h
ieeefp.h limits.h
src/sys/arch/mvme68k/include [jmcneill-usbmp]: limits.h
src/sys/arch/news68k/include [jmcneill-usbmp]: limits.h
src/sys/arch/powerpc/booke [jmcneill-usbmp]: booke_pmap.c copyin.c
e500_tlb.c
src/sys/arch/powerpc/booke/dev [jmcneill-usbmp]: pq3gpio.c
src/sys/arch/powerpc/conf [jmcneill-usbmp]: Makefile.powerpc
files.powerpc
src/sys/arch/powerpc/include [jmcneill-usbmp]: cpu.h limits.h
src/sys/arch/powerpc/include/booke [jmcneill-usbmp]: e500var.h pmap.h
src/sys/arch/powerpc/powerpc [jmcneill-usbmp]: db_disasm.c
powerpc_machdep.c vm_machdep.c
src/sys/arch/sh3/include [jmcneill-usbmp]: limits.h
src/sys/arch/shark/ofw [jmcneill-usbmp]: vga_ofbus.c
src/sys/arch/sparc/conf [jmcneill-usbmp]: BILL-THE-CAT GENERIC INSTALL
KRUPS MRCOFFEE TADPOLE3GX
src/sys/arch/sparc/dev [jmcneill-usbmp]: tctrl.c
src/sys/arch/sparc/include [jmcneill-usbmp]: aout_machdep.h ieeefp.h
limits.h
src/sys/arch/sparc/sparc [jmcneill-usbmp]: cpu.c
src/sys/arch/sparc64/conf [jmcneill-usbmp]: GENERIC NONPLUS64
src/sys/arch/sparc64/dev [jmcneill-usbmp]: central.c ebus_mainbus.c
fhc.c fhc_central.c fhc_mainbus.c gfb.c iommu.c iommuvar.h
pcf8591_envctrl.c pcfiic_ebus.c pld_wdog.c pyro.c schizo.c
schizoreg.h schizovar.h tda.c upa.c
src/sys/arch/sparc64/sparc64 [jmcneill-usbmp]: locore.s pmap.c trap.c
src/sys/arch/vax/conf [jmcneill-usbmp]: INSTALL
src/sys/arch/vax/include [jmcneill-usbmp]: limits.h
src/sys/arch/x68k/include [jmcneill-usbmp]: limits.h loadfile_machdep.h
src/sys/arch/x68k/stand [jmcneill-usbmp]: Makefile
src/sys/arch/x68k/stand/boot [jmcneill-usbmp]: Makefile boot.c
boot.ldscript conf.c version
src/sys/arch/x68k/stand/libsa [jmcneill-usbmp]: sdcd.c
src/sys/arch/x68k/stand/mboot [jmcneill-usbmp]: Makefile mboot.c
src/sys/arch/x86/include [jmcneill-usbmp]: pmap.h
src/sys/arch/x86/x86 [jmcneill-usbmp]: ipmi.c
src/sys/arch/xen/x86 

CVS commit: [jmcneill-usbmp] src/sys/dev/usb

2012-04-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Thu Apr  5 22:32:09 UTC 2012

Modified Files:
src/sys/dev/usb [jmcneill-usbmp]: ehci.c ohci.c uhci.c

Log Message:
make these compile without DIAGNOSTIC.


To generate a diff of this commit:
cvs rdiff -u -r1.181.6.19 -r1.181.6.20 src/sys/dev/usb/ehci.c
cvs rdiff -u -r1.218.6.19 -r1.218.6.20 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.240.6.18 -r1.240.6.19 src/sys/dev/usb/uhci.c

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

Modified files:

Index: src/sys/dev/usb/ehci.c
diff -u src/sys/dev/usb/ehci.c:1.181.6.19 src/sys/dev/usb/ehci.c:1.181.6.20
--- src/sys/dev/usb/ehci.c:1.181.6.19	Thu Apr  5 21:33:33 2012
+++ src/sys/dev/usb/ehci.c	Thu Apr  5 22:32:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ehci.c,v 1.181.6.19 2012/04/05 21:33:33 mrg Exp $ */
+/*	$NetBSD: ehci.c,v 1.181.6.20 2012/04/05 22:32:08 mrg Exp $ */
 
 /*
  * Copyright (c) 2004-2012 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.181.6.19 2012/04/05 21:33:33 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ehci.c,v 1.181.6.20 2012/04/05 22:32:08 mrg Exp $);
 
 #include ohci.h
 #include uhci.h
@@ -2596,7 +2596,9 @@ ehci_root_intr_start(usbd_xfer_handle xf
 Static void
 ehci_root_intr_abort(usbd_xfer_handle xfer)
 {
+#ifdef DIAGNOSTIC
 	ehci_softc_t *sc = xfer-pipe-device-bus-hci_private;
+#endif
 
 	KASSERT(mutex_owned(sc-sc_lock));
 	if (xfer-pipe-intrxfer == xfer) {

Index: src/sys/dev/usb/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.218.6.19 src/sys/dev/usb/ohci.c:1.218.6.20
--- src/sys/dev/usb/ohci.c:1.218.6.19	Sun Mar 11 01:52:28 2012
+++ src/sys/dev/usb/ohci.c	Thu Apr  5 22:32:08 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.218.6.19 2012/03/11 01:52:28 mrg Exp $	*/
+/*	$NetBSD: ohci.c,v 1.218.6.20 2012/04/05 22:32:08 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.218.6.19 2012/03/11 01:52:28 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: ohci.c,v 1.218.6.20 2012/04/05 22:32:08 mrg Exp $);
 
 #include opt_usb.h
 
@@ -2873,7 +2873,9 @@ ohci_root_intr_start(usbd_xfer_handle xf
 Static void
 ohci_root_intr_abort(usbd_xfer_handle xfer)
 {
+#ifdef DIAGNOSTIC
 	ohci_softc_t *sc = xfer-pipe-device-bus-hci_private;
+#endif
 
 	KASSERT(mutex_owned(sc-sc_lock));
 

Index: src/sys/dev/usb/uhci.c
diff -u src/sys/dev/usb/uhci.c:1.240.6.18 src/sys/dev/usb/uhci.c:1.240.6.19
--- src/sys/dev/usb/uhci.c:1.240.6.18	Sun Mar 11 01:52:28 2012
+++ src/sys/dev/usb/uhci.c	Thu Apr  5 22:32:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uhci.c,v 1.240.6.18 2012/03/11 01:52:28 mrg Exp $	*/
+/*	$NetBSD: uhci.c,v 1.240.6.19 2012/04/05 22:32:09 mrg Exp $	*/
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: uhci.c,v 1.240.6.18 2012/03/11 01:52:28 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: uhci.c,v 1.240.6.19 2012/04/05 22:32:09 mrg Exp $);
 
 #include opt_usb.h
 
@@ -1498,7 +1498,9 @@ uhci_idone(uhci_intr_info_t *ii)
 {
 	usbd_xfer_handle xfer = ii-xfer;
 	struct uhci_pipe *upipe = (struct uhci_pipe *)xfer-pipe;
+#ifdef DIAGNOSTIC
 	uhci_softc_t *sc = upipe-pipe.device-bus-hci_private;
+#endif
 	uhci_soft_td_t *std;
 	u_int32_t status = 0, nstatus;
 	int actlen;
@@ -2745,7 +2747,9 @@ uhci_device_isoc_start(usbd_xfer_handle 
 void
 uhci_device_isoc_abort(usbd_xfer_handle xfer)
 {
+#ifdef DIAGNOSTIC
 	uhci_softc_t *sc = xfer-pipe-device-bus-hci_private;
+#endif
 	struct uhci_pipe *upipe = (struct uhci_pipe *)xfer-pipe;
 	uhci_soft_td_t **stds = upipe-u.iso.stds;
 	uhci_soft_td_t *std;



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

2012-04-05 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Apr  6 01:35:58 UTC 2012

Modified Files:
src/sys/arch/evbarm/dev: plcomreg.h

Log Message:
don't mix #defineTAB and #defineSPACE in a file.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/evbarm/dev/plcomreg.h

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

Modified files:

Index: src/sys/arch/evbarm/dev/plcomreg.h
diff -u src/sys/arch/evbarm/dev/plcomreg.h:1.1 src/sys/arch/evbarm/dev/plcomreg.h:1.2
--- src/sys/arch/evbarm/dev/plcomreg.h:1.1	Sat Oct 27 16:22:06 2001
+++ src/sys/arch/evbarm/dev/plcomreg.h	Fri Apr  6 01:35:58 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcomreg.h,v 1.1 2001/10/27 16:22:06 rearnsha Exp $	*/
+/*	$NetBSD: plcomreg.h,v 1.2 2012/04/06 01:35:58 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -34,14 +34,14 @@
 #define	PLCOM_TOLERANCE	30	/* baud rate tolerance, in 0.1% units */
 
 /* control register */
-#define CR_LBE		0x80	/* Loopback enable */
-#define CR_RTIE		0x40	/* Receive timeout interrupt enable */
-#define CR_TIE		0x20	/* Transmit interrupt enable */
-#define CR_RIE		0x10	/* Receive interrrupt enable */
-#define CR_MSIE		0x08	/* Modem status interrupt enable */
-#define CR_SIRLP	0x04	/* IrDA SIR Low power mode */
-#define CR_SIREN	0x02	/* SIR Enable */
-#define CR_UARTEN	0x01	/* Uart enable */
+#define	CR_LBE		0x80	/* Loopback enable */
+#define	CR_RTIE		0x40	/* Receive timeout interrupt enable */
+#define	CR_TIE		0x20	/* Transmit interrupt enable */
+#define	CR_RIE		0x10	/* Receive interrrupt enable */
+#define	CR_MSIE		0x08	/* Modem status interrupt enable */
+#define	CR_SIRLP	0x04	/* IrDA SIR Low power mode */
+#define	CR_SIREN	0x02	/* SIR Enable */
+#define	CR_UARTEN	0x01	/* Uart enable */
 
 /* interrupt identification register */
 #define	IIR_IMASK	0x0f
@@ -51,15 +51,15 @@
 #define	IIR_MIS		0x01
 
 /* line control register */
-#define LCR_WLEN	0x60	/* Mask of size bits */
+#define	LCR_WLEN	0x60	/* Mask of size bits */
 #define	LCR_8BITS	0x60	/* 8 bits per serial word */
 #define	LCR_7BITS	0x40	/* 7 bits */
 #define	LCR_6BITS	0x20	/* 6 bits */
 #define	LCR_5BITS	0x00	/* 5 bits */
-#define LCR_FEN		0x10	/* FIFO enable */
+#define	LCR_FEN		0x10	/* FIFO enable */
 #define	LCR_STP2	0x08	/* 2 stop bits per serial word */
-#define LCR_EPS		0x04	/* Even parity select */
-#define LCR_PEN		0x02	/* Parity enable */
+#define	LCR_EPS		0x04	/* Even parity select */
+#define	LCR_PEN		0x02	/* Parity enable */
 #define	LCR_PEVEN	(LCR_PEN | LCR_EPS)
 #define	LCR_PODD	LCR_PEN
 #define	LCR_PNONE	0x00	/* No parity */
@@ -71,10 +71,10 @@
 
 /* receive status register */
 
-#define RSR_OE		0x08	/* Overrun Error */
-#define RSR_BE		0x04	/* Break */
-#define RSR_PE		0x02	/* Parity Error */
-#define RSR_FE		0x01	/* Framing Error */
+#define	RSR_OE		0x08	/* Overrun Error */
+#define	RSR_BE		0x04	/* Break */
+#define	RSR_PE		0x02	/* Parity Error */
+#define	RSR_FE		0x01	/* Framing Error */
 
 /* flag register */
 #define	FR_TXFE		0x80	/* Transmit fifo empty */
@@ -93,17 +93,17 @@
 #define	MSR_CTS		FR_CTS
 
 /* Register offsets */
-#define plcom_dr	0x00
-#define plcom_rsr	0x04
-#define plcom_ecr	0x04
-#define plcom_lcr	0x08
-#define plcom_dlbh	0x0c
-#define plcom_dlbl	0x10
-#define plcom_cr	0x14
-#define plcom_fr	0x18
-#define plcom_iir	0x1c
-#define plcom_icr	0x1c
-#define plcom_ilpr	0x20
+#define	plcom_dr	0x00
+#define	plcom_rsr	0x04
+#define	plcom_ecr	0x04
+#define	plcom_lcr	0x08
+#define	plcom_dlbh	0x0c
+#define	plcom_dlbl	0x10
+#define	plcom_cr	0x14
+#define	plcom_fr	0x18
+#define	plcom_iir	0x1c
+#define	plcom_icr	0x1c
+#define	plcom_ilpr	0x20
 
 /* IFPGA specific */
-#define PLCOM_UART_SIZE	0x24
+#define	PLCOM_UART_SIZE	0x24



CVS commit: src/sys/arch/evbarm

2012-04-05 Thread Hiroyuki Bessho
Module Name:src
Committed By:   bsh
Date:   Fri Apr  6 01:47:16 UTC 2012

Modified Files:
src/sys/arch/evbarm/conf: INTEGRATOR
src/sys/arch/evbarm/dev: plcom.c

Log Message:
avoid warning with options PLCOM_DEBUG for INTEGRATOR.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/evbarm/conf/INTEGRATOR
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/evbarm/dev/plcom.c

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

Modified files:

Index: src/sys/arch/evbarm/conf/INTEGRATOR
diff -u src/sys/arch/evbarm/conf/INTEGRATOR:1.64 src/sys/arch/evbarm/conf/INTEGRATOR:1.65
--- src/sys/arch/evbarm/conf/INTEGRATOR:1.64	Sun Dec 18 05:49:25 2011
+++ src/sys/arch/evbarm/conf/INTEGRATOR	Fri Apr  6 01:47:15 2012
@@ -1,4 +1,4 @@
-#	$NetBSD: INTEGRATOR,v 1.64 2011/12/18 05:49:25 dholland Exp $
+#	$NetBSD: INTEGRATOR,v 1.65 2012/04/06 01:47:15 bsh Exp $
 #
 #	GENERIC -- ARM Integrator board Generic kernel
 #
@@ -155,6 +155,7 @@ ifpga0	at mainbus?
 # PL010 uart
 plcom0		at ifpga? offset 0x0600 irq 1
 plcom1		at ifpga? offset 0x0700 irq 2
+#options 	PLCOM_DEBUG
 
 # PL030 real time clock
 plrtc0		at ifpga? offset 0x0500

Index: src/sys/arch/evbarm/dev/plcom.c
diff -u src/sys/arch/evbarm/dev/plcom.c:1.33 src/sys/arch/evbarm/dev/plcom.c:1.34
--- src/sys/arch/evbarm/dev/plcom.c:1.33	Thu Feb  2 19:42:59 2012
+++ src/sys/arch/evbarm/dev/plcom.c	Fri Apr  6 01:47:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: plcom.c,v 1.33 2012/02/02 19:42:59 tls Exp $	*/
+/*	$NetBSD: plcom.c,v 1.34 2012/04/06 01:47:16 bsh Exp $	*/
 
 /*-
  * Copyright (c) 2001 ARM Ltd
@@ -94,7 +94,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.33 2012/02/02 19:42:59 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: plcom.c,v 1.34 2012/04/06 01:47:16 bsh Exp $);
 
 #include opt_plcom.h
 #include opt_ddb.h
@@ -280,9 +280,9 @@ plcomspeed(long speed, long frequency)
 #ifdef PLCOM_DEBUG
 int	plcom_debug = 0;
 
-void plcomstatus (struct plcom_softc *, char *);
+void plcomstatus (struct plcom_softc *, const char *);
 void
-plcomstatus(struct plcom_softc *sc, char *str)
+plcomstatus(struct plcom_softc *sc, const char *str)
 {
 	struct tty *tp = sc-sc_tty;
 
@@ -304,6 +304,7 @@ plcomstatus(struct plcom_softc *sc, char
 }
 #endif
 
+/* XXX this function is not used? */
 int
 plcomprobe1(bus_space_tag_t iot, bus_space_handle_t ioh)
 {



CVS commit: src/sys/arch/x68k/stand

2012-04-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Apr  6 02:51:03 UTC 2012

Modified Files:
src/sys/arch/x68k/stand: Makefile

Log Message:
put library first.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/x68k/stand/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/x68k/stand/Makefile
diff -u src/sys/arch/x68k/stand/Makefile:1.9 src/sys/arch/x68k/stand/Makefile:1.10
--- src/sys/arch/x68k/stand/Makefile:1.9	Thu Apr  5 12:12:57 2012
+++ src/sys/arch/x68k/stand/Makefile	Fri Apr  6 02:51:03 2012
@@ -1,6 +1,7 @@
-#	$NetBSD: Makefile,v 1.9 2012/04/05 12:12:57 isaki Exp $
+#	$NetBSD: Makefile,v 1.10 2012/04/06 02:51:03 isaki Exp $
 
-SUBDIR= newdisk aout2hux libdos libiocs .WAIT loadbsd # common
-SUBDIR+= libsa .WAIT mboot boot boot_ufs boot_ustar installboot
+SUBDIR= libdos libiocs libsa .WAIT
+SUBDIR+= aout2hux .WAIT
+SUBDIR+= newdisk loadbsd mboot boot boot_ufs boot_ustar installboot
 
 .include bsd.subdir.mk



CVS commit: src/sys/dev/ata

2012-04-05 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Fri Apr  6 02:52:00 UTC 2012

Modified Files:
src/sys/dev/ata: ata.c

Log Message:
Fix a typo (that I found 5 years ago).  Though the definition of
atabusiodetach_args is the same as atabusioscan_args (at the moment).


To generate a diff of this commit:
cvs rdiff -u -r1.115 -r1.116 src/sys/dev/ata/ata.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/ata.c
diff -u src/sys/dev/ata/ata.c:1.115 src/sys/dev/ata/ata.c:1.116
--- src/sys/dev/ata/ata.c:1.115	Sat Apr 30 00:34:03 2011
+++ src/sys/dev/ata/ata.c	Fri Apr  6 02:52:00 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: ata.c,v 1.115 2011/04/30 00:34:03 jakllsch Exp $	*/
+/*	$NetBSD: ata.c,v 1.116 2012/04/06 02:52:00 isaki Exp $	*/
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -25,7 +25,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ata.c,v 1.115 2011/04/30 00:34:03 jakllsch Exp $);
+__KERNEL_RCSID(0, $NetBSD: ata.c,v 1.116 2012/04/06 02:52:00 isaki Exp $);
 
 #include opt_ata.h
 
@@ -1497,8 +1497,8 @@ atabusioctl(dev_t dev, u_long cmd, void 
 	}
 	case ATABUSIODETACH:
 	{
-		struct atabusioscan_args *a=
-		(struct atabusioscan_args *)addr;
+		struct atabusiodetach_args *a=
+		(struct atabusiodetach_args *)addr;
 		if ((chp-ch_drive[0].drive_flags  DRIVE_OLD) ||
 		(chp-ch_drive[1].drive_flags  DRIVE_OLD))
 			return (EOPNOTSUPP);



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

2012-04-05 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Fri Apr  6 03:20:43 UTC 2012

Modified Files:
src/sys/arch/xen/xen: hypervisor.c

Log Message:
Retrive and print the hypervisor extra (teeny) version.
From Manuel Bouyer.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/xen/xen/hypervisor.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/xen/xen/hypervisor.c
diff -u src/sys/arch/xen/xen/hypervisor.c:1.61 src/sys/arch/xen/xen/hypervisor.c:1.62
--- src/sys/arch/xen/xen/hypervisor.c:1.61	Fri Feb 17 18:42:19 2012
+++ src/sys/arch/xen/xen/hypervisor.c	Fri Apr  6 03:20:43 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: hypervisor.c,v 1.61 2012/02/17 18:42:19 bouyer Exp $ */
+/* $NetBSD: hypervisor.c,v 1.62 2012/04/06 03:20:43 riz Exp $ */
 
 /*
  * Copyright (c) 2005 Manuel Bouyer.
@@ -53,7 +53,7 @@
 
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hypervisor.c,v 1.61 2012/02/17 18:42:19 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: hypervisor.c,v 1.62 2012/04/06 03:20:43 riz Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -210,12 +210,15 @@ hypervisor_attach(device_t parent, devic
 #endif
 #endif /* NPCI */
 	union hypervisor_attach_cookie hac;
+	char xen_extra_version[XEN_EXTRAVERSION_LEN];
 
 	xenkernfs_init();
 
 	xen_version = HYPERVISOR_xen_version(XENVER_version, NULL);
-	aprint_normal(: Xen version %d.%d\n, XEN_MAJOR(xen_version),
-	   XEN_MINOR(xen_version));
+	memset(xen_extra_version, 0, sizeof(xen_extra_version));
+	HYPERVISOR_xen_version(XENVER_extraversion, xen_extra_version);
+	aprint_normal(: Xen version %d.%d%s\n, XEN_MAJOR(xen_version),
+		XEN_MINOR(xen_version), xen_extra_version);
 
 	xengnt_init();
 	events_init();