Module Name: src
Committed By: thorpej
Date: Sat Jan 13 17:10:58 UTC 2024
Modified Files:
src/sys/arch/virt68k/conf: files.virt68k
src/sys/arch/virt68k/virt68k: locore.s machdep.c
Added Files:
src/sys/arch/virt68k/include: vectors.h
Removed Files:
src/sys/arch/virt68k/virt68k: vectors.s
Log Message:
Switch to common m68k vector table.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/arch/virt68k/conf/files.virt68k
cvs rdiff -u -r0 -r1.1 src/sys/arch/virt68k/include/vectors.h
cvs rdiff -u -r1.8 -r1.9 src/sys/arch/virt68k/virt68k/locore.s
cvs rdiff -u -r1.7 -r1.8 src/sys/arch/virt68k/virt68k/machdep.c
cvs rdiff -u -r1.2 -r0 src/sys/arch/virt68k/virt68k/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/virt68k/conf/files.virt68k
diff -u src/sys/arch/virt68k/conf/files.virt68k:1.3 src/sys/arch/virt68k/conf/files.virt68k:1.4
--- src/sys/arch/virt68k/conf/files.virt68k:1.3 Tue Jan 9 04:16:27 2024
+++ src/sys/arch/virt68k/conf/files.virt68k Sat Jan 13 17:10:58 2024
@@ -1,4 +1,4 @@
-# $NetBSD: files.virt68k,v 1.3 2024/01/09 04:16:27 thorpej Exp $
+# $NetBSD: files.virt68k,v 1.4 2024/01/13 17:10:58 thorpej Exp $
# config file for virt68k
@@ -51,6 +51,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
Index: src/sys/arch/virt68k/virt68k/locore.s
diff -u src/sys/arch/virt68k/virt68k/locore.s:1.8 src/sys/arch/virt68k/virt68k/locore.s:1.9
--- src/sys/arch/virt68k/virt68k/locore.s:1.8 Fri Jan 12 23:36:30 2024
+++ src/sys/arch/virt68k/virt68k/locore.s Sat Jan 13 17:10:58 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: locore.s,v 1.8 2024/01/12 23:36:30 thorpej Exp $ */
+/* $NetBSD: locore.s,v 1.9 2024/01/13 17:10:58 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -72,8 +72,6 @@
.space PAGE_SIZE
ASLOCAL(tmpstk)
-#include <virt68k/virt68k/vectors.s>
-
/*
* Macro to relocate a symbol, used before MMU is enabled.
*/
@@ -128,36 +126,6 @@ ASENTRY_NOPROFILE(start)
movc %d0,%cacr | clear and disable on-chip cache(s)
/* XXX XXX XXX */
- /*
- * bootinfo_start() will have determined what kind of CPU
- * we have, so it's time to fix up the vector table:
- *
- * vectab+8 bus error
- * vectab+12 address error
- */
- RELOC(cputype, %a0)
- movl #_C_LABEL(vectab),%a2
- addl %a5,%a2
-#if defined(M68040)
- cmpl #CPU_68040,%a0@ | 68040?
- jne 1f | no, skip
- movl #_C_LABEL(buserr40),%a2@(8)
- movl #_C_LABEL(addrerr4060),%a2@(12)
- jra Lstart1
-1:
-#endif /* M68040 */
-#if defined(M68030)
- cmpl #CPU_68040,%a0@ | 68040?
- jeq 1f | yes, skip
- movl #_C_LABEL(busaddrerr2030),%a2@(8)
- movl #_C_LABEL(busaddrerr2030),%a2@(12)
- jra Lstart1
-1:
-#endif /* M68030 */
-
- /* Config botch. No hope. SOLDIER ON! */
-
-Lstart1:
/* initialize source/destination control registers for movs */
moveq #FC_USERD,%d0 | user space
movc %d0,%sfc | as source
@@ -239,10 +207,8 @@ Lmotommu2:
* Should be running mapped from this point on
*/
Lenab1:
-/* Point the CPU VBR at our vector table */
- 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 the temporary stack
+ jbsr _C_LABEL(vec_init) | initialize the vector table
/* call final pmap setup */
jbsr _C_LABEL(pmap_bootstrap_finalize)
/* set kernel stack, user SP */
Index: src/sys/arch/virt68k/virt68k/machdep.c
diff -u src/sys/arch/virt68k/virt68k/machdep.c:1.7 src/sys/arch/virt68k/virt68k/machdep.c:1.8
--- src/sys/arch/virt68k/virt68k/machdep.c:1.7 Tue Jan 9 14:24:08 2024
+++ src/sys/arch/virt68k/virt68k/machdep.c Sat Jan 13 17:10:58 2024
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.7 2024/01/09 14:24:08 thorpej Exp $ */
+/* $NetBSD: machdep.c,v 1.8 2024/01/13 17:10:58 thorpej Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2024/01/09 14:24:08 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.8 2024/01/13 17:10:58 thorpej Exp $");
#include "opt_ddb.h"
#include "opt_m060sp.h"
@@ -802,41 +802,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
+ /* No work to do. */
}
void
Added files:
Index: src/sys/arch/virt68k/include/vectors.h
diff -u /dev/null src/sys/arch/virt68k/include/vectors.h:1.1
--- /dev/null Sat Jan 13 17:10:59 2024
+++ src/sys/arch/virt68k/include/vectors.h Sat Jan 13 17:10:58 2024
@@ -0,0 +1,50 @@
+/* $NetBSD: vectors.h,v 1.1 2024/01/13 17:10:58 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 _VIRT68K_VECTORS_H_
+#define _VIRT68K_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 /* _VIRT68K_VECTORS_H_ */