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 <mvme68k/mvme68k/vectors.s>
-
-
 /*
  * 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/20 00:40:44 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.162 2024/01/13 20:18:47 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.161 2023/12/20 00:40:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.162 2024/01/13 20:18:47 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_m060sp.h"
@@ -958,41 +958,7 @@ dumpsys(void)
 void
 initcpu(void)
 {
-#if defined(M68060)
-	extern void *vectab[256];
-#if defined(M060SP)
-	extern uint8_t I_CALL_TOP[];
-	extern uint8_t FP_CALL_TOP[];
-#else
-	extern uint8_t illinst;
-#endif
-	extern uint8_t fpfault;
-#endif
-
-#if defined(M68060)
-	if (cputype == CPU_68060) {
-#if defined(M060SP)
-		/* integer support */
-		vectab[61] = &I_CALL_TOP[128 + 0x00];
-
-		/* floating point support */
-		vectab[11] = &FP_CALL_TOP[128 + 0x30];
-		vectab[55] = &FP_CALL_TOP[128 + 0x38];
-		vectab[60] = &FP_CALL_TOP[128 + 0x40];
-
-		vectab[54] = &FP_CALL_TOP[128 + 0x00];
-		vectab[52] = &FP_CALL_TOP[128 + 0x08];
-		vectab[53] = &FP_CALL_TOP[128 + 0x10];
-		vectab[51] = &FP_CALL_TOP[128 + 0x18];
-		vectab[50] = &FP_CALL_TOP[128 + 0x20];
-		vectab[49] = &FP_CALL_TOP[128 + 0x28];
-#else
-		vectab[61] = &illinst;
-#endif
-		vectab[48] = &fpfault;
-	}
-	DCIS();
-#endif
+	/* Nothing to do. */
 }
 
 void

Added files:

Index: src/sys/arch/mvme68k/include/vectors.h
diff -u /dev/null src/sys/arch/mvme68k/include/vectors.h:1.1
--- /dev/null	Sat Jan 13 20:18:47 2024
+++ src/sys/arch/mvme68k/include/vectors.h	Sat Jan 13 20:18:46 2024
@@ -0,0 +1,50 @@
+/*	$NetBSD: vectors.h,v 1.1 2024/01/13 20:18:46 thorpej Exp $	*/
+
+/*-
+ * 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.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef _MVME68K_VECTORS_H_
+#define	_MVME68K_VECTORS_H_
+
+#ifdef _KERNEL
+
+#include <m68k/vectors.h>
+
+#define	MACHINE_AV0_HANDLER	intrhand_autovec
+#define	MACHINE_AV1_HANDLER	intrhand_autovec
+#define	MACHINE_AV2_HANDLER	intrhand_autovec
+#define	MACHINE_AV3_HANDLER	intrhand_autovec
+#define	MACHINE_AV4_HANDLER	intrhand_autovec
+#define	MACHINE_AV5_HANDLER	intrhand_autovec
+#define	MACHINE_AV6_HANDLER	intrhand_autovec
+#define	MACHINE_AV7_HANDLER	intrhand_autovec
+
+#endif /* _KERNEL */
+
+#endif /* _MVME68K_VECTORS_H_ */

Reply via email to