Module Name:    src
Committed By:   thorpej
Date:           Sat Jan 13 19:20:26 UTC 2024

Modified Files:
        src/sys/arch/hp300/conf: files.hp300
        src/sys/arch/hp300/hp300: locore.s
        src/sys/arch/hp300/include: cpu.h
Added Files:
        src/sys/arch/hp300/include: vectors.h
Removed Files:
        src/sys/arch/hp300/hp300: vectors.s

Log Message:
Switch hp300 over to the common m68k vector table.


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 src/sys/arch/hp300/conf/files.hp300
cvs rdiff -u -r1.179 -r1.180 src/sys/arch/hp300/hp300/locore.s
cvs rdiff -u -r1.19 -r0 src/sys/arch/hp300/hp300/vectors.s
cvs rdiff -u -r1.74 -r1.75 src/sys/arch/hp300/include/cpu.h
cvs rdiff -u -r0 -r1.1 src/sys/arch/hp300/include/vectors.h

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

Modified files:

Index: src/sys/arch/hp300/conf/files.hp300
diff -u src/sys/arch/hp300/conf/files.hp300:1.93 src/sys/arch/hp300/conf/files.hp300:1.94
--- src/sys/arch/hp300/conf/files.hp300:1.93	Tue Jan  9 04:16:24 2024
+++ src/sys/arch/hp300/conf/files.hp300	Sat Jan 13 19:20:26 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: files.hp300,v 1.93 2024/01/09 04:16:24 thorpej Exp $
+#	$NetBSD: files.hp300,v 1.94 2024/01/13 19:20:26 thorpej Exp $
 #
 # hp300-specific configuration info
 
@@ -224,6 +224,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/hp300/hp300/locore.s
diff -u src/sys/arch/hp300/hp300/locore.s:1.179 src/sys/arch/hp300/hp300/locore.s:1.180
--- src/sys/arch/hp300/hp300/locore.s:1.179	Tue Jan  9 07:28:25 2024
+++ src/sys/arch/hp300/hp300/locore.s	Sat Jan 13 19:20:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.179 2024/01/09 07:28:25 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.180 2024/01/13 19:20:26 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1980, 1990, 1993
@@ -128,8 +128,6 @@ GLOBAL(kernel_text)
 	.space	PAGE_SIZE
 ASLOCAL(tmpstk)
 
-#include <hp300/hp300/vectors.s>
-
 /*
  * Macro to relocate a symbol, used before MMU is enabled.
  */
@@ -370,36 +368,6 @@ Lis320:
 	 */
 
 Lstart1:
-	/*
-	 * Now that we know what CPU we have, initialize the address error
-	 * and bus error handlers in 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	Lstart2
-1:
-#endif
-#if defined(M68020) || defined(M68030)
-	cmpl	#CPU_68040,%a0@		| 68040?
-	jeq	1f			| yes, skip
-	movl	#_C_LABEL(busaddrerr2030),%a2@(8)
-	movl	#_C_LABEL(busaddrerr2030),%a2@(12)
-	jra	Lstart2
-1:
-#endif
-	/* Config botch; no hope. */
-	DOREBOOT
-
-Lstart2:
 	movl	#0,%a1@(MMUCMD)		| clear out MMU again
 /* initialize source/destination control registers for movs */
 	moveq	#FC_USERD,%d0		| user space
@@ -493,13 +461,6 @@ Lcodecopy:
 	 */
 
 Lhighcode:
-	/*
-	 * Set up the vector table, and race to get the MMU
-	 * enabled.
-	 */
-	movl	#_C_LABEL(vectab),%d0	| set Vector Base Register
-	movc	%d0,%vbr
-
 	RELOC(mmutype, %a0)
 	tstl	%a0@			| HP MMU?
 	jeq	Lhpmmu3			| yes, skip
@@ -542,7 +503,8 @@ Lehighcode:
  * Should be running mapped from this point on
  */
 Lenab1:
-	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/hp300/include/cpu.h
diff -u src/sys/arch/hp300/include/cpu.h:1.74 src/sys/arch/hp300/include/cpu.h:1.75
--- src/sys/arch/hp300/include/cpu.h:1.74	Tue Jan  9 04:16:24 2024
+++ src/sys/arch/hp300/include/cpu.h	Sat Jan 13 19:20:26 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.74 2024/01/09 04:16:24 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.75 2024/01/13 19:20:26 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -116,7 +116,6 @@ extern int astpending;		/* need to trap 
  */
 
 extern	uint8_t *intiobase, *intiolimit, *extiobase;
-extern	void (*vectab[])(void);
 
 /* locore.s functions */
 void	doboot(void) __attribute__((__noreturn__));

Added files:

Index: src/sys/arch/hp300/include/vectors.h
diff -u /dev/null src/sys/arch/hp300/include/vectors.h:1.1
--- /dev/null	Sat Jan 13 19:20:26 2024
+++ src/sys/arch/hp300/include/vectors.h	Sat Jan 13 19:20:26 2024
@@ -0,0 +1,50 @@
+/*	$NetBSD: vectors.h,v 1.1 2024/01/13 19:20:26 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 _HP300_VECTORS_H_
+#define	_HP300_VECTORS_H_
+
+#ifdef _KERNEL
+
+#include <m68k/vectors.h>
+
+#define	MACHINE_AV0_HANDLER	spurintr
+#define	MACHINE_AV1_HANDLER	intrhand
+#define	MACHINE_AV2_HANDLER	intrhand
+#define	MACHINE_AV3_HANDLER	intrhand
+#define	MACHINE_AV4_HANDLER	intrhand
+#define	MACHINE_AV5_HANDLER	intrhand
+#define	MACHINE_AV6_HANDLER	lev6intr
+#define	MACHINE_AV7_HANDLER	lev7intr
+
+#endif /* _KERNEL */
+
+#endif /* _HP300_VECTORS_H_ */

Reply via email to