Module Name:    src
Committed By:   thorpej
Date:           Mon Jan 15 20:21:51 UTC 2024

Modified Files:
        src/sys/arch/news68k/dev: timer_hb.c
        src/sys/arch/news68k/include: cpu.h intr.h types.h
        src/sys/arch/news68k/news68k: genassym.cf locore.s machdep.c

Log Message:
G/C __HAVE_LEGACY_INTRCNT from news68k.


To generate a diff of this commit:
cvs rdiff -u -r1.20 -r1.21 src/sys/arch/news68k/dev/timer_hb.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/news68k/include/cpu.h
cvs rdiff -u -r1.29 -r1.30 src/sys/arch/news68k/include/intr.h
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/news68k/include/types.h
cvs rdiff -u -r1.35 -r1.36 src/sys/arch/news68k/news68k/genassym.cf
cvs rdiff -u -r1.81 -r1.82 src/sys/arch/news68k/news68k/locore.s
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/news68k/news68k/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/news68k/dev/timer_hb.c
diff -u src/sys/arch/news68k/dev/timer_hb.c:1.20 src/sys/arch/news68k/dev/timer_hb.c:1.21
--- src/sys/arch/news68k/dev/timer_hb.c:1.20	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/dev/timer_hb.c	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: timer_hb.c,v 1.20 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: timer_hb.c,v 1.21 2024/01/15 20:21:50 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: timer_hb.c,v 1.20 2024/01/15 00:35:23 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: timer_hb.c,v 1.21 2024/01/15 20:21:50 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -154,7 +154,8 @@ clock_intr(struct clockframe cf)
 	/* Pulse the clock intr. enable low. */
 	*ctrl_timer = 0;
 	*ctrl_timer = 1;
-	intrcnt[TIMER_LEVEL]++;
+
+	m68k_count_intr(TIMER_LEVEL);
 
 	/* Entertainment! */
 #ifdef	LED_IDLE_CHECK
@@ -164,7 +165,6 @@ clock_intr(struct clockframe cf)
 
 	/* Call common clock interrupt handler. */
 	hardclock(&cf);
-	curcpu()->ci_data.cpu_nintr++;
 }
 
 /* heartbeat LED */

Index: src/sys/arch/news68k/include/cpu.h
diff -u src/sys/arch/news68k/include/cpu.h:1.50 src/sys/arch/news68k/include/cpu.h:1.51
--- src/sys/arch/news68k/include/cpu.h:1.50	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/cpu.h	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.50 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.51 2024/01/15 20:21:50 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -148,7 +148,6 @@ extern int cpuspeed;
 extern char *intiobase, *intiolimit, *extiobase;
 extern u_int intiobase_phys, intiotop_phys;
 extern u_int extiobase_phys, extiotop_phys;
-extern u_int intrcnt[];
 
 extern void *romcallvec;
 

Index: src/sys/arch/news68k/include/intr.h
diff -u src/sys/arch/news68k/include/intr.h:1.29 src/sys/arch/news68k/include/intr.h:1.30
--- src/sys/arch/news68k/include/intr.h:1.29	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/intr.h	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: intr.h,v 1.29 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: intr.h,v 1.30 2024/01/15 20:21:50 thorpej Exp $	*/
 
 /*-
  * Copyright (c) 2024 The NetBSD Foundation, Inc.
@@ -41,6 +41,9 @@
 #define	MACHINE_PSL_IPL_VM		PSL_IPL5
 #define	MACHINE_PSL_IPL_SCHED		PSL_IPL7
 
+#define	MACHINE_INTREVCNT_NAMES						\
+	{ "spur", "AST", "softint", "lev3", "lev4", "lev5", "clock", "nmi" }
+
 #include <m68k/intr.h>
 
 #endif	/* _NEWS68K_INTR_H_ */

Index: src/sys/arch/news68k/include/types.h
diff -u src/sys/arch/news68k/include/types.h:1.14 src/sys/arch/news68k/include/types.h:1.15
--- src/sys/arch/news68k/include/types.h:1.14	Mon Jan 15 00:35:23 2024
+++ src/sys/arch/news68k/include/types.h	Mon Jan 15 20:21:50 2024
@@ -1,7 +1,6 @@
-/*	$NetBSD: types.h,v 1.14 2024/01/15 00:35:23 thorpej Exp $	*/
+/*	$NetBSD: types.h,v 1.15 2024/01/15 20:21:50 thorpej Exp $	*/
 
 #include <m68k/types.h>
 
-#define	__HAVE_LEGACY_INTRCNT
 #define	__HAVE_MM_MD_KERNACC
 #define	__HAVE_M68K_INTR_VECTORED

Index: src/sys/arch/news68k/news68k/genassym.cf
diff -u src/sys/arch/news68k/news68k/genassym.cf:1.35 src/sys/arch/news68k/news68k/genassym.cf:1.36
--- src/sys/arch/news68k/news68k/genassym.cf:1.35	Mon Jan 15 00:35:24 2024
+++ src/sys/arch/news68k/news68k/genassym.cf	Mon Jan 15 20:21:50 2024
@@ -1,4 +1,4 @@
-#	$NetBSD: genassym.cf,v 1.35 2024/01/15 00:35:24 thorpej Exp $
+#	$NetBSD: genassym.cf,v 1.36 2024/01/15 20:21:50 thorpej Exp $
 
 #
 # Copyright (c) 1982, 1990, 1993
@@ -115,6 +115,8 @@ define	P_VMSPACE		offsetof(struct proc, 
 
 # interrupt/fault metering
 define	CI_NINTR		offsetof(struct cpu_info, ci_data.cpu_nintr)
+define	AST_INTRCNT		((sizeof(struct evcnt)*1) + offsetof(struct evcnt, ev_count32))
+define	NMI_INTRCNT		((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
 
 # PSL values (should just include psl.h?)
 define	PSL_S			PSL_S

Index: src/sys/arch/news68k/news68k/locore.s
diff -u src/sys/arch/news68k/news68k/locore.s:1.81 src/sys/arch/news68k/news68k/locore.s:1.82
--- src/sys/arch/news68k/news68k/locore.s:1.81	Mon Jan 15 19:54:53 2024
+++ src/sys/arch/news68k/news68k/locore.s	Mon Jan 15 20:21:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.81 2024/01/15 19:54:53 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.82 2024/01/15 20:21:51 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -655,7 +655,7 @@ ENTRY_NOPROFILE(lev1intr)		/* Level 1: A
 	addql	#1,_C_LABEL(idepth)
 	INTERRUPT_SAVEREG
 	CPUINFO_INCREMENT(CI_NINTR)
-	addql	#1,_C_LABEL(intrcnt)+4
+	addql	#1,_C_LABEL(m68k_intr_evcnt)+AST_INTRCNT
 	movl	_C_LABEL(ctrl_ast),%a0
 	clrb	%a0@			| disable AST interrupt
 	INTERRUPT_RESTOREREG
@@ -696,7 +696,7 @@ ENTRY_NOPROFILE(_isr_clock)		/* Level 6:
 
 #if 0
 ENTRY_NOPROFILE(lev7intr)		/* Level 7: NMI */
-	addql	#1,_C_LABEL(intrcnt)+32
+	addql	#1,_C_LABEL(intrcnt)+NMI_INTRCNT
 	clrl	%sp@-
 	moveml	#0xFFFF,%sp@-		| save registers
 	movl	%usp,%a0		| and save
@@ -974,21 +974,3 @@ GLOBAL(cache_clr)
 
 GLOBAL(romcallvec)
 	.long	0
-
-
-/* interrupt counters */
-GLOBAL(intrnames)
-	.asciz	"spur"
-	.asciz	"AST"		| lev1: AST
-	.asciz	"softint"	| lev2: software interrupt
-	.asciz	"lev3"		| lev3: slot intr, VME intr 2, fd, lpt
-	.asciz	"lev4"		| lev4: slot intr, VME intr 4, le, scsi
-	.asciz	"lev5"		| lev5: kb, ms, zs
-	.asciz	"clock"		| lev6: clock
-	.asciz	"nmi"		| parity error
-GLOBAL(eintrnames)
-	.even
-
-GLOBAL(intrcnt)
-	.long	0,0,0,0,0,0,0,0
-GLOBAL(eintrcnt)

Index: src/sys/arch/news68k/news68k/machdep.c
diff -u src/sys/arch/news68k/news68k/machdep.c:1.112 src/sys/arch/news68k/news68k/machdep.c:1.113
--- src/sys/arch/news68k/news68k/machdep.c:1.112	Wed Dec 20 00:40:44 2023
+++ src/sys/arch/news68k/news68k/machdep.c	Mon Jan 15 20:21:51 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: machdep.c,v 1.112 2023/12/20 00:40:44 thorpej Exp $	*/
+/*	$NetBSD: machdep.c,v 1.113 2024/01/15 20:21:51 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.112 2023/12/20 00:40:44 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.113 2024/01/15 20:21:51 thorpej Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -898,8 +898,7 @@ intrhand_lev3(void)
 	int stat;
 
 	stat = *int_status;
-	intrcnt[3]++;
-	curcpu()->ci_data.cpu_nintr++;
+	m68k_count_intr(3);
 #if 1
 	printf("level 3 interrupt: INT_STATUS = 0x%02x\n", stat);
 #endif
@@ -917,8 +916,7 @@ intrhand_lev4(void)
 #define INTST_SCSI	0x80
 
 	stat = *int_status;
-	intrcnt[4]++;
-	curcpu()->ci_data.cpu_nintr++;
+	m68k_count_intr(4);
 
 #if NSI > 0
 	if (stat & INTST_SCSI) {

Reply via email to