CVS commit: src/bin/ls

2012-10-20 Thread Jan Schaumann
Module Name:src
Committed By:   jschauma
Date:   Sun Oct 21 01:39:05 UTC 2012

Modified Files:
src/bin/ls: ls.1

Log Message:
clarify that BLOCKSIZE also influences the total in long output


To generate a diff of this commit:
cvs rdiff -u -r1.69 -r1.70 src/bin/ls/ls.1

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

Modified files:

Index: src/bin/ls/ls.1
diff -u src/bin/ls/ls.1:1.69 src/bin/ls/ls.1:1.70
--- src/bin/ls/ls.1:1.69	Sat Apr  2 08:38:56 2011
+++ src/bin/ls/ls.1	Sun Oct 21 01:39:05 2012
@@ -1,4 +1,4 @@
-.\"	$NetBSD: ls.1,v 1.69 2011/04/02 08:38:56 mbalmer Exp $
+.\"	$NetBSD: ls.1,v 1.70 2012/10/21 01:39:05 jschauma Exp $
 .\"
 .\" Copyright (c) 1980, 1990, 1991, 1993, 1994
 .\"	The Regents of the University of California.  All rights reserved.
@@ -333,9 +333,10 @@ pathname
 .El
 .Pp
 In addition, for each directory whose contents are displayed, the total
-number of 512-byte blocks used by the files in the directory is displayed
-on a line by itself immediately before the information for the files in the
-directory.
+number of blocks in units of 512 bytes or BLOCKSIZE (see
+.Sx ENVIRONMENT )
+used by the files in the directory is displayed on a line by itself
+immediately before the information for the files in the directory.
 .Pp
 If the owner or group names are not a known owner or group name,
 or the



CVS commit: src/usr.bin/mail

2012-10-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 21 01:11:23 UTC 2012

Modified Files:
src/usr.bin/mail: names.c

Log Message:
PR/47098: Steffen "Daode" Nurpmeso: mail(1): SEGV with bad globbed file argument


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/usr.bin/mail/names.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/mail/names.c
diff -u src/usr.bin/mail/names.c:1.29 src/usr.bin/mail/names.c:1.30
--- src/usr.bin/mail/names.c:1.29	Sun Apr 29 19:50:22 2012
+++ src/usr.bin/mail/names.c	Sat Oct 20 21:11:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: names.c,v 1.29 2012/04/29 23:50:22 christos Exp $	*/
+/*	$NetBSD: names.c,v 1.30 2012/10/21 01:11:23 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)names.c	8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: names.c,v 1.29 2012/04/29 23:50:22 christos Exp $");
+__RCSID("$NetBSD: names.c,v 1.30 2012/10/21 01:11:23 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -266,8 +266,16 @@ outof(struct name *names, FILE *fo, stru
 		ispipe = np->n_name[0] == '|';
 		if (ispipe)
 			fname = np->n_name+1;
-		else
+		else {
 			fname = expand(np->n_name);
+			if (fname == NULL) {
+warnx("Filename expansion of %s failed",
+np->n_name);
+senderr++;
+goto cant;
+			}
+		}
+
 
 		/*
 		 * See if we have copied the complete message out yet.



CVS commit: src/usr.bin/mail

2012-10-20 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Oct 21 01:10:22 UTC 2012

Modified Files:
src/usr.bin/mail: fio.c

Log Message:
consistently use warn


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/mail/fio.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/mail/fio.c
diff -u src/usr.bin/mail/fio.c:1.35 src/usr.bin/mail/fio.c:1.36
--- src/usr.bin/mail/fio.c:1.35	Sun Apr 29 19:50:22 2012
+++ src/usr.bin/mail/fio.c	Sat Oct 20 21:10:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: fio.c,v 1.35 2012/04/29 23:50:22 christos Exp $	*/
+/*	$NetBSD: fio.c,v 1.36 2012/10/21 01:10:22 christos Exp $	*/
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)fio.c	8.2 (Berkeley) 4/20/95";
 #else
-__RCSID("$NetBSD: fio.c,v 1.35 2012/04/29 23:50:22 christos Exp $");
+__RCSID("$NetBSD: fio.c,v 1.36 2012/10/21 01:10:22 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -440,7 +440,7 @@ expand(const char *name)
 		if (name[1] != 0)
 			break;
 		if (prevfile[0] == 0) {
-			(void)printf("No previous file\n");
+			warnx("No previous file");
 			return NULL;
 		}
 		return savestr(prevfile);



CVS commit: [netbsd-6] src/doc

2012-10-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 20 23:16:24 UTC 2012

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

Log Message:
Tickets 608, 609, 611


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

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

Modified files:

Index: src/doc/CHANGES-6.1
diff -u src/doc/CHANGES-6.1:1.1.2.5 src/doc/CHANGES-6.1:1.1.2.6
--- src/doc/CHANGES-6.1:1.1.2.5	Fri Oct 19 17:30:38 2012
+++ src/doc/CHANGES-6.1	Sat Oct 20 23:16:24 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.1,v 1.1.2.5 2012/10/19 17:30:38 riz Exp $
+# $NetBSD: CHANGES-6.1,v 1.1.2.6 2012/10/20 23:16:24 riz Exp $
 
 A complete list of changes from the 6.0 release until the 6.1 release:
 
@@ -167,3 +167,19 @@ sys/arch/x86/include/lock.h			1.26
 	Work around a possible gcc bug.  Fixes PR#45673.
 	[apb, ticket #606]
 
+doc/CHANGES	patch
+
+	Typo fix: OpenSSL, not OpenSSH.
+	[khorben, ticket #608]
+
+sys/arch/arm/marvell/kirkwood.c			1.5
+
+	Fix a bit check in the Kirkwood IRQ code so that the correct bit
+	is checked.
+	[msaitoh, ticket #609]
+
+usr.bin/calendar/calendars/calendar.netbsd	1.22
+
+	Note the date of the NetBSD 6.0 release.
+	[jnemeth, ticket #611]
+



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

2012-10-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 20 23:13:44 UTC 2012

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

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


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

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

Modified files:

Index: src/usr.bin/calendar/calendars/calendar.netbsd
diff -u src/usr.bin/calendar/calendars/calendar.netbsd:1.20.8.1 src/usr.bin/calendar/calendars/calendar.netbsd:1.20.8.2
--- src/usr.bin/calendar/calendars/calendar.netbsd:1.20.8.1	Mon May  7 16:52:04 2012
+++ src/usr.bin/calendar/calendars/calendar.netbsd	Sat Oct 20 23:13:44 2012
@@ -77,6 +77,7 @@
 10/14	NetBSD 4.0.1 released, 2008
 10/14   NetBSD/bebox port started, 1997
 10/16   NetBSD/playstation2 port started, 2001
+10/17   NetBSD 6.0 released, 2012
 10/26   NetBSD 1.0 released, 1994
 10/30   pkgsrc/Darwin support added, 2001
 10/31	NetBSD 2.0.3 released, 2005



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

2012-10-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 20 22:31:05 UTC 2012

Modified Files:
src/sys/arch/arm/marvell [netbsd-6]: kirkwood.c

Log Message:
Pull up following revision(s) (requested by msaitoh in ticket #609):
sys/arch/arm/marvell/kirkwood.c: revision 1.5
Fix always check high.  macro KIRKWOOD_IRQ_* means bit number.  HIGH is
bit0.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.4.10.1 src/sys/arch/arm/marvell/kirkwood.c

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

Modified files:

Index: src/sys/arch/arm/marvell/kirkwood.c
diff -u src/sys/arch/arm/marvell/kirkwood.c:1.4 src/sys/arch/arm/marvell/kirkwood.c:1.4.10.1
--- src/sys/arch/arm/marvell/kirkwood.c:1.4	Tue May 24 17:45:49 2011
+++ src/sys/arch/arm/marvell/kirkwood.c	Sat Oct 20 22:31:05 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: kirkwood.c,v 1.4 2011/05/24 17:45:49 matt Exp $	*/
+/*	$NetBSD: kirkwood.c,v 1.4.10.1 2012/10/20 22:31:05 riz Exp $	*/
 /*
  * Copyright (c) 2010 KIYOHARA Takashi
  * All rights reserved.
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kirkwood.c,v 1.4 2011/05/24 17:45:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kirkwood.c,v 1.4.10.1 2012/10/20 22:31:05 riz Exp $");
 
 #define _INTR_PRIVATE
 
@@ -188,7 +188,7 @@ kirkwood_find_pending_irqs(void)
 	if (pendinglow != 0)
 		ipl |= pic_mark_pending_sources(&kirkwood_pic, 0, pendinglow);
 
-	if ((causelow & KIRKWOOD_IRQ_HIGH) == KIRKWOOD_IRQ_HIGH) {
+	if ((causelow & (1 << KIRKWOOD_IRQ_HIGH)) == (1 << KIRKWOOD_IRQ_HIGH)) {
 		uint32_t causehigh = read_mlmbreg(KIRKWOOD_MLMB_MICHR);
 		uint32_t pendinghigh = read_mlmbreg(KIRKWOOD_MLMB_MIRQIMHR);
 		pendinghigh &= causehigh;



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

2012-10-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 20 22:24:24 UTC 2012

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

Log Message:
Ticket 606.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 src/doc/CHANGES-6.0.1

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

Modified files:

Index: src/doc/CHANGES-6.0.1
diff -u src/doc/CHANGES-6.0.1:1.1.2.2 src/doc/CHANGES-6.0.1:1.1.2.3
--- src/doc/CHANGES-6.0.1:1.1.2.2	Fri Oct 19 17:34:55 2012
+++ src/doc/CHANGES-6.0.1	Sat Oct 20 22:24:24 2012
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-6.0.1,v 1.1.2.2 2012/10/19 17:34:55 riz Exp $
+# $NetBSD: CHANGES-6.0.1,v 1.1.2.3 2012/10/20 22:24:24 riz Exp $
 
 A complete list of changes from the NetBSD 6.0 release to the NetBSD 6.0.1
 release:
@@ -19,3 +19,8 @@ sys/arch/x86/include/lock.h			1.26
 	Work around a possible gcc bug.  Fixes PR#45673.
 	[apb, ticket #606]
 
+doc/CHANGES	patch
+
+	Typo fix: OpenSSL, not OpenSSH.
+	[khorben, ticket #608]
+



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

2012-10-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 20 22:18:43 UTC 2012

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

Log Message:
Pull up following revision(s) (requested by khorben in ticket #608):

Fix typo - OpenSSL 1.0.1c, not OpenSSH.


To generate a diff of this commit:
cvs rdiff -u -r1.1670.2.11 -r1.1670.2.11.2.1 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.1670.2.11 src/doc/CHANGES:1.1670.2.11.2.1
--- src/doc/CHANGES:1.1670.2.11	Fri Oct  5 18:37:24 2012
+++ src/doc/CHANGES	Sat Oct 20 22:18:43 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1670.2.11 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1670.2.11.2.1 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1286,5 +1286,5 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
 	wm(4): Add support for Intel I350 Ethernet. [msaitoh 20120525]
 	postfix(1): Import version 2.8.11 [tron 20120609]
 	evbarm: Add initial support for the RaspberryPi. [skrll 20120726]
-	OpenSSH: Imported 1.0.1c [christos 20120726]
+	OpenSSL: Imported 1.0.1c [christos 20120726]
 	postfix(1): Import version 2.8.12 [tron 20120810]



CVS commit: [netbsd-6] src/doc

2012-10-20 Thread Jeff Rizzo
Module Name:src
Committed By:   riz
Date:   Sat Oct 20 22:18:30 UTC 2012

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

Log Message:
Pull up following revision(s) (requested by khorben in ticket #608):

Fix typo - OpenSSL 1.0.1c, not OpenSSH.


To generate a diff of this commit:
cvs rdiff -u -r1.1670.2.11 -r1.1670.2.12 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.1670.2.11 src/doc/CHANGES:1.1670.2.12
--- src/doc/CHANGES:1.1670.2.11	Fri Oct  5 18:37:24 2012
+++ src/doc/CHANGES	Sat Oct 20 22:18:29 2012
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1670.2.11 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.1670.2.12 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -1286,5 +1286,5 @@ Changes from NetBSD 5.0 to NetBSD 6.0:
 	wm(4): Add support for Intel I350 Ethernet. [msaitoh 20120525]
 	postfix(1): Import version 2.8.11 [tron 20120609]
 	evbarm: Add initial support for the RaspberryPi. [skrll 20120726]
-	OpenSSH: Imported 1.0.1c [christos 20120726]
+	OpenSSL: Imported 1.0.1c [christos 20120726]
 	postfix(1): Import version 2.8.12 [tron 20120810]



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

2012-10-20 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Oct 20 22:11:38 UTC 2012

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

Log Message:
Use 0 for MS_NOMNTTAB since we have no mnttab anyway.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/external/cddl/osnet/sys/sys/mount.h

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

Modified files:

Index: src/external/cddl/osnet/sys/sys/mount.h
diff -u src/external/cddl/osnet/sys/sys/mount.h:1.5 src/external/cddl/osnet/sys/sys/mount.h:1.6
--- src/external/cddl/osnet/sys/sys/mount.h:1.5	Sat Oct 20 11:37:37 2012
+++ src/external/cddl/osnet/sys/sys/mount.h	Sat Oct 20 22:11:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.5 2012/10/20 11:37:37 joerg Exp $	*/
+/*	$NetBSD: mount.h,v 1.6 2012/10/20 22:11:38 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek 
@@ -37,7 +37,7 @@
 #define	MS_FORCE	MNT_FORCE
 #define	MS_REMOUNT	MNT_UPDATE
 #define	MS_OPTIONSTR	__MNT_UNUSED1
-#define	MS_NOMNTTAB	__MNT_UNUSED1
+#define	MS_NOMNTTAB	0   /* We don't have any mnttab anyway.  */
 
 typedef	struct fid		fid_t;
 



CVS commit: src/sys/dev/pci

2012-10-20 Thread SAITOH Masanobu
Module Name:src
Committed By:   msaitoh
Date:   Sat Oct 20 19:53:29 UTC 2012

Modified Files:
src/sys/dev/pci: pcidevs

Log Message:
Add SB600_USB_OHCI0 again. This was (accidentally) removed in rev. 1.1105


To generate a diff of this commit:
cvs rdiff -u -r1.1141 -r1.1142 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.1141 src/sys/dev/pci/pcidevs:1.1142
--- src/sys/dev/pci/pcidevs:1.1141	Sat Oct 20 06:14:06 2012
+++ src/sys/dev/pci/pcidevs	Sat Oct 20 19:53:28 2012
@@ -1,4 +1,4 @@
-$NetBSD: pcidevs,v 1.1141 2012/10/20 06:14:06 matt Exp $
+$NetBSD: pcidevs,v 1.1142 2012/10/20 19:53:28 msaitoh Exp $
 
 /*
  * Copyright (c) 1995, 1996 Christopher G. Demetriou
@@ -1229,6 +1229,7 @@ product ATI SB600_AZALIA	0x4383	SB600 Az
 product ATI SB600_PPB_4384	0x4384	SB600 PCI to PCI Bridge
 product ATI SB600_SMB		0x4385	SB600/SB700/SB800 SMBus Controller
 product ATI SB600_USB_EHCI	0x4386	SB600 USB EHCI Controller
+product ATI SB600_USB_OHCI0	0x4387	SB600 USB OHCI0 Controller
 product ATI SB600_USB_OHCI1	0x4388	SB600 USB OHCI1 Controller
 product ATI SB600_USB_OHCI2	0x4389	SB600 USB OHCI2 Controller
 product ATI SB600_USB_OHCI3	0x438a	SB600 USB OHCI3 Controller



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp/dist/src/libverify

2012-10-20 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sat Oct 20 15:58:46 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
verify.h

Log Message:
fix up name of struct, missed on an earlier pass


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 \
src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h:1.1.2.3 src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h:1.1.2.4
--- src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h:1.1.2.3	Sat Oct 20 05:55:43 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/verify.h	Sat Oct 20 15:58:46 2012
@@ -49,7 +49,7 @@ typedef struct pgpv_bignum_t {
 
 #define PGPV_MAX_HASH_LEN	20
 
-typedef struct fingerprint_t {
+typedef struct pgpv_fingerprint_t {
 	uint8_t			hashalg;
 	uint8_t			v[PGPV_MAX_HASH_LEN];
 	uint32_t		len;



CVS commit: src/sys/arch/bebox/bebox

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 14:56:31 UTC 2012

Modified Files:
src/sys/arch/bebox/bebox: pic_bebox.c

Log Message:
Add experimental support GENERIC.MP.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/bebox/bebox/pic_bebox.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/bebox/bebox/pic_bebox.c
diff -u src/sys/arch/bebox/bebox/pic_bebox.c:1.9 src/sys/arch/bebox/bebox/pic_bebox.c:1.10
--- src/sys/arch/bebox/bebox/pic_bebox.c:1.9	Sat Oct 20 12:37:49 2012
+++ src/sys/arch/bebox/bebox/pic_bebox.c	Sat Oct 20 14:56:31 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pic_bebox.c,v 1.9 2012/10/20 12:37:49 kiyohara Exp $ */
+/* $NetBSD: pic_bebox.c,v 1.10 2012/10/20 14:56:31 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.9 2012/10/20 12:37:49 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.10 2012/10/20 14:56:31 kiyohara Exp $");
+
+#include "opt_multiprocessor.h"
 
 #include 
 #include 
@@ -68,6 +70,11 @@ setup_bebox_intr(void)
 	pic->pic_establish_irq = dummy_pic_establish_intr;
 	strcpy(pic->pic_name, "bebox");
 	pic_add(pic);
+
+#ifdef MULTIPROCESSOR
+	setup_bebox_ipi();
+#endif
+
 	return(pic);
 }
 



CVS commit: src/sys/arch/bebox

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 14:53:38 UTC 2012

Modified Files:
src/sys/arch/bebox/bebox: cpu.c locore.S
src/sys/arch/bebox/conf: files.bebox
src/sys/arch/bebox/include: cpu.h intr.h
Added Files:
src/sys/arch/bebox/bebox: ipi_bebox.c
src/sys/arch/bebox/conf: GENERIC.MP

Log Message:
Add experimental support GENERIC.MP.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/bebox/bebox/cpu.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/bebox/bebox/ipi_bebox.c
cvs rdiff -u -r1.27 -r1.28 src/sys/arch/bebox/bebox/locore.S
cvs rdiff -u -r0 -r1.1 src/sys/arch/bebox/conf/GENERIC.MP
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/bebox/conf/files.bebox
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/bebox/include/cpu.h
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/bebox/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/bebox/bebox/cpu.c
diff -u src/sys/arch/bebox/bebox/cpu.c:1.11 src/sys/arch/bebox/bebox/cpu.c:1.12
--- src/sys/arch/bebox/bebox/cpu.c:1.11	Fri Jul  1 20:34:52 2011
+++ src/sys/arch/bebox/bebox/cpu.c	Sat Oct 20 14:53:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.c,v 1.11 2011/07/01 20:34:52 dyoung Exp $	*/
+/*	$NetBSD: cpu.c,v 1.12 2012/10/20 14:53:37 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -30,21 +30,29 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.11 2011/07/01 20:34:52 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.12 2012/10/20 14:53:37 kiyohara Exp $");
+
+#include "opt_multiprocessor.h"
 
 #include 
+#include 
 #include 
 #include 
 
 #include 
-#include 
 #include 
 
+#include 
+#include 
+#include 
+
+#include 
+
+
 int cpumatch(device_t, cfdata_t, void *);
 void cpuattach(device_t, device_t, void *);
 
-CFATTACH_DECL_NEW(cpu, 0,
-cpumatch, cpuattach, NULL, NULL);
+CFATTACH_DECL_NEW(cpu, 0, cpumatch, cpuattach, NULL, NULL);
 
 extern struct cfdriver cpu_cd;
 
@@ -52,16 +60,126 @@ int
 cpumatch(device_t parent, cfdata_t cfdata, void *aux)
 {
 	struct confargs *ca = aux;
-  
+
 	if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0)
-		return (0);
-	if (cpu_info[0].ci_dev != NULL)
-		return (0);
-	return (1);
+		return 0;
+	return 1;
 }
 
 void
 cpuattach(device_t parent, device_t self, void *aux)
 {
-	(void) cpu_attach_common(self, 0);
+	struct confargs *ca = aux;
+	struct cpu_info *ci;
+	int id = ca->ca_node;
+
+	ci = cpu_attach_common(self, id);
+	if (ci == NULL)
+		return;
+
+#ifdef MULTIPROCESSOR
+	if (id > 0)
+		cpu_spinup(self, ci);
+#endif
+}
+
+
+#ifdef MULTIPROCESSOR
+
+extern volatile u_int cpu_spinstart_ack, cpu_spinstart_cpunum;
+
+int
+md_setup_trampoline(volatile struct cpu_hatch_data *h, struct cpu_info *ci)
+{
+	int blocks, i;
+	extern void cache_flush_invalidate_all(int blocks);
+
+	/*
+	 * Our CPU(603e) supports control protocol for cache only MEI
+	 * (Modified/Exclusive/Invalid).  Flush dirty caches myself.
+	 */
+
+	h->hatch_running = -1;
+	cpu_spinstart_ack = -1;
+
+	/* Flush-invalidate all blocks */
+	blocks = curcpu()->ci_ci.dcache_size / curcpu()->ci_ci.dcache_line_size;
+	cache_flush_invalidate_all(blocks);
+
+	cpu_spinstart_cpunum = ci->ci_cpuid;
+	__asm volatile("dcbf 0,%0"::"r"(&cpu_spinstart_cpunum):"memory");
+
+	for (i = 0; i < 1; i++) {
+		if (cpu_spinstart_ack != -1)
+			break;
+		__asm volatile("dcbi 0,%0"::"r"(&cpu_spinstart_ack):"memory");
+		__asm volatile("sync; isync");
+	}
+	return 1;
+}
+
+void
+md_presync_timebase(volatile struct cpu_hatch_data *h)
+{
+	uint64_t tb;
+
+	/* Sync timebase. */
+	tb = mftb();
+	tb += 100;	/* 30ms @ 33MHz */
+
+	h->hatch_tbu = tb >> 32;
+	h->hatch_tbl = tb & 0x;
+
+	while (tb > mftb())
+		;
+
+	h->hatch_running = 0;
+
+	delay(50);
 }
+
+void
+md_start_timebase(volatile struct cpu_hatch_data *h)
+{
+	/* Nothing */
+}
+
+void
+md_sync_timebase(volatile struct cpu_hatch_data *h)
+{
+	u_int tbu, tbl;
+
+	do {
+		__asm volatile("dcbi 0,%0"::"r"(&h->hatch_running):"memory");
+		__asm volatile("sync; isync");
+
+		__asm volatile("dcbst 0,%0"::"r"(&h->hatch_running):"memory");
+		__asm volatile("sync; isync");
+	} while (h->hatch_running == -1);
+
+	__asm volatile("dcbi 0,%0"::"r"(&h->hatch_tbu):"memory");
+	__asm volatile("dcbi 0,%0"::"r"(&h->hatch_tbl):"memory");
+	__asm volatile("sync; isync");
+	__asm volatile("dcbst 0,%0"::"r"(&h->hatch_tbu):"memory");
+	__asm volatile("dcbst 0,%0"::"r"(&h->hatch_tbl):"memory");
+	__asm volatile("sync; isync");
+
+	/* Sync timebase. */
+	tbu = h->hatch_tbu;
+	tbl = h->hatch_tbl;
+	__asm volatile ("sync; isync");
+	__asm volatile ("mttbl %0" :: "r"(0));
+	__asm volatile ("mttbu %0" :: "r"(tbu));
+	__asm volatile ("mttbl %0" :: "r"(tbl));
+}
+
+void
+md_setup_interrupts(void)
+{
+
+	CLEAR_BEBOX_REG(CPU1_INT_MASK, BEBOX_INTR_MASK);
+
+	/* XX: We can handle interrupts on CPU0 only now. */
+}
+
+#endif /* MULTIPROCESSOR */

Index

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

2012-10-20 Thread Matt Thomas
Module Name:src
Committed By:   matt
Date:   Sat Oct 20 14:42:20 UTC 2012

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

Log Message:
Increase l2pts to accomodate large memory disks.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/arm/include/arm32/machdep.h

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

Modified files:

Index: src/sys/arch/arm/include/arm32/machdep.h
diff -u src/sys/arch/arm/include/arm32/machdep.h:1.16 src/sys/arch/arm/include/arm32/machdep.h:1.17
--- src/sys/arch/arm/include/arm32/machdep.h:1.16	Sat Sep  1 12:19:32 2012
+++ src/sys/arch/arm/include/arm32/machdep.h	Sat Oct 20 14:42:20 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.h,v 1.16 2012/09/01 12:19:32 martin Exp $ */
+/* $NetBSD: machdep.h,v 1.17 2012/10/20 14:42:20 matt Exp $ */
 
 #ifndef _ARM32_BOOT_MACHDEP_H_
 #define _ARM32_BOOT_MACHDEP_H_
@@ -43,7 +43,7 @@ struct bootmem_info {
 	 */
 	pv_addr_t bmi_vector_l2pt;
 	pv_addr_t bmi_io_l2pt;
-	pv_addr_t bmi_l2pts[16];
+	pv_addr_t bmi_l2pts[32];	// for large memory disks.
 	u_int bmi_freepages;
 	u_int bmi_nfreeblocks;
 };



CVS commit: src/sys/arch/powerpc

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 14:42:15 UTC 2012

Modified Files:
src/sys/arch/powerpc/conf: files.powerpc
src/sys/arch/powerpc/include: cpu.h
src/sys/arch/powerpc/oea: cpu_subr.c ofwoea_machdep.c pmap.c
src/sys/arch/powerpc/powerpc: vm_machdep.c

Log Message:
Support Cache Protocol 'MEI' with MULTIPROCESSOR.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/powerpc/conf/files.powerpc
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/powerpc/include/cpu.h
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/powerpc/oea/cpu_subr.c
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/powerpc/oea/ofwoea_machdep.c
cvs rdiff -u -r1.86 -r1.87 src/sys/arch/powerpc/oea/pmap.c
cvs rdiff -u -r1.97 -r1.98 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/conf/files.powerpc
diff -u src/sys/arch/powerpc/conf/files.powerpc:1.84 src/sys/arch/powerpc/conf/files.powerpc:1.85
--- src/sys/arch/powerpc/conf/files.powerpc:1.84	Tue Oct  2 23:51:39 2012
+++ src/sys/arch/powerpc/conf/files.powerpc	Sat Oct 20 14:42:15 2012
@@ -1,9 +1,10 @@
-#	$NetBSD: files.powerpc,v 1.84 2012/10/02 23:51:39 christos Exp $
+#	$NetBSD: files.powerpc,v 1.85 2012/10/20 14:42:15 kiyohara Exp $
 
 defflag	opt_altivec.h	ALTIVEC K_ALTIVEC PPC_HAVE_SPE
 defflag	opt_openpic.h	OPENPIC OPENPIC_SERIAL_MODE OPENPIC_DISTRIBUTE
 defparam opt_ppcparam.h	L2CR_CONFIG L3CR_CONFIG INTSTK CLOCKBASE VERBOSE_INITPPC
 defflag	opt_ppcarch.h	PPC_OEA PPC_OEA601 PPC_OEA64 PPC_OEA64_BRIDGE PPC_MPC8XX PPC_IBM4XX PPC_IBM403 PPC_BOOKE
+defflag opt_ppccache.h	CACHE_PROTO_MEI
 defflag opt_pmap.h	PMAPDEBUG PMAPCHECK PMAPCOUNTERS PMAP_MINIMALTLB
 defparam opt_pmap.h	PTEGCOUNT PMAP_MEMLIMIT
 

Index: src/sys/arch/powerpc/include/cpu.h
diff -u src/sys/arch/powerpc/include/cpu.h:1.93 src/sys/arch/powerpc/include/cpu.h:1.94
--- src/sys/arch/powerpc/include/cpu.h:1.93	Sat Jul 28 23:11:00 2012
+++ src/sys/arch/powerpc/include/cpu.h	Sat Oct 20 14:42:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.93 2012/07/28 23:11:00 matt Exp $	*/
+/*	$NetBSD: cpu.h,v 1.94 2012/10/20 14:42:15 kiyohara Exp $	*/
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -165,7 +165,8 @@ struct cpu_hatch_data {
 	uintptr_t hatch_asr;
 	uintptr_t hatch_sdr1;
 	uint32_t hatch_sr[16];
-	uintptr_t hatch_batu[8], hatch_batl[8];
+	uintptr_t hatch_ibatu[8], hatch_ibatl[8];
+	uintptr_t hatch_dbatu[8], hatch_dbatl[8];
 #endif
 #if defined(PPC_BOOKE)
 	vaddr_t hatch_sp;

Index: src/sys/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.75 src/sys/arch/powerpc/oea/cpu_subr.c:1.76
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.75	Sat Oct 20 13:18:45 2012
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sat Oct 20 14:42:15 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.75 2012/10/20 13:18:45 kiyohara Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.76 2012/10/20 14:42:15 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,9 +34,10 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.75 2012/10/20 13:18:45 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.76 2012/10/20 14:42:15 kiyohara Exp $");
 
 #include "opt_ppcparam.h"
+#include "opt_ppccache.h"
 #include "opt_multiprocessor.h"
 #include "opt_altivec.h"
 #include "sysmon_envsys.h"
@@ -581,6 +582,13 @@ cpu_setup(device_t self, struct cpu_info
 		break;
 	}
 
+#ifdef MULTIPROCESSOR
+	switch (vers) {
+	case MPC603e:
+		hid0 |= HID0_ABE;
+	}
+#endif
+
 	if (hid0 != hid0_save) {
 		mtspr(SPR_HID0, hid0);
 		__asm volatile("sync;isync");
@@ -1189,7 +1197,7 @@ cpu_tau_refresh(struct sysmon_envsys *sm
 #endif /* NSYSMON_ENVSYS > 0 */
 
 #ifdef MULTIPROCESSOR
-extern volatile u_int cpu_spinstart_ack;
+volatile u_int cpu_spinstart_ack, cpu_spinstart_cpunum;
 
 int
 cpu_spinup(device_t self, struct cpu_info *ci)
@@ -1243,14 +1251,22 @@ cpu_spinup(device_t self, struct cpu_inf
 		h->hatch_asr = 0;
 
 	/* copy the bat regs */
-	__asm volatile ("mfibatu %0,0" : "=r"(h->hatch_batu[0]));
-	__asm volatile ("mfibatl %0,0" : "=r"(h->hatch_batl[0]));
-	__asm volatile ("mfibatu %0,1" : "=r"(h->hatch_batu[1]));
-	__asm volatile ("mfibatl %0,1" : "=r"(h->hatch_batl[1]));
-	__asm volatile ("mfibatu %0,2" : "=r"(h->hatch_batu[2]));
-	__asm volatile ("mfibatl %0,2" : "=r"(h->hatch_batl[2]));
-	__asm volatile ("mfibatu %0,3" : "=r"(h->hatch_batu[3]));
-	__asm volatile ("mfibatl %0,3" : "=r"(h->hatch_batl[3]));
+	__asm volatile ("mfibatu %0,0" : "=r"(h->hatch_ibatu[0]));
+	__asm volatile ("mfibatl %0,0" : "=r"(h->hatch_ibatl[0]));
+	__asm volatile ("mfibatu %0,1" : "=r"(h->hatch_ibatu[1]));
+	__asm volatile ("mfibatl %0,1" : "=r"(h->hatch_ibatl[1]));
+	__asm volatile ("mfibatu %0,2" : "=r"(h->hatch_ibatu[2]));
+	__asm volatile ("mfibatl %0,2" : "=r"(h->hatch_ibatl[2]));
+	__asm volatile ("mfibatu %0,3" : "=r"(h->hatch_ibatu[3]));
+	__asm volatile ("mfiba

CVS commit: src/sys/dev/sbus

2012-10-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Oct 20 13:52:11 UTC 2012

Modified Files:
src/sys/dev/sbus: agten.c files.sbus

Log Message:
- only sync the drawing engine when we're about to access video memory
- use the blitter to draw the cursor
- use the glyphcache to minimize vram access
-> about 15% to 20% speedup


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/dev/sbus/agten.c
cvs rdiff -u -r1.38 -r1.39 src/sys/dev/sbus/files.sbus

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/sbus/agten.c
diff -u src/sys/dev/sbus/agten.c:1.28 src/sys/dev/sbus/agten.c:1.29
--- src/sys/dev/sbus/agten.c:1.28	Wed Jan 11 16:08:57 2012
+++ src/sys/dev/sbus/agten.c	Sat Oct 20 13:52:11 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: agten.c,v 1.28 2012/01/11 16:08:57 macallan Exp $ */
+/*	$NetBSD: agten.c,v 1.29 2012/10/20 13:52:11 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,14 +27,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.28 2012/01/11 16:08:57 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.29 2012/10/20 13:52:11 macallan Exp $");
 
 /*
  * a driver for the Fujitsu AG-10e SBus framebuffer
  *
  * this thing is Frankenstein's Monster among graphics boards.
  * it contains three graphics chips:
- * a GLint - 24bit stuff, double-buffered
+ * a GLint 300SX - 24bit stuff, double-buffered
  * an Imagine 128 which provides an 8bit overlay
  * a Weitek P9100 which provides WIDs
  * so here we need to mess only with the P9100 and the I128 - for X we just
@@ -68,6 +68,7 @@ __KERNEL_RCSID(0, "$NetBSD: agten.c,v 1.
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -119,7 +120,11 @@ struct agten_softc {
 
 	int sc_mode;
 	uint32_t sc_bg;
+
+	void (*sc_putchar)(void *, int, int, u_int, long);
+
 	struct vcons_data vd;
+	glyphcache sc_gc;
 };
 
 CFATTACH_DECL_NEW(agten, sizeof(struct agten_softc),
@@ -135,6 +140,11 @@ static void	agten_gfx(struct agten_softc
 static void	agten_set_video(struct agten_softc *, int);
 static int	agten_get_video(struct agten_softc *);
 
+static void	agten_bitblt(void *, int, int, int, int, int, int, int);
+static void 	agten_rectfill(void *, int, int, int, int, long);
+
+static void	agten_putchar(void *, int, int, u_int, long);
+static void	agten_cursor(void *, int, int, int);
 static void	agten_copycols(void *, int, int, int, int);
 static void	agten_erasecols(void *, int, int, int, long);
 static void	agten_copyrows(void *, int, int, int);
@@ -236,6 +246,7 @@ agten_attach(device_t parent, device_t d
 	sc->sc_fb_is_open = 0;
 	sc->sc_video = -1;
 	sc->sc_bustag = sa->sa_bustag;
+	sc->sc_putchar = NULL;
 
 	sc->sc_width = prom_getpropint(node, "ffb_width", 1152);
 	sc->sc_height = prom_getpropint(node, "ffb_height", 900);
@@ -297,6 +308,15 @@ agten_attach(device_t parent, device_t d
 
 	ri = &sc->sc_console_screen.scr_ri;
 
+	sc->sc_gc.gc_bitblt = agten_bitblt;
+	sc->sc_gc.gc_rectfill = agten_rectfill;
+	sc->sc_gc.gc_blitcookie = sc;
+	sc->sc_gc.gc_rop = CR_COPY;
+
+#if defined(AGTEN_DEBUG)
+	sc->sc_height -= 200;
+#endif
+
 	if (console) {
 		vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
 		&defattr);
@@ -306,6 +326,14 @@ agten_attach(device_t parent, device_t d
 		sc->sc_defaultscreen_descr.capabilities = ri->ri_caps;
 		sc->sc_defaultscreen_descr.nrows = ri->ri_rows;
 		sc->sc_defaultscreen_descr.ncols = ri->ri_cols;
+		glyphcache_init(&sc->sc_gc,
+		sc->sc_height + 5,
+		(0x40 / sc->sc_stride) - sc->sc_height - 5,
+		sc->sc_width,
+		ri->ri_font->fontwidth,
+		ri->ri_font->fontheight,
+		defattr);
+
 		wsdisplay_cnattach(&sc->sc_defaultscreen_descr, ri, 0, 0,
 		defattr);
 		i128_rectfill(sc->sc_bustag, sc->sc_i128_regh, 0, 0,
@@ -317,6 +345,18 @@ agten_attach(device_t parent, device_t d
 		 * since we're not the console we can postpone the rest
 		 * until someone actually allocates a screen for us
 		 */
+		if (sc->sc_console_screen.scr_ri.ri_rows == 0) {
+			/* do some minimal setup to avoid weirdnesses later */
+			vcons_init_screen(&sc->vd, &sc->sc_console_screen, 1,
+			&defattr);
+		}
+		glyphcache_init(&sc->sc_gc,
+		sc->sc_height + 5,
+		(0x40 / sc->sc_stride) - sc->sc_height - 5,
+		sc->sc_width,
+		ri->ri_font->fontwidth,
+		ri->ri_font->fontheight,
+		defattr);
 	}
 
 	/* Initialize the default color map. */
@@ -470,12 +510,16 @@ agten_init_screen(void *cookie, struct v
 	}
 
 	rasops_init(ri, 0, 0);
+	sc->sc_putchar = ri->ri_ops.putchar;
+
 	ri->ri_caps = WSSCREEN_WSCOLORS;
 
 	rasops_reconfig(ri, sc->sc_height / ri->ri_font->fontheight,
 		sc->sc_width / ri->ri_font->fontwidth);
 
 	ri->ri_hw = scr;
+	ri->ri_ops.putchar   = agten_putchar;
+	ri->ri_ops.cursor= agten_cursor;
 	ri->ri_ops.copyrows  = agten_copyrows;
 	ri->ri_ops.eraserows = agten_eraserows;
 	ri->ri_ops.copycols  = agten_copycols;
@@ -68

CVS commit: src/sys/dev/ic

2012-10-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Oct 20 13:31:09 UTC 2012

Modified Files:
src/sys/dev/ic: i128.c i128var.h

Log Message:
don't sync after each drawing op, ass functions to wait for the engine to get
ready for more commands or idle


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/dev/ic/i128.c
cvs rdiff -u -r1.2 -r1.3 src/sys/dev/ic/i128var.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/i128.c
diff -u src/sys/dev/ic/i128.c:1.3 src/sys/dev/ic/i128.c:1.4
--- src/sys/dev/ic/i128.c:1.3	Tue Apr 29 06:53:02 2008
+++ src/sys/dev/ic/i128.c	Sat Oct 20 13:31:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i128.c,v 1.3 2008/04/29 06:53:02 martin Exp $ */
+/*	$NetBSD: i128.c,v 1.4 2012/10/20 13:31:09 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i128.c,v 1.3 2008/04/29 06:53:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i128.c,v 1.4 2012/10/20 13:31:09 macallan Exp $");
 
 #include 
 #include 
@@ -102,7 +102,6 @@ i128_bitblt(bus_space_tag_t tag, bus_spa
 	bus_space_write_4(tag, regh, XY2_WH, (wi << 16) | he);
 	bus_space_write_4(tag, regh, XY0_SRC, (xs << 16) | ys);
 	bus_space_write_4(tag, regh, XY1_DST, (xd << 16) | yd);
-	I128_DONE(tag, regh);
 }
 
 void
@@ -118,5 +117,17 @@ i128_rectfill(bus_space_tag_t tag, bus_s
 	bus_space_write_4(tag, regh, XY2_WH, (wi << 16) | he);
 	bus_space_write_4(tag, regh, XY0_SRC, 0);
 	bus_space_write_4(tag, regh, XY1_DST, (x << 16) | y);
-	I128_DONE(tag, regh);
 }
+
+void
+i128_ready(bus_space_tag_t t, bus_space_handle_t h)
+{
+I128_READY(t, h);
+}
+
+void
+i128_sync(bus_space_tag_t t, bus_space_handle_t h)
+{
+I128_DONE(t, h);
+}
+ 

Index: src/sys/dev/ic/i128var.h
diff -u src/sys/dev/ic/i128var.h:1.2 src/sys/dev/ic/i128var.h:1.3
--- src/sys/dev/ic/i128var.h:1.2	Tue Apr 29 06:53:02 2008
+++ src/sys/dev/ic/i128var.h	Sat Oct 20 13:31:09 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: i128var.h,v 1.2 2008/04/29 06:53:02 martin Exp $ */
+/*	$NetBSD: i128var.h,v 1.3 2012/10/20 13:31:09 macallan Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: i128var.h,v 1.2 2008/04/29 06:53:02 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i128var.h,v 1.3 2012/10/20 13:31:09 macallan Exp $");
 
 /* 
  * register definition for Number Nine Imagine 128 graphics controllers
@@ -44,5 +44,8 @@ void i128_bitblt(bus_space_tag_t, bus_sp
 int, int);
 void i128_rectfill(bus_space_tag_t, bus_space_handle_t, int, int, int, int,
 uint32_t);
+void i128_ready(bus_space_tag_t, bus_space_handle_t);
+void i128_sync(bus_space_tag_t, bus_space_handle_t);
+
 
 #endif /* I128VAR_H */



CVS commit: src/sys/dev/ic

2012-10-20 Thread Michael Lorenz
Module Name:src
Committed By:   macallan
Date:   Sat Oct 20 13:29:53 UTC 2012

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

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/dev/ic/ibm561reg.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/ibm561reg.h
diff -u src/sys/dev/ic/ibm561reg.h:1.5 src/sys/dev/ic/ibm561reg.h:1.6
--- src/sys/dev/ic/ibm561reg.h:1.5	Mon Apr 28 20:23:50 2008
+++ src/sys/dev/ic/ibm561reg.h	Sat Oct 20 13:29:53 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: ibm561reg.h,v 1.5 2008/04/28 20:23:50 martin Exp $ */
+/* $NetBSD: ibm561reg.h,v 1.6 2012/10/20 13:29:53 macallan Exp $ */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -155,7 +155,7 @@
 #define IBM561_CURSOR_LUT		0x0a10
 	/*
 	 * four blocks of 4, transparent, 1, 2, 3 each 
-	 * cursor orimary, cursor blink, xhair primary, xhair blink 
+	 * cursor primary, cursor blink, xhair primary, xhair blink 
 	 */
 
 #define IBM561_CURSOR_BITMAP		0x2000



CVS commit: src/sys/arch/powerpc/oea

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 13:18:45 UTC 2012

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Fix broken cpu_hatch_stack.
And define macro HATCH_STACK_SIZE.


To generate a diff of this commit:
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/powerpc/oea/cpu_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/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.74 src/sys/arch/powerpc/oea/cpu_subr.c:1.75
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.74	Sat Oct 20 13:10:44 2012
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sat Oct 20 13:18:45 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.74 2012/10/20 13:10:44 kiyohara Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.75 2012/10/20 13:18:45 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.74 2012/10/20 13:10:44 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.75 2012/10/20 13:18:45 kiyohara Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_multiprocessor.h"
@@ -236,6 +236,7 @@ struct cpu_info cpu_info[CPU_MAXNUM] = {
 };
 volatile struct cpu_hatch_data *cpu_hatch_data;
 volatile int cpu_hatch_stack;
+#define HATCH_STACK_SIZE 0x1000
 extern int ticks_per_intr;
 #include 
 #include 
@@ -1203,7 +1204,7 @@ cpu_spinup(device_t self, struct cpu_inf
 	KASSERT(ci != curcpu());
 
 	/* Now allocate a hatch stack */
-	error = uvm_pglistalloc(0x1000, 0x1, 0x1000, 16, 0,
+	error = uvm_pglistalloc(HATCH_STACK_SIZE, 0x1, 0x1000, 16, 0,
 	&mlist, 1, 1);
 	if (error) {
 		aprint_error(": unable to allocate hatch stack\n");
@@ -1211,7 +1212,7 @@ cpu_spinup(device_t self, struct cpu_inf
 	}
 
 	hp = (void *)VM_PAGE_TO_PHYS(TAILQ_FIRST(&mlist));
-	memset(hp, 0, 0x1000);
+	memset(hp, 0, HATCH_STACK_SIZE);
 
 	/* Initialize secondary cpu's initial lwp to its idlelwp. */
 	ci->ci_curlwp = ci->ci_data.cpu_idlelwp;
@@ -1224,7 +1225,7 @@ cpu_spinup(device_t self, struct cpu_inf
 	h->hatch_ci = ci;
 	h->hatch_pir = ci->ci_cpuid;
 
-	cpu_hatch_stack = (uint32_t)hp;
+	cpu_hatch_stack = (uint32_t)hp + HATCH_STACK_SIZE - CALLFRAMELEN;
 	ci->ci_lasttb = cpu_info[0].ci_lasttb;
 
 	/* copy special registers */



CVS commit: src/sys/arch/powerpc/oea

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 13:10:44 UTC 2012

Modified Files:
src/sys/arch/powerpc/oea: cpu_subr.c

Log Message:
Remove white-spaces.  And remove unused 'extern void tlbia()'.


To generate a diff of this commit:
cvs rdiff -u -r1.73 -r1.74 src/sys/arch/powerpc/oea/cpu_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/arch/powerpc/oea/cpu_subr.c
diff -u src/sys/arch/powerpc/oea/cpu_subr.c:1.73 src/sys/arch/powerpc/oea/cpu_subr.c:1.74
--- src/sys/arch/powerpc/oea/cpu_subr.c:1.73	Wed Feb  1 09:54:03 2012
+++ src/sys/arch/powerpc/oea/cpu_subr.c	Sat Oct 20 13:10:44 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu_subr.c,v 1.73 2012/02/01 09:54:03 matt Exp $	*/
+/*	$NetBSD: cpu_subr.c,v 1.74 2012/10/20 13:10:44 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 2001 Matt Thomas.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.73 2012/02/01 09:54:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_subr.c,v 1.74 2012/10/20 13:10:44 kiyohara Exp $");
 
 #include "opt_ppcparam.h"
 #include "opt_multiprocessor.h"
@@ -266,13 +266,13 @@ cpu_model_init(void)
 	vers = pvr >> 16;
 
 	oeacpufeat = 0;
-	
+
 	if ((vers >= IBMRS64II && vers <= IBM970GX) || vers == MPC620 ||
 		vers == IBMCELL || vers == IBMPOWER6P5) {
 		oeacpufeat |= OEACPU_64;
 		oeacpufeat |= OEACPU_64_BRIDGE;
 		oeacpufeat |= OEACPU_NOBAT;
-	
+
 	} else if (vers == MPC601) {
 		oeacpufeat |= OEACPU_601;
 
@@ -656,7 +656,7 @@ cpu_setup(device_t self, struct cpu_info
 	/*
 	 * Attach MPC750 temperature sensor to the envsys subsystem.
 	 * XXX the 74xx series also has this sensor, but it is not
-	 * XXX supported by Motorola and may return values that are off by 
+	 * XXX supported by Motorola and may return values that are off by
 	 * XXX 35-55 degrees C.
 	 */
 	if (vers == MPC750 || vers == IBM750FX || vers == IBM750GX)
@@ -799,7 +799,7 @@ cpu_enable_l2cr(register_t l2cr)
 	uint16_t vers;
 
 	vers = mfpvr() >> 16;
-	
+
 	/* Disable interrupts and set the cache config bits. */
 	msr = mfmsr();
 	mtmsr(msr & ~PSL_EE);
@@ -838,7 +838,7 @@ cpu_enable_l3cr(register_t l3cr)
 	register_t x;
 
 	/* By The Book (numbered steps from section 3.7.1.3 of MPC7450UM) */
-
+
 	/*
 	 * 1: Set all L3CR bits for final config except L3E, L3I, L3PE, and
 	 *L3CLKEN.  (also mask off reserved bits in case they were included
@@ -862,7 +862,7 @@ cpu_enable_l3cr(register_t l3cr)
 	do {
 		x = mfspr(SPR_L3CR);
 	} while (x & L3CR_L3I);
-	
+
 	/* 6: Clear L3CLKEN to 0 */
 	l3cr &= ~L3CR_L3CLKEN;
 	mtspr(SPR_L3CR, l3cr);
@@ -964,7 +964,7 @@ cpu_config_l3cr(int vers)
 		cpu_enable_l2cr(l2cr_config);
 		l2cr = mfspr(SPR_L2CR);
 	}
-	
+
 	aprint_normal(",");
 	switch (vers) {
 	case MPC7447A:
@@ -997,7 +997,7 @@ cpu_config_l3cr(int vers)
 		cpu_enable_l3cr(l3cr_config);
 		l3cr = mfspr(SPR_L3CR);
 	}
-	
+
 	if (l3cr & L3CR_L3E) {
 		aprint_normal(",");
 		cpu_fmttab_print(cpu_7450_l3cr_formats, l3cr);
@@ -1123,8 +1123,8 @@ cpu_tau_setup(struct cpu_info *ci)
 	 */
 
 	therm_delay = ci->ci_khz / 40;		/* 25us just to be safe */
-	
-mtspr(SPR_THRM3, SPR_THRM_TIMER(therm_delay) | SPR_THRM_ENABLE); 
+
+mtspr(SPR_THRM3, SPR_THRM_TIMER(therm_delay) | SPR_THRM_ENABLE);
 
 	sme = sysmon_envsys_create();
 
@@ -1136,7 +1136,7 @@ cpu_tau_setup(struct cpu_info *ci)
 		return;
 	}
 
-	sme->sme_name = device_xname(ci->ci_dev);	
+	sme->sme_name = device_xname(ci->ci_dev);
 	sme->sme_cookie = ci;
 	sme->sme_refresh = cpu_tau_refresh;
 
@@ -1161,24 +1161,23 @@ cpu_tau_refresh(struct sysmon_envsys *sm
 	 * Unit in the MPC750 Microprocessor".
 	 */
 	for (i = 5; i >= 0 ; i--) {
-		mtspr(SPR_THRM1, 
+		mtspr(SPR_THRM1,
 		SPR_THRM_THRESHOLD(threshold) | SPR_THRM_VALID);
 		count = 0;
-		while ((count < 10) && 
+		while ((count < 10) &&
 		((mfspr(SPR_THRM1) & SPR_THRM_TIV) == 0)) {
 			count++;
 			delay(1);
 		}
 		if (mfspr(SPR_THRM1) & SPR_THRM_TIN) {
-			/* The interrupt bit was set, meaning the 
-			 * temperature was above the threshold 
+			/* The interrupt bit was set, meaning the
+			 * temperature was above the threshold
 			 */
 			threshold += 1 << i;
 		} else {
 			/* Temperature was below the threshold */
 			threshold -= 1 << i;
 		}
-		
 	}
 	threshold += 2;
 
@@ -1231,7 +1230,7 @@ cpu_spinup(device_t self, struct cpu_inf
 	/* copy special registers */
 
 	h->hatch_hid0 = mfspr(SPR_HID0);
-	
+
 	__asm volatile ("mfsdr1 %0" : "=r"(h->hatch_sdr1));
 	for (i = 0; i < 16; i++) {
 		__asm ("mfsrin %0,%1" : "=r"(h->hatch_sr[i]) :
@@ -1277,7 +1276,6 @@ cpu_spinup(device_t self, struct cpu_inf
 }
 
 static volatile int start_secondary_cpu;
-extern void tlbia(void);
 
 register_t
 cpu_hatch(void)
@@ -1300,7 +1298,7 @@ cpu_hatch(void)
 	msr = mfspr(SPR_PIR);
 	if (msr != h->hatch_pir)
 		mtspr(SPR_PIR, h->hatch_pir);
-	
+
 	__asm volatile ("mtsprg0 %0" :: "r"(ci));
 	curlwp = ci->ci_curlwp;
 	cpu_sp

CVS commit: src/sys/arch/bebox/bebox

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 12:45:22 UTC 2012

Modified Files:
src/sys/arch/bebox/bebox: locore.S

Log Message:
Enable cpu0 I/D cache. Disable cpu1 it.


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/bebox/bebox/locore.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.26 src/sys/arch/bebox/bebox/locore.S:1.27
--- src/sys/arch/bebox/bebox/locore.S:1.26	Sat Oct 20 12:13:46 2012
+++ src/sys/arch/bebox/bebox/locore.S	Sat Oct 20 12:45:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.26 2012/10/20 12:13:46 kiyohara Exp $	*/
+/*	$NetBSD: locore.S,v 1.27 2012/10/20 12:45:22 kiyohara Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -49,6 +49,7 @@
 #include 
 
 #include 
+#include 
 #include 
 
 /*
@@ -123,6 +124,12 @@ __start:
 	nop
 
 __start_cpu1:
+	/* Disable data and instruction caches for spinup. */
+	li	8,0
+	mtspr	SPR_HID0,8
+	sync
+	isync
+
 #ifdef MULTIPROCESSOR
 	li	3, 0x1		/* CPU ID 1 */
 	ba	cpu_spinstart	/* cpu_spinstart(CPU ID) */
@@ -133,6 +140,20 @@ __start_cpu1:
 	nop
 
 __start_cpu0:
+	/* Enable data and instruction caches */
+	mfspr	8,SPR_HID0
+	andi.	8,8,(HID0_ICE|HID0_DCE)@l
+	andi.	0,8,HID0_DCE
+	ori	7,8,HID0_ICFI
+	bne	1f
+	ori	7,7,HID0_DCFI
+1:
+	sync
+	mtspr	SPR_HID0,7
+	sync
+	mtspr	SPR_HID0,8
+	sync
+	isync
 
 /* compute end of kernel memory */
 #if defined(DDB) || NKSYMS || defined(MODULAR)



CVS commit: src/sys/arch/bebox

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 12:37:49 UTC 2012

Modified Files:
src/sys/arch/bebox/bebox: pic_bebox.c
src/sys/arch/bebox/include: bebox.h

Log Message:
Cleanup macros of access for bebox-register.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/bebox/bebox/pic_bebox.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/bebox/include/bebox.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/bebox/bebox/pic_bebox.c
diff -u src/sys/arch/bebox/bebox/pic_bebox.c:1.8 src/sys/arch/bebox/bebox/pic_bebox.c:1.9
--- src/sys/arch/bebox/bebox/pic_bebox.c:1.8	Sun Aug  7 15:13:07 2011
+++ src/sys/arch/bebox/bebox/pic_bebox.c	Sat Oct 20 12:37:49 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: pic_bebox.c,v 1.8 2011/08/07 15:13:07 kiyohara Exp $ */
+/* $NetBSD: pic_bebox.c,v 1.9 2012/10/20 12:37:49 kiyohara Exp $ */
 
 /*-
  * Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.8 2011/08/07 15:13:07 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,v 1.9 2012/10/20 12:37:49 kiyohara Exp $");
 
 #include 
 #include 
@@ -43,9 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: pic_bebox.c,
 
 #include 
 
-#define BEBOX_INTR_MASK		0x0ffc
-#define BEBOX_SET_MASK		0x8000
-#define BEBOX_INTR(x)		(0x8000 >> x)
 
 static void bebox_enable_irq(struct pic_ops *, int, int);
 static void bebox_disable_irq(struct pic_ops *, int);
@@ -78,16 +75,14 @@ static void
 bebox_enable_irq(struct pic_ops *pic, int irq, int type)
 {
 
-	*(volatile unsigned int *)(BEBOX_REG + CPU0_INT_MASK) =
-	BEBOX_SET_MASK | (1 << (31 - irq));
+	SET_BEBOX_REG(CPU0_INT_MASK, 1 << (31 - irq));
 }
 
 static void
 bebox_disable_irq(struct pic_ops *pic, int irq)
 {
 
-	*(volatile unsigned int *)(BEBOX_REG + CPU0_INT_MASK) =
-	(1 << (31 - irq));
+	CLEAR_BEBOX_REG(CPU0_INT_MASK, 1 << (31 - irq));
 }
 
 static int
@@ -95,9 +90,9 @@ bebox_get_irq(struct pic_ops *pic, int m
 {
 	unsigned int state;
 
-	state = *(volatile unsigned int *)(BEBOX_REG + INT_SOURCE);
+	state = READ_BEBOX_REG(INT_SOURCE);
 	state &= BEBOX_INTR_MASK;
-	state &= *(volatile unsigned int *)(BEBOX_REG + CPU0_INT_MASK);
+	state &= READ_BEBOX_REG(CPU0_INT_MASK);
 	if (state == 0)
 		return 255;
 	return __builtin_clz(state);

Index: src/sys/arch/bebox/include/bebox.h
diff -u src/sys/arch/bebox/include/bebox.h:1.1 src/sys/arch/bebox/include/bebox.h:1.2
--- src/sys/arch/bebox/include/bebox.h:1.1	Sun Aug  7 15:04:45 2011
+++ src/sys/arch/bebox/include/bebox.h	Sat Oct 20 12:37:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: bebox.h,v 1.1 2011/08/07 15:04:45 kiyohara Exp $	*/
+/*	$NetBSD: bebox.h,v 1.2 2012/10/20 12:37:49 kiyohara Exp $	*/
 /*
  * Copyright (c) 2011 KIYOHARA Takashi
  * All rights reserved.
@@ -36,11 +36,11 @@
 #define BEBOX_SET_MASK		0x8000
 #define BEBOX_CLEAR_MASK	0x
 
-#define READ_BEBOX_REG(reg)	*(uint32_t *)(BEBOX_REG + (reg))
+#define READ_BEBOX_REG(reg)	*(volatile uint32_t *)(BEBOX_REG + (reg))
 #define SET_BEBOX_REG(reg, v)	\
-		*(uint32_t *)(BEBOX_REG + (reg)) = ((v) | BEBOX_SET_MASK)
+	*(volatile uint32_t *)(BEBOX_REG + (reg)) = ((v) | BEBOX_SET_MASK)
 #define CLEAR_BEBOX_REG(reg, v)	\
-		*(uint32_t *)(BEBOX_REG + (reg)) = ((v) | BEBOX_CLEAR_MASK)
+	*(volatile uint32_t *)(BEBOX_REG + (reg)) = ((v) | BEBOX_CLEAR_MASK)
 
 #define CPU0_INT_MASK	 0x0f0	/* Interrupt Mask for CPU0 */
 #define CPU1_INT_MASK	 0x1f0	/* Interrupt Mask for CPU1 */
@@ -49,6 +49,8 @@
 #define CPU_RESET	 0x4f0	/* Reset Control */
 #define INTR_VECTOR_REG	 0xff0
 
+#define BEBOX_INTR_MASK	0x0ffc
+
 /* Control */
 #define CPU0_SMI	(1 << 30)	/* SMI to CPU0 */
 #define CPU1_SMI	(1 << 29)	/* SMI to CPU1 */



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp/bin/netpgpverify

2012-10-20 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sat Oct 20 12:22:00 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/bin/netpgpverify [agc-netpgp-standalone]:
Makefile

Log Message:
install into the correct place


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile

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

Modified files:

Index: src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile
diff -u src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.1.2.2 src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.1.2.3
--- src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile:1.1.2.2	Sat Oct 20 04:59:52 2012
+++ src/crypto/external/bsd/netpgp/bin/netpgpverify/Makefile	Sat Oct 20 12:22:00 2012
@@ -1,9 +1,11 @@
-# $NetBSD: Makefile,v 1.1.2.2 2012/10/20 04:59:52 agc Exp $
+# $NetBSD: Makefile,v 1.1.2.3 2012/10/20 12:22:00 agc Exp $
 
 .include 
 
 PROG=netpgpverify
 SRCS+=main.c
+BINDIR=/usr/bin
+
 WARNS=5
 MAN=netpgpverify.1
 LDADD+=-lz



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp/dist/src/libverify

2012-10-20 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sat Oct 20 12:18:31 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
libverify.c

Log Message:
Get rid of a debugging inclusion which is no longer needed.


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.3 -r1.1.2.4 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.3 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.4
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.3	Sat Oct 20 10:16:31 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Sat Oct 20 12:18:31 2012
@@ -1897,8 +1897,6 @@ read_binary_memory(pgpv_t *pgp, const ch
 	return read_all_packets(pgp, mem, op);
 }
 
-#include "dump.c"
-
 /* fixup the detached signature packets */
 static int
 fixup_detached(pgpv_cursor_t *cursor, const char *f)



CVS commit: src/sys/arch/bebox

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 12:13:47 UTC 2012

Modified Files:
src/sys/arch/bebox/bebox: locore.S
src/sys/arch/bebox/include: intr.h

Log Message:
Remove unused enable_intr()/disable_intr().


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/bebox/bebox/locore.S
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/bebox/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/bebox/bebox/locore.S
diff -u src/sys/arch/bebox/bebox/locore.S:1.25 src/sys/arch/bebox/bebox/locore.S:1.26
--- src/sys/arch/bebox/bebox/locore.S:1.25	Sun Aug  7 15:44:59 2011
+++ src/sys/arch/bebox/bebox/locore.S	Sat Oct 20 12:13:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.S,v 1.25 2011/08/07 15:44:59 kiyohara Exp $	*/
+/*	$NetBSD: locore.S,v 1.26 2012/10/20 12:13:46 kiyohara Exp $	*/
 /*	$OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $	*/
 
 /*
@@ -157,20 +157,6 @@ __start_cpu0:
 
 loop:	b	loop			/* XXX not reached */
 
-	.globl	_C_LABEL(enable_intr)
-_C_LABEL(enable_intr):
-	mfmsr	3
-	ori	3,3,PSL_EE@l
-	mtmsr	3
-	blr
-
-	.globl	_C_LABEL(disable_intr)
-_C_LABEL(disable_intr):
-	mfmsr	3
-	andi.	3,3,~PSL_EE@l
-	mtmsr	3
-	blr
-
 	.globl	_C_LABEL(debug_led)
 _C_LABEL(debug_led):
 	lis	4, 0x8000

Index: src/sys/arch/bebox/include/intr.h
diff -u src/sys/arch/bebox/include/intr.h:1.31 src/sys/arch/bebox/include/intr.h:1.32
--- src/sys/arch/bebox/include/intr.h:1.31	Sun Aug  7 15:13:07 2011
+++ src/sys/arch/bebox/include/intr.h	Sat Oct 20 12:13:46 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.31 2011/08/07 15:13:07 kiyohara Exp $	*/
+/*	$NetBSD: intr.h,v 1.32 2012/10/20 12:13:46 kiyohara Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -37,10 +37,6 @@
 
 #ifndef _LOCORE
 
-void enable_intr(void);
-void disable_intr(void);
-
-
 #define ICU_LEN			32
 #define IRQ_SLAVE		2
 #define LEGAL_HWIRQ_P(x)	((u_int)(x) < ICU_LEN && (x) != IRQ_SLAVE)



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

2012-10-20 Thread KIYOHARA Takashi
Module Name:src
Committed By:   kiyohara
Date:   Sat Oct 20 11:58:45 UTC 2012

Modified Files:
src/sys/arch/bebox/conf: GENERIC

Log Message:
Disable some not working drivers. (pcppi, spkr, midi)
Disable some not need drivers. (fdc1, bio, raid)


To generate a diff of this commit:
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/bebox/conf/GENERIC

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/conf/GENERIC
diff -u src/sys/arch/bebox/conf/GENERIC:1.132 src/sys/arch/bebox/conf/GENERIC:1.133
--- src/sys/arch/bebox/conf/GENERIC:1.132	Wed Oct 17 14:48:09 2012
+++ src/sys/arch/bebox/conf/GENERIC	Sat Oct 20 11:58:45 2012
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.132 2012/10/17 14:48:09 apb Exp $
+# $NetBSD: GENERIC,v 1.133 2012/10/20 11:58:45 kiyohara Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/bebox/conf/std.bebox"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.132 $"
+#ident 		"GENERIC-$Revision: 1.133 $"
 
 maxusers	32
 
@@ -205,8 +205,8 @@ lpt0	at isa? port 0x378 irq 7	# standard
 
 mcclock0 at isa? port 0x70		# time-of-day clock
 attimer0 at isa?
-pcppi0	at isa?
-spkr0	at pcppi?
+#pcppi0	at isa?
+#spkr0	at pcppi?
 
 wss0	at isa? port 0x82c irq 30 drq 6 drq2 7	# Windows Sound System
 
@@ -214,7 +214,7 @@ wss0	at isa? port 0x82c irq 30 drq 6 drq
 audio*	at audiobus?
 
 # MIDI support
-midi*	at pcppi?			# MIDI interface to the PC speaker
+#midi*	at pcppi?			# MIDI interface to the PC speaker
 
 # Joystick driver. Probe is a little strange; add only if you have one.
 joy0	at isa? port 0x201
@@ -230,7 +230,6 @@ cd*	at scsibus? target ? lun ?	# SCSI CD
 #uk*	at scsibus? target ? lun ?	# SCSI unknown
 
 fdc0	at isa? port 0x3f0 irq 6 drq 2	# standard PC floppy controllers
-#fdc1	at isa? port 0x370 irq ? drq ?
 fd0	at fdc? drive 1
 #fd*	at fdc? drive ?
 
@@ -272,11 +271,11 @@ pseudo-device	crypto			# /dev/crypto dev
 pseudo-device	swcrypto		# software crypto implementation
 
 # disk/mass storage pseudo-devices
-pseudo-device	bio			# RAID control device driver
+#pseudo-device	bio			# RAID control device driver
 pseudo-device	ccd		4	# concatenated/striped disk devices
 pseudo-device	cgd		4	# cryptographic disk devices
-pseudo-device	raid		8	# RAIDframe disk driver
-options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
+#pseudo-device	raid		8	# RAIDframe disk driver
+#options 	RAID_AUTOCONFIG		# auto-configuration of RAID components
 # Options to enable various other RAIDframe RAID types.
 #options 	RF_INCLUDE_EVENODD=1
 #options 	RF_INCLUDE_RAID5_RS=1



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

2012-10-20 Thread Joerg Sonnenberger
Module Name:src
Committed By:   joerg
Date:   Sat Oct 20 11:37:42 UTC 2012

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

Log Message:
Hack to avoid missing macro to unbuild the tree.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/external/cddl/osnet/sys/sys/mount.h

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

Modified files:

Index: src/external/cddl/osnet/sys/sys/mount.h
diff -u src/external/cddl/osnet/sys/sys/mount.h:1.4 src/external/cddl/osnet/sys/sys/mount.h:1.5
--- src/external/cddl/osnet/sys/sys/mount.h:1.4	Sun Feb 28 14:45:47 2010
+++ src/external/cddl/osnet/sys/sys/mount.h	Sat Oct 20 11:37:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mount.h,v 1.4 2010/02/28 14:45:47 haad Exp $	*/
+/*	$NetBSD: mount.h,v 1.5 2012/10/20 11:37:37 joerg Exp $	*/
 
 /*-
  * Copyright (c) 2007 Pawel Jakub Dawidek 
@@ -37,7 +37,7 @@
 #define	MS_FORCE	MNT_FORCE
 #define	MS_REMOUNT	MNT_UPDATE
 #define	MS_OPTIONSTR	__MNT_UNUSED1
-#define	MS_NOMNTTAB	__MNT_UNUSED2
+#define	MS_NOMNTTAB	__MNT_UNUSED1
 
 typedef	struct fid		fid_t;
 



CVS commit: [agc-netpgp-standalone] src/crypto/external/bsd/netpgp/dist/src/libverify

2012-10-20 Thread Alistair G. Crooks
Module Name:src
Committed By:   agc
Date:   Sat Oct 20 10:16:31 UTC 2012

Modified Files:
src/crypto/external/bsd/netpgp/dist/src/libverify 
[agc-netpgp-standalone]:
libverify.c

Log Message:
add preliminary support for DSA signatures to libnetpgpverify(3) and
netpgpverify(1)


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.2 -r1.1.2.3 \
src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c

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

Modified files:

Index: src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c
diff -u src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.2 src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.3
--- src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c:1.1.2.2	Sat Oct 20 05:55:42 2012
+++ src/crypto/external/bsd/netpgp/dist/src/libverify/libverify.c	Sat Oct 20 10:16:31 2012
@@ -122,8 +122,8 @@
 
 /* signature mpi indices in bignumber array */
 #define RSA_SIG0
-#define DSA_SIG_R			0
-#define DSA_SIG_S			1
+#define DSA_R0
+#define DSA_S1
 #define ELGAMAL_SIG_R			0
 #define ELGAMAL_SIG_S			1
 
@@ -392,6 +392,8 @@ fmt_mpi(char *s, size_t size, pgpv_bignu
 			 ((alg) == PUBKEY_RSA_ENCRYPT) ||		\
 			 ((alg) == PUBKEY_RSA_SIGN))
 
+#define ALG_IS_DSA(alg)	((alg) == PUBKEY_DSA)
+
 /* format key mpis into memory */
 static unsigned
 fmt_key_mpis(pgpv_pubkey_t *pubkey, uint8_t *buf, size_t size)
@@ -678,8 +680,8 @@ read_signature_mpis(pgpv_sigpkt_t *sigpk
 	case PUBKEY_DSA:
 	case PUBKEY_ECDSA:
 	case PUBKEY_ELGAMAL_ENCRYPT_OR_SIGN: /* deprecated */
-		if (!get_mpi(&sigpkt->sig.bn[DSA_SIG_R], p, pktlen, &off) ||
-		!get_mpi(&sigpkt->sig.bn[DSA_SIG_S], &p[off], pktlen, &off)) {
+		if (!get_mpi(&sigpkt->sig.bn[DSA_R], p, pktlen, &off) ||
+		!get_mpi(&sigpkt->sig.bn[DSA_S], &p[off], pktlen, &off)) {
 			printf("sigpkt->version %d, dsa/elgamal sig weird\n", sigpkt->sig.version);
 			return 0;
 		}
@@ -1449,6 +1451,74 @@ rsa_verify(uint8_t *calculated, unsigned
 	return memcmp(&decrypted[i + prefixlen], calculated, calclen) == 0;
 }
 
+#ifndef DSA_MAX_MODULUS_BITS
+#define DSA_MAX_MODULUS_BITS  1
+#endif
+
+/* verify DSA signature */
+static int
+verify_dsa_verify(uint8_t *calculated, unsigned calclen, pgpv_bignum_t *sig, pgpv_pubkey_t *pubkey)
+{
+	unsigned	  qbits;
+	BIGNUM		 *M;
+	BIGNUM		 *W;
+	BIGNUM		 *t1;
+	int		  ret;
+
+	if (sig[DSA_P].bn == NULL || sig[DSA_Q].bn == NULL || sig[DSA_G].bn == NULL) {
+		return 0;
+	}
+	M = W = t1 = NULL;
+	qbits = pubkey->bn[DSA_Q].bits;
+	switch(qbits) {
+	case 160:
+	case 224:
+	case 256:
+		break;
+	default:
+		printf("dsa: bad # of Q bits\n");
+		return 0;
+	}
+	if (pubkey->bn[DSA_Q].bits > DSA_MAX_MODULUS_BITS) {
+		printf("dsa: p too large\n");
+		return 0;
+	}
+	/* no love for SHA512? */
+	if (calclen > SHA256_DIGEST_LENGTH) {
+		printf("dsa: digest too long\n");
+		return 0;
+	}
+	ret = 0;
+	if ((M = BN_new()) == NULL || (W = BN_new()) == NULL || (t1 = BN_new()) == NULL ||
+	BN_is_zero(sig[DSA_R].bn) || BN_is_negative(sig[DSA_R].bn) || BN_cmp(sig[DSA_R].bn, pubkey->bn[DSA_Q].bn) >= 0 ||
+	BN_is_zero(sig[DSA_S].bn) || BN_is_negative(sig[DSA_S].bn) || BN_cmp(sig[DSA_S].bn, pubkey->bn[DSA_Q].bn) >= 0 ||
+	BN_mod_inverse(W, sig[DSA_S].bn, pubkey->bn[DSA_Q].bn, NULL) != MP_OKAY) {
+		goto err;
+	}
+	if (calclen > qbits / 8) {
+		calclen = qbits / 8;
+	}
+	if (BN_bin2bn(calculated, (int)calclen, M) == NULL ||
+	!BN_mod_mul(M, M, W, pubkey->bn[DSA_Q].bn, NULL) ||
+	!BN_mod_mul(W, sig[DSA_R].bn, W, pubkey->bn[DSA_Q].bn, NULL) ||
+	!BN_mod_exp(pubkey->bn[DSA_P].bn, t1, pubkey->bn[DSA_G].bn, M, NULL) ||
+	!BN_div(NULL, M, t1, pubkey->bn[DSA_Q].bn, NULL)) {
+		goto err;
+	}
+	ret = (BN_cmp(M, sig[DSA_R].bn) == 0);
+err:
+	if (M) {
+		BN_free(M);
+	}
+	if (W) {
+		BN_free(W);
+	}
+	if (t1) {
+		BN_free(t1);
+	}
+	return ret;
+}
+
 #define TIME_SNPRINTF(_cc, _buf, _size, _fmt, _val)	do {		\
 	time_t	 _t;			\
 	char	*_s;			\
@@ -2017,18 +2087,24 @@ pgpv_verify(pgpv_cursor_t *cursor, pgpv_
 			snprintf(cursor->why, sizeof(cursor->why), "Signature on data did not match");
 			return 0;
 		}
-		if (valid_dates(signature, pubkey, cursor->why, sizeof(cursor->why)) > 0) {
-			return 0;
-		}
-		if (key_expired(pubkey, cursor->why, sizeof(cursor->why))) {
+	} else if (ALG_IS_DSA(signature->keyalg)) {
+		if (!verify_dsa_verify(calculated, calclen, signature->bn, pubkey)) {
+			snprintf(cursor->why, sizeof(cursor->why), "Signature on data did not match");
 			return 0;
 		}
-		ARRAY_APPEND(cursor->datacookies, pkt);
-		ARRAY_APPEND(cursor->found, primary);
-		return 1;
+	} else {
+		snprintf(cursor->why, sizeof(cursor->why), "Signature type %u not recognised", signature->keyalg);
+		return 0;
 	}
-	snprintf(cursor->why, sizeof(cursor->why), "Signature not RSA");
-	return 0;
+	if (valid_dates(signature, pubkey, cursor->why, sizeof(cursor