CVS commit: src/sys/arch/mac68k/obio

2021-05-13 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Thu May 13 08:47:21 UTC 2021

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
We do not match machines whose SWIM does not support the IWM register
set used by this driver (SWIM II/III, SWIM behind IOP, AV models' DMA
based controllers).  Unfortunately, this distinction does not run
cleanly along MACH_CLASS* lines, and we have to look at MACH_MAC{model} tags.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.59 src/sys/arch/mac68k/obio/iwm_fd.c:1.60
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.59	Sat Apr 24 23:36:41 2021
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Thu May 13 08:47:21 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.59 2021/04/24 23:36:41 thorpej Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.60 2021/05/13 08:47:21 hauke Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.59 2021/04/24 23:36:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.60 2021/05/13 08:47:21 hauke Exp $");
 
 #include "locators.h"
 
@@ -65,11 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1
 #include 
 #include 
 
-/**
- **	Private functions
- **/
-static int map_iwm_base(vm_offset_t);
-
 /* Autoconfig */
 int	iwm_match(device_t, cfdata_t, void *);
 void	iwm_attach(device_t, device_t, void *);
@@ -78,6 +73,10 @@ int	fd_match(device_t, cfdata_t, void *)
 void	fd_attach(device_t, device_t, void *);
 int	fd_print(void *, const char *);
 
+/**
+ **	Private functions
+ **/
+
 /* Disklabel stuff */
 static void fdGetDiskLabel(fd_softc_t *, dev_t);
 static void fdPrintDiskLabel(struct disklabel *);
@@ -164,7 +163,7 @@ int iwmDebugging = 0 /* | M_TRACE_OP
  ** Module-global Variables
  **/
 
-/* The IWM base address */
+/* The controller base address */
 u_long IWMBase;
 
 /*
@@ -273,30 +272,71 @@ struct dkdriver fd_dkDriver = {
  * to match against. After all, that's what the obio concept is 
  * about: Onboard components that are present depending (only) 
  * on machine type.
+ *
+ * While here, map the machine-dependent physical IO address of IWM
+ * to VM address.
+ *
+ * We do not match, nor return an IWMBase address for machines whose
+ * SWIM does not support the IWM register set used by this driver
+ * (SWIM II/III, SWIM behind IOP, AV models' DMA based controllers).
+ * Unfortunately, this distinction does not run cleanly along
+ * MACH_CLASS* lines, and we will have to look at MACH_MAC{model} tags.
+ *
+ * See also "What chips are in what Macs?" at
+ * ,
  */
 int
 iwm_match(device_t parent, cfdata_t match, void *aux)
 {
-	int matched;
+	int matched = 0;
 	extern u_long IOBase;		/* from mac68k/machdep.c */
 	extern u_long IWMBase;
-	
-	if (0 == map_iwm_base(IOBase)) {
-		/* 
-		 * Unknown machine HW:
-		 * The SWIM II/III chips that are present in post-Q700
-		 * '040 Macs have dropped the IWM register structure.
-		 * We know next to nothing about the SWIM.
-		 */
-		matched = 0;
-		if (TRACE_CONFIG)
-			printf("IWM or SWIM not found: Unknown location (SWIM II?).\n");
-	} else {
+
+	IWMBase = 0L;
+
+	switch (current_mac_model->class) {
+	case MACH_CLASSPB:	/* Not: 5x0, 190x */
+		if (current_mac_model->machineid == MACH_MACPB500 ||
+		current_mac_model->machineid == MACH_MACPB190 ||
+		current_mac_model->machineid == MACH_MACPB190CS)
+			break;
+		/* FALLTHROUGH */
+	case MACH_CLASSLC:	/* Only: LC II, Classic II */
+		if (current_mac_model->machineid != MACH_MACLCII &&
+		current_mac_model->machineid != MACH_MACCLASSICII)
+			break;
+		/* FALLTHROUGH */
+	case MACH_CLASSII:	/* All */
+	case MACH_CLASSIIci:	/* All */
+	case MACH_CLASSIIsi:	/* All */
+	case MACH_CLASSIIvx:	/* All */
+	case MACH_CLASSDUO:	/* All */
+		IWMBase = IOBase + 0x16000;
 		matched = 1;
-		if (TRACE_CONFIG) {
-			printf("iwm: IWMBase mapped to 0x%lx in VM.\n", 
-			IWMBase);
+		break;
+	case MACH_CLASSQ:	/* Only: 700 */
+		if (current_mac_model->machineid == MACH_MACQ700) {
+			IWMBase = IOBase + 0x1E000;
+			matched = 1;
+			break;
 		}
+		/* FALLTHROUGH */
+	case MACH_CLASSQ2:	/* None */
+	case MACH_CLASSP580:	/* None */
+	case MACH_CLASSIIfx:	/* None */
+	case MACH_CLASSAV:	/* None */
+	default:
+		IWMBase = 0L;
+		matched = 0;
+		break;
+	}
+
+	if (TRACE_CONFIG) {
+		if (matched == 0)
+			printf("IWM or original SWIM not found.\n");
+		else
+			printf("IWMBase mapped to VM addr 0x%lx.\n",
+			IWMBase);
 	}
 	return matched;
 }
@@ -337,7 +377,7 @@ iwm_attach(device_t parent, device_t sel
 		if (TRACE_CONFIG)
 			printf("iwm: Initialization completed.\n");
 	} else {
-		printf("iwm: Chip revision not supported (%d)\n", 

CVS commit: src/sys/arch/mac68k/mac68k

2021-04-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 28 02:28:06 UTC 2021

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

Log Message:
Change sccA address for Quadra 800 from base + 0xc000 to 0xc020.

The H/W partially decodes its address, and sccA is available at
offsets 0xc000, 0xc020,  The functionality is same, but Mac
toolbox ROM routines use 0xc020, and QEMU for Quadra 800 only
supports this address.

Thanks Mark Cave-Ayland for discussion, who is working on NetBSD
support to QEMU for Quadra 800!


To generate a diff of this commit:
cvs rdiff -u -r1.361 -r1.362 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.361 src/sys/arch/mac68k/mac68k/machdep.c:1.362
--- src/sys/arch/mac68k/mac68k/machdep.c:1.361	Wed Apr 28 02:00:58 2021
+++ src/sys/arch/mac68k/mac68k/machdep.c	Wed Apr 28 02:28:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.361 2021/04/28 02:00:58 rin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.362 2021/04/28 02:28:05 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.361 2021/04/28 02:00:58 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.362 2021/04/28 02:28:05 rin Exp $");
 
 #include "opt_adb.h"
 #include "opt_compat_netbsd.h"
@@ -2122,6 +2122,15 @@ mac68k_set_io_offsets(vaddr_t base)
 			mac68k_machine.scsi96_2 = 1;
 			iop_init(0);	/* For console */
 			break;
+		case MACH_MACQ800:
+			/*
+			 * The H/W partially decode address for sccA; it is
+			 * available at offsets 0xc000, 0xc020,  Here,
+			 * we choose 0xc020, where Mac toolbox ROM uses.
+			 */
+			sccA = (volatile u_char *)base + 0xc020;
+			SCSIBase = base + 0x1;
+			break;
 		case MACH_MACQ700:
 			sccA = (volatile u_char *)base + 0xc000;
 			SCSIBase = base + 0xf000;



CVS commit: src/sys/arch/mac68k/mac68k

2021-04-27 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Apr 28 02:00:59 UTC 2021

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

Log Message:
Make mac68k_set_io_offsets() a little bit cleaner:

- Via1Base is always ``base'' for all supported models.
- Set sccA and SCSIBase for each model of MACH_CLASSQ class.
- Some style fixes.

No functional changes intended.


To generate a diff of this commit:
cvs rdiff -u -r1.360 -r1.361 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.360 src/sys/arch/mac68k/mac68k/machdep.c:1.361
--- src/sys/arch/mac68k/mac68k/machdep.c:1.360	Fri Feb 26 10:54:12 2021
+++ src/sys/arch/mac68k/mac68k/machdep.c	Wed Apr 28 02:00:58 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.360 2021/02/26 10:54:12 rin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.361 2021/04/28 02:00:58 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.360 2021/02/26 10:54:12 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.361 2021/04/28 02:00:58 rin Exp $");
 
 #include "opt_adb.h"
 #include "opt_compat_netbsd.h"
@@ -2110,24 +2110,24 @@ void
 mac68k_set_io_offsets(vaddr_t base)
 {
 
+	Via1Base = (volatile u_char *)base;
+	Via2Base = Via1Base + 0x2000 * VIA2;
 	switch (current_mac_model->class) {
 	case MACH_CLASSQ:
-		Via1Base = (volatile u_char *)base;
-
-		/* The following two may be overridden. */
-		sccA = (volatile u_char *)base + 0xc000;
-		SCSIBase = base + 0xf000;
-
 		switch (current_mac_model->machineid) {
 		case MACH_MACQ900:
 		case MACH_MACQ950:
-			mac68k_machine.scsi96_2 = 1;
 			sccA = (volatile u_char *)base + 0xc020;
+			SCSIBase = base + 0xf000;
+			mac68k_machine.scsi96_2 = 1;
 			iop_init(0);	/* For console */
 			break;
 		case MACH_MACQ700:
+			sccA = (volatile u_char *)base + 0xc000;
+			SCSIBase = base + 0xf000;
 			break;
 		default:
+			sccA = (volatile u_char *)base + 0xc000;
 			SCSIBase = base + 0x1;
 			break;
 		}
@@ -2138,7 +2138,6 @@ mac68k_set_io_offsets(vaddr_t base)
 		 * machines.  This seems to be common on many of the
 		 * Quadra-type machines.
 		 */
-		Via1Base = (volatile u_char *)base;
 		sccA = (volatile u_char *)base + 0xc020;
 		SCSIBase = base + 0x1;
 		break;
@@ -2147,12 +2146,10 @@ mac68k_set_io_offsets(vaddr_t base)
 		 * Here's a queer bird... it seems to be a cross between
 		 * the two different Quadra classes.
 		 */
-		Via1Base = (volatile u_char *) base;
-		sccA = (volatile u_char *) base + 0xc020;
+		sccA = (volatile u_char *)base + 0xc020;
 		SCSIBase = base;
 		break;
 	case MACH_CLASSAV:
-		Via1Base = (volatile u_char *)base;
 		sccA = (volatile u_char *)base + 0x4000;
 		SCSIBase = base + 0x18000;
 		PSCBase = (volatile u_char *)base + 0x31000;
@@ -2164,8 +2161,7 @@ mac68k_set_io_offsets(vaddr_t base)
 	case MACH_CLASSIIsi:
 	case MACH_CLASSIIvx:
 	case MACH_CLASSLC:
-		Via1Base = (volatile u_char *)base;
-		sccA = (volatile u_char *) base + 0x4000;
+		sccA = (volatile u_char *)base + 0x4000;
 		SCSIBase = base;
 		break;
 	case MACH_CLASSIIfx:
@@ -2174,7 +2170,6 @@ mac68k_set_io_offsets(vaddr_t base)
 		 * the serial port in `compatible' mode (set in
 		 * the Serial Switch control panel before booting).
 		 */
-		Via1Base = (volatile u_char *)base;
 		sccA = (volatile u_char *)base + 0x4020;
 		SCSIBase = base;
 		iop_init(0);	/* For console */
@@ -2185,7 +2180,6 @@ mac68k_set_io_offsets(vaddr_t base)
 		current_mac_model->class);
 		break;
 	}
-	Via2Base = Via1Base + 0x2000 * VIA2;
 }
 
 #if GRAYBARS



CVS commit: src/sys/arch/mac68k/mac68k

2021-03-13 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Mar 14 03:25:01 UTC 2021

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

Log Message:
Fix DJMEMCMAX option for Quadra/Centris 650/800.

- Use jeq instead of jra for conditional branch.
- Use cmpl instead of cmp (= cmpw) for int variables.

Now, my Quadra 800 recognizes full 520MB memory!


To generate a diff of this commit:
cvs rdiff -u -r1.173 -r1.174 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.173 src/sys/arch/mac68k/mac68k/locore.s:1.174
--- src/sys/arch/mac68k/mac68k/locore.s:1.173	Tue Jul 21 06:10:26 2020
+++ src/sys/arch/mac68k/mac68k/locore.s	Sun Mar 14 03:25:01 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.173 2020/07/21 06:10:26 rin Exp $	*/
+/*	$NetBSD: locore.s,v 1.174 2021/03/14 03:25:01 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -275,16 +275,16 @@ Lstart3:
 
 #if defined(DJMEMCMAX)
 	movl	%a3,%sp@-
-	cmp	#MACH_MACC610,_C_LABEL(machineid)
-	jra	Ldjmemc610
-	cmp	#MACH_MACQ610,_C_LABEL(machineid)
-	jra	Ldjmemc610
-	cmp	#MACH_MACC650,_C_LABEL(machineid)
-	jra	Ldjmemccfg
-	cmp	#MACH_MACQ650,_C_LABEL(machineid)
-	jra	Ldjmemccfg
-	cmp	#MACH_MACQ800,_C_LABEL(machineid)
-	jra	Ldjmemccfg
+	cmpl	#MACH_MACC610,_C_LABEL(machineid)
+	jeq	Ldjmemc610
+	cmpl	#MACH_MACQ610,_C_LABEL(machineid)
+	jeq	Ldjmemc610
+	cmpl	#MACH_MACC650,_C_LABEL(machineid)
+	jeq	Ldjmemccfg
+	cmpl	#MACH_MACQ650,_C_LABEL(machineid)
+	jeq	Ldjmemccfg
+	cmpl	#MACH_MACQ800,_C_LABEL(machineid)
+	jeq	Ldjmemccfg
 
 	jra	Lnodjmemc




CVS commit: src/sys/arch/mac68k

2021-02-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Feb 26 10:54:13 UTC 2021

Modified Files:
src/sys/arch/mac68k/conf: GENERIC files.mac68k
src/sys/arch/mac68k/mac68k: machdep.c

Log Message:
Add MAC68K_MEMSIZE option to hard-code memory size in MB, instead of
that given by Booter. Work around Booter bug by which max memory is
restricted to 255MB.


To generate a diff of this commit:
cvs rdiff -u -r1.233 -r1.234 src/sys/arch/mac68k/conf/GENERIC
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.359 -r1.360 src/sys/arch/mac68k/mac68k/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/mac68k/conf/GENERIC
diff -u src/sys/arch/mac68k/conf/GENERIC:1.233 src/sys/arch/mac68k/conf/GENERIC:1.234
--- src/sys/arch/mac68k/conf/GENERIC:1.233	Thu Jan 21 06:51:55 2021
+++ src/sys/arch/mac68k/conf/GENERIC	Fri Feb 26 10:54:12 2021
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.233 2021/01/21 06:51:55 nia Exp $
+# $NetBSD: GENERIC,v 1.234 2021/02/26 10:54:12 rin Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include 	"arch/mac68k/conf/std.mac68k"
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		"GENERIC-$Revision: 1.233 $"
+#ident 		"GENERIC-$Revision: 1.234 $"
 
 makeoptions	COPTS="-O2 -fno-reorder-blocks -fno-omit-frame-pointer"
 	# See share/mk/sys.mk. -fno-omit-frame-pointer is necessary for
@@ -43,6 +43,10 @@ options 	FPU_EMULATE
 # You need to set the total memory in the MacOS Booter.
 #options 	DJMEMCMAX
 
+# Use hard-coded memory size in MB, instead of parameter given by Booter.
+# Workaround for Booter bug by which max memory is restricted to 255MB.
+#options 	MAC68K_MEMSIZE=256
+
 # Standard system options
 
 options 	INSECURE	# disable kernel security levels

Index: src/sys/arch/mac68k/conf/files.mac68k
diff -u src/sys/arch/mac68k/conf/files.mac68k:1.130 src/sys/arch/mac68k/conf/files.mac68k:1.131
--- src/sys/arch/mac68k/conf/files.mac68k:1.130	Thu Aug 22 14:52:58 2019
+++ src/sys/arch/mac68k/conf/files.mac68k	Fri Feb 26 10:54:12 2021
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mac68k,v 1.130 2019/08/22 14:52:58 rin Exp $
+#	$NetBSD: files.mac68k,v 1.131 2021/02/26 10:54:12 rin Exp $
 
 # mac68k-specific configuration info
 
@@ -10,6 +10,8 @@ defflag	opt_grf_compat.h	GRF_COMPAT
 
 defflag	opt_wsdisplay_compat.h	WSDISPLAY_COMPAT_ITEFONT
 
+defparam opt_mac68k.h		MAC68K_MEMSIZE
+
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 8
 

Index: src/sys/arch/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.359 src/sys/arch/mac68k/mac68k/machdep.c:1.360
--- src/sys/arch/mac68k/mac68k/machdep.c:1.359	Fri Feb 26 10:47:24 2021
+++ src/sys/arch/mac68k/mac68k/machdep.c	Fri Feb 26 10:54:12 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.359 2021/02/26 10:47:24 rin Exp $	*/
+/*	$NetBSD: machdep.c,v 1.360 2021/02/26 10:54:12 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.359 2021/02/26 10:47:24 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.360 2021/02/26 10:54:12 rin Exp $");
 
 #include "opt_adb.h"
 #include "opt_compat_netbsd.h"
@@ -82,6 +82,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
 #include "opt_kgdb.h"
+#include "opt_mac68k.h"
 #include "opt_modular.h"
 
 #include "akbd.h"
@@ -903,7 +904,11 @@ getenvvars(u_long flag, char *buf)
 	 */
 	mac68k_machine.machineid = machineid = getenv("MACHINEID");
 	mac68k_machine.mach_processor = getenv("PROCESSOR");
+#ifndef MAC68K_MEMSIZE
 	mac68k_machine.mach_memsize = getenv("MEMSIZE");
+#else
+	mac68k_machine.mach_memsize = MAC68K_MEMSIZE;
+#endif
 	mac68k_machine.do_graybars = getenv("GRAYBARS");
 	mac68k_machine.serial_boot_echo = getenv("SERIALECHO");
 	mac68k_machine.serial_console = getenv("SERIALCONSOLE");



CVS commit: src/sys/arch/mac68k/mac68k

2021-02-26 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Feb 26 10:47:24 UTC 2021

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

Log Message:
Sort opt_*.h. No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.358 -r1.359 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.358 src/sys/arch/mac68k/mac68k/machdep.c:1.359
--- src/sys/arch/mac68k/mac68k/machdep.c:1.358	Thu Jun 11 19:20:44 2020
+++ src/sys/arch/mac68k/mac68k/machdep.c	Fri Feb 26 10:47:24 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.358 2020/06/11 19:20:44 ad Exp $	*/
+/*	$NetBSD: machdep.c,v 1.359 2021/02/26 10:47:24 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,15 +74,16 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.358 2020/06/11 19:20:44 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.359 2021/02/26 10:47:24 rin Exp $");
 
 #include "opt_adb.h"
+#include "opt_compat_netbsd.h"
 #include "opt_copy_symtab.h"
 #include "opt_ddb.h"
 #include "opt_ddbparam.h"
 #include "opt_kgdb.h"
 #include "opt_modular.h"
-#include "opt_compat_netbsd.h"
+
 #include "akbd.h"
 #include "genfb.h"
 #include "macfb.h"



CVS commit: src/sys/arch/mac68k/obio

2021-02-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Feb 22 05:23:37 UTC 2021

Modified Files:
src/sys/arch/mac68k/obio: esp.c

Log Message:
Elucidate why synchronous transfer is disabled for AV Macs.

Sync negotiation times out when drive advertises that capability:


sd1 at scsibus0 target 1 lun 0:  disk fixed
sd1: 16384 MB, 2088 cyl, 255 head, 63 sec, 512 bytes/sect x 33554432 sectors
sd1: sync (160.00ns offset 15), 8-bit (6.250MB/s) transfers
...
sd1(esp0:0:1:0): esp0: timed out [ecb 0x9f7fc4 (flags 0x1, dleft 8, stat 0)], 

sd1(esp0:0:1:0): sync negotiation disabled
sd1(esp0:0:1:0): esp0: timed out [ecb 0x9f7fc4 (flags 0x41, dleft 8, stat 0)], 
 AGAIN
sd1: async, 8-bit transfers


This is observed for real SCSI drives as well as SCSI2SD (rev 6.0).

Note that this is not a fallout from DMA patch for AV Macs; timeout
takes place even if ``avdma'' code is forcibly disabled.

No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 src/sys/arch/mac68k/obio/esp.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/mac68k/obio/esp.c
diff -u src/sys/arch/mac68k/obio/esp.c:1.59 src/sys/arch/mac68k/obio/esp.c:1.60
--- src/sys/arch/mac68k/obio/esp.c:1.59	Mon Feb 22 04:24:41 2021
+++ src/sys/arch/mac68k/obio/esp.c	Mon Feb 22 05:23:36 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.59 2021/02/22 04:24:41 rin Exp $	*/
+/*	$NetBSD: esp.c,v 1.60 2021/02/22 05:23:36 rin Exp $	*/
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.59 2021/02/22 04:24:41 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.60 2021/02/22 05:23:36 rin Exp $");
 
 #include 
 #include 
@@ -327,8 +327,9 @@ dafb_dreq:	bst = oa->oa_tag;
 		 * No synchronous xfers w/o DMA.
 		 *
 		 * XXXRO
-		 * Also disable synchronous xfers for avdma for now,
-		 * by which some disks cannot be read.
+		 * Also disable synchronous xfers for AV Macs;
+		 * sync negotiation times out when drive advertises that
+		 * capability, even if avdma code is forcibly disabled.
 		 */
 		sc->sc_minsync = 0;
 	}



CVS commit: src/sys/arch/mac68k/obio

2021-02-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Mon Feb 22 04:24:42 UTC 2021

Modified Files:
src/sys/arch/mac68k/obio: esp.c

Log Message:
- Add missing \n's to printf(9).
- Whitespace fixes.


To generate a diff of this commit:
cvs rdiff -u -r1.58 -r1.59 src/sys/arch/mac68k/obio/esp.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/mac68k/obio/esp.c
diff -u src/sys/arch/mac68k/obio/esp.c:1.58 src/sys/arch/mac68k/obio/esp.c:1.59
--- src/sys/arch/mac68k/obio/esp.c:1.58	Tue Jul 23 15:19:07 2019
+++ src/sys/arch/mac68k/obio/esp.c	Mon Feb 22 04:24:41 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.58 2019/07/23 15:19:07 rin Exp $	*/
+/*	$NetBSD: esp.c,v 1.59 2021/02/22 04:24:41 rin Exp $	*/
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -81,7 +81,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.58 2019/07/23 15:19:07 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.59 2021/02/22 04:24:41 rin Exp $");
 
 #include 
 #include 
@@ -315,8 +315,8 @@ dafb_dreq:	bst = oa->oa_tag;
 	/* We need this to fit into the TCR... */
 	sc->sc_maxxfer = 64 * 1024;
 
-switch (current_mac_model->machineid) {
-case MACH_MACQ630:
+	switch (current_mac_model->machineid) {
+	case MACH_MACQ630:
 		/* XXX on LC630 64k xfer causes timeout error */
 		sc->sc_maxxfer = 63 * 1024;
 		break;
@@ -382,7 +382,7 @@ dafb_dreq:	bst = oa->oa_tag;
 			printf("failed to map omess buffer.\n");
 			goto out2;
 		}
-		
+
 		if (bus_dmamem_alloc(esc->sc_dmat, NBPG, 16, NBPG,
 		, 1, , BUS_DMA_NOWAIT)) {
 			printf("failed to allocate imess buffer.\n");
@@ -391,8 +391,8 @@ dafb_dreq:	bst = oa->oa_tag;
 		if (bus_dmamem_map(esc->sc_dmat, , irsegs,
 		NCR_MAX_MSG_LEN + 1, (void **)>sc_imess,
 		BUS_DMA_NOWAIT | BUS_DMA_COHERENT)) {
-			printf("failed to map imess buffer.");
-			
+			printf("failed to map imess buffer.\n");
+
 			bus_dmamem_free(esc->sc_dmat, , irsegs);
 		out3:	bus_dmamem_unmap(esc->sc_dmat, sc->sc_omess, NBPG);
 		out2:	bus_dmamem_free(esc->sc_dmat, , orsegs);
@@ -484,7 +484,7 @@ esp_dma_intr(struct ncr53c9x_softc *sc)
 
 	cnt = *esc->sc_dmalen;
 	if (*esc->sc_dmalen == 0) {
-		printf("data interrupt, but no count left.");
+		printf("data interrupt, but no count left.\n");
 	}
 
 	p = *esc->sc_dmaaddr;
@@ -624,7 +624,7 @@ esp_quick_dma_intr(struct ncr53c9x_softc
 
 	trans = esc->sc_dmasize - resid;
 	if (trans < 0) {
-		printf("dmaintr: trans < 0");
+		printf("dmaintr: trans < 0\n");
 		trans = *esc->sc_dmalen;
 	}
 
@@ -1107,7 +1107,7 @@ esp_av_pio_intr(struct ncr53c9x_softc *s
 	uint8_t *p;
 
 #if DEBUG
-	printf("[av_pio_intr: intr 0x%x stat 0x%x] ", sc->sc_espintr,
+	printf("[av_pio_intr: intr 0x%x stat 0x%x]\n", sc->sc_espintr,
 	sc->sc_espstat);
 #endif
 
@@ -1123,7 +1123,7 @@ esp_av_pio_intr(struct ncr53c9x_softc *s
 	 * Is this possible?
 	 */
 	if (cnt == 0)
-		printf("data interrupt, but no count left.");
+		printf("data interrupt, but no count left.\n");
 #endif
 
 	p = *esc->sc_dmaaddr;
@@ -1227,7 +1227,7 @@ esp_av_dma_setup(struct ncr53c9x_softc *
 #endif
 		return 0;
 	}
-	
+
 	/*
 	 * Ensure the transfer is on a 16-byte aligned boundary for
 	 * the DMA engine by doing PIO to the next 16-byte boundary.



CVS commit: src/sys/arch/mac68k

2021-01-23 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun Jan 24 05:20:23 UTC 2021

Modified Files:
src/sys/arch/mac68k/dev: if_mc.c if_mcvar.h
src/sys/arch/mac68k/obio: if_mc_obio.c

Log Message:
Add rnd(9) support.


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/mac68k/dev/if_mc.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/mac68k/dev/if_mcvar.h
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mac68k/obio/if_mc_obio.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/mac68k/dev/if_mc.c
diff -u src/sys/arch/mac68k/dev/if_mc.c:1.56 src/sys/arch/mac68k/dev/if_mc.c:1.57
--- src/sys/arch/mac68k/dev/if_mc.c:1.56	Tue Oct 20 18:17:58 2020
+++ src/sys/arch/mac68k/dev/if_mc.c	Sun Jan 24 05:20:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc.c,v 1.56 2020/10/20 18:17:58 roy Exp $	*/
+/*	$NetBSD: if_mc.c,v 1.57 2021/01/24 05:20:23 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.56 2020/10/20 18:17:58 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.57 2021/01/24 05:20:23 rin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -51,6 +51,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.
 #include 
 #include 
 
+#include 
+
 #include 
 
 #include 
@@ -158,6 +160,9 @@ mcsetup(struct mc_softc	*sc, uint8_t *ll
 	if_deferred_start_init(ifp, NULL);
 	ether_ifattach(ifp, lladdr);
 
+	rnd_attach_source(>rnd_source, ifp->if_xname, RND_TYPE_NET,
+	RND_FLAG_DEFAULT);
+
 	return 0;
 }
 
@@ -516,6 +521,8 @@ mc_tint(struct mc_softc *sc)
 	sc->sc_if.if_flags &= ~IFF_OACTIVE;
 	sc->sc_if.if_timer = 0;
 	if_schedule_deferred_start(>sc_if);
+
+	rnd_add_uint32(>rnd_source, xmtfs);
 }
 
 void
@@ -559,6 +566,8 @@ mc_rint(struct mc_softc *sc)
 	}
 
 	mace_read(sc, rxf.rx_frame, len);
+
+	rnd_add_uint32(>rnd_source, rxf.rx_rcvsts);
 #undef	rxf
 }
 

Index: src/sys/arch/mac68k/dev/if_mcvar.h
diff -u src/sys/arch/mac68k/dev/if_mcvar.h:1.16 src/sys/arch/mac68k/dev/if_mcvar.h:1.17
--- src/sys/arch/mac68k/dev/if_mcvar.h:1.16	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/if_mcvar.h	Sun Jan 24 05:20:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mcvar.h,v 1.16 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_mcvar.h,v 1.17 2021/01/24 05:20:23 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -87,6 +87,8 @@ struct mc_softc {
 	int		sc_tail;
 	int		sc_rxset;
 	int		sc_txset, sc_txseti;
+
+	krndsource_t rnd_source;
 };
 
 int	mcsetup(struct mc_softc *, u_int8_t *);

Index: src/sys/arch/mac68k/obio/if_mc_obio.c
diff -u src/sys/arch/mac68k/obio/if_mc_obio.c:1.18 src/sys/arch/mac68k/obio/if_mc_obio.c:1.19
--- src/sys/arch/mac68k/obio/if_mc_obio.c:1.18	Sat Oct 27 17:18:00 2012
+++ src/sys/arch/mac68k/obio/if_mc_obio.c	Sun Jan 24 05:20:23 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc_obio.c,v 1.18 2012/10/27 17:18:00 chs Exp $	*/
+/*	$NetBSD: if_mc_obio.c,v 1.19 2021/01/24 05:20:23 rin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -36,7 +36,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mc_obio.c,v 1.18 2012/10/27 17:18:00 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mc_obio.c,v 1.19 2021/01/24 05:20:23 rin Exp $");
 
 #include "opt_ddb.h"
 
@@ -46,6 +46,8 @@ __KERNEL_RCSID(0, "$NetBSD: if_mc_obio.c
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 



CVS commit: src/sys/arch/mac68k

2020-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 21:48:04 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: macfb.c
src/sys/arch/mac68k/nubus: cpi_nubus.c
src/sys/arch/mac68k/obio: iwm_fd.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/mac68k/dev/macfb.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/mac68k/nubus/cpi_nubus.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/dev/macfb.c
diff -u src/sys/arch/mac68k/dev/macfb.c:1.20 src/sys/arch/mac68k/dev/macfb.c:1.21
--- src/sys/arch/mac68k/dev/macfb.c:1.20	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/macfb.c	Sat Dec 19 21:48:04 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: macfb.c,v 1.20 2012/10/27 17:17:59 chs Exp $ */
+/* $NetBSD: macfb.c,v 1.21 2020/12/19 21:48:04 thorpej Exp $ */
 /*
  * Copyright (c) 1998 Matt DeBergalis
  * All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: macfb.c,v 1.20 2012/10/27 17:17:59 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: macfb.c,v 1.21 2020/12/19 21:48:04 thorpej Exp $");
 
 #include "opt_wsdisplay_compat.h"
 #include "grf.h"
@@ -41,7 +41,7 @@ __KERNEL_RCSID(0, "$NetBSD: macfb.c,v 1.
 #include 
 #include 
 #include 
-#include 
+#include 
 
 #include 
 #include 
@@ -206,7 +206,8 @@ macfb_attach(device_t parent, device_t s
 		sc->sc_dc = _console_dc;
 		sc->nscreens = 1;
 	} else {
-		sc->sc_dc = malloc(sizeof(struct macfb_devconfig), M_DEVBUF, M_WAITOK);
+		sc->sc_dc = kmem_alloc(sizeof(struct macfb_devconfig),
+		KM_SLEEP);
 		sc->sc_dc->dc_vaddr = (vaddr_t)gm->fbbase;
 		sc->sc_dc->dc_paddr = ga->ga_phys;
 		sc->sc_dc->dc_size = gm->fbsize;
@@ -373,7 +374,7 @@ init_itefont(void)
 		return;
 	itefont_initted = 1;
 
-	/* XXX but we cannot use malloc here... */
+	/* XXX but we cannot use kmem_alloc here... */
 	gallant19.width = 6;
 	gallant19.height = 10;
 	gallant19.ascent = 0;

Index: src/sys/arch/mac68k/nubus/cpi_nubus.c
diff -u src/sys/arch/mac68k/nubus/cpi_nubus.c:1.10 src/sys/arch/mac68k/nubus/cpi_nubus.c:1.11
--- src/sys/arch/mac68k/nubus/cpi_nubus.c:1.10	Mon Sep  3 16:29:25 2018
+++ src/sys/arch/mac68k/nubus/cpi_nubus.c	Sat Dec 19 21:48:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpi_nubus.c,v 1.10 2018/09/03 16:29:25 riastradh Exp $	*/
+/*	$NetBSD: cpi_nubus.c,v 1.11 2020/12/19 21:48:04 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2008 Hauke Fath
@@ -25,12 +25,12 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: cpi_nubus.c,v 1.10 2018/09/03 16:29:25 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpi_nubus.c,v 1.11 2020/12/19 21:48:04 thorpej Exp $");
 #include 
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -392,7 +392,7 @@ cpi_open(dev_t device, int flag, int mod
 		printf("\tcpi_open() allocating printer buffer...\n");
 	
 	/* Allocate the driver's line buffer */
-	sc->sc_printbuf = malloc(CPI_BUFSIZE, M_DEVBUF, M_WAITOK);
+	sc->sc_printbuf = kmem_alloc(CPI_BUFSIZE, KM_SLEEP);
 	sc->sc_bufbytes = 0;
 	sc->sc_lpstate = LP_OPEN;
 
@@ -441,7 +441,7 @@ cpi_close(dev_t device, int flag, int mo
 	z8536_reg_set(sc->sc_bst, sc->sc_bsh, Z8536_PCSRA, PCSR_CLR_IP_IUS);
 
 	sc->sc_lpstate = LP_INITIAL;
-	free(sc->sc_printbuf, M_DEVBUF);
+	kmem_free(sc->sc_printbuf, CPI_BUFSIZE);
 	
 	return 0;
 }

Index: src/sys/arch/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.57 src/sys/arch/mac68k/obio/iwm_fd.c:1.58
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.57	Tue Nov 12 13:17:43 2019
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Sat Dec 19 21:48:04 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.57 2019/11/12 13:17:43 msaitoh Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.58 2020/12/19 21:48:04 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.57 2019/11/12 13:17:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1.58 2020/12/19 21:48:04 thorpej Exp $");
 
 #include "locators.h"
 
@@ -42,7 +42,7 @@ __KERNEL_RCSID(0, "$NetBSD: iwm_fd.c,v 1
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 
 
@@ -669,9 +669,11 @@ fdclose(dev_t dev, int flags, int devTyp
 	fdType = minor(dev) % MAXPARTITIONS;
 	fd = iwm->fd[fdUnit];
 	/* release cylinder cache memory */
-	if (fd->cbuf != NULL)
-		 free(fd->cbuf, M_DEVBUF);
-	
+	if (fd->cbuf != NULL) {
+		 kmem_free(fd->cbuf,
+		 IWM_MAX_GCR_SECTORS * fd->currentType->sectorSize);
+	}
+
 	partitionMask = (1 << fdType);
 
 	/* Set state flag. */
@@ -1636,8 +1638,7 @@ initCylinderCache(fd_softc_t *fd)
 	secsize = fd->currentType->sectorSize;
 	fd->cachedSide = 0;
 	
-	fd->cbuf = (unsigned char *) malloc(IWM_MAX_GCR_SECTORS
-	* secsize, M_DEVBUF, M_WAITOK);
+	fd->cbuf = kmem_alloc(IWM_MAX_GCR_SECTORS * 

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

2020-12-19 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Dec 19 21:46:40 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: aed.c

Log Message:
Use sel{record,remove}_knote().


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/sys/arch/mac68k/dev/aed.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/mac68k/dev/aed.c
diff -u src/sys/arch/mac68k/dev/aed.c:1.34 src/sys/arch/mac68k/dev/aed.c:1.35
--- src/sys/arch/mac68k/dev/aed.c:1.34	Wed Oct 25 08:12:37 2017
+++ src/sys/arch/mac68k/dev/aed.c	Sat Dec 19 21:46:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: aed.c,v 1.34 2017/10/25 08:12:37 maya Exp $	*/
+/*	$NetBSD: aed.c,v 1.35 2020/12/19 21:46:40 thorpej Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.34 2017/10/25 08:12:37 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aed.c,v 1.35 2020/12/19 21:46:40 thorpej Exp $");
 
 #include "opt_adb.h"
 
@@ -585,7 +585,7 @@ filt_aedrdetach(struct knote *kn)
 	int s;
 
 	s = splvm();
-	SLIST_REMOVE(_sc->sc_selinfo.sel_klist, kn, knote, kn_selnext);
+	selremove_knote(_sc->sc_selinfo, kn);
 	splx(s);
 }
 
@@ -614,17 +614,14 @@ static const struct filterops aed_seltru
 int
 aedkqfilter(dev_t dev, struct knote *kn)
 {
-	struct klist *klist;
 	int s;
 
 	switch (kn->kn_filter) {
 	case EVFILT_READ:
-		klist = _sc->sc_selinfo.sel_klist;
 		kn->kn_fop = _filtops;
 		break;
 
 	case EVFILT_WRITE:
-		klist = _sc->sc_selinfo.sel_klist;
 		kn->kn_fop = _seltrue_filtops;
 		break;
 
@@ -635,7 +632,7 @@ aedkqfilter(dev_t dev, struct knote *kn)
 	kn->kn_hook = NULL;
 
 	s = splvm();
-	SLIST_INSERT_HEAD(klist, kn, kn_selnext);
+	selrecord_knote(_sc->sc_selinfo, kn);
 	splx(s);
 
 	return (0);



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

2020-10-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Wed Oct 21 11:15:18 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: genfb_grfbus.c

Log Message:
Drop inappropriate WSFB_VRAM_IS_RAM bit from fbi_flags;
framebuffer is not regular RAM.

Thanks to jmcneill@ and macallan@ for kind explanation
(at elsewhere).


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mac68k/dev/genfb_grfbus.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/mac68k/dev/genfb_grfbus.c
diff -u src/sys/arch/mac68k/dev/genfb_grfbus.c:1.1 src/sys/arch/mac68k/dev/genfb_grfbus.c:1.2
--- src/sys/arch/mac68k/dev/genfb_grfbus.c:1.1	Fri Jul 26 10:48:44 2019
+++ src/sys/arch/mac68k/dev/genfb_grfbus.c	Wed Oct 21 11:15:18 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: genfb_grfbus.c,v 1.1 2019/07/26 10:48:44 rin Exp $ */
+/* $NetBSD: genfb_grfbus.c,v 1.2 2020/10/21 11:15:18 rin Exp $ */
 
 /* NetBSD: simplefb.c,v 1.7 2019/01/30 00:55:04 jmcneill Exp */
 /*-
@@ -61,7 +61,7 @@
 #include "opt_wsdisplay_compat.h"
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: genfb_grfbus.c,v 1.1 2019/07/26 10:48:44 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb_grfbus.c,v 1.2 2020/10/21 11:15:18 rin Exp $");
 
 #include 
 #include 
@@ -156,7 +156,6 @@ genfb_grfbus_ioctl(void *v, void *vs, u_
 			 * unaligned part
 			 */
 			fbi->fbi_fboffset = m68k_page_offset(sc->sc_paddr);
-			fbi->fbi_flags |= WSFB_VRAM_IS_RAM;
 		}
 		return error;
 	default:



CVS commit: src/sys/arch/mac68k/mac68k

2020-07-21 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 21 06:10:26 UTC 2020

Modified Files:
src/sys/arch/mac68k/mac68k: intr.c locore.s via.c

Log Message:
For GCC8, do not omit frame pointer for intr_dispatch() and via1_intr()
(-fomit-frame-pointer is enabled for -O and higher for GCC8).

This is required by rtclock_intr() which unwinds stack frame of caller!

XX
We need to get rid of this hackest hack for rtclock_intr(). This problem
was discussed back in 2014:

http://mail-index.netbsd.org/port-mac68k/2014/08/15/msg000595.html
http://mail-index.netbsd.org/port-mac68k/2014/08/17/msg000600.html
http://mail-index.netbsd.org/port-mac68k/2014/08/17/msg000601.html

However, unfortunately, the problem has been left untouched until today.

The patch attached in the third message works around the problem. But,
it adds hard-coded magic numbers to intr_dispatch() and via1_intr().
For real fix, we should probably reconsider whole interrupt handling.

Anyway, now kernel compiled by GCC8 works fine as far as I can see.


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/mac68k/mac68k/intr.c
cvs rdiff -u -r1.172 -r1.173 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.75 -r1.76 src/sys/arch/mac68k/mac68k/via.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/mac68k/mac68k/intr.c
diff -u src/sys/arch/mac68k/mac68k/intr.c:1.30 src/sys/arch/mac68k/mac68k/intr.c:1.31
--- src/sys/arch/mac68k/mac68k/intr.c:1.30	Tue Feb 19 00:34:50 2019
+++ src/sys/arch/mac68k/mac68k/intr.c	Tue Jul 21 06:10:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.30 2019/02/19 00:34:50 mrg Exp $	*/
+/*	$NetBSD: intr.c,v 1.31 2020/07/21 06:10:26 rin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.30 2019/02/19 00:34:50 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.31 2020/07/21 06:10:26 rin Exp $");
 
 #include 
 #include 
@@ -206,6 +206,13 @@ intr_disestablish(int ipl)
  *
  * XXX Note: see the warning in intr_establish()
  */
+#if __GNUC_PREREQ__(8, 0)
+/*
+ * XXX rtclock_intr() requires this for unwinding stack frame.
+ */
+#pragma GCC push_options
+#pragma GCC optimize "-fno-omit-frame-pointer"
+#endif
 void
 intr_dispatch(int evec)		/* format | vector offset */
 {
@@ -225,6 +232,9 @@ intr_dispatch(int evec)		/* format | vec
 	(void)(*intr_func[ipl])(intr_arg[ipl]);
 	idepth--;
 }
+#if __GNUC_PREREQ__(8, 0)
+#pragma GCC pop_options
+#endif
 
 /*
  * Default interrupt handler:  do nothing.

Index: src/sys/arch/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.172 src/sys/arch/mac68k/mac68k/locore.s:1.173
--- src/sys/arch/mac68k/mac68k/locore.s:1.172	Tue Jul 21 05:45:38 2020
+++ src/sys/arch/mac68k/mac68k/locore.s	Tue Jul 21 06:10:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.172 2020/07/21 05:45:38 rin Exp $	*/
+/*	$NetBSD: locore.s,v 1.173 2020/07/21 06:10:26 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -794,6 +794,7 @@ ENTRY_NOPROFILE(rtclock_intr)
 	movw	_C_LABEL(ipl2psl_table)+IPL_CLOCK*2,%sr
 	| raise SPL to splclock()
 	movl	%a6@,%a1		| unwind to frame in intr_dispatch
+	| XXX FIXME
 	lea	%a1@(28),%a1		| push pointer to interrupt frame
 	movl	%a1,%sp@-			| 28 = 16 for regs in intrhand,
 	|+ 4 for args to intr_dispatch

Index: src/sys/arch/mac68k/mac68k/via.c
diff -u src/sys/arch/mac68k/mac68k/via.c:1.75 src/sys/arch/mac68k/mac68k/via.c:1.76
--- src/sys/arch/mac68k/mac68k/via.c:1.75	Sun Dec 11 12:18:03 2005
+++ src/sys/arch/mac68k/mac68k/via.c	Tue Jul 21 06:10:26 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: via.c,v 1.75 2005/12/11 12:18:03 christos Exp $	*/
+/*	$NetBSD: via.c,v 1.76 2020/07/21 06:10:26 rin Exp $	*/
 
 /*-
  * Copyright (C) 1993	Allen K. Briggs, Chris P. Caputo,
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: via.c,v 1.75 2005/12/11 12:18:03 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: via.c,v 1.76 2020/07/21 06:10:26 rin Exp $");
 
 #include "opt_mac68k.h"
 
@@ -239,6 +239,13 @@ via_set_modem(int onoff)
 		via_reg(VIA1, vBufA) &= ~DA1O_vSync;
 }
 
+#if __GNUC_PREREQ__(8, 0)
+/*
+ * XXX rtclock_intr() requires this for unwinding stack frame.
+ */
+#pragma GCC push_options
+#pragma GCC optimize "-fno-omit-frame-pointer"
+#endif
 void
 via1_intr(void *intr_arg)
 {
@@ -269,6 +276,9 @@ via1_intr(void *intr_arg)
 		++bitnum;
 	} while (intbits >= mask);
 }
+#if __GNUC_PREREQ__(8, 0)
+#pragma GCC pop_options
+#endif
 
 void
 via2_intr(void *intr_arg)



CVS commit: src/sys/arch/mac68k/mac68k

2020-07-20 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Tue Jul 21 05:45:38 UTC 2020

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

Log Message:
Align tmpstk to 4-byte boundary as required by System V (ELF) ABI.

Fix GCC8-compiled kernel crash during very early boot stage when
printf decimal numbers; __umoddi3 corrupts stack frame which is not
aligned properly.


To generate a diff of this commit:
cvs rdiff -u -r1.171 -r1.172 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.171 src/sys/arch/mac68k/mac68k/locore.s:1.172
--- src/sys/arch/mac68k/mac68k/locore.s:1.171	Wed Dec 19 13:57:48 2018
+++ src/sys/arch/mac68k/mac68k/locore.s	Tue Jul 21 05:45:38 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.171 2018/12/19 13:57:48 maxv Exp $	*/
+/*	$NetBSD: locore.s,v 1.172 2020/07/21 05:45:38 rin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -1367,6 +1367,7 @@ GLOBAL(sanity_check)
 	.long	0x18621862	| this is our stack overflow checker.
 
 	.space	4 * PAGE_SIZE
+	.align	4
 ASLOCAL(tmpstk)
 
 GLOBAL(machineid)



CVS commit: src/sys/arch/mac68k/mac68k

2020-06-19 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jun 19 16:30:31 UTC 2020

Modified Files:
src/sys/arch/mac68k/mac68k: pram.c

Log Message:
KNF.


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mac68k/mac68k/pram.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/mac68k/mac68k/pram.c
diff -u src/sys/arch/mac68k/mac68k/pram.c:1.23 src/sys/arch/mac68k/mac68k/pram.c:1.24
--- src/sys/arch/mac68k/mac68k/pram.c:1.23	Wed Mar 26 17:46:04 2014
+++ src/sys/arch/mac68k/mac68k/pram.c	Fri Jun 19 16:30:31 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: pram.c,v 1.23 2014/03/26 17:46:04 christos Exp $	*/
+/*	$NetBSD: pram.c,v 1.24 2020/06/19 16:30:31 tsutsui Exp $	*/
 
 /*-
  * Copyright (C) 1993	Allen K. Briggs, Chris P. Caputo,
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: pram.c,v 1.23 2014/03/26 17:46:04 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pram.c,v 1.24 2020/06/19 16:30:31 tsutsui Exp $");
 
 #include "opt_adb.h"
 
@@ -54,107 +54,102 @@ __KERNEL_RCSID(0, "$NetBSD: pram.c,v 1.2
 #if DEBUG
 static const char *convtime(unsigned long t)
 {
-  static long daypmon[] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
-  static const char *monstr[] = {"January","February","March","April","May",
-"June","July","August","September","October","November","December" };
-  static char s[200];
-  long year,month,day,hour,minute,seconds,i,dayperyear;
-
-  year=1904;
-  month=0;  /* Jan */
-  day=1;
-  hour=0;
-  minute=0;
-  seconds=0;
-
-  if(t == 0x)
- return("");
-
-  while (t > 0)
-  {
-if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0))
-{
-  dayperyear=366;
-  daypmon[1]=29;
-}
-else
-{
-  dayperyear=365;
-  daypmon[1]=28;
-}
-i=dayperyear*60*60*24;
-if (t >= i)
-{
-  t-=i;
-  year++;
-  continue;
-}
-i=daypmon[month]*60*60*24;
-if (t >= i)
-{
-  t-=i;
-  month++;
-  continue;
-}
-i=60*60*24;
-if (t >= i)
-{
-  t-=i;
-  day++;
-  continue;
-}
-i=60*60;
-if (t >= i)
-{
-  t-=i;
-  hour++;
-  continue;
-}
-i=60;
-if (t >= i)
-{
-  t-=i;
-  minute++;
-  continue;
-}
-seconds=t;
-t=0;
-  }
+	static long daypmon[] =
+	{ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
+	static const char *monstr[] = {
+	"January", "February", "March", "April", "May", "June",
+	"July", "August", "September", "October", "November", "December"
+	};
+	static char s[200];
+	long year, month, day, hour, minute, seconds, i, dayperyear;
+
+	year = 1904;
+	month = 0;	/* Jan */
+	day = 1;
+	hour = 0;
+	minute = 0;
+	seconds = 0;
+
+	if (t == 0x)
+		return "";
+
+	while (t > 0) {
+		if (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)) {
+			dayperyear = 366;
+			daypmon[1] = 29;
+		} else {
+			dayperyear = 365;
+			daypmon[1] = 28;
+		}
+		i = dayperyear * 60 * 60 * 24;
+		if (t >= i) {
+			t -= i;
+			year++;
+			continue;
+		}
+		i = daypmon[month] * 60 * 60 * 24;
+		if (t >= i) {
+			t -= i;
+			month++;
+			continue;
+		}
+		i = 60 * 60 * 24;
+		if (t >= i) {
+			t -= i;
+			day++;
+			continue;
+		}
+		i = 60 * 60;
+		if (t >= i) {
+			t -= i;
+			hour++;
+			continue;
+		}
+		i = 60;
+		if (t >= i) {
+			t -= i;
+			minute++;
+			continue;
+		}
+		seconds = t;
+		t = 0;
+	}
 
-  snprintf(s, sizeof(s), "%s %ld, %ld   %ld:%ld:%ld",
-  monstr[month], day, year, hour, minute, seconds);
+	snprintf(s, sizeof(s), "%s %ld, %ld   %ld:%ld:%ld",
+	monstr[month], day, year, hour, minute, seconds);
 
-  return s;
+	return s;
 }
 #endif
 
 unsigned long
 pram_readtime(void)
 {
-   unsigned long	timedata;
+	unsigned long	timedata;
 
 #ifdef MRG_ADB
-   if (0 == jClkNoMem)
-	timedata = 0;	/* cause comparision of MacOS boottime */
-			/* and PRAM time to fail */
-   else
+	if (0 == jClkNoMem)
+		timedata = 0;	/* cause comparision of MacOS boottime */
+/* and PRAM time to fail */
+	else
 #endif
 	timedata = getPramTime();
 #if DEBUG
-   printf("time read from PRAM: 0x%lx\n", timedata);
-   printf("Date and time: %s\n",convtime(timedata));
+	printf("time read from PRAM: 0x%lx\n", timedata);
+	printf("Date and time: %s\n",convtime(timedata));
 #endif
 
-   return(timedata);
+	return timedata;
 }
 
 void
 pram_settime(unsigned long curtime)
 {
+
 #ifdef MRG_ADB
-   if (0 == jClkNoMem)
-	return;
-   else
+	if (0 == jClkNoMem)
+		return;
+	else
 #endif
 	return setPramTime(curtime);
 }
@@ -211,6 +206,7 @@ getPramTime(void)
 void
 setPramTime(unsigned long curtime)
 {
+
 	switch (adbHardware) {
 	case ADB_HW_IOP:
 	case ADB_HW_II:		/* access PRAM via ADB interface */



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

2020-06-09 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Tue Jun  9 11:44:48 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: ams.c

Log Message:
Fix inverted Y-axis value passed to wsmouse_input(9).

Note this is what src/sys/arch/macppc/dev/ams.c does as
"upward (moving the mouse forward) is positive" as noted in wsmouse(9):
 http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/macppc/dev/ams.c#rev1.4

Reported and tested by @NonameInsect on his SE/30 and Xorg server.
Should be pulled up to netbsd-8 and netbsd-9.


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mac68k/dev/ams.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/mac68k/dev/ams.c
diff -u src/sys/arch/mac68k/dev/ams.c:1.22 src/sys/arch/mac68k/dev/ams.c:1.23
--- src/sys/arch/mac68k/dev/ams.c:1.22	Sat Oct 19 16:23:17 2013
+++ src/sys/arch/mac68k/dev/ams.c	Tue Jun  9 11:44:48 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: ams.c,v 1.22 2013/10/19 16:23:17 martin Exp $	*/
+/*	$NetBSD: ams.c,v 1.23 2020/06/09 11:44:48 tsutsui Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -31,7 +31,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: ams.c,v 1.22 2013/10/19 16:23:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ams.c,v 1.23 2020/06/09 11:44:48 tsutsui Exp $");
 
 #include 
 #include 
@@ -506,7 +506,7 @@ ms_processevent(adb_event_t *event, stru
 		if (amsc->sc_wsmousedev != NULL) /* wsmouse is attached? */
 			wsmouse_input(amsc->sc_wsmousedev,
 			new_event.u.m.buttons,
-			new_event.u.m.dx, new_event.u.m.dy, 0, 0,
+			new_event.u.m.dx, -new_event.u.m.dy, 0, 0,
 			WSMOUSE_INPUT_DELTA);
 #else
 		/* do nothing */ ;



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

2020-05-31 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May 31 09:00:25 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: adbsysasm.s

Log Message:
#ifdef out debug garbage.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mac68k/dev/adbsysasm.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/mac68k/dev/adbsysasm.s
diff -u src/sys/arch/mac68k/dev/adbsysasm.s:1.12 src/sys/arch/mac68k/dev/adbsysasm.s:1.13
--- src/sys/arch/mac68k/dev/adbsysasm.s:1.12	Sun Nov  1 01:51:35 2009
+++ src/sys/arch/mac68k/dev/adbsysasm.s	Sun May 31 09:00:25 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: adbsysasm.s,v 1.12 2009/11/01 01:51:35 snj Exp $	*/
+/*	$NetBSD: adbsysasm.s,v 1.13 2020/05/31 09:00:25 rin Exp $	*/
 
 /*-
  * Copyright (C) 1994	Bradley A. Grantham
@@ -64,11 +64,11 @@ GLOBAL(adb_ms_asmcomplete)
 #endif
 	rts
 
-
+#if defined(ADB_DEBUG) && 0
 GLOBAL(adb_jadbprochello)
 	.asciz	"adb: hello from adbproc\n"
 	.even
-
+#endif
 
 GLOBAL(adb_jadbproc)
 #if defined(ADB_DEBUG) && 0



CVS commit: src/sys/arch/mac68k/obio

2020-05-31 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Sun May 31 08:59:40 UTC 2020

Modified Files:
src/sys/arch/mac68k/obio: wdc_obio.c

Log Message:
For wdc_obio_match(), struct wdc_regs is too large for stack.
Use kmem_alloc(9) instead.

Frame size becomes:
3088 --> 0


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/mac68k/obio/wdc_obio.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/mac68k/obio/wdc_obio.c
diff -u src/sys/arch/mac68k/obio/wdc_obio.c:1.29 src/sys/arch/mac68k/obio/wdc_obio.c:1.30
--- src/sys/arch/mac68k/obio/wdc_obio.c:1.29	Fri Oct 20 07:06:07 2017
+++ src/sys/arch/mac68k/obio/wdc_obio.c	Sun May 31 08:59:40 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_obio.c,v 1.29 2017/10/20 07:06:07 jdolecek Exp $ */
+/*	$NetBSD: wdc_obio.c,v 1.30 2020/05/31 08:59:40 rin Exp $ */
 
 /*
  * Copyright (c) 2002 Takeshi Shibagaki  All rights reserved.
@@ -32,14 +32,14 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.29 2017/10/20 07:06:07 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wdc_obio.c,v 1.30 2020/05/31 08:59:40 rin Exp $");
 
 #include 
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -87,45 +87,49 @@ int
 wdc_obio_match(device_t parent, cfdata_t match, void *aux)
 {
 	struct obio_attach_args *oa = (struct obio_attach_args *) aux;
-	struct wdc_regs wdr;
+	struct wdc_regs *wdr;
 	int i, result = 0;
 
+	wdr = kmem_alloc(sizeof(struct wdc_regs), KM_SLEEP);
+
 	switch (current_mac_model->machineid) {
 	case MACH_MACPB150:
 	case MACH_MACPB190:
 	case MACH_MACPB190CS:
 	case MACH_MACP580:
 	case MACH_MACQ630:
-		wdr.cmd_iot = wdr.ctl_iot = oa->oa_tag;
+		wdr->cmd_iot = wdr->ctl_iot = oa->oa_tag;
 
-		if (bus_space_map(wdr.cmd_iot, IDEBase, WDC_OBIO_REG_NPORTS,
-0, _baseioh))
-			return 0;
+		if (bus_space_map(wdr->cmd_iot, IDEBase, WDC_OBIO_REG_NPORTS,
+0, >cmd_baseioh))
+			goto out;
 
-		mac68k_bus_space_handle_swapped(wdr.cmd_iot, _baseioh);
+		mac68k_bus_space_handle_swapped(wdr->cmd_iot,
+		>cmd_baseioh);
 
 		for (i = 0; i < WDC_NREG; i++) {
-			if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh,
-	4 * i, 4, _iohs[i]) != 0) {
-return 0;
-			}
+			if (bus_space_subregion(wdr->cmd_iot, wdr->cmd_baseioh,
+	4 * i, 4, >cmd_iohs[i]) != 0)
+goto out;
 		}
-		wdc_init_shadow_regs();
+		wdc_init_shadow_regs(wdr);
 
 
-		if (bus_space_subregion(wdr.cmd_iot, wdr.cmd_baseioh,
+		if (bus_space_subregion(wdr->cmd_iot, wdr->cmd_baseioh,
 WDC_OBIO_AUXREG_OFFSET,
 	WDC_OBIO_AUXREG_NPORTS,
-	_ioh))
-			return 0;
+	>ctl_ioh))
+			goto out;
 
-		result = wdcprobe();
+		result = wdcprobe(wdr);
 
-		bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, WDC_OBIO_REG_NPORTS);
+		bus_space_unmap(wdr->cmd_iot, wdr->cmd_baseioh,
+		WDC_OBIO_REG_NPORTS);
 
-		return (result);
+		goto out;
 	}
-	return 0;
+out:	kmem_free(wdr, sizeof(struct wdc_regs));
+	return result;
 }
 
 void



CVS commit: src/sys/arch/mac68k/nubus

2020-02-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  5 08:36:34 UTC 2020

Modified Files:
src/sys/arch/mac68k/nubus: if_ae_nubus.c

Log Message:
Adopt 


To generate a diff of this commit:
cvs rdiff -u -r1.41 -r1.42 src/sys/arch/mac68k/nubus/if_ae_nubus.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/mac68k/nubus/if_ae_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_ae_nubus.c:1.41 src/sys/arch/mac68k/nubus/if_ae_nubus.c:1.42
--- src/sys/arch/mac68k/nubus/if_ae_nubus.c:1.41	Fri Jan 16 23:43:46 2009
+++ src/sys/arch/mac68k/nubus/if_ae_nubus.c	Wed Feb  5 08:36:34 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ae_nubus.c,v 1.41 2009/01/16 23:43:46 tsutsui Exp $	*/
+/*	$NetBSD: if_ae_nubus.c,v 1.42 2020/02/05 08:36:34 skrll Exp $	*/
 
 /*
  * Copyright (C) 1997 Scott Reynolds
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ae_nubus.c,v 1.41 2009/01/16 23:43:46 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ae_nubus.c,v 1.42 2020/02/05 08:36:34 skrll Exp $");
 
 #include 
 #include 
@@ -502,7 +502,7 @@ ae_nb_watchdog(struct ifnet *ifp)
 	(*via2itab[1])((void *)1);
 
 	log(LOG_ERR, "%s: device timeout\n", device_xname(sc->sc_dev));
-	++ifp->if_oerrors;
+	if_statinc(ifp, if_oerrors);
 
 	dp8390_reset(sc);
 }



CVS commit: src/sys/arch/mac68k/nubus

2020-02-05 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Wed Feb  5 08:36:56 UTC 2020

Modified Files:
src/sys/arch/mac68k/nubus: if_ae_nubus.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/mac68k/nubus/if_ae_nubus.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/mac68k/nubus/if_ae_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_ae_nubus.c:1.42 src/sys/arch/mac68k/nubus/if_ae_nubus.c:1.43
--- src/sys/arch/mac68k/nubus/if_ae_nubus.c:1.42	Wed Feb  5 08:36:34 2020
+++ src/sys/arch/mac68k/nubus/if_ae_nubus.c	Wed Feb  5 08:36:56 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_ae_nubus.c,v 1.42 2020/02/05 08:36:34 skrll Exp $	*/
+/*	$NetBSD: if_ae_nubus.c,v 1.43 2020/02/05 08:36:56 skrll Exp $	*/
 
 /*
  * Copyright (C) 1997 Scott Reynolds
@@ -40,7 +40,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_ae_nubus.c,v 1.42 2020/02/05 08:36:34 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ae_nubus.c,v 1.43 2020/02/05 08:36:56 skrll Exp $");
 
 #include 
 #include 
@@ -386,7 +386,7 @@ void
 ae_nubus_intr(void *arg)
 {
 	struct dp8390_softc *sc = arg;
-	
+
 	(void)dp8390_intr(sc);
 }
 



CVS commit: src/sys/arch/mac68k/nubus

2020-02-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Feb  4 07:40:53 UTC 2020

Modified Files:
src/sys/arch/mac68k/nubus: if_netdock_nubus.c

Log Message:
Trailing whitespace


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/sys/arch/mac68k/nubus/if_netdock_nubus.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/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.33 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.34
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.33	Tue Feb  4 07:36:28 2020
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Tue Feb  4 07:40:53 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.33 2020/02/04 07:36:28 skrll Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.34 2020/02/04 07:40:53 skrll Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.33 2020/02/04 07:36:28 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.34 2020/02/04 07:40:53 skrll Exp $");
 
 #include 
 #include 
@@ -91,7 +91,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_netdock_n
 #define REG_DATA	0x0008
 #define REG_EFD00	0xefd00
 
-#define ISR_ALL		0x3300	
+#define ISR_ALL		0x3300
 #define ISR_TX		0x0200
 #define ISR_RX		0x0100
 #define ISR_READY	0x0800
@@ -518,7 +518,7 @@ netdock_init(struct netdock_softc *sc)
 	/* 1382 */
 	savetmp = NIC_GET_2(sc, REG_000E);
 	NIC_PUT_2(sc, REG_000E, 0x0100);
-	NIC_ORW(sc, REG_ISR, ISR_BIT_03); 
+	NIC_ORW(sc, REG_ISR, ISR_BIT_03);
 	NIC_PUT_2(sc, REG_000E, savetmp);
 	NIC_PUT_2(sc, REG_ISR , saveisr);
 



CVS commit: src/sys/arch/mac68k/nubus

2020-02-03 Thread Nick Hudson
Module Name:src
Committed By:   skrll
Date:   Tue Feb  4 07:36:28 UTC 2020

Modified Files:
src/sys/arch/mac68k/nubus: if_netdock_nubus.c

Log Message:
Adopt 


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 src/sys/arch/mac68k/nubus/if_netdock_nubus.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/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.32 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.33
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.32	Wed Jan 29 05:25:42 2020
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Tue Feb  4 07:36:28 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.32 2020/01/29 05:25:42 thorpej Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.33 2020/02/04 07:36:28 skrll Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.32 2020/01/29 05:25:42 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.33 2020/02/04 07:36:28 skrll Exp $");
 
 #include 
 #include 
@@ -674,9 +674,9 @@ netdock_txint(struct netdock_softc *sc)
 		NIC_GET_2(sc, REG_ISR);
 		regdata = NIC_GET_2(sc, REG_DATA);
 		if ((regdata & REG_DATA_BIT_08) == 0) {
-			/* ifp->if_collisions++; */
+			/* if_statinc(ifp, if_collisions); */
 			if (regdata & REG_DATA_BIT_07)
-			/* ifp->if_oerrors++; */
+			/* if_statinc(ifp, if_oerrors); */
 			NIC_PUT_2(sc, REG_000E, 0);
 			NIC_ORW(sc, REG_, 0x0100);
 			NIC_PUT_2(sc, REG_000E, 0x0200);



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

2020-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 30 06:30:52 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: if_mc.c

Log Message:
Fix more typos


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/mac68k/dev/if_mc.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/mac68k/dev/if_mc.c
diff -u src/sys/arch/mac68k/dev/if_mc.c:1.54 src/sys/arch/mac68k/dev/if_mc.c:1.55
--- src/sys/arch/mac68k/dev/if_mc.c:1.54	Thu Jan 30 06:28:46 2020
+++ src/sys/arch/mac68k/dev/if_mc.c	Thu Jan 30 06:30:52 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc.c,v 1.54 2020/01/30 06:28:46 martin Exp $	*/
+/*	$NetBSD: if_mc.c,v 1.55 2020/01/30 06:30:52 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.54 2020/01/30 06:28:46 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.55 2020/01/30 06:30:52 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -491,12 +491,12 @@ mc_tint(struct mc_softc *sc)
 
 	if (xmtfs & MORE)
 		/* Real number is unknown. */
-		if_statadd_ref(nsr, if_collisons, 2);
+		if_statadd_ref(nsr, if_collisions, 2);
 	else if (xmtfs & ONE)
 		if_statinc_ref(nsr, if_collisions);
 	else if (xmtfs & RTRY) {
 		printf("%s: excessive collisions\n", device_xname(sc->sc_dev));
-		if_statadd_ref(nsr, if_collsions, 16);
+		if_statadd_ref(nsr, if_collisions, 16);
 		if_statinc_ref(nsr, if_oerrors);
 	}
 



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

2020-01-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 30 06:28:46 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: if_mc.c

Log Message:
Fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mac68k/dev/if_mc.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/mac68k/dev/if_mc.c
diff -u src/sys/arch/mac68k/dev/if_mc.c:1.53 src/sys/arch/mac68k/dev/if_mc.c:1.54
--- src/sys/arch/mac68k/dev/if_mc.c:1.53	Wed Jan 29 05:25:41 2020
+++ src/sys/arch/mac68k/dev/if_mc.c	Thu Jan 30 06:28:46 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc.c,v 1.53 2020/01/29 05:25:41 thorpej Exp $	*/
+/*	$NetBSD: if_mc.c,v 1.54 2020/01/30 06:28:46 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.53 2020/01/29 05:25:41 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.54 2020/01/30 06:28:46 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -491,7 +491,7 @@ mc_tint(struct mc_softc *sc)
 
 	if (xmtfs & MORE)
 		/* Real number is unknown. */
-		if_statadd_ref(nsr, if_collsions, 2);
+		if_statadd_ref(nsr, if_collisons, 2);
 	else if (xmtfs & ONE)
 		if_statinc_ref(nsr, if_collisions);
 	else if (xmtfs & RTRY) {



CVS commit: src/sys/arch/mac68k

2020-01-28 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Wed Jan 29 05:25:42 UTC 2020

Modified Files:
src/sys/arch/mac68k/dev: if_mc.c
src/sys/arch/mac68k/nubus: if_netdock_nubus.c

Log Message:
Adopt .


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mac68k/dev/if_mc.c
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mac68k/nubus/if_netdock_nubus.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/mac68k/dev/if_mc.c
diff -u src/sys/arch/mac68k/dev/if_mc.c:1.52 src/sys/arch/mac68k/dev/if_mc.c:1.53
--- src/sys/arch/mac68k/dev/if_mc.c:1.52	Fri Dec 27 09:32:09 2019
+++ src/sys/arch/mac68k/dev/if_mc.c	Wed Jan 29 05:25:41 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc.c,v 1.52 2019/12/27 09:32:09 msaitoh Exp $	*/
+/*	$NetBSD: if_mc.c,v 1.53 2020/01/29 05:25:41 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang 
@@ -35,7 +35,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.52 2019/12/27 09:32:09 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mc.c,v 1.53 2020/01/29 05:25:41 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_inet.h"
@@ -266,7 +266,7 @@ mcstart(struct ifnet *ifp)
 		ifp->if_flags |= IFF_OACTIVE;
 		maceput(sc, m);
 
-		ifp->if_opackets++;		/* # of pkts */
+		if_statinc(ifp, if_opackets);	/* # of pkts */
 	}
 }
 
@@ -434,21 +434,21 @@ struct mc_softc *sc = arg;
 #ifdef MCDEBUG
 		printf("%s: jabber error\n", device_xname(sc->sc_dev));
 #endif
-		sc->sc_if.if_oerrors++;
+		if_statinc(>sc_if, if_oerrors);
 	}
 
 	if (ir & BABL) {
 #ifdef MCDEBUG
 		printf("%s: babble\n", device_xname(sc->sc_dev));
 #endif
-		sc->sc_if.if_oerrors++;
+		if_statinc(>sc_if, if_oerrors);
 	}
 
 	if (ir & CERR) {
 #ifdef MCDEBUG
 		printf("%s: collision error\n", device_xname(sc->sc_dev));
 #endif
-		sc->sc_if.if_collisions++;
+		if_statinc(>sc_if, if_collisions);
 	}
 
 	/*
@@ -481,29 +481,33 @@ mc_tint(struct mc_softc *sc)
 		return;
 	}
 
+	net_stat_ref_t nsr = IF_STAT_GETREF(>sc_if);
+
 	if (xmtfs & LCOL) {
 		printf("%s: late collision\n", device_xname(sc->sc_dev));
-		sc->sc_if.if_oerrors++;
-		sc->sc_if.if_collisions++;
+		if_statinc_ref(nsr, if_oerrors);
+		if_statinc_ref(nsr, if_collisions);
 	}
 
 	if (xmtfs & MORE)
 		/* Real number is unknown. */
-		sc->sc_if.if_collisions += 2;
+		if_statadd_ref(nsr, if_collsions, 2);
 	else if (xmtfs & ONE)
-		sc->sc_if.if_collisions++;
+		if_statinc_ref(nsr, if_collisions);
 	else if (xmtfs & RTRY) {
 		printf("%s: excessive collisions\n", device_xname(sc->sc_dev));
-		sc->sc_if.if_collisions += 16;
-		sc->sc_if.if_oerrors++;
+		if_statadd_ref(nsr, if_collsions, 16);
+		if_statinc_ref(nsr, if_oerrors);
 	}
 
 	if (xmtfs & LCAR) {
 		sc->sc_havecarrier = 0;
 		printf("%s: lost carrier\n", device_xname(sc->sc_dev));
-		sc->sc_if.if_oerrors++;
+		if_statinc_ref(nsr, if_oerrors);
 	}
 
+	IF_STAT_PUTREF(>sc_if);
+
 	sc->sc_if.if_flags &= ~IFF_OACTIVE;
 	sc->sc_if.if_timer = 0;
 	if_schedule_deferred_start(>sc_if);
@@ -526,18 +530,18 @@ mc_rint(struct mc_softc *sc)
 
 	if (rxf.rx_rcvsts & OFLO) {
 		printf("%s: receive FIFO overflow\n", device_xname(sc->sc_dev));
-		sc->sc_if.if_ierrors++;
+		if_statinc(>sc_if, if_ierrors);
 		return;
 	}
 
 	if (rxf.rx_rcvsts & CLSN)
-		sc->sc_if.if_collisions++;
+		if_statinc(>sc_if, if_collisions);
 
 	if (rxf.rx_rcvsts & FRAM) {
 #ifdef MCDEBUG
 		printf("%s: framing error\n", device_xname(sc->sc_dev));
 #endif
-		sc->sc_if.if_ierrors++;
+		if_statinc(>sc_if, if_ierrors);
 		return;
 	}
 
@@ -545,7 +549,7 @@ mc_rint(struct mc_softc *sc)
 #ifdef MCDEBUG
 		printf("%s: frame control checksum error\n", device_xname(sc->sc_dev));
 #endif
-		sc->sc_if.if_ierrors++;
+		if_statinc(>sc_if, if_ierrors);
 		return;
 	}
 
@@ -565,13 +569,13 @@ mace_read(struct mc_softc *sc, void *pkt
 		printf("%s: invalid packet size %d; dropping\n",
 		device_xname(sc->sc_dev), len);
 #endif
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 
 	m = mace_get(sc, pkt, len);
 	if (m == NULL) {
-		ifp->if_ierrors++;
+		if_statinc(ifp, if_ierrors);
 		return;
 	}
 

Index: src/sys/arch/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.31 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.32
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.31	Mon Oct 21 08:22:06 2019
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Wed Jan 29 05:25:42 2020
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.31 2019/10/21 08:22:06 msaitoh Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.32 2020/01/29 05:25:42 thorpej Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.31 2019/10/21 08:22:06 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.32 2020/01/29 05:25:42 thorpej Exp $");
 
 #include 
 #include 
@@ -458,7 +458,7 @@ netdock_start(struct ifnet 

CVS commit: src/sys/arch/mac68k/mac68k

2019-02-18 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Tue Feb 19 00:34:50 UTC 2019

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

Log Message:
convert 'extern long intrnames' to 'extern char intrnames[MAX_INAME_LENGTH]'.
also, assert that MAX_INAME_LENGTH is not larger than eintrnames - intrnames.

fixes gcc 7's object size checker checks.  tested by martin@.


To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/intr.c
diff -u src/sys/arch/mac68k/mac68k/intr.c:1.29 src/sys/arch/mac68k/mac68k/intr.c:1.30
--- src/sys/arch/mac68k/mac68k/intr.c:1.29	Mon Dec 20 00:25:36 2010
+++ src/sys/arch/mac68k/mac68k/intr.c	Tue Feb 19 00:34:50 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.c,v 1.29 2010/12/20 00:25:36 matt Exp $	*/
+/*	$NetBSD: intr.c,v 1.30 2019/02/19 00:34:50 mrg Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.29 2010/12/20 00:25:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: intr.c,v 1.30 2019/02/19 00:34:50 mrg Exp $");
 
 #include 
 #include 
@@ -100,9 +100,9 @@ void	intr_computeipl(void);
 void
 intr_init(void)
 {
-	extern long	intrnames;
+	extern char	intrnames[MAX_INAME_LENGTH];
+	extern char	eintrnames[] __diagused;
 	const char	*inames;
-	char		*g_inames;
 
 	ipl2psl_table[IPL_NONE]   = 0;
 	ipl2psl_table[IPL_SOFTCLOCK]  = PSL_S|PSL_IPL1;
@@ -111,7 +111,6 @@ intr_init(void)
 	ipl2psl_table[IPL_SOFTBIO]= PSL_S|PSL_IPL1;
 	ipl2psl_table[IPL_HIGH]   = PSL_S|PSL_IPL7;
 
-	g_inames = (char *) 
 	if (mac68k_machine.aux_interrupts) {
 		inames = AUX_INAMES;
 
@@ -132,7 +131,9 @@ intr_init(void)
 		}
 	}
 
-	memcpy(g_inames, inames, MAX_INAME_LENGTH);
+	KASSERT(MAX_INAME_LENGTH <=
+		((uintptr_t)eintrnames - (uintptr_t)intrnames));
+	memcpy(intrnames, inames, MAX_INAME_LENGTH);
 
 	intr_computeipl();
 



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

2018-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 19 18:21:55 UTC 2018

Modified Files:
src/sys/arch/mac68k/dev: adb.c

Log Message:
#ifdef DIAGNOSTIC should not cause functional differences (even if
minor or cosmetic)


To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/mac68k/dev/adb.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/mac68k/dev/adb.c
diff -u src/sys/arch/mac68k/dev/adb.c:1.56 src/sys/arch/mac68k/dev/adb.c:1.57
--- src/sys/arch/mac68k/dev/adb.c:1.56	Sat Oct 18 08:33:25 2014
+++ src/sys/arch/mac68k/dev/adb.c	Fri Oct 19 18:21:55 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb.c,v 1.56 2014/10/18 08:33:25 snj Exp $	*/
+/*	$NetBSD: adb.c,v 1.57 2018/10/19 18:21:55 martin Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.56 2014/10/18 08:33:25 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: adb.c,v 1.57 2018/10/19 18:21:55 martin Exp $");
 
 #include "opt_adb.h"
 
@@ -192,11 +192,13 @@ adbprint(void *args, const char *name)
 		/* print out what kind of ADB device we have found */
 		aprint_normal("%s addr %d: ", name, aa_args->adbaddr);
 		switch(aa_args->origaddr) {
-#ifdef DIAGNOSTIC
 		case 0:
+#ifdef DIAGNOSTIC
 			aprint_normal("ADB event device");
+#endif
 			rv = UNCONF;
 			break;
+#ifdef DIAGNOSTIC
 		case ADBADDR_SECURE:
 			aprint_normal("security dongle (%d)",
 			aa_args->handler_id);



CVS commit: src/sys/arch/mac68k/mac68k

2017-11-07 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Nov  7 14:56:03 UTC 2017

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

Log Message:
Don't define ELFSIZE


To generate a diff of this commit:
cvs rdiff -u -r1.351 -r1.352 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.351 src/sys/arch/mac68k/mac68k/machdep.c:1.352
--- src/sys/arch/mac68k/mac68k/machdep.c:1.351	Tue Aug 15 05:26:56 2017
+++ src/sys/arch/mac68k/mac68k/machdep.c	Tue Nov  7 09:56:03 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.351 2017/08/15 09:26:56 maya Exp $	*/
+/*	$NetBSD: machdep.c,v 1.352 2017/11/07 14:56:03 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.351 2017/08/15 09:26:56 maya Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.352 2017/11/07 14:56:03 christos Exp $");
 
 #include "opt_adb.h"
 #include "opt_copy_symtab.h"
@@ -114,7 +114,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 #ifdef	KGDB
 #include 
 #endif
-#define ELFSIZE 32
 #include 
 #include 
 #include 



CVS commit: src/sys/arch/mac68k/obio

2017-10-12 Thread Felix Deichmann
Module Name:src
Committed By:   flxd
Date:   Thu Oct 12 09:48:53 UTC 2017

Modified Files:
src/sys/arch/mac68k/obio: asc.c

Log Message:
Exclude Enhanced Apple Sound Chip (EASC) without support for wavetable mode
used by asc(4).


To generate a diff of this commit:
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/mac68k/obio/asc.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/mac68k/obio/asc.c
diff -u src/sys/arch/mac68k/obio/asc.c:1.57 src/sys/arch/mac68k/obio/asc.c:1.58
--- src/sys/arch/mac68k/obio/asc.c:1.57	Fri Jul 25 08:10:34 2014
+++ src/sys/arch/mac68k/obio/asc.c	Thu Oct 12 09:48:53 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: asc.c,v 1.57 2014/07/25 08:10:34 dholland Exp $	*/
+/*	$NetBSD: asc.c,v 1.58 2017/10/12 09:48:53 flxd Exp $	*/
 
 /*
  * Copyright (C) 1997 Scott Reynolds
@@ -64,7 +64,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.57 2014/07/25 08:10:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.58 2017/10/12 09:48:53 flxd Exp $");
 
 #include 
 #include 
@@ -135,6 +135,8 @@ const struct cdevsw asc_cdevsw = {
 	.d_flag = 0
 };
 
+static const uint8_t easc_version_tab[] = { 0xb0 };
+
 static int
 ascmatch(device_t parent, cfdata_t cf, void *aux)
 {
@@ -142,6 +144,7 @@ ascmatch(device_t parent, cfdata_t cf, v
 	bus_addr_t addr;
 	bus_space_handle_t bsh;
 	int rval = 0;
+	uint8_t ver;
 
 	if (oa->oa_addr != (-1))
 		addr = (bus_addr_t)oa->oa_addr;
@@ -155,9 +158,20 @@ ascmatch(device_t parent, cfdata_t cf, v
 	if (bus_space_map(oa->oa_tag, addr, MAC68K_ASC_LEN, 0, ))
 		return (0);
 
-	if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0, 1))
+	if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0, 1)) {
 		rval = 1;
-	else
+
+		/*
+		 * Enhanced Apple Sound Chip (EASC) does not support wavetable
+		 * mode, exclude it for now.
+		 */
+		ver = bus_space_read_1(oa->oa_tag, bsh, 0x800);
+		for (size_t i = 0; i < __arraycount(easc_version_tab); i++)
+			if (ver == easc_version_tab[i]) {
+rval = 0;
+break;
+			}
+	} else
 		rval = 0;
 
 	bus_space_unmap(oa->oa_tag, bsh, MAC68K_ASC_LEN);



CVS commit: src/sys/arch/mac68k/mac68k

2017-08-15 Thread Maya Rashish
Module Name:src
Committed By:   maya
Date:   Tue Aug 15 09:26:56 UTC 2017

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

Log Message:
Remove dead code. it isn't possible to do non-__ELF__ build


To generate a diff of this commit:
cvs rdiff -u -r1.350 -r1.351 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.350 src/sys/arch/mac68k/mac68k/machdep.c:1.351
--- src/sys/arch/mac68k/mac68k/machdep.c:1.350	Mon Apr  3 17:36:17 2017
+++ src/sys/arch/mac68k/mac68k/machdep.c	Tue Aug 15 09:26:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.350 2017/04/03 17:36:17 christos Exp $	*/
+/*	$NetBSD: machdep.c,v 1.351 2017/08/15 09:26:56 maya Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.350 2017/04/03 17:36:17 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.351 2017/08/15 09:26:56 maya Exp $");
 
 #include "opt_adb.h"
 #include "opt_copy_symtab.h"
@@ -872,12 +872,10 @@ getenvvars(u_long flag, char *buf)
 	extern long macos_gmtbias;
 	int root_scsi_id;
 	u_long root_ata_dev;
-#ifdef	__ELF__
 	int i;
 	Elf_Ehdr *ehdr;
 	Elf_Shdr *shp;
 	vaddr_t minsym;
-#endif
 
 	/*
 	 * If flag & 0x8000 == 0, then we're booting with the old booter
@@ -990,7 +988,6 @@ getenvvars(u_long flag, char *buf)
  	ADBReInit_JTBL = getenv("ADBREINIT_JTBL");
  	mrg_ADBIntrPtr = (void *)getenv("ADBINTERRUPT");
 
-#ifdef	__ELF__
 	/*
 	 * Check the ELF headers.
 	 */
@@ -1017,10 +1014,6 @@ getenvvars(u_long flag, char *buf)
 
 	symsize = 1;
 	ssym = (int *)ehdr;
-#else
-	symsize = *(int *)
-	ssym = ((int *)) + 1;
-#endif
 }
 
 static long



CVS commit: src/sys/arch/mac68k/nubus

2017-07-28 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat Jul 29 02:17:44 UTC 2017

Modified Files:
src/sys/arch/mac68k/nubus: if_netdock_nubus.c

Log Message:
Avoid memory leak in netdock_get.

If top is null, this is the first time through and nothing else will
free m.

>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/sys/arch/mac68k/nubus/if_netdock_nubus.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/mac68k/nubus/if_netdock_nubus.c
diff -u src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.25 src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.26
--- src/sys/arch/mac68k/nubus/if_netdock_nubus.c:1.25	Thu Dec 15 09:28:03 2016
+++ src/sys/arch/mac68k/nubus/if_netdock_nubus.c	Sat Jul 29 02:17:44 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_netdock_nubus.c,v 1.25 2016/12/15 09:28:03 ozaki-r Exp $	*/
+/*	$NetBSD: if_netdock_nubus.c,v 1.26 2017/07/29 02:17:44 riastradh Exp $	*/
 
 /*
  * Copyright (C) 2000,2002 Daishi Kato 
@@ -43,7 +43,7 @@
 /***/
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.25 2016/12/15 09:28:03 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_netdock_nubus.c,v 1.26 2017/07/29 02:17:44 riastradh Exp $");
 
 #include 
 #include 
@@ -802,6 +802,8 @@ netdock_get(struct netdock_softc *sc, in
 			if ((m->m_flags & M_EXT) == 0) {
 if (top)
 	m_freem(top);
+else
+	m_freem(m);
 return (NULL);
 			}
 			len = MCLBYTES;



CVS commit: src/sys/arch/mac68k/mac68k

2017-04-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon Apr  3 17:36:17 UTC 2017

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

Log Message:
PR/52134: David Binderman: Fix loop bounds checking.


To generate a diff of this commit:
cvs rdiff -u -r1.349 -r1.350 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.349 src/sys/arch/mac68k/mac68k/machdep.c:1.350
--- src/sys/arch/mac68k/mac68k/machdep.c:1.349	Sat Aug 29 21:46:03 2015
+++ src/sys/arch/mac68k/mac68k/machdep.c	Mon Apr  3 13:36:17 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.349 2015/08/30 01:46:03 uebayasi Exp $	*/
+/*	$NetBSD: machdep.c,v 1.350 2017/04/03 17:36:17 christos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.349 2015/08/30 01:46:03 uebayasi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.350 2017/04/03 17:36:17 christos Exp $");
 
 #include "opt_adb.h"
 #include "opt_copy_symtab.h"
@@ -646,7 +646,7 @@ cpu_dumpconf(void)
 	chdrsize = cpu_dumpsize();
 
 	dumpsize = 0;
-	for (i = 0; m->ram_segs[i].size && i < M68K_NPHYS_RAM_SEGS; i++)
+	for (i = 0; i < M68K_NPHYS_RAM_SEGS && m->ram_segs[i].size; i++)
 		dumpsize += btoc(m->ram_segs[i].size);
 
 	/*



CVS commit: src/sys/arch/mac68k/nubus

2016-02-28 Thread Robert Swindells
Module Name:src
Committed By:   rjs
Date:   Sun Feb 28 19:39:27 UTC 2016

Modified Files:
src/sys/arch/mac68k/nubus: grf_nubus.c

Log Message:
Set sc_dev field of softc.

Should pullup to 7.


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/mac68k/nubus/grf_nubus.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/mac68k/nubus/grf_nubus.c
diff -u src/sys/arch/mac68k/nubus/grf_nubus.c:1.77 src/sys/arch/mac68k/nubus/grf_nubus.c:1.78
--- src/sys/arch/mac68k/nubus/grf_nubus.c:1.77	Fri Oct 25 21:42:30 2013
+++ src/sys/arch/mac68k/nubus/grf_nubus.c	Sun Feb 28 19:39:27 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_nubus.c,v 1.77 2013/10/25 21:42:30 martin Exp $	*/
+/*	$NetBSD: grf_nubus.c,v 1.78 2016/02/28 19:39:27 rjs Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: grf_nubus.c,v 1.77 2013/10/25 21:42:30 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: grf_nubus.c,v 1.78 2016/02/28 19:39:27 rjs Exp $");
 
 #include 
 
@@ -143,6 +143,7 @@ grfmv_attach(device_t parent, device_t s
 
 	memcpy(>sc_slot, na->fmt, sizeof(nubus_slot));
 
+	sc->sc_dev = self;
 	sc->sc_tag = na->na_tag;
 	sc->card_id = na->drhw;
 	sc->sc_basepa = (bus_addr_t)NUBUS_SLOT2PA(na->slot);



CVS commit: src/sys/arch/mac68k/mac68k

2015-03-03 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Tue Mar  3 20:36:31 UTC 2015

Modified Files:
src/sys/arch/mac68k/mac68k: trap.c

Log Message:
Handle EINVAL in the fault path and send SIGBUS on mmap'd access past EOF.


To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/trap.c
diff -u src/sys/arch/mac68k/mac68k/trap.c:1.146 src/sys/arch/mac68k/mac68k/trap.c:1.147
--- src/sys/arch/mac68k/mac68k/trap.c:1.146	Sun Feb 19 21:06:15 2012
+++ src/sys/arch/mac68k/mac68k/trap.c	Tue Mar  3 20:36:31 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.146 2012/02/19 21:06:15 rmind Exp $	*/
+/*	$NetBSD: trap.c,v 1.147 2015/03/03 20:36:31 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.146 2012/02/19 21:06:15 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: trap.c,v 1.147 2015/03/03 20:36:31 martin Exp $);
 
 #include opt_ddb.h
 #include opt_execfmt.h
@@ -585,11 +585,6 @@ copyfault:
 			}
 			goto out;
 		}
-		if (rv == EACCES) {
-			ksi.ksi_code = SEGV_ACCERR;
-			rv = EFAULT;
-		} else
-			ksi.ksi_code = SEGV_MAPERR;
 		if (type == T_MMUFLT) {
 			if (onfault)
 goto copyfault;
@@ -600,14 +595,26 @@ copyfault:
 			goto dopanic;
 		}
 		ksi.ksi_addr = (void *)v;
-		if (rv == ENOMEM) {
+		switch (rv) {
+		case ENOMEM:
 			printf(UVM: pid %d (%s), uid %d killed: out of swap\n,
 			   p-p_pid, p-p_comm,
 			   l-l_cred ?
 			   kauth_cred_geteuid(l-l_cred) : -1);
 			ksi.ksi_signo = SIGKILL;
-		} else {
+			break;
+		case EINVAL:
+			ksi.ksi_signo = SIGBUS;
+			ksi.ksi_code = BUS_ADRERR;
+			break;
+		case EACCES:
 			ksi.ksi_signo = SIGSEGV;
+			ksi.ksi_code = SEGV_ACCERR;
+			break;
+		default:
+			ksi.ksi_signo = SIGSEGV;
+			ksi.ksi_code = SEGV_MAPERR;
+			break;
 		}
 		break;
 	}



CVS commit: src/sys/arch/mac68k/obio

2015-01-03 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sat Jan  3 16:44:15 UTC 2015

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
fix typo


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.54 src/sys/arch/mac68k/obio/iwm_fd.c:1.55
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.54	Fri Jan  2 14:42:05 2015
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Sat Jan  3 11:44:14 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.54 2015/01/02 19:42:05 christos Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.55 2015/01/03 16:44:14 christos Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iwm_fd.c,v 1.54 2015/01/02 19:42:05 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: iwm_fd.c,v 1.55 2015/01/03 16:44:14 christos Exp $);
 
 #include locators.h
 
@@ -721,7 +721,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 	fd = iwm-fd[fdUnit];
 	result = 0;
 
-	error = disk_ioctl(fd-diskIndfo, fdType, cmd, data, flag, l);
+	error = disk_ioctl(fd-diskInfo, fdType, cmd, data, flag, l);
 	if (error != EPASSTHROUGH)
 		return error;
 



CVS commit: src/sys/arch/mac68k/obio

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 15:49:52 UTC 2015

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
name the flag ioctl argument flag like most other drivers.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.52 src/sys/arch/mac68k/obio/iwm_fd.c:1.53
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.52	Thu Jan  1 12:47:21 2015
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Fri Jan  2 10:49:51 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.52 2015/01/01 17:47:21 christos Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.53 2015/01/02 15:49:51 christos Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iwm_fd.c,v 1.52 2015/01/01 17:47:21 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: iwm_fd.c,v 1.53 2015/01/02 15:49:51 christos Exp $);
 
 #include locators.h
 
@@ -698,7 +698,7 @@ fdclose(dev_t dev, int flags, int devTyp
  * we do not support them.
  */
 int
-fdioctl(dev_t dev, u_long cmd, void *data, int flags, struct lwp *l)
+fdioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
 {
 	int result, fdUnit, fdType;
 	fd_softc_t *fd;
@@ -729,7 +729,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 	case DIOCSDINFO:
 		if (TRACE_IOCTL)
 			printf( DIOCSDINFO: Set in-core disklabel.\n);
-		result = ((flags  FWRITE) == 0) ? EBADF : 0;
+		result = ((flag  FWRITE) == 0) ? EBADF : 0;
 		if (result == 0)
 			result = setdisklabel(fd-diskInfo.dk_label,
 			(struct disklabel *)data, 0,
@@ -740,7 +740,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 		if (TRACE_IOCTL)
 			printf( DIOCWDINFO: Set in-core disklabel 
 			 update disk.\n);
-		result = ((flags  FWRITE) == 0) ? EBADF : 0;
+		result = ((flag  FWRITE) == 0) ? EBADF : 0;
 
 		if (result == 0)
 			result = setdisklabel(fd-diskInfo.dk_label,
@@ -779,7 +779,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 	case DIOCWLABEL:
 		if (TRACE_IOCTL)
 			printf( DIOCWLABEL: Set write access to disklabel.\n);
-		result = ((flags  FWRITE) == 0) ? EBADF : 0;
+		result = ((flag  FWRITE) == 0) ? EBADF : 0;
 
 		if (result == 0)
 			fd-writeLabel = *(int *)data;



CVS commit: src/sys/arch/mac68k/obio

2015-01-02 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Jan  2 15:50:28 UTC 2015

Modified Files:
src/sys/arch/mac68k/obio: iwm.s

Log Message:
avoid trigraph


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/mac68k/obio/iwm.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/mac68k/obio/iwm.s
diff -u src/sys/arch/mac68k/obio/iwm.s:1.6 src/sys/arch/mac68k/obio/iwm.s:1.7
--- src/sys/arch/mac68k/obio/iwm.s:1.6	Tue Nov 30 11:05:55 2010
+++ src/sys/arch/mac68k/obio/iwm.s	Fri Jan  2 10:50:28 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm.s,v 1.6 2010/11/30 16:05:55 hauke Exp $	*/
+/*	$NetBSD: iwm.s,v 1.7 2015/01/02 15:50:28 christos Exp $	*/
 
 /*
  * Copyright (c) 1996-99 Hauke Fath.  All rights reserved.
@@ -1130,7 +1130,7 @@ wsRDY01:	
 	moveb	%a4@(0,%d3),%a0@	| Translate nibble and write
 	subqw	#3,%d4			| Update counter
 	moveb	%d7,%d3
-	addb	%d7,%d3			| Set X flag (??)
+	addb	%d7,%d3			| Set X flag (Why?)
 	rolb	#1,%d7
 	andib	#0x3F,%d0
 wsRDY02:



CVS commit: src/sys/arch/mac68k/obio

2015-01-01 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Thu Jan  1 17:47:21 UTC 2015

Modified Files:
src/sys/arch/mac68k/obio: iwm_fd.c

Log Message:
declare error


To generate a diff of this commit:
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/mac68k/obio/iwm_fd.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/mac68k/obio/iwm_fd.c
diff -u src/sys/arch/mac68k/obio/iwm_fd.c:1.51 src/sys/arch/mac68k/obio/iwm_fd.c:1.52
--- src/sys/arch/mac68k/obio/iwm_fd.c:1.51	Wed Dec 31 14:52:05 2014
+++ src/sys/arch/mac68k/obio/iwm_fd.c	Thu Jan  1 12:47:21 2015
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm_fd.c,v 1.51 2014/12/31 19:52:05 christos Exp $	*/
+/*	$NetBSD: iwm_fd.c,v 1.52 2015/01/01 17:47:21 christos Exp $	*/
 
 /*
  * Copyright (c) 1997, 1998 Hauke Fath.  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: iwm_fd.c,v 1.51 2014/12/31 19:52:05 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: iwm_fd.c,v 1.52 2015/01/01 17:47:21 christos Exp $);
 
 #include locators.h
 
@@ -703,6 +703,7 @@ fdioctl(dev_t dev, u_long cmd, void *dat
 	int result, fdUnit, fdType;
 	fd_softc_t *fd;
 	iwm_softc_t *iwm = device_lookup_private(iwm_cd, 0);
+	int error;
 
 	if (TRACE_IOCTL)
 		printf(iwm: Execute ioctl... );



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

2014-06-29 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sun Jun 29 12:18:42 UTC 2014

Modified Files:
src/sys/arch/mac68k/dev: sbc.c

Log Message:
Remove an unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/mac68k/dev/sbc.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/mac68k/dev/sbc.c
diff -u src/sys/arch/mac68k/dev/sbc.c:1.55 src/sys/arch/mac68k/dev/sbc.c:1.56
--- src/sys/arch/mac68k/dev/sbc.c:1.55	Fri Dec  7 08:04:02 2012
+++ src/sys/arch/mac68k/dev/sbc.c	Sun Jun 29 12:18:42 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbc.c,v 1.55 2012/12/07 08:04:02 hauke Exp $	*/
+/*	$NetBSD: sbc.c,v 1.56 2014/06/29 12:18:42 martin Exp $	*/
 
 /*
  * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sbc.c,v 1.55 2012/12/07 08:04:02 hauke Exp $);
+__KERNEL_RCSID(0, $NetBSD: sbc.c,v 1.56 2014/06/29 12:18:42 martin Exp $);
 
 #include opt_ddb.h
 
@@ -426,7 +426,6 @@ sbc_drq_intr(void *p)
 	volatile u_int8_t *drq = 0;	/* XXX gcc4 -Wuninitialized */
 	u_int8_t *data;
 	int count, dcount, resid;
-	u_int8_t tmp;
 
 	/*
 	 * If we're not ready to xfer data, or have no more, just return.
@@ -534,7 +533,7 @@ sbc_drq_intr(void *p)
 		 */
 		if (dcount = MAX_DMA_LEN)
 			drq = (volatile u_int8_t *)sc-sc_drq_addr;
-		tmp = *drq;
+		(void)*drq;
 	} else {	/* Data In */
 		/*
 		 * Get the dest address aligned.



CVS commit: src/sys/arch/mac68k/mac68k

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

Modified Files:
src/sys/arch/mac68k/mac68k: pram.c

Log Message:
kill sprintf


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mac68k/mac68k/pram.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/mac68k/mac68k/pram.c
diff -u src/sys/arch/mac68k/mac68k/pram.c:1.22 src/sys/arch/mac68k/mac68k/pram.c:1.23
--- src/sys/arch/mac68k/mac68k/pram.c:1.22	Tue Jun 20 20:02:26 2006
+++ src/sys/arch/mac68k/mac68k/pram.c	Wed Mar 26 13:46:04 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: pram.c,v 1.22 2006/06/21 00:02:26 rjs Exp $	*/
+/*	$NetBSD: pram.c,v 1.23 2014/03/26 17:46:04 christos Exp $	*/
 
 /*-
  * Copyright (C) 1993	Allen K. Briggs, Chris P. Caputo,
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pram.c,v 1.22 2006/06/21 00:02:26 rjs Exp $);
+__KERNEL_RCSID(0, $NetBSD: pram.c,v 1.23 2014/03/26 17:46:04 christos Exp $);
 
 #include opt_adb.h
 
@@ -121,7 +121,8 @@ static const char *convtime(unsigned lon
 t=0;
   }
 
-  sprintf(s,%s %ld, %ld   %ld:%ld:%ld,monstr[month],day,year,hour,minute,seconds);
+  snprintf(s, sizeof(s), %s %ld, %ld   %ld:%ld:%ld,
+  monstr[month], day, year, hour, minute, seconds);
 
   return s;
 }



CVS commit: src/sys/arch/mac68k/mac68k

2014-03-15 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sat Mar 15 12:11:23 UTC 2014

Modified Files:
src/sys/arch/mac68k/mac68k: 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/mac68k/mac68k/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/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.169 src/sys/arch/mac68k/mac68k/locore.s:1.170
--- src/sys/arch/mac68k/mac68k/locore.s:1.169	Sun Mar  9 16:28:43 2014
+++ src/sys/arch/mac68k/mac68k/locore.s	Sat Mar 15 12:11:23 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 12:11:23 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -474,187 +474,16 @@ Lnocache0:
  */ 
 #include m68k/m68k/trap_subr.s
 
+/*
+ * Use common m68k bus error and address error handlers.
+ */
 	.data
 GLOBAL(mac68k_a2_fromfault)
 	.long	0
 GLOBAL(m68k_fault_addr)
 	.long	0
 
-#if defined(M68040) || defined(M68060)
-ENTRY_NOPROFILE(addrerr4060)
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save %USP
-	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 %USP
-	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	%a2,_C_LABEL(mac68k_a2_fromfault) | save %a2
-	movl	%sp@(FR_HW+8+8),_C_LABEL(m68k_fault_addr) | save fault addr
-	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 %USP
-	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	%a2,_C_LABEL(mac68k_a2_fromfault) | save %a2
-	movl	%sp@(FR_HW+8+20),_C_LABEL(m68k_fault_addr) | save fault addr
-	movl	_C_LABEL(nofault),%sp@-	| yes,
-	jbsr	_C_LABEL(longjmp)	|  longjmp(nofault)
-	/* NOTREACHED */
-#endif
-
-ENTRY_NOPROFILE(busaddrerr2030)
-#if !(defined(M68020) || defined(M68030))
-	jra	_C_LABEL(badtrap)
-#else
-	clrl	%sp@-			| stack adjust count
-	moveml	#0x,%sp@-		| save user registers
-	movl	%usp,%a0		| save %USP
-	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, 

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

2014-01-30 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Thu Jan 30 13:04:06 UTC 2014

Modified Files:
src/sys/arch/mac68k/dev: grf_compat.c

Log Message:
Add missing cast (to make it compilable)


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mac68k/dev/grf_compat.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/mac68k/dev/grf_compat.c
diff -u src/sys/arch/mac68k/dev/grf_compat.c:1.23 src/sys/arch/mac68k/dev/grf_compat.c:1.24
--- src/sys/arch/mac68k/dev/grf_compat.c:1.23	Sun Jan 26 00:08:48 2014
+++ src/sys/arch/mac68k/dev/grf_compat.c	Thu Jan 30 13:04:06 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_compat.c,v 1.23 2014/01/26 00:08:48 christos Exp $	*/
+/*	$NetBSD: grf_compat.c,v 1.24 2014/01/30 13:04:06 martin Exp $	*/
 
 /*
  * Copyright (C) 1999 Scott Reynolds
@@ -34,7 +34,7 @@
 #include opt_grf_compat.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: grf_compat.c,v 1.23 2014/01/26 00:08:48 christos Exp $);
+__KERNEL_RCSID(0, $NetBSD: grf_compat.c,v 1.24 2014/01/30 13:04:06 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -316,7 +316,7 @@ grfmap(dev_t dev, struct macfb_softc *sc
 
 	len = m68k_round_page(sc-sc_dc-dc_offset + sc-sc_dc-dc_size);
 	*addrp = (void *)p-p_emul-e_vm_default_addr(p,
-	p-p_vmspace-vm_daddr, len);
+	(vaddr_t)p-p_vmspace-vm_daddr, len);
 	flags = MAP_SHARED | MAP_FIXED;
 
 	vn.v_type = VCHR;		/* XXX */



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

2014-01-25 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Sun Jan 26 00:08:48 UTC 2014

Modified Files:
src/sys/arch/mac68k/dev: grf_compat.c

Log Message:
kill VM_DEFAULT_ADDRESS use


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mac68k/dev/grf_compat.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/mac68k/dev/grf_compat.c
diff -u src/sys/arch/mac68k/dev/grf_compat.c:1.22 src/sys/arch/mac68k/dev/grf_compat.c:1.23
--- src/sys/arch/mac68k/dev/grf_compat.c:1.22	Sun Jun  6 00:52:17 2010
+++ src/sys/arch/mac68k/dev/grf_compat.c	Sat Jan 25 19:08:48 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_compat.c,v 1.22 2010/06/06 04:52:17 mrg Exp $	*/
+/*	$NetBSD: grf_compat.c,v 1.23 2014/01/26 00:08:48 christos Exp $	*/
 
 /*
  * Copyright (C) 1999 Scott Reynolds
@@ -34,7 +34,7 @@
 #include opt_grf_compat.h
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: grf_compat.c,v 1.22 2010/06/06 04:52:17 mrg Exp $);
+__KERNEL_RCSID(0, $NetBSD: grf_compat.c,v 1.23 2014/01/26 00:08:48 christos Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -315,7 +315,8 @@ grfmap(dev_t dev, struct macfb_softc *sc
 	int error, flags;
 
 	len = m68k_round_page(sc-sc_dc-dc_offset + sc-sc_dc-dc_size);
-	*addrp = (void *)VM_DEFAULT_ADDRESS(p-p_vmspace-vm_daddr, len);
+	*addrp = (void *)p-p_emul-e_vm_default_addr(p,
+	p-p_vmspace-vm_daddr, len);
 	flags = MAP_SHARED | MAP_FIXED;
 
 	vn.v_type = VCHR;		/* XXX */



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

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 20:49:38 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: pm_direct.c

Log Message:
Remove unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.28 -r1.29 src/sys/arch/mac68k/dev/pm_direct.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/mac68k/dev/pm_direct.c
diff -u src/sys/arch/mac68k/dev/pm_direct.c:1.28 src/sys/arch/mac68k/dev/pm_direct.c:1.29
--- src/sys/arch/mac68k/dev/pm_direct.c:1.28	Wed Jan 24 13:08:12 2007
+++ src/sys/arch/mac68k/dev/pm_direct.c	Fri Oct 25 20:49:38 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: pm_direct.c,v 1.28 2007/01/24 13:08:12 hubertf Exp $	*/
+/*	$NetBSD: pm_direct.c,v 1.29 2013/10/25 20:49:38 martin Exp $	*/
 
 /*
  * Copyright (C) 1997 Takashi Hamada
@@ -32,7 +32,7 @@
 /* From: pm_direct.c 1.3 03/18/98 Takashi Hamada */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pm_direct.c,v 1.28 2007/01/24 13:08:12 hubertf Exp $);
+__KERNEL_RCSID(0, $NetBSD: pm_direct.c,v 1.29 2013/10/25 20:49:38 martin Exp $);
 
 #include opt_adb.h
 
@@ -598,7 +598,6 @@ pm_intr_pm1(void *arg)
 int
 pm_receive_pm2(u_char *data)
 {
-	int i;
 	int rval;
 
 	rval = 0xcd34;
@@ -608,7 +607,7 @@ pm_receive_pm2(u_char *data)
 			/* set VIA SR to input mode */
 			via_reg(VIA1, vACR) |= 0x0c;
 			via_reg(VIA1, vACR) = ~0x10;
-			i = PM_SR();
+			PM_SR();
 
 			PM_SET_STATE_ACKOFF();
 			if (pm_wait_busy((int)ADBDelay*32) != 0)
@@ -1137,7 +1136,6 @@ pm_adb_poll_next_device_pm1(PMData *pmda
 	int i;
 	int ndid;
 	u_short bendid = 0x1;
-	int rval;
 	PMData tmp_pmdata;
 
 	/* find another existent ADB device to poll */
@@ -1156,8 +1154,5 @@ pm_adb_poll_next_device_pm1(PMData *pmda
 	tmp_pmdata.data[0] = (u_char)(ndid  4) | 0xc;
 	tmp_pmdata.data[1] = 0x04;	/* magic spell for awaking the PM */
 	tmp_pmdata.data[2] = 0x00;
-	rval = pmgrop(tmp_pmdata);
+	pmgrop(tmp_pmdata);
 }
-
-
-



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

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 21:09:25 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: akbd.c

Log Message:
Mark a potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mac68k/dev/akbd.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/mac68k/dev/akbd.c
diff -u src/sys/arch/mac68k/dev/akbd.c:1.23 src/sys/arch/mac68k/dev/akbd.c:1.24
--- src/sys/arch/mac68k/dev/akbd.c:1.23	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/akbd.c	Fri Oct 25 21:09:25 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: akbd.c,v 1.23 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: akbd.c,v 1.24 2013/10/25 21:09:25 martin Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: akbd.c,v 1.23 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: akbd.c,v 1.24 2013/10/25 21:09:25 martin Exp $);
 
 #include opt_adb.h
 
@@ -132,7 +132,7 @@ akbdattach(device_t parent, device_t sel
 	ADBSetInfoBlock adbinfo;
 	struct akbd_softc *sc = device_private(self);
 	struct adb_attach_args *aa_args = (struct adb_attach_args *)aux;
-	int error, kbd_done;
+	int error __unused, kbd_done;
 	short cmd;
 	u_char buffer[9];
 #if NWSKBD  0



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

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 21:19:56 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: adb_direct.c

Log Message:
Mark potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mac68k/dev/adb_direct.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/mac68k/dev/adb_direct.c
diff -u src/sys/arch/mac68k/dev/adb_direct.c:1.65 src/sys/arch/mac68k/dev/adb_direct.c:1.66
--- src/sys/arch/mac68k/dev/adb_direct.c:1.65	Sat Oct 19 16:19:13 2013
+++ src/sys/arch/mac68k/dev/adb_direct.c	Fri Oct 25 21:19:56 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_direct.c,v 1.65 2013/10/19 16:19:13 martin Exp $	*/
+/*	$NetBSD: adb_direct.c,v 1.66 2013/10/25 21:19:56 martin Exp $	*/
 
 /* From: adb_direct.c 2.02 4/18/97 jpw */
 
@@ -62,7 +62,7 @@
 #ifdef __NetBSD__
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.65 2013/10/19 16:19:13 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.66 2013/10/25 21:19:56 martin Exp $);
 
 #include opt_adb.h
 
@@ -391,7 +391,7 @@ adb_cuda_tickle(void)
 void
 adb_intr_cuda(void *arg)
 {
-	volatile int i, ending;
+	volatile int i __unused, ending;
 	volatile unsigned int s;
 	struct adbCommand packet;
 



CVS commit: src/sys/arch/mac68k/obio

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 21:24:14 UTC 2013

Modified Files:
src/sys/arch/mac68k/obio: asc.c

Log Message:
Remove not yet used stuff


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/mac68k/obio/asc.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/mac68k/obio/asc.c
diff -u src/sys/arch/mac68k/obio/asc.c:1.54 src/sys/arch/mac68k/obio/asc.c:1.55
--- src/sys/arch/mac68k/obio/asc.c:1.54	Sat Oct 27 17:18:00 2012
+++ src/sys/arch/mac68k/obio/asc.c	Fri Oct 25 21:24:14 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: asc.c,v 1.54 2012/10/27 17:18:00 chs Exp $	*/
+/*	$NetBSD: asc.c,v 1.55 2013/10/25 21:24:14 martin Exp $	*/
 
 /*
  * Copyright (C) 1997 Scott Reynolds
@@ -64,7 +64,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: asc.c,v 1.54 2012/10/27 17:18:00 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: asc.c,v 1.55 2013/10/25 21:24:14 martin Exp $);
 
 #include sys/types.h
 #include sys/errno.h
@@ -250,11 +250,13 @@ ascwrite(dev_t dev, struct uio *uio, int
 int
 ascioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
 {
-	struct asc_softc *sc;
 	int error;
+#ifdef not_yet
+	struct asc_softc *sc;
 	int unit = ASCUNIT(dev);
 
 	sc = device_lookup_private(asc_cd, unit);
+#endif
 	error = 0;
 
 	switch (cmd) {



CVS commit: src/sys/arch/mac68k/nubus

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 21:42:30 UTC 2013

Modified Files:
src/sys/arch/mac68k/nubus: grf_nubus.c

Log Message:
Simplify


To generate a diff of this commit:
cvs rdiff -u -r1.76 -r1.77 src/sys/arch/mac68k/nubus/grf_nubus.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/mac68k/nubus/grf_nubus.c
diff -u src/sys/arch/mac68k/nubus/grf_nubus.c:1.76 src/sys/arch/mac68k/nubus/grf_nubus.c:1.77
--- src/sys/arch/mac68k/nubus/grf_nubus.c:1.76	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/nubus/grf_nubus.c	Fri Oct 25 21:42:30 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_nubus.c,v 1.76 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: grf_nubus.c,v 1.77 2013/10/25 21:42:30 martin Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs.  All rights reserved.
@@ -30,7 +30,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: grf_nubus.c,v 1.76 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: grf_nubus.c,v 1.77 2013/10/25 21:42:30 martin Exp $);
 
 #include sys/param.h
 
@@ -628,9 +628,8 @@ static void
 grfmv_intr_supermacgfx(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	u_int8_t dummy;
 
-	dummy = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xE70D3);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xE70D3);
 }
 
 /*
@@ -641,10 +640,9 @@ static void
 grfmv_intr_cmax(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	u_int32_t dummy;
 
-	dummy = bus_space_read_4(sc-sc_tag, sc-sc_handle, 0xf501c);
-	dummy = bus_space_read_4(sc-sc_tag, sc-sc_handle, 0xf5018);
+	bus_space_read_4(sc-sc_tag, sc-sc_handle, 0xf501c);
+	bus_space_read_4(sc-sc_tag, sc-sc_handle, 0xf5018);
 }
 
 /*
@@ -670,10 +668,9 @@ static void
 grfmv_intr_formac(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	u_int8_t dummy;
 
-	dummy = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xde80db);
-	dummy = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xde80d3);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xde80db);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xde80d3);
 }
 
 /*
@@ -697,9 +694,8 @@ static void
 grfmv_intr_gvimage(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	u_int8_t dummy;
 
-	dummy = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xf0);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xf0);
 }
 
 /*
@@ -710,9 +706,8 @@ static void
 grfmv_intr_radius_gsc(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	u_int8_t dummy;
 
-	dummy = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xfb802);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0xfb802);
 	bus_space_write_1(sc-sc_tag, sc-sc_handle, 0xfb802, 0xff);
 }
 
@@ -737,10 +732,9 @@ static void
 grfmv_intr_relax_200(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	unsigned long	scratch;
 
 	/* The board ROM driver code has a tst.l here. */
-	scratch = bus_space_read_4(sc-sc_tag, sc-sc_handle, 0x000D0040);
+	bus_space_read_4(sc-sc_tag, sc-sc_handle, 0x000D0040);
 }
 
 /*
@@ -764,9 +758,8 @@ static void
 grfmv_intr_viltro_340(void *vsc)
 {
 	struct grfbus_softc *sc = (struct grfbus_softc *)vsc;
-	u_int8_t scratch;
 
 	/* Yes, two read accesses to the same spot. */
-	scratch = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0x0500);
-	scratch = bus_space_read_1(sc-sc_tag, sc-sc_handle, 0x0500);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0x0500);
+	bus_space_read_1(sc-sc_tag, sc-sc_handle, 0x0500);
 }



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

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 21:48:48 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: mac68k5380.c ncr5380.c

Log Message:
Simplify


To generate a diff of this commit:
cvs rdiff -u -r1.48 -r1.49 src/sys/arch/mac68k/dev/mac68k5380.c
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/mac68k/dev/ncr5380.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/mac68k/dev/mac68k5380.c
diff -u src/sys/arch/mac68k/dev/mac68k5380.c:1.48 src/sys/arch/mac68k/dev/mac68k5380.c:1.49
--- src/sys/arch/mac68k/dev/mac68k5380.c:1.48	Thu Dec  6 13:28:17 2012
+++ src/sys/arch/mac68k/dev/mac68k5380.c	Fri Oct 25 21:48:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: mac68k5380.c,v 1.48 2012/12/06 13:28:17 hauke Exp $	*/
+/*	$NetBSD: mac68k5380.c,v 1.49 2013/10/25 21:48:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mac68k5380.c,v 1.48 2012/12/06 13:28:17 hauke Exp $);
+__KERNEL_RCSID(0, $NetBSD: mac68k5380.c,v 1.49 2013/10/25 21:48:48 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -147,9 +147,8 @@ static int	transfer_pdma(u_char *, u_cha
 static void
 scsi_clr_ipend(void)
 {
-	int tmp;
 
-	tmp = GET_5380_REG(NCR5380_IRCV);
+	GET_5380_REG(NCR5380_IRCV);
 	scsi_clear_irq();
 }
 
@@ -357,7 +356,7 @@ extern	int			*nofault, m68k_fault_addr;
 	register int		count;
 	volatile u_int32_t	*long_drq;
 	u_int32_t		*long_data;
-	volatile u_int8_t	*drq, tmp_data;
+	volatile u_int8_t	*drq;
 	u_int8_t		*data;
 
 #if DBG_PID
@@ -499,8 +498,7 @@ extern	int			*nofault, m68k_fault_addr;
 
 		PID(write complete);
 
-		drq = (volatile u_int8_t *) ncr_5380_with_drq;
-		tmp_data = *drq;
+		(void)*((volatile u_int8_t *) ncr_5380_with_drq);
 
 		PID(read a byte to force a phase change);
 	}

Index: src/sys/arch/mac68k/dev/ncr5380.c
diff -u src/sys/arch/mac68k/dev/ncr5380.c:1.65 src/sys/arch/mac68k/dev/ncr5380.c:1.66
--- src/sys/arch/mac68k/dev/ncr5380.c:1.65	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/ncr5380.c	Fri Oct 25 21:48:48 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ncr5380.c,v 1.65 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: ncr5380.c,v 1.66 2013/10/25 21:48:48 martin Exp $	*/
 
 /*
  * Copyright (c) 1995 Leo Weppelman.
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ncr5380.c,v 1.65 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: ncr5380.c,v 1.66 2013/10/25 21:48:48 martin Exp $);
 
 /*
  * Bit mask of targets you want debugging to be shown
@@ -262,7 +262,6 @@ ncr5380_scsi_request(struct scsipi_chann
 void *arg)
 {
 	struct scsipi_xfer *xs;
-	struct scsipi_periph *periph; 
 	struct ncr_softc *sc = device_private(chan-chan_adapter-adapt_dev);
 	int	sps, flags;
 	SC_REQ	*reqp, *link, *tmp;
@@ -271,7 +270,6 @@ ncr5380_scsi_request(struct scsipi_chann
 	case ADAPTER_REQ_RUN_XFER:
 		xs = arg;
 		flags = xs-xs_control;
-		periph = xs-xs_periph;
 
 		/*
 		 * We do not queue RESET commands
@@ -1629,7 +1627,6 @@ static int
 reach_msg_out(struct ncr_softc *sc, u_long len)
 {
 	u_char	phase;
-	u_char	data;
 	u_long	n = len;
 
 	ncr_aprint(sc, Trying to reach Message-out phase\n);
@@ -1648,7 +1645,7 @@ reach_msg_out(struct ncr_softc *sc, u_lo
 		if (((GET_5380_REG(NCR5380_IDSTAT)  2)  7) != phase)
 			break;
 		if (PH_IN(phase)) {
-			data = GET_5380_REG(NCR5380_DATA);
+			GET_5380_REG(NCR5380_DATA);
 			SET_5380_REG(NCR5380_ICOM, SC_A_ACK | SC_A_ATN);
 		}
 		else {



CVS commit: src/sys/arch/mac68k/obio

2013-10-25 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 25 21:50:28 UTC 2013

Modified Files:
src/sys/arch/mac68k/obio: wdc_obio.c

Log Message:
Simplify


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/mac68k/obio/wdc_obio.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/mac68k/obio/wdc_obio.c
diff -u src/sys/arch/mac68k/obio/wdc_obio.c:1.26 src/sys/arch/mac68k/obio/wdc_obio.c:1.27
--- src/sys/arch/mac68k/obio/wdc_obio.c:1.26	Tue Jul 31 15:50:32 2012
+++ src/sys/arch/mac68k/obio/wdc_obio.c	Fri Oct 25 21:50:28 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wdc_obio.c,v 1.26 2012/07/31 15:50:32 bouyer Exp $ */
+/*	$NetBSD: wdc_obio.c,v 1.27 2013/10/25 21:50:28 martin Exp $ */
 
 /*
  * Copyright (c) 2002 Takeshi Shibagaki  All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: wdc_obio.c,v 1.26 2012/07/31 15:50:32 bouyer Exp $);
+__KERNEL_RCSID(0, $NetBSD: wdc_obio.c,v 1.27 2013/10/25 21:50:28 martin Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -91,7 +91,6 @@ wdc_obio_match(device_t parent, cfdata_t
 	struct ata_channel ch;
 	struct wdc_softc wdc;
 	struct wdc_regs wdr;
-	static int wdc_matched = 0;
 	int i, result = 0;
 
 	memset(wdc, 0, sizeof(wdc));
@@ -132,8 +131,6 @@ wdc_obio_match(device_t parent, cfdata_t
 
 		bus_space_unmap(wdr.cmd_iot, wdr.cmd_baseioh, WDC_OBIO_REG_NPORTS);
 
-		if (result)
-			wdc_matched = 1;
 		return (result);
 	}
 	return 0;



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

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:19:13 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: adb_direct.c

Log Message:
Make sure we don't accidently pass an unsolicited packet as ack only
(which would dereference unitialized pointers)


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mac68k/dev/adb_direct.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/mac68k/dev/adb_direct.c
diff -u src/sys/arch/mac68k/dev/adb_direct.c:1.64 src/sys/arch/mac68k/dev/adb_direct.c:1.65
--- src/sys/arch/mac68k/dev/adb_direct.c:1.64	Fri Oct 18 18:38:49 2013
+++ src/sys/arch/mac68k/dev/adb_direct.c	Sat Oct 19 16:19:13 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_direct.c,v 1.64 2013/10/18 18:38:49 martin Exp $	*/
+/*	$NetBSD: adb_direct.c,v 1.65 2013/10/19 16:19:13 martin Exp $	*/
 
 /* From: adb_direct.c 2.02 4/18/97 jpw */
 
@@ -62,7 +62,7 @@
 #ifdef __NetBSD__
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.64 2013/10/18 18:38:49 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.65 2013/10/19 16:19:13 martin Exp $);
 
 #include opt_adb.h
 
@@ -1693,6 +1693,8 @@ adb_pass_up(struct adbCommand *in)
  	 * the caller sent us.
  	 */
 	if (in-unsol) {
+		if (in-ack_only) panic(invalid ack-only pkg);
+
 		adbInbound[adbInTail].compRout = (void *)block.dbServiceRtPtr;
 		adbInbound[adbInTail].compData = (void *)block.dbDataAreaAddr;
 		adbInbound[adbInTail].saveBuf = (void *)adbInbound[adbInTail].data;



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

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:21:57 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: aed.c

Log Message:
comment out unused code (for documentation purposes)


To generate a diff of this commit:
cvs rdiff -u -r1.30 -r1.31 src/sys/arch/mac68k/dev/aed.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/mac68k/dev/aed.c
diff -u src/sys/arch/mac68k/dev/aed.c:1.30 src/sys/arch/mac68k/dev/aed.c:1.31
--- src/sys/arch/mac68k/dev/aed.c:1.30	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/aed.c	Sat Oct 19 16:21:57 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: aed.c,v 1.30 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: aed.c,v 1.31 2013/10/19 16:21:57 martin Exp $	*/
 
 /*
  * Copyright (C) 1994	Bradley A. Grantham
@@ -26,7 +26,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: aed.c,v 1.30 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: aed.c,v 1.31 2013/10/19 16:21:57 martin Exp $);
 
 #include opt_adb.h
 
@@ -539,11 +539,8 @@ aedioctl(dev_t dev, u_long cmd, void *da
 		/* Do nothing for now */
 		break;
 
-	case ADBIOC_LISTENCMD:{
-		adb_listencmd_t *lc;
-
-		lc = (void *)data;
-	}
+	case ADBIOC_LISTENCMD:
+		/* adb_listencmd_t *lc = data; */
 
 	default:
 		return (EINVAL);



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

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 16:23:17 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: ams.c

Log Message:
Mark a potentially unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mac68k/dev/ams.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/mac68k/dev/ams.c
diff -u src/sys/arch/mac68k/dev/ams.c:1.21 src/sys/arch/mac68k/dev/ams.c:1.22
--- src/sys/arch/mac68k/dev/ams.c:1.21	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/ams.c	Sat Oct 19 16:23:17 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: ams.c,v 1.21 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: ams.c,v 1.22 2013/10/19 16:23:17 martin Exp $	*/
 
 /*
  * Copyright (C) 1998	Colin Wood
@@ -31,7 +31,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: ams.c,v 1.21 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: ams.c,v 1.22 2013/10/19 16:23:17 martin Exp $);
 
 #include sys/param.h
 #include sys/device.h
@@ -106,7 +106,7 @@ amsattach(device_t parent, device_t self
 	ADBSetInfoBlock adbinfo;
 	struct ams_softc *sc = device_private(self);
 	struct adb_attach_args * aa_args = (struct adb_attach_args *)aux;
-	int error;
+	int error __unused;
 #if NWSMOUSE  0
 	struct wsmousedev_attach_args a;
 #endif



CVS commit: src/sys/arch/mac68k/mac68k

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:08:39 UTC 2013

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

Log Message:
Avoid unused variables


To generate a diff of this commit:
cvs rdiff -u -r1.31 -r1.32 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/bus_space.c
diff -u src/sys/arch/mac68k/mac68k/bus_space.c:1.31 src/sys/arch/mac68k/mac68k/bus_space.c:1.32
--- src/sys/arch/mac68k/mac68k/bus_space.c:1.31	Mon Apr 28 20:23:27 2008
+++ src/sys/arch/mac68k/mac68k/bus_space.c	Sat Oct 19 19:08:39 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.c,v 1.31 2008/04/28 20:23:27 martin Exp $	*/
+/*	$NetBSD: bus_space.c,v 1.32 2013/10/19 19:08:39 martin Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.31 2008/04/28 20:23:27 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: bus_space.c,v 1.32 2013/10/19 19:08:39 martin Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -139,7 +139,9 @@ int
 bus_space_map(bus_space_tag_t t, bus_addr_t bpa, bus_size_t size, int flags,
 	  bus_space_handle_t *hp)
 {
+#ifdef DIAGNOSTIC
 	paddr_t pa, endpa;
+#endif
 	int error;
 
 	/*
@@ -151,10 +153,10 @@ bus_space_map(bus_space_tag_t t, bus_add
 	if (error)
 		return (error);
 
+#ifdef DIAGNOSTIC
 	pa = m68k_trunc_page(bpa + t);
 	endpa = m68k_round_page((bpa + t + size) - 1);
 
-#ifdef DIAGNOSTIC
 	if (endpa = pa)
 		panic(bus_space_map: overflow);
 #endif
@@ -269,7 +271,6 @@ int
 mac68k_bus_space_probe(bus_space_tag_t t, bus_space_handle_t h,
 		   bus_size_t offset, int size)
 {
-	int i;
 	label_t faultbuf;
 
 	nofault = faultbuf;
@@ -280,13 +281,13 @@ mac68k_bus_space_probe(bus_space_tag_t t
 
 	switch (size) {
 	case 1:
-		i = bus_space_read_1(t, h, offset);
+		bus_space_read_1(t, h, offset);
 		break;
 	case 2:
-		i = bus_space_read_2(t, h, offset);
+		bus_space_read_2(t, h, offset);
 		break;
 	case 4:
-		i = bus_space_read_4(t, h, offset);
+		bus_space_read_4(t, h, offset);
 		break;
 	case 8:
 	default:



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

2013-10-19 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Oct 19 19:47:55 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: if_mc.c

Log Message:
Remove an unused variable


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/arch/mac68k/dev/if_mc.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/mac68k/dev/if_mc.c
diff -u src/sys/arch/mac68k/dev/if_mc.c:1.39 src/sys/arch/mac68k/dev/if_mc.c:1.40
--- src/sys/arch/mac68k/dev/if_mc.c:1.39	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/if_mc.c	Sat Oct 19 19:47:55 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_mc.c,v 1.39 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: if_mc.c,v 1.40 2013/10/19 19:47:55 martin Exp $	*/
 
 /*-
  * Copyright (c) 1997 David Huang k...@azeotrope.org
@@ -35,7 +35,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: if_mc.c,v 1.39 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: if_mc.c,v 1.40 2013/10/19 19:47:55 martin Exp $);
 
 #include opt_ddb.h
 #include opt_inet.h
@@ -471,9 +471,9 @@ struct mc_softc *sc = arg;
 integrate void
 mc_tint(struct mc_softc *sc)
 {
-	u_int8_t xmtrc, xmtfs;
+	u_int8_t /* xmtrc,*/ xmtfs;
 
-	xmtrc = NIC_GET(sc, MACE_XMTRC);
+	/* xmtrc = */ NIC_GET(sc, MACE_XMTRC);
 	xmtfs = NIC_GET(sc, MACE_XMTFS);
 
 	if ((xmtfs  XMTSV) == 0)



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

2013-10-18 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Oct 18 18:38:49 UTC 2013

Modified Files:
src/sys/arch/mac68k/dev: adb_direct.c

Log Message:
Remove set but unused variables.


To generate a diff of this commit:
cvs rdiff -u -r1.63 -r1.64 src/sys/arch/mac68k/dev/adb_direct.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/mac68k/dev/adb_direct.c
diff -u src/sys/arch/mac68k/dev/adb_direct.c:1.63 src/sys/arch/mac68k/dev/adb_direct.c:1.64
--- src/sys/arch/mac68k/dev/adb_direct.c:1.63	Fri Apr  4 09:16:59 2008
+++ src/sys/arch/mac68k/dev/adb_direct.c	Fri Oct 18 18:38:49 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: adb_direct.c,v 1.63 2008/04/04 09:16:59 yamt Exp $	*/
+/*	$NetBSD: adb_direct.c,v 1.64 2013/10/18 18:38:49 martin Exp $	*/
 
 /* From: adb_direct.c 2.02 4/18/97 jpw */
 
@@ -62,7 +62,7 @@
 #ifdef __NetBSD__
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.63 2008/04/04 09:16:59 yamt Exp $);
+__KERNEL_RCSID(0, $NetBSD: adb_direct.c,v 1.64 2013/10/18 18:38:49 martin Exp $);
 
 #include opt_adb.h
 
@@ -1238,7 +1238,7 @@ void
 adb_intr_IIsi(void *arg)
 {
 	struct adbCommand packet;
-	int i, ending;
+	int ending;
 	unsigned int s;
 
 	s = splhigh();		/* can't be too careful - might be called */
@@ -1351,7 +1351,7 @@ switch_start:
 		break;
 
 	case ADB_ACTION_OUT:
-		i = ADB_SR();	/* reset SR-intr in IFR */
+		(void)ADB_SR();	/* reset SR-intr in IFR */
 		ADB_SET_SR_OUTPUT();	/* set shift register for OUT */
 
 		ADB_SET_STATE_ACKOFF();	/* finish ACK */
@@ -2040,7 +2040,6 @@ void
 adb_hw_setup_IIsi(u_char *buffer)
 {
 	int i;
-	int dummy;
 	int s;
 	long my_time;
 	int endofframe;
@@ -2066,7 +2065,7 @@ adb_hw_setup_IIsi(u_char *buffer)
 			 */
 			my_time = ADB_DELAY * 5;
 			while ((ADB_SR_INTR_IS_OFF)  (my_time--  0))
-dummy = via_reg(VIA1, vBufB);
+(void)via_reg(VIA1, vBufB);
 
 			buffer[i++] = ADB_SR();	/* reset interrupt flag by
 		 * reading vSR */



CVS commit: src/sys/arch/mac68k

2013-07-16 Thread John Klos
Module Name:src
Committed By:   jklos
Date:   Tue Jul 16 07:31:40 UTC 2013

Modified Files:
src/sys/arch/mac68k/conf: GENERIC
src/sys/arch/mac68k/mac68k: genassym.cf locore.s machdep.c
pmap_bootstrap.c

Log Message:
Added DJMEMCMAX option for recognizing 128 meg SIMMs in Centris and Quadra
610, 650 and 800 systems. From Rob Braun,
http://synack.net/~bbraun/netbsdmac2.html


To generate a diff of this commit:
cvs rdiff -u -r1.214 -r1.215 src/sys/arch/mac68k/conf/GENERIC
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mac68k/mac68k/genassym.cf
cvs rdiff -u -r1.166 -r1.167 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.345 -r1.346 src/sys/arch/mac68k/mac68k/machdep.c
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/mac68k/mac68k/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/mac68k/conf/GENERIC
diff -u src/sys/arch/mac68k/conf/GENERIC:1.214 src/sys/arch/mac68k/conf/GENERIC:1.215
--- src/sys/arch/mac68k/conf/GENERIC:1.214	Sun Jun 30 21:38:57 2013
+++ src/sys/arch/mac68k/conf/GENERIC	Tue Jul 16 07:31:40 2013
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.214 2013/06/30 21:38:57 rmind Exp $
+# $NetBSD: GENERIC,v 1.215 2013/07/16 07:31:40 jklos Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		arch/mac68k/conf/std.mac68k
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.214 $
+#ident 		GENERIC-$Revision: 1.215 $
 
 maxusers	16		# estimated number of users
 
@@ -35,6 +35,10 @@ options 	M68020		# Note:  must have 6885
 options 	FPSP
 options 	FPU_EMULATE
 
+# Support for 128 meg SIMMs in Centris / Quadra 610, 650 and 800 machines.
+# You need to set the total memory in the MacOS Booter.
+#options 	DJMEMCMAX
+
 # Standard system options
 
 options 	INSECURE	# disable kernel security levels

Index: src/sys/arch/mac68k/mac68k/genassym.cf
diff -u src/sys/arch/mac68k/mac68k/genassym.cf:1.36 src/sys/arch/mac68k/mac68k/genassym.cf:1.37
--- src/sys/arch/mac68k/mac68k/genassym.cf:1.36	Fri Jan 14 02:06:28 2011
+++ src/sys/arch/mac68k/mac68k/genassym.cf	Tue Jul 16 07:31:40 2013
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.36 2011/01/14 02:06:28 rmind Exp $
+#	$NetBSD: genassym.cf,v 1.37 2013/07/16 07:31:40 jklos Exp $
 
 #
 # Copyright (c) 1990 The Regents of the University of California.
@@ -169,6 +169,13 @@ define	ENOENT			ENOENT
 define	EFAULT			EFAULT
 define	ENAMETOOLONG		ENAMETOOLONG
 
+# machine ids
+define MACH_MACC610		MACH_MACC610
+define MACH_MACQ610		MACH_MACQ610
+define MACH_MACC650		MACH_MACC650
+define MACH_MACQ650		MACH_MACQ650
+define MACH_MACQ800		MACH_MACQ800
+
 # SVR4 binary compatibility
 ifdef COMPAT_SVR4
 define SVR4_SIGF_HANDLER	offsetof(struct svr4_sigframe, sf_handler)

Index: src/sys/arch/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.166 src/sys/arch/mac68k/mac68k/locore.s:1.167
--- src/sys/arch/mac68k/mac68k/locore.s:1.166	Thu Dec 22 15:33:29 2011
+++ src/sys/arch/mac68k/mac68k/locore.s	Tue Jul 16 07:31:40 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.166 2011/12/22 15:33:29 tsutsui Exp $	*/
+/*	$NetBSD: locore.s,v 1.167 2013/07/16 07:31:40 jklos Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -273,6 +273,117 @@ Lstart3:
 	movl	%a1,%d1
 	.word	0xf518			| pflusha
 	.long	0x4e7b1807		| movc %d1,%srp
+
+#if defined(DJMEMCMAX)
+	movl	%a3,%sp@-
+	cmp	#MACH_MACC610,_C_LABEL(machineid)
+	jra	Ldjmemc610
+	cmp	#MACH_MACQ610,_C_LABEL(machineid)
+	jra	Ldjmemc610
+	cmp	#MACH_MACC650,_C_LABEL(machineid)
+	jra	Ldjmemccfg
+	cmp	#MACH_MACQ650,_C_LABEL(machineid)
+	jra	Ldjmemccfg
+	cmp	#MACH_MACQ800,_C_LABEL(machineid)
+	jra	Ldjmemccfg
+
+	jra	Lnodjmemc
+   
+Ldjmemccfg:
+	movl	#0x50f0e00c,%a0
+	movl	%a0@,%d0	| determine where RAM SIMMs start
+	andl	#0x00FF,%d0
+	addl	#0x10,%d0	| bank 3 start
+	addl	#0x10,%d0	| bank 4 start
+
+	movl	#0x50f0e014,%a0
+	movl	%d0,%a0@+	| bank 4
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 5
+	addl	#0x10,%d0
+
+	movl	%d0,%a0@+	| bank 6
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 7
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 8
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 9
+	addl	#0x10,%d0
+	jra	Ldjmemctop
+
+Ldjmemc610:
+	movl	#0x50f0e00c,%a0
+	movl	%a0@,%d0	| determine where RAM SIMMs start
+	andl	#0x00FF,%d0
+	addl	#0x10,%d0	| bank 3 start
+
+	movl	#0x50f0e014,%a0
+	movl	%d0,%a0@+	| bank 4
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 5
+	movl	%d0,%a0@+	| bank 6
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 7
+	movl	%d0,%a0@+	| bank 8
+	addl	#0x10,%d0
+	movl	%d0,%a0@+	| bank 9
+
+Ldjmemctop:
+	movl	#0x50F0E02C,%a0
+	movl	%d0,%a0@	| memtop
+
+	| preserve ~512KB beyond 4MB just in case
+	movl	#0x40,%a0
+	movl	#0x900,%a2
+	movl	#0x,%d0
+L1stbankcopy1:
+	movl	%a0@+,%a2@+
+	dbra	%d0,L1stbankcopy1
+	movl	#0x,%d0
+L1stbankcopy2:
+	movl	%a0@+,%a2@+
+	dbra	%d0,L1stbankcopy2
+
+	lea	_ASM_LABEL(Lsetup1stbank),%a0
+	movl	#0x880,%a2	| 

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

2012-12-07 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Fri Dec  7 08:04:02 UTC 2012

Modified Files:
src/sys/arch/mac68k/dev: sbc.c

Log Message:
Remove the R1 syntactic sugar, since it collides with a #define in
m68k/regs.h, breaking the build.

The R1s serve to bring the buffer pointer to a 4 byte boundary, but
that should be clear from the context.


To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 src/sys/arch/mac68k/dev/sbc.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/mac68k/dev/sbc.c
diff -u src/sys/arch/mac68k/dev/sbc.c:1.54 src/sys/arch/mac68k/dev/sbc.c:1.55
--- src/sys/arch/mac68k/dev/sbc.c:1.54	Mon Nov 23 00:11:44 2009
+++ src/sys/arch/mac68k/dev/sbc.c	Fri Dec  7 08:04:02 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sbc.c,v 1.54 2009/11/23 00:11:44 rmind Exp $	*/
+/*	$NetBSD: sbc.c,v 1.55 2012/12/07 08:04:02 hauke Exp $	*/
 
 /*
  * Copyright (C) 1996 Scott Reynolds.  All rights reserved.
@@ -45,7 +45,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: sbc.c,v 1.54 2009/11/23 00:11:44 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: sbc.c,v 1.55 2012/12/07 08:04:02 hauke Exp $);
 
 #include opt_ddb.h
 
@@ -274,7 +274,6 @@ sbc_pdma_in(struct ncr5380_softc *ncr_sc
 	}
 
 #define R4	*(u_int32_t *)data = *long_data, data += 4;
-#define R1	*(u_int8_t *)data = *byte_data, data += 1;
 	for (; resid = 128; resid -= 128) {
 		if (sbc_ready(ncr_sc))
 			goto interrupt;
@@ -286,11 +285,10 @@ sbc_pdma_in(struct ncr5380_softc *ncr_sc
 	while (resid) {
 		if (sbc_ready(ncr_sc))
 			goto interrupt;
-		R1;
+		*(u_int8_t *)data = *byte_data, data += 1;
 		resid--;
 	}
 #undef R4
-#undef R1
 
 interrupt:
 	nofault = NULL;
@@ -546,12 +544,10 @@ sbc_drq_intr(void *p)
 		if (count  count  4) {
 			data = (u_int8_t *)dh-dh_addr;
 			drq = (volatile u_int8_t *)sc-sc_drq_addr;
-
-#define R1		*data++ = *drq++
 			while (count) {
-R1; count--;
+*data++ = *drq++;
+count--;
 			}
-#undef R1
 			dh-dh_addr += resid;
 			dh-dh_len -= resid;
 		}
@@ -576,12 +572,10 @@ sbc_drq_intr(void *p)
 #undef R4
 			data = (u_int8_t *)long_data;
 			drq = (volatile u_int8_t *)long_drq;
-
-#define R1		*data++ = *drq++
 			while (count) {
-R1; count--;
+*data++ = *drq++;
+count--;
 			}
-#undef R1
 			dh-dh_len -= dcount;
 			dh-dh_addr += dcount;
 		}



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

2012-12-06 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Thu Dec  6 13:28:17 UTC 2012

Modified Files:
src/sys/arch/mac68k/dev: mac68k5380.c

Log Message:
Remove the R1 syntactic sugar, since it collides with a #define in
m68k/regs.h, breaking the build.

The R1s serve to bring the buffer pointer to a 4 byte boundary, but
that should be clear from the context.


To generate a diff of this commit:
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mac68k/dev/mac68k5380.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/mac68k/dev/mac68k5380.c
diff -u src/sys/arch/mac68k/dev/mac68k5380.c:1.47 src/sys/arch/mac68k/dev/mac68k5380.c:1.48
--- src/sys/arch/mac68k/dev/mac68k5380.c:1.47	Sat Oct 27 17:17:59 2012
+++ src/sys/arch/mac68k/dev/mac68k5380.c	Thu Dec  6 13:28:17 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: mac68k5380.c,v 1.47 2012/10/27 17:17:59 chs Exp $	*/
+/*	$NetBSD: mac68k5380.c,v 1.48 2012/12/06 13:28:17 hauke Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mac68k5380.c,v 1.47 2012/10/27 17:17:59 chs Exp $);
+__KERNEL_RCSID(0, $NetBSD: mac68k5380.c,v 1.48 2012/12/06 13:28:17 hauke Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -409,9 +409,8 @@ extern	int			*nofault, m68k_fault_addr;
 			data = (u_int8_t *) pending_5380_data;
 			drq = (volatile u_int8_t *) ncr_5380_with_drq;
 			while (count) {
-#define R1	*data++ = *drq++
-R1; count--;
-#undef R1
+*data++ = *drq++;
+count--;
 			}
 			pending_5380_data += resid;
 			pending_5380_count -= resid;
@@ -440,9 +439,8 @@ extern	int			*nofault, m68k_fault_addr;
 		data = (u_int8_t *) long_data;
 		drq = (volatile u_int8_t *) long_drq;
 		while (count) {
-#define R1	*data++ = *drq++
-			R1; count--;
-#undef R1
+			*data++ = *drq++;
+			count--;
 		}
 		pending_5380_count -= dcount;
 		pending_5380_data += dcount;



CVS commit: src/sys/arch/mac68k/mac68k

2012-08-04 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Sat Aug  4 17:18:39 UTC 2012

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

Log Message:
No need to statically initialize physmem here, it is set to the correct
value in pmap_bootstrap(), which is early enough.
Tested on my Centris 660AV.


To generate a diff of this commit:
cvs rdiff -u -r1.344 -r1.345 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/machdep.c
diff -u src/sys/arch/mac68k/mac68k/machdep.c:1.344 src/sys/arch/mac68k/mac68k/machdep.c:1.345
--- src/sys/arch/mac68k/mac68k/machdep.c:1.344	Fri Jul 27 05:36:11 2012
+++ src/sys/arch/mac68k/mac68k/machdep.c	Sat Aug  4 17:18:38 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.344 2012/07/27 05:36:11 matt Exp $	*/
+/*	$NetBSD: machdep.c,v 1.345 2012/08/04 17:18:38 martin Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -74,7 +74,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.344 2012/07/27 05:36:11 matt Exp $);
+__KERNEL_RCSID(0, $NetBSD: machdep.c,v 1.345 2012/08/04 17:18:38 martin Exp $);
 
 #include opt_adb.h
 #include opt_ddb.h
@@ -191,7 +191,6 @@ void *	mac68k_bell_cookie;
 struct vm_map *phys_map = NULL;
 
 int	maxmem;			/* max memory per process */
-int	physmem = MAXMEM;	/* max supported memory, changes to actual */
 
 /*
  * Extent maps to manage all memory space, including I/O ranges.  Allocate



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

2011-10-03 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Mon Oct  3 19:22:59 UTC 2011

Modified Files:
src/sys/arch/mac68k/conf: GENERIC SMALLRAM majors.mac68k

Log Message:
Add the MI software watchdog to GENERIC (not to SMALLRAM, as usual).


To generate a diff of this commit:
cvs rdiff -u -r1.201 -r1.202 src/sys/arch/mac68k/conf/GENERIC
cvs rdiff -u -r1.38 -r1.39 src/sys/arch/mac68k/conf/SMALLRAM
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mac68k/conf/majors.mac68k

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

Modified files:

Index: src/sys/arch/mac68k/conf/GENERIC
diff -u src/sys/arch/mac68k/conf/GENERIC:1.201 src/sys/arch/mac68k/conf/GENERIC:1.202
--- src/sys/arch/mac68k/conf/GENERIC:1.201	Thu Jun 30 20:09:32 2011
+++ src/sys/arch/mac68k/conf/GENERIC	Mon Oct  3 19:22:59 2011
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.201 2011/06/30 20:09:32 wiz Exp $
+# $NetBSD: GENERIC,v 1.202 2011/10/03 19:22:59 hauke Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@ include		arch/mac68k/conf/std.mac68k
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.201 $
+#ident 		GENERIC-$Revision: 1.202 $
 
 maxusers	16		# estimated number of users
 
@@ -350,6 +350,7 @@ pseudo-device	ite		1	# ite emulation for
 pseudo-device	pty			# pseudo-terminals
 pseudo-device	clockctl		# user control of clock subsystem
 pseudo-device	putter			# for puffs and pud
+pseudo-device	swwdog			# software watchdog driver
 
 # random number generator pseudo-device
 pseudo-device	rnd			# /dev/random and in-kernel generator

Index: src/sys/arch/mac68k/conf/SMALLRAM
diff -u src/sys/arch/mac68k/conf/SMALLRAM:1.38 src/sys/arch/mac68k/conf/SMALLRAM:1.39
--- src/sys/arch/mac68k/conf/SMALLRAM:1.38	Sun Mar  6 17:08:27 2011
+++ src/sys/arch/mac68k/conf/SMALLRAM	Mon Oct  3 19:22:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: SMALLRAM,v 1.38 2011/03/06 17:08:27 bouyer Exp $
+#	$NetBSD: SMALLRAM,v 1.39 2011/10/03 19:22:59 hauke Exp $
 #
 # This is an example of how to configure a small, efficient kernel for
 # a system with limited RAM. Even so it's capable of doing quite a
@@ -133,4 +133,5 @@ no pseudo-device	agr
 no pseudo-device	accf_data
 no pseudo-device	accf_http
 no pseudo-device	putter
+no pseudo-device	swwdog
 no pseudo-device	ksyms

Index: src/sys/arch/mac68k/conf/majors.mac68k
diff -u src/sys/arch/mac68k/conf/majors.mac68k:1.22 src/sys/arch/mac68k/conf/majors.mac68k:1.23
--- src/sys/arch/mac68k/conf/majors.mac68k:1.22	Thu Jun 30 20:09:32 2011
+++ src/sys/arch/mac68k/conf/majors.mac68k	Mon Oct  3 19:22:59 2011
@@ -1,4 +1,4 @@
-#	$NetBSD: majors.mac68k,v 1.22 2011/06/30 20:09:32 wiz Exp $
+#	$NetBSD: majors.mac68k,v 1.23 2011/10/03 19:22:59 hauke Exp $
 #
 # Device majors for mac68k
 #
@@ -49,6 +49,7 @@ device-major	cgd		char 51  block 23	cgd
 device-major	ksyms		char 52			ksyms
 device-major	wsfont		char 53			wsfont
 device-major	cpi		char 54			cpi
+device-major	sysmon		char 55			sysmon_wdog
 
 device-major	nsmb		char 98			nsmb
 



CVS commit: src/sys/arch/mac68k/obio

2011-08-01 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Aug  2 05:10:31 UTC 2011

Modified Files:
src/sys/arch/mac68k/obio: esp.c

Log Message:
Include sys/simplelock.h to use simple_lock(); fix build.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mac68k/obio/esp.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/mac68k/obio/esp.c
diff -u src/sys/arch/mac68k/obio/esp.c:1.52 src/sys/arch/mac68k/obio/esp.c:1.53
--- src/sys/arch/mac68k/obio/esp.c:1.52	Mon Nov 23 00:11:44 2009
+++ src/sys/arch/mac68k/obio/esp.c	Tue Aug  2 05:10:31 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.52 2009/11/23 00:11:44 rmind Exp $	*/
+/*	$NetBSD: esp.c,v 1.53 2011/08/02 05:10:31 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.52 2009/11/23 00:11:44 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.53 2011/08/02 05:10:31 uebayasi Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -89,6 +89,7 @@
 #include sys/buf.h
 #include sys/proc.h
 #include sys/queue.h
+#include sys/simplelock.h
 
 #include dev/scsipi/scsi_all.h
 #include dev/scsipi/scsipi_all.h



CVS commit: src/sys/arch/mac68k/obio

2011-08-01 Thread Masao Uebayashi
Module Name:src
Committed By:   uebayasi
Date:   Tue Aug  2 05:17:18 UTC 2011

Modified Files:
src/sys/arch/mac68k/obio: esp.c

Log Message:
ncr53c9x was converted to use mutex(9), follow that.  Fix DEBUG build too.


To generate a diff of this commit:
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mac68k/obio/esp.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/mac68k/obio/esp.c
diff -u src/sys/arch/mac68k/obio/esp.c:1.53 src/sys/arch/mac68k/obio/esp.c:1.54
--- src/sys/arch/mac68k/obio/esp.c:1.53	Tue Aug  2 05:10:31 2011
+++ src/sys/arch/mac68k/obio/esp.c	Tue Aug  2 05:17:18 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: esp.c,v 1.53 2011/08/02 05:10:31 uebayasi Exp $	*/
+/*	$NetBSD: esp.c,v 1.54 2011/08/02 05:17:18 uebayasi Exp $	*/
 
 /*
  * Copyright (c) 1997 Jason R. Thorpe.
@@ -77,7 +77,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.53 2011/08/02 05:10:31 uebayasi Exp $);
+__KERNEL_RCSID(0, $NetBSD: esp.c,v 1.54 2011/08/02 05:17:18 uebayasi Exp $);
 
 #include sys/types.h
 #include sys/param.h
@@ -89,7 +89,7 @@
 #include sys/buf.h
 #include sys/proc.h
 #include sys/queue.h
-#include sys/simplelock.h
+#include sys/mutex.h
 
 #include dev/scsipi/scsi_all.h
 #include dev/scsipi/scsipi_all.h
@@ -871,9 +871,9 @@
 	 * which protects itself against multiple invocation with a
 	 * simple_lock. Follow the example of ncr53c9x_poll().
 	 */
-	simple_unlock(sc-sc_lock);
+	mutex_exit(sc-sc_lock);
 	ncr53c9x_intr(sc);
-	simple_lock(sc-sc_lock);
+	mutex_enter(sc-sc_lock);
 	if (espspl != -1)
 		splx(espspl);
 	espspl = -1;



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

2011-07-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sat Jul  9 15:02:15 UTC 2011

Modified Files:
src/sys/arch/mac68k/dev: mac68k5380.c

Log Message:
avoid inconsistent inline usage to appease gcc 4.5.


To generate a diff of this commit:
cvs rdiff -u -r1.44 -r1.45 src/sys/arch/mac68k/dev/mac68k5380.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/mac68k/dev/mac68k5380.c
diff -u src/sys/arch/mac68k/dev/mac68k5380.c:1.44 src/sys/arch/mac68k/dev/mac68k5380.c:1.45
--- src/sys/arch/mac68k/dev/mac68k5380.c:1.44	Sat Dec 24 23:24:00 2005
+++ src/sys/arch/mac68k/dev/mac68k5380.c	Sat Jul  9 15:02:15 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: mac68k5380.c,v 1.44 2005/12/24 23:24:00 perry Exp $	*/
+/*	$NetBSD: mac68k5380.c,v 1.45 2011/07/09 15:02:15 mrg Exp $	*/
 
 /*
  * Copyright (c) 1995 Allen Briggs
@@ -34,7 +34,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: mac68k5380.c,v 1.44 2005/12/24 23:24:00 perry Exp $);
+__KERNEL_RCSID(0, $NetBSD: mac68k5380.c,v 1.45 2011/07/09 15:02:15 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -138,14 +138,14 @@
 static void	ncr5380_drq_intr(void *);
 static void	do_ncr5380_drq_intr(void *);
 
-static inline void	scsi_clr_ipend(void);
-static		  void	scsi_mach_init(struct ncr_softc *);
-static		  int	machine_match(struct device *, struct cfdata *, void *,
-			struct cfdriver *);
-static inline int	pdma_ready(void);
-static		  int	transfer_pdma(u_char *, u_char *, u_long *);
+static void	scsi_clr_ipend(void);
+static void	scsi_mach_init(struct ncr_softc *);
+static int	machine_match(struct device *, struct cfdata *, void *,
+			  struct cfdriver *);
+static int	pdma_ready(void);
+static int	transfer_pdma(u_char *, u_char *, u_long *);
 
-static inline void
+static void
 scsi_clr_ipend(void)
 {
 	int tmp;
@@ -266,7 +266,7 @@
 }
 #endif
 
-static inline int
+static int
 pdma_ready(void)
 {
 #if USE_PDMA



CVS commit: src/sys/arch/mac68k/mac68k

2011-01-02 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Sun Jan  2 18:16:59 UTC 2011

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

Log Message:
Pull code that maps the kernel segment table cache invalidated for 040/060,
to reduce diffs from other m68k ports.

Tested on LC630 (with 68LC040) upto single user.


To generate a diff of this commit:
cvs rdiff -u -r1.90 -r1.91 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/pmap_bootstrap.c
diff -u src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.90 src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.91
--- src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.90	Sun Jan  2 08:40:55 2011
+++ src/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Sun Jan  2 18:16:59 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.90 2011/01/02 08:40:55 tsutsui Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.91 2011/01/02 18:16:59 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.90 2011/01/02 08:40:55 tsutsui Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.91 2011/01/02 18:16:59 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -370,11 +370,11 @@
 	}
 	/*
 	 * Validate PTEs for kernel data/bss, dynamic data allocated
-	 * by us so far (nextpa - firstpa bytes), and pages for lwp0
+	 * by us so far (kstpa - firstpa bytes), and pages for lwp0
 	 * u-area and page table allocated below (RW).
 	 */
 	epte = PA2VA(kptpa, pt_entry_t *);
-	epte = epte[m68k_btop(nextpa - firstpa)];
+	epte = epte[m68k_btop(kstpa - firstpa)];
 	protopte = (protopte  ~PG_PROT) | PG_RW;
 	/*
 	 * Enable copy-back caching of data pages
@@ -385,6 +385,26 @@
 		*pte++ = protopte;
 		protopte += PAGE_SIZE;
 	}
+	/*
+	 * map the kernel segment table cache invalidated for
+	 * these machines (for the 68040 not strictly necessary, but
+	 * recommended by Motorola; for the 68060 mandatory)
+	 */
+	epte = PA2VA(kptpa, pt_entry_t *);
+	epte = epte[m68k_btop(nextpa - firstpa)];
+	protopte = (protopte  ~PG_PROT) | PG_RW;
+	if (mmutype == MMU_68040) {
+		protopte = ~PG_CCB;
+		protopte |= PG_CIN;
+	}
+	while (pte  epte) {
+		*pte++ = protopte;
+		protopte += PAGE_SIZE;
+	}
+
+	/*
+	 * Finally, validate the internal IO space PTEs (RW+CI).
+	 */
 
 #define	PTE2VA(pte)	m68k_ptob(pte - PA2VA(kptpa, pt_entry_t *))
 



CVS commit: src/sys/arch/mac68k/obio

2010-11-30 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Tue Nov 30 16:05:56 UTC 2010

Modified Files:
src/sys/arch/mac68k/obio: iwm.s

Log Message:
Fix an embarassing tyop. gcc should run aspell over the comments...


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/mac68k/obio/iwm.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/mac68k/obio/iwm.s
diff -u src/sys/arch/mac68k/obio/iwm.s:1.5 src/sys/arch/mac68k/obio/iwm.s:1.6
--- src/sys/arch/mac68k/obio/iwm.s:1.5	Mon May 26 17:58:37 2008
+++ src/sys/arch/mac68k/obio/iwm.s	Tue Nov 30 16:05:55 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: iwm.s,v 1.5 2008/05/26 17:58:37 hauke Exp $	*/
+/*	$NetBSD: iwm.s,v 1.6 2010/11/30 16:05:55 hauke Exp $	*/
 
 /*
  * Copyright (c) 1996-99 Hauke Fath.  All rights reserved.
@@ -514,7 +514,7 @@
 /*
  * iwmTrack00 -- move head to track 00 for drive calibration.
  *
- * XXX Drive makes funny noises during resore. Tune delay/retry count?
+ * XXX Drive makes funny noises during restore. Tune delay/retry count?
  *
  * Parameters:	-
  * Returns:	%d0		result code



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

2010-11-24 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Wed Nov 24 13:48:20 UTC 2010

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

Log Message:
One more page in the Big Book Of Things That We Can do Without --
COMPAT* options, puffs support.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/arch/mac68k/conf/SMALLRAM

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

Modified files:

Index: src/sys/arch/mac68k/conf/SMALLRAM
diff -u src/sys/arch/mac68k/conf/SMALLRAM:1.36 src/sys/arch/mac68k/conf/SMALLRAM:1.37
--- src/sys/arch/mac68k/conf/SMALLRAM:1.36	Mon Dec  7 08:57:38 2009
+++ src/sys/arch/mac68k/conf/SMALLRAM	Wed Nov 24 13:48:20 2010
@@ -1,12 +1,12 @@
-#	$NetBSD: SMALLRAM,v 1.36 2009/12/07 08:57:38 pooka Exp $
+#	$NetBSD: SMALLRAM,v 1.37 2010/11/24 13:48:20 hauke Exp $
 #
 # This is an example of how to configure a small, efficient kernel for
 # a system with limited RAM. Even so it's capable of doing quite a
 # bit. The hypothetical system used for this example is a Macintosh
 # IIx or Macintosh IIcx with 8 MB of RAM and an 80 MB disk. One or
 # more DP5380- based NuBus Ethernet cards, onboard video and one or
-# more NuBus video cards are configured. Basic SLIP and PPP support is
-# available.
+# more NuBus video cards are configured. Basic SLIP and PPP support
+# as well as packet filtering are available.
 #
 # This configuration is suitable for experimenting with NetBSD as a
 # router with one or more Ethernet cards, and up to two PPP
@@ -38,7 +38,10 @@
 no options 	COMPAT_15
 no options 	COMPAT_16
 no options 	COMPAT_20
+no options 	COMPAT_30
+no options 	COMPAT_40
 no options 	COMPAT_43
+no options 	COMPAT_50
 
 no options 	COMPAT_AOUT_M68K
 no options 	EXEC_AOUT
@@ -53,6 +56,7 @@
 no file-system 	KERNFS
 no file-system 	NULLFS
 no file-system 	OVERLAY
+no file-system	PUFFS
 no file-system 	PROCFS
 no file-system 	UMAPFS
 no file-system 	UNION
@@ -127,4 +131,5 @@
 no pseudo-device	agr
 no pseudo-device	accf_data
 no pseudo-device	accf_http
+no pseudo-device	putter
 no pseudo-device	ksyms



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

2010-11-24 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Wed Nov 24 13:53:34 UTC 2010

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

Log Message:
Catch up on COMPAT* options -- it's been a while...


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/mac68k/conf/INSTALL

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

Modified files:

Index: src/sys/arch/mac68k/conf/INSTALL
diff -u src/sys/arch/mac68k/conf/INSTALL:1.46 src/sys/arch/mac68k/conf/INSTALL:1.47
--- src/sys/arch/mac68k/conf/INSTALL:1.46	Tue Nov 23 11:14:01 2010
+++ src/sys/arch/mac68k/conf/INSTALL	Wed Nov 24 13:53:34 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: INSTALL,v 1.46 2010/11/23 11:14:01 hannken Exp $
+#	$NetBSD: INSTALL,v 1.47 2010/11/24 13:53:34 hauke Exp $
 #
 # INSTALL
 
@@ -48,6 +48,10 @@
 options 	COMPAT_14	# NetBSD 1.4,
 options 	COMPAT_15	# NetBSD 1.5,
 options 	COMPAT_16	# NetBSD 1.6,
+options 	COMPAT_20	# NetBSD 2.0,
+options 	COMPAT_30	# NetBSD 3.0,
+options 	COMPAT_40	# NetBSD 4.0,
+options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_43	# and 4.3BSD
 options		COMPAT_BSDPTY	# /dev/[pt]ty?? ptys.
 



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

2010-11-24 Thread Hauke Fath
Module Name:src
Committed By:   hauke
Date:   Wed Nov 24 13:54:50 UTC 2010

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

Log Message:
Consistency in commenting COMPAT_nn options.


To generate a diff of this commit:
cvs rdiff -u -r1.198 -r1.199 src/sys/arch/mac68k/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/mac68k/conf/GENERIC
diff -u src/sys/arch/mac68k/conf/GENERIC:1.198 src/sys/arch/mac68k/conf/GENERIC:1.199
--- src/sys/arch/mac68k/conf/GENERIC:1.198	Tue Nov 23 11:14:01 2010
+++ src/sys/arch/mac68k/conf/GENERIC	Wed Nov 24 13:54:49 2010
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.198 2010/11/23 11:14:01 hannken Exp $
+# $NetBSD: GENERIC,v 1.199 2010/11/24 13:54:49 hauke Exp $
 #
 # GENERIC machine description file
 # 
@@ -22,7 +22,7 @@
 
 options 	INCLUDE_CONFIG_FILE	# embed config file in kernel binary
 
-#ident 		GENERIC-$Revision: 1.198 $
+#ident 		GENERIC-$Revision: 1.199 $
 
 maxusers	16		# estimated number of users
 
@@ -83,7 +83,7 @@
 options 	COMPAT_16	# NetBSD 1.6,
 options 	COMPAT_20	# NetBSD 2.0,
 options 	COMPAT_30	# NetBSD 3.0,
-options 	COMPAT_40	# NetBSD 4.0 compatibility.
+options 	COMPAT_40	# NetBSD 4.0,
 options 	COMPAT_50	# NetBSD 5.0 compatibility.
 options 	COMPAT_43	# and 4.3BSD
 #options 	TCP_COMPAT_42	# 4.2BSD TCP/IP bug compat. Not recommended.



CVS commit: src/sys/arch/mac68k

2010-06-05 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Sun Jun  6 04:52:17 UTC 2010

Modified Files:
src/sys/arch/mac68k/conf: files.mac68k
src/sys/arch/mac68k/dev: grf_compat.c

Log Message:
defflag GRF_COMPAT.


To generate a diff of this commit:
cvs rdiff -u -r1.122 -r1.123 src/sys/arch/mac68k/conf/files.mac68k
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mac68k/dev/grf_compat.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/mac68k/conf/files.mac68k
diff -u src/sys/arch/mac68k/conf/files.mac68k:1.122 src/sys/arch/mac68k/conf/files.mac68k:1.123
--- src/sys/arch/mac68k/conf/files.mac68k:1.122	Thu May 22 19:49:43 2008
+++ src/sys/arch/mac68k/conf/files.mac68k	Sun Jun  6 04:52:17 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mac68k,v 1.122 2008/05/22 19:49:43 hauke Exp $
+#	$NetBSD: files.mac68k,v 1.123 2010/06/06 04:52:17 mrg Exp $
 
 # mac68k-specific configuration info
 
@@ -6,6 +6,7 @@
 # (note, these are case-sensitive)
 defflag	opt_adb.h		ADB_DEBUG MRG_ADB ALTXBUTTONS
 defflag	opt_mac68k.h		DISABLE_EXT_CACHE ZS_CONSOLE_ABORT
+defflag	opt_grf_compat.h	GRF_COMPAT
 
 defflag	opt_wsdisplay_compat.h	WSDISPLAY_COMPAT_ITEFONT
 

Index: src/sys/arch/mac68k/dev/grf_compat.c
diff -u src/sys/arch/mac68k/dev/grf_compat.c:1.21 src/sys/arch/mac68k/dev/grf_compat.c:1.22
--- src/sys/arch/mac68k/dev/grf_compat.c:1.21	Fri Jan 25 08:47:44 2008
+++ src/sys/arch/mac68k/dev/grf_compat.c	Sun Jun  6 04:52:17 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: grf_compat.c,v 1.21 2008/01/25 08:47:44 dogcow Exp $	*/
+/*	$NetBSD: grf_compat.c,v 1.22 2010/06/06 04:52:17 mrg Exp $	*/
 
 /*
  * Copyright (C) 1999 Scott Reynolds
@@ -31,8 +31,10 @@
  * macfb compatibility with legacy grf devices
  */
 
+#include opt_grf_compat.h
+
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: grf_compat.c,v 1.21 2008/01/25 08:47:44 dogcow Exp $);
+__KERNEL_RCSID(0, $NetBSD: grf_compat.c,v 1.22 2010/06/06 04:52:17 mrg Exp $);
 
 #include sys/param.h
 #include sys/systm.h



CVS commit: src/sys/arch/mac68k/mac68k

2009-12-04 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Dec  4 16:57:18 UTC 2009

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

Log Message:
Use common pmap_bootstrap_finalize() to initialize lwp0 uarea etc.
Tested on LC630.


To generate a diff of this commit:
cvs rdiff -u -r1.156 -r1.157 src/sys/arch/mac68k/mac68k/locore.s
cvs rdiff -u -r1.80 -r1.81 src/sys/arch/mac68k/mac68k/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/mac68k/mac68k/locore.s
diff -u src/sys/arch/mac68k/mac68k/locore.s:1.156 src/sys/arch/mac68k/mac68k/locore.s:1.157
--- src/sys/arch/mac68k/mac68k/locore.s:1.156	Thu Nov 26 00:19:18 2009
+++ src/sys/arch/mac68k/mac68k/locore.s	Fri Dec  4 16:57:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.156 2009/11/26 00:19:18 matt Exp $	*/
+/*	$NetBSD: locore.s,v 1.157 2009/12/04 16:57:18 tsutsui Exp $	*/
 
 /*
  * Copyright (c) 1982, 1990 The Regents of the University of California.
@@ -336,15 +336,13 @@
 /* select the software page size now */
 	lea	_ASM_LABEL(tmpstk),%sp	| temporary stack
 	jbsr	_C_LABEL(uvm_setpagesize)  | select software page size
-
+/* call final pmap setup which initialize lwp0, curlwp, and curpcb */
+	jbsr	_C_LABEL(pmap_bootstrap_finalize)
 /* set kernel stack, user SP, lwp0, and initial pcb */
-	lea	_C_LABEL(lwp0),%a2	| get lwp0.l_addr
-	movl	%a2@(L_ADDR),%a1	|   set kernel stack to end of area 
-	lea	%a1@(USPACE-4),%sp	|   and curlwp so that we don't
-	movl	%a2,_C_LABEL(curlwp)	|   deref NULL in trap()
+	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 %USP
-	movl	%a1,_C_LABEL(curpcb)	| lwp0 is running
 
 /* flush TLB and turn on caches */
 	cmpl	#MMU_68040,_C_LABEL(mmutype) | 68040?

Index: src/sys/arch/mac68k/mac68k/pmap_bootstrap.c
diff -u src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.80 src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.81
--- src/sys/arch/mac68k/mac68k/pmap_bootstrap.c:1.80	Fri Nov 27 03:23:10 2009
+++ src/sys/arch/mac68k/mac68k/pmap_bootstrap.c	Fri Dec  4 16:57:18 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: pmap_bootstrap.c,v 1.80 2009/11/27 03:23:10 rmind Exp $	*/
+/*	$NetBSD: pmap_bootstrap.c,v 1.81 2009/12/04 16:57:18 tsutsui Exp $	*/
 
 /* 
  * Copyright (c) 1991, 1993
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.80 2009/11/27 03:23:10 rmind Exp $);
+__KERNEL_RCSID(0, $NetBSD: pmap_bootstrap.c,v 1.81 2009/12/04 16:57:18 tsutsui Exp $);
 
 #include opt_ddb.h
 #include opt_kgdb.h
@@ -110,7 +110,7 @@
 void
 pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
 {
-	paddr_t kstpa, kptpa, kptmpa, l0upa;
+	paddr_t kstpa, kptpa, kptmpa, lwp0upa;
 	u_int nptpages, kstsize;
 	paddr_t avail_next;
 	int avail_remaining;
@@ -138,7 +138,7 @@
 	 *
 	 *	kptmpa		kernel PT map		1 page
 	 *
-	 *	l0upa		lwp 0 u-area		UPAGES pages
+	 *	lwp0upa		lwp 0 u-area		UPAGES pages
 	 *
 	 */
 	if (mmutype == MMU_68040)
@@ -149,7 +149,7 @@
 	nextpa += kstsize * PAGE_SIZE;
 	kptmpa = nextpa;
 	nextpa += PAGE_SIZE;
-	l0upa = nextpa;
+	lwp0upa = nextpa;
 	nextpa += USPACE;
 	kptpa = nextpa;
 	nptpages = Sysptsize +
@@ -335,7 +335,7 @@
 	}
 	/*
 	 * Validate PTEs for kernel data/bss, dynamic data allocated
-	 * by us so far (nextpa - firstpa bytes), and pages for proc0
+	 * by us so far (nextpa - firstpa bytes), and pages for lwp0
 	 * u-area and page table allocated below (RW).
 	 */
 	epte = (PA2VA(kptpa, u_int *))[m68k_btop(nextpa - firstpa)];
@@ -399,21 +399,22 @@
 	Sysmap = (pt_entry_t *)m68k_ptob((NPTEPG - 1) * NPTEPG);
 
 	/*
-	 * Setup u-area for process 0.
+	 * Setup u-area for lwp 0.
 	 */
 	/*
 	 * Zero the u-area.
 	 * NOTE: `pte' and `epte' aren't PTEs here.
 	 */
-	pte = PA2VA(l0upa, u_int *);
-	epte = (u_int *)(PA2VA(l0upa, u_int) + USPACE);
+	pte = PA2VA(lwp0upa, u_int *);
+	epte = (u_int *)(PA2VA(lwp0upa, u_int) + USPACE);
 	while (pte  epte)
 		*pte++ = 0;
 
 	/*
-	 * Store the u-area address
+	 * Remember the u-area address so it can be loaded in the lwp0
+	 * via uvm_lwp_setuarea() later in pmap_bootstrap_finalize().
 	 */
-	uvm_lwp_setuarea(lwp0, PA2VA(l0upa, vaddr_t));
+	lwp0uarea = PA2VA(lwp0upa, vaddr_t);
 
 	/*
 	 * VM data structures are now initialized, set up data for