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

2021-08-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Aug  6 05:22:21 UTC 2021

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

Log Message:
Add comments how mm_md_physacc() for hp300 works.

mm_md_physacc() for all other hp300 pmap based m68k ports that copied
hp300 implemantation should have been fixed properly.

XXX: no mm(9) man pages that describe MD implementation API definitions.


To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.234 src/sys/arch/hp300/hp300/machdep.c:1.235
--- src/sys/arch/hp300/hp300/machdep.c:1.234	Thu Jun 11 19:20:43 2020
+++ src/sys/arch/hp300/hp300/machdep.c	Fri Aug  6 05:22:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.234 2020/06/11 19:20:43 ad Exp $	*/
+/*	$NetBSD: machdep.c,v 1.235 2021/08/06 05:22:21 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.234 2020/06/11 19:20:43 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.235 2021/08/06 05:22:21 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -1164,6 +1164,10 @@ int
 mm_md_physacc(paddr_t pa, vm_prot_t prot)
 {
 
+	/*
+	 * On the hp300, physical RAM is always located at the end of
+	 * the physical address space, i.e. from 0x to lowram.
+	 */
 	return (pa < lowram || pa >= 0xfffc) ? EFAULT : 0;
 }
 



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

2021-07-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jul 11 13:00:53 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rd.c rdreg.h

Log Message:
Add Device and drive info of 2202A, 7908A, 7911A, and 7941A.

Geometries and description info are taken from hpdrive.ini.sample
in HPDrive.  Briefly tested on HPDisk.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/dev/rdreg.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/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.108 src/sys/arch/hp300/dev/rd.c:1.109
--- src/sys/arch/hp300/dev/rd.c:1.108	Fri Jul  9 17:05:33 2021
+++ src/sys/arch/hp300/dev/rd.c	Sun Jul 11 13:00:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.108 2021/07/09 17:05:33 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.109 2021/07/11 13:00:52 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.108 2021/07/09 17:05:33 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.109 2021/07/11 13:00:52 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -355,6 +355,42 @@ static const struct rdidentinfo rdidenti
 		.ri_ntpc = NRD2203ATRK,
 		.ri_ncyl = 1449,
 		.ri_nblocks = 1309896
+	},
+
+	[RD2202A] = {
+		.ri_hwid = RD2202AID,
+		.ri_desc = "2202A",
+		.ri_nbpt = NRD2202ABPT,
+		.ri_ntpc = NRD2202ATRK,
+		.ri_ncyl = 1449,
+		.ri_nblocks = 1309896
+	},
+
+	[RD7908A] = {
+		.ri_hwid = RD7908AID,
+		.ri_desc = "7908A",
+		.ri_nbpt = NRD7908ABPT,
+		.ri_ntpc = NRD7908ATRK,
+		.ri_ncyl = 185,
+		.ri_nblocks = 32375
+	},
+
+	[RD7911A] = {
+		.ri_hwid = RD7911AID,
+		.ri_desc = "7911A",
+		.ri_nbpt = NRD7911ABPT,
+		.ri_ntpc = NRD7911ATRK,
+		.ri_ncyl = 572,
+		.ri_nblocks = 54912
+	},
+
+	[RD7941A] = {
+		.ri_hwid = RD7946AID,
+		.ri_desc = "7941A",
+		.ri_nbpt = NRD7941ABPT,
+		.ri_ntpc = NRD7941ATRK,
+		.ri_ncyl = 968,
+		.ri_nblocks = 46464
 	}
 };
 static const int numrdidentinfo = __arraycount(rdidentinfo);
@@ -380,7 +416,11 @@ static const struct rdname2id rdname2id[
 	{ RD7958BNAME,	RD7958B },
 	{ RD7959BNAME,	RD7959B },
 	{ RD2200ANAME,	RD2200A },
-	{ RD2203ANAME,	RD2203A }
+	{ RD2203ANAME,	RD2203A },
+	{ RD2202ANAME,	RD2202A },
+	{ RD7908ANAME,	RD7908A },
+	{ RD7911ANAME,	RD7911A },
+	{ RD7941ANAME,	RD7941A }
 };
 static const int numrdname2id = __arraycount(rdname2id);
 
@@ -618,7 +658,7 @@ rdident(device_t parent, struct rd_softc
 
 	/*
 	 * Take care of a couple of anomolies:
-	 * 1. 7945A and 7946A both return same HW id
+	 * 1. 7945A, 7946A, and 7941A all return same HW id
 	 * 2. 9122S and 9134D both return same HW id
 	 * 3. 9122D and 9134L both return same HW id
 	 */
@@ -626,6 +666,8 @@ rdident(device_t parent, struct rd_softc
 	case RD7946AID:
 		if (memcmp(name, RD7945ANAME, RDNAMELEN) == 0)
 			id = RD7945A;
+		else if (memcmp(name, RD7941ANAME, RDNAMELEN) == 0)
+			id = RD7941A;
 		else
 			id = RD7946A;
 		break;

Index: src/sys/arch/hp300/dev/rdreg.h
diff -u src/sys/arch/hp300/dev/rdreg.h:1.16 src/sys/arch/hp300/dev/rdreg.h:1.17
--- src/sys/arch/hp300/dev/rdreg.h:1.16	Fri Jul  9 17:05:33 2021
+++ src/sys/arch/hp300/dev/rdreg.h	Sun Jul 11 13:00:52 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rdreg.h,v 1.16 2021/07/09 17:05:33 tsutsui Exp $	*/
+/*	$NetBSD: rdreg.h,v 1.17 2021/07/11 13:00:52 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -104,7 +104,7 @@ struct	rd_clearcmd {
 } __attribute__((__packed__));
 
 /* HW ids */
-#define	RD7946AID	0x220	/* also 7945A */
+#define	RD7946AID	0x220	/* also 7945A and 7941A */
 #define	RD9134DID	0x221	/* also 9122S */
 #define	RD9134LID	0x222	/* also 9122D */
 #define	RD7912PID	0x209
@@ -120,6 +120,9 @@ struct	rd_clearcmd {
 #define	RD7959BID	0x22E	/* another guess based on 7958B */
 #define	RD2200AID	0x22F
 #define	RD2203AID	0x230	/* yet another guess */
+#define	RD2202AID	0x231	/* from hpdrive.ini.sample */
+#define	RD7908AID	0x200	/* from hpdrive.ini.sample */
+#define	RD7911AID	0x204	/* from hpdrive.ini.sample */
 
 /* Drive names -- per identify description structure */
 #define	RD7945ANAME	"079450"
@@ -140,6 +143,10 @@ struct	rd_clearcmd {
 #define	RD7959BNAME	"079591"
 #define	RD2200ANAME	"022000"
 #define	RD2203ANAME	"022030"
+#define	RD2202ANAME	"022020"
+#define	RD7908ANAME	"079080"
+#define	RD7911ANAME	"079110"
+#define	RD7941ANAME	"079410"
 
 #define	RDNAMELEN	6
 
@@ -163,6 +170,10 @@ struct	rd_clearcmd {
 #define	RD7959B		16
 #define	RD2200A		17
 #define	RD2203A		18
+#define	RD2202A		19
+#define	RD7908A		20
+#define	RD7911A		21
+#define	RD7941A		22
 
 #define	NRD7945ABPT	16
 #define	NRD7945ATRK	7
@@ -178,6 +189,10 @@ struct	rd_clearcmd {
 #define	NRD7933HTRK	13
 #define	NRD9134LBPT	16
 #define	NRD9134LTRK	5
+#define	NRD7911ABPT	32
+#define	NRD7911ATRK	3
+#define	NRD7941ABPT	16
+#define	NRD7941ATRK	3
 
 /*
  * Several HP 

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

2021-07-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jul  9 17:44:28 UTC 2021

Modified Files:
src/sys/arch/hp300/stand: Makefile.buildboot

Log Message:
Specify -fno-unwind-tables to shrink binaries.

Before:
   textdata bss dec hex filename
  779024328  137120  219350   358d6 uboot
After:
   textdata bss dec hex filename
  641864328  137120  205634   32342 uboot


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/hp300/stand/Makefile.buildboot

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

Modified files:

Index: src/sys/arch/hp300/stand/Makefile.buildboot
diff -u src/sys/arch/hp300/stand/Makefile.buildboot:1.36 src/sys/arch/hp300/stand/Makefile.buildboot:1.37
--- src/sys/arch/hp300/stand/Makefile.buildboot:1.36	Sat Apr  8 19:53:20 2017
+++ src/sys/arch/hp300/stand/Makefile.buildboot	Fri Jul  9 17:44:28 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.36 2017/04/08 19:53:20 christos Exp $
+#	$NetBSD: Makefile.buildboot,v 1.37 2021/07/09 17:44:28 tsutsui Exp $
 
 # RELOC=FFF0 allows for boot prog up to FF000 (1044480) bytes long
 RELOC=	FFF0
@@ -20,7 +20,7 @@ CLEANFILES+=	${PROGAOUT}
 CPPFLAGS+=	-I${.CURDIR}/../../.. -I${.CURDIR}/../../../..  -I${.OBJDIR}
 CPPFLAGS+=	-Wno-main
 CPPFLAGS+=	-D__daddr_t=int32_t
-CFLAGS=		-Os -msoft-float -ffreestanding
+CFLAGS=		-Os -fno-unwind-tables -msoft-float -ffreestanding
 
 # XXX SHOULD NOT NEED TO DEFINE THESE!
 LIBCRT0=



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

2021-07-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jul  9 17:05:33 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: hpibvar.h rd.c rdreg.h rdvar.h

Log Message:
Add support of multiple rd(4) disks on all punits for HPDisk.

Special thanks to Anders Gustafsson, the author of "HPDisk"
(GPIB disk emulator) http://www.dalton.ax/hpdisk/
for providing bare boards and improving firmwares for NetBSD/hp300.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp300/dev/hpibvar.h
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp300/dev/rdreg.h
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/hp300/dev/rdvar.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/hp300/dev/hpibvar.h
diff -u src/sys/arch/hp300/dev/hpibvar.h:1.23 src/sys/arch/hp300/dev/hpibvar.h:1.24
--- src/sys/arch/hp300/dev/hpibvar.h:1.23	Mon Jul  5 14:51:23 2021
+++ src/sys/arch/hp300/dev/hpibvar.h	Fri Jul  9 17:05:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpibvar.h,v 1.23 2021/07/05 14:51:23 tsutsui Exp $	*/
+/*	$NetBSD: hpibvar.h,v 1.24 2021/07/09 17:05:33 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -167,7 +167,7 @@ struct hpibbus_attach_args {
 #define	hpibbuscf_punit		cf_loc[HPIBBUSCF_PUNIT]
 
 #define	HPIB_NSLAVES		8	/* number of slaves on a bus */
-#define	HPIB_NPUNITS		2	/* number of punits per slave */
+#define	HPIB_NPUNITS		15	/* number of punits per slave */
 
 /*
  * An HP-IB job queue entry.  Slave drivers have one of these used

Index: src/sys/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.107 src/sys/arch/hp300/dev/rd.c:1.108
--- src/sys/arch/hp300/dev/rd.c:1.107	Mon Jul  5 14:51:23 2021
+++ src/sys/arch/hp300/dev/rd.c	Fri Jul  9 17:05:33 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.107 2021/07/05 14:51:23 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.108 2021/07/09 17:05:33 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.107 2021/07/05 14:51:23 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.108 2021/07/09 17:05:33 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -186,65 +186,204 @@ int	rddebug = RDB_ERROR | RDB_IDENT;
  * Nothing really critical here, could do without it.
  */
 static const struct rdidentinfo rdidentinfo[] = {
-	{ RD7946AID,	0,	"7945A",	NRD7945ABPT,
-	  NRD7945ATRK,	968,	 108416 },
-
-	{ RD9134DID,	1,	"9134D",	NRD9134DBPT,
-	  NRD9134DTRK,	303,	  29088 },
-
-	{ RD9134LID,	1,	"9122S",	NRD9122SBPT,
-	  NRD9122STRK,	77,	   1232 },
-
-	{ RD7912PID,	0,	"7912P",	NRD7912PBPT,
-	  NRD7912PTRK,	572,	 128128 },
-
-	{ RD7914PID,	0,	"7914P",	NRD7914PBPT,
-	  NRD7914PTRK,	1152,	 258048 },
-
-	{ RD7958AID,	0,	"7958A",	NRD7958ABPT,
-	  NRD7958ATRK,	1013,	 255276 },
-
-	{ RD7957AID,	0,	"7957A",	NRD7957ABPT,
-	  NRD7957ATRK,	1036,	 159544 },
-
-	{ RD7933HID,	0,	"7933H",	NRD7933HBPT,
-	  NRD7933HTRK,	1321,	 789958 },
-
-	{ RD9134LID,	1,	"9134L",	NRD9134LBPT,
-	  NRD9134LTRK,	973,	  77840 },
-
-	{ RD7936HID,	0,	"7936H",	NRD7936HBPT,
-	  NRD7936HTRK,	698,	 600978 },
-
-	{ RD7937HID,	0,	"7937H",	NRD7937HBPT,
-	  NRD7937HTRK,	698,	1116102 },
-
-	{ RD7914CTID,	0,	"7914CT",	NRD7914PBPT,
-	  NRD7914PTRK,	1152,	 258048 },
-
-	{ RD7946AID,	0,	"7946A",	NRD7945ABPT,
-	  NRD7945ATRK,	968,	 108416 },
-
-	{ RD9134LID,	1,	"9122D",	NRD9122SBPT,
-	  NRD9122STRK,	77,	   1232 },
-
-	{ RD7957BID,	0,	"7957B",	NRD7957BBPT,
-	  NRD7957BTRK,	1269,	 159894 },
-
-	{ RD7958BID,	0,	"7958B",	NRD7958BBPT,
-	  NRD7958BTRK,	786,	 297108 },
-
-	{ RD7959BID,	0,	"7959B",	NRD7959BBPT,
-	  NRD7959BTRK,	1572,	 594216 },
-
-	{ RD2200AID,	0,	"2200A",	NRD2200ABPT,
-	  NRD2200ATRK,	1449,	 654948 },
-
-	{ RD2203AID,	0,	"2203A",	NRD2203ABPT,
-	  NRD2203ATRK,	1449,	1309896 }
+	[RD7945A] = {
+		.ri_hwid = RD7946AID,
+		.ri_desc = "7945A",
+		.ri_nbpt = NRD7945ABPT,
+		.ri_ntpc = NRD7945ATRK,
+		.ri_ncyl = 968,
+		.ri_nblocks = 108416
+	},
+
+	[RD9134D] = {
+		.ri_hwid = RD9134DID,
+		.ri_desc = "9134D",
+		.ri_nbpt = NRD9134DBPT,
+		.ri_ntpc = NRD9134DTRK,
+		.ri_ncyl = 303,
+		.ri_nblocks = 29088
+	},
+
+	[RD9122S] = {
+		.ri_hwid = RD9134LID,
+		.ri_desc = "9122S",
+		.ri_nbpt = NRD9122SBPT,
+		.ri_ntpc = NRD9122STRK,
+		.ri_ncyl = 77,
+		.ri_nblocks = 1232
+	},
+
+	[RD7912P] = {
+		.ri_hwid = RD7912PID,
+		.ri_desc = "7912P",
+		.ri_nbpt = NRD7912PBPT,
+		.ri_ntpc = NRD7912PTRK,
+		.ri_ncyl = 572,
+		.ri_nblocks = 128128
+	},
+
+	[RD7914P] = {
+		.ri_hwid = RD7914PID,
+		.ri_desc = "7914P",
+		.ri_nbpt = NRD7914PBPT,
+		.ri_ntpc = NRD7914PTRK,
+		.ri_ncyl = 1152,
+		.ri_nblocks = 258048
+	},
+
+	[RD7958A] = {
+		.ri_hwid = RD7958AID,
+		.ri_desc = "7958A",
+		.ri_nbpt = NRD7958ABPT,
+		.ri_ntpc = NRD7958ATRK,
+		.ri_ncyl = 1013,
+		.ri_nblocks = 255276
+	},
+
+	[RD7957A] = {
+		.ri_hwid = RD7957AID,
+		.ri_desc = "7957A",
+		.ri_nbpt = 

CVS commit: src/sys/arch/hp300

2021-07-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jul  5 14:51:23 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: ct.c ctreg.h hpibvar.h rd.c rdreg.h rdvar.h
src/sys/arch/hp300/stand/common: ct.c hpibvar.h rd.c

Log Message:
Cleanup duplicated CS/80 indentify structures.  From OpenBSD.

https://marc.info/?l=openbsd-cvs=113227249626888=2
> Define the CS/80 identify structure only once and correctly, instead of
> duplicating it in every CS/80 driver and using an hardcoded number for
> its size.
> No functional change.

https://marc.info/?l=openbsd-cvs=113273001020159=2
> Pick HP-IB describe structures changes from main kernel code here as well.


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/hp300/dev/ct.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/dev/ctreg.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/hp300/dev/hpibvar.h
cvs rdiff -u -r1.106 -r1.107 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/dev/rdreg.h
cvs rdiff -u -r1.24 -r1.25 src/sys/arch/hp300/dev/rdvar.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/stand/common/ct.c
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp300/stand/common/hpibvar.h
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/rd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/ct.c
diff -u src/sys/arch/hp300/dev/ct.c:1.62 src/sys/arch/hp300/dev/ct.c:1.63
--- src/sys/arch/hp300/dev/ct.c:1.62	Mon Jul  5 14:03:46 2021
+++ src/sys/arch/hp300/dev/ct.c	Mon Jul  5 14:51:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ct.c,v 1.62 2021/07/05 14:03:46 tsutsui Exp $	*/
+/*	$NetBSD: ct.c,v 1.63 2021/07/05 14:51:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.62 2021/07/05 14:03:46 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.63 2021/07/05 14:51:23 tsutsui Exp $");
 
 #include 
 #include 
@@ -257,7 +257,7 @@ ctattach(device_t parent, device_t self,
 static int
 ctident(device_t parent, struct ct_softc *sc, struct hpibbus_attach_args *ha)
 {
-	struct ct_describe desc;
+	struct cs80_describe desc;
 	u_char stat, cmd[3];
 	char name[7];
 	int i, id, n, type, canstream;
@@ -284,9 +284,10 @@ ctident(device_t parent, struct ct_softc
 	cmd[1] = C_SVOL(0);
 	cmd[2] = C_DESC;
 	hpibsend(device_unit(parent), ha->ha_slave, C_CMD, cmd, sizeof(cmd));
-	hpibrecv(device_unit(parent), ha->ha_slave, C_EXEC, , 37);
+	hpibrecv(device_unit(parent), ha->ha_slave, C_EXEC, ,
+	sizeof(desc));
 	hpibrecv(device_unit(parent), ha->ha_slave, C_QSTAT, ,
-		 sizeof(stat));
+	sizeof(stat));
 
 	memset(name, 0, sizeof(name));
 	if (stat == 0) {

Index: src/sys/arch/hp300/dev/ctreg.h
diff -u src/sys/arch/hp300/dev/ctreg.h:1.10 src/sys/arch/hp300/dev/ctreg.h:1.11
--- src/sys/arch/hp300/dev/ctreg.h:1.10	Sun Dec 11 12:17:13 2005
+++ src/sys/arch/hp300/dev/ctreg.h	Mon Jul  5 14:51:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ctreg.h,v 1.10 2005/12/11 12:17:13 christos Exp $	*/
+/*	$NetBSD: ctreg.h,v 1.11 2021/07/05 14:51:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -98,30 +98,6 @@ struct	ct_clearcmd {
 	char	cmd;
 };
 
-struct ct_describe {
-	u_int	d_iuw:16,	/* controller: installed unit word */
-		d_cmaxxfr:16,	/* controller: max transfer rate (Kb) */
-		d_ctype:8,	/* controller: controller type */
-		d_utype:8,	/* unit: unit type */
-		d_name:24,	/* unit: name (6 BCD digits) */
-		d_sectsize:16,	/* unit: # of bytes per block (sector) */
-		d_blkbuf:8,	/* unit: # of blocks which can be buffered */
-		d_burstsize:8,	/* unit: recommended burst size */
-		d_blocktime:16,	/* unit: block time (u-sec) */
-		d_uavexfr:16,	/* unit: average transfer rate (Kb) */
-		d_retry:16,	/* unit: optimal retry time (1/100-sec) */
-		d_access:16,	/* unit: access time param (1/100-sec) */
-		d_maxint:8,	/* unit: maximum interleave */
-		d_fvbyte:8,	/* unit: fixed volume byte */
-		d_rvbyte:8,	/* unit: removable volume byte */
-		d_maxcyl:24,	/* volume: maximum cylinder */
-		d_maxhead:8,	/* volume: maximum head */
-		d_maxsect:16,	/* volume: maximum sector on track */
-		d_maxvsecth:16,	/* volume: maximum sector on volume (MSW) */
-		d_maxvsectl:32,	/* volume: maximum sector on volume (LSWs) */
-		d_interleave:8;	/* volume: current interleave */
- };
-
 #define	CT7946ID	0x220
 #define CT9145ID	0x268
 #define	CT9144ID	0x260

Index: src/sys/arch/hp300/dev/hpibvar.h
diff -u src/sys/arch/hp300/dev/hpibvar.h:1.22 src/sys/arch/hp300/dev/hpibvar.h:1.23
--- src/sys/arch/hp300/dev/hpibvar.h:1.22	Mon Jul  5 14:03:46 2021
+++ src/sys/arch/hp300/dev/hpibvar.h	Mon Jul  5 14:51:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpibvar.h,v 1.22 2021/07/05 14:03:46 tsutsui Exp $	*/
+/*	$NetBSD: hpibvar.h,v 1.23 2021/07/05 14:51:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -60,8 +60,6 @@
  *	@(#)hpibvar.h	8.1 

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

2021-07-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jul  5 14:15:16 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
Move attach messages from common rdident() to explicit rdattach().


To generate a diff of this commit:
cvs rdiff -u -r1.105 -r1.106 src/sys/arch/hp300/dev/rd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.105 src/sys/arch/hp300/dev/rd.c:1.106
--- src/sys/arch/hp300/dev/rd.c:1.105	Mon Jul  5 14:03:46 2021
+++ src/sys/arch/hp300/dev/rd.c	Mon Jul  5 14:15:16 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.105 2021/07/05 14:03:46 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.106 2021/07/05 14:15:16 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.105 2021/07/05 14:03:46 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.106 2021/07/05 14:15:16 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -320,6 +320,8 @@ rdattach(device_t parent, device_t self,
 {
 	struct rd_softc *sc = device_private(self);
 	struct hpibbus_attach_args *ha = aux;
+	int id;
+	char pbuf[9];
 
 	sc->sc_dev = self;
 	bufq_alloc(>sc_tab, "disksort", BUFQ_SORT_RAWBLOCK);
@@ -330,6 +332,21 @@ rdattach(device_t parent, device_t self,
 	}
 
 	/*
+	 * XXX We use DEV_BSIZE instead of the sector size value pulled
+	 * XXX off the driver because all of this code assumes 512 byte
+	 * XXX blocks.  ICK!
+	 */
+	id = sc->sc_type;
+	aprint_normal(": %s\n", rdidentinfo[id].ri_desc);
+	format_bytes(pbuf, sizeof(pbuf),
+	rdidentinfo[id].ri_nblocks * DEV_BSIZE);
+	aprint_normal_dev(sc->sc_dev, "%s, %d cyl, %d head, %d sec,"
+	" %d bytes/block x %u blocks\n",
+	pbuf, rdidentinfo[id].ri_ncyl, rdidentinfo[id].ri_ntpc,
+	rdidentinfo[id].ri_nbpt,
+	DEV_BSIZE, rdidentinfo[id].ri_nblocks);
+
+	/*
 	 * Initialize and attach the disk structure.
 	 */
 	memset(>sc_dkdev, 0, sizeof(sc->sc_dkdev));
@@ -366,7 +383,7 @@ rdident(device_t parent, struct rd_softc
 {
 	struct rd_describe *desc = sc != NULL ? >sc_rddesc : NULL;
 	u_char stat, cmd[3];
-	char name[7], pbuf[9];
+	char name[7];
 	int i, id, n, ctlr, slave;
 
 	ctlr = device_unit(parent);
@@ -464,20 +481,6 @@ rdident(device_t parent, struct rd_softc
 
 	sc->sc_type = id;
 
-	/*
-	 * XXX We use DEV_BSIZE instead of the sector size value pulled
-	 * XXX off the driver because all of this code assumes 512 byte
-	 * XXX blocks.  ICK!
-	 */
-	aprint_normal(": %s\n", rdidentinfo[id].ri_desc);
-	format_bytes(pbuf, sizeof(pbuf),
-	rdidentinfo[id].ri_nblocks * DEV_BSIZE);
-	aprint_normal_dev(sc->sc_dev, "%s, %d cyl, %d head, %d sec,"
-	" %d bytes/block x %u blocks\n",
-	pbuf, rdidentinfo[id].ri_ncyl, rdidentinfo[id].ri_ntpc,
-	rdidentinfo[id].ri_nbpt,
-	DEV_BSIZE, rdidentinfo[id].ri_nblocks);
-
 	return 1;
 }
 



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

2021-07-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jul  5 14:03:46 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: ct.c hpib.c hpibvar.h mt.c rd.c

Log Message:
Pull HP-IB probe fixes from OpenBSD/hp300.

https://marc.info/?l=openbsd-cvs=113217630426615=2
> Overhaul the way HP-IB devices are probed. We will now do an exhaustive
> probe of the (slave, punit) tuple space, since this is the only way we
> can get a dual disk or dual tape enclosure to attach two devices of the
> same kind.

This allows using multiple rd(4) disk images on the same slave emulated
by HPDisk (and probably the real 9122D with dual floppy disk drives).

Thanks to Miod Vallat for suggesting this fix.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 src/sys/arch/hp300/dev/ct.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/hp300/dev/hpib.c
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp300/dev/hpibvar.h
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/hp300/dev/mt.c
cvs rdiff -u -r1.104 -r1.105 src/sys/arch/hp300/dev/rd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/ct.c
diff -u src/sys/arch/hp300/dev/ct.c:1.61 src/sys/arch/hp300/dev/ct.c:1.62
--- src/sys/arch/hp300/dev/ct.c:1.61	Fri Jul 25 08:10:33 2014
+++ src/sys/arch/hp300/dev/ct.c	Mon Jul  5 14:03:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ct.c,v 1.61 2014/07/25 08:10:33 dholland Exp $	*/
+/*	$NetBSD: ct.c,v 1.62 2021/07/05 14:03:46 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.61 2014/07/25 08:10:33 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ct.c,v 1.62 2021/07/05 14:03:46 tsutsui Exp $");
 
 #include 
 #include 
@@ -270,13 +270,12 @@ ctident(device_t parent, struct ct_softc
 
 	/* Is it one of the tapes we support? */
 	for (id = 0; id < nctinfo; id++)
-		if (ha->ha_id == ctinfo[id].hwid)
+		if (ha->ha_id == ctinfo[id].hwid &&
+		ha->ha_punit == ctinfo[id].punit)
 			break;
 	if (id == nctinfo)
 		return 0;
 
-	ha->ha_punit = ctinfo[id].punit;
-
 	/*
 	 * So far, so good.  Get drive parameters.  Note command
 	 * is always issued to unit 0.

Index: src/sys/arch/hp300/dev/hpib.c
diff -u src/sys/arch/hp300/dev/hpib.c:1.42 src/sys/arch/hp300/dev/hpib.c:1.43
--- src/sys/arch/hp300/dev/hpib.c:1.42	Sat Apr 24 23:36:37 2021
+++ src/sys/arch/hp300/dev/hpib.c	Mon Jul  5 14:03:46 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpib.c,v 1.42 2021/04/24 23:36:37 thorpej Exp $	*/
+/*	$NetBSD: hpib.c,v 1.43 2021/07/05 14:03:46 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.42 2021/04/24 23:36:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.43 2021/07/05 14:03:46 tsutsui Exp $");
 
 #include 
 #include 
@@ -89,14 +89,9 @@ CFATTACH_DECL_NEW(hpibbus, sizeof(struct
 hpibbusmatch, hpibbusattach, NULL, NULL);
 
 static void	hpibbus_attach_children(struct hpibbus_softc *);
-static int	hpibbussearch(device_t, cfdata_t, const int *, void *);
+static int	hpibbussubmatch(device_t, cfdata_t, const int *ldesc, void *);
 static int	hpibbusprint(void *, const char *);
 
-static int	hpibbus_alloc(struct hpibbus_softc *, int, int);
-#if 0
-static void	hpibbus_free(struct hpibbus_softc *, int, int);
-#endif
-
 static void	hpibstart(void *);
 static void	hpibdone(void *);
 
@@ -121,17 +116,9 @@ int	hpibdmathresh = 3;	/* byte count bey
  * have ID tags, and often the host cannot even tell if such
  * a device is attached to the system!
  *
- * These two nasty bits mean that we have to treat HP-IB as
- * an indirect bus.  However, since we are given some ID
- * information, it is unreasonable to disallow cloning of
- * CS/80 devices.
- *
- * To deal with all of this, we use the semi-twisted scheme
- * in hpibbus_attach_children().  For each HP-IB slave, we loop
- * through all of the possibly-configured children, allowing
- * them to modify the punit parameter (but NOT the slave!).
- *
- * This is evil, but what can you do?
+ * * We nevertheless probe the whole (slave, punit) tuple space, since
+ * drivers for devices with a unique ID know exactly where to attach; 
+ * and we disallow ``star'' locators for other drivers.
  */
 
 static int
@@ -177,64 +164,51 @@ static void
 hpibbus_attach_children(struct hpibbus_softc *sc)
 {
 	struct hpibbus_attach_args ha;
-	int slave;
+	int id, slave, punit;
+	int i;
 
-	for (slave = 0; slave < 8; slave++) {
+	for (slave = 0; slave < HPIB_NSLAVES; slave++) {
 		/*
 		 * Get the ID tag for the device, if any.
 		 * Plotters won't identify themselves, and
 		 * get the same value as non-existent devices.
+		 * However, aging HP-IB drives are slow to respond; try up
+		 * to three times to get a valid ID.
 		 */
-		ha.ha_id = hpibid(device_unit(sc->sc_dev), slave);
-
-		ha.ha_slave = slave;	/* not to be modified by children */
-		

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

2021-07-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Mon Jul  5 13:41:08 UTC 2021

Modified Files:
src/sys/arch/hp300/stand/common: autoconf.c ite.c ite_tc.c
Removed Files:
src/sys/arch/hp300/stand/common: grfreg.h

Log Message:
Get rid of obsolete grfreg.h.  From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/autoconf.c
cvs rdiff -u -r1.3 -r0 src/sys/arch/hp300/stand/common/grfreg.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/ite_tc.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/autoconf.c
diff -u src/sys/arch/hp300/stand/common/autoconf.c:1.13 src/sys/arch/hp300/stand/common/autoconf.c:1.14
--- src/sys/arch/hp300/stand/common/autoconf.c:1.13	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/autoconf.c	Mon Jul  5 13:41:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.13 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.14 2021/07/05 13:41:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -49,7 +49,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 /*

Index: src/sys/arch/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.18 src/sys/arch/hp300/stand/common/ite.c:1.19
--- src/sys/arch/hp300/stand/common/ite.c:1.18	Fri Feb 26 18:11:11 2016
+++ src/sys/arch/hp300/stand/common/ite.c	Mon Jul  5 13:41:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.18 2016/02/26 18:11:11 christos Exp $	*/
+/*	$NetBSD: ite.c,v 1.19 2021/07/05 13:41:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,7 +47,7 @@
 #include 
 #include 
 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -129,19 +129,19 @@ iteconfig(void)
 	int dtype, fboff, slotno, i;
 	uint8_t *va;
 	struct hp_hw *hw;
-	struct grfreg *gr;
+	struct diofbreg *fb;
 	struct ite_data *ip;
 
 	i = 0;
 	for (hw = sc_table; hw < _table[MAXCTLRS]; hw++) {
 	if (!HW_ISDEV(hw, D_BITMAP))
 			continue;
-		gr = (struct grfreg *) hw->hw_kva;
+		fb = (struct diofbreg *)hw->hw_kva;
 		/* XXX: redundent but safe */
-		if (badaddr((void *)gr) || gr->gr_id != GRFHWID)
+		if (badaddr((void *)fb) || fb->id != GRFHWID)
 			continue;
 		for (dtype = 0; dtype < nitesw; dtype++)
-			if (itesw[dtype].ite_hwid == gr->gr_id2)
+			if (itesw[dtype].ite_hwid == fb->fbid)
 break;
 		if (dtype == nitesw)
 			continue;
@@ -150,16 +150,16 @@ iteconfig(void)
 		ite_scode[i] = hw->hw_sc;
 		ip = _data[i];
 		ip->isw = [dtype];
-		ip->regbase = (void *) gr;
-		fboff = (gr->gr_fbomsb << 8) | gr->gr_fbolsb;
+		ip->regbase = (void *)fb;
+		fboff = (fb->fbomsb << 8) | fb->fbolsb;
 		ip->fbbase = (void *)(*((u_char *)ip->regbase + fboff) << 16);
 		/* DIO II: FB offset is relative to select code space */
 		if (ip->regbase >= (void *)DIOIIBASE)
 			ip->fbbase = (char*)ip->fbbase + (int)ip->regbase;
-		ip->fbwidth  = gr->gr_fbwidth_h << 8 | gr->gr_fbwidth_l;
-		ip->fbheight = gr->gr_fbheight_h << 8 | gr->gr_fbheight_l;
-		ip->dwidth   = gr->gr_dwidth_h << 8 | gr->gr_dwidth_l;
-		ip->dheight  = gr->gr_dheight_h << 8 | gr->gr_dheight_l;
+		ip->fbwidth  = fb->fbwmsb << 8 | fb->fbwlsb;
+		ip->fbheight = fb->fbhmsb << 8 | fb->fbhlsb;
+		ip->dwidth   = fb->dwmsb  << 8 | fb->dwlsb;
+		ip->dheight  = fb->dhmsb  << 8 | fb->dhlsb;
 		/*
 		 * XXX some displays (e.g. the davinci) appear
 		 * to return a display height greater than the

Index: src/sys/arch/hp300/stand/common/ite_tc.c
diff -u src/sys/arch/hp300/stand/common/ite_tc.c:1.10 src/sys/arch/hp300/stand/common/ite_tc.c:1.11
--- src/sys/arch/hp300/stand/common/ite_tc.c:1.10	Thu Feb 10 12:46:22 2011
+++ src/sys/arch/hp300/stand/common/ite_tc.c	Mon Jul  5 13:41:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_tc.c,v 1.10 2011/02/10 12:46:22 tsutsui Exp $	*/
+/*	$NetBSD: ite_tc.c,v 1.11 2021/07/05 13:41:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -42,8 +42,8 @@
 
 #include 
 
+#include 
 #include 
-#include 
 #include 
 
 #include 



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

2021-06-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Jun 30 14:54:03 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
No need to bother to use aprint_debug(9) inside #ifdef DEBUG block.


To generate a diff of this commit:
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/hp300/dev/rd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.103 src/sys/arch/hp300/dev/rd.c:1.104
--- src/sys/arch/hp300/dev/rd.c:1.103	Sun Jan 10 00:58:56 2021
+++ src/sys/arch/hp300/dev/rd.c	Wed Jun 30 14:54:03 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.103 2021/01/10 00:58:56 tsutsui Exp $	*/
+/*	$NetBSD: rd.c,v 1.104 2021/06/30 14:54:03 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.103 2021/01/10 00:58:56 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.104 2021/06/30 14:54:03 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -429,20 +429,20 @@ rdident(device_t parent, struct rd_softc
 
 #ifdef DEBUG
 	if (rddebug & RDB_IDENT) {
-		aprint_debug("\n");
-		aprint_debug_dev(sc->sc_dev, "name: %x ('%s')\n",
-		desc->d_name, name);
-		aprint_debug("  iuw %x, maxxfr %d, ctype %d\n",
+		aprint_normal("\n");
+		aprint_normal_dev(sc->sc_dev, "id: 0x%04x, name: %x ('%s')\n",
+		ha->ha_id, desc->d_name, name);
+		aprint_normal("  iuw %x, maxxfr %d, ctype %d\n",
 		desc->d_iuw, desc->d_cmaxxfr, desc->d_ctype);
-		aprint_debug("  utype %d, bps %d, blkbuf %d, burst %d,"
+		aprint_normal("  utype %d, bps %d, blkbuf %d, burst %d,"
 		" blktime %d\n",
 		desc->d_utype, desc->d_sectsize,
 		desc->d_blkbuf, desc->d_burstsize, desc->d_blocktime);
-		aprint_debug("  avxfr %d, ort %d, atp %d, maxint %d, fv %x"
+		aprint_normal("  avxfr %d, ort %d, atp %d, maxint %d, fv %x"
 		", rv %x\n",
 		desc->d_uavexfr, desc->d_retry, desc->d_access,
 		desc->d_maxint, desc->d_fvbyte, desc->d_rvbyte);
-		aprint_debug("  maxcyl/head/sect %d/%d/%d, maxvsect %d,"
+		aprint_normal("  maxcyl/head/sect %d/%d/%d, maxvsect %d,"
 		" inter %d\n",
 		desc->d_maxcyl, desc->d_maxhead, desc->d_maxsect,
 		desc->d_maxvsectl, desc->d_interleave);



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

2021-06-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun  4 17:12:08 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rdvar.h

Log Message:
Consistently use #define as rdreg.h.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp300/dev/rdvar.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/hp300/dev/rdvar.h
diff -u src/sys/arch/hp300/dev/rdvar.h:1.23 src/sys/arch/hp300/dev/rdvar.h:1.24
--- src/sys/arch/hp300/dev/rdvar.h:1.23	Tue Apr 14 20:32:35 2015
+++ src/sys/arch/hp300/dev/rdvar.h	Fri Jun  4 17:12:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rdvar.h,v 1.23 2015/04/14 20:32:35 riastradh Exp $	*/
+/*	$NetBSD: rdvar.h,v 1.24 2021/06/04 17:12:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -87,16 +87,16 @@ struct	rd_softc {
 /* sc_flags values */
 #define	RDF_ALIVE	0x01
 #define	RDF_SEEK	0x02
-#define RDF_SWAIT	0x04
-#define RDF_OPENING	0x08
-#define RDF_CLOSING	0x10
-#define RDF_WANTED	0x20
-#define RDF_WLABEL	0x40
+#define	RDF_SWAIT	0x04
+#define	RDF_OPENING	0x08
+#define	RDF_CLOSING	0x10
+#define	RDF_WANTED	0x20
+#define	RDF_WLABEL	0x40
 
 #define	rdunit(x)	((int)(minor(x) >> 3))
-#define rdpart(x)	((int)(minor(x) & 0x7))
+#define	rdpart(x)	((int)(minor(x) & 0x7))
 #define	rdpunit(x)	((x) & 7)
-#define rdlabdev(d)	(dev_t)(((int)(d)&~7)|2)	/* rd?c */
+#define	rdlabdev(d)	(dev_t)(((int)(d)&~7)|2)	/* rd?c */
 
 #define	RDRETRY		5
-#define RDWAITC		1	/* min time for timeout in seconds */
+#define	RDWAITC		1	/* min time for timeout in seconds */



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

2021-05-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 29 22:52:35 UTC 2021

Modified Files:
src/sys/arch/hp300/conf: INSTALL

Log Message:
Reduce diffs from GENERIC for maintainability.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/hp300/conf/INSTALL

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

Modified files:

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.68 src/sys/arch/hp300/conf/INSTALL:1.69
--- src/sys/arch/hp300/conf/INSTALL:1.68	Sat May 29 21:08:44 2021
+++ src/sys/arch/hp300/conf/INSTALL	Sat May 29 22:52:35 2021
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.68 2021/05/29 21:08:44 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.69 2021/05/29 22:52:35 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -9,17 +9,18 @@ include 	"arch/hp300/conf/std.hp300"
 
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-# optimise for smaller kernels
-makeoptions 	COPTS="-Os -fno-unwind-tables"
+# Optimize for space.
+makeoptions	COPTS="-Os -fno-unwind-tables"
+
+maxusers	8		# estimated number of users
+
+# Special options for smaller kernels
 #options 	NVNODE=50
 #options 	NBUF=16
 #options 	BUFPAGES=16
 options 	BUFCACHE=5
 options 	NFS_V2_ONLY
 options 	NFS_DEFAULT_NIOTHREADS=1
-options 	USERCONF		# userconf(4) support
-options 	PIPE_SOCKETPAIR		# smaller, but slower pipe(2)
-#options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 
 # Support for various CPU types
 options 	HP320
@@ -38,42 +39,77 @@ options 	HP400
 options 	HP425
 options 	HP433
 options 	FPSP		# floating point interface for 68040
-
-# Need to set locally
-maxusers	8
+#options 	FPU_EMULATE	# software fpu emulation for MC68030
 
 # Standard system options
+#options 	KTRACE		# system call tracing support
+#options 	INSECURE	# disable kernel security level
+options 	USERCONF	# userconf(4) support
+options 	PIPE_SOCKETPAIR	# smaller, but slower pipe(2)
+#options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
+#options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
+#options 	NTP		# NTP phase/frequency locked loop
+#options 	SYSVMSG		# System V-style message queues
+#options 	SYSVSEM		# System V-style semaphores
+#options 	SYSVSHM		# System V-style shared memory
+
+#options 	MODULAR		# new style module(7) framework
+#options 	MODULAR_DEFAULT_AUTOLOAD
+
+# Alternate buffer queue strategies for better responsiveness under high
+# disk I/O load.
+#options 	BUFQ_READPRIO
+#options 	BUFQ_PRIOCSCAN
+
+# Debugging options
+#options 	DIAGNOSTIC	# Extra kernel sanity checks
+#options 	DEBUG		# Enable misc. kernel debugging code
+#options 	DDB		# Kernel Dynamic Debugger
+#options 	DDB_HISTORY_SIZE=512	# Enable history editing in DDB
+#options 	KGDB		# remote debugger
+#makeoptions	DEBUG="-g"	# netbsd.gdb with full debugging symbols
+
+# Compatibility options
 #include 	"conf/compat_netbsd09.config"
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
-#options 	SYSVSHM		# System V-style shared memory
-#options 	SYSVSEM		# System V-style semaphores
-#options 	SEMMNI=10	# number of semaphore identifiers
-#options 	SEMMNS=60	# number of semaphores in system
-#options 	SEMUME=10	# max number of undo entries per process
-#options 	SEMMNU=30	# number of undo structures in system
-#options 	SYSVMSG		# System V-style message queues
-#options 	KTRACE		# system call tracing support
-#options 	SCSIVERBOSE	# Verbose SCSI errors
+
+# Binary compatibility.
+#options 	COMPAT_AOUT_M68K	# NetBSD/m68k a.out binary compatibility
+#options 	COMPAT_M68K4K	# NetBSD/m68k4k binary compatibility
+#options 	COMPAT_SUNOS	# SunOS4 m68k binary compatibility
+#options 	COMPAT_LINUX	# Linux/m68k binary compatibility
+#options 	COMPAT_OSSAUDIO	# Linux/m68k binary compatibility
 
 # Filesystems
-file-system	FFS		# fast filesystem
 file-system	CD9660		# CD-ROM ISO-9660 filesystem
-file-system	NFS		# Network filesystem client
-#file-system	UNION		# Union filesystem (req. for FDESC)
-#file-system	KERNFS		# kernel data-structure filesystem
+#file-system	EXT2FS		# second extended file system (linux)
 #file-system	FDESC		# user file descriptor filesystem
-#file-system	PROCFS		# /proc filesystem
+file-system	FFS		# fast filesystem
+#file-system	KERNFS		# kernel data-structure filesystem
+#file-system	LFS		# log-structured file system
 file-system	MFS		# Memory-based filesystem
+file-system	NFS		# Network filesystem client
+#file-system	NULLFS		# loopback file system
+#file-system	OVERLAY		# overlay file system
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g & sshfs)
+#file-system	PROCFS		# /proc filesystem
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+#file-system	UNION		# Union filesystem (req. for FDESC)
+#file-system	CODA		# Coda File System; also needs vcoda (below)
 #file-system	PTYFS		# /dev/pts/N support
+#file-system	TMPFS		# Efficient 

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

2021-05-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 29 22:50:18 UTC 2021

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

Log Message:
Reorder entries and reorganize comments for maintainability.

No functional change intended.


To generate a diff of this commit:
cvs rdiff -u -r1.207 -r1.208 src/sys/arch/hp300/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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.207 src/sys/arch/hp300/conf/GENERIC:1.208
--- src/sys/arch/hp300/conf/GENERIC:1.207	Thu Jan 21 06:51:54 2021
+++ src/sys/arch/hp300/conf/GENERIC	Sat May 29 22:50:18 2021
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.207 2021/01/21 06:51:54 nia Exp $
+# $NetBSD: GENERIC,v 1.208 2021/05/29 22:50:18 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	"arch/hp300/conf/std.hp300"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.207 $"
+#ident 		"GENERIC-$Revision: 1.208 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks -fno-omit-frame-pointer"
 	# See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for
@@ -57,9 +57,9 @@ options 	USERCONF	# userconf(4) support
 options 	SYSCTL_INCLUDE_DESCR	# Include sysctl descriptions in kernel
 #options 	RTC_OFFSET=0	# hardware clock is this many mins. west of GMT
 options 	NTP		# NTP phase/frequency locked loop
-options 	SYSVSHM		# System V-style shared memory
 options 	SYSVMSG		# System V-style message queues
 options 	SYSVSEM		# System V-style semaphores
+options 	SYSVSHM		# System V-style shared memory
 
 options 	MODULAR		# new style module(7) framework
 options 	MODULAR_DEFAULT_AUTOLOAD
@@ -159,7 +159,8 @@ options 	USELEDS		# make the lights twin
 options 	DIOVERBOSE	# recognize "unknown" DIO devices
 
 # workstation console options
-options 	WSEMUL_VT100# VT100 / VT220 emulation
+options 	WSEMUL_VT100			# VT100 / VT220 emulation
+#options 	WSDISPLAY_DEFAULTSCREENS=1
 options 	WSDISPLAY_COMPAT_USL		# wsconscfg VT handling
 options 	WSDISPLAY_COMPAT_RAWKBD
 options 	WS_KERNEL_FG=WSCOL_GREEN
@@ -180,6 +181,12 @@ intio0		at mainbus0		# internal i/o spac
 dio0		at mainbus0		# DIO/DIO-II bus
 sgc0		at mainbus0		# SGC bus
 
+# Real-time clock (not optional)
+rtc*		at intio?
+
+# DMA controller
+dma* 		at intio?
+
 # Human Interface Loop devices
 hil0		at intio?		# HIL controller
 hilkbd* 	at hil?			# keyboards
@@ -188,10 +195,8 @@ hilms*		at hil?			# mice, buttons and ta
 wsmouse*	at hilms? mux 0
 hilid*		at hil?			# ID module
 
-rtc*		at intio?		# real-time clock (not optional)
-dma* 		at intio?		# DMA controller
-frodo*		at intio?		# Frodo utility chip found on 382, 4xx
-nhpib*		at intio?		# slow internal HP-IB
+# Frodo utility chip found on 382, 4xx's
+frodo*		at intio?
 
 # 8250-like serial ports found on Frodo ASIC
 dnkbd0		at frodo? offset 0x0	# Domain keyboard flavor
@@ -202,32 +207,40 @@ com*		at frodo? offset ?	# tty flavor
 # mc146818-like real time clock found on 425e
 mcclock0	at frodo? offset 0x80
 
-dvbox*		at intio?		# Davinci framebuffer
+# Davinci framebuffer
+dvbox*		at intio?
 dvbox*		at dio? scode ?
 wsdisplay*	at dvbox?
 
-gbox*		at intio?		# Gatorbox framebuffer
+# Gatorbox framebuffer
+gbox*		at intio?
 gbox*		at dio? scode ?
 wsdisplay*	at gbox?
 
-hyper*		at dio? scode ?		# Hyperion framebuffer
+# Hyperion framebuffer
+hyper*		at dio? scode ?
 wsdisplay*	at hyper?
 
-rbox*		at intio?		# Renaissance framebuffer
+# Renaissance framebuffer
+rbox*		at intio?
 rbox*		at dio? scode ?
 wsdisplay*	at rbox?
 
-topcat*		at intio?		# Topcat/catseye framebuffers
+# Topcat/catseye framebuffers
+topcat*		at intio?
 topcat*		at dio? scode ?
 wsdisplay*	at topcat?
 
-tvrx*		at dio? scode ?		# TurboVRX framebuffer
+# TurboVRX framebuffer
+tvrx*		at dio? scode ?
 wsdisplay*	at tvrx?
 
-gendiofb*	at dio? scode ?		# dumb framebuffer support for 362/382
+# dumb framebuffer support for 362/382
+gendiofb*	at dio? scode ?
 wsdisplay*	at gendiofb?
 
-sti*		at sgc?	slot ?		# SGC EVRX framebuffers
+# STI framebuffers
+sti*		at sgc?	slot ?
 wsdisplay*	at sti?
 
 com0		at dio0 scode 9		# DCA serial interfaces
@@ -237,10 +250,12 @@ dcm*		at dio? scode ?	flags 0xe # DCM 4-
 
 le*		at dio? scode ?		# LANCE ethernet interfaces
 
-nhpib0		at dio? scode 7		# slow internal HP-IB
+# HP-IB devices
+nhpib*		at intio?		# internal HP-IB
+nhpib0		at dio? scode 7		# 98624A HP-IB
 nhpib*		at dio? scode ?
 
-fhpib*		at dio? scode ?		# `fast' HP-IB
+fhpib*		at dio? scode ?		# 98625A/98625B HP-IB
 
 hpibbus0	at nhpib0
 hpibbus*	at nhpib?
@@ -251,6 +266,7 @@ ct*		at hpibbus? slave ? punit ?	# HP-IB
 mt*		at hpibbus? slave ? punit ?	# HP-IB 9-track tape
 ppi0		at hpibbus0 slave 5 punit 0	# HP-IB plotter
 
+# SCSI devices
 spc*		at dio? scode ?			# HP 98265A SCSI
 scsibus*	at spc?
 
@@ -296,10 +312,10 @@ pseudo-device	agr			# IEEE 802.3ad link 
 

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

2021-05-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 29 21:08:44 UTC 2021

Modified Files:
src/sys/arch/hp300/conf: INSTALL

Log Message:
Reduce maxusers to 8 as GENERIC.

Should be pulled up to netbsd-9 and netbsd-8.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/hp300/conf/INSTALL

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

Modified files:

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.67 src/sys/arch/hp300/conf/INSTALL:1.68
--- src/sys/arch/hp300/conf/INSTALL:1.67	Sat May 29 21:06:20 2021
+++ src/sys/arch/hp300/conf/INSTALL	Sat May 29 21:08:44 2021
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.67 2021/05/29 21:06:20 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.68 2021/05/29 21:08:44 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -40,7 +40,7 @@ options 	HP433
 options 	FPSP		# floating point interface for 68040
 
 # Need to set locally
-maxusers	32
+maxusers	8
 
 # Standard system options
 #include 	"conf/compat_netbsd09.config"



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

2021-05-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 29 21:06:20 UTC 2021

Modified Files:
src/sys/arch/hp300/conf: INSTALL

Log Message:
Add missed 'nhpib at intio' for internal HP-IB.  Found on testing HPDisk.

Also fix comments for HP-IB devices.
Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/hp300/conf/INSTALL

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

Modified files:

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.66 src/sys/arch/hp300/conf/INSTALL:1.67
--- src/sys/arch/hp300/conf/INSTALL:1.66	Sat Dec 12 05:48:55 2020
+++ src/sys/arch/hp300/conf/INSTALL	Sat May 29 21:06:20 2021
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.66 2020/12/12 05:48:55 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.67 2021/05/29 21:06:20 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -183,10 +183,11 @@ dcm*		at dio? scode ?	flags 0xe # DCM 4-
 
 le*		at dio? scode ?		# LANCE ethernet interfaces
 
-nhpib0		at dio? scode 7		# slow internal HP-IB
+nhpib*		at intio?		# internal HP-IB
+nhpib0		at dio? scode 7		# 98624A HP-IB
 nhpib*		at dio? scode ?
 
-fhpib*		at dio? scode ?		# `fast' HP-IB
+fhpib*		at dio? scode ?		# 98625A/98625B HP-IB
 
 hpibbus0	at nhpib0
 hpibbus*	at nhpib?



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

2021-05-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 18 15:21:41 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rdreg.h

Log Message:
Consistently use #define here.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/dev/rdreg.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/hp300/dev/rdreg.h
diff -u src/sys/arch/hp300/dev/rdreg.h:1.13 src/sys/arch/hp300/dev/rdreg.h:1.14
--- src/sys/arch/hp300/dev/rdreg.h:1.13	Tue Feb  8 20:20:13 2011
+++ src/sys/arch/hp300/dev/rdreg.h	Tue May 18 15:21:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rdreg.h,v 1.13 2011/02/08 20:20:13 rmind Exp $	*/
+/*	$NetBSD: rdreg.h,v 1.14 2021/05/18 15:21:41 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -78,9 +78,9 @@ struct	rd_stat {
 		} cu_tva;
 	} c_pf;
 } __attribute__((__packed__));
-#define c_raw	c_pf.cu_raw
-#define c_blk	c_pf.cu_sva.cu_lsl	/* for now */
-#define c_tva	c_pf.cu_tva
+#define	c_raw	c_pf.cu_raw
+#define	c_blk	c_pf.cu_sva.cu_lsl	/* for now */
+#define	c_tva	c_pf.cu_tva
 
 struct	rd_ssmcmd {
 	char	c_unit;
@@ -132,18 +132,18 @@ struct rd_describe {
 #define	RD9134DID	0x221	/* also 9122S */
 #define	RD9134LID	0x222	/* also 9122D */
 #define	RD7912PID	0x209
-#define RD7914CTID	0x20A
+#define	RD7914CTID	0x20A
 #define	RD7914PID	0x20B
 #define	RD7958AID	0x22B
-#define RD7957AID	0x22A
+#define	RD7957AID	0x22A
 #define	RD7933HID	0x212
 #define	RD7936HID	0x213	/* just guessing -- as of yet unknown */
 #define	RD7937HID	0x214
-#define RD7957BID	0x22C	/* another guess based on 7958B */
-#define RD7958BID	0x22D
-#define RD7959BID	0x22E	/* another guess based on 7958B */
-#define RD2200AID	0x22F
-#define RD2203AID	0x230	/* yet another guess */
+#define	RD7957BID	0x22C	/* another guess based on 7958B */
+#define	RD7958BID	0x22D
+#define	RD7959BID	0x22E	/* another guess based on 7958B */
+#define	RD2200AID	0x22F
+#define	RD2203AID	0x230	/* yet another guess */
 
 /* SW ids -- indicies into rdidentinfo, order is arbitrary */
 #define	RD7945A		0
@@ -152,17 +152,17 @@ struct rd_describe {
 #define	RD7912P		3
 #define	RD7914P		4
 #define	RD7958A		5
-#define RD7957A		6
+#define	RD7957A		6
 #define	RD7933H		7
 #define	RD9134L		8
 #define	RD7936H		9
 #define	RD7937H		10
-#define RD7914CT	11
-#define RD7946A		12
-#define RD9122D		13
-#define RD7957B		14
-#define RD7958B		15
-#define RD7959B		16
+#define	RD7914CT	11
+#define	RD7946A		12
+#define	RD9122D		13
+#define	RD7957B		14
+#define	RD7958B		15
+#define	RD7959B		16
 
 #define	NRD7945ABPT	16
 #define	NRD7945ATRK	7
@@ -226,31 +226,31 @@ struct rd_describe {
 #define	RDCTLR		15
 
 /* convert 512 byte count into DEV_BSIZE count */
-#define RDSZ(x)		((x) >> (DEV_BSHIFT-9))
+#define	RDSZ(x)		((x) >> (DEV_BSHIFT-9))
 
 /* convert block number into sector number and back */
 #define	RDBTOS(x)	((x) << (DEV_BSHIFT-8))
-#define RDSTOB(x)	((x) >> (DEV_BSHIFT-8))
+#define	RDSTOB(x)	((x) >> (DEV_BSHIFT-8))
 
 /* extract cyl/head/sect info from three-vector address */
-#define RDCYL(tva)	((u_long)(tva).cu_cyhd >> 8)
-#define RDHEAD(tva)	((tva).cu_cyhd & 0xFF)
-#define RDSECT(tva)	((tva).cu_sect)
+#define	RDCYL(tva)	((u_long)(tva).cu_cyhd >> 8)
+#define	RDHEAD(tva)	((tva).cu_cyhd & 0xFF)
+#define	RDSECT(tva)	((tva).cu_sect)
 
 #define	REF_MASK	0x0
 #define	FEF_MASK	0x0
 #define	AEF_MASK	0x0
 #define	IEF_MASK	0xF970
 
-#define FEF_CU		0x4000	/* cross-unit */
-#define FEF_DR		0x0080	/* diagnostic result */
-#define FEF_IMR		0x0008	/* internal maintenance release */
+#define	FEF_CU		0x4000	/* cross-unit */
+#define	FEF_DR		0x0080	/* diagnostic result */
+#define	FEF_IMR		0x0008	/* internal maintenance release */
 #define	FEF_PF		0x0002	/* power fail */
 #define	FEF_REXMT	0x0001	/* retransmit */
-#define AEF_UD		0x0040	/* unrecoverable data */
-#define IEF_RRMASK	0xe000	/* request release bits */
-#define IEF_MD		0x0020	/* marginal data */
-#define IEF_RD		0x0010	/* recoverable data */
+#define	AEF_UD		0x0040	/* unrecoverable data */
+#define	IEF_RRMASK	0xe000	/* request release bits */
+#define	IEF_MD		0x0020	/* marginal data */
+#define	IEF_RD		0x0010	/* recoverable data */
 
 #define	C_READ		0x00
 #define	C_RAM		0x00	/* single vector (i.e. sector number) */
@@ -260,13 +260,13 @@ struct rd_describe {
 #define	C_SADDR		0x10
 #define	C_SLEN		0x18
 #define	C_SUNIT(x)	(0x20 | (x))
-#define C_SVOL(x)	(0x40 | (x))
+#define	C_SVOL(x)	(0x40 | (x))
 #define	C_NOP		0x34
-#define C_DESC		0x35
+#define	C_DESC		0x35
 #define	C_SREL		0x3b
 #define	C_SSM		0x3e
 #define	C_SRAM		0x48
-#define C_REL		0xc0
+#define	C_REL		0xc0
 
 #define	C_CMD		0x05
 #define	C_EXEC		0x0e



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

2021-04-15 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Apr 15 14:43:19 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: diofb.c topcat.c

Log Message:
Fix two problems on old topcat(4) framebuffers found on HP332/340.

- Fix panic on monochrome framebuffers. They don't have palette registers.
  The problem was reported from Anders Gustafsson and also Andrew Gillham
  back in 2013:
   https://mail-index.netbsd.org/port-hp300/2013/09/27/msg86.html
   https://mail-index.netbsd.org/port-hp300/2013/09/28/msg87.html
- Fix incorrect framebuffer width of 98542/98544 framebuffers on HP332.
  Reported from Andrew Gillham (98542) as above and Chris Hanson (98543):
   https://mail-index.netbsd.org/port-hp300/2013/09/27/msg83.html
   https://mail-index.netbsd.org/port-hp300/2020/05/01/msg000164.html

Worth to pullup to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp300/dev/diofb.c \
src/sys/arch/hp300/dev/topcat.c

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

Modified files:

Index: src/sys/arch/hp300/dev/diofb.c
diff -u src/sys/arch/hp300/dev/diofb.c:1.4 src/sys/arch/hp300/dev/diofb.c:1.5
--- src/sys/arch/hp300/dev/diofb.c:1.4	Mon Mar 24 19:42:58 2014
+++ src/sys/arch/hp300/dev/diofb.c	Thu Apr 15 14:43:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofb.c,v 1.4 2014/03/24 19:42:58 christos Exp $	*/
+/*	$NetBSD: diofb.c,v 1.5 2021/04/15 14:43:19 tsutsui Exp $	*/
 /*	$OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $	*/
 
 /*
@@ -146,6 +146,15 @@ diofb_fbinquire(struct diofb *fb, int sc
 	if (fb->dheight > fb->fbheight)
 		fb->dheight = fb->fbheight;
 
+	/*
+	 * Some displays, such as the HP332 and HP340 internal video
+	 * appear to return a display width of 1024 instead of 512.
+	 */
+	if (fbr->num_planes == 1 || fbr->num_planes == 4) {
+		if (fb->dwidth == 1024 && fb->dheight == 400)
+			fb->dwidth = 512;
+	}
+
 	fb->planes = fbr->num_planes;
 	if (fb->planes > 8)
 		fb->planes = 8;
Index: src/sys/arch/hp300/dev/topcat.c
diff -u src/sys/arch/hp300/dev/topcat.c:1.4 src/sys/arch/hp300/dev/topcat.c:1.5
--- src/sys/arch/hp300/dev/topcat.c:1.4	Fri Feb 18 19:15:43 2011
+++ src/sys/arch/hp300/dev/topcat.c	Thu Apr 15 14:43:19 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: topcat.c,v 1.4 2011/02/18 19:15:43 tsutsui Exp $	*/
+/*	$NetBSD: topcat.c,v 1.5 2021/04/15 14:43:19 tsutsui Exp $	*/
 /*	$OpenBSD: topcat.c,v 1.15 2006/08/11 18:33:13 miod Exp $	*/
 
 /*
@@ -274,7 +274,10 @@ topcat_end_attach(struct topcat_softc *s
 	case GID_TOPCAT:
 		switch (sc->sc_fb->planes) {
 		case 1:
-			fbname = "HP98544 topcat";
+			if (sc->sc_fb->dheight == 400)
+fbname = "HP98542 topcat";
+			else
+fbname = "HP98544 topcat";
 			break;
 		case 4:
 			if (sc->sc_fb->dheight == 400)
@@ -413,8 +416,12 @@ topcat_ioctl(void *v, void *vs, u_long c
 		*(u_int *)data = fb->ri.ri_stride;
 		return 0;
 	case WSDISPLAYIO_GETCMAP:
+		if (fb->planemask == 1)
+			return EPASSTHROUGH;
 		return diofb_getcmap(fb, (struct wsdisplay_cmap *)data);
 	case WSDISPLAYIO_PUTCMAP:
+		if (fb->planemask == 1)
+			return EPASSTHROUGH;
 		return topcat_setcmap(fb, (struct wsdisplay_cmap *)data);
 	case WSDISPLAYIO_GVIDEO:
 	case WSDISPLAYIO_SVIDEO:
@@ -429,6 +436,10 @@ topcat_setcolor(struct diofb *fb, u_int 
 {
 	volatile struct tcboxfb *tc = (struct tcboxfb *)fb->regkva;
 
+	/* No color map registers on monochrome framebuffers. */
+	if (fb->planemask == 1)
+		return;
+
 	if (tc->regs.fbid != GID_TOPCAT) {
 		tccm_waitbusy(tc);
 		tc->plane_mask = 0xff;



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

2021-03-07 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Sun Mar  7 10:01:09 UTC 2021

Modified Files:
src/sys/arch/hp300/include: bus.h

Log Message:
Provide a bus_space_mmap that always fails.  Nothing uses it yet, but it
will be very soon.

OK tsutsui@


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hp300/include/bus.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/hp300/include/bus.h
diff -u src/sys/arch/hp300/include/bus.h:1.21 src/sys/arch/hp300/include/bus.h:1.22
--- src/sys/arch/hp300/include/bus.h:1.21	Sat Jan 23 19:38:07 2021
+++ src/sys/arch/hp300/include/bus.h	Sun Mar  7 10:01:08 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.21 2021/01/23 19:38:07 christos Exp $	*/
+/*	$NetBSD: bus.h,v 1.22 2021/03/07 10:01:08 skrll Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -167,6 +167,20 @@ int	bus_space_map(bus_space_tag_t, bus_a
 void	bus_space_unmap(bus_space_tag_t, bus_space_handle_t, bus_size_t);
 
 /*
+ *	paddr_t bus_space_mmap(bus_space_tag_t t,
+ *	bus_addr_t addr, off_t off, int prot, int flags);
+ *
+ * Provide a cookie for pmap_phys_address/pmap_mmap_flags for bus_space address at
+ * addr + offset and flags.
+ */
+static __inline paddr_t
+bus_space_mmap(bus_space_tag_t t, bus_addr_t addr, off_t off, int prot, int flags)
+{
+	/* Always fail for now */
+	return -1;
+}
+
+/*
  *	int bus_space_subregion(bus_space_tag_t t,
  *	bus_space_handle_t bsh, bus_size_t offset, bus_size_t size,
  *	bus_space_handle_t *nbshp);



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

2021-01-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 10 00:58:56 UTC 2021

Modified Files:
src/sys/arch/hp300/dev: rd.c

Log Message:
Print rd(4) capacity and geometry info as sd(4) and wd(4) do.

Before:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 698 cylinders, 13 heads, 1116102 blocks, 512 bytes/block

After:
rd0 at hpibbus1 slave 0 punit 0: 7937H
rd0: 544 MB, 698 cyl, 13 head, 123 sec, 512 bytes/block x 1116102 blocks


To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 src/sys/arch/hp300/dev/rd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.102 src/sys/arch/hp300/dev/rd.c:1.103
--- src/sys/arch/hp300/dev/rd.c:1.102	Tue Sep 29 02:49:56 2020
+++ src/sys/arch/hp300/dev/rd.c	Sun Jan 10 00:58:56 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.102 2020/09/29 02:49:56 msaitoh Exp $	*/
+/*	$NetBSD: rd.c,v 1.103 2021/01/10 00:58:56 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.102 2020/09/29 02:49:56 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rd.c,v 1.103 2021/01/10 00:58:56 tsutsui Exp $");
 
 #include "opt_useleds.h"
 
@@ -384,7 +384,7 @@ rdident(device_t parent, struct rd_softc
 {
 	struct rd_describe *desc = sc != NULL ? >sc_rddesc : NULL;
 	u_char stat, cmd[3];
-	char name[7];
+	char name[7], pbuf[9];
 	int i, id, n, ctlr, slave;
 
 	ctlr = device_unit(parent);
@@ -487,11 +487,13 @@ rdident(device_t parent, struct rd_softc
 	 * XXX blocks.  ICK!
 	 */
 	aprint_normal(": %s\n", rdidentinfo[id].ri_desc);
-	aprint_normal_dev(sc->sc_dev, "%d cylinders, %d heads, %d blocks,"
-	" %d bytes/block\n",
-	rdidentinfo[id].ri_ncyl,
-	rdidentinfo[id].ri_ntpc, rdidentinfo[id].ri_nblocks,
-	DEV_BSIZE);
+	format_bytes(pbuf, sizeof(pbuf),
+	rdidentinfo[id].ri_nblocks * DEV_BSIZE);
+	aprint_normal_dev(sc->sc_dev, "%s, %d cyl, %d head, %d sec,"
+	" %d bytes/block x %u blocks\n",
+	pbuf, rdidentinfo[id].ri_ncyl, rdidentinfo[id].ri_ntpc,
+	rdidentinfo[id].ri_nbpt,
+	DEV_BSIZE, rdidentinfo[id].ri_nblocks);
 
 	return 1;
 }



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

2020-12-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Dec 29 16:02:01 UTC 2020

Modified Files:
src/sys/arch/hp300/dev: dcm.c

Log Message:
Use C99 designated initializers for struct consdev.


To generate a diff of this commit:
cvs rdiff -u -r1.88 -r1.89 src/sys/arch/hp300/dev/dcm.c

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

Modified files:

Index: src/sys/arch/hp300/dev/dcm.c
diff -u src/sys/arch/hp300/dev/dcm.c:1.88 src/sys/arch/hp300/dev/dcm.c:1.89
--- src/sys/arch/hp300/dev/dcm.c:1.88	Sat Nov 15 19:20:01 2014
+++ src/sys/arch/hp300/dev/dcm.c	Tue Dec 29 16:02:01 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcm.c,v 1.88 2014/11/15 19:20:01 christos Exp $	*/
+/*	$NetBSD: dcm.c,v 1.89 2020/12/29 16:02:01 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.88 2014/11/15 19:20:01 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dcm.c,v 1.89 2020/12/29 16:02:01 tsutsui Exp $");
 
 #include "opt_kgdb.h"
 
@@ -306,16 +306,11 @@ static	int dcm_lastcnpri = CN_DEAD; 	/* 
 #endif
 
 static struct consdev dcm_cons = {
-	NULL,
-	NULL,
-	dcmcngetc,
-	dcmcnputc,
-	nullcnpollc,
-	NULL,
-	NULL,
-	NULL,
-	NODEV,
-	CN_REMOTE
+	.cn_getc = dcmcngetc,
+	.cn_putc = dcmcnputc,
+	.cn_pollc = nullcnpollc,
+	.cn_dev = NODEV,
+	.cn_pri = CN_REMOTE
 };
 int	dcmconscode;
 int	dcmdefaultrate = DEFAULT_BAUD_RATE;



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

2020-12-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 26 00:16:16 UTC 2020

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c hil_intio.c

Log Message:
Fix a longstanding bug in hilkbd (and dnkbd) console attachment.

cn_tab->cn_dev is initialized in wsdisplay_emul_attach()
(but not in wsdiaplay_cnattach()) so it cannot be used
when hil(4) is attached before wsdisplay(4) is attached.
Instead, use exported wsdisplay_cnputc() that is actually
set in early wsdisplay_cnattach().

Now we can use ddb and RB_ASKNAME via HIL keyboard console.
Should be pulleld up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/dev/dnkbd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp300/dev/hil_intio.c

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.10 src/sys/arch/hp300/dev/dnkbd.c:1.11
--- src/sys/arch/hp300/dev/dnkbd.c:1.10	Sat Apr  8 17:04:56 2017
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Dec 26 00:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.10 2017/04/08 17:04:56 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.11 2020/12/26 00:16:16 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -69,6 +69,9 @@
 
 #include "opt_wsdisplay_compat.h"
 
+#include "wsdisplay.h"
+#include "wsmouse.h"
+
 #include 
 #include 
 #include 
@@ -87,7 +90,9 @@
 #include 
 #include 
 #include 
-#include "wsmouse.h"
+#if NWSDISPLAY > 0
+#include 
+#endif
 #if NWSMOUSE > 0
 #include 
 #endif
@@ -354,7 +359,8 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 	 * plugged), unless the console keyboard has been claimed already
 	 * (i.e. late hotplug with hil keyboard plugged first).
 	 */
-	if (major(cn_tab->cn_dev) == devsw_name2chr("wsdisplay", NULL, 0)) {
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc == wsdisplay_cnputc) {
 #if NHILKBD > 0
 		if (hil_is_console == -1) {
 			ka.console = 1;
@@ -365,7 +371,10 @@ dnkbd_attach_subdevices(struct dnkbd_sof
 		ka.console = 1;
 #endif
 	} else
+#endif
+	{
 		ka.console = 0;
+	}
 
 	ka.keymap = _keymapdata;
 	ka.accessops = _accessops;

Index: src/sys/arch/hp300/dev/hil_intio.c
diff -u src/sys/arch/hp300/dev/hil_intio.c:1.3 src/sys/arch/hp300/dev/hil_intio.c:1.4
--- src/sys/arch/hp300/dev/hil_intio.c:1.3	Sat Feb 19 05:36:49 2011
+++ src/sys/arch/hp300/dev/hil_intio.c	Sat Dec 26 00:16:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil_intio.c,v 1.3 2011/02/19 05:36:49 tsutsui Exp $	*/
+/*	$NetBSD: hil_intio.c,v 1.4 2020/12/26 00:16:16 tsutsui Exp $	*/
 /*	$OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $	*/
 
 /*
@@ -28,6 +28,8 @@
  *
  */
 
+#include "wsdisplay.h"
+
 #include 
 #include 
 #include 
@@ -38,6 +40,9 @@
 #include 
 
 #include 
+#if NWSDISPLAY > 0
+#include 
+#endif
 
 #include 
 
@@ -88,8 +93,12 @@ hil_intio_attach(device_t parent, device
 	/*
 	 * Check that the configured console device is a wsdisplay.
 	 */
-	if (major(cn_tab->cn_dev) != devsw_name2chr("wsdisplay", NULL, 0))
+#if NWSDISPLAY > 0
+	if (cn_tab->cn_putc != wsdisplay_cnputc)
+#endif
+	{
 		hil_is_console = 0;
+	}
 
 	hil_attach(sc, _is_console);
 	intr_establish(hil_intr, sc, ia->ia_ipl, IPL_TTY);



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

2020-12-23 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Dec 23 08:36:47 UTC 2020

Modified Files:
src/sys/arch/hp300/dev: sti_sgc.c

Log Message:
Add bitmap access ops support for SGC CRX (A1659-66001) framebuffer.

Also modify existing 425e EVRX attachment to use updated MI sti(4) ops
more efficiently.

The Xorg server and mlterm-wscons (that support wsdisplay bitmap) work
fine on SGC hp425t.

No particular comments on port-hp300@ and port-hppa@:
 https://mail-index.netbsd.org/port-hp300/2020/12/19/msg000184.html
 https://mail-index.netbsd.org/port-hp300/2020/12/20/msg000185.html

Special thanks to Miod Vallat again, for contributing the SGC CRX
framebuffer with the SGC connector and flexible cable for HP9000/425t.

He also contributed DIO-II "Hyperion" monochrome framebuffer and
1 plane grayscale SGC GRX (A1924-66001), and I've confirmed hyper(4)
just works even with Xorg server.  I will try GRX as the next project.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/sti_sgc.c
diff -u src/sys/arch/hp300/dev/sti_sgc.c:1.3 src/sys/arch/hp300/dev/sti_sgc.c:1.4
--- src/sys/arch/hp300/dev/sti_sgc.c:1.3	Mon May  4 06:52:53 2020
+++ src/sys/arch/hp300/dev/sti_sgc.c	Wed Dec 23 08:36:47 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: sti_sgc.c,v 1.3 2020/05/04 06:52:53 tsutsui Exp $	*/
+/*	$NetBSD: sti_sgc.c,v 1.4 2020/12/23 08:36:47 tsutsui Exp $	*/
 /*	$OpenBSD: sti_sgc.c,v 1.14 2007/05/26 00:36:03 krw Exp $	*/
 
 /*
@@ -27,7 +27,7 @@
  *
  */
 #include 
-__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.3 2020/05/04 06:52:53 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sti_sgc.c,v 1.4 2020/12/23 08:36:47 tsutsui Exp $");
 
 #include 
 #include 
@@ -49,33 +49,40 @@ struct sti_sgc_softc {
 	struct sti_softc sc_sti;
 
 	paddr_t sc_bitmap;
-	bus_space_tag_t sc_bst;
-	bus_space_handle_t sc_ramdach;
 };
 
 /*
  * 425e EVRX specific hardware
  */
-#define STI_EVRX_RAMDACOFFSET	0x06
-#define STI_EVRX_RAMDACSIZE	0x000800
+/*
+ * EVRX RAMDAC (Bt458) is found at offset 0x06 from SGC bus PA and 
+ * offset 0x04 length 0x1c is mapped in MI sti via ROM region 2
+ */
+#define STI_EVRX_REGNO2OFFSET	0x02
 #define STI_EVRX_FBOFFSET	0x20
 
-#define EVRX_BT458_ADDR		(0x200 + 2)
-#define EVRX_BT458_CMAP		(0x204 + 2)
-#define EVRX_BT458_CTRL		(0x208 + 2)
-#define EVRX_BT458_OMAP		(0x20C + 2)
+#define EVRX_BT458_ADDR		(STI_EVRX_REGNO2OFFSET + 0x200 + 2)
+#define EVRX_BT458_CMAP		(STI_EVRX_REGNO2OFFSET + 0x204 + 2)
+#define EVRX_BT458_CTRL		(STI_EVRX_REGNO2OFFSET + 0x208 + 2)
+#define EVRX_BT458_OMAP		(STI_EVRX_REGNO2OFFSET + 0x20C + 2)
 
 /* from HP-UX /usr/lib/libddevrx.a */
-#define EVRX_MAGIC00		0x600
-#define EVRX_MAGIC04		0x604
-#define EVRX_MAGIC08		0x608
-#define EVRX_MAGIC0C		0x60c
-#define EVRX_MAGIC10		0x610
+#define EVRX_MAGIC00		(STI_EVRX_REGNO2OFFSET + 0x600)
+#define EVRX_MAGIC04		(STI_EVRX_REGNO2OFFSET + 0x604)
+#define EVRX_MAGIC08		(STI_EVRX_REGNO2OFFSET + 0x608)
+#define EVRX_MAGIC0C		(STI_EVRX_REGNO2OFFSET + 0x60c)
+#define EVRX_MAGIC10		(STI_EVRX_REGNO2OFFSET + 0x610)
 #define EVRX_MAGIC10_BSY	0x0001
-#define EVRX_MAGIC18		0x618
-#define EVRX_MAGIC1C		0x61c
+#define EVRX_MAGIC18		(STI_EVRX_REGNO2OFFSET + 0x618)
+#define EVRX_MAGIC1C		(STI_EVRX_REGNO2OFFSET + 0x61c)
+
+/*
+ * HP A1659A CRX specific hardware
+ */
+#define STI_CRX_FBOFFSET	0x0100
 
 static int sticonslot = -1;
+static struct bus_space_tag sticn_tag;
 static struct sti_rom sticn_rom;
 static struct sti_screen sticn_scr;
 static bus_addr_t sticn_bases[STI_REGION_MAX];
@@ -88,16 +95,16 @@ static int sti_sgc_probe(bus_space_tag_t
 CFATTACH_DECL_NEW(sti_sgc, sizeof(struct sti_sgc_softc),
 sti_sgc_match, sti_sgc_attach, NULL, NULL);
 
-/* 425e EVRX specific access functions */
-static int sti_evrx_setcmap(struct sti_sgc_softc *, struct wsdisplay_cmap *);
-static void sti_evrx_resetramdac(struct sti_sgc_softc *);
-static void sti_evrx_resetcmap(struct sti_sgc_softc *);
-static int sti_evrx_ioctl(void *, void *, u_long, void *, int, struct lwp *);
-static paddr_t sti_evrx_mmap(void *, void *, off_t, int);
-
-static const struct wsdisplay_accessops sti_evrx_accessops = {
-	sti_evrx_ioctl,
-	sti_evrx_mmap,
+/* 425e EVRX/CRX specific access functions */
+static int sti_evrx_putcmap(struct sti_screen *, u_int, u_int);
+static void sti_evrx_resetramdac(struct sti_screen *);
+static void sti_evrx_resetcmap(struct sti_screen *);
+static void sti_evrx_setupfb(struct sti_screen *);
+static paddr_t sti_m68k_mmap(void *, void *, off_t, int);
+
+static const struct wsdisplay_accessops sti_m68k_accessops = {
+	sti_ioctl,
+	sti_m68k_mmap,
 	sti_alloc_screen,
 	sti_free_screen,
 	sti_show_screen,
@@ -126,6 +133,7 @@ sti_sgc_attach(device_t parent, device_t
 	struct sti_softc *ssc = >sc_sti;
 	struct sgc_attach_args *saa = aux;
 	struct 

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

2020-12-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Dec 12 05:48:55 UTC 2020

Modified Files:
src/sys/arch/hp300/conf: INSTALL RAMDISK

Log Message:
Remove options (NVNODE, NBUF, and BUFPAGES) for small RAM machines.

These options make extracting binary sets much slower even on miniroot.
Instead, use "options BUFCACHE=5" (use 5% of memory for buffercache) and
also specify "-fno-unwind-tables" for COPTS to shrink INSTALL kernel.

Worth to pullup to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/hp300/conf/INSTALL
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp300/conf/RAMDISK

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

Modified files:

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.65 src/sys/arch/hp300/conf/INSTALL:1.66
--- src/sys/arch/hp300/conf/INSTALL:1.65	Sun Sep 27 13:48:51 2020
+++ src/sys/arch/hp300/conf/INSTALL	Sat Dec 12 05:48:55 2020
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.65 2020/09/27 13:48:51 roy Exp $
+# $NetBSD: INSTALL,v 1.66 2020/12/12 05:48:55 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -10,10 +10,11 @@ include 	"arch/hp300/conf/std.hp300"
 #options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
 # optimise for smaller kernels
-makeoptions 	COPTS="-Os"
-options 	NVNODE=50
-options 	NBUF=16
-options 	BUFPAGES=16
+makeoptions 	COPTS="-Os -fno-unwind-tables"
+#options 	NVNODE=50
+#options 	NBUF=16
+#options 	BUFPAGES=16
+options 	BUFCACHE=5
 options 	NFS_V2_ONLY
 options 	NFS_DEFAULT_NIOTHREADS=1
 options 	USERCONF		# userconf(4) support

Index: src/sys/arch/hp300/conf/RAMDISK
diff -u src/sys/arch/hp300/conf/RAMDISK:1.15 src/sys/arch/hp300/conf/RAMDISK:1.16
--- src/sys/arch/hp300/conf/RAMDISK:1.15	Tue Dec 29 14:51:38 2015
+++ src/sys/arch/hp300/conf/RAMDISK	Sat Dec 12 05:48:55 2020
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.15 2015/12/29 14:51:38 christos Exp $
+# $NetBSD: RAMDISK,v 1.16 2020/12/12 05:48:55 tsutsui Exp $
 #
 # RAMDISK machine description file
 #
@@ -7,11 +7,6 @@
 
 include 	"arch/hp300/conf/INSTALL"
 
-# These options for small RAM machines makes extracting binaries much slower.
-no options	NVNODE
-no options	NBUF
-no options	BUFPAGES
-
 # Enable the hooks used for initializing the root memory-disk.
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT		# force root on memory disk



CVS commit: src/sys/arch/hp300

2020-11-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Nov 18 02:22:17 UTC 2020

Modified Files:
src/sys/arch/hp300/dev: hpib.c ppi.c
src/sys/arch/hp300/hp300: autoconf.c intr.c

Log Message:
malloc(9) -> kmem(9)


To generate a diff of this commit:
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/hp300/dev/hpib.c
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/hp300/dev/ppi.c
cvs rdiff -u -r1.107 -r1.108 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hp300/hp300/intr.c

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

Modified files:

Index: src/sys/arch/hp300/dev/hpib.c
diff -u src/sys/arch/hp300/dev/hpib.c:1.40 src/sys/arch/hp300/dev/hpib.c:1.41
--- src/sys/arch/hp300/dev/hpib.c:1.40	Sun Nov 10 21:16:27 2019
+++ src/sys/arch/hp300/dev/hpib.c	Wed Nov 18 02:22:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpib.c,v 1.40 2019/11/10 21:16:27 chs Exp $	*/
+/*	$NetBSD: hpib.c,v 1.41 2020/11/18 02:22:16 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -65,12 +65,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.40 2019/11/10 21:16:27 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hpib.c,v 1.41 2020/11/18 02:22:16 thorpej Exp $");
 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 
 #include 
@@ -161,7 +161,7 @@ hpibbusattach(device_t parent, device_t 
 	/*
 	 * Initialize the DMA queue entry.
 	 */
-	sc->sc_dq = malloc(sizeof(struct dmaqueue), M_DEVBUF, M_WAITOK);
+	sc->sc_dq = kmem_alloc(sizeof(struct dmaqueue), KM_SLEEP);
 	sc->sc_dq->dq_softc = sc;
 	sc->sc_dq->dq_start = hpibstart;
 	sc->sc_dq->dq_done = hpibdone;

Index: src/sys/arch/hp300/dev/ppi.c
diff -u src/sys/arch/hp300/dev/ppi.c:1.47 src/sys/arch/hp300/dev/ppi.c:1.48
--- src/sys/arch/hp300/dev/ppi.c:1.47	Mon Sep  3 16:29:24 2018
+++ src/sys/arch/hp300/dev/ppi.c	Wed Nov 18 02:22:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppi.c,v 1.47 2018/09/03 16:29:24 riastradh Exp $	*/
+/*	$NetBSD: ppi.c,v 1.48 2020/11/18 02:22:16 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.47 2018/09/03 16:29:24 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.48 2020/11/18 02:22:16 thorpej Exp $");
 
 #include 
 #include 
@@ -74,7 +74,7 @@ __KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.47
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -299,7 +299,7 @@ ppirw(dev_t dev, struct uio *uio)
 	int s, s2, len, cnt;
 	char *cp;
 	int error = 0, gotdata = 0;
-	int buflen, ctlr, slave;
+	int ctlr, slave;
 	char *buf;
 
 	if (uio->uio_resid == 0)
@@ -314,8 +314,8 @@ ppirw(dev_t dev, struct uio *uio)
 		   dev, uio, uio->uio_rw == UIO_READ ? 'R' : 'W',
 		   sc->sc_burst, sc->sc_timo, uio->uio_resid);
 #endif
-	buflen = uimin(sc->sc_burst, uio->uio_resid);
-	buf = (char *)malloc(buflen, M_DEVBUF, M_WAITOK);
+	const int buflen = uimin(sc->sc_burst, uio->uio_resid);
+	buf = kmem_alloc(buflen, KM_SLEEP);
 	sc->sc_flags |= PPIF_UIO;
 	if (sc->sc_timo > 0) {
 		sc->sc_flags |= PPIF_TIMO;
@@ -442,7 +442,7 @@ again:
 			   len-cnt);
 #endif
 	}
-	free(buf, M_DEVBUF);
+	kmem_free(buf, buflen);
 #ifdef DEBUG
 	if (ppidebug & (PDB_FOLLOW|PDB_IO))
 		printf("ppirw: return %d, resid %d\n", error, uio->uio_resid);

Index: src/sys/arch/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.107 src/sys/arch/hp300/hp300/autoconf.c:1.108
--- src/sys/arch/hp300/hp300/autoconf.c:1.107	Sun Nov 10 21:16:27 2019
+++ src/sys/arch/hp300/hp300/autoconf.c	Wed Nov 18 02:22:16 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.107 2019/11/10 21:16:27 chs Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.108 2020/11/18 02:22:16 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.107 2019/11/10 21:16:27 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.108 2020/11/18 02:22:16 thorpej Exp $");
 
 #include "dvbox.h"
 #include "gbox.h"
@@ -108,7 +108,7 @@ __KERNEL_RCSID(0, "$NetBSD: autoconf.c,v
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -395,7 +395,7 @@ device_register(device_t dev, void *aux)
 	 * we can mount as root.
 	 */
 
-	dd = malloc(sizeof(struct dev_data), M_DEVBUF, M_WAITOK | M_ZERO);
+	dd = kmem_zalloc(sizeof(*dd), KM_SLEEP);
 	dd->dd_dev = dev;
 
 	/*
@@ -439,7 +439,7 @@ device_register(device_t dev, void *aux)
 	/*
 	 * Didn't need the dev_data.
 	 */
-	free(dd, M_DEVBUF);
+	kmem_free(dd, sizeof(*dd));
 	return;
 
  linkup:
@@ -677,7 +677,7 @@ setbootdev(void)
 	for (dd = LIST_FIRST(_data_list); dd != NULL; ) {
 		cdd = dd;
 		dd = LIST_NEXT(dd, dd_list);
-		free(cdd, M_DEVBUF);
+		kmem_free(cdd, sizeof(*cdd));
 	}
 }
 

Index: src/sys/arch/hp300/hp300/intr.c
diff -u src/sys/arch/hp300/hp300/intr.c:1.43 src/sys/arch/hp300/hp300/intr.c:1.44

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

2020-04-28 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 28 14:45:24 UTC 2020

Modified Files:
src/sys/arch/hp300/stand/common: netio.c
src/sys/arch/hp300/stand/inst: version
src/sys/arch/hp300/stand/uboot: version

Log Message:
Fix inappropriate error messages when nfs_mount() fails.

Noticed by Chris Hanson and his HP330 and confirmed on my HP425e.
Also bump revisions to denote visible changes.
Worth to pull up to netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/stand/common/netio.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/inst/version
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp300/stand/uboot/version

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

Modified files:

Index: src/sys/arch/hp300/stand/common/netio.c
diff -u src/sys/arch/hp300/stand/common/netio.c:1.16 src/sys/arch/hp300/stand/common/netio.c:1.17
--- src/sys/arch/hp300/stand/common/netio.c:1.16	Sat Jun 11 06:20:11 2016
+++ src/sys/arch/hp300/stand/common/netio.c	Tue Apr 28 14:45:23 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: netio.c,v 1.16 2016/06/11 06:20:11 dholland Exp $	*/
+/*	$NetBSD: netio.c,v 1.17 2020/04/28 14:45:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -158,7 +158,6 @@ netstrategy(void *devdata, int func, dad
 int
 netmountroot(struct open_file *f, char *devname)
 {
-	int error;
 	struct iodesc *d;
 
 #ifdef DEBUG
@@ -260,7 +259,8 @@ netmountroot(struct open_file *f, char *
 
  do_nfs_mount:
 	/* Get the NFS file handle (mount). */
-	error = nfs_mount(netdev_sock, rootip, rootpath);
+	if (nfs_mount(netdev_sock, rootip, rootpath))
+		return errno;
 
-	return error;
+	return 0;
 }

Index: src/sys/arch/hp300/stand/inst/version
diff -u src/sys/arch/hp300/stand/inst/version:1.13 src/sys/arch/hp300/stand/inst/version:1.14
--- src/sys/arch/hp300/stand/inst/version:1.13	Sun Jan 17 08:05:20 2016
+++ src/sys/arch/hp300/stand/inst/version	Tue Apr 28 14:45:24 2020
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.13 2016/01/17 08:05:20 tsutsui Exp $
+$NetBSD: version,v 1.14 2020/04/28 14:45:24 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for HP-IB cartridge tapes
@@ -13,3 +13,4 @@ $NetBSD: version,v 1.13 2016/01/17 08:05
 1.11:	Add support for framebuffers on HP362 and HP382.
 1.12:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.
 1.13:	Disable slow gunzip CRC32 calculation.
+1.14:	Fix wrong errno when nfs_mount() fails.

Index: src/sys/arch/hp300/stand/uboot/version
diff -u src/sys/arch/hp300/stand/uboot/version:1.20 src/sys/arch/hp300/stand/uboot/version:1.21
--- src/sys/arch/hp300/stand/uboot/version:1.20	Sun Jan 17 08:05:20 2016
+++ src/sys/arch/hp300/stand/uboot/version	Tue Apr 28 14:45:24 2020
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.20 2016/01/17 08:05:20 tsutsui Exp $
+$NetBSD: version,v 1.21 2020/04/28 14:45:24 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for network booting
@@ -20,3 +20,4 @@ $NetBSD: version,v 1.20 2016/01/17 08:05
 1.18:	Add support for framebuffers on HP362 and HP382.
 1.19:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.
 1.20:	Disable slow gunzip CRC32 calculation.
+1.21:	Fix wrong errno when nfs_mount() fails.



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

2020-04-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 21 09:02:33 UTC 2020

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

Log Message:
Fix garbages in dmesg caused by uninitialized variables slipped in r1.228.

Noticed in HP9000/362 dmesg:
 https://dmesgd.nycbug.org/index.cgi?do=view=5459

Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.232 -r1.233 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.232 src/sys/arch/hp300/hp300/machdep.c:1.233
--- src/sys/arch/hp300/hp300/machdep.c:1.232	Tue Dec 31 13:07:10 2019
+++ src/sys/arch/hp300/hp300/machdep.c	Tue Apr 21 09:02:33 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.232 2019/12/31 13:07:10 ad Exp $	*/
+/*	$NetBSD: machdep.c,v 1.233 2020/04/21 09:02:33 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.232 2019/12/31 13:07:10 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.233 2020/04/21 09:02:33 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -433,6 +433,7 @@ identifycpu(void)
 	/*
 	 * ...and the FPU type.
 	 */
+	fpu[0] = '\0';
 	switch (fputype) {
 	case FPU_68040:
 		strlcpy(fpu, "+FPU", sizeof(fpu));
@@ -458,6 +459,7 @@ identifycpu(void)
 	/*
 	 * ...and finally, the cache type.
 	 */
+	cache[0] = '\0';
 	if (cputype == CPU_68040)
 		snprintf(cache, sizeof(cache),
 		", 4k on-chip physical I/D caches");



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

2017-03-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 25 22:09:45 UTC 2017

Modified Files:
src/sys/arch/hp300/dev: ppi.c

Log Message:
Include  for hz.

Compile test only. (no HP-IB devices here)


To generate a diff of this commit:
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/hp300/dev/ppi.c

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

Modified files:

Index: src/sys/arch/hp300/dev/ppi.c
diff -u src/sys/arch/hp300/dev/ppi.c:1.45 src/sys/arch/hp300/dev/ppi.c:1.46
--- src/sys/arch/hp300/dev/ppi.c:1.45	Fri Jul 25 08:10:33 2014
+++ src/sys/arch/hp300/dev/ppi.c	Sat Mar 25 22:09:45 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppi.c,v 1.45 2014/07/25 08:10:33 dholland Exp $	*/
+/*	$NetBSD: ppi.c,v 1.46 2017/03/25 22:09:45 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -65,10 +65,11 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.45 2014/07/25 08:10:33 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ppi.c,v 1.46 2017/03/25 22:09:45 tsutsui Exp $");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -486,7 +487,6 @@ ppiioctl(dev_t dev, u_long cmd, void *da
 static int
 ppihztoms(int h)
 {
-	extern int hz;
 	int m = h;
 
 	if (m > 0)
@@ -497,7 +497,6 @@ ppihztoms(int h)
 static int
 ppimstohz(int m)
 {
-	extern int hz;
 	int h = m;
 
 	if (h > 0) {



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

2017-03-25 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 25 22:08:27 UTC 2017

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c

Log Message:
In RAWKBD mode, don't schedule autorepeat callout(9) after KEY_UP events.

Now Apollo Domain keyboard works propery on Xorg server on my 425t.
Changes are taken from sys/dev/hil/hilkbd.c.

Note as OpenBSD says in the following commit log:
 
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/sys/arch/hp300/dev/Attic/dnkbd.c#rev1.18
>> Auto-repeat keys in WSKBD_RAW mode is not needed.
>> WSKBD_RAW mode used in X, but X independently implements auto-repeat keys.
these autorepeat code will be removed later, but I commit this fix first
for the record.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/dev/dnkbd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.8 src/sys/arch/hp300/dev/dnkbd.c:1.9
--- src/sys/arch/hp300/dev/dnkbd.c:1.8	Sat Mar 25 01:48:31 2017
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Mar 25 22:08:27 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.8 2017/03/25 01:48:31 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.9 2017/03/25 22:08:27 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -706,8 +706,9 @@ dnevent_kbd_internal(struct dnkbd_softc 
 #ifdef WSDISPLAY_COMPAT_RAWKBD
 	if (sc->sc_rawkbd) {
 		u_char cbuf[2];
-		int c, j = 0;
+		int c, j, npress;
 
+		npress = j = 0;
 		c = dnkbd_raw[key];
 		if (c != 0) {
 			/* fake extended scancode if necessary */
@@ -718,7 +719,9 @@ dnevent_kbd_internal(struct dnkbd_softc 
 cbuf[j] |= 0x80;
 			else {
 /* remember pressed key for autorepeat */
-memcpy(sc->sc_rep, cbuf, sizeof(sc->sc_rep));
+if (c & 0x80)
+	sc->sc_rep[npress++] = 0xe0;
+sc->sc_rep[npress++] = c & 0x7f;
 			}
 			j++;
 		}
@@ -728,9 +731,11 @@ dnevent_kbd_internal(struct dnkbd_softc 
 			wskbd_rawinput(sc->sc_wskbddev, cbuf, j);
 			splx(s);
 			callout_stop(>sc_rawrepeat_ch);
-			sc->sc_nrep = j;
-			callout_schedule(>sc_rawrepeat_ch,
-			mstohz(REP_DELAY1));
+			sc->sc_nrep = npress;
+			if (npress != 0) {
+callout_schedule(>sc_rawrepeat_ch,
+mstohz(REP_DELAY1));
+			}
 		}
 	} else
 #endif



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

2017-03-24 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 25 01:48:31 UTC 2017

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c

Log Message:
Send break signal to reset keyboard state before keyboard probe.

Now Apollo Domain keyboard is probed properly even after
any keys are typed before boot (i.e. on bootloader prompt).

Tested on 425e and A1630-82001 keyboard
(that were contributed by Miod Vallat).


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/dev/dnkbd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.7 src/sys/arch/hp300/dev/dnkbd.c:1.8
--- src/sys/arch/hp300/dev/dnkbd.c:1.7	Thu Apr 24 12:10:27 2014
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Mar 25 01:48:31 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.7 2014/04/24 12:10:27 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.8 2017/03/25 01:48:31 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -263,6 +263,7 @@ static int	dnkbd_probe(struct dnkbd_soft
 static void	dnkbd_rawrepeat(void *);
 #endif
 static int	dnkbd_send(struct dnkbd_softc *, const uint8_t *, size_t);
+static void	dnkbd_break(struct dnkbd_softc *, int);
 
 int
 dnkbd_match(device_t parent, cfdata_t cf, void *aux)
@@ -309,6 +310,12 @@ dnkbd_attach(device_t parent, device_t s
 
 	frodo_intr_establish(parent, dnkbd_intr, sc, fa->fa_line, IPL_VM);
 
+	/* send break to reset keyboard state */
+	dnkbd_break(sc, 1);
+	delay(10 * 1000);	/* 10ms for 12 space bits */
+	dnkbd_break(sc, 0);
+	delay(10 * 1000);
+
 	/* probe for keyboard */
 	if (dnkbd_probe(sc) != 0) {
 		aprint_normal("no keyboard\n");
@@ -869,6 +876,24 @@ dnkbd_send(struct dnkbd_softc *sc, const
 	return 0;
 }
 
+void
+dnkbd_break(struct dnkbd_softc *sc, int onoff)
+{
+	bus_space_tag_t bst;
+	bus_space_handle_t bsh;
+	uint8_t reg;
+
+	bst = sc->sc_bst;
+	bsh = sc->sc_bsh;
+
+	reg = bus_space_read_1(bst, bsh, com_lctl);
+	if (onoff)
+		reg |= LCR_SBREAK;
+	else
+		reg &= ~LCR_SBREAK;
+	bus_space_write_1(bst, bsh, com_lctl, reg);
+}
+
 int
 dnkbd_intr(void *v)
 {



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

2016-06-11 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Jun 11 06:22:11 UTC 2016

Modified Files:
src/sys/arch/hp300/stand/common: samachdep.h tgets.c
src/sys/arch/hp300/stand/uboot: uboot.c

Log Message:
Change "tgets_s" back to "tgets". We obviously want to keep the bounds
argument, but there's no need to mess with the function name.


To generate a diff of this commit:
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp300/stand/common/samachdep.h
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/stand/common/tgets.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/stand/uboot/uboot.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/samachdep.h
diff -u src/sys/arch/hp300/stand/common/samachdep.h:1.19 src/sys/arch/hp300/stand/common/samachdep.h:1.20
--- src/sys/arch/hp300/stand/common/samachdep.h:1.19	Sun Jun  5 17:43:02 2016
+++ src/sys/arch/hp300/stand/common/samachdep.h	Sat Jun 11 06:22:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: samachdep.h,v 1.19 2016/06/05 17:43:02 christos Exp $	*/
+/*	$NetBSD: samachdep.h,v 1.20 2016/06/11 06:22:11 dholland Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -98,7 +98,7 @@ void romout(int, char *);
 void _transfer(char *, int, int, int, char *, char *);
 
 /* tget.c */
-int tgets_s(char *, size_t);
+int tgets(char *, size_t);
 
 
 #define DELAY(n)			\

Index: src/sys/arch/hp300/stand/common/tgets.c
diff -u src/sys/arch/hp300/stand/common/tgets.c:1.7 src/sys/arch/hp300/stand/common/tgets.c:1.8
--- src/sys/arch/hp300/stand/common/tgets.c:1.7	Thu Jun  9 03:05:54 2016
+++ src/sys/arch/hp300/stand/common/tgets.c	Sat Jun 11 06:22:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tgets.c,v 1.7 2016/06/09 03:05:54 christos Exp $	*/
+/*	$NetBSD: tgets.c,v 1.8 2016/06/11 06:22:11 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -38,7 +38,7 @@
 #include 
 
 int
-tgets_s(char *buf, size_t size)
+tgets(char *buf, size_t size)
 {
 	int c;
 	int i;

Index: src/sys/arch/hp300/stand/uboot/uboot.c
diff -u src/sys/arch/hp300/stand/uboot/uboot.c:1.16 src/sys/arch/hp300/stand/uboot/uboot.c:1.17
--- src/sys/arch/hp300/stand/uboot/uboot.c:1.16	Sun Jun  5 17:43:02 2016
+++ src/sys/arch/hp300/stand/uboot/uboot.c	Sat Jun 11 06:22:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uboot.c,v 1.16 2016/06/05 17:43:02 christos Exp $	*/
+/*	$NetBSD: uboot.c,v 1.17 2016/06/11 06:22:11 dholland Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -109,7 +109,7 @@ getbootdev(int *howto)
 	printf("Boot: [[[%s%d%c:]%s][-a][-c][-d][-s][-v][-q]] :- ",
 	devsw[bdev].dv_name, bctlr + (8 * badapt), 'a' + bpart, name);
 
-	if (tgets_s(line, sizeof(line))) {
+	if (tgets(line, sizeof(line))) {
 		if (strcmp(line, "reset") == 0) {
 			call_req_reboot();  /* reset machine */
 			printf("panic: can't reboot, halting\n");



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

2016-06-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jun  9 03:05:54 UTC 2016

Modified Files:
src/sys/arch/hp300/stand/common: tgets.c

Log Message:
return something


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/hp300/stand/common/tgets.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/tgets.c
diff -u src/sys/arch/hp300/stand/common/tgets.c:1.6 src/sys/arch/hp300/stand/common/tgets.c:1.7
--- src/sys/arch/hp300/stand/common/tgets.c:1.6	Sun Jun  5 13:43:02 2016
+++ src/sys/arch/hp300/stand/common/tgets.c	Wed Jun  8 23:05:54 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tgets.c,v 1.6 2016/06/05 17:43:02 christos Exp $	*/
+/*	$NetBSD: tgets.c,v 1.7 2016/06/09 03:05:54 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -48,7 +48,7 @@ tgets_s(char *buf, size_t size)
 if (lp - buf == size) {
 lp--;
 *lp = '\0';
-return; 
+return 0;
 }
 		c = tgetchar() & 0177;
 		if (c) {



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

2016-06-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  5 17:44:40 UTC 2016

Modified Files:
src/sys/arch/hp300/stand/inst: inst.c

Log Message:
get rid of gets


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp300/stand/inst/inst.c

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

Modified files:

Index: src/sys/arch/hp300/stand/inst/inst.c
diff -u src/sys/arch/hp300/stand/inst/inst.c:1.20 src/sys/arch/hp300/stand/inst/inst.c:1.21
--- src/sys/arch/hp300/stand/inst/inst.c:1.20	Sun Aug 10 03:40:49 2014
+++ src/sys/arch/hp300/stand/inst/inst.c	Sun Jun  5 13:44:40 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: inst.c,v 1.20 2014/08/10 07:40:49 isaki Exp $	*/
+/*	$NetBSD: inst.c,v 1.21 2016/06/05 17:44:40 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -131,7 +131,7 @@ main(void)
 	for (;;) {
 		printf("sys_inst> ");
 		memset(line, 0, sizeof(line));
-		gets(line);
+		gets_s(line, sizeof(line));
 		if (line[0] == '\n' || line[0] == '\0')
 			continue;
 
@@ -200,7 +200,7 @@ dsklabel(void)
  disklabel_loop:
 	memset(line, 0, sizeof(line));
 	printf("(z)ap, (e)dit, (s)how, (w)rite, (d)one > ");
-	gets(line);
+	gets_s(line, sizeof(line));
 	if (line[0] == '\n' || line[0] == '\0')
 		goto disklabel_loop;
 
@@ -259,28 +259,28 @@ dsklabel(void)
 #define GETNUM(out, num)		\
 	printf((out), (num));		\
 	memset(line, 0, sizeof(line));	\
-	gets(line);			\
+	gets_s(line, sizeof(line));			\
 	if (line[0])			\
 		(num) = atoi(line);
 
 #define GETNUM2(out, num1, num2)	\
 	printf((out), (num1), (num2));	\
 	memset(line, 0, sizeof(line));	\
-	gets(line);			\
+	gets_s(line, sizeof(line));			\
 	if (line[0])			\
 		(num2) = atoi(line);
 
 #define GETSTR(out, str)		\
 	printf((out), (str));		\
 	memset(line, 0, sizeof(line));	\
-	gets(line);			\
+	gets_s(line, sizeof(line));			\
 	if (line[0])			\
 		strcpy((str), line);
 
 #define FLAGS(out, flag)		\
 	printf((out), lp->d_flags & (flag) ? 'y' : 'n');		\
 	memset(line, 0, sizeof(line));	\
-	gets(line);			\
+	gets_s(line, sizeof(line));			\
 	if (line[0] == 'y' || line[0] == 'Y')\
 		lp->d_flags |= (flag);	\
 	else\
@@ -514,7 +514,7 @@ opendisk(char *question, char *diskname,
 	printf("%s ", question);
 	memset(diskname, 0, len);
 	memset(fulldiskname, 0, sizeof(fulldiskname));
-	gets(diskname);
+	gets_s(diskname, sizeof(diskname));
 	if (diskname[0] == '\n' || diskname[0] == '\0')
 		goto getdiskname;
 
@@ -570,7 +570,7 @@ miniroot(void)
  getsource:
 	printf("Source? (N)FS, (t)ape, (d)one > ");
 	memset(line, 0, sizeof(line));
-	gets(line);
+	gets_s(line, sizeof(line));
 	if (line[0] == '\0')
 		goto getsource;
 
@@ -581,7 +581,7 @@ miniroot(void)
 		printf("Name of miniroot file? ");
 		memset(line, 0, sizeof(line));
 		memset(minirootname, 0, sizeof(minirootname));
-		gets(line);
+		gets_s(line, sizeof(line));
 		if (line[0] == '\0')
 			goto name_of_nfs_miniroot;
 		(void)strcat(minirootname, "le0a:");
@@ -613,7 +613,7 @@ miniroot(void)
 		memset(line, 0, sizeof(line));
 		memset(minirootname, 0, sizeof(minirootname));
 		memset(tapename, 0, sizeof(tapename));
-		gets(line);
+		gets_s(line, sizeof(line));
 		if (line[0] == '\0')
 			goto name_of_tape_miniroot;
 		strcat(minirootname, line);
@@ -621,7 +621,7 @@ miniroot(void)
 
 		printf("File number (first == 1)? ");
 		memset(line, 0, sizeof(line));
-		gets(line);
+		gets_s(line, sizeof(line));
 		fileno = a2int(line);
 		if (fileno < 1 || fileno > 8) {
 			printf("Invalid file number: %s\n", line);
@@ -643,7 +643,7 @@ miniroot(void)
 		ignoreshread = 0;
 		printf("Copy how many %d byte blocks? ", DEV_BSIZE);
 		memset(line, 0, sizeof(line));
-		gets(line);
+		gets_s(line, sizeof(line));
 		nblks = a2int(line);
 		if (nblks < 0) {
 			printf("Invalid block count: %s\n", line);
@@ -723,7 +723,7 @@ bootmini(void)
 	printf("Disk to boot from? ");
 	memset(diskname, 0, sizeof(diskname));
 	memset(bootname, 0, sizeof(bootname));
-	gets(diskname);
+	gets_s(diskname, sizeof(diskname));
 	if (diskname[0] == '\n' || diskname[0] == '\0')
 		goto getdiskname;
 



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

2016-06-05 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jun  5 17:43:02 UTC 2016

Modified Files:
src/sys/arch/hp300/stand/common: netio.c samachdep.h tgets.c
src/sys/arch/hp300/stand/uboot: uboot.c

Log Message:
get rid of gets/tgets


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/stand/common/netio.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/stand/common/samachdep.h
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp300/stand/common/tgets.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp300/stand/uboot/uboot.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/netio.c
diff -u src/sys/arch/hp300/stand/common/netio.c:1.14 src/sys/arch/hp300/stand/common/netio.c:1.15
--- src/sys/arch/hp300/stand/common/netio.c:1.14	Sun Jul 17 16:54:40 2011
+++ src/sys/arch/hp300/stand/common/netio.c	Sun Jun  5 13:43:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: netio.c,v 1.14 2011/07/17 20:54:40 joerg Exp $	*/
+/*	$NetBSD: netio.c,v 1.15 2016/06/05 17:43:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -169,7 +169,7 @@ netmountroot(struct open_file *f, char *
  get_my_ip:
 		printf("My IP address? ");
 		memset(input_line, 0, sizeof(input_line));
-		gets(input_line);
+		gets_s(input_line, sizeof(input_line));
 		if ((myip.s_addr = inet_addr(input_line)) ==
 		htonl(INADDR_NONE)) {
 			printf("invalid IP address: %s\n", input_line);
@@ -179,7 +179,7 @@ netmountroot(struct open_file *f, char *
  get_my_netmask:
 		printf("My netmask? ");
 		memset(input_line, 0, sizeof(input_line)); 
-		gets(input_line);
+		gets_s(input_line, sizeof(input_line));
 		if ((netmask = inet_addr(input_line)) ==
 		htonl(INADDR_NONE)) {
 			printf("invalid netmask: %s\n", input_line);
@@ -189,7 +189,7 @@ netmountroot(struct open_file *f, char *
  get_my_gateway:
 		printf("My gateway? ");
 		memset(input_line, 0, sizeof(input_line)); 
-		gets(input_line);
+		gets_s(input_line, sizeof(input_line));
 		if ((gateip.s_addr = inet_addr(input_line)) ==
 		htonl(INADDR_NONE)) {
 			printf("invalid IP address: %s\n", input_line);
@@ -199,7 +199,7 @@ netmountroot(struct open_file *f, char *
  get_server_ip:
 		printf("Server IP address? ");
 		memset(input_line, 0, sizeof(input_line)); 
-		gets(input_line);
+		gets_s(input_line, sizeof(input_line));
 		if ((rootip.s_addr = inet_addr(input_line)) ==
 		htonl(INADDR_NONE)) {
 			printf("invalid IP address: %s\n", input_line);
@@ -209,7 +209,7 @@ netmountroot(struct open_file *f, char *
  get_server_path:
 		printf("Server path? ");
 		memset(rootpath, 0, sizeof(rootpath)); 
-		gets(rootpath);
+		gets_s(rootpath, sizeof(rootpath));
 		if (rootpath[0] == '\0' || rootpath[0] == '\n')
 			goto get_server_path;
 

Index: src/sys/arch/hp300/stand/common/samachdep.h
diff -u src/sys/arch/hp300/stand/common/samachdep.h:1.18 src/sys/arch/hp300/stand/common/samachdep.h:1.19
--- src/sys/arch/hp300/stand/common/samachdep.h:1.18	Sun Aug 10 03:40:49 2014
+++ src/sys/arch/hp300/stand/common/samachdep.h	Sun Jun  5 13:43:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: samachdep.h,v 1.18 2014/08/10 07:40:49 isaki Exp $	*/
+/*	$NetBSD: samachdep.h,v 1.19 2016/06/05 17:43:02 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -98,7 +98,7 @@ void romout(int, char *);
 void _transfer(char *, int, int, int, char *, char *);
 
 /* tget.c */
-int tgets(char *);
+int tgets_s(char *, size_t);
 
 
 #define DELAY(n)			\

Index: src/sys/arch/hp300/stand/common/tgets.c
diff -u src/sys/arch/hp300/stand/common/tgets.c:1.5 src/sys/arch/hp300/stand/common/tgets.c:1.6
--- src/sys/arch/hp300/stand/common/tgets.c:1.5	Sun Dec 11 07:17:19 2005
+++ src/sys/arch/hp300/stand/common/tgets.c	Sun Jun  5 13:43:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: tgets.c,v 1.5 2005/12/11 12:17:19 christos Exp $	*/
+/*	$NetBSD: tgets.c,v 1.6 2016/06/05 17:43:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1993
@@ -38,13 +38,18 @@
 #include 
 
 int
-tgets(char *buf)
+tgets_s(char *buf, size_t size)
 {
 	int c;
 	int i;
 	char *lp = buf;
 
 	for (i = 24; i > 0; i--) {
+if (lp - buf == size) {
+lp--;
+*lp = '\0';
+return; 
+}
 		c = tgetchar() & 0177;
 		if (c) {
 			for (;;) {

Index: src/sys/arch/hp300/stand/uboot/uboot.c
diff -u src/sys/arch/hp300/stand/uboot/uboot.c:1.15 src/sys/arch/hp300/stand/uboot/uboot.c:1.16
--- src/sys/arch/hp300/stand/uboot/uboot.c:1.15	Wed Jul 16 09:44:51 2008
+++ src/sys/arch/hp300/stand/uboot/uboot.c	Sun Jun  5 13:43:02 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: uboot.c,v 1.15 2008/07/16 13:44:51 tsutsui Exp $	*/
+/*	$NetBSD: uboot.c,v 1.16 2016/06/05 17:43:02 christos Exp $	*/
 
 /*-
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -109,7 +109,7 @@ getbootdev(int *howto)
 	printf("Boot: [[[%s%d%c:]%s][-a][-c][-d][-s][-v][-q]] :- ",
 	

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

2016-02-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Feb 26 18:11:11 UTC 2016

Modified Files:
src/sys/arch/hp300/stand/common: ite.c

Log Message:
PR/50852: David Binderman: make code more readable (although it was correct
anyway)


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp300/stand/common/ite.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.17 src/sys/arch/hp300/stand/common/ite.c:1.18
--- src/sys/arch/hp300/stand/common/ite.c:1.17	Sun Apr 13 11:45:27 2014
+++ src/sys/arch/hp300/stand/common/ite.c	Fri Feb 26 13:11:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.17 2014/04/13 15:45:27 tsutsui Exp $	*/
+/*	$NetBSD: ite.c,v 1.18 2016/02/26 18:11:11 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -236,7 +236,7 @@ iteprobe(struct consdev *cp)
 	int unit, pri;
 
 #ifdef CONSDEBUG
-	whichconsole = ++whichconsole % (NITE+1);
+	whichconsole = (whichconsole + 1) % (NITE+1);
 #endif
 
 	if (itecons != -1)



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

2016-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 17 08:05:20 UTC 2016

Modified Files:
src/sys/arch/hp300/stand: Makefile.buildboot
src/sys/arch/hp300/stand/inst: version
src/sys/arch/hp300/stand/uboot: version

Log Message:
Enable LIBSA_CREAD_NOCRC.  PR/50638

Bump version to denote user visible change.
Tested on HP9000/382.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/hp300/stand/Makefile.buildboot
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/inst/version
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp300/stand/uboot/version

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

Modified files:

Index: src/sys/arch/hp300/stand/Makefile.buildboot
diff -u src/sys/arch/hp300/stand/Makefile.buildboot:1.34 src/sys/arch/hp300/stand/Makefile.buildboot:1.35
--- src/sys/arch/hp300/stand/Makefile.buildboot:1.34	Sun Apr 13 15:45:26 2014
+++ src/sys/arch/hp300/stand/Makefile.buildboot	Sun Jan 17 08:05:20 2016
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.34 2014/04/13 15:45:26 tsutsui Exp $
+#	$NetBSD: Makefile.buildboot,v 1.35 2016/01/17 08:05:20 tsutsui Exp $
 
 # RELOC=FFF0 allows for boot prog up to FF000 (1044480) bytes long
 RELOC=	FFF0
@@ -47,6 +47,7 @@ CPPFLAGS+=		-DHIL_KEYBOARD -DUK_KEYBOARD
 CPPFLAGS+=		-DDOMAIN_KEYBOARD
 CPPFLAGS+=		-D_STANDALONE -DCOMPAT_NOLABEL -Dhp300
 CPPFLAGS+=		-DCOMPAT_UFS -DNO_LSEEK
+CPPFLAGS+=		-DLIBSA_CREAD_NOCRC
 
 # if sun bootparams is desired
 #CPPFLAGS+= -DSUN_BOOTPARAMS

Index: src/sys/arch/hp300/stand/inst/version
diff -u src/sys/arch/hp300/stand/inst/version:1.12 src/sys/arch/hp300/stand/inst/version:1.13
--- src/sys/arch/hp300/stand/inst/version:1.12	Sat Apr 26 07:53:41 2014
+++ src/sys/arch/hp300/stand/inst/version	Sun Jan 17 08:05:20 2016
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.12 2014/04/26 07:53:41 tsutsui Exp $
+$NetBSD: version,v 1.13 2016/01/17 08:05:20 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for HP-IB cartridge tapes
@@ -12,3 +12,4 @@ $NetBSD: version,v 1.12 2014/04/26 07:53
 1.10:	Pull OpenBSD's ite driver reorganization.
 1.11:	Add support for framebuffers on HP362 and HP382.
 1.12:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.
+1.13:	Disable slow gunzip CRC32 calculation.

Index: src/sys/arch/hp300/stand/uboot/version
diff -u src/sys/arch/hp300/stand/uboot/version:1.19 src/sys/arch/hp300/stand/uboot/version:1.20
--- src/sys/arch/hp300/stand/uboot/version:1.19	Sat Apr 26 07:53:41 2014
+++ src/sys/arch/hp300/stand/uboot/version	Sun Jan 17 08:05:20 2016
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.19 2014/04/26 07:53:41 tsutsui Exp $
+$NetBSD: version,v 1.20 2016/01/17 08:05:20 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for network booting
@@ -19,3 +19,4 @@ $NetBSD: version,v 1.19 2014/04/26 07:53
 1.17:	Pull OpenBSD's ite driver reorganization.
 1.18:	Add support for framebuffers on HP362 and HP382.
 1.19:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.
+1.20:	Disable slow gunzip CRC32 calculation.



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

2016-01-17 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan 17 17:49:55 UTC 2016

Modified Files:
src/sys/arch/hp300/hp300: intr.c

Log Message:
Fix fatal "intr_dispatch: stray level 6 interrupt" panic by the GENERIC
kernel on machines without arcofi(4) audio (i.e. all hp300 except HP425e).

I failed to pull all necessary changes for arcofi(4) from OpenBSD
and I should have tested 7.0_RC kernels on my HP382 too :-(

Should be pulled up to netbsd-7 and netbsd-7-0.


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/hp300/hp300/intr.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/intr.c
diff -u src/sys/arch/hp300/hp300/intr.c:1.41 src/sys/arch/hp300/hp300/intr.c:1.42
--- src/sys/arch/hp300/hp300/intr.c:1.41	Sun Aug 24 08:17:44 2014
+++ src/sys/arch/hp300/hp300/intr.c	Sun Jan 17 17:49:55 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.41 2014/08/24 08:17:44 tsutsui Exp $	*/
+/*	$NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1999 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.41 2014/08/24 08:17:44 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.42 2016/01/17 17:49:55 tsutsui Exp $");
 
 #define _HP300_INTR_H_PRIVATE
 
@@ -199,9 +199,12 @@ intr_dispatch(int evec /* format | vecto
 
 	list = _intr_list[ipl];
 	if (LIST_FIRST(>hi_q) == NULL) {
-		printf("intr_dispatch: ipl %d unexpected\n", ipl);
-		if (++unexpected > 10)
-			panic("intr_dispatch: too many unexpected interrupts");
+		if (ipl != 6) {
+			printf("intr_dispatch: ipl %d unexpected\n", ipl);
+			if (++unexpected > 10)
+panic("intr_dispatch:"
+" too many unexpected interrupts");
+		}
 		return;
 	}
 



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

2015-12-29 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Dec 29 14:51:38 UTC 2015

Modified Files:
src/sys/arch/hp300/conf: RAMDISK

Log Message:
Holiday food satiation.


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/conf/RAMDISK

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

Modified files:

Index: src/sys/arch/hp300/conf/RAMDISK
diff -u src/sys/arch/hp300/conf/RAMDISK:1.14 src/sys/arch/hp300/conf/RAMDISK:1.15
--- src/sys/arch/hp300/conf/RAMDISK:1.14	Tue Apr 29 14:47:22 2014
+++ src/sys/arch/hp300/conf/RAMDISK	Tue Dec 29 09:51:38 2015
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.14 2014/04/29 18:47:22 tsutsui Exp $
+# $NetBSD: RAMDISK,v 1.15 2015/12/29 14:51:38 christos Exp $
 #
 # RAMDISK machine description file
 #
@@ -16,7 +16,7 @@ no options	BUFPAGES
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT		# force root on memory disk
 options 	MEMORY_DISK_SERVER=0		# no mdconfig(8) support
-options 	MEMORY_DISK_ROOT_SIZE=3200	# size, in blocks (1.60MB)
+options 	MEMORY_DISK_ROOT_SIZE=3600	# size, in blocks (1.80MB)
 options 	MEMORY_DISK_RBFLAGS=RB_SINGLE	# boot in single-user mode
 
 pseudo-device 	md# memory disk device



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

2014-10-10 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Sat Oct 11 05:33:25 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/mkboot: mkboot.c

Log Message:
PR 49245: Fix broken RCSID (Kamil Rytarowski)


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/mkboot/mkboot.c

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

Modified files:

Index: src/sys/arch/hp300/stand/mkboot/mkboot.c
diff -u src/sys/arch/hp300/stand/mkboot/mkboot.c:1.10 src/sys/arch/hp300/stand/mkboot/mkboot.c:1.11
--- src/sys/arch/hp300/stand/mkboot/mkboot.c:1.10	Sun Jun 18 05:53:51 2006
+++ src/sys/arch/hp300/stand/mkboot/mkboot.c	Sat Oct 11 05:33:25 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: mkboot.c,v 1.10 2006/06/18 05:53:51 gdamore Exp $
+/*	$NetBSD: mkboot.c,v 1.11 2014/10/11 05:33:25 dholland Exp $	*/
 
 /*
  * Copyright (c) 1990, 1993
@@ -47,7 +47,7 @@ __COPYRIGHT(
 #ifdef notdef
 static char sccsid[] = @(#)mkboot.c	7.2 (Berkeley) 12/16/90;
 #endif
-__RCSID($NetBSD: mkboot.c,v 1.10 2006/06/18 05:53:51 gdamore Exp $);
+__RCSID($NetBSD: mkboot.c,v 1.11 2014/10/11 05:33:25 dholland Exp $);
 #endif /* not lint */
 
 #include sys/param.h



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

2014-07-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jul 18 17:51:27 UTC 2014

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

Log Message:
Shrink GENERIC and enable MODULAR instead.


To generate a diff of this commit:
cvs rdiff -u -r1.182 -r1.183 src/sys/arch/hp300/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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.182 src/sys/arch/hp300/conf/GENERIC:1.183
--- src/sys/arch/hp300/conf/GENERIC:1.182	Sat Jul  5 09:15:38 2014
+++ src/sys/arch/hp300/conf/GENERIC	Fri Jul 18 17:51:27 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.182 2014/07/05 09:15:38 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.183 2014/07/18 17:51:27 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	arch/hp300/conf/std.hp300
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.182 $
+#ident 		GENERIC-$Revision: 1.183 $
 
 makeoptions	COPTS=-O2 -fno-reorder-blocks	# see share/mk/sys.mk
 
@@ -59,7 +59,7 @@ options 	SYSVSHM		# System V-style share
 options 	SYSVMSG		# System V-style message queues
 options 	SYSVSEM		# System V-style semaphores
 
-#options 	MODULAR		# new style module(7) framework
+options 	MODULAR		# new style module(7) framework
 
 # Enable experimental buffer queue strategy for better responsiveness under
 # high disk I/O load. Use it with caution - it's not proven to be stable yet.
@@ -97,26 +97,26 @@ options 	COMPAT_60	# NetBSD 6.0 compatib
 options 	COMPAT_AOUT_M68K	# NetBSD/m68k a.out binary compatibility
 options 	COMPAT_M68K4K	# NetBSD/m68k4k binary compatibility
 options 	COMPAT_SUNOS	# SunOS4 m68k binary compatibility
-options 	COMPAT_LINUX	# Linux/m68k binary compatibility
-options 	COMPAT_SVR4	# SVR4 binary compatibility
+#options 	COMPAT_LINUX	# Linux/m68k binary compatibility
+#options 	COMPAT_SVR4	# SVR4 binary compatibility
 options 	COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 
 # Filesystems
 file-system	CD9660		# CD-ROM ISO-9660 filesystem
-file-system	EXT2FS		# second extended file system (linux)
+#file-system	EXT2FS		# second extended file system (linux)
 file-system	FDESC		# user file descriptor filesystem
 file-system	FFS		# fast filesystem
 file-system	KERNFS		# kernel data-structure filesystem
-file-system	LFS		# log-structured file system
+#file-system	LFS		# log-structured file system
 file-system	MFS		# Memory-based filesystem
 file-system	NFS		# Network filesystem client
 file-system	NULLFS		# loopback file system
-file-system	OVERLAY		# overlay file system
-file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g  sshfs)
+#file-system	OVERLAY		# overlay file system
+#file-system	PUFFS		# Userspace file systems (e.g. ntfs-3g  sshfs)
 file-system	PROCFS		# /proc filesystem
-file-system	UMAPFS		# NULLFS + uid and gid remapping
-file-system	UNION		# Union filesystem (req. for FDESC)
-file-system	CODA		# Coda File System; also needs vcoda (below)
+#file-system	UMAPFS		# NULLFS + uid and gid remapping
+#file-system	UNION		# Union filesystem (req. for FDESC)
+#file-system	CODA		# Coda File System; also needs vcoda (below)
 file-system	PTYFS		# /dev/pts/N support
 file-system	TMPFS		# Efficient memory file-system
 #file-system	UDF		# experimental - OSTA UDF CD/DVD file-system
@@ -130,7 +130,7 @@ options 	WAPBL		# File system journaling
 options 	NFSSERVER	# Network filesystem server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags
 options 	NFS_BOOT_BOOTP	# use bootp for NFS boot
-#options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
+options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
 options 	INET		# Internet protocols
@@ -141,8 +141,8 @@ options 	GATEWAY		# IP forwarding
 options 	MROUTING	# Multicast routing
 options 	PIM		# Protocol Independent Multicast
 options 	NETATALK	# AppleTalk networking protocols
-options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
-options 	PPP_DEFLATE	# Deflate compression support for PPP
+#options 	PPP_BSDCOMP	# BSD-Compress compression support for PPP
+#options 	PPP_DEFLATE	# Deflate compression support for PPP
 options 	PPP_FILTER	# Active filter support for PPP (requires bpf)
 options 	IPFILTER_LOG	# ipmon(8) log support
 options 	IPFILTER_LOOKUP	# ippool(8) support
@@ -294,7 +294,7 @@ options 	RAID_AUTOCONFIG		# auto-configu
 #options 	RF_INCLUDE_INTERDECLUSTER=1
 #options 	RF_INCLUDE_PARITY_DECLUSTERING=1
 #options 	RF_INCLUDE_PARITY_DECLUSTERING_DS=1
-pseudo-device	fss			# file system snapshot device
+#pseudo-device	fss			# file system snapshot device
 pseudo-device	md			# memory disk device (ramdisk)
 pseudo-device	vnd			# vnode pseudo-disks
 #options 	VND_COMPRESSION		# compressed vnd(4)
@@ -320,17 +320,17 @@ pseudo-device	vlan			# IEEE 802.1q encap
 
 #
 # accept filters
-pseudo-device   accf_data		# dataready accept filter
-pseudo-device   accf_http		# httpready 

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

2014-07-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jul 18 17:59:12 UTC 2014

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

Log Message:
More tweaks to GENERIC.

- reduce maxusers from 32 to 8 as other m68k ports
- make NFS_BOOT_DHCP default rather than NFS_BOOT_BOOTP
  (and move these options in Networking options block)
- use 8x16 font instead of 12x22 for machines with small screen like HP362


To generate a diff of this commit:
cvs rdiff -u -r1.183 -r1.184 src/sys/arch/hp300/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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.183 src/sys/arch/hp300/conf/GENERIC:1.184
--- src/sys/arch/hp300/conf/GENERIC:1.183	Fri Jul 18 17:51:27 2014
+++ src/sys/arch/hp300/conf/GENERIC	Fri Jul 18 17:59:12 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.183 2014/07/18 17:51:27 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.184 2014/07/18 17:59:12 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,11 +22,11 @@ include 	arch/hp300/conf/std.hp300
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.183 $
+#ident 		GENERIC-$Revision: 1.184 $
 
 makeoptions	COPTS=-O2 -fno-reorder-blocks	# see share/mk/sys.mk
 
-maxusers	32		# estimated number of users
+maxusers	8		# estimated number of users
 
 # Support for various CPU types
 options 	HP320
@@ -129,7 +129,6 @@ options 	WAPBL		# File system journaling
 #options 	UFS_DIRHASH	# UFS Large Directory Hashing - Experimental
 options 	NFSSERVER	# Network filesystem server
 #options 	EXT2FS_SYSTEM_FLAGS # makes ext2fs file flags
-options 	NFS_BOOT_BOOTP	# use bootp for NFS boot
 options 	FFS_NO_SNAPSHOT	# No FFS snapshot support
 
 # Networking options
@@ -163,6 +162,9 @@ options 	IPFILTER_COMPAT # Compat for IP
 #options 	ALTQ_RIO	# RED with IN/OUT
 #options 	ALTQ_WFQ	# Weighted Fair Queueing
 
+#options 	NFS_BOOT_BOOTP	# use bootp for NFS boot
+options 	NFS_BOOT_DHCP	# use dhcp for NFS boot
+
 # Options for HP hardware
 options 	USELEDS		# make the lights twinkle
 #options 	PANICBUTTON	# two fast resets on HIL dump kernel
@@ -181,8 +183,8 @@ options 	WSDISPLAY_COMPAT_RAWKBD
 options 	WS_KERNEL_FG=WSCOL_GREEN
 #options 	WS_KERNEL_BG=WSCOL_BLACK
 
-options 	FONT_GALLANT12x22
-#options 	FONT_VT220ISO8x16
+#options 	FONT_GALLANT12x22
+options 	FONT_VT220ISO8x16
 
 config		netbsd root on ? type ?
 



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

2014-07-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jul  5 09:15:38 UTC 2014

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

Log Message:
Use COPTS=-O2 -fno-reorder-blocks as defined in sys.mk for userland.

with -O2:
   textdata bss dec hex filename
3717740   86092  152864 3956696  3c5fd8 netbsd

with -O2 -fno-reorder-blocks:
   textdata bss dec hex filename
3304404   86092  152864 3543360  361140 netbsd


To generate a diff of this commit:
cvs rdiff -u -r1.181 -r1.182 src/sys/arch/hp300/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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.181 src/sys/arch/hp300/conf/GENERIC:1.182
--- src/sys/arch/hp300/conf/GENERIC:1.181	Sat Apr 19 05:37:54 2014
+++ src/sys/arch/hp300/conf/GENERIC	Sat Jul  5 09:15:38 2014
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.181 2014/04/19 05:37:54 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.182 2014/07/05 09:15:38 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,9 @@ include 	arch/hp300/conf/std.hp300
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.181 $
+#ident 		GENERIC-$Revision: 1.182 $
+
+makeoptions	COPTS=-O2 -fno-reorder-blocks	# see share/mk/sys.mk
 
 maxusers	32		# estimated number of users
 



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

2014-06-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 21 02:01:21 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/inst: inst.c

Log Message:
Properly use an unused-but-set-variable.  Also replace a magic number.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/stand/inst/inst.c

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

Modified files:

Index: src/sys/arch/hp300/stand/inst/inst.c
diff -u src/sys/arch/hp300/stand/inst/inst.c:1.18 src/sys/arch/hp300/stand/inst/inst.c:1.19
--- src/sys/arch/hp300/stand/inst/inst.c:1.18	Wed Jul 16 13:44:51 2008
+++ src/sys/arch/hp300/stand/inst/inst.c	Sat Jun 21 02:01:21 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: inst.c,v 1.18 2008/07/16 13:44:51 tsutsui Exp $	*/
+/*	$NetBSD: inst.c,v 1.19 2014/06/21 02:01:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -485,8 +485,8 @@ disklabel_show(struct disklabel *lp)
 	printf( size   offset\n);
 	pp = lp-d_partitions;
 	for (i = 0; i  lp-d_npartitions; i++) {
-		printf(%c:   %d,%d\n, 97 + i, lp-d_partitions[i].p_size,
-		lp-d_partitions[i].p_offset);
+		printf(%c:   %d,%d\n, 'a' + i, pp[i].p_size,
+		pp[i].p_offset);
 	}
 	printf(\n);
 }



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

2014-06-20 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Jun 21 02:02:40 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/common: dcm.c if_le.c

Log Message:
Appease gcc48 -Wunused-but-set-variable warnings.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/stand/common/dcm.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/common/if_le.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/dcm.c
diff -u src/sys/arch/hp300/stand/common/dcm.c:1.8 src/sys/arch/hp300/stand/common/dcm.c:1.9
--- src/sys/arch/hp300/stand/common/dcm.c:1.8	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/dcm.c	Sat Jun 21 02:02:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcm.c,v 1.8 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: dcm.c,v 1.9 2014/06/21 02:02:40 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -112,7 +112,7 @@ dcmgetchar(dev_t dev)
 	struct dcmrfifo *fifo;
 	struct dcmpreg *pp;
 	unsigned int head;
-	int c, stat, port;
+	int c, port;
 
 	port = DCMCONUNIT;
 	pp = dcm_preg(dcm, port);
@@ -121,10 +121,10 @@ dcmgetchar(dev_t dev)
 		return 0;
 	fifo = dcm-dcm_rfifos[3-port][head1];
 	c = fifo-data_char;
-	stat = fifo-data_stat;
+	(void)fifo-data_stat;
 	pp-r_head = (head + 2)  RX_MASK;
 	SEM_LOCK(dcm);
-	stat = dcm-dcm_iir;
+	(void)dcm-dcm_iir;
 	SEM_UNLOCK(dcm);
 	return c;
 }
@@ -145,7 +145,7 @@ dcmputchar(dev_t dev, int c)
 	struct dcmpreg *pp;
 	int timo;
 	unsigned int tail;
-	int port, stat;
+	int port;
 
 	port = DCMCONUNIT;
 	pp = dcm_preg(dcm, port);
@@ -163,7 +163,7 @@ dcmputchar(dev_t dev, int c)
 	while (tail != (pp-t_head  TX_MASK)  --timo)
 		;
 	SEM_LOCK(dcm);
-	stat = dcm-dcm_iir;
+	(void)dcm-dcm_iir;
 	SEM_UNLOCK(dcm);
 }
 #endif

Index: src/sys/arch/hp300/stand/common/if_le.c
diff -u src/sys/arch/hp300/stand/common/if_le.c:1.12 src/sys/arch/hp300/stand/common/if_le.c:1.13
--- src/sys/arch/hp300/stand/common/if_le.c:1.12	Thu May  1 18:08:47 2014
+++ src/sys/arch/hp300/stand/common/if_le.c	Sat Jun 21 02:02:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_le.c,v 1.12 2014/05/01 18:08:47 tsutsui Exp $	*/
+/*	$NetBSD: if_le.c,v 1.13 2014/06/21 02:02:40 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1993 Adam Glass
@@ -531,7 +531,10 @@ le_put(struct iodesc *desc, void *pkt, s
 	int unit = /*nif-nif_unit*/0;
 	struct le_softc *sc = le_softc[unit];
 	volatile struct mds *cdm;
-	int timo, i, stat;
+	int timo, stat;
+#if 0
+	int i;
+#endif
 
  le_put_loop:
 	timo = 10;
@@ -545,8 +548,8 @@ le_put(struct iodesc *desc, void *pkt, s
 	if (stat  (LE_BABL | LE_CERR | LE_MISS | LE_MERR))
 		le_error(unit, le_put(way before xmit), stat);
 	cdm = sc-sc_td[sc-sc_next_td];
-	i = 0;
 #if 0
+	i = 0;
 	while (cdm-flags  LE_OWN) {
 		if ((i % 100) == 0)
 			printf(le%d: output buffer busy - flags=%x\n,



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

2014-05-22 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Thu May 22 16:30:40 UTC 2014

Modified Files:
src/sys/arch/hp300/dev: dcmreg.h

Log Message:
Use uintptr_t so this file can be compile-tested on foreign arches.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/dev/dcmreg.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/hp300/dev/dcmreg.h
diff -u src/sys/arch/hp300/dev/dcmreg.h:1.9 src/sys/arch/hp300/dev/dcmreg.h:1.10
--- src/sys/arch/hp300/dev/dcmreg.h:1.9	Tue Feb  8 20:20:13 2011
+++ src/sys/arch/hp300/dev/dcmreg.h	Thu May 22 16:30:40 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcmreg.h,v 1.9 2011/02/08 20:20:13 rmind Exp $	*/
+/*	$NetBSD: dcmreg.h,v 1.10 2014/05/22 16:30:40 dholland Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -131,7 +131,7 @@ struct	dcmpreg {
 	u_char		pad3[7];	/* +12 */
 	vu_char	t_tail;			/* +19 */
 };
-#define	dcm_preg(d, p)	((struct dcmpreg *)((u_int)(d)+0x8e00+(p)*2))
+#define	dcm_preg(d, p)	((struct dcmpreg *)((uintptr_t)(d)+0x8e00+(p)*2))
 
 /* interface reset/id */
 #define DCMCON  0x80	/* REMOTE/LOCAL switch, read */



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

2014-05-01 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu May  1 18:08:47 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/common: if_le.c

Log Message:
Reduce a number of getsecs() calls in le_get() to make netboot a bit faster.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/if_le.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/if_le.c
diff -u src/sys/arch/hp300/stand/common/if_le.c:1.11 src/sys/arch/hp300/stand/common/if_le.c:1.12
--- src/sys/arch/hp300/stand/common/if_le.c:1.11	Mon Jan 12 11:32:43 2009
+++ src/sys/arch/hp300/stand/common/if_le.c	Thu May  1 18:08:47 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_le.c,v 1.11 2009/01/12 11:32:43 tsutsui Exp $	*/
+/*	$NetBSD: if_le.c,v 1.12 2014/05/01 18:08:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1993 Adam Glass
@@ -631,10 +631,9 @@ le_get(struct iodesc *desc, void *pkt, s
 	int cc;
 
 	t = getsecs();
-	cc = 0;
-	while (((getsecs() - t)  timeout)  !cc) {
+	do {
 		cc = le_poll(desc, pkt, len);
-	}
+	} while (cc == 0  (getsecs() - t)  timeout);
 	return cc;
 }
 



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

2014-04-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Apr 30 15:53:09 UTC 2014

Modified Files:
src/sys/arch/hp300/dev: frodo.c

Log Message:
Probe mcclock only on 425e to avoid an extra not configured message.


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hp300/dev/frodo.c

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

Modified files:

Index: src/sys/arch/hp300/dev/frodo.c
diff -u src/sys/arch/hp300/dev/frodo.c:1.31 src/sys/arch/hp300/dev/frodo.c:1.32
--- src/sys/arch/hp300/dev/frodo.c:1.31	Sat Apr 19 05:37:54 2014
+++ src/sys/arch/hp300/dev/frodo.c	Wed Apr 30 15:53:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: frodo.c,v 1.31 2014/04/19 05:37:54 tsutsui Exp $	*/
+/*	$NetBSD: frodo.c,v 1.32 2014/04/30 15:53:09 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: frodo.c,v 1.31 2014/04/19 05:37:54 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: frodo.c,v 1.32 2014/04/30 15:53:09 tsutsui Exp $);
 
 #define	_HP300_INTR_H_PRIVATE
 
@@ -197,6 +197,11 @@ frodoattach(device_t parent, device_t se
 		if (fd-fd_offset == FRODO_APCI_OFFSET(1) 
 		mmuid != MMUID_425_E)
 			continue;
+		/*
+		 * The mcclock is available only on a 425e.
+		 */
+		if (fd-fd_offset == FRODO_CALENDAR  mmuid != MMUID_425_E)
+			continue;
 		fa.fa_name = fd-fd_name;
 		fa.fa_bst = bst;
 		fa.fa_base = ia-ia_iobase;



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

2014-04-30 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Apr 30 17:51:53 UTC 2014

Modified Files:
src/sys/arch/hp300/conf: INSTALL

Log Message:
Add and enable sti(4) at sgc in install kernels for 425e.

Tested on both serial console and framebuffer console.
(switched by the service switch on the back panel)


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/hp300/conf/INSTALL

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

Modified files:

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.57 src/sys/arch/hp300/conf/INSTALL:1.58
--- src/sys/arch/hp300/conf/INSTALL:1.57	Tue Apr 29 18:38:27 2014
+++ src/sys/arch/hp300/conf/INSTALL	Wed Apr 30 17:51:53 2014
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.57 2014/04/29 18:38:27 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.58 2014/04/30 17:51:53 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -136,7 +136,7 @@ mainbus0	at root		# root bus
 
 intio0		at mainbus0	# internal i/o space
 dio0		at mainbus0	# DIO/DIO-II bus
-#sgc0		at mainbus0	# SGC bus
+sgc0		at mainbus0	# SGC bus
 
 # Real-time clock (not optional)
 rtc*		at intio?
@@ -191,6 +191,9 @@ wsdisplay*	at tvrx?
 gendiofb*	at dio? scode ?
 wsdisplay*	at gendiofb?
 
+sti*		at sgc?	slot ?		# SGC EVRX framebuffers
+wsdisplay*	at sti?
+
 com*		at dio0 scode 9		# DCA serial interfaces
 com*		at dio? scode ?
 



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

2014-04-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 29 18:38:27 UTC 2014

Modified Files:
src/sys/arch/hp300/conf: INSTALL

Log Message:
Add pseudo-device wsmux in INSTALL (and RAMDISK) kernels.

On NetBSD/hp300, hilkbd(4) is probed in config_interrupts(9)
so it's always attached after wsdisplay(4).  In that case,
wskbd can't be used as a console input device without wsmux(4).
(i.e. keyboard didn't work on installer using screen console)

Should be pulled up to all netbsd-6* branches.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/hp300/conf/INSTALL

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

Modified files:

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.56 src/sys/arch/hp300/conf/INSTALL:1.57
--- src/sys/arch/hp300/conf/INSTALL:1.56	Sat Apr 19 05:37:54 2014
+++ src/sys/arch/hp300/conf/INSTALL	Tue Apr 29 18:38:27 2014
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.56 2014/04/19 05:37:54 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.57 2014/04/29 18:38:27 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -248,3 +248,4 @@ pseudo-device	loop			# loopback network 
 #pseudo-device	stf			# 6to4 IPv6 over IPv4 encapsulation
 #pseudo-device	vlan			# IEEE 802.1q encapsulation
 #pseudo-device	bridge			# simple inter-network bridging
+pseudo-device	wsmux			# mouse  keyboard multiplexor



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

2014-04-29 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Apr 29 18:47:22 UTC 2014

Modified Files:
src/sys/arch/hp300/conf: RAMDISK

Log Message:
Disable options NVNODE, NBUF and BUFPAGES in the RAMDISK kernel.

These options were specified in the INSTALL kernel for 4MB machines,
but nowadays even the INSTALL kernel would not boot on such machines
and the RAMDISK kernel assumes the target machine has more memories.
Furthermore, these options makes extracting binary sets much slower
and also could cause wapbl_register_deallocation: out of resources
panic during extracting binaries into a 32GB SSD with 4KB fragments.

Should be pulled up to netbsd-6* branches.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/conf/RAMDISK

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

Modified files:

Index: src/sys/arch/hp300/conf/RAMDISK
diff -u src/sys/arch/hp300/conf/RAMDISK:1.13 src/sys/arch/hp300/conf/RAMDISK:1.14
--- src/sys/arch/hp300/conf/RAMDISK:1.13	Tue Nov 23 11:13:58 2010
+++ src/sys/arch/hp300/conf/RAMDISK	Tue Apr 29 18:47:22 2014
@@ -1,4 +1,4 @@
-# $NetBSD: RAMDISK,v 1.13 2010/11/23 11:13:58 hannken Exp $
+# $NetBSD: RAMDISK,v 1.14 2014/04/29 18:47:22 tsutsui Exp $
 #
 # RAMDISK machine description file
 #
@@ -7,6 +7,11 @@
 
 include 	arch/hp300/conf/INSTALL
 
+# These options for small RAM machines makes extracting binaries much slower.
+no options	NVNODE
+no options	NBUF
+no options	BUFPAGES
+
 # Enable the hooks used for initializing the root memory-disk.
 options 	MEMORY_DISK_HOOKS
 options 	MEMORY_DISK_IS_ROOT		# force root on memory disk



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

2014-04-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Apr 26 07:53:41 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/inst: version
src/sys/arch/hp300/stand/uboot: version

Log Message:
Bump versions to denote recent 425e related changes.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/inst/version
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/stand/uboot/version

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

Modified files:

Index: src/sys/arch/hp300/stand/inst/version
diff -u src/sys/arch/hp300/stand/inst/version:1.11 src/sys/arch/hp300/stand/inst/version:1.12
--- src/sys/arch/hp300/stand/inst/version:1.11	Sat Feb 12 05:09:15 2011
+++ src/sys/arch/hp300/stand/inst/version	Sat Apr 26 07:53:41 2014
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.11 2011/02/12 05:09:15 tsutsui Exp $
+$NetBSD: version,v 1.12 2014/04/26 07:53:41 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for HP-IB cartridge tapes
@@ -11,3 +11,4 @@ $NetBSD: version,v 1.11 2011/02/12 05:09
 1.9:	Change boot messages to replace build date and maker with kernrev.
 1.10:	Pull OpenBSD's ite driver reorganization.
 1.11:	Add support for framebuffers on HP362 and HP382.
+1.12:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.

Index: src/sys/arch/hp300/stand/uboot/version
diff -u src/sys/arch/hp300/stand/uboot/version:1.18 src/sys/arch/hp300/stand/uboot/version:1.19
--- src/sys/arch/hp300/stand/uboot/version:1.18	Sat Feb 12 05:09:15 2011
+++ src/sys/arch/hp300/stand/uboot/version	Sat Apr 26 07:53:41 2014
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.18 2011/02/12 05:09:15 tsutsui Exp $
+$NetBSD: version,v 1.19 2014/04/26 07:53:41 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for network booting
@@ -18,3 +18,4 @@ $NetBSD: version,v 1.18 2011/02/12 05:09
 1.16:	Change boot messages to replace build date and maker with kernrev.
 1.17:	Pull OpenBSD's ite driver reorganization.
 1.18:	Add support for framebuffers on HP362 and HP382.
+1.19:	Add and fix support for HP425e mcclock, sti framebuffer, apci and dnkbd.



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

2014-04-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Apr 10 18:10:09 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/common: apci.c

Log Message:
Fix a botch on switching from apci (and dca) to MI com(4) 10 years ago.

I.e. fix apci device address per FRODO_BASE macro change
in frodoreg.h rev 1.2.  Now bootloader works with serial console
on HP425e (which has only com at frodo).

Thanks to miod@openbsd for providing his 425e.


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/apci.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/apci.c
diff -u src/sys/arch/hp300/stand/common/apci.c:1.11 src/sys/arch/hp300/stand/common/apci.c:1.12
--- src/sys/arch/hp300/stand/common/apci.c:1.11	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/apci.c	Thu Apr 10 18:10:09 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: apci.c,v 1.11 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: apci.c,v 1.12 2014/04/10 18:10:09 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1999 The NetBSD Foundation, Inc.
@@ -85,7 +85,8 @@ void
 apciprobe(struct consdev *cp)
 {
 
-	apcicnaddr = (void *)IIOV(FRODO_BASE + FRODO_APCI_OFFSET(1));
+	apcicnaddr =
+	(void *)IIOV(INTIOBASE + FRODO_BASE + FRODO_APCI_OFFSET(1));
 
 	cp-cn_pri = CN_DEAD;
 



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

2014-03-26 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Wed Mar 26 17:55:26 UTC 2014

Modified Files:
src/sys/arch/hp300/dev: dio.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/hp300/dev/dio.c

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

Modified files:

Index: src/sys/arch/hp300/dev/dio.c
diff -u src/sys/arch/hp300/dev/dio.c:1.38 src/sys/arch/hp300/dev/dio.c:1.39
--- src/sys/arch/hp300/dev/dio.c:1.38	Sun Mar  6 09:51:21 2011
+++ src/sys/arch/hp300/dev/dio.c	Wed Mar 26 13:55:26 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $	*/
+/*	$NetBSD: dio.c,v 1.39 2014/03/26 17:55:26 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: dio.c,v 1.39 2014/03/26 17:55:26 christos Exp $);
 
 #define	_HP300_INTR_H_PRIVATE
 
@@ -263,7 +263,8 @@ dio_devinfo(struct dio_attach_args *da, 
 }
 			} else {
 			foundit:
-sprintf(buf, %s, dio_devdescs[i].dd_desc);
+snprintf(buf, buflen, %s,
+dio_devdescs[i].dd_desc);
 return buf;
 			}
 		}
@@ -273,7 +274,7 @@ dio_devinfo(struct dio_attach_args *da, 
 	/*
 	 * Device is unknown.  Construct something reasonable.
 	 */
-	sprintf(buf, device id = 0x%x secid = 0x%x,
+	snprintf(buf, buflen, device id = 0x%x secid = 0x%x,
 	da-da_id, da-da_secid);
 	return buf;
 }



CVS commit: src/sys/arch/hp300

2014-03-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Mar 24 19:42:58 UTC 2014

Modified Files:
src/sys/arch/hp300/dev: ct.c dcm.c diofb.c dmareg.h fhpib.c mt.c
nhpib.c rd.c
src/sys/arch/hp300/hp300: autoconf.c bus_space.c machdep.c

Log Message:
- remove unused
- use cpu_{g,s}etmodel


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/hp300/dev/ct.c
cvs rdiff -u -r1.84 -r1.85 src/sys/arch/hp300/dev/dcm.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp300/dev/diofb.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/dev/dmareg.h
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/hp300/dev/fhpib.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hp300/dev/mt.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/hp300/dev/nhpib.c
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.103 -r1.104 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp300/hp300/bus_space.c
cvs rdiff -u -r1.227 -r1.228 src/sys/arch/hp300/hp300/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/hp300/dev/ct.c
diff -u src/sys/arch/hp300/dev/ct.c:1.58 src/sys/arch/hp300/dev/ct.c:1.59
--- src/sys/arch/hp300/dev/ct.c:1.58	Sun Mar 16 01:20:24 2014
+++ src/sys/arch/hp300/dev/ct.c	Mon Mar 24 15:42:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: ct.c,v 1.58 2014/03/16 05:20:24 dholland Exp $	*/
+/*	$NetBSD: ct.c,v 1.59 2014/03/24 19:42:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -75,7 +75,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ct.c,v 1.58 2014/03/16 05:20:24 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: ct.c,v 1.59 2014/03/24 19:42:58 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -732,11 +732,10 @@ ctintr(void *arg)
 	struct ct_softc *sc = arg;
 	struct buf *bp;
 	uint8_t stat;
-	int ctlr, slave, unit;
+	int ctlr, slave;
 
 	ctlr = device_unit(device_parent(sc-sc_dev));
 	slave = sc-sc_slave;
-	unit = device_unit(sc-sc_dev);
 
 	bp = bufq_peek(sc-sc_tab);
 	if (bp == NULL) {

Index: src/sys/arch/hp300/dev/dcm.c
diff -u src/sys/arch/hp300/dev/dcm.c:1.84 src/sys/arch/hp300/dev/dcm.c:1.85
--- src/sys/arch/hp300/dev/dcm.c:1.84	Sun Mar 16 01:20:24 2014
+++ src/sys/arch/hp300/dev/dcm.c	Mon Mar 24 15:42:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dcm.c,v 1.84 2014/03/16 05:20:24 dholland Exp $	*/
+/*	$NetBSD: dcm.c,v 1.85 2014/03/24 19:42:58 christos Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dcm.c,v 1.84 2014/03/16 05:20:24 dholland Exp $);
+__KERNEL_RCSID(0, $NetBSD: dcm.c,v 1.85 2014/03/24 19:42:58 christos Exp $);
 
 #include opt_kgdb.h
 
@@ -1594,6 +1594,7 @@ dcmcngetc(dev_t dev)
 	c = fifo-data_char;
 	stat = fifo-data_stat;
 	pp-r_head = (head + 2)  RX_MASK;
+	__USE(stat);
 	splx(s);
 	return c;
 }
@@ -1621,7 +1622,7 @@ dcmcnputc(dev_t dev, int c)
 	}
 	tail = pp-t_tail  TX_MASK;
 	while (tail != (pp-t_head  TX_MASK))
-		;
+		continue;
 	dcm_cn-dcm_tfifos[3-DCMCONSPORT][tail].data_char = c;
 	pp-t_tail = tail = (tail + 1)  TX_MASK;
 	SEM_LOCK(dcm_cn);
@@ -1629,7 +1630,7 @@ dcmcnputc(dev_t dev, int c)
 	dcm_cn-dcm_cr |= (1  DCMCONSPORT);
 	SEM_UNLOCK(dcm_cn);
 	while (tail != (pp-t_head  TX_MASK))
-		;
+		continue;
 	/*
 	 * If board interrupts are enabled, just let our completion
 	 * interrupt through in case some other port on the board
@@ -1640,5 +1641,6 @@ dcmcnputc(dev_t dev, int c)
 		stat = dcm_cn-dcm_iir;
 		SEM_UNLOCK(dcm_cn);
 	}
+	__USE(stat);
 	splx(s);
 }

Index: src/sys/arch/hp300/dev/diofb.c
diff -u src/sys/arch/hp300/dev/diofb.c:1.3 src/sys/arch/hp300/dev/diofb.c:1.4
--- src/sys/arch/hp300/dev/diofb.c:1.3	Fri Feb 18 14:15:43 2011
+++ src/sys/arch/hp300/dev/diofb.c	Mon Mar 24 15:42:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofb.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
+/*	$NetBSD: diofb.c,v 1.4 2014/03/24 19:42:58 christos Exp $	*/
 /*	$OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $	*/
 
 /*
@@ -318,7 +318,7 @@ diofb_end_attach(device_t self, struct w
 
 	fb-scrlist[0] = fb-wsd;
 	fb-wsl.nscreens = 1;
-	fb-wsl.screens = (const struct wsscreen_descr **)fb-scrlist;
+	fb-wsl.screens = (void *)fb-scrlist;
 
 	waa.console = console;
 	waa.scrdata = fb-wsl;

Index: src/sys/arch/hp300/dev/dmareg.h
diff -u src/sys/arch/hp300/dev/dmareg.h:1.16 src/sys/arch/hp300/dev/dmareg.h:1.17
--- src/sys/arch/hp300/dev/dmareg.h:1.16	Wed Jul 19 13:21:23 2006
+++ src/sys/arch/hp300/dev/dmareg.h	Mon Mar 24 15:42:58 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: dmareg.h,v 1.16 2006/07/19 17:21:23 tsutsui Exp $	*/
+/*	$NetBSD: dmareg.h,v 1.17 2014/03/24 19:42:58 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990, 1993
@@ -108,7 +108,8 @@ struct	dmareg {
 #define	DMA_CLEAR(dc) do {	\
 		v_int dmaclr;	\
 		dmaclr = (int)dc-dm_Bhwaddr-dmaB_addr;	\
-	} while (0);
+		__USE(dmaclr);	\
+	} while 

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

2014-03-15 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 15 09:26:36 UTC 2014

Modified Files:
src/sys/arch/hp300/hp300: locore.s

Log Message:
Use common m68k/busaddrerr.s for bus error and address error handlers.

No binary changes on GENERIC.


To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.169 src/sys/arch/hp300/hp300/locore.s:1.170
--- src/sys/arch/hp300/hp300/locore.s:1.169	Sun Mar  9 16:28:43 2014
+++ src/sys/arch/hp300/hp300/locore.s	Sat Mar 15 09:26:36 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.169 2014/03/09 16:28:43 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.170 2014/03/15 09:26:36 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -621,192 +621,10 @@ Lnocache0:
  */
 #include m68k/m68k/trap_subr.s
 
-#if defined(M68040) || defined(M68060)
-ENTRY_NOPROFILE(addrerr4060)
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	movl	%sp@(FR_HW+8),%sp@-
-	clrl	%sp@-			| dummy code
-	movl	#T_ADDRERR,%sp@-	| mark address error
-	jra	_ASM_LABEL(faultstkadj)	| and deal with it
-#endif
-
-#if defined(M68060)
-ENTRY_NOPROFILE(buserr60)
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	movel	%sp@(FR_HW+12),%d0	| FSLW
-	btst	#2,%d0			| branch prediction error?
-	jeq	Lnobpe
-	movc	%cacr,%d2
-	orl	#IC60_CABC,%d2		| clear all branch cache entries
-	movc	%d2,%cacr
-	movl	%d0,%d1
-	andl	#0x7ffd,%d1
-	jeq	_ASM_LABEL(faultstkadjnotrap2)
-Lnobpe:
-| we need to adjust for misaligned addresses
-	movl	%sp@(FR_HW+8),%d1	| grab VA
-	btst	#27,%d0			| check for mis-aligned access
-	jeq	Lberr3			| no, skip
-	addl	#28,%d1			| yes, get into next page
-	| operand case: 3,
-	| instruction case: 4+12+12
-	andl	#PG_FRAME,%d1   | and truncate
-Lberr3:
-	movl	%d1,%sp@-
-	movl	%d0,%sp@-		| code is FSLW now.
-	andw	#0x1f80,%d0
-	jeq	Lberr60			| it is a bus error
-	movl	#T_MMUFLT,%sp@-		| show that we are an MMU fault
-	jra	_ASM_LABEL(faultstkadj)	| and deal with it
-Lberr60:
-	tstl	_C_LABEL(nofault)	| catch bus error?
-	jeq	Lisberr			| no, handle as usual
-	movl	_C_LABEL(nofault),%sp@-	| yes,
-	jbsr	_C_LABEL(longjmp)	|  longjmp(nofault)
-	/* NOTREACHED */
-#endif
-#if defined(M68040)
-ENTRY_NOPROFILE(buserr40)
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	movl	%sp@(FR_HW+20),%d1	| get fault address
-	moveq	#0,%d0
-	movw	%sp@(FR_HW+12),%d0	| get SSW
-	btst	#11,%d0			| check for mis-aligned
-	jeq	Lbe1stpg		| no skip
-	addl	#3,%d1			| get into next page
-	andl	#PG_FRAME,%d1		| and truncate
-Lbe1stpg:
-	movl	%d1,%sp@-		| pass fault address.
-	movl	%d0,%sp@-		| pass SSW as code
-	btst	#10,%d0			| test ATC
-	jeq	Lberr40			| it is a bus error
-	movl	#T_MMUFLT,%sp@-		| show that we are an MMU fault
-	jra	_ASM_LABEL(faultstkadj)	| and deal with it
-Lberr40:
-	tstl	_C_LABEL(nofault)	| catch bus error?
-	jeq	Lisberr			| no, handle as usual
-	movl	_C_LABEL(nofault),%sp@-	| yes,
-	jbsr	_C_LABEL(longjmp)	|  longjmp(nofault)
-	/* NOTREACHED */
-#endif
-
-#if defined(M68020) || defined(M68030)
-ENTRY_NOPROFILE(busaddrerr2030)
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save the user SP
-	movl	%a0,%sp@(FR_SP)		|   in the savearea
-	moveq	#0,%d0
-	movw	%sp@(FR_HW+10),%d0	| grab SSW for fault processing
-	btst	#12,%d0			| RB set?
-	jeq	LbeX0			| no, test RC
-	bset	#14,%d0			| yes, must set FB
-	movw	%d0,%sp@(FR_HW+10)	| for hardware too
-LbeX0:
-	btst	#13,%d0			| RC set?
-	jeq	LbeX1			| no, skip
-	bset	#15,%d0			| yes, must set FC
-	movw	%d0,%sp@(FR_HW+10)	| for hardware too
-LbeX1:
-	btst	#8,%d0			| data fault?
-	jeq	Lbe0			| no, check for hard cases
-	movl	%sp@(FR_HW+16),%d1	| fault address is as given in frame
-	jra	Lbe10			| thats it
-Lbe0:
-	btst	#4,%sp@(FR_HW+6)	| long (type B) stack frame?
-	jne	Lbe4			| yes, go handle
-	movl	%sp@(FR_HW+2),%d1	| no, can use save PC
-	btst	#14,%d0			| FB set?
-	jeq	Lbe3			| no, try FC
-	addql	#4,%d1			| yes, adjust address
-	jra	Lbe10			| done
-Lbe3:
-	btst	#15,%d0			| FC set?
-	jeq	Lbe10			| no, done
-	addql	#2,%d1			| yes, adjust address
-	jra	Lbe10			| done
-Lbe4:
-	movl	%sp@(FR_HW+36),%d1	| long format, use stage B address
-	btst	#15,%d0			| FC set?
-	jeq	Lbe10			| no, all done
-	subql	#2,%d1			| yes, adjust address
-Lbe10:
-	movl	%d1,%sp@-		| push fault VA
-	movl	%d0,%sp@-		| and padded SSW
-	movw	%sp@(FR_HW+8+6),%d0	| get frame format/vector offset
-	andw	#0x0FFF,%d0		| clear out frame format
-	cmpw	#12,%d0		

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

2014-01-10 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan 10 16:35:59 UTC 2014

Modified Files:
src/sys/arch/hp300/dev: Makefile

Log Message:
don't include bsd.sys.mk


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp300/dev/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/hp300/dev/Makefile
diff -u src/sys/arch/hp300/dev/Makefile:1.4 src/sys/arch/hp300/dev/Makefile:1.5
--- src/sys/arch/hp300/dev/Makefile:1.4	Tue Dec 28 05:15:49 2010
+++ src/sys/arch/hp300/dev/Makefile	Fri Jan 10 11:35:59 2014
@@ -1,7 +1,6 @@
-#	$NetBSD: Makefile,v 1.4 2010/12/28 10:15:49 tsutsui Exp $
+#	$NetBSD: Makefile,v 1.5 2014/01/10 16:35:59 christos Exp $
 
 .include bsd.own.mk
-.include bsd.sys.mk
 
 diodevs.h diodevs_data.h: diodevs devlist2h.awk
 	/bin/rm -f diodevs.h diodevs_data.h



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

2014-01-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jan  2 17:43:33 UTC 2014

Modified Files:
src/sys/arch/hp300/stand/common: scsi.c

Log Message:
Change the SCSI select timeout from 2ms to 250ms as kernel spc(4) driver does.

Noticed by miod@openbsd.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/scsi.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/scsi.c
diff -u src/sys/arch/hp300/stand/common/scsi.c:1.10 src/sys/arch/hp300/stand/common/scsi.c:1.11
--- src/sys/arch/hp300/stand/common/scsi.c:1.10	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/scsi.c	Thu Jan  2 17:43:32 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: scsi.c,v 1.10 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: scsi.c,v 1.11 2014/01/02 17:43:32 tsutsui Exp $	*/
 
 /*
  * This is reported to fix some odd failures when disklabeling
@@ -181,10 +181,10 @@ issue_select(volatile struct scsidevice 
 
 	hd-scsi_pctl = 0;
 	hd-scsi_temp = (1  target) | our_addr;
-	/* select timeout is hardcoded to 2ms */
-	hd-scsi_tch = 0;
-	hd-scsi_tcm = 32;
-	hd-scsi_tcl = 4;
+	/* select timeout is hardcoded to 250ms */
+	hd-scsi_tch = 2;
+	hd-scsi_tcm = 113;
+	hd-scsi_tcl = 3;
 
 	hd-scsi_scmd = SCMD_SELECT;
 	return 0;



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

2013-09-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Sep 21 06:24:43 UTC 2013

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

Log Message:
Fix a build error on a kernel config without 68040 machines.

Reported by Andrew Gillham on port-hp300@:
http://mail-index.NetBSD.org/port-hp300/2013/09/09/msg77.html
(I removed defined(68060) since hp300 doesn't have it)

Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/hp300/hp300/pmap_bootstrap.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/pmap_bootstrap.c
diff -u src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.57 src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.58
--- src/sys/arch/hp300/hp300/pmap_bootstrap.c:1.57	Fri Feb 10 06:28:39 2012
+++ src/sys/arch/hp300/hp300/pmap_bootstrap.c	Sat Sep 21 06:24:43 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.57 2012/02/10 06:28:39 mhitch Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.58 2013/09/21 06:24:43 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.57 2012/02/10 06:28:39 mhitch Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.58 2013/09/21 06:24:43 tsutsui Exp $);
 
 #include sys/param.h
 #include uvm/uvm_extern.h
@@ -411,8 +411,10 @@ pmap_bootstrap(paddr_t nextpa, paddr_t f
 	 */
 	RELOC(Sysseg, st_entry_t *) = (st_entry_t *)(kstpa - firstpa);
 	RELOC(Sysseg_pa, paddr_t) = kstpa;
+#if defined(M68040)
 	if (RELOC(mmutype, int) == MMU_68040)
 		RELOC(protostfree, u_int) = stfree;
+#endif
 	/*
 	 * Sysptmap: base of kernel page table map
 	 */



CVS commit: src/sys/arch/hp300

2013-08-16 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Aug 16 13:39:47 UTC 2013

Modified Files:
src/sys/arch/hp300/conf: GENERIC files.hp300
src/sys/arch/hp300/hp300: locore.s machdep.c trap.c

Log Message:
Make FPU_EMULATE work on NetBSD/hp300.  Commented out by default in GENERIC.

Tested on HP9000/362 without optional MC68882 FPU in its socket.


To generate a diff of this commit:
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.85 -r1.86 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.226 -r1.227 src/sys/arch/hp300/hp300/machdep.c
cvs rdiff -u -r1.149 -r1.150 src/sys/arch/hp300/hp300/trap.c

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

Modified files:

Index: src/sys/arch/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.179 src/sys/arch/hp300/conf/GENERIC:1.180
--- src/sys/arch/hp300/conf/GENERIC:1.179	Sun Jun 30 21:38:57 2013
+++ src/sys/arch/hp300/conf/GENERIC	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.179 2013/06/30 21:38:57 rmind Exp $
+# $NetBSD: GENERIC,v 1.180 2013/08/16 13:39:47 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	arch/hp300/conf/std.hp300
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.179 $
+#ident 		GENERIC-$Revision: 1.180 $
 
 maxusers	32		# estimated number of users
 
@@ -43,6 +43,7 @@ options 	HP400
 options 	HP425
 options 	HP433
 options 	FPSP		# floating point interface for 68040
+#options 	FPU_EMULATE	# software fpu emulation for MC68030
 
 # Standard system options
 options 	KTRACE		# system call tracing support

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.85 src/sys/arch/hp300/conf/files.hp300:1.86
--- src/sys/arch/hp300/conf/files.hp300:1.85	Sun Jun 12 03:35:40 2011
+++ src/sys/arch/hp300/conf/files.hp300	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.85 2011/06/12 03:35:40 rmind Exp $
+#	$NetBSD: files.hp300,v 1.86 2013/08/16 13:39:47 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -208,6 +208,7 @@ file	arch/hp300/hp300/trap.c
 file	arch/hp300/hp300/disksubr.c
 file	arch/m68k/m68k/cacheops.c
 file	arch/m68k/m68k/db_memrw.c		ddb | kgdb
+file	arch/m68k/m68k/fpu.c
 file	arch/m68k/m68k/kgdb_machdep.c		kgdb
 file	arch/m68k/m68k/pmap_motorola.c
 file	arch/m68k/m68k/procfs_machdep.c		procfs
@@ -216,6 +217,10 @@ file	arch/m68k/m68k/vm_machdep.c
 
 file	dev/cons.c
 
+# Emulation modules
+# 6888x emulator (FPU_EMULATE)
+include arch/m68k/fpe/files.fpe
+
 # NetBSD m68k a.out Binary Compatibility (COMPAT_AOUT_M68K)
 include	compat/aoutm68k/files.aoutm68k
 

Index: src/sys/arch/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.165 src/sys/arch/hp300/hp300/locore.s:1.166
--- src/sys/arch/hp300/hp300/locore.s:1.165	Thu Dec 22 15:33:29 2011
+++ src/sys/arch/hp300/hp300/locore.s	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.165 2011/12/22 15:33:29 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.166 2013/08/16 13:39:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -576,6 +576,8 @@ Lenab1:
 	movl	#USRSTACK-4,%a2
 	movl	%a2,%usp		| init user SP
 
+	jbsr	_C_LABEL(fpu_probe)
+	movl	%d0,_C_LABEL(fputype)
 	tstl	_C_LABEL(fputype)	| Have an FPU?
 	jeq	Lenab2			| No, skip.
 	clrl	%a1@(PCB_FPCTX)		| ensure null FP context

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.226 src/sys/arch/hp300/hp300/machdep.c:1.227
--- src/sys/arch/hp300/hp300/machdep.c:1.226	Fri Aug 10 12:29:59 2012
+++ src/sys/arch/hp300/hp300/machdep.c	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $	*/
+/*	$NetBSD: machdep.c,v 1.227 2013/08/16 13:39:47 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,10 +39,11 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.227 2013/08/16 13:39:47 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
+#include opt_fpu_emulate.h
 #include opt_modular.h
 #include opt_panicbutton.h
 
@@ -447,6 +448,13 @@ identifycpu(void)
 		len += sprintf(cpu_model + len, , %sMHz MC68881 FPU,
 		machineid == HP_350 ? 20 : 16.67);
 		break;
+	case FPU_NONE:
+#ifdef FPU_EMULATE
+		len += sprintf(cpu_model + len, , emulated FPU);
+#else
+		len += sprintf(cpu_model + len, , no FPU);
+#endif
+		break;
 	default:
 		len += sprintf(cpu_model + len, , unknown FPU);
 	}

Index: src/sys/arch/hp300/hp300/trap.c
diff -u src/sys/arch/hp300/hp300/trap.c:1.149 src/sys/arch/hp300/hp300/trap.c:1.150
--- src/sys/arch/hp300/hp300/trap.c:1.149	Sun Feb 19 21:06:07 2012
+++ src/sys/arch/hp300/hp300/trap.c	Fri Aug 16 13:39:47 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: 

CVS commit: src/sys/arch/hp300

2013-01-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 11 12:03:04 UTC 2013

Modified Files:
src/sys/arch/hp300/conf: GENERIC
src/sys/arch/hp300/hp300: autoconf.c
Added Files:
src/sys/arch/hp300/dev: sti_sgc.c

Log Message:
Add sti at sgc framebuffer.
Ported from OpenBSD by kiyohara@.


To generate a diff of this commit:
cvs rdiff -u -r1.172 -r1.173 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/dev/sti_sgc.c
cvs rdiff -u -r1.101 -r1.102 src/sys/arch/hp300/hp300/autoconf.c

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

Modified files:

Index: src/sys/arch/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.172 src/sys/arch/hp300/conf/GENERIC:1.173
--- src/sys/arch/hp300/conf/GENERIC:1.172	Wed Oct 17 14:48:12 2012
+++ src/sys/arch/hp300/conf/GENERIC	Fri Jan 11 12:03:03 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.172 2012/10/17 14:48:12 apb Exp $
+# $NetBSD: GENERIC,v 1.173 2013/01/11 12:03:03 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@ include 	arch/hp300/conf/std.hp300
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.172 $
+#ident 		GENERIC-$Revision: 1.173 $
 
 maxusers	32		# estimated number of users
 
@@ -196,7 +196,7 @@ mainbus0	at root			# root bus
 
 intio0		at mainbus0		# internal i/o space
 dio0		at mainbus0		# DIO/DIO-II bus
-#sgc0		at mainbus0		# SGC bus
+sgc0		at mainbus0		# SGC bus
 
 # Human Interface Loop devices
 hil0		at intio?		# HIL controller
@@ -242,8 +242,8 @@ wsdisplay*	at tvrx?
 gendiofb*	at dio? scode ?		# dumb framebuffer support for 362/382
 wsdisplay*	at gendiofb?
 
-#sti*		at sgc?	slot ?		# SGC EVRX framebuffers
-#wsdisplay*	at sti?
+sti*		at sgc?	slot ?		# SGC EVRX framebuffers
+wsdisplay*	at sti?
 
 com0		at dio0 scode 9		# DCA serial interfaces
 com*		at dio? scode ?

Index: src/sys/arch/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.101 src/sys/arch/hp300/hp300/autoconf.c:1.102
--- src/sys/arch/hp300/hp300/autoconf.c:1.101	Sat Oct 13 06:12:23 2012
+++ src/sys/arch/hp300/hp300/autoconf.c	Fri Jan 11 12:03:04 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.101 2012/10/13 06:12:23 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.102 2013/01/11 12:03:04 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.101 2012/10/13 06:12:23 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.102 2013/01/11 12:03:04 tsutsui Exp $);
 
 #include dvbox.h
 #include gbox.h
@@ -827,7 +827,10 @@ hp300_cninit(void)
 		goto find_kbd;
 #endif
 
+#if (NDVBOX + NGBOX + NRBOX + NTOPCAT + NDVBOX + NGBOX + NHYPER + NRBOX + \
+ NTOPCAT + NTVRX + NGENDIOFB)  0
 find_kbd:
+#endif
 
 #if NDNKBD  0
 	dnkbdcnattach(bst, FRODO_BASE + FRODO_APCI_OFFSET(0))

Added files:

Index: src/sys/arch/hp300/dev/sti_sgc.c
diff -u /dev/null src/sys/arch/hp300/dev/sti_sgc.c:1.1
--- /dev/null	Fri Jan 11 12:03:04 2013
+++ src/sys/arch/hp300/dev/sti_sgc.c	Fri Jan 11 12:03:03 2013
@@ -0,0 +1,138 @@
+/*	$NetBSD: sti_sgc.c,v 1.1 2013/01/11 12:03:03 tsutsui Exp $	*/
+/*	$OpenBSD: sti_sgc.c,v 1.14 2007/05/26 00:36:03 krw Exp $	*/
+
+/*
+ * Copyright (c) 2005, Miodrag Vallat
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+#include sys/cdefs.h
+__KERNEL_RCSID(0, $NetBSD: sti_sgc.c,v 1.1 2013/01/11 12:03:03 tsutsui Exp $);
+
+#include sys/param.h
+#include sys/device.h
+#include sys/bus.h
+
+#include uvm/uvm_extern.h
+
+#include dev/wscons/wsdisplayvar.h
+
+#include dev/ic/stireg.h
+#include dev/ic/stivar.h
+
+#include hp300/dev/sgcvar.h
+
+static int 

CVS commit: src/sys/arch/hp300

2012-10-13 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Oct 13 06:12:23 UTC 2012

Modified Files:
src/sys/arch/hp300/dev: hpib.c hpibvar.h rd.c
src/sys/arch/hp300/hp300: autoconf.c

Log Message:
struct device * - device_t, struct cfdata * - cfdata_t
use device_xname()  (from chs@)


To generate a diff of this commit:
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/hp300/dev/hpib.c
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/hp300/dev/hpibvar.h
cvs rdiff -u -r1.92 -r1.93 src/sys/arch/hp300/dev/rd.c
cvs rdiff -u -r1.100 -r1.101 src/sys/arch/hp300/hp300/autoconf.c

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

Modified files:

Index: src/sys/arch/hp300/dev/hpib.c
diff -u src/sys/arch/hp300/dev/hpib.c:1.38 src/sys/arch/hp300/dev/hpib.c:1.39
--- src/sys/arch/hp300/dev/hpib.c:1.38	Fri Jun 13 09:41:15 2008
+++ src/sys/arch/hp300/dev/hpib.c	Sat Oct 13 06:12:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpib.c,v 1.38 2008/06/13 09:41:15 cegger Exp $	*/
+/*	$NetBSD: hpib.c,v 1.39 2012/10/13 06:12:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: hpib.c,v 1.38 2008/06/13 09:41:15 cegger Exp $);
+__KERNEL_RCSID(0, $NetBSD: hpib.c,v 1.39 2012/10/13 06:12:23 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -267,7 +267,7 @@ hpibreset(int unit)
 }
 
 int
-hpibreq(struct device *pdev, struct hpibqueue *hq)
+hpibreq(device_t pdev, struct hpibqueue *hq)
 {
 	struct hpibbus_softc *sc = device_private(pdev);
 	int s;
@@ -283,7 +283,7 @@ hpibreq(struct device *pdev, struct hpib
 }
 
 void
-hpibfree(struct device *pdev, struct hpibqueue *hq)
+hpibfree(device_t pdev, struct hpibqueue *hq)
 {
 	struct hpibbus_softc *sc = device_private(pdev);
 	int s;

Index: src/sys/arch/hp300/dev/hpibvar.h
diff -u src/sys/arch/hp300/dev/hpibvar.h:1.20 src/sys/arch/hp300/dev/hpibvar.h:1.21
--- src/sys/arch/hp300/dev/hpibvar.h:1.20	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/dev/hpibvar.h	Sat Oct 13 06:12:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: hpibvar.h,v 1.20 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: hpibvar.h,v 1.21 2012/10/13 06:12:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -206,8 +206,8 @@ void	hpibawait(int);
 int	hpibswait(int, int);
 int	hpibid(int, int);
 
-int	hpibreq(struct device *, struct hpibqueue *);
-void	hpibfree(struct device *, struct hpibqueue *);
+int	hpibreq(device_t, struct hpibqueue *);
+void	hpibfree(device_t, struct hpibqueue *);
 
 int	hpibintr(void *);
 int	hpibdevprint(void *, const char *);

Index: src/sys/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.92 src/sys/arch/hp300/dev/rd.c:1.93
--- src/sys/arch/hp300/dev/rd.c:1.92	Thu Feb  2 19:42:59 2012
+++ src/sys/arch/hp300/dev/rd.c	Sat Oct 13 06:12:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.92 2012/02/02 19:42:59 tls Exp $	*/
+/*	$NetBSD: rd.c,v 1.93 2012/10/13 06:12:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rd.c,v 1.92 2012/02/02 19:42:59 tls Exp $);
+__KERNEL_RCSID(0, $NetBSD: rd.c,v 1.93 2012/10/13 06:12:23 tsutsui Exp $);
 
 #include opt_useleds.h
 
@@ -245,7 +245,7 @@ static const struct rdidentinfo rdidenti
 };
 static const int numrdidentinfo = __arraycount(rdidentinfo);
 
-static int	rdident(struct device *, struct rd_softc *,
+static int	rdident(device_t, struct rd_softc *,
 		struct hpibbus_attach_args *);
 static void	rdreset(struct rd_softc *);
 static void	rdustart(struct rd_softc *);

Index: src/sys/arch/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.100 src/sys/arch/hp300/hp300/autoconf.c:1.101
--- src/sys/arch/hp300/hp300/autoconf.c:1.100	Sun Jul 29 18:05:43 2012
+++ src/sys/arch/hp300/hp300/autoconf.c	Sat Oct 13 06:12:23 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.100 2012/07/29 18:05:43 mlelstv Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.101 2012/10/13 06:12:23 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.100 2012/07/29 18:05:43 mlelstv Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.101 2012/10/13 06:12:23 tsutsui Exp $);
 
 #include dvbox.h
 #include gbox.h
@@ -209,7 +209,7 @@ int extio_ex_malloc_safe;
 struct dev_data {
 	LIST_ENTRY(dev_data)	dd_list;  /* dev_data_list */
 	LIST_ENTRY(dev_data)	dd_clist; /* ctlr list */
-	struct device		*dd_dev;  /* device described by this entry */
+	device_t		dd_dev;  /* device described by this entry */
 	int			dd_scode; /* select code of device */
 	int			dd_slave; /* ...or slave */
 	int			dd_punit; /* and punit... */
@@ -223,7 +223,7 @@ static void	findbootdev(void);
 static void	findbootdev_slave(ddlist_t *, int, int, int);
 static void	setbootdev(void);
 
-static struct dev_data 

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

2012-08-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Aug 10 12:29:59 UTC 2012

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

Log Message:
Appease gcc -fno-common:
 - remove initialzation of physmem since it's properly initialized
   before pmap_bootstrap() using a value passed from bootloader and
   sanity possible maximum value is not necessary
Tested on HP382.


To generate a diff of this commit:
cvs rdiff -u -r1.225 -r1.226 src/sys/arch/hp300/hp300/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/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.225 src/sys/arch/hp300/hp300/machdep.c:1.226
--- src/sys/arch/hp300/hp300/machdep.c:1.225	Fri Jul 27 05:36:10 2012
+++ src/sys/arch/hp300/hp300/machdep.c	Fri Aug 10 12:29:59 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.225 2012/07/27 05:36:10 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.225 2012/07/27 05:36:10 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.226 2012/08/10 12:29:59 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -129,7 +129,6 @@ paddr_t	bootinfo_pa;
 vaddr_t	bootinfo_va;
 
 int	maxmem;			/* max memory per process */
-int	physmem = MAXMEM;	/* max supported memory, changes to actual */
 
 extern	u_int lowram;
 extern	short exframesize[];



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

2012-07-26 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Jul 26 17:15:22 UTC 2012

Modified Files:
src/sys/arch/hp300/stand/common: if_lereg.h

Log Message:
Remove '__attribute__((__packed__))' from structure definisions
for Am7990 LANCE registers where no implicit padding is expected.

gcc 4.5.3 seems to generate strange and wrong instructions
(four moveb insns against u_short members) if packed attribute
is specified in this case, then netboot fails immediately.

Should be pulled up to netbsd-6.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/hp300/stand/common/if_lereg.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/hp300/stand/common/if_lereg.h
diff -u src/sys/arch/hp300/stand/common/if_lereg.h:1.5 src/sys/arch/hp300/stand/common/if_lereg.h:1.6
--- src/sys/arch/hp300/stand/common/if_lereg.h:1.5	Sun Dec 11 12:17:19 2005
+++ src/sys/arch/hp300/stand/common/if_lereg.h	Thu Jul 26 17:15:22 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_lereg.h,v 1.5 2005/12/11 12:17:19 christos Exp $	*/
+/*	$NetBSD: if_lereg.h,v 1.6 2012/07/26 17:15:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -50,7 +50,7 @@ struct lereg0 {
 	vu_char	ler0_id;	/* ID */
 	u_char	ler0_pad1;
 	vu_char	ler0_status;	/* interrupt enable/status */
-} __attribute__((__packed__));
+};
 
 /*
  * Control and status bits -- lereg0
@@ -65,7 +65,7 @@ struct lereg0 {
 struct lereg1 {
 	vu_short	ler1_rdp;	/* data port */
 	vu_short	ler1_rap;	/* register select port */
-} __attribute__((__packed__));
+};
 
 /*
  * Control and status bits -- lereg1



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

2011-11-05 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Nov  5 15:21:43 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: locore.s

Log Message:
bgt - jgt for a short jump.


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.161 src/sys/arch/hp300/hp300/locore.s:1.162
--- src/sys/arch/hp300/hp300/locore.s:1.161	Fri Nov  4 17:53:51 2011
+++ src/sys/arch/hp300/hp300/locore.s	Sat Nov  5 15:21:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.161 2011/11/04 17:53:51 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.162 2011/11/05 15:21:43 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -988,7 +988,7 @@ Lkbrkpt: | Kernel-mode breakpoint or tra
 Lbrkpt1:
 	movl	%a0@+,%a1@+
 	subql	#4,%d1
-	bgt	Lbrkpt1
+	jgt	Lbrkpt1
 
 Lbrkpt2:
 	| Call the trap handler for the kernel debugger.



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

2011-11-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Nov  4 17:53:51 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: locore.s

Log Message:
Fix indent and some comments.


To generate a diff of this commit:
cvs rdiff -u -r1.160 -r1.161 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.160 src/sys/arch/hp300/hp300/locore.s:1.161
--- src/sys/arch/hp300/hp300/locore.s:1.160	Thu Nov  3 15:13:02 2011
+++ src/sys/arch/hp300/hp300/locore.s	Fri Nov  4 17:53:51 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.160 2011/11/03 15:13:02 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.161 2011/11/04 17:53:51 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -566,11 +566,11 @@ Lehighcode:
  * Should be running mapped from this point on
  */
 Lenab1:
-	lea	_ASM_LABEL(tmpstk),%sp		| temporary stack
+	lea	_ASM_LABEL(tmpstk),%sp	| temporary stack
 /* call final pmap setup */
 	jbsr	_C_LABEL(pmap_bootstrap_finalize)
 /* set kernel stack, user SP */
-	movl	_C_LABEL(lwp0uarea),%a1	|
+	movl	_C_LABEL(lwp0uarea),%a1	| get lwp0 uarea
 	lea	%a1@(USPACE-4),%sp	| set kernel stack to end of area
 	movl	#USRSTACK-4,%a2
 	movl	%a2,%usp		| init user SP
@@ -630,7 +630,7 @@ ENTRY_NOPROFILE(addrerr4060)
 	movl	%a0,%sp@(FR_SP)		|   in the savearea
 	movl	%sp@(FR_HW+8),%sp@-
 	clrl	%sp@-			| dummy code
-	movl	#T_ADDRERR,%sp@-		| mark address error
+	movl	#T_ADDRERR,%sp@-	| mark address error
 	jra	_ASM_LABEL(faultstkadj)	| and deal with it
 #endif
 
@@ -780,7 +780,7 @@ Lismerr:
 Lmightnotbemerr:
 	btst	#3,%d1			| write protect bit set?
 	jeq	Lisberr1		| no: must be bus error
-	movl	%sp@,%d0			| ssw into low word of %d0
+	movl	%sp@,%d0		| ssw into low word of %d0
 	andw	#0xc0,%d0		| Write protect is set on page:
 	cmpw	#0x40,%d0		| was it read cycle?
 	jne	Lismerr			| no, was not WPE, must be MMU fault
@@ -982,7 +982,7 @@ Lkbrkpt: | Kernel-mode breakpoint or tra
 	jls	Lbrkpt2			| already on tmpstk
 	| Copy frame to the temporary stack
 	movl	%sp,%a0			| %a0=src
-	lea	_ASM_LABEL(tmpstk)-96,%a1 | a1=dst
+	lea	_ASM_LABEL(tmpstk)-96,%a1 | %a1=dst
 	movl	%a1,%sp			| %sp=new frame
 	moveq	#FR_SIZE,%d1
 Lbrkpt1:
@@ -1258,7 +1258,7 @@ Lslerr:
 	moveq	#-1,%d0
 Lsldone:
 	movl	_C_LABEL(curpcb),%a1	| current pcb
-	clrl	%a1@(PCB_ONFAULT) 	| clear fault address
+	clrl	%a1@(PCB_ONFAULT)	| clear fault address
 	rts
 #endif
 
@@ -1379,7 +1379,7 @@ ENTRY(m68881_save)
 	tstb	%a0@			| null state frame?
 	jeq	Lm68881sdone		| yes, all done
 	fmovem	%fp0-%fp7,%a0@(FPF_REGS) | save FP general registers
-	fmovem	%fpcr/%fpsr/%fpi,%a0@(FPF_FPCR)	| save FP control registers
+	fmovem	%fpcr/%fpsr/%fpi,%a0@(FPF_FPCR) | save FP control registers
 Lm68881sdone:
 	rts
 
@@ -1387,7 +1387,7 @@ ENTRY(m68881_restore)
 	movl	%sp@(4),%a0		| save area pointer
 	tstb	%a0@			| null state frame?
 	jeq	Lm68881rdone		| yes, easy
-	fmovem	%a0@(FPF_FPCR),%fpcr/%fpsr/%fpi	| restore FP control registers
+	fmovem	%a0@(FPF_FPCR),%fpcr/%fpsr/%fpi | restore FP control registers
 	fmovem	%a0@(FPF_REGS),%fp0-%fp7 | restore FP general registers
 Lm68881rdone:
 	frestore %a0@			| restore state



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

2011-11-03 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Nov  3 15:13:02 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: locore.s

Log Message:
unifdef __ELF__


To generate a diff of this commit:
cvs rdiff -u -r1.159 -r1.160 src/sys/arch/hp300/hp300/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/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.159 src/sys/arch/hp300/hp300/locore.s:1.160
--- src/sys/arch/hp300/hp300/locore.s:1.159	Sun Mar  6 14:51:21 2011
+++ src/sys/arch/hp300/hp300/locore.s	Thu Nov  3 15:13:02 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.159 2011/03/06 14:51:21 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.160 2011/11/03 15:13:02 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -1364,11 +1364,7 @@ ENTRY_NOPROFILE(_delay)
 	 * operations and that the loop will run from a single cache
 	 * half-line.
 	 */
-#ifdef __ELF__
 	.align	8
-#else
-	.align	3
-#endif
 L_delay:
 	subl	%d1,%d0
 	jgt	L_delay



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

2011-07-27 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Thu Jul 28 03:42:21 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: ppi.c rd.c

Log Message:
dev_t is uint64_t; use PRIx64 to print it.  Fix DEBUG build.


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/hp300/dev/ppi.c
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/hp300/dev/rd.c

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

Modified files:

Index: src/sys/arch/hp300/dev/ppi.c
diff -u src/sys/arch/hp300/dev/ppi.c:1.42 src/sys/arch/hp300/dev/ppi.c:1.43
--- src/sys/arch/hp300/dev/ppi.c:1.42	Wed Jun 18 12:25:13 2008
+++ src/sys/arch/hp300/dev/ppi.c	Thu Jul 28 03:42:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ppi.c,v 1.42 2008/06/18 12:25:13 tsutsui Exp $	*/
+/*	$NetBSD: ppi.c,v 1.43 2011/07/28 03:42:20 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ppi.c,v 1.42 2008/06/18 12:25:13 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: ppi.c,v 1.43 2011/07/28 03:42:20 uebayasi Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -206,7 +206,7 @@
 
 #ifdef DEBUG
 	if (ppidebug  PDB_FOLLOW)
-		printf(ppiopen(%x, %x): flags %x\n,
+		printf(ppiopen(%PRIx64, %x): flags %x\n,
 		   dev, flags, sc-sc_flags);
 #endif
 	if (sc-sc_flags  PPIF_OPEN)
@@ -226,7 +226,7 @@
 
 #ifdef DEBUG
 	if (ppidebug  PDB_FOLLOW)
-		printf(ppiclose(%x, %x): flags %x\n,
+		printf(ppiclose(%PRIx64, %x): flags %x\n,
 		   dev, flags, sc-sc_flags);
 #endif
 	sc-sc_flags = ~PPIF_OPEN;
@@ -265,7 +265,7 @@
 
 #ifdef DEBUG
 	if (ppidebug  PDB_FOLLOW)
-		printf(ppiread(%x, %p)\n, dev, uio);
+		printf(ppiread(%PRIx64, %p)\n, dev, uio);
 #endif
 	return ppirw(dev, uio);
 }
@@ -276,7 +276,7 @@
 
 #ifdef DEBUG
 	if (ppidebug  PDB_FOLLOW)
-		printf(ppiwrite(%x, %p)\n, dev, uio);
+		printf(ppiwrite(%PRIx64, %p)\n, dev, uio);
 #endif
 	return ppirw(dev, uio);
 }
@@ -299,7 +299,7 @@
 
 #ifdef DEBUG
 	if (ppidebug  (PDB_FOLLOW|PDB_IO))
-		printf(ppirw(%x, %p, %c): burst %d, timo %d, resid %x\n,
+		printf(ppirw(%PRIx64, %p, %c): burst %d, timo %d, resid %x\n,
 		   dev, uio, uio-uio_rw == UIO_READ ? 'R' : 'W',
 		   sc-sc_burst, sc-sc_timo, uio-uio_resid);
 #endif

Index: src/sys/arch/hp300/dev/rd.c
diff -u src/sys/arch/hp300/dev/rd.c:1.90 src/sys/arch/hp300/dev/rd.c:1.91
--- src/sys/arch/hp300/dev/rd.c:1.90	Tue Feb  8 20:20:13 2011
+++ src/sys/arch/hp300/dev/rd.c	Thu Jul 28 03:42:20 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rd.c,v 1.90 2011/02/08 20:20:13 rmind Exp $	*/
+/*	$NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: rd.c,v 1.90 2011/02/08 20:20:13 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: rd.c,v 1.91 2011/07/28 03:42:20 uebayasi Exp $);
 
 #include opt_useleds.h
 #include rnd.h
@@ -657,7 +657,7 @@
 
 #ifdef DEBUG
 	if (rddebug  RDB_FOLLOW)
-		printf(rdstrategy(%p): dev %x, bn %llx, bcount %x, %c\n,
+		printf(rdstrategy(%p): dev %PRIx64, bn %llx, bcount %x, %c\n,
 		   bp, bp-b_dev, bp-b_blkno, bp-b_bcount,
 		   (bp-b_flags  B_READ) ? 'R' : 'W');
 #endif



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

2011-05-21 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat May 21 12:06:14 UTC 2011

Modified Files:
src/sys/arch/hp300/conf: GENERIC files.hp300

Log Message:
Add sti at sgc configuration for SGC EVRX framebuffers found on
some later HP4xx models.  Untested, and disabled in GENERIC for now.


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.83 -r1.84 src/sys/arch/hp300/conf/files.hp300

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

Modified files:

Index: src/sys/arch/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.165 src/sys/arch/hp300/conf/GENERIC:1.166
--- src/sys/arch/hp300/conf/GENERIC:1.165	Sun Mar  6 17:08:24 2011
+++ src/sys/arch/hp300/conf/GENERIC	Sat May 21 12:06:14 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.165 2011/03/06 17:08:24 bouyer Exp $
+# $NetBSD: GENERIC,v 1.166 2011/05/21 12:06:14 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.165 $
+#ident 		GENERIC-$Revision: 1.166 $
 
 maxusers	32		# estimated number of users
 
@@ -241,6 +241,9 @@
 gendiofb*	at dio? scode ?		# dumb framebuffer support for 362/382
 wsdisplay*	at gendiofb?
 
+#sti*		at sgc?	slot ?		# SGC EVRX framebuffers
+#wsdisplay*	at sti?
+
 com0		at dio0 scode 9		# DCA serial interfaces
 com*		at dio? scode ?
 

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.83 src/sys/arch/hp300/conf/files.hp300:1.84
--- src/sys/arch/hp300/conf/files.hp300:1.83	Fri Feb 18 16:06:20 2011
+++ src/sys/arch/hp300/conf/files.hp300	Sat May 21 12:06:14 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.83 2011/02/18 16:06:20 tsutsui Exp $
+#	$NetBSD: files.hp300,v 1.84 2011/05/21 12:06:14 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -182,6 +182,13 @@
 attach	spc at dio
 file	arch/hp300/dev/spc.c		spc needs-flag
 
+#
+# Devices on the SGC bus
+#
+
+attach	sti at sgc with sti_sgc
+file	arch/hp300/dev/sti_sgc.c	sti_sgc
+
 # Memory Disk for ramdisk
 file	dev/md_root.c			memory_disk_hooks
 



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

2011-05-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue May 10 14:38:08 UTC 2011

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

Log Message:
Move intr_init() call from early hp300_init() to cpu_configure(9)
since interrupt functions would want evcnt(9).


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.219 -r1.220 src/sys/arch/hp300/hp300/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/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.97 src/sys/arch/hp300/hp300/autoconf.c:1.98
--- src/sys/arch/hp300/hp300/autoconf.c:1.97	Sat Feb 12 05:08:40 2011
+++ src/sys/arch/hp300/hp300/autoconf.c	Tue May 10 14:38:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.97 2011/02/12 05:08:40 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.97 2011/02/12 05:08:40 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.98 2011/05/10 14:38:08 tsutsui Exp $);
 
 #include dvbox.h
 #include gbox.h
@@ -282,6 +282,9 @@
 	/* Kick off autoconfiguration. */
 	(void)splhigh();
 
+	/* Initialize the interrupt handlers. */
+	intr_init();
+
 	if (config_rootfound(mainbus, NULL) == NULL)
 		panic(no mainbus found);
 

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.219 src/sys/arch/hp300/hp300/machdep.c:1.220
--- src/sys/arch/hp300/hp300/machdep.c:1.219	Fri Mar  4 22:25:25 2011
+++ src/sys/arch/hp300/hp300/machdep.c	Tue May 10 14:38:08 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.219 2011/03/04 22:25:25 joerg Exp $	*/
+/*	$NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.219 2011/03/04 22:25:25 joerg Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.220 2011/05/10 14:38:08 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -203,9 +203,6 @@
 	uvm_page_physload(atop(avail_start), atop(avail_end),
 	atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT);
 
-	/* Initialize the interrupt handlers. */
-	intr_init();
-
 	/* Calibrate the delay loop. */
 	hp300_calibrate_delay();
 



CVS commit: src/sys/arch/hp300

2011-03-06 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Mar  6 14:51:22 UTC 2011

Modified Files:
src/sys/arch/hp300/conf: majors.hp300
src/sys/arch/hp300/dev: dio.c dioreg.h mtreg.h
src/sys/arch/hp300/hp300: locore.s
src/sys/arch/hp300/include: intr.h

Log Message:
Remove trailing spaces.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/hp300/conf/majors.hp300
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/hp300/dev/dio.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/dev/dioreg.h
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp300/dev/mtreg.h
cvs rdiff -u -r1.158 -r1.159 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/hp300/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/hp300/conf/majors.hp300
diff -u src/sys/arch/hp300/conf/majors.hp300:1.23 src/sys/arch/hp300/conf/majors.hp300:1.24
--- src/sys/arch/hp300/conf/majors.hp300:1.23	Sun Feb  6 18:26:53 2011
+++ src/sys/arch/hp300/conf/majors.hp300	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.hp300,v 1.23 2011/02/06 18:26:53 tsutsui Exp $
+#	$NetBSD: majors.hp300,v 1.24 2011/03/06 14:51:21 tsutsui Exp $
 #
 # Device majors for hp300
 #
@@ -52,5 +52,5 @@
 device-major	nsmb		char 98			nsmb
 
 # Majors up to 143 are reserved for machine-dependant drivers.
-# New machine-independent driver majors are assigned in 
+# New machine-independent driver majors are assigned in
 # sys/conf/majors.

Index: src/sys/arch/hp300/dev/dio.c
diff -u src/sys/arch/hp300/dev/dio.c:1.37 src/sys/arch/hp300/dev/dio.c:1.38
--- src/sys/arch/hp300/dev/dio.c:1.37	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/dev/dio.c	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dio.c,v 1.37 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: dio.c,v 1.37 2008/04/28 20:23:19 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: dio.c,v 1.38 2011/03/06 14:51:21 tsutsui Exp $);
 
 #define	_HP300_INTR_H_PRIVATE
 
@@ -365,7 +365,7 @@
 	return *(volatile uint8_t *)(bsh + (offset  1) + 1);
 }
 
-static void 
+static void
 dio_bus_space_write_oddbyte_1(bus_space_tag_t bst, bus_space_handle_t bsh,
 bus_size_t offset, uint8_t val)
 {

Index: src/sys/arch/hp300/dev/dioreg.h
diff -u src/sys/arch/hp300/dev/dioreg.h:1.7 src/sys/arch/hp300/dev/dioreg.h:1.8
--- src/sys/arch/hp300/dev/dioreg.h:1.7	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/dev/dioreg.h	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dioreg.h,v 1.7 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: dioreg.h,v 1.8 2011/03/06 14:51:21 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -23,7 +23,7 @@
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -60,9 +60,9 @@
  * e.g. a display framebuffer.
  *
  * DIO-II ranges from select codes 132-255 at physical addresses given by:
- *	0x100 + (sc - 132) * 0x40 
+ *	0x100 + (sc - 132) * 0x40
  * The address range of DIO-II space is thus [0x100-0x2000).
- * 
+ *
  * DIO/DIO-II space is too large to map in its entirety, instead devices
  * are mapped into kernel virtual address space allocated from a range
  * of EIOMAPSIZE pages (vmparam.h) starting at ``extiobase''.

Index: src/sys/arch/hp300/dev/mtreg.h
diff -u src/sys/arch/hp300/dev/mtreg.h:1.4 src/sys/arch/hp300/dev/mtreg.h:1.5
--- src/sys/arch/hp300/dev/mtreg.h:1.4	Sun Dec 11 12:17:14 2005
+++ src/sys/arch/hp300/dev/mtreg.h	Sun Mar  6 14:51:21 2011
@@ -1,6 +1,6 @@
-/*	$NetBSD: mtreg.h,v 1.4 2005/12/11 12:17:14 christos Exp $	*/
+/*	$NetBSD: mtreg.h,v 1.5 2011/03/06 14:51:21 tsutsui Exp $	*/
 
-/* 
+/*
  * Copyright (c) 1992, The University of Utah and
  * the Computer Systems Laboratory at the University of Utah (CSL).
  * All rights reserved.

Index: src/sys/arch/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.158 src/sys/arch/hp300/hp300/locore.s:1.159
--- src/sys/arch/hp300/hp300/locore.s:1.158	Thu Jan  6 13:03:47 2011
+++ src/sys/arch/hp300/hp300/locore.s	Sun Mar  6 14:51:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.158 2011/01/06 13:03:47 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.159 2011/03/06 14:51:21 tsutsui Exp $	

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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Feb 18 16:02:48 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: topcat.c

Log Message:
Make local functions and variables static.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/topcat.c
diff -u src/sys/arch/hp300/dev/topcat.c:1.2 src/sys/arch/hp300/dev/topcat.c:1.3
--- src/sys/arch/hp300/dev/topcat.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/topcat.c	Fri Feb 18 16:02:48 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: topcat.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: topcat.c,v 1.3 2011/02/18 16:02:48 tsutsui Exp $	*/
 /*	$OpenBSD: topcat.c,v 1.15 2006/08/11 18:33:13 miod Exp $	*/
 
 /*
@@ -129,10 +129,10 @@
 	int		sc_scode;
 };
 
-int	topcat_dio_match(device_t, cfdata_t, void *);
-void	topcat_dio_attach(device_t, device_t, void *);
-int	topcat_intio_match(device_t, cfdata_t, void *);
-void	topcat_intio_attach(device_t, device_t, void *);
+static int	topcat_dio_match(device_t, cfdata_t, void *);
+static void	topcat_dio_attach(device_t, device_t, void *);
+static int	topcat_intio_match(device_t, cfdata_t, void *);
+static void	topcat_intio_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(topcat_dio, sizeof(struct topcat_softc),
 topcat_dio_match, topcat_dio_attach, NULL, NULL);
@@ -140,17 +140,17 @@
 CFATTACH_DECL_NEW(topcat_intio, sizeof(struct topcat_softc),
 topcat_intio_match, topcat_intio_attach, NULL, NULL);
 
-void	topcat_end_attach(struct topcat_softc *, uint8_t);
-int	topcat_reset(struct diofb *, int, struct diofbreg *);
-void	topcat_restore(struct diofb *);
-int	topcat_setcmap(struct diofb *, struct wsdisplay_cmap *);
-void	topcat_setcolor(struct diofb *, u_int);
-int	topcat_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t,
-	uint16_t, uint16_t, uint16_t, int16_t, int16_t);
+static void	topcat_end_attach(struct topcat_softc *, uint8_t);
+static int	topcat_reset(struct diofb *, int, struct diofbreg *);
+static void	topcat_restore(struct diofb *);
+static int	topcat_setcmap(struct diofb *, struct wsdisplay_cmap *);
+static void	topcat_setcolor(struct diofb *, u_int);
+static int	topcat_windowmove(struct diofb *, uint16_t, uint16_t, uint16_t,
+		uint16_t, uint16_t, uint16_t, int16_t, int16_t);
 
-int	topcat_ioctl(void *, void *, u_long, void *, int, struct lwp *);
+static int	topcat_ioctl(void *, void *, u_long, void *, int, struct lwp *);
 
-struct	wsdisplay_accessops	topcat_accessops = {
+static struct wsdisplay_accessops topcat_accessops = {
 	topcat_ioctl,
 	diofb_mmap,
 	diofb_alloc_screen,



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Feb 18 16:05:22 UTC 2011

Modified Files:
src/sys/arch/hp300/include: bus.h

Log Message:
Add definitions for stream methods.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/include/bus.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/hp300/include/bus.h
diff -u src/sys/arch/hp300/include/bus.h:1.16 src/sys/arch/hp300/include/bus.h:1.17
--- src/sys/arch/hp300/include/bus.h:1.16	Sat Feb 12 05:15:39 2011
+++ src/sys/arch/hp300/include/bus.h	Fri Feb 18 16:05:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.16 2011/02/12 05:15:39 tsutsui Exp $	*/
+/*	$NetBSD: bus.h,v 1.17 2011/02/18 16:05:22 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -727,6 +727,35 @@
 #undef __HP300_copy_region_N
 
 /*
+ * Bus stream operations--defined in terms of non-stream counterparts
+ */
+#define	__BUS_SPACE_HAS_STREAM_METHODS 1
+#define	bus_space_read_stream_1 bus_space_read_1
+#define	bus_space_read_stream_2 bus_space_read_2
+#define	bus_space_read_stream_4 bus_space_read_4
+#define	bus_space_read_stream_8 bus_space_read_8
+#define	bus_space_read_multi_stream_1 bus_space_read_multi_1
+#define	bus_space_read_multi_stream_2 bus_space_read_multi_2
+#define	bus_space_read_multi_stream_4 bus_space_read_multi_4
+#define	bus_space_read_multi_stream_8 bus_space_read_multi_8
+#define	bus_space_read_region_stream_1 bus_space_read_region_1
+#define	bus_space_read_region_stream_2 bus_space_read_region_2
+#define	bus_space_read_region_stream_4 bus_space_read_region_4
+#define	bus_space_read_region_stream_8 bus_space_read_region_8
+#define	bus_space_write_stream_1 bus_space_write_1
+#define	bus_space_write_stream_2 bus_space_write_2
+#define	bus_space_write_stream_4 bus_space_write_4
+#define	bus_space_write_stream_8 bus_space_write_8
+#define	bus_space_write_multi_stream_1 bus_space_write_multi_1
+#define	bus_space_write_multi_stream_2 bus_space_write_multi_2
+#define	bus_space_write_multi_stream_4 bus_space_write_multi_4
+#define	bus_space_write_multi_stream_8 bus_space_write_multi_8
+#define	bus_space_write_region_stream_1 bus_space_write_region_1
+#define	bus_space_write_region_stream_2 bus_space_write_region_2
+#define	bus_space_write_region_stream_4 bus_space_write_region_4
+#define	bus_space_write_region_stream_8	bus_space_write_region_8
+
+/*
  * Bus read/write barrier methods.
  *
  *	void bus_space_barrier(bus_space_tag_t tag,



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Feb 18 16:06:20 UTC 2011

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

Log Message:
sgc takes slot, not scode.


To generate a diff of this commit:
cvs rdiff -u -r1.82 -r1.83 src/sys/arch/hp300/conf/files.hp300

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

Modified files:

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.82 src/sys/arch/hp300/conf/files.hp300:1.83
--- src/sys/arch/hp300/conf/files.hp300:1.82	Sat Feb 12 15:49:01 2011
+++ src/sys/arch/hp300/conf/files.hp300	Fri Feb 18 16:06:20 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.82 2011/02/12 15:49:01 tsutsui Exp $
+#	$NetBSD: files.hp300,v 1.83 2011/02/18 16:06:20 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -46,7 +46,7 @@
 # SGC bus
 #
 
-device	sgc { scode = -1 }
+device	sgc { slot = -1 }
 attach	sgc at mainbus
 file	arch/hp300/dev/sgc.c		sgc
 



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Feb 18 19:15:06 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: sgc.c

Log Message:
Make local functions static.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/sgc.c
diff -u src/sys/arch/hp300/dev/sgc.c:1.1 src/sys/arch/hp300/dev/sgc.c:1.2
--- src/sys/arch/hp300/dev/sgc.c:1.1	Sat Feb 12 05:15:39 2011
+++ src/sys/arch/hp300/dev/sgc.c	Fri Feb 18 19:15:06 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sgc.c,v 1.1 2011/02/12 05:15:39 tsutsui Exp $	*/
+/*	$NetBSD: sgc.c,v 1.2 2011/02/18 19:15:06 tsutsui Exp $	*/
 /*	$OpenBSD: sgc.c,v 1.6 2010/04/15 20:35:21 miod Exp $	*/
 
 /*
@@ -55,9 +55,9 @@
 	struct bus_space_tag sc_tag;
 };
 
-int	sgcmatch(device_t, cfdata_t, void *);
-void	sgcattach(device_t, device_t, void *);
-int	sgcprint(void *, const char *);
+static int	sgcmatch(device_t, cfdata_t, void *);
+static void	sgcattach(device_t, device_t, void *);
+static int	sgcprint(void *, const char *);
 
 CFATTACH_DECL_NEW(sgc, sizeof(struct sgc_softc),
 sgcmatch, sgcattach, NULL, NULL);



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Feb 18 19:15:44 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: diofb.c dnkbd.c dvbox.c gbox.c hyper.c rbox.c
topcat.c tvrx.c

Log Message:
Use aprint_normal(9) and variants.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp300/dev/diofb.c \
src/sys/arch/hp300/dev/dvbox.c src/sys/arch/hp300/dev/gbox.c \
src/sys/arch/hp300/dev/hyper.c src/sys/arch/hp300/dev/rbox.c \
src/sys/arch/hp300/dev/tvrx.c
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/hp300/dev/dnkbd.c
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/hp300/dev/topcat.c

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

Modified files:

Index: src/sys/arch/hp300/dev/diofb.c
diff -u src/sys/arch/hp300/dev/diofb.c:1.2 src/sys/arch/hp300/dev/diofb.c:1.3
--- src/sys/arch/hp300/dev/diofb.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/diofb.c	Fri Feb 18 19:15:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofb.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: diofb.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
 /*	$OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $	*/
 
 /*
@@ -305,16 +305,16 @@
 {
 	struct wsemuldisplaydev_attach_args waa;
 
-	printf(: %dx%d, fb-dwidth, fb-dheight);
+	aprint_normal(: %dx%d, fb-dwidth, fb-dheight);
 
 	if (fb-planes == 1)
-		printf( monochrome);
+		aprint_normal( monochrome);
 	else
-		printf(x%d, fb-planes);
+		aprint_normal(x%d, fb-planes);
 
 	if (descr != NULL)
-		printf( %s, descr);
-	printf( frame buffer\n);
+		aprint_normal( %s, descr);
+	aprint_normal( frame buffer\n);
 
 	fb-scrlist[0] = fb-wsd;
 	fb-wsl.nscreens = 1;
Index: src/sys/arch/hp300/dev/dvbox.c
diff -u src/sys/arch/hp300/dev/dvbox.c:1.2 src/sys/arch/hp300/dev/dvbox.c:1.3
--- src/sys/arch/hp300/dev/dvbox.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/dvbox.c	Fri Feb 18 19:15:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dvbox.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: dvbox.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
 /*	$OpenBSD: dvbox.c,v 1.13 2006/08/11 18:33:13 miod Exp $	*/
 
 /*
@@ -235,7 +235,7 @@
 		}
 		fbr = bus_space_vaddr(da-da_bst, bsh);
 		if (dvbox_reset(sc-sc_fb, sc-sc_scode, fbr) != 0) {
-			printf(: can't map framebuffer\n);
+			aprint_error(: can't reset framebuffer\n);
 			return;
 		}
 	}
Index: src/sys/arch/hp300/dev/gbox.c
diff -u src/sys/arch/hp300/dev/gbox.c:1.2 src/sys/arch/hp300/dev/gbox.c:1.3
--- src/sys/arch/hp300/dev/gbox.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/gbox.c	Fri Feb 18 19:15:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: gbox.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: gbox.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
 /*	$OpenBSD: gbox.c,v 1.15 2007/01/07 15:13:52 miod Exp $	*/
 
 /*
@@ -244,7 +244,7 @@
 		}
 		fbr = bus_space_vaddr(da-da_bst, bsh);
 		if (gbox_reset(sc-sc_fb, sc-sc_scode, fbr) != 0) {
-			printf(: can't map framebuffer\n);
+			aprint_error(: can't reset framebuffer\n);
 			return;
 		}
 	}
Index: src/sys/arch/hp300/dev/hyper.c
diff -u src/sys/arch/hp300/dev/hyper.c:1.2 src/sys/arch/hp300/dev/hyper.c:1.3
--- src/sys/arch/hp300/dev/hyper.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/hyper.c	Fri Feb 18 19:15:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hyper.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: hyper.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
 /*	$OpenBSD: hyper.c,v 1.15 2006/04/14 21:05:43 miod Exp $	*/
 
 /*
@@ -187,7 +187,7 @@
 		}
 		fbr = bus_space_vaddr(da-da_bst, bsh);
 		if (hyper_reset(sc-sc_fb, sc-sc_scode, fbr) != 0) {
-			printf(: can't map framebuffer\n);
+			aprint_error(: can't reset framebuffer\n);
 			return;
 		}
 	}
Index: src/sys/arch/hp300/dev/rbox.c
diff -u src/sys/arch/hp300/dev/rbox.c:1.2 src/sys/arch/hp300/dev/rbox.c:1.3
--- src/sys/arch/hp300/dev/rbox.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/rbox.c	Fri Feb 18 19:15:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: rbox.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: rbox.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
 /*	$OpenBSD: rbox.c,v 1.14 2006/08/11 18:33:13 miod Exp $	*/
 
 /*
@@ -235,7 +235,7 @@
 		}
 		fbr = bus_space_vaddr(da-da_bst, bsh);
 		if (rbox_reset(sc-sc_fb, sc-sc_scode, fbr) != 0) {
-			printf(: can't map framebuffer\n);
+			aprint_error(: can't reset framebuffer\n);
 			return;
 		}
 	}
Index: src/sys/arch/hp300/dev/tvrx.c
diff -u src/sys/arch/hp300/dev/tvrx.c:1.2 src/sys/arch/hp300/dev/tvrx.c:1.3
--- src/sys/arch/hp300/dev/tvrx.c:1.2	Sat Feb 12 16:40:29 2011
+++ src/sys/arch/hp300/dev/tvrx.c	Fri Feb 18 19:15:43 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: tvrx.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
+/*	$NetBSD: tvrx.c,v 1.3 2011/02/18 19:15:43 tsutsui Exp $	*/
 /*	$OpenBSD: tvrx.c,v 1.1 2006/04/14 21:05:43 miod Exp $	*/
 
 /*
@@ -120,7 +120,7 @@
 		}
 		fbr = bus_space_vaddr(da-da_bst, bsh);
 		if (tvrx_reset(sc-sc_fb, sc-sc_scode, fbr) != 0) {
-			

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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 19 05:35:00 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: hil_intio.c

Log Message:
- make local functions static
- use aprint_erorr(9)
- some KNF


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

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

Modified files:

Index: src/sys/arch/hp300/dev/hil_intio.c
diff -u src/sys/arch/hp300/dev/hil_intio.c:1.1 src/sys/arch/hp300/dev/hil_intio.c:1.2
--- src/sys/arch/hp300/dev/hil_intio.c:1.1	Sun Feb  6 18:26:51 2011
+++ src/sys/arch/hp300/dev/hil_intio.c	Sat Feb 19 05:34:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil_intio.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $	*/
+/*	$NetBSD: hil_intio.c,v 1.2 2011/02/19 05:34:59 tsutsui Exp $	*/
 /*	$OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $	*/
 
 /*
@@ -44,8 +44,8 @@
 #include machine/hil_machdep.h
 #include dev/hil/hilvar.h
 
-int	hil_intio_match(device_t, cfdata_t, void *);
-void	hil_intio_attach(device_t, device_t, void *);
+static int	hil_intio_match(device_t, cfdata_t, void *);
+static void	hil_intio_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(hil_intio, sizeof(struct hil_softc),
 hil_intio_match, hil_intio_attach, NULL, NULL);
@@ -61,12 +61,12 @@
 
 	/* Allow only one instance. */
 	if (hil_matched != 0)
-		return (0);
+		return 0;
 
 	if (badaddr((void *)ia-ia_addr))	/* should not happen! */
-		return (0);
+		return 0;
 
-	return (1);
+	return 1;
 }
 
 int hil_is_console = -1;	/* undecided */
@@ -81,7 +81,7 @@
 	sc-sc_bst = ia-ia_bst;
 	if (bus_space_map(sc-sc_bst, ia-ia_iobase,
 	HILMAPSIZE, 0, sc-sc_bsh) != 0) {
-		printf(: couldn't map hil controller\n);
+		aprint_error(: couldn't map hil controller\n);
 		return;
 	}
 



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 19 05:36:50 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: hil_intio.c

Log Message:
Actually check that the configured console device is a wsdisplay.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/hil_intio.c
diff -u src/sys/arch/hp300/dev/hil_intio.c:1.2 src/sys/arch/hp300/dev/hil_intio.c:1.3
--- src/sys/arch/hp300/dev/hil_intio.c:1.2	Sat Feb 19 05:34:59 2011
+++ src/sys/arch/hp300/dev/hil_intio.c	Sat Feb 19 05:36:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hil_intio.c,v 1.2 2011/02/19 05:34:59 tsutsui Exp $	*/
+/*	$NetBSD: hil_intio.c,v 1.3 2011/02/19 05:36:49 tsutsui Exp $	*/
 /*	$OpenBSD: hil_intio.c,v 1.8 2007/01/06 20:10:57 miod Exp $	*/
 
 /*
@@ -88,7 +88,8 @@
 	/*
 	 * Check that the configured console device is a wsdisplay.
 	 */
-	hil_is_console = 1;
+	if (major(cn_tab-cn_dev) != devsw_name2chr(wsdisplay, NULL, 0))
+		hil_is_console = 0;
 
 	hil_attach(sc, hil_is_console);
 	intr_establish(hil_intr, sc, ia-ia_ipl, IPL_TTY);



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 19 05:37:55 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: dnkbdmap.c dnkbdmap.h

Log Message:
u_int8_t - uint8_t


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp300/dev/dnkbdmap.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp300/dev/dnkbdmap.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/hp300/dev/dnkbdmap.c
diff -u src/sys/arch/hp300/dev/dnkbdmap.c:1.2 src/sys/arch/hp300/dev/dnkbdmap.c:1.3
--- src/sys/arch/hp300/dev/dnkbdmap.c:1.2	Sat Feb 12 16:36:37 2011
+++ src/sys/arch/hp300/dev/dnkbdmap.c	Sat Feb 19 05:37:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbdmap.c,v 1.2 2011/02/12 16:36:37 tsutsui Exp $	*/
+/*	$NetBSD: dnkbdmap.c,v 1.3 2011/02/19 05:37:55 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbdmap.c,v 1.2 2005/05/06 22:22:53 miod Exp $	*/
 /*
  * Copyright (c) 2005, Miodrag Vallat
@@ -40,7 +40,7 @@
  * Translate Domain keycodes to US keyboard XT scancodes, for proper
  * X11-over-wsmux operation.
  */
-const u_int8_t dnkbd_raw[0x80] = {
+const uint8_t dnkbd_raw[0x80] = {
 0x00, 0x00, 0x00, 0x00, 0x44, 0x3b, 0x3c, 0x3d,
 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x00, 0x00,
 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x01, 0x01,

Index: src/sys/arch/hp300/dev/dnkbdmap.h
diff -u src/sys/arch/hp300/dev/dnkbdmap.h:1.1 src/sys/arch/hp300/dev/dnkbdmap.h:1.2
--- src/sys/arch/hp300/dev/dnkbdmap.h:1.1	Sat Feb 12 15:49:01 2011
+++ src/sys/arch/hp300/dev/dnkbdmap.h	Sat Feb 19 05:37:55 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbdmap.h,v 1.1 2011/02/12 15:49:01 tsutsui Exp $	*/
+/*	$NetBSD: dnkbdmap.h,v 1.2 2011/02/19 05:37:55 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbdmap.h,v 1.1 2005/04/22 11:59:11 miod Exp $	*/
 /*
  * Copyright (c) 2005, Miodrag Vallat
@@ -26,4 +26,4 @@
  */
 
 extern const struct wscons_keydesc dnkbd_keydesctab[];
-extern const u_int8_t dnkbd_raw[0x80];
+extern const uint8_t dnkbd_raw[0x80];



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 19 05:40:59 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: diodevs

Log Message:
Move recently supported framebuffers out of the unsupported list.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/dev/diodevs

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

Modified files:

Index: src/sys/arch/hp300/dev/diodevs
diff -u src/sys/arch/hp300/dev/diodevs:1.13 src/sys/arch/hp300/dev/diodevs:1.14
--- src/sys/arch/hp300/dev/diodevs:1.13	Sun Feb  6 04:06:11 2011
+++ src/sys/arch/hp300/dev/diodevs	Sat Feb 19 05:40:58 2011
@@ -1,4 +1,4 @@
-$NetBSD: diodevs,v 1.13 2011/02/06 04:06:11 tsutsui Exp $
+$NetBSD: diodevs,v 1.14 2011/02/19 05:40:58 tsutsui Exp $
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -66,15 +66,15 @@
 framebuffer HRMCATSEYE	0x07	1	high-res mono catseye display
 framebuffer DAVINCI	0x08	2	98730/98731 (\davinci\) display
 framebuffer XXXCATSEYE	0x09	1	catseye display
+framebuffer TIGERSHARK	0x0c	3	TurboVRX (\tigershark\) display
 framebuffer HYPERION	0x0e	1	A1096A (\hyperion\) display
+framebuffer A1474MID	0x10	4	A1474-69511 on-board mid-res graphics
+framebuffer A147xVGA	0x11	4	A147x-69510 on-board VGA graphics
 
 /* Unsupported framebuffers. */
 
 framebuffer XGENESIS	0x0b	1	x-genesis display
-framebuffer TIGERSHARK	0x0c	3	TurboVRX (\tigershark\) display
 framebuffer YGENESIS	0x0d	1	y-genesis display
-framebuffer A1474MID	0x10	4	A1474-69511 on-board mid-res graphics
-framebuffer A147xVGA	0x11	4	A147x-69510 on-board VGA graphics
 /* No ID info about A1474-69515 on-board high-res graphics */
 
 /* Devices not yet supported.  Descriptions are lacking. */



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

2011-02-18 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 19 05:41:38 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: diodevs.h diodevs_data.h

Log Message:
Regen from diodevs rev 1.14:
 Move recently supported framebuffers out of the unsupported list.


To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/dev/diodevs.h \
src/sys/arch/hp300/dev/diodevs_data.h

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

Modified files:

Index: src/sys/arch/hp300/dev/diodevs.h
diff -u src/sys/arch/hp300/dev/diodevs.h:1.16 src/sys/arch/hp300/dev/diodevs.h:1.17
--- src/sys/arch/hp300/dev/diodevs.h:1.16	Sun Feb  6 04:06:58 2011
+++ src/sys/arch/hp300/dev/diodevs.h	Sat Feb 19 05:41:38 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: diodevs.h,v 1.16 2011/02/06 04:06:58 tsutsui Exp $	*/
+/*	$NetBSD: diodevs.h,v 1.17 2011/02/19 05:41:38 tsutsui Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: diodevs,v 1.13 2011/02/06 04:06:11 tsutsui Exp 
+ *	NetBSD: diodevs,v 1.14 2011/02/19 05:40:58 tsutsui Exp 
  */
 
 /*-
@@ -114,26 +114,26 @@
 #define	DIO_DEVICE_SECID_XXXCATSEYE	0x09
 #define	DIO_DEVICE_DESC_XXXCATSEYE	catseye display
 
+#define	DIO_DEVICE_SECID_TIGERSHARK	0x0c
+#define	DIO_DEVICE_DESC_TIGERSHARK	TurboVRX (\tigershark\) display
+
 #define	DIO_DEVICE_SECID_HYPERION	0x0e
 #define	DIO_DEVICE_DESC_HYPERION	A1096A (\hyperion\) display
 
+#define	DIO_DEVICE_SECID_A1474MID	0x10
+#define	DIO_DEVICE_DESC_A1474MID	A1474-69511 on-board mid-res graphics
+
+#define	DIO_DEVICE_SECID_A147xVGA	0x11
+#define	DIO_DEVICE_DESC_A147xVGA	A147x-69510 on-board VGA graphics
+
 /* Unsupported framebuffers. */
 
 
 #define	DIO_DEVICE_SECID_XGENESIS	0x0b
 #define	DIO_DEVICE_DESC_XGENESIS	x-genesis display
 
-#define	DIO_DEVICE_SECID_TIGERSHARK	0x0c
-#define	DIO_DEVICE_DESC_TIGERSHARK	TurboVRX (\tigershark\) display
-
 #define	DIO_DEVICE_SECID_YGENESIS	0x0d
 #define	DIO_DEVICE_DESC_YGENESIS	y-genesis display
-
-#define	DIO_DEVICE_SECID_A1474MID	0x10
-#define	DIO_DEVICE_DESC_A1474MID	A1474-69511 on-board mid-res graphics
-
-#define	DIO_DEVICE_SECID_A147xVGA	0x11
-#define	DIO_DEVICE_DESC_A147xVGA	A147x-69510 on-board VGA graphics
 /* No ID info about A1474-69515 on-board high-res graphics */
 
 /* Devices not yet supported.  Descriptions are lacking. */
Index: src/sys/arch/hp300/dev/diodevs_data.h
diff -u src/sys/arch/hp300/dev/diodevs_data.h:1.16 src/sys/arch/hp300/dev/diodevs_data.h:1.17
--- src/sys/arch/hp300/dev/diodevs_data.h:1.16	Sun Feb  6 04:06:58 2011
+++ src/sys/arch/hp300/dev/diodevs_data.h	Sat Feb 19 05:41:38 2011
@@ -1,10 +1,10 @@
-/*	$NetBSD: diodevs_data.h,v 1.16 2011/02/06 04:06:58 tsutsui Exp $	*/
+/*	$NetBSD: diodevs_data.h,v 1.17 2011/02/19 05:41:38 tsutsui Exp $	*/
 
 /*
  * THIS FILE AUTOMATICALLY GENERATED.  DO NOT EDIT.
  *
  * generated from:
- *	NetBSD: diodevs,v 1.13 2011/02/06 04:06:11 tsutsui Exp 
+ *	NetBSD: diodevs,v 1.14 2011/02/19 05:40:58 tsutsui Exp 
  */
 
 /*-
@@ -62,12 +62,12 @@
 	{ 0x39,	0x07,	1 },
 	{ 0x39,	0x08,	2 },
 	{ 0x39,	0x09,	1 },
-	{ 0x39,	0x0e,	1 },
-	{ 0x39,	0x0b,	1 },
 	{ 0x39,	0x0c,	3 },
-	{ 0x39,	0x0d,	1 },
+	{ 0x39,	0x0e,	1 },
 	{ 0x39,	0x10,	4 },
 	{ 0x39,	0x11,	4 },
+	{ 0x39,	0x0b,	1 },
+	{ 0x39,	0x0d,	1 },
 	{ 0x03,	0,	1 },
 	{ 0x04,	0,	1 },
 	{ 0x06,	0,	1 },
@@ -114,12 +114,12 @@
 	{ 0x39,	0x07,	DIO_DEVICE_DESC_HRMCATSEYE },
 	{ 0x39,	0x08,	DIO_DEVICE_DESC_DAVINCI },
 	{ 0x39,	0x09,	DIO_DEVICE_DESC_XXXCATSEYE },
-	{ 0x39,	0x0e,	DIO_DEVICE_DESC_HYPERION },
-	{ 0x39,	0x0b,	DIO_DEVICE_DESC_XGENESIS },
 	{ 0x39,	0x0c,	DIO_DEVICE_DESC_TIGERSHARK },
-	{ 0x39,	0x0d,	DIO_DEVICE_DESC_YGENESIS },
+	{ 0x39,	0x0e,	DIO_DEVICE_DESC_HYPERION },
 	{ 0x39,	0x10,	DIO_DEVICE_DESC_A1474MID },
 	{ 0x39,	0x11,	DIO_DEVICE_DESC_A147xVGA },
+	{ 0x39,	0x0b,	DIO_DEVICE_DESC_XGENESIS },
+	{ 0x39,	0x0d,	DIO_DEVICE_DESC_YGENESIS },
 	{ 0x03,	0,	DIO_DEVICE_DESC_MISC0 },
 	{ 0x04,	0,	DIO_DEVICE_DESC_MISC1 },
 	{ 0x06,	0,	DIO_DEVICE_DESC_PARALLEL },



CVS commit: src/sys/arch/hp300

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 15:49:02 UTC 2011

Modified Files:
src/sys/arch/hp300/conf: GENERIC files.hp300
Added Files:
src/sys/arch/hp300/dev: dnkbd.c dnkbdmap.c dnkbdmap.h

Log Message:
Pull Apollo Domain keyboard and mouse support from OpenBSD.
Untested (no hardware), but no bad sideeffect on 425t without Domain keyboard.

This is the last portion of new hp300 kernel features submitted in
PR port-hp300/3528 back in 1997, and I think finally we can close it.


To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/dev/dnkbd.c \
src/sys/arch/hp300/dev/dnkbdmap.c src/sys/arch/hp300/dev/dnkbdmap.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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.163 src/sys/arch/hp300/conf/GENERIC:1.164
--- src/sys/arch/hp300/conf/GENERIC:1.163	Sat Feb 12 05:15:39 2011
+++ src/sys/arch/hp300/conf/GENERIC	Sat Feb 12 15:49:01 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.163 2011/02/12 05:15:39 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.164 2011/02/12 15:49:01 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.163 $
+#ident 		GENERIC-$Revision: 1.164 $
 
 maxusers	32		# estimated number of users
 
@@ -210,9 +210,9 @@
 nhpib*		at intio?		# slow internal HP-IB
 
 # 8250-like serial ports found on Frodo ASIC
-#dnkbd0		at frodo? offset 0x0	# Domain keyboard flavor
-#wskbd*		at dnkbd? mux 1
-#wsmouse*	at dnkbd? mux 0
+dnkbd0		at frodo? offset 0x0	# Domain keyboard flavor
+wskbd*		at dnkbd? mux 1
+wsmouse*	at dnkbd? mux 0
 com*		at frodo? offset ?	# tty flavor
 
 dvbox*		at intio?		# Davinci framebuffer

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.81 src/sys/arch/hp300/conf/files.hp300:1.82
--- src/sys/arch/hp300/conf/files.hp300:1.81	Sat Feb 12 05:15:39 2011
+++ src/sys/arch/hp300/conf/files.hp300	Sat Feb 12 15:49:01 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.81 2011/02/12 05:15:39 tsutsui Exp $
+#	$NetBSD: files.hp300,v 1.82 2011/02/12 15:49:01 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -80,10 +80,10 @@
 file	arch/hp300/dev/com_frodo.c	com_frodo needs-flag
 
 # Apollo Keyboard and mouse
-#device	dnkbd: wskbddev, wsmousedev
-#attach	dnkbd at frodo
-#file	arch/hp300/dev/dnkbd.c			dnkbd	needs-flag
-#file	arch/hp300/dev/dnkbdmap.c		dnkbd
+device	dnkbd: wskbddev, wsmousedev
+attach	dnkbd at frodo
+file	arch/hp300/dev/dnkbd.c			dnkbd	needs-flag
+file	arch/hp300/dev/dnkbdmap.c		dnkbd
 
 #
 # Frame buffer devices on Internal I/O and the DIO bus

Added files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u /dev/null src/sys/arch/hp300/dev/dnkbd.c:1.1
--- /dev/null	Sat Feb 12 15:49:02 2011
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Feb 12 15:49:01 2011
@@ -0,0 +1,1138 @@
+/*	$NetBSD: dnkbd.c,v 1.1 2011/02/12 15:49:01 tsutsui Exp $	*/
+/*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
+
+/*
+ * Copyright (c) 2005, Miodrag Vallat
+ * Copyright (c) 1997 Michael Smith.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+/*
+ * Driver for the Apollo Domain keyboard and mouse.
+ */
+
+#include sys/param.h
+#include sys/systm.h
+#include sys/device.h
+#include sys/ioctl.h
+#include sys/kernel.h
+#include sys/callout.h
+#include sys/conf.h
+#include sys/bus.h
+#include sys/cpu.h
+
+#include machine/autoconf.h
+
+#include 

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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 16:30:22 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c

Log Message:
Make this compile properly with options WSDISPLAY_COMPAT_RAWKBD.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.1 src/sys/arch/hp300/dev/dnkbd.c:1.2
--- src/sys/arch/hp300/dev/dnkbd.c:1.1	Sat Feb 12 15:49:01 2011
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Feb 12 16:30:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.1 2011/02/12 15:49:01 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.2 2011/02/12 16:30:22 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -31,6 +31,8 @@
  * Driver for the Apollo Domain keyboard and mouse.
  */
 
+#include opt_wsdisplay_compat.h
+
 #include sys/param.h
 #include sys/systm.h
 #include sys/device.h
@@ -681,7 +683,7 @@
 		int c, j = 0;
 
 		c = dnkbd_raw[key];
-		if (c != RAWKEY_Null) {
+		if (c != 0) {
 			/* fake extended scancode if necessary */
 			if (c  0x80)
 cbuf[j++] = 0xe0;



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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 16:36:37 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: dnkbdmap.c

Log Message:
Make sure to include opt_wsdisplay_compat.h for WSDISPLAY_COMPAT_RAWKBD.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbdmap.c
diff -u src/sys/arch/hp300/dev/dnkbdmap.c:1.1 src/sys/arch/hp300/dev/dnkbdmap.c:1.2
--- src/sys/arch/hp300/dev/dnkbdmap.c:1.1	Sat Feb 12 15:49:01 2011
+++ src/sys/arch/hp300/dev/dnkbdmap.c	Sat Feb 12 16:36:37 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbdmap.c,v 1.1 2011/02/12 15:49:01 tsutsui Exp $	*/
+/*	$NetBSD: dnkbdmap.c,v 1.2 2011/02/12 16:36:37 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbdmap.c,v 1.2 2005/05/06 22:22:53 miod Exp $	*/
 /*
  * Copyright (c) 2005, Miodrag Vallat
@@ -25,6 +25,8 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#include opt_wsdisplay_compat.h
+
 #include sys/types.h
 
 #include dev/wscons/wsksymdef.h



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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 16:37:33 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c

Log Message:
Fix one more porting botch inside #ifdef WSDISPLAY_COMPAT_RAWKBD.


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

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.2 src/sys/arch/hp300/dev/dnkbd.c:1.3
--- src/sys/arch/hp300/dev/dnkbd.c:1.2	Sat Feb 12 16:30:22 2011
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Feb 12 16:37:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.2 2011/02/12 16:30:22 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.3 2011/02/12 16:37:32 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -991,7 +991,7 @@
 #ifdef WSDISPLAY_COMPAT_RAWKBD
 	case WSKBDIO_SETMODE:
 		sc-sc_rawkbd = *(int *)data == WSKBD_RAW;
-		timeout_del(sc-sc_rawrepeat_ch);
+		callout_stop(sc-sc_rawrepeat_ch);
 		return (0);
 #endif
 	}



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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 16:40:29 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: diofb.c diofb_mono.c diofbreg.h diofbvar.h
dvbox.c dvboxreg.h gbox.c gboxreg.h hyper.c hyperreg.h rbox.c
rboxreg.h topcat.c topcatreg.h tvrx.c

Log Message:
- make local functions static
- some KNF


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp300/dev/diofb.c \
src/sys/arch/hp300/dev/diofb_mono.c src/sys/arch/hp300/dev/dvbox.c \
src/sys/arch/hp300/dev/dvboxreg.h src/sys/arch/hp300/dev/gbox.c \
src/sys/arch/hp300/dev/gboxreg.h src/sys/arch/hp300/dev/hyper.c \
src/sys/arch/hp300/dev/hyperreg.h src/sys/arch/hp300/dev/rbox.c \
src/sys/arch/hp300/dev/rboxreg.h src/sys/arch/hp300/dev/topcat.c \
src/sys/arch/hp300/dev/topcatreg.h src/sys/arch/hp300/dev/tvrx.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp300/dev/diofbreg.h \
src/sys/arch/hp300/dev/diofbvar.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/hp300/dev/diofb.c
diff -u src/sys/arch/hp300/dev/diofb.c:1.1 src/sys/arch/hp300/dev/diofb.c:1.2
--- src/sys/arch/hp300/dev/diofb.c:1.1	Sun Feb  6 18:26:51 2011
+++ src/sys/arch/hp300/dev/diofb.c	Sat Feb 12 16:40:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofb.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $	*/
+/*	$NetBSD: diofb.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
 /*	$OpenBSD: diofb.c,v 1.18 2010/12/26 15:40:59 miod Exp $	*/
 
 /*
@@ -80,12 +80,12 @@
 #include hp300/dev/diofbreg.h
 #include hp300/dev/diofbvar.h
 
-void	diofb_do_cursor(struct rasops_info *);
-void	diofb_copycols(void *, int, int, int, int);
-void	diofb_erasecols(void *, int, int, int, long);
-void	diofb_copyrows(void *, int, int, int);
-void	diofb_eraserows(void *, int, int, long);
-int	diofb_allocattr(void *, int, int, int, long *);
+static void	diofb_do_cursor(struct rasops_info *);
+static void	diofb_copycols(void *, int, int, int, int);
+static void	diofb_erasecols(void *, int, int, int, long);
+static void	diofb_copyrows(void *, int, int, int);
+static void	diofb_eraserows(void *, int, int, long);
+static int	diofb_allocattr(void *, int, int, int, long *);
 
 struct diofb diofb_cn;
 
@@ -130,7 +130,7 @@
 		 */
 		fb-fbkva = iomap(fb-fbaddr, fb-fbsize);
 		if (fb-fbkva == NULL)
-			return (ENOMEM);
+			return ENOMEM;
 	}
 	if (fb-dwidth == 0 || fb-dheight == 0) {
 		fb-dwidth = (fbr-dwmsb  8) | fbr-dwlsb;
@@ -153,7 +153,7 @@
 
 	fb-mapmode = WSDISPLAYIO_MODE_DUMBFB;
 
-	return (0);
+	return 0;
 }
 
 /*
@@ -335,8 +335,9 @@
 int
 diofb_allocattr(void *cookie, int fg, int bg, int flg, long *attr)
 {
+
 	if ((flg  (WSATTR_BLINK | WSATTR_HILIT)) != 0)
-		return (EINVAL);
+		return EINVAL;
 
 	if ((flg  WSATTR_WSCOLORS) == 0) {
 		fg = WSCOL_WHITE;
@@ -460,14 +461,14 @@
 	struct rasops_info *ri = fb-ri;
 
 	if (fb-nscreens  0)
-		return (ENOMEM);
+		return ENOMEM;
 
 	*cookiep = ri;
 	*curxp = *curyp = 0;
 	ri-ri_ops.allocattr(ri, 0, 0, 0, attrp);
 	fb-nscreens++;
 
-	return (0);
+	return 0;
 }
 
 void
@@ -482,7 +483,8 @@
 diofb_show_screen(void *v, void *cookie, int waitok,
 void (*cb)(void *, int, int), void *cbarg)
 {
-	return (0);
+
+	return 0;
 }
 
 paddr_t
@@ -491,7 +493,7 @@
 	struct diofb *fb = v;
 
 	if ((offset  PAGE_MASK) != 0)
-		return (-1);
+		return -1;
 
 	switch (fb-mapmode) {
 	case WSDISPLAYIO_MODE_MAPPED:
@@ -505,7 +507,7 @@
 		break;
 	}
 
-	return (-1);
+	return -1;
 }
 
 int
@@ -516,14 +518,14 @@
 	int error;
 
 	if (index = colcount || count  colcount - index)
-		return (EINVAL);
+		return EINVAL;
 
 	if ((error = copyout(fb-cmap.r + index, cm-red, count)) != 0)
-		return (error);
+		return error;
 	if ((error = copyout(fb-cmap.g + index, cm-green, count)) != 0)
-		return (error);
+		return error;
 	if ((error = copyout(fb-cmap.b + index, cm-blue, count)) != 0)
-		return (error);
+		return error;
 
-	return (0);
+	return 0;
 }
Index: src/sys/arch/hp300/dev/diofb_mono.c
diff -u src/sys/arch/hp300/dev/diofb_mono.c:1.1 src/sys/arch/hp300/dev/diofb_mono.c:1.2
--- src/sys/arch/hp300/dev/diofb_mono.c:1.1	Sun Feb  6 18:26:51 2011
+++ src/sys/arch/hp300/dev/diofb_mono.c	Sat Feb 12 16:40:29 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofb_mono.c,v 1.1 2011/02/06 18:26:51 tsutsui Exp $	*/
+/*	$NetBSD: diofb_mono.c,v 1.2 2011/02/12 16:40:29 tsutsui Exp $	*/
 /*	$OpenBSD: diofb_mono.c,v 1.3 2006/08/11 18:33:13 miod Exp $	*/
 
 /*
@@ -115,8 +115,8 @@
 #include hp300/dev/maskbits.h
 
 int
-diofb_mono_windowmove(struct diofb *fb, u_int16_t sx, u_int16_t sy,
-u_int16_t dx, u_int16_t dy, u_int16_t cx, u_int16_t cy, int16_t rop,
+diofb_mono_windowmove(struct diofb *fb, uint16_t sx, uint16_t sy,
+uint16_t dx, uint16_t dy, uint16_t cx, uint16_t cy, int16_t rop,
 int16_t planemask /* ignored */)
 {
 	int width;		/* add to get to same position in next line */
@@ -271,5 +271,5 @@
 		}
 	}
 
-	return (0);
+	return 0;
 }
Index: 

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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 16:41:55 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: dnkbd.c

Log Message:
- make local functions static
- some KNF


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

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

Modified files:

Index: src/sys/arch/hp300/dev/dnkbd.c
diff -u src/sys/arch/hp300/dev/dnkbd.c:1.3 src/sys/arch/hp300/dev/dnkbd.c:1.4
--- src/sys/arch/hp300/dev/dnkbd.c:1.3	Sat Feb 12 16:37:32 2011
+++ src/sys/arch/hp300/dev/dnkbd.c	Sat Feb 12 16:41:54 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: dnkbd.c,v 1.3 2011/02/12 16:37:32 tsutsui Exp $	*/
+/*	$NetBSD: dnkbd.c,v 1.4 2011/02/12 16:41:54 tsutsui Exp $	*/
 /*	$OpenBSD: dnkbd.c,v 1.17 2009/07/23 21:05:56 blambert Exp $	*/
 
 /*
@@ -140,7 +140,7 @@
 			sc_state, sc_prevstate;
 	u_int		sc_echolen;
 
-	u_int8_t	sc_mousepkt[3];	/* mouse packet being constructed */
+	uint8_t		sc_mousepkt[3];	/* mouse packet being constructed */
 	u_int		sc_mousepos;	/* index in above */
 
 	struct callout	sc_bellstop_tmo;
@@ -160,46 +160,46 @@
 #endif
 };
 
-int	dnkbd_match(device_t, cfdata_t, void *);
-void	dnkbd_attach(device_t, device_t, void *);
+static int	dnkbd_match(device_t, cfdata_t, void *);
+static void	dnkbd_attach(device_t, device_t, void *);
 
 CFATTACH_DECL_NEW(dnkbd, sizeof(struct dnkbd_softc),
 dnkbd_match, dnkbd_attach, NULL, NULL);
 
-void	dnkbd_init(struct dnkbd_softc *, uint16_t, uint16_t);
-int	dnkbd_enable(void *, int);
-void	dnkbd_set_leds(void *, int);
-int	dnkbd_ioctl(void *, u_long, void *, int, struct lwp *);
+static void	dnkbd_init(struct dnkbd_softc *, uint16_t, uint16_t);
+static int	dnkbd_enable(void *, int);
+static void	dnkbd_set_leds(void *, int);
+static int	dnkbd_ioctl(void *, u_long, void *, int, struct lwp *);
 
-const struct wskbd_accessops dnkbd_accessops = {
+static const struct wskbd_accessops dnkbd_accessops = {
 	dnkbd_enable,
 	dnkbd_set_leds,
 	dnkbd_ioctl
 };
 
 #if NWSMOUSE  0
-int	dnmouse_enable(void *);
-int	dnmouse_ioctl(void *, u_long, void *, int, struct lwp *);
-void	dnmouse_disable(void *);
+static int	dnmouse_enable(void *);
+static int	dnmouse_ioctl(void *, u_long, void *, int, struct lwp *);
+static void	dnmouse_disable(void *);
 
-const struct wsmouse_accessops dnmouse_accessops = {
+static const struct wsmouse_accessops dnmouse_accessops = {
 	dnmouse_enable,
 	dnmouse_ioctl,
 	dnmouse_disable
 };
 #endif
 
-void	dnkbd_bell(void *, u_int, u_int, u_int);
-void	dnkbd_cngetc(void *, u_int *, int *);
-void	dnkbd_cnpollc(void *, int);
+static void	dnkbd_bell(void *, u_int, u_int, u_int);
+static void	dnkbd_cngetc(void *, u_int *, int *);
+static void	dnkbd_cnpollc(void *, int);
 
-const struct wskbd_consops dnkbd_consops = {
+static const struct wskbd_consops dnkbd_consops = {
 	dnkbd_cngetc,
 	dnkbd_cnpollc,
 	dnkbd_bell
 };
 
-struct wskbd_mapdata dnkbd_keymapdata = {
+static struct wskbd_mapdata dnkbd_keymapdata = {
 	dnkbd_keydesctab,
 #ifdef DNKBD_LAYOUT
 	DNKBD_LAYOUT
@@ -210,21 +210,23 @@
 
 typedef enum { EVENT_NONE, EVENT_KEYBOARD, EVENT_MOUSE } dnevent;
 
-void	dnevent_kbd(struct dnkbd_softc *, int);
-void	dnevent_kbd_internal(struct dnkbd_softc *, int);
-void	dnevent_mouse(struct dnkbd_softc *, u_int8_t *);
-void	dnkbd_attach_subdevices(struct dnkbd_softc *);
-void	dnkbd_bellstop(void *);
-void	dnkbd_decode(int, u_int *, int *);
-dnevent	dnkbd_input(struct dnkbd_softc *, int);
-int	dnkbd_intr(void *);
-int	dnkbd_pollin(struct dnkbd_softc *, u_int);
-int	dnkbd_pollout(struct dnkbd_softc *, int);
-int	dnkbd_probe(struct dnkbd_softc *);
-void	dnkbd_rawrepeat(void *);
-int	dnkbd_send(struct dnkbd_softc *, const u_int8_t *, size_t);
-int	dnsubmatch_kbd(device_t, cfdata_t, const int *, void *);
-int	dnsubmatch_mouse(device_t, cfdata_t, const int *, void *);
+static void	dnevent_kbd(struct dnkbd_softc *, int);
+static void	dnevent_kbd_internal(struct dnkbd_softc *, int);
+static void	dnevent_mouse(struct dnkbd_softc *, uint8_t *);
+static void	dnkbd_attach_subdevices(struct dnkbd_softc *);
+static void	dnkbd_bellstop(void *);
+static void	dnkbd_decode(int, u_int *, int *);
+static dnevent	dnkbd_input(struct dnkbd_softc *, int);
+static int	dnkbd_intr(void *);
+static int	dnkbd_pollin(struct dnkbd_softc *, u_int);
+static int	dnkbd_pollout(struct dnkbd_softc *, int);
+static int	dnkbd_probe(struct dnkbd_softc *);
+#ifdef WSDISPLAY_COMPAT_RAWKBD
+static void	dnkbd_rawrepeat(void *);
+#endif
+static int	dnkbd_send(struct dnkbd_softc *, const uint8_t *, size_t);
+static int	dnsubmatch_kbd(device_t, cfdata_t, const int *, void *);
+static int	dnsubmatch_mouse(device_t, cfdata_t, const int *, void *);
 
 int
 dnkbd_match(device_t parent, cfdata_t cf, void *aux)
@@ -232,7 +234,7 @@
 	struct frodo_attach_args *fa = aux;
 
 	if (strcmp(fa-fa_name, dnkbd_cd.cd_name) != 0)
-		return (0);
+		return 0;
 
 	if (machineid == HP_382) {
 		

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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 22:48:05 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: frodo.c

Log Message:
Fix comment (362 doesn't have frodo).


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/hp300/dev/frodo.c

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

Modified files:

Index: src/sys/arch/hp300/dev/frodo.c
diff -u src/sys/arch/hp300/dev/frodo.c:1.29 src/sys/arch/hp300/dev/frodo.c:1.30
--- src/sys/arch/hp300/dev/frodo.c:1.29	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/dev/frodo.c	Sat Feb 12 22:48:04 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: frodo.c,v 1.29 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: frodo.c,v 1.30 2011/02/12 22:48:04 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc.
@@ -56,12 +56,11 @@
 
 /*
  * Support for the Frodo (a.k.a. Apollo Utility) chip found
- * in HP Apollo 9000/4xx workstations, as well as
- * HP 9000/362 and 9000/382 controllers.
+ * in HP Apollo 9000/4xx workstations, as well as 9000/382 controllers.
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: frodo.c,v 1.29 2008/04/28 20:23:19 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: frodo.c,v 1.30 2011/02/12 22:48:04 tsutsui Exp $);
 
 #define	_HP300_INTR_H_PRIVATE
 



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

2011-02-12 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 23:10:22 UTC 2011

Modified Files:
src/sys/arch/hp300/dev: spc.c

Log Message:
Handle LED_DISK per DMA xfer.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/dev/spc.c

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

Modified files:

Index: src/sys/arch/hp300/dev/spc.c
diff -u src/sys/arch/hp300/dev/spc.c:1.7 src/sys/arch/hp300/dev/spc.c:1.8
--- src/sys/arch/hp300/dev/spc.c:1.7	Wed May 14 13:29:28 2008
+++ src/sys/arch/hp300/dev/spc.c	Sat Feb 12 23:10:22 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: spc.c,v 1.7 2008/05/14 13:29:28 tsutsui Exp $ */
+/* $NetBSD: spc.c,v 1.8 2011/02/12 23:10:22 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 2003 Izumi Tsutsui.  All rights reserved.
@@ -25,10 +25,11 @@
  */
 
 #include opt_ddb.h
+#include opt_useleds.h
 
 #include sys/cdefs.h			/* RCS ID  Copyright macro defns */
 
-__KERNEL_RCSID(0, $NetBSD: spc.c,v 1.7 2008/05/14 13:29:28 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: spc.c,v 1.8 2011/02/12 23:10:22 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -55,6 +56,10 @@
 #include hp300/dev/dmareg.h
 #include hp300/dev/dmavar.h
 
+#ifdef USELEDS
+#include hp300/hp300/leds.h
+#endif
+
 static int	spc_dio_match(device_t, cfdata_t, void *);
 static void	spc_dio_attach(device_t, device_t, void *);
 static void	spc_dio_dmastart(struct spc_softc *, void *, size_t, int);
@@ -227,6 +232,9 @@
 	bus_space_write_1(iot, iohspc, SCMD, cmd);
 
 	sc-sc_flags |= SPC_DOINGDMA;
+#ifdef USELEDS
+	ledcontrol(LED_DISK, 0, 0);
+#endif
 }
 
 static void
@@ -270,6 +278,9 @@
 	sc-sc_dleft -= trans;
 
 	sc-sc_flags = ~SPC_DOINGDMA;
+#ifdef USELEDS
+	ledcontrol(0, LED_DISK, 0);
+#endif
 }
 
 static void
@@ -286,4 +297,7 @@
 
 	dsc-sc_dflags = ~SCSI_HAVEDMA;
 	sc-sc_flags = ~SPC_DOINGDMA;
+#ifdef USELEDS
+	ledcontrol(0, LED_DISK, 0);
+#endif
 }



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

2011-02-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 03:43:50 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: bus_space.c

Log Message:
Use __func__ to print (correct) function names.


To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp300/hp300/bus_space.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/bus_space.c
diff -u src/sys/arch/hp300/hp300/bus_space.c:1.17 src/sys/arch/hp300/hp300/bus_space.c:1.18
--- src/sys/arch/hp300/hp300/bus_space.c:1.17	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/hp300/bus_space.c	Sat Feb 12 03:43:50 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.17 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.17 2008/04/28 20:23:19 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,7 +66,7 @@
 	}
 
 	if (t-bustype != HP300_BUS_SPACE_DIO)
-		panic(bus_space_map: bad space tag);
+		panic(%s: bad space tag, __FUNC__);
 
 	/*
 	 * Allocate virtual address space from the extio extent map.
@@ -112,7 +112,7 @@
 	/*
 	 * Not meaningful on any currently-supported hp300 bus.
 	 */
-	panic(bus_space_free: shouldn't be here);
+	panic(%s: shouldn't be here, __func__);
 }
 
 void
@@ -130,7 +130,7 @@
 	}
 
 	if (t-bustype != HP300_BUS_SPACE_DIO)
-		panic(bus_space_map: bad space tag);
+		panic(%s: bad space tag, __func__);
 
 	kva = m68k_trunc_page(bsh);
 	offset = m68k_page_offset(bsh);
@@ -139,7 +139,7 @@
 #ifdef DIAGNOSTIC
 	if (bsh  (vaddr_t)extiobase ||
 	bsh = ((vaddr_t)extiobase + ptoa(EIOMAPSIZE)))
-		panic(bus_space_unmap: bad bus space handle);
+		panic(%s: bad bus space handle, __func__);
 #endif
 
 	/*
@@ -152,8 +152,8 @@
 	 */
 	if (extent_free(extio_ex, kva, size,
 	EX_NOWAIT | (extio_ex_malloc_safe ? EX_MALLOCOK : 0)))
-		printf(bus_space_unmap: kva 0x%lx size 0x%lx: 
-		can't free region\n, (u_long) bsh, size);
+		printf(%s: kva 0x%lx size 0x%lx: 
+		can't free region\n, __func-_, (u_long)bsh, size);
 }
 
 /* ARGSUSED */
@@ -194,7 +194,7 @@
 		break;
 
 	default:
-		panic(bus_space_probe: unupported data size %d, sz);
+		panic(%s: unupported data size %d, __func__, sz);
 		/* NOTREACHED */
 	}
 



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

2011-02-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 04:52:28 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: bus_space.c

Log Message:
Umm, fix typo.


To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/hp300/hp300/bus_space.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/bus_space.c
diff -u src/sys/arch/hp300/hp300/bus_space.c:1.18 src/sys/arch/hp300/hp300/bus_space.c:1.19
--- src/sys/arch/hp300/hp300/bus_space.c:1.18	Sat Feb 12 03:43:50 2011
+++ src/sys/arch/hp300/hp300/bus_space.c	Sat Feb 12 04:52:28 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.19 2011/02/12 04:52:28 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.18 2011/02/12 03:43:50 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.19 2011/02/12 04:52:28 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -66,7 +66,7 @@
 	}
 
 	if (t-bustype != HP300_BUS_SPACE_DIO)
-		panic(%s: bad space tag, __FUNC__);
+		panic(%s: bad space tag, __func__);
 
 	/*
 	 * Allocate virtual address space from the extio extent map.
@@ -153,7 +153,7 @@
 	if (extent_free(extio_ex, kva, size,
 	EX_NOWAIT | (extio_ex_malloc_safe ? EX_MALLOCOK : 0)))
 		printf(%s: kva 0x%lx size 0x%lx: 
-		can't free region\n, __func-_, (u_long)bsh, size);
+		can't free region\n, __func__, (u_long)bsh, size);
 }
 
 /* ARGSUSED */



CVS commit: src/sys/arch/hp300

2011-02-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 05:08:41 UTC 2011

Modified Files:
src/sys/arch/hp300/conf: GENERIC INSTALL files.hp300
src/sys/arch/hp300/dev: diofbreg.h diofbvar.h
src/sys/arch/hp300/hp300: autoconf.c
src/sys/arch/hp300/stand: Makefile.buildboot
src/sys/arch/hp300/stand/common: grfreg.h ite.c ite_subr.c itevar.h
Added Files:
src/sys/arch/hp300/dev: gendiofb.c
src/sys/arch/hp300/stand/common: ite_dumb.c

Log Message:
Add dumb framebuffer (no acceleration, no colormap) support
for HP362 and HP382.

Tested on A1473-69510 (HP362 VGA-res) and A1474-69511 (HP382 mid-res).


To generate a diff of this commit:
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/hp300/conf/INSTALL
cvs rdiff -u -r1.79 -r1.80 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/hp300/dev/diofbreg.h \
src/sys/arch/hp300/dev/diofbvar.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/dev/gendiofb.c
cvs rdiff -u -r1.96 -r1.97 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/hp300/stand/Makefile.buildboot
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/hp300/stand/common/grfreg.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/stand/common/ite_dumb.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/ite_subr.c
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/stand/common/itevar.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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.161 src/sys/arch/hp300/conf/GENERIC:1.162
--- src/sys/arch/hp300/conf/GENERIC:1.161	Sun Feb  6 18:40:55 2011
+++ src/sys/arch/hp300/conf/GENERIC	Sat Feb 12 05:08:40 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.161 2011/02/06 18:40:55 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.162 2011/02/12 05:08:40 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.161 $
+#ident 		GENERIC-$Revision: 1.162 $
 
 maxusers	32		# estimated number of users
 
@@ -236,6 +236,9 @@
 tvrx*		at dio? scode ?		# TurboVRX framebuffer
 wsdisplay*	at tvrx?
 
+gendiofb*	at dio? scode ?		# dumb framebuffer support for 362/382
+wsdisplay*	at gendiofb?
+
 com0		at dio0 scode 9		# DCA serial interfaces
 com*		at dio? scode ?
 

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.42 src/sys/arch/hp300/conf/INSTALL:1.43
--- src/sys/arch/hp300/conf/INSTALL:1.42	Sun Feb  6 18:26:53 2011
+++ src/sys/arch/hp300/conf/INSTALL	Sat Feb 12 05:08:40 2011
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.42 2011/02/06 18:26:53 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.43 2011/02/12 05:08:40 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -183,6 +183,9 @@
 tvrx*		at dio? scode ?
 wsdisplay*	at tvrx?
 
+gendiofb*	at dio? scode ?
+wsdisplay*	at gendiofb?
+
 com*		at dio0 scode 9		# DCA serial interfaces
 com*		at dio? scode ?
 

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.79 src/sys/arch/hp300/conf/files.hp300:1.80
--- src/sys/arch/hp300/conf/files.hp300:1.79	Sun Feb  6 18:26:53 2011
+++ src/sys/arch/hp300/conf/files.hp300	Sat Feb 12 05:08:40 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.79 2011/02/06 18:26:53 tsutsui Exp $
+#	$NetBSD: files.hp300,v 1.80 2011/02/12 05:08:40 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -113,6 +113,10 @@
 attach	tvrx at dio
 file	arch/hp300/dev/tvrx.c			tvrx	needs-flag
 
+device	gendiofb: wsemuldisplaydev, diofb, rasops8
+attach	gendiofb at dio
+file	arch/hp300/dev/gendiofb.c		gendiofb	needs-flag
+
 #
 # Devices on the DIO bus
 #

Index: src/sys/arch/hp300/dev/diofbreg.h
diff -u src/sys/arch/hp300/dev/diofbreg.h:1.1 src/sys/arch/hp300/dev/diofbreg.h:1.2
--- src/sys/arch/hp300/dev/diofbreg.h:1.1	Sun Feb  6 18:26:51 2011
+++ src/sys/arch/hp300/dev/diofbreg.h	Sat Feb 12 05:08:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofbreg.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $	*/
+/*	$NetBSD: diofbreg.h,v 1.2 2011/02/12 05:08:40 tsutsui Exp $	*/
 /*	$OpenBSD: diofbreg.h,v 1.3 2007/01/07 15:13:52 miod Exp $	*/
 
 /*
@@ -58,6 +58,8 @@
 #define GID_TIGER  12
 #define GID_YGENESIS   13
 #define GID_HYPERION   14
+#define GID_A1474MID   16
+#define GID_A147xVGA   17
 
 #ifndef	_LOCORE
 struct	diofbreg {
Index: src/sys/arch/hp300/dev/diofbvar.h
diff -u src/sys/arch/hp300/dev/diofbvar.h:1.1 src/sys/arch/hp300/dev/diofbvar.h:1.2
--- src/sys/arch/hp300/dev/diofbvar.h:1.1	Sun Feb  6 18:26:51 2011
+++ src/sys/arch/hp300/dev/diofbvar.h	Sat Feb 12 05:08:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: diofbvar.h,v 1.1 2011/02/06 18:26:51 tsutsui Exp $	*/
+/*	$NetBSD: diofbvar.h,v 1.2 2011/02/12 05:08:40 tsutsui Exp $	*/
 /*	$OpenBSD: diofbvar.h,v 1.10 2006/08/11 

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

2011-02-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 05:09:15 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/inst: version
src/sys/arch/hp300/stand/uboot: version

Log Message:
Bump version for 362 and 382 framebuffer support.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/inst/version
cvs rdiff -u -r1.17 -r1.18 src/sys/arch/hp300/stand/uboot/version

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

Modified files:

Index: src/sys/arch/hp300/stand/inst/version
diff -u src/sys/arch/hp300/stand/inst/version:1.10 src/sys/arch/hp300/stand/inst/version:1.11
--- src/sys/arch/hp300/stand/inst/version:1.10	Thu Feb 10 12:47:08 2011
+++ src/sys/arch/hp300/stand/inst/version	Sat Feb 12 05:09:15 2011
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.10 2011/02/10 12:47:08 tsutsui Exp $
+$NetBSD: version,v 1.11 2011/02/12 05:09:15 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for HP-IB cartridge tapes
@@ -10,3 +10,4 @@
 1.8:	Identify HP362 and HP382
 1.9:	Change boot messages to replace build date and maker with kernrev.
 1.10:	Pull OpenBSD's ite driver reorganization.
+1.11:	Add support for framebuffers on HP362 and HP382.

Index: src/sys/arch/hp300/stand/uboot/version
diff -u src/sys/arch/hp300/stand/uboot/version:1.17 src/sys/arch/hp300/stand/uboot/version:1.18
--- src/sys/arch/hp300/stand/uboot/version:1.17	Thu Feb 10 12:47:08 2011
+++ src/sys/arch/hp300/stand/uboot/version	Sat Feb 12 05:09:15 2011
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.17 2011/02/10 12:47:08 tsutsui Exp $
+$NetBSD: version,v 1.18 2011/02/12 05:09:15 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for network booting
@@ -17,3 +17,4 @@
 1.15:	Identify HP362 and HP382
 1.16:	Change boot messages to replace build date and maker with kernrev.
 1.17:	Pull OpenBSD's ite driver reorganization.
+1.18:	Add support for framebuffers on HP362 and HP382.



CVS commit: src/sys/arch/hp300

2011-02-11 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Feb 12 05:15:39 UTC 2011

Modified Files:
src/sys/arch/hp300/conf: GENERIC INSTALL files.hp300
src/sys/arch/hp300/hp300: bus_space.c
src/sys/arch/hp300/include: bus.h
Added Files:
src/sys/arch/hp300/dev: sgc.c sgcreg.h sgcvar.h

Log Message:
Pull basic SGC bus attachment from OpenBSD to test devices.
Disabled by default since there is no SGC drivers yet.


To generate a diff of this commit:
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/hp300/conf/GENERIC
cvs rdiff -u -r1.43 -r1.44 src/sys/arch/hp300/conf/INSTALL
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/dev/sgc.c \
src/sys/arch/hp300/dev/sgcreg.h src/sys/arch/hp300/dev/sgcvar.h
cvs rdiff -u -r1.19 -r1.20 src/sys/arch/hp300/hp300/bus_space.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/hp300/include/bus.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/hp300/conf/GENERIC
diff -u src/sys/arch/hp300/conf/GENERIC:1.162 src/sys/arch/hp300/conf/GENERIC:1.163
--- src/sys/arch/hp300/conf/GENERIC:1.162	Sat Feb 12 05:08:40 2011
+++ src/sys/arch/hp300/conf/GENERIC	Sat Feb 12 05:15:39 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.162 2011/02/12 05:08:40 tsutsui Exp $
+# $NetBSD: GENERIC,v 1.163 2011/02/12 05:15:39 tsutsui Exp $
 #
 # GENERIC machine description file
 #
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.162 $
+#ident 		GENERIC-$Revision: 1.163 $
 
 maxusers	32		# estimated number of users
 
@@ -194,6 +194,7 @@
 
 intio0		at mainbus0		# internal i/o space
 dio0		at mainbus0		# DIO/DIO-II bus
+#sgc0		at mainbus0		# SGC bus
 
 # Human Interface Loop devices
 hil0		at intio?		# HIL controller

Index: src/sys/arch/hp300/conf/INSTALL
diff -u src/sys/arch/hp300/conf/INSTALL:1.43 src/sys/arch/hp300/conf/INSTALL:1.44
--- src/sys/arch/hp300/conf/INSTALL:1.43	Sat Feb 12 05:08:40 2011
+++ src/sys/arch/hp300/conf/INSTALL	Sat Feb 12 05:15:39 2011
@@ -1,4 +1,4 @@
-# $NetBSD: INSTALL,v 1.43 2011/02/12 05:08:40 tsutsui Exp $
+# $NetBSD: INSTALL,v 1.44 2011/02/12 05:15:39 tsutsui Exp $
 #
 # INSTALL machine description file
 #
@@ -135,6 +135,7 @@
 
 intio0		at mainbus0	# internal i/o space
 dio0		at mainbus0	# DIO/DIO-II bus
+#sgc0		at mainbus0	# SGC bus
 
 # Real-time clock (not optional)
 rtc*		at intio?

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.80 src/sys/arch/hp300/conf/files.hp300:1.81
--- src/sys/arch/hp300/conf/files.hp300:1.80	Sat Feb 12 05:08:40 2011
+++ src/sys/arch/hp300/conf/files.hp300	Sat Feb 12 05:15:39 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.80 2011/02/12 05:08:40 tsutsui Exp $
+#	$NetBSD: files.hp300,v 1.81 2011/02/12 05:15:39 tsutsui Exp $
 #
 # hp300-specific configuration info
 
@@ -43,6 +43,14 @@
 file	arch/hp300/dev/dio.c		dio
 
 #
+# SGC bus
+#
+
+device	sgc { scode = -1 }
+attach	sgc at mainbus
+file	arch/hp300/dev/sgc.c		sgc
+
+#
 # Devices in Internal i/o space
 #
 

Index: src/sys/arch/hp300/hp300/bus_space.c
diff -u src/sys/arch/hp300/hp300/bus_space.c:1.19 src/sys/arch/hp300/hp300/bus_space.c:1.20
--- src/sys/arch/hp300/hp300/bus_space.c:1.19	Sat Feb 12 04:52:28 2011
+++ src/sys/arch/hp300/hp300/bus_space.c	Sat Feb 12 05:15:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.19 2011/02/12 04:52:28 tsutsui Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.20 2011/02/12 05:15:39 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.19 2011/02/12 04:52:28 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.20 2011/02/12 05:15:39 tsutsui Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -65,7 +65,8 @@
 		return 0;
 	}
 
-	if (t-bustype != HP300_BUS_SPACE_DIO)
+	if (t-bustype != HP300_BUS_SPACE_DIO 
+	t-bustype != HP300_BUS_SPACE_SGC)
 		panic(%s: bad space tag, __func__);
 
 	/*
@@ -129,7 +130,8 @@
 		return;
 	}
 
-	if (t-bustype != HP300_BUS_SPACE_DIO)
+	if (t-bustype != HP300_BUS_SPACE_DIO 
+	t-bustype != HP300_BUS_SPACE_SGC)
 		panic(%s: bad space tag, __func__);
 
 	kva = m68k_trunc_page(bsh);

Index: src/sys/arch/hp300/include/bus.h
diff -u src/sys/arch/hp300/include/bus.h:1.15 src/sys/arch/hp300/include/bus.h:1.16
--- src/sys/arch/hp300/include/bus.h:1.15	Mon Apr 28 20:23:19 2008
+++ src/sys/arch/hp300/include/bus.h	Sat Feb 12 05:15:39 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus.h,v 1.15 2008/04/28 20:23:19 martin Exp $	*/
+/*	$NetBSD: bus.h,v 1.16 2011/02/12 05:15:39 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -64,6 +64,7 @@
  */
 #define	HP300_BUS_SPACE_INTIO	0	/* space is intio space */
 #define	HP300_BUS_SPACE_DIO	1	/* space is dio space */
+#define	HP300_BUS_SPACE_SGC	2	/* space is sgc space */
 
 

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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 10:44:23 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/common: ite.c ite_subr.c itevar.h

Log Message:
All framebuffer drivers use common readbyte and writeglyph functions
so no need to put them into per driver function pointers. From OpenBSD.

Tested on HP382 (serial) and HP425t (topcat).


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/hp300/stand/common/ite_subr.c
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/stand/common/itevar.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/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.11 src/sys/arch/hp300/stand/common/ite.c:1.12
--- src/sys/arch/hp300/stand/common/ite.c:1.11	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite.c	Thu Feb 10 10:44:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.11 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite.c,v 1.12 2011/02/10 10:44:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -64,35 +64,35 @@
 struct itesw itesw[] = {
 	{ GID_TOPCAT,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_GATORBOX,
 	gbox_init,	ite_deinit_noop, gbox_clear,	gbox_putc,
-	gbox_cursor,	gbox_scroll,	ite_readbyte,	ite_writeglyph },
+	gbox_cursor,	gbox_scroll },
 
 	{ GID_RENAISSANCE,
 	rbox_init,	ite_deinit_noop, rbox_clear,	rbox_putc,
-	rbox_cursor,	rbox_scroll,	ite_readbyte,	ite_writeglyph },
+	rbox_cursor,	rbox_scroll },
 
 	{ GID_LRCATSEYE,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_HRCCATSEYE,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_HRMCATSEYE,
 	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll,	ite_readbyte,	ite_writeglyph },
+	topcat_cursor,	topcat_scroll },
 
 	{ GID_DAVINCI,
   	dvbox_init,	ite_deinit_noop, dvbox_clear,	dvbox_putc,
-	dvbox_cursor,	dvbox_scroll,	ite_readbyte,	ite_writeglyph },
+	dvbox_cursor,	dvbox_scroll },
 
 	{ GID_HYPERION,
 	hyper_init,	ite_deinit_noop, hyper_clear,	hyper_putc,
-	hyper_cursor,	hyper_scroll,	ite_readbyte,	ite_writeglyph },
+	hyper_cursor,	hyper_scroll },
 };
 int	nitesw = sizeof(itesw) / sizeof(itesw[0]);
 

Index: src/sys/arch/hp300/stand/common/ite_subr.c
diff -u src/sys/arch/hp300/stand/common/ite_subr.c:1.7 src/sys/arch/hp300/stand/common/ite_subr.c:1.8
--- src/sys/arch/hp300/stand/common/ite_subr.c:1.7	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite_subr.c	Thu Feb 10 10:44:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_subr.c,v 1.7 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite_subr.c,v 1.8 2011/02/10 10:44:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,6 +47,8 @@
 #include hp300/stand/common/samachdep.h
 #include hp300/stand/common/itevar.h
 
+static void ite_writeglyph(struct ite_data *, u_char *, u_char *);
+
 void
 ite_fontinfo(struct ite_data *ip)
 {
@@ -99,21 +101,11 @@
 			*dp++ = getbyte(ip, romp);
 			romp += 2;
 		}
-		writeglyph(ip, fbmem, fontbuf);
+		ite_writeglyph(ip, fbmem, fontbuf);
 	}
 }
 
-/*
- * Display independent versions of the readbyte and writeglyph routines.
- */
-u_char
-ite_readbyte(struct ite_data *ip, int disp)
-{
-
-	return (u_char)*(((u_char *)ip-regbase) + disp);
-}
-
-void
+static void
 ite_writeglyph(struct ite_data *ip, u_char *fbmem, u_char *glyphp)
 {
 	int bn;

Index: src/sys/arch/hp300/stand/common/itevar.h
diff -u src/sys/arch/hp300/stand/common/itevar.h:1.8 src/sys/arch/hp300/stand/common/itevar.h:1.9
--- src/sys/arch/hp300/stand/common/itevar.h:1.8	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/itevar.h	Thu Feb 10 10:44:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: itevar.h,v 1.8 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: itevar.h,v 1.9 2011/02/10 10:44:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -45,14 +45,11 @@
 #define ITEUNIT(dev)   minor(dev)
 
 #define getbyte(ip, offset) \
-	((*(ip)-isw-ite_readbyte)(ip, offset))
+	*(((u_char *)(ip)-regbase) + (offset))
 
 #define getword(ip, offset) \
 	((getbyte(ip, offset)  8) | getbyte(ip, (offset) + 2))
 
-#define writeglyph(ip, offset, fontbuf) \
-	((*(ip)-isw-ite_writeglyph)((ip), (offset), (fontbuf)))
-
 struct ite_data {
 	int	flags;
 	struct	tty *tty;
@@ -84,8 +81,6 @@
 	void	(*ite_putc)(struct ite_data *, int, int, int, int);
 	void	(*ite_cursor)(struct ite_data *, int);
 	void	(*ite_scroll)(struct ite_data *, int, int, int, int);
-	u_char	(*ite_readbyte)(struct ite_data *, int);
-	void	

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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 10:52:01 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/common: itevar.h

Log Message:
bcopy() - memmove()

How did this one survive several sweeps?


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/stand/common/itevar.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/hp300/stand/common/itevar.h
diff -u src/sys/arch/hp300/stand/common/itevar.h:1.9 src/sys/arch/hp300/stand/common/itevar.h:1.10
--- src/sys/arch/hp300/stand/common/itevar.h:1.9	Thu Feb 10 10:44:23 2011
+++ src/sys/arch/hp300/stand/common/itevar.h	Thu Feb 10 10:52:01 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: itevar.h,v 1.9 2011/02/10 10:44:23 tsutsui Exp $	*/
+/*	$NetBSD: itevar.h,v 1.10 2011/02/10 10:52:01 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -99,9 +99,9 @@
 	memset(ip-attrbuf + ((sy) * ip-cols) + (sx), 0, (h) * (w))
   
 #define attrmov(ip, sy, sx, dy, dx, h, w) \
-	bcopy(ip-attrbuf + ((sy) * ip-cols) + (sx), \
-	  ip-attrbuf + ((dy) * ip-cols) + (dx), \
-	  (h) * (w))
+	memmove(ip-attrbuf + ((dy) * ip-cols) + (dx), \
+	ip-attrbuf + ((sy) * ip-cols) + (sx), \
+	(h) * (w))
 
 #define attrtest(ip, attr) \
 	((* (u_char *) attrloc(ip, ip-cury, ip-curx))  attr)



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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 11:08:24 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/common: ite_dv.c ite_gb.c ite_hy.c ite_rb.c
ite_subr.c ite_tc.c itevar.h

Log Message:
Move and renamve hyper_ite_fontinit() to ite_fontinit1bpp() to share it
among all monochrome framebuffers.  Also rename ite_fontinit() to
ite_fontinit8bpp(). From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/hp300/stand/common/ite_dv.c \
src/sys/arch/hp300/stand/common/ite_gb.c \
src/sys/arch/hp300/stand/common/ite_subr.c \
src/sys/arch/hp300/stand/common/ite_tc.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/ite_hy.c \
src/sys/arch/hp300/stand/common/itevar.h
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/stand/common/ite_rb.c

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

Modified files:

Index: src/sys/arch/hp300/stand/common/ite_dv.c
diff -u src/sys/arch/hp300/stand/common/ite_dv.c:1.8 src/sys/arch/hp300/stand/common/ite_dv.c:1.9
--- src/sys/arch/hp300/stand/common/ite_dv.c:1.8	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite_dv.c	Thu Feb 10 11:08:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_dv.c,v 1.8 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite_dv.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -115,7 +115,7 @@
 	db_waitbusy(regbase);
 
 	ite_fontinfo(ip);
-	ite_fontinit(ip);
+	ite_fontinit8bpp(ip);
 
 	/*
 	 * Clear the (visible) framebuffer.
Index: src/sys/arch/hp300/stand/common/ite_gb.c
diff -u src/sys/arch/hp300/stand/common/ite_gb.c:1.8 src/sys/arch/hp300/stand/common/ite_gb.c:1.9
--- src/sys/arch/hp300/stand/common/ite_gb.c:1.8	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite_gb.c	Thu Feb 10 11:08:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_gb.c,v 1.8 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite_gb.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -91,7 +91,7 @@
 	gbcm_waitbusy(regbase);
 
 	ite_fontinfo(ip);
-	ite_fontinit(ip);
+	ite_fontinit8bpp(ip);
 
 	/*
 	 * Clear the display. This used to be before the font unpacking
Index: src/sys/arch/hp300/stand/common/ite_subr.c
diff -u src/sys/arch/hp300/stand/common/ite_subr.c:1.8 src/sys/arch/hp300/stand/common/ite_subr.c:1.9
--- src/sys/arch/hp300/stand/common/ite_subr.c:1.8	Thu Feb 10 10:44:22 2011
+++ src/sys/arch/hp300/stand/common/ite_subr.c	Thu Feb 10 11:08:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_subr.c,v 1.8 2011/02/10 10:44:22 tsutsui Exp $	*/
+/*	$NetBSD: ite_subr.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -82,7 +82,35 @@
 }
 
 void
-ite_fontinit(struct ite_data *ip)
+ite_fontinit1bpp(struct ite_data *ip)
+{
+	u_char *fbmem, *dp;
+	int c, l, b;
+	int stride, width;
+
+	dp = (u_char *)(getword(ip, getword(ip, FONTROM) + FONTADDR) +
+	(char *)ip-regbase) + FONTDATA;
+	stride = ip-fbwidth  3;
+	width = (ip-ftwidth + 7) / 8;
+
+	for (c = 0; c  128; c++) {
+		fbmem = (u_char *) FBBASE +
+			(ip-fonty + (c / ip-cpl) * ip-ftheight) *
+			stride;
+		fbmem += (ip-fontx  3) + (c % ip-cpl) * width;
+		for (l = 0; l  ip-ftheight; l++) {
+			for (b = 0; b  width; b++) {
+*fbmem++ = *dp;
+dp += 2;
+			}
+			fbmem -= width;
+			fbmem += stride;
+		}
+	}
+}
+
+void
+ite_fontinit8bpp(struct ite_data *ip)
 {
 	int bytewidth = (((ip-ftwidth - 1) / 8) + 1);
 	int glyphsize = bytewidth * ip-ftheight;
Index: src/sys/arch/hp300/stand/common/ite_tc.c
diff -u src/sys/arch/hp300/stand/common/ite_tc.c:1.8 src/sys/arch/hp300/stand/common/ite_tc.c:1.9
--- src/sys/arch/hp300/stand/common/ite_tc.c:1.8	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite_tc.c	Thu Feb 10 11:08:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_tc.c,v 1.8 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite_tc.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -99,7 +99,7 @@
 	topcat_windowmove(ip, 0, 0, 0, 0, ip-fbheight, ip-fbwidth, RR_CLEAR);
 	tc_waitbusy(regbase, ip-planemask);
 
-	ite_fontinit(ip);
+	ite_fontinit8bpp(ip);
 
 	/*
 	 * Stash the inverted cursor.

Index: src/sys/arch/hp300/stand/common/ite_hy.c
diff -u src/sys/arch/hp300/stand/common/ite_hy.c:1.10 src/sys/arch/hp300/stand/common/ite_hy.c:1.11
--- src/sys/arch/hp300/stand/common/ite_hy.c:1.10	Tue Feb  8 20:20:14 2011
+++ src/sys/arch/hp300/stand/common/ite_hy.c	Thu Feb 10 11:08:23 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_hy.c,v 1.10 2011/02/08 20:20:14 rmind Exp $	*/
+/*	$NetBSD: ite_hy.c,v 1.11 2011/02/10 11:08:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -55,7 +55,6 @@
 #define	charX(ip,c)	\
 	(((c) % (ip)-cpl) * ip)-ftwidth + 7) / 8) * 8) + (ip)-fontx)
 
-void hyper_ite_fontinit(struct ite_data *);
 void hyper_windowmove(struct ite_data *, int, int, int, int, int, int, int);
 
 

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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 11:17:21 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/common: ite.c itevar.h

Log Message:
Remove unused deinit functions. From OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/itevar.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/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.12 src/sys/arch/hp300/stand/common/ite.c:1.13
--- src/sys/arch/hp300/stand/common/ite.c:1.12	Thu Feb 10 10:44:22 2011
+++ src/sys/arch/hp300/stand/common/ite.c	Thu Feb 10 11:17:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.12 2011/02/10 10:44:22 tsutsui Exp $	*/
+/*	$NetBSD: ite.c,v 1.13 2011/02/10 11:17:21 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -57,41 +57,40 @@
 #include hp300/stand/common/samachdep.h
 
 static void iteconfig(void);
-static void ite_deinit_noop(struct ite_data *);
 static void ite_clrtoeol(struct ite_data *, struct itesw *, int, int);
 static void itecheckwrap(struct ite_data *, struct itesw *);
 
 struct itesw itesw[] = {
 	{ GID_TOPCAT,
-	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
+	topcat_init,	topcat_clear,	topcat_putc,
 	topcat_cursor,	topcat_scroll },
 
 	{ GID_GATORBOX,
-	gbox_init,	ite_deinit_noop, gbox_clear,	gbox_putc,
+	gbox_init,	gbox_clear,	gbox_putc,
 	gbox_cursor,	gbox_scroll },
 
 	{ GID_RENAISSANCE,
-	rbox_init,	ite_deinit_noop, rbox_clear,	rbox_putc,
+	rbox_init,	rbox_clear,	rbox_putc,
 	rbox_cursor,	rbox_scroll },
 
 	{ GID_LRCATSEYE,
-	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
+	topcat_init,	topcat_clear,	topcat_putc,
 	topcat_cursor,	topcat_scroll },
 
 	{ GID_HRCCATSEYE,
-	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
+	topcat_init,	topcat_clear,	topcat_putc,
 	topcat_cursor,	topcat_scroll },
 
 	{ GID_HRMCATSEYE,
-	topcat_init,	ite_deinit_noop, topcat_clear,	topcat_putc,
+	topcat_init,	topcat_clear,	topcat_putc,
 	topcat_cursor,	topcat_scroll },
 
 	{ GID_DAVINCI,
-  	dvbox_init,	ite_deinit_noop, dvbox_clear,	dvbox_putc,
+  	dvbox_init,	dvbox_clear,	dvbox_putc,
 	dvbox_cursor,	dvbox_scroll },
 
 	{ GID_HYPERION,
-	hyper_init,	ite_deinit_noop, hyper_clear,	hyper_putc,
+	hyper_init,	hyper_clear,	hyper_putc,
 	hyper_cursor,	hyper_scroll },
 };
 int	nitesw = sizeof(itesw) / sizeof(itesw[0]);
@@ -303,9 +302,3 @@
 #endif
 }
 #endif
-
-/* ARGSUSED */
-static void
-ite_deinit_noop(struct ite_data *ip)
-{
-}

Index: src/sys/arch/hp300/stand/common/itevar.h
diff -u src/sys/arch/hp300/stand/common/itevar.h:1.11 src/sys/arch/hp300/stand/common/itevar.h:1.12
--- src/sys/arch/hp300/stand/common/itevar.h:1.11	Thu Feb 10 11:08:23 2011
+++ src/sys/arch/hp300/stand/common/itevar.h	Thu Feb 10 11:17:21 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: itevar.h,v 1.11 2011/02/10 11:08:23 tsutsui Exp $	*/
+/*	$NetBSD: itevar.h,v 1.12 2011/02/10 11:17:21 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -76,7 +76,6 @@
 struct itesw {
 	int	ite_hwid;
 	void	(*ite_init)(struct ite_data *);
-	void	(*ite_deinit)(struct ite_data *);
 	void	(*ite_clear)(struct ite_data *, int, int, int, int);
 	void	(*ite_putc)(struct ite_data *, int, int, int, int);
 	void	(*ite_cursor)(struct ite_data *, int);



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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 12:46:22 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/common: ite.c ite_dv.c ite_gb.c ite_hy.c
ite_rb.c ite_subr.c ite_tc.c itevar.h

Log Message:
Pull OpenBSD's standalone ITE driver reorganization:
 - merge similar clear, putc, cursor, and scroll ops for all DIO framebuffers
 - rename and move hyper_windowmove() to ite_dio_windowmove1bpp()
   to use it among all dumb monochrome framebuffers
 - ditto hyper_putc() to ite_dio_putc1bpp()
 - remove unnecessary flags, macro, function args, and structure members
 - remove trailing spaces and tabs

Also misc cosmetics to reduce diffs from OpenBSD,
and some KNF that generates diffs from OpenBSD.

Tested on HP382 and HP425t.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/stand/common/ite_dv.c \
src/sys/arch/hp300/stand/common/ite_gb.c \
src/sys/arch/hp300/stand/common/ite_subr.c \
src/sys/arch/hp300/stand/common/ite_tc.c
cvs rdiff -u -r1.11 -r1.12 src/sys/arch/hp300/stand/common/ite_hy.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/hp300/stand/common/ite_rb.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/hp300/stand/common/itevar.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/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.13 src/sys/arch/hp300/stand/common/ite.c:1.14
--- src/sys/arch/hp300/stand/common/ite.c:1.13	Thu Feb 10 11:17:21 2011
+++ src/sys/arch/hp300/stand/common/ite.c	Thu Feb 10 12:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.13 2011/02/10 11:17:21 tsutsui Exp $	*/
+/*	$NetBSD: ite.c,v 1.14 2011/02/10 12:46:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -62,36 +62,36 @@
 
 struct itesw itesw[] = {
 	{ GID_TOPCAT,
-	topcat_init,	topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll },
+	topcat_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 
 	{ GID_GATORBOX,
-	gbox_init,	gbox_clear,	gbox_putc,
-	gbox_cursor,	gbox_scroll },
+	gbox_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	gbox_scroll },
 
 	{ GID_RENAISSANCE,
-	rbox_init,	rbox_clear,	rbox_putc,
-	rbox_cursor,	rbox_scroll },
+	rbox_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 
 	{ GID_LRCATSEYE,
-	topcat_init,	topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll },
+	topcat_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 
 	{ GID_HRCCATSEYE,
-	topcat_init,	topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll },
+	topcat_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 
 	{ GID_HRMCATSEYE,
-	topcat_init,	topcat_clear,	topcat_putc,
-	topcat_cursor,	topcat_scroll },
+	topcat_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 
 	{ GID_DAVINCI,
-  	dvbox_init,	dvbox_clear,	dvbox_putc,
-	dvbox_cursor,	dvbox_scroll },
+  	dvbox_init,	ite_dio_clear,	ite_dio_putc8bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 
 	{ GID_HYPERION,
-	hyper_init,	hyper_clear,	hyper_putc,
-	hyper_cursor,	hyper_scroll },
+	hyper_init,	ite_dio_clear,	ite_dio_putc1bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 };
 int	nitesw = sizeof(itesw) / sizeof(itesw[0]);
 
@@ -150,7 +150,7 @@
 			ip-dwidth = ip-fbwidth;
 		if (ip-dheight  ip-fbheight)
 			ip-dheight = ip-fbheight;
-		ip-flags = ITE_ALIVE|ITE_CONSOLE;
+		ip-alive = 1;
 		i++;
 	}
 }
@@ -186,8 +186,7 @@
 			continue;
 #endif
 		ip = ite_data[ite];
-		if ((ip-flags  (ITE_ALIVE|ITE_CONSOLE))
-		!= (ITE_ALIVE|ITE_CONSOLE))
+		if (ip-alive == 0)
 			continue;
 		if ((int)ip-regbase == INTIOBASE + FB_BASE) {
 			pri = CN_INTERNAL;
@@ -238,7 +237,7 @@
 	case '\n':
 		if (++ip-cury == ip-rows) {
 			ip-cury--;
-			(*sp-ite_scroll)(ip, 1, 0, 1, SCROLL_UP);
+			(*sp-ite_scroll)(ip);
 			ite_clrtoeol(ip, sp, ip-cury, 0);
 		}
 		else
@@ -260,7 +259,7 @@
 	default:
 		if (c  ' ' || c == 0177)
 			break;
-		(*sp-ite_putc)(ip, c, ip-cury, ip-curx, ATTR_NOR);
+		(*sp-ite_putc)(ip, c, ip-cury, ip-curx);
 		(*sp-ite_cursor)(ip, DRAW_CURSOR);
 		itecheckwrap(ip, sp);
 		break;
@@ -274,7 +273,7 @@
 		ip-curx = 0;
 		if (++ip-cury == ip-rows) {
 			--ip-cury;
-			(*sp-ite_scroll)(ip, 1, 0, 1, SCROLL_UP);
+			(*sp-ite_scroll)(ip);
 			ite_clrtoeol(ip, sp, ip-cury, 0);
 			return;
 		}

Index: src/sys/arch/hp300/stand/common/ite_dv.c
diff -u src/sys/arch/hp300/stand/common/ite_dv.c:1.9 src/sys/arch/hp300/stand/common/ite_dv.c:1.10
--- src/sys/arch/hp300/stand/common/ite_dv.c:1.9	Thu Feb 10 11:08:23 2011
+++ src/sys/arch/hp300/stand/common/ite_dv.c	Thu Feb 10 12:46:22 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite_dv.c,v 1.9 2011/02/10 11:08:23 tsutsui Exp $	*/
+/*	$NetBSD: ite_dv.c,v 1.10 2011/02/10 12:46:22 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -48,8 +48,6 @@
 

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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 12:47:09 UTC 2011

Modified Files:
src/sys/arch/hp300/stand/inst: version
src/sys/arch/hp300/stand/uboot: version

Log Message:
Bump version to denote standalone ITE driver reorganization
pulled from OpenBSD.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/sys/arch/hp300/stand/inst/version
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/hp300/stand/uboot/version

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

Modified files:

Index: src/sys/arch/hp300/stand/inst/version
diff -u src/sys/arch/hp300/stand/inst/version:1.9 src/sys/arch/hp300/stand/inst/version:1.10
--- src/sys/arch/hp300/stand/inst/version:1.9	Wed Jul 16 13:44:51 2008
+++ src/sys/arch/hp300/stand/inst/version	Thu Feb 10 12:47:08 2011
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.9 2008/07/16 13:44:51 tsutsui Exp $
+$NetBSD: version,v 1.10 2011/02/10 12:47:08 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for HP-IB cartridge tapes
@@ -9,3 +9,4 @@
 1.7:	Added APCI console support
 1.8:	Identify HP362 and HP382
 1.9:	Change boot messages to replace build date and maker with kernrev.
+1.10:	Pull OpenBSD's ite driver reorganization.

Index: src/sys/arch/hp300/stand/uboot/version
diff -u src/sys/arch/hp300/stand/uboot/version:1.16 src/sys/arch/hp300/stand/uboot/version:1.17
--- src/sys/arch/hp300/stand/uboot/version:1.16	Wed Jul 16 13:44:51 2008
+++ src/sys/arch/hp300/stand/uboot/version	Thu Feb 10 12:47:08 2011
@@ -1,4 +1,4 @@
-$NetBSD: version,v 1.16 2008/07/16 13:44:51 tsutsui Exp $
+$NetBSD: version,v 1.17 2011/02/10 12:47:08 tsutsui Exp $
 
 1.1:	Initial version
 1.2:	Added support for network booting
@@ -16,3 +16,4 @@
 1.14:	Default to BOOTP network boot
 1.15:	Identify HP362 and HP382
 1.16:	Change boot messages to replace build date and maker with kernrev.
+1.17:	Pull OpenBSD's ite driver reorganization.



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

2011-02-10 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Thu Feb 10 13:04:32 UTC 2011

Modified Files:
src/sys/arch/hp300/stand: Makefile.buildboot
src/sys/arch/hp300/stand/common: ite.c itevar.h
Added Files:
src/sys/arch/hp300/stand/common: ite_tvrx.c

Log Message:
Pull support for Tigershark monochrome framebuffer from OpenBSD.
Untested (no hardware), but doesn't break existing HP425t topcat.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/hp300/stand/Makefile.buildboot
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/hp300/stand/common/ite.c
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/stand/common/ite_tvrx.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/hp300/stand/common/itevar.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/hp300/stand/Makefile.buildboot
diff -u src/sys/arch/hp300/stand/Makefile.buildboot:1.30 src/sys/arch/hp300/stand/Makefile.buildboot:1.31
--- src/sys/arch/hp300/stand/Makefile.buildboot:1.30	Sat Jan 22 19:19:17 2011
+++ src/sys/arch/hp300/stand/Makefile.buildboot	Thu Feb 10 13:04:31 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.buildboot,v 1.30 2011/01/22 19:19:17 joerg Exp $
+#	$NetBSD: Makefile.buildboot,v 1.31 2011/02/10 13:04:31 tsutsui Exp $
 
 # RELOC=FFF0 allows for boot prog up to FF000 (1044480) bytes long
 RELOC=	FFF0
@@ -56,9 +56,9 @@
 COMMONSOURCE=		srt0.S autoconf.c clock.c conf.c cons.c devopen.c \
 			exec.c machdep.c prf.c rawfs.c netio.c
 DRIVERSOURCE=		apci.c ct.c dca.c dcm.c dnkbd.c fhpib.c hil.c \
-			hpib.c if_le.c ite.c ite_dv.c ite_gb.c ite_rb.c \
-			ite_subr.c ite_tc.c ite_hy.c kbd.c kbdconf.c \
-			nhpib.c rd.c scsi.c sd.c
+			hpib.c if_le.c ite.c ite_dv.c ite_gb.c ite_hy.c \
+			ite_rb.c ite_subr.c ite_tc.c ite_tvrx.c \
+			kbd.c kbdconf.c nhpib.c rd.c scsi.c sd.c
 
 .include bsd.own.mk
 .include bsd.klinks.mk

Index: src/sys/arch/hp300/stand/common/ite.c
diff -u src/sys/arch/hp300/stand/common/ite.c:1.14 src/sys/arch/hp300/stand/common/ite.c:1.15
--- src/sys/arch/hp300/stand/common/ite.c:1.14	Thu Feb 10 12:46:22 2011
+++ src/sys/arch/hp300/stand/common/ite.c	Thu Feb 10 13:04:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ite.c,v 1.14 2011/02/10 12:46:22 tsutsui Exp $	*/
+/*	$NetBSD: ite.c,v 1.15 2011/02/10 13:04:32 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -92,6 +92,10 @@
 	{ GID_HYPERION,
 	hyper_init,	ite_dio_clear,	ite_dio_putc1bpp,
 	ite_dio_cursor,	ite_dio_scroll },
+
+	{ GID_TIGER,
+	tvrx_init,	ite_dio_clear,	ite_dio_putc1bpp,
+	ite_dio_cursor,	ite_dio_scroll },
 };
 int	nitesw = sizeof(itesw) / sizeof(itesw[0]);
 

Index: src/sys/arch/hp300/stand/common/itevar.h
diff -u src/sys/arch/hp300/stand/common/itevar.h:1.13 src/sys/arch/hp300/stand/common/itevar.h:1.14
--- src/sys/arch/hp300/stand/common/itevar.h:1.13	Thu Feb 10 12:46:22 2011
+++ src/sys/arch/hp300/stand/common/itevar.h	Thu Feb 10 13:04:32 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: itevar.h,v 1.13 2011/02/10 12:46:22 tsutsui Exp $	*/
+/*	$NetBSD: itevar.h,v 1.14 2011/02/10 13:04:32 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -132,3 +132,4 @@
 void rbox_init(struct ite_data *);
 void dvbox_init(struct ite_data *);
 void hyper_init(struct ite_data *);
+void tvrx_init(struct ite_data *);

Added files:

Index: src/sys/arch/hp300/stand/common/ite_tvrx.c
diff -u /dev/null src/sys/arch/hp300/stand/common/ite_tvrx.c:1.1
--- /dev/null	Thu Feb 10 13:04:32 2011
+++ src/sys/arch/hp300/stand/common/ite_tvrx.c	Thu Feb 10 13:04:32 2011
@@ -0,0 +1,76 @@
+/*	$NetBSD: ite_tvrx.c,v 1.1 2011/02/10 13:04:32 tsutsui Exp $	*/
+/*	$OpenBSD: ite_tvrx.c,v 1.2 2006/08/17 06:31:10 miod Exp $	*/
+
+/*
+ * Copyright (c) 1988 University of Utah.
+ * Copyright (c) 1990, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * the Systems Programming Group of the University of Utah Computer
+ * Science Department and Mark Davies of the Department of Computer
+ * Science, Victoria University of Wellington, New Zealand.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *may be used to endorse or promote products derived from this software
+ *without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, 

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

2011-02-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Feb  9 09:29:57 UTC 2011

Modified Files:
src/sys/arch/hp300/hp300: autoconf.c

Log Message:
Remove leftover debug stuff.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 src/sys/arch/hp300/hp300/autoconf.c

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

Modified files:

Index: src/sys/arch/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.94 src/sys/arch/hp300/hp300/autoconf.c:1.95
--- src/sys/arch/hp300/hp300/autoconf.c:1.94	Tue Feb  8 20:20:13 2011
+++ src/sys/arch/hp300/hp300/autoconf.c	Wed Feb  9 09:29:57 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.94 2011/02/08 20:20:13 rmind Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.94 2011/02/08 20:20:13 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $);
 
 #include dvbox.h
 #include gbox.h
@@ -764,7 +764,7 @@
 #endif
 #if NCOM_DIO  0
 	if (!dio_scan(com_dio_cnattach))
-		;//return;
+		return;
 #endif
 #if NDCM  0
 	if (!dio_scan(dcmcnattach))



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

2011-02-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Wed Feb  9 09:32:50 UTC 2011

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

Log Message:
NHIL is no more.


To generate a diff of this commit:
cvs rdiff -u -r1.95 -r1.96 src/sys/arch/hp300/hp300/autoconf.c
cvs rdiff -u -r1.217 -r1.218 src/sys/arch/hp300/hp300/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/hp300/hp300/autoconf.c
diff -u src/sys/arch/hp300/hp300/autoconf.c:1.95 src/sys/arch/hp300/hp300/autoconf.c:1.96
--- src/sys/arch/hp300/hp300/autoconf.c:1.95	Wed Feb  9 09:29:57 2011
+++ src/sys/arch/hp300/hp300/autoconf.c	Wed Feb  9 09:32:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $	*/
+/*	$NetBSD: autoconf.c,v 1.96 2011/02/09 09:32:49 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997, 2002 The NetBSD Foundation, Inc.
@@ -88,7 +88,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.95 2011/02/09 09:29:57 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: autoconf.c,v 1.96 2011/02/09 09:32:49 tsutsui Exp $);
 
 #include dvbox.h
 #include gbox.h
@@ -827,7 +827,8 @@
 	dnkbdcnattach(bst, FRODO_BASE + FRODO_APCI_OFFSET(0))
 #endif
 
-#if NHIL  0
+#if NHILKBD  0
+	/* not yet */
 	hilkbdcnattach(bst, HIL_BASE);
 #endif
 ;

Index: src/sys/arch/hp300/hp300/machdep.c
diff -u src/sys/arch/hp300/hp300/machdep.c:1.217 src/sys/arch/hp300/hp300/machdep.c:1.218
--- src/sys/arch/hp300/hp300/machdep.c:1.217	Tue Feb  8 20:20:13 2011
+++ src/sys/arch/hp300/hp300/machdep.c	Wed Feb  9 09:32:49 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.217 2011/02/08 20:20:13 rmind Exp $	*/
+/*	$NetBSD: machdep.c,v 1.218 2011/02/09 09:32:49 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.217 2011/02/08 20:20:13 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.218 2011/02/09 09:32:49 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_compat_netbsd.h
@@ -1022,7 +1022,8 @@
 static int innmihand;	/* simple mutex */
 
 /*
- * Level 7 interrupts can be caused by the keyboard or parity errors.
+ * Level 7 interrupts can be caused by HIL keyboards (in cooked mode only,
+ * but we run them in raw mode) or parity errors.
  */
 void
 nmihand(struct frame frame)
@@ -1033,57 +1034,12 @@
 		return;
 	innmihand = 1;
 
-#if NHIL  0
-	/* Check for keyboard CRTL+SHIFT+RESET. */
-	if (kbdnmi()) {
-		printf(Got a keyboard NMI);
-
-		/*
-		 * We can:
-		 *
-		 *	- enter DDB
-		 *
-		 *	- Start the crashandburn sequence
-		 *
-		 *	- Ignore it.
-		 */
-#ifdef DDB
-		printf(: entering debugger\n);
-		Debugger();
-#else
-#ifdef PANICBUTTON
-		if (panicbutton) {
-			/* XXX */
-			callout_init(candbtimer_ch, 0);
-			if (crashandburn) {
-crashandburn = 0;
-printf(: CRASH AND BURN!\n);
-panic(forced crash);
-			} else {
-/* Start the crashandburn sequence */
-printf(\n);
-crashandburn = 1;
-callout_reset(candbtimer_ch, hz / candbdiv,
-candbtimer, NULL);
-			}
-		} else
-#endif /* PANICBUTTON */
-			printf(: ignoring\n);
-#endif /* DDB */
-
-		goto nmihand_out;	/* no more work to do */
-	}
-#endif
-
 	if (parityerror(frame))
 		return;
 	/* panic?? */
 	printf(unexpected level 7 interrupt ignored\n);
 
-#if NHIL  0
-nmihand_out:
 	innmihand = 0;
-#endif
 }
 
 /*



  1   2   >