CVS commit: src/sys/arch/mvme68k

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:12:30 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: Makefile.mvme68k files.mvme68k
src/sys/arch/mvme68k/dev: mainbus.c zs.c
src/sys/arch/mvme68k/include: cpu.h
src/sys/arch/mvme68k/mvme68k: autoconf.c locore.s machdep.c

Log Message:
Don't put the MVME1xx model defines into IDENT, make them defflag options and
put them in opt_mvmeconf.h.  Make these options depend on the appropriate
M680x0 option (MVME147 -> M68030, MVME16[27] -> M68040, MVME17[27] -> M68060)
so that the CPU option appears correctly in opt_m68k_arch.h.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mvme68k/conf/Makefile.mvme68k \
src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mvme68k/dev/mainbus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mvme68k/dev/zs.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mvme68k/mvme68k/autoconf.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/mvme68k/mvme68k/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/mvme68k/conf/Makefile.mvme68k
diff -u src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.68 src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.69
--- src/sys/arch/mvme68k/conf/Makefile.mvme68k:1.68	Sat Sep 22 12:24:02 2018
+++ src/sys/arch/mvme68k/conf/Makefile.mvme68k	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.mvme68k,v 1.68 2018/09/22 12:24:02 rin Exp $
+#	$NetBSD: Makefile.mvme68k,v 1.69 2024/01/18 05:12:29 thorpej Exp $
 
 # Makefile for NetBSD
 #
@@ -32,19 +32,19 @@ GENASSYM_CONF=	${MVME68K}/mvme68k/genass
 ## (2) compile settings
 ##
 CPPFLAGS+=	-Dmvme68k
-.if empty(IDENT:M-DMVME172) && empty(IDENT:M-DMVME177)
-.if empty(IDENT:M-DMVME147)
+.if empty(KERNEL_OPT_M68060)
+.if empty(KERNEL_OPT_M68030)
 CMACHFLAGS=	-m68040
 .else
 CMACHFLAGS=	-m68030
 .endif
-.else
-.if empty(IDENT:M-DMVME147) && empty(IDENT:M-DMVME162) && empty(IDENT:M-DMVME167)
+.else		# M68060
+.if empty(KERNEL_OPT_M68030) && empty(KERNEL_OPT_M68040)
 CMACHFLAGS=	-m68060 -Wa,-march=68030 -Wa,-m68030 -Wa,-mcpu=68030 -Wa,-m68851
 .else
 CMACHFLAGS=	-m68020-60 -Wa,-m68030 -Wa,-mcpu=68030 -Wa,-m68851
 .endif
-.endif
+.endif		# M68060
 CFLAGS+=	${CMACHFLAGS} -msoft-float
 AFLAGS+=	-x assembler-with-cpp
 
Index: src/sys/arch/mvme68k/conf/files.mvme68k
diff -u src/sys/arch/mvme68k/conf/files.mvme68k:1.68 src/sys/arch/mvme68k/conf/files.mvme68k:1.69
--- src/sys/arch/mvme68k/conf/files.mvme68k:1.68	Tue Jan 16 01:26:34 2024
+++ src/sys/arch/mvme68k/conf/files.mvme68k	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mvme68k,v 1.68 2024/01/16 01:26:34 thorpej Exp $
+#	$NetBSD: files.mvme68k,v 1.69 2024/01/18 05:12:29 thorpej Exp $
 
 # config file for mvme68k
 
@@ -8,6 +8,13 @@ defflagPANICBUTTON	# panic on ABORT 
 # maxpartitions must be first item in files.${ARCH}.newconf
 maxpartitions 8
 
+# System configuration options.
+defflag	opt_mvmeconf.h	MVME147: M68030
+defflag	opt_mvmeconf.h	MVME162: M68040
+defflag	opt_mvmeconf.h	MVME167: M68040
+defflag	opt_mvmeconf.h	MVME172: M68060
+defflag	opt_mvmeconf.h	MVME177: M68060
+
 device mainbus { }
 attach mainbus at root
 file arch/mvme68k/dev/mainbus.c		mainbus

Index: src/sys/arch/mvme68k/dev/mainbus.c
diff -u src/sys/arch/mvme68k/dev/mainbus.c:1.23 src/sys/arch/mvme68k/dev/mainbus.c:1.24
--- src/sys/arch/mvme68k/dev/mainbus.c:1.23	Sat Aug  7 16:19:00 2021
+++ src/sys/arch/mvme68k/dev/mainbus.c	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: mainbus.c,v 1.23 2021/08/07 16:19:00 thorpej Exp $	*/
+/*	$NetBSD: mainbus.c,v 1.24 2024/01/18 05:12:29 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -34,8 +34,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.23 2021/08/07 16:19:00 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.24 2024/01/18 05:12:29 thorpej Exp $");
 
+#include "opt_mvmeconf.h"
 #include "vmetwo.h"
 
 #include 

Index: src/sys/arch/mvme68k/dev/zs.c
diff -u src/sys/arch/mvme68k/dev/zs.c:1.45 src/sys/arch/mvme68k/dev/zs.c:1.46
--- src/sys/arch/mvme68k/dev/zs.c:1.45	Sat Sep 11 20:28:04 2021
+++ src/sys/arch/mvme68k/dev/zs.c	Thu Jan 18 05:12:29 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: zs.c,v 1.45 2021/09/11 20:28:04 andvar Exp $	*/
+/*	$NetBSD: zs.c,v 1.46 2024/01/18 05:12:29 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -39,7 +39,9 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.45 2021/09/11 20:28:04 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: zs.c,v 1.46 2024/01/18 05:12:29 thorpej Exp $");
+
+#include "opt_mvmeconf.h"
 
 #include 
 #include 

Index: src/sys/arch/mvme68k/include/cpu.h
diff -u src/sys/arch/mvme68k/include/cpu.h:1.53 src/sys/arch/mvme68k/include/cpu.h:1.54
---

CVS commit: src/sys/arch/mvme68k

2024-01-17 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Thu Jan 18 05:12:30 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: Makefile.mvme68k files.mvme68k
src/sys/arch/mvme68k/dev: mainbus.c zs.c
src/sys/arch/mvme68k/include: cpu.h
src/sys/arch/mvme68k/mvme68k: autoconf.c locore.s machdep.c

Log Message:
Don't put the MVME1xx model defines into IDENT, make them defflag options and
put them in opt_mvmeconf.h.  Make these options depend on the appropriate
M680x0 option (MVME147 -> M68030, MVME16[27] -> M68040, MVME17[27] -> M68060)
so that the CPU option appears correctly in opt_m68k_arch.h.


To generate a diff of this commit:
cvs rdiff -u -r1.68 -r1.69 src/sys/arch/mvme68k/conf/Makefile.mvme68k \
src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.23 -r1.24 src/sys/arch/mvme68k/dev/mainbus.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/mvme68k/dev/zs.c
cvs rdiff -u -r1.53 -r1.54 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.47 -r1.48 src/sys/arch/mvme68k/mvme68k/autoconf.c
cvs rdiff -u -r1.130 -r1.131 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.163 -r1.164 src/sys/arch/mvme68k/mvme68k/machdep.c

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



CVS commit: src/sys/arch/mvme68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:26:34 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/include: cpu.h intr.h types.h vectors.h
src/sys/arch/mvme68k/mvme68k: genassym.cf isr.h locore.s machdep.c
trap.c
Removed Files:
src/sys/arch/mvme68k/mvme68k: isr.c

Log Message:
Switch mvme68k over to the common interrupt dispatch code and G/C
__HAVE_LEGACY_INTRCNT.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mvme68k/include/intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mvme68k/include/types.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mvme68k/include/vectors.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mvme68k/mvme68k/genassym.cf
cvs rdiff -u -r1.36 -r0 src/sys/arch/mvme68k/mvme68k/isr.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mvme68k/mvme68k/isr.h
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/mvme68k/mvme68k/trap.c

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



CVS commit: src/sys/arch/mvme68k

2024-01-15 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Tue Jan 16 01:26:34 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/include: cpu.h intr.h types.h vectors.h
src/sys/arch/mvme68k/mvme68k: genassym.cf isr.h locore.s machdep.c
trap.c
Removed Files:
src/sys/arch/mvme68k/mvme68k: isr.c

Log Message:
Switch mvme68k over to the common interrupt dispatch code and G/C
__HAVE_LEGACY_INTRCNT.


To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/mvme68k/include/cpu.h
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/mvme68k/include/intr.h
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/mvme68k/include/types.h
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/mvme68k/include/vectors.h
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/mvme68k/mvme68k/genassym.cf
cvs rdiff -u -r1.36 -r0 src/sys/arch/mvme68k/mvme68k/isr.c
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/mvme68k/mvme68k/isr.h
cvs rdiff -u -r1.126 -r1.127 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.162 -r1.163 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.114 -r1.115 src/sys/arch/mvme68k/mvme68k/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/mvme68k/conf/files.mvme68k
diff -u src/sys/arch/mvme68k/conf/files.mvme68k:1.67 src/sys/arch/mvme68k/conf/files.mvme68k:1.68
--- src/sys/arch/mvme68k/conf/files.mvme68k:1.67	Sat Jan 13 20:18:46 2024
+++ src/sys/arch/mvme68k/conf/files.mvme68k	Tue Jan 16 01:26:34 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mvme68k,v 1.67 2024/01/13 20:18:46 thorpej Exp $
+#	$NetBSD: files.mvme68k,v 1.68 2024/01/16 01:26:34 thorpej Exp $
 
 # config file for mvme68k
 
@@ -91,13 +91,14 @@ file arch/mvme68k/mvme68k/bus_space.c
 file arch/mvme68k/mvme68k/clock.c
 file arch/mvme68k/mvme68k/conf.c
 file arch/mvme68k/mvme68k/disksubr.c
-file arch/mvme68k/mvme68k/isr.c
 file arch/mvme68k/mvme68k/machdep.c
 file arch/mvme68k/mvme68k/pmap_bootstrap.c	compile-with "${NOPROF_C}"
 file arch/mvme68k/mvme68k/trap.c
 file arch/m68k/m68k/cacheops.c
 file arch/m68k/m68k/db_memrw.c			ddb | kgdb
 file arch/m68k/m68k/kgdb_machdep.c		kgdb
+file arch/m68k/m68k/m68k_intr.c
+file arch/m68k/m68k/m68k_intr_stubs.s
 file arch/m68k/m68k/m68k_trap.c
 file arch/m68k/m68k/mmu_subr.s
 file arch/m68k/m68k/pmap_motorola.c

Index: src/sys/arch/mvme68k/include/cpu.h
diff -u src/sys/arch/mvme68k/include/cpu.h:1.52 src/sys/arch/mvme68k/include/cpu.h:1.53
--- src/sys/arch/mvme68k/include/cpu.h:1.52	Tue Jan  9 04:16:26 2024
+++ src/sys/arch/mvme68k/include/cpu.h	Tue Jan 16 01:26:34 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.52 2024/01/09 04:16:26 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.53 2024/01/16 01:26:34 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -60,17 +60,17 @@
 /*
  * Arguments to hardclock and gatherstats encapsulate the previous
  * machine state in an opaque clockframe.  On the mvme68k, we use
- * what the hardware pushes on an interrupt (frame format 0).
+ * what the locore.s glue puts on the stack before calling C-code.
  */
 struct clockframe {
-	u_short	sr;		/* sr at time of interrupt */
-	u_long	pc;		/* pc at time of interrupt */
-	u_short	fmt:4,
-		vec:12;		/* vector offset (4-word frame) */
+	u_int	cf_regs[4];	/* d0,d1,a0,a1 */
+	u_short	cf_sr;		/* sr at time of interrupt */
+	u_long	cf_pc;		/* pc at time of interrupt */
+	u_short	cf_vo;		/* vector offset (4-word frame) */
 } __attribute__((packed));
 
-#define	CLKF_USERMODE(framep)	(((framep)->sr & PSL_S) == 0)
-#define	CLKF_PC(framep)		((framep)->pc)
+#define	CLKF_USERMODE(framep)	(((framep)->cf_sr & PSL_S) == 0)
+#define	CLKF_PC(framep)		((framep)->cf_pc)
 
 /*
  * The clock interrupt handler can determine if it's a nested
@@ -78,8 +78,7 @@ struct clockframe {
  * (Remember, the clock interrupt handler itself will cause the
  * depth counter to be incremented).
  */
-extern volatile unsigned int interrupt_depth;
-#define	CLKF_INTR(framep)	(interrupt_depth > 1)
+#define	CLKF_INTR(framep)	(idepth > 1)
 
 
 /*

Index: src/sys/arch/mvme68k/include/intr.h
diff -u src/sys/arch/mvme68k/include/intr.h:1.22 src/sys/arch/mvme68k/include/intr.h:1.23
--- src/sys/arch/mvme68k/include/intr.h:1.22	Tue Jul 11 11:07:54 2023
+++ src/sys/arch/mvme68k/include/intr.h	Tue Jan 16 01:26:34 2024
@@ -1,11 +1,11 @@
-/*	$NetBSD: intr.h,v 1.22 2023/07/11 11:07:54 riastradh Exp $	*/
+/*	$NetBSD: intr.h,v 1.23 2024/01/16 01:26:34 thorpej Exp $	*/
 
 /*-
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
+ * Copyright (c) 2024 The NetBSD Foundation, Inc.
  * All rights reserved.
  *
  * This code is derived from software contributed to The NetBSD Foundation
- * by Jason R. Thorpe and Steve C. Woodford.
+ * by Jason R. Thorpe.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the follow

CVS commit: src/sys/arch/mvme68k

2024-01-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 13 20:18:47 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/mvme68k: locore.s machdep.c
Added Files:
src/sys/arch/mvme68k/include: vectors.h
Removed Files:
src/sys/arch/mvme68k/mvme68k: vectors.s

Log Message:
Switch mvme68k to the common m68k vector table.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r0 -r1.1 src/sys/arch/mvme68k/include/vectors.h
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.11 -r0 src/sys/arch/mvme68k/mvme68k/vectors.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/mvme68k/conf/files.mvme68k
diff -u src/sys/arch/mvme68k/conf/files.mvme68k:1.66 src/sys/arch/mvme68k/conf/files.mvme68k:1.67
--- src/sys/arch/mvme68k/conf/files.mvme68k:1.66	Tue Jan  9 04:16:25 2024
+++ src/sys/arch/mvme68k/conf/files.mvme68k	Sat Jan 13 20:18:46 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mvme68k,v 1.66 2024/01/09 04:16:25 thorpej Exp $
+#	$NetBSD: files.mvme68k,v 1.67 2024/01/13 20:18:46 thorpej Exp $
 
 # config file for mvme68k
 
@@ -103,6 +103,7 @@ file arch/m68k/m68k/mmu_subr.s
 file arch/m68k/m68k/pmap_motorola.c
 file arch/m68k/m68k/procfs_machdep.c		procfs
 file arch/m68k/m68k/sys_machdep.c
+file arch/m68k/m68k/vectors.c
 file arch/m68k/m68k/vm_machdep.c
 file dev/cons.c
 file dev/cninit.c

Index: src/sys/arch/mvme68k/mvme68k/locore.s
diff -u src/sys/arch/mvme68k/mvme68k/locore.s:1.125 src/sys/arch/mvme68k/mvme68k/locore.s:1.126
--- src/sys/arch/mvme68k/mvme68k/locore.s:1.125	Fri Jan 12 23:36:29 2024
+++ src/sys/arch/mvme68k/mvme68k/locore.s	Sat Jan 13 20:18:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.125 2024/01/12 23:36:29 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.126 2024/01/13 20:18:47 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -62,12 +62,6 @@
 	.space	PAGE_SIZE
 ASLOCAL(tmpstk)
 
-ASLOCAL(bug_vbr)
-	.long	0
-
-#include 
-
-
 /*
  * Macro to relocate a symbol, used before MMU is enabled.
  */
@@ -201,8 +195,6 @@ ASLOCAL(Lbrdid2mach)
 	.word		CPU_68030
 	.word		MMU_68030
 	.word		FPU_68882
-	.long		_C_LABEL(busaddrerr2030)
-	.long		_C_LABEL(busaddrerr2030)
 	.long		Linit147
 #endif
 #ifdef MVME162
@@ -210,8 +202,6 @@ ASLOCAL(Lbrdid2mach)
 	.word		CPU_68040
 	.word		MMU_68040
 	.word		FPU_68040
-	.long		_C_LABEL(buserr40)
-	.long		_C_LABEL(addrerr4060)
 	.long		Linit1x2
 #endif
 #ifdef MVME167
@@ -219,8 +209,6 @@ ASLOCAL(Lbrdid2mach)
 	.word		CPU_68040
 	.word		MMU_68040
 	.word		FPU_68040
-	.long		_C_LABEL(buserr40)
-	.long		_C_LABEL(addrerr4060)
 	.long		Linit1x7
 #endif
 #ifdef MVME172
@@ -228,8 +216,6 @@ ASLOCAL(Lbrdid2mach)
 	.word		CPU_68060
 	.word		MMU_68040
 	.word		FPU_68060
-	.long		_C_LABEL(buserr60)
-	.long		_C_LABEL(addrerr4060)
 	.long		Linit1x2
 #endif
 #ifdef MVME177
@@ -237,8 +223,6 @@ ASLOCAL(Lbrdid2mach)
 	.word		CPU_68060
 	.word		MMU_68040
 	.word		FPU_68060
-	.long		_C_LABEL(buserr60)
-	.long		_C_LABEL(addrerr4060)
 	.long		Linit1x7
 #endif
 	.word	0
@@ -254,19 +238,17 @@ Lgotmatch:
 	extl	%d1
 	RELOC(cputype,%a1)
 	movel	%d1,%a1@
+
 	movew	%a0@+,%d1		| Copy the MMU type
 	extl	%d1
 	RELOC(mmutype,%a1)
 	movel	%d1,%a1@
+
 	movew	%a0@+,%d1		| Copy the FPU type
 	extl	%d1
 	RELOC(fputype,%a1)
 	movel	%d1,%a1@
-	movel	%a0@+,%a2		| Fetch the bus error vector
-	RELOC(vectab,%a1)
-	movl	%a2,%a1@(8)
-	movel	%a0@+,%a2		| Fetch the address error vector
-	movl	%a2,%a1@(12)
+
 	movel	%a0@,%a0		| Finally, the board-specific init code
 	jmp	%a0@
 
@@ -622,11 +604,8 @@ Lmotommu2:
  */
 Lenab1:
 /* Point the CPU VBR at our vector table */
-	movc	%vbr,%d0		| Preserve Bug's VBR address
-	movl	%d0,_ASM_LABEL(bug_vbr)
-	movl	#_C_LABEL(vectab),%d0	| get our VBR address
-	movc	%d0,%vbr
-	lea	_ASM_LABEL(tmpstk),%sp	| temporary stack
+	lea	_ASM_LABEL(tmpstk),%sp	| re-load temporary stack
+	jbsr	_C_LABEL(vec_init)	| initialize vector table
 /* call final pmap setup */
 	jbsr	_C_LABEL(pmap_bootstrap_finalize)
 /* set kernel stack, user SP */
@@ -1121,7 +1100,7 @@ ENTRY_NOPROFILE(doboot)
 	movw	#PSL_HIGHIPL,%sr
 	movl	_C_LABEL(boothowto),%d1	| load howto
 	movl	%sp@(4),%d2		| arg
-	movl	_ASM_LABEL(bug_vbr),%d3	| Fetch Bug's original VBR value
+	movl	_C_LABEL(saved_vbr),%d3	| Fetch Bug's original VBR value
 	movl	_C_LABEL(machineid),%d4	| What type of board is this?
 	movl	#CACHE_OFF,%d0
 #if defined(M68040) || defined(M68060)

Index: src/sys/arch/mvme68k/mvme68k/machdep.c
diff -u src/sys/arch/mvme68k/mvme68k/machdep.c:1.161 src/sys/arch/mvme68k/mvme68k/machdep.c:1.162
--- src/sys/arch/mvme68k/mvme68k/machdep.c:1.161	Wed Dec 20 00:40:44 2023
+++ src/sys/arch/mvme68k/mvme68k/machdep.c	Sat Jan 13 20:18:47 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.161 2023/12

CVS commit: src/sys/arch/mvme68k

2024-01-13 Thread Jason R Thorpe
Module Name:src
Committed By:   thorpej
Date:   Sat Jan 13 20:18:47 UTC 2024

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/mvme68k: locore.s machdep.c
Added Files:
src/sys/arch/mvme68k/include: vectors.h
Removed Files:
src/sys/arch/mvme68k/mvme68k: vectors.s

Log Message:
Switch mvme68k to the common m68k vector table.


To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r0 -r1.1 src/sys/arch/mvme68k/include/vectors.h
cvs rdiff -u -r1.125 -r1.126 src/sys/arch/mvme68k/mvme68k/locore.s
cvs rdiff -u -r1.161 -r1.162 src/sys/arch/mvme68k/mvme68k/machdep.c
cvs rdiff -u -r1.11 -r0 src/sys/arch/mvme68k/mvme68k/vectors.s

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



CVS commit: src/sys/arch/mvme68k

2023-09-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 30 21:00:43 UTC 2023

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/mvme68k: trap.c

Log Message:
Improve kgdb build for mvme68k:
* include sys/kgdb.h in mvme68k/trap.c for missing definitions.
* cast second kgdb_trap argument to (db_regs_t *).
* build m68k/kgdb_machdep.c in kgdb enable build for kgdb_trap() implementation.

KGDB build still fails, apparently due to missing zs_kgdb.c implementation.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/mvme68k/mvme68k/trap.c

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



CVS commit: src/sys/arch/mvme68k

2023-09-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 30 21:00:43 UTC 2023

Modified Files:
src/sys/arch/mvme68k/conf: files.mvme68k
src/sys/arch/mvme68k/mvme68k: trap.c

Log Message:
Improve kgdb build for mvme68k:
* include sys/kgdb.h in mvme68k/trap.c for missing definitions.
* cast second kgdb_trap argument to (db_regs_t *).
* build m68k/kgdb_machdep.c in kgdb enable build for kgdb_trap() implementation.

KGDB build still fails, apparently due to missing zs_kgdb.c implementation.


To generate a diff of this commit:
cvs rdiff -u -r1.64 -r1.65 src/sys/arch/mvme68k/conf/files.mvme68k
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/mvme68k/mvme68k/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/mvme68k/conf/files.mvme68k
diff -u src/sys/arch/mvme68k/conf/files.mvme68k:1.64 src/sys/arch/mvme68k/conf/files.mvme68k:1.65
--- src/sys/arch/mvme68k/conf/files.mvme68k:1.64	Mon Feb 18 01:12:23 2019
+++ src/sys/arch/mvme68k/conf/files.mvme68k	Sat Sep 30 21:00:43 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: files.mvme68k,v 1.64 2019/02/18 01:12:23 thorpej Exp $
+#	$NetBSD: files.mvme68k,v 1.65 2023/09/30 21:00:43 andvar Exp $
 
 # config file for mvme68k
 
@@ -97,6 +97,7 @@ file arch/mvme68k/mvme68k/pmap_bootstrap
 file arch/mvme68k/mvme68k/trap.c
 file arch/m68k/m68k/cacheops.c
 file arch/m68k/m68k/db_memrw.c			ddb | kgdb
+file arch/m68k/m68k/kgdb_machdep.c		kgdb
 file arch/m68k/m68k/m68k_trap.c
 file arch/m68k/m68k/pmap_motorola.c
 file arch/m68k/m68k/procfs_machdep.c		procfs

Index: src/sys/arch/mvme68k/mvme68k/trap.c
diff -u src/sys/arch/mvme68k/mvme68k/trap.c:1.112 src/sys/arch/mvme68k/mvme68k/trap.c:1.113
--- src/sys/arch/mvme68k/mvme68k/trap.c:1.112	Sat Sep 25 19:16:31 2021
+++ src/sys/arch/mvme68k/mvme68k/trap.c	Sat Sep 30 21:00:43 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: trap.c,v 1.112 2021/09/25 19:16:31 tsutsui Exp $	*/
+/*	$NetBSD: trap.c,v 1.113 2023/09/30 21:00:43 andvar Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.112 2021/09/25 19:16:31 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.113 2023/09/30 21:00:43 andvar Exp $");
 
 #include "opt_ddb.h"
 #include "opt_execfmt.h"
@@ -57,6 +57,7 @@ __KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.1
 #include 
 #include 
 #include 
+#include 
 
 #ifdef DEBUG
 #include 
@@ -313,7 +314,7 @@ trap(struct frame *fp, int type, unsigne
 		(type & T_USER) ? "user" : "kernel", fp->f_pc);
 #ifdef KGDB
 		/* If connected, step or cont returns 1 */
-		if (kgdb_trap(type, fp))
+		if (kgdb_trap(type, (db_regs_t *)fp))
 			goto kgdb_cont;
 #endif
 #ifdef DDB



CVS commit: src/sys/arch/mvme68k/docs

2023-09-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 30 20:15:55 UTC 2023

Modified Files:
src/sys/arch/mvme68k/docs: VMEbus-RAM

Log Message:
s/resonably/reasonably/.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mvme68k/docs/VMEbus-RAM

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/mvme68k/docs/VMEbus-RAM
diff -u src/sys/arch/mvme68k/docs/VMEbus-RAM:1.4 src/sys/arch/mvme68k/docs/VMEbus-RAM:1.5
--- src/sys/arch/mvme68k/docs/VMEbus-RAM:1.4	Sun Dec 11 12:18:17 2005
+++ src/sys/arch/mvme68k/docs/VMEbus-RAM	Sat Sep 30 20:15:54 2023
@@ -1,4 +1,4 @@
-	$NetBSD: VMEbus-RAM,v 1.4 2005/12/11 12:18:17 christos Exp $
+	$NetBSD: VMEbus-RAM,v 1.5 2023/09/30 20:15:54 andvar Exp $
 
 NetBSD/mvme68k: VMEbus RAM card configuration
 ~
@@ -31,7 +31,7 @@ then you'll have to locate it elsewhere.
 responds to A24D16 only, in which case the CPU-relative address you need
 to specify below will be in the 16MB region starting at 0x.
 
-For A32D32, choose an address which is resonably close to the end of the
+For A32D32, choose an address which is reasonably close to the end of the
 MVME board's RAM. That is, if you have 32MB of onboard RAM, set the
 VMEbus RAM board to appear at A32:0200.
 



CVS commit: src/sys/arch/mvme68k/docs

2023-09-30 Thread Andrius Varanavicius
Module Name:src
Committed By:   andvar
Date:   Sat Sep 30 20:15:55 UTC 2023

Modified Files:
src/sys/arch/mvme68k/docs: VMEbus-RAM

Log Message:
s/resonably/reasonably/.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/arch/mvme68k/docs/VMEbus-RAM

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



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

2023-07-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 11 11:07:54 UTC 2023

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

Log Message:
mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mvme68k/include/intr.h

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

Modified files:

Index: src/sys/arch/mvme68k/include/intr.h
diff -u src/sys/arch/mvme68k/include/intr.h:1.21 src/sys/arch/mvme68k/include/intr.h:1.22
--- src/sys/arch/mvme68k/include/intr.h:1.21	Thu Apr 19 21:50:07 2018
+++ src/sys/arch/mvme68k/include/intr.h	Tue Jul 11 11:07:54 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.21 2018/04/19 21:50:07 christos Exp $	*/
+/*	$NetBSD: intr.h,v 1.22 2023/07/11 11:07:54 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -44,6 +44,12 @@
 #define	IPL_HIGH	7
 #define	NIPL		8
 
+#if defined(_KERNEL) || defined(_KMEMUSER)
+typedef struct {
+	uint16_t _psl;
+} ipl_cookie_t;
+#endif
+
 #ifdef _KERNEL
 #define spl0()			_spl0()
 #define splsoftclock()		splraise1()
@@ -59,9 +65,6 @@
 extern const uint16_t ipl2psl_table[NIPL];
 
 typedef int ipl_t;
-typedef struct {
-	uint16_t _psl;
-} ipl_cookie_t;
 
 static __inline ipl_cookie_t
 makeiplcookie(ipl_t ipl)



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

2023-07-11 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Tue Jul 11 11:07:54 UTC 2023

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

Log Message:
mvme68k/intr.h: Expose ipl_cookie_t to _KMEMUSER for crash(8).


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/mvme68k/include/intr.h

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



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

2023-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 27 20:03:03 UTC 2023

Modified Files:
src/sys/arch/mvme68k/include: bus_space.h

Log Message:
mvme68k: Specify proper constraints for bus_space_read region and multi ops.

Sync with next68k.


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

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

Modified files:

Index: src/sys/arch/mvme68k/include/bus_space.h
diff -u src/sys/arch/mvme68k/include/bus_space.h:1.17 src/sys/arch/mvme68k/include/bus_space.h:1.18
--- src/sys/arch/mvme68k/include/bus_space.h:1.17	Sat Jan 23 19:38:08 2021
+++ src/sys/arch/mvme68k/include/bus_space.h	Fri Jan 27 20:03:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: bus_space.h,v 1.17 2021/01/23 19:38:08 christos Exp $ */
+/*	$NetBSD: bus_space.h,v 1.18 2023/01/27 20:03:02 tsutsui Exp $ */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -226,7 +226,7 @@ struct mvme68k_bus_space_tag {
 		jne	1b"	:	\
 :	\
 		"r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		"a0","a1","d0");	\
+		"a0","a1","d0","memory");\
 } while (0);
 
 #define	bus_space_read_multi_2(t, h, o, a, c) do {			\
@@ -240,7 +240,7 @@ struct mvme68k_bus_space_tag {
 		jne	1b"	:	\
 :	\
 		"r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		"a0","a1","d0");	\
+		"a0","a1","d0","memory");\
 } while (0);
 
 #define	bus_space_read_multi_4(t, h, o, a, c) do {			\
@@ -254,7 +254,7 @@ struct mvme68k_bus_space_tag {
 		jne	1b"	:	\
 :	\
 		"r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		"a0","a1","d0");	\
+		"a0","a1","d0","memory");\
 } while (0);
 
 /*
@@ -278,7 +278,7 @@ struct mvme68k_bus_space_tag {
 		jne	1b"	:	\
 :	\
 		"r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		"a0","a1","d0");	\
+		"a0","a1","d0","memory");\
 } while (0);
 
 #define	bus_space_read_region_2(t, h, o, a, c) do {			\
@@ -292,7 +292,7 @@ struct mvme68k_bus_space_tag {
 		jne	1b"	:	\
 :	\
 		"r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		"a0","a1","d0");	\
+		"a0","a1","d0","memory");\
 } while (0);
 
 #define	bus_space_read_region_4(t, h, o, a, c) do {			\
@@ -306,7 +306,7 @@ struct mvme68k_bus_space_tag {
 		jne	1b"	:	\
 :	\
 		"r" ((h) + (o)), "g" (a), "g" (c)		:	\
-		"a0","a1","d0");	\
+		"a0","a1","d0","memory");\
 } while (0);
 
 /*



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

2023-01-27 Thread Izumi Tsutsui
Module Name:src
Committed By:   tsutsui
Date:   Fri Jan 27 20:03:03 UTC 2023

Modified Files:
src/sys/arch/mvme68k/include: bus_space.h

Log Message:
mvme68k: Specify proper constraints for bus_space_read region and multi ops.

Sync with next68k.


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

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