Mon Jan 15 19:11:31 2024 UTC (139d)
G/C __HAVE_LEGACY_INTRCNT from cesfic.


(thorpej)
diff -r1.21 -r1.22 src/sys/arch/cesfic/cesfic/genassym.cf
diff -r1.41 -r1.42 src/sys/arch/cesfic/cesfic/locore.s
diff -r1.16 -r1.17 src/sys/arch/cesfic/include/intr.h
diff -r1.7 -r1.8 src/sys/arch/cesfic/include/types.h

cvs diff -r1.21 -r1.22 src/sys/arch/cesfic/cesfic/genassym.cf (expand / switch to unified diff)

--- src/sys/arch/cesfic/cesfic/genassym.cf 2024/01/09 04:16:24 1.21
+++ src/sys/arch/cesfic/cesfic/genassym.cf 2024/01/15 19:11:31 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1# $NetBSD: genassym.cf,v 1.21 2024/01/09 04:16:24 thorpej Exp $ 1# $NetBSD: genassym.cf,v 1.22 2024/01/15 19:11:31 thorpej Exp $
2 2
3# 3#
4# Copyright (c) 1982, 1990, 1993 4# Copyright (c) 1982, 1990, 1993
5# The Regents of the University of California. All rights reserved. 5# The Regents of the University of California. All rights reserved.
6# 6#
7# Redistribution and use in source and binary forms, with or without 7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions 8# modification, are permitted provided that the following conditions
9# are met: 9# are met:
10# 1. Redistributions of source code must retain the above copyright 10# 1. Redistributions of source code must retain the above copyright
11# notice, this list of conditions and the following disclaimer. 11# notice, this list of conditions and the following disclaimer.
12# 2. Redistributions in binary form must reproduce the above copyright 12# 2. Redistributions in binary form must reproduce the above copyright
13# notice, this list of conditions and the following disclaimer in the 13# notice, this list of conditions and the following disclaimer in the
14# documentation and/or other materials provided with the distribution. 14# documentation and/or other materials provided with the distribution.
@@ -28,26 +28,27 @@ @@ -28,26 +28,27 @@
28# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
29# SUCH DAMAGE. 29# SUCH DAMAGE.
30# 30#
31# @(#)genassym.c 8.3 (Berkeley) 1/4/94 31# @(#)genassym.c 8.3 (Berkeley) 1/4/94
32# 32#
33 33
34include <sys/param.h> 34include <sys/param.h>
35include <sys/buf.h> 35include <sys/buf.h>
36include <sys/proc.h> 36include <sys/proc.h>
37include <sys/mbuf.h> 37include <sys/mbuf.h>
38include <sys/msgbuf.h> 38include <sys/msgbuf.h>
39include <sys/syscall.h> 39include <sys/syscall.h>
40include <sys/device.h> 40include <sys/device.h>
 41include <sys/intr.h>
41 42
42include <uvm/uvm_extern.h> 43include <uvm/uvm_extern.h>
43 44
44include <machine/cpu.h> 45include <machine/cpu.h>
45include <machine/fcode.h> 46include <machine/fcode.h>
46include <machine/psl.h> 47include <machine/psl.h>
47include <machine/pcb.h> 48include <machine/pcb.h>
48include <machine/pte.h> 49include <machine/pte.h>
49 50
50# values for mmutype 51# values for mmutype
51define MMU_68040 MMU_68040 52define MMU_68040 MMU_68040
52define MMU_68030 MMU_68030 53define MMU_68030 MMU_68030
53define MMU_HP MMU_HP 54define MMU_HP MMU_HP
@@ -94,28 +95,34 @@ export MMU51_SRP_BITS @@ -94,28 +95,34 @@ export MMU51_SRP_BITS
94export MMU51_CRP_BITS 95export MMU51_CRP_BITS
95export MMU51_TCR_BITS 96export MMU51_TCR_BITS
96export MMU40_TCR_BITS 97export MMU40_TCR_BITS
97 98
98# lwp & proc fields and values 99# lwp & proc fields and values
99define L_PCB offsetof(struct lwp, l_addr) 100define L_PCB offsetof(struct lwp, l_addr)
100define L_PROC offsetof(struct lwp, l_proc) 101define L_PROC offsetof(struct lwp, l_proc)
101define L_MD_REGS offsetof(struct lwp, l_md.md_regs) 102define L_MD_REGS offsetof(struct lwp, l_md.md_regs)
102define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) 103define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags)
103define P_FLAG offsetof(struct proc, p_flag) 104define P_FLAG offsetof(struct proc, p_flag)
104define P_RASLIST offsetof(struct proc, p_raslist) 105define P_RASLIST offsetof(struct proc, p_raslist)
105define P_VMSPACE offsetof(struct proc, p_vmspace) 106define P_VMSPACE offsetof(struct proc, p_vmspace)
106 107
 108# event counter
 109define EVCNT_COUNT offsetof(struct evcnt, ev_count)
 110
107# interrupt/fault metering 111# interrupt/fault metering
108define CI_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr) 112define CI_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr)
 113define SPUR_INTRCNT ((sizeof(struct evcnt)*0) + offsetof(struct evcnt, ev_count32))
 114define CLOCK_INTRCNT ((sizeof(struct evcnt)*6) + offsetof(struct evcnt, ev_count32))
 115define NMI_INTRCNT ((sizeof(struct evcnt)*7) + offsetof(struct evcnt, ev_count32))
109 116
110# PSL values (should just include psl.h?) 117# PSL values (should just include psl.h?)
111define PSL_S PSL_S 118define PSL_S PSL_S
112define PSL_IPL7 PSL_IPL7 119define PSL_IPL7 PSL_IPL7
113define PSL_LOWIPL PSL_LOWIPL 120define PSL_LOWIPL PSL_LOWIPL
114define PSL_HIGHIPL PSL_HIGHIPL 121define PSL_HIGHIPL PSL_HIGHIPL
115define PSL_USER PSL_USER 122define PSL_USER PSL_USER
116define PSL_TS PSL_T | PSL_S 123define PSL_TS PSL_T | PSL_S
117define SPL1 PSL_S | PSL_IPL1 124define SPL1 PSL_S | PSL_IPL1
118define SPL2 PSL_S | PSL_IPL2 125define SPL2 PSL_S | PSL_IPL2
119define SPL3 PSL_S | PSL_IPL3 126define SPL3 PSL_S | PSL_IPL3
120define SPL4 PSL_S | PSL_IPL4 127define SPL4 PSL_S | PSL_IPL4
121define SPL5 PSL_S | PSL_IPL5 128define SPL5 PSL_S | PSL_IPL5
@@ -165,16 +172,13 @@ define FPF_REGS offsetof(struct fpframe @@ -165,16 +172,13 @@ define FPF_REGS offsetof(struct fpframe
165define FPF_FPCR offsetof(struct fpframe, fpf_fpcr) 172define FPF_FPCR offsetof(struct fpframe, fpf_fpcr)
166define FPF_FPSR offsetof(struct fpframe, fpf_fpsr) 173define FPF_FPSR offsetof(struct fpframe, fpf_fpsr)
167define FPF_FPI offsetof(struct fpframe, fpf_fpiar) 174define FPF_FPI offsetof(struct fpframe, fpf_fpiar)
168 175
169# system calls 176# system calls
170define SYS_exit SYS_exit 177define SYS_exit SYS_exit
171define SYS_execve SYS_execve 178define SYS_execve SYS_execve
172define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14 179define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14
173define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13 180define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13
174 181
175# errno 182# errno
176define EFAULT EFAULT 183define EFAULT EFAULT
177define ENAMETOOLONG ENAMETOOLONG 184define ENAMETOOLONG ENAMETOOLONG
178 
179# event counter 
180define EVCNT_COUNT offsetof(struct evcnt, ev_count) 

cvs diff -r1.41 -r1.42 src/sys/arch/cesfic/cesfic/locore.s (expand / switch to unified diff)

--- src/sys/arch/cesfic/cesfic/locore.s 2024/01/15 03:07:14 1.41
+++ src/sys/arch/cesfic/cesfic/locore.s 2024/01/15 19:11:31 1.42
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.41 2024/01/15 03:07:14 thorpej Exp $ */ 1/* $NetBSD: locore.s,v 1.42 2024/01/15 19:11:31 thorpej Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1980, 1990, 1993 4 * Copyright (c) 1980, 1990, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley by 7 * This code is derived from software contributed to Berkeley by
8 * the Systems Programming Group of the University of Utah Computer 8 * the Systems Programming Group of the University of Utah Computer
9 * Science Department. 9 * Science Department.
10 * 10 *
11 * Redistribution and use in source and binary forms, with or without 11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions 12 * modification, are permitted provided that the following conditions
13 * are met: 13 * are met:
14 * 1. Redistributions of source code must retain the above copyright 14 * 1. Redistributions of source code must retain the above copyright
@@ -597,56 +597,56 @@ Lbrkpt2: @@ -597,56 +597,56 @@ Lbrkpt2:
597 rte | all done 597 rte | all done
598 598
599/* Use common m68k sigreturn */ 599/* Use common m68k sigreturn */
600#include <m68k/m68k/sigreturn.s> 600#include <m68k/m68k/sigreturn.s>
601 601
602/* 602/*
603 * Interrupt handlers. 603 * Interrupt handlers.
604 * All device interrupts are auto-vectored. The CPU provides 604 * All device interrupts are auto-vectored. The CPU provides
605 * the vector 0x18+level. Note we count spurious interrupts, but 605 * the vector 0x18+level. Note we count spurious interrupts, but
606 * we don't do anything else with them. 606 * we don't do anything else with them.
607 */ 607 */
608 608
609ENTRY_NOPROFILE(spurintr) /* level 0 */ 609ENTRY_NOPROFILE(spurintr) /* level 0 */
610 addql #1,_C_LABEL(intrcnt)+0 610 addql #1,_C_LABEL(m68k_intr_evcnt)+SPUR_INTRCNT
611 INTERRUPT_SAVEREG 611 INTERRUPT_SAVEREG
612 CPUINFO_INCREMENT(CI_NINTR) 612 CPUINFO_INCREMENT(CI_NINTR)
613 INTERRUPT_RESTOREREG 613 INTERRUPT_RESTOREREG
614 jra _ASM_LABEL(rei) 614 jra _ASM_LABEL(rei)
615 615
616ENTRY_NOPROFILE(lev6intr) /* Level 6: clock */ 616ENTRY_NOPROFILE(lev6intr) /* Level 6: clock */
617 INTERRUPT_SAVEREG 617 INTERRUPT_SAVEREG
618 /* XXX */ 618 /* XXX */
619 movl _C_LABEL(clockbase), %a0 619 movl _C_LABEL(clockbase), %a0
620 movl %a0@, %d0 620 movl %a0@, %d0
621 movl %d0, %a0@ 621 movl %d0, %a0@
622 btst #2, %d0 622 btst #2, %d0
623 jeq 1f 623 jeq 1f
624 addql #1,_C_LABEL(intrcnt)+24 624 addql #1,_C_LABEL(m68k_intr_evcnt)+CLOCK_INTRCNT
625 lea %sp@(0), %a1 | a1 = &clockframe 625 lea %sp@(0), %a1 | a1 = &clockframe
626 movl %a1, %sp@- 626 movl %a1, %sp@-
627 jbsr _C_LABEL(hardclock) | hardclock(&frame) 627 jbsr _C_LABEL(hardclock) | hardclock(&frame)
628 addql #4, %sp 628 addql #4, %sp
629 jra 2f 629 jra 2f
6301: 6301:
631 movl %d0, %sp@- 631 movl %d0, %sp@-
632 jbsr _C_LABEL(otherclock) 632 jbsr _C_LABEL(otherclock)
633 addql #4, %sp 633 addql #4, %sp
6342: 6342:
635 INTERRUPT_RESTOREREG 635 INTERRUPT_RESTOREREG
636 jra _ASM_LABEL(rei) | all done 636 jra _ASM_LABEL(rei) | all done
637 637
638ENTRY_NOPROFILE(lev7intr) /* level 7: parity errors, reset key */ 638ENTRY_NOPROFILE(lev7intr) /* level 7: parity errors, reset key */
639 addql #1,_C_LABEL(intrcnt)+28 639 addql #1,_C_LABEL(m68k_intr_evcnt)+NMI_INTRCNT
640 clrl %sp@- 640 clrl %sp@-
641 moveml #0xFFFF,%sp@- | save registers 641 moveml #0xFFFF,%sp@- | save registers
642 movl %usp,%a0 | and save 642 movl %usp,%a0 | and save
643 movl %a0,%sp@(FR_SP) | the user stack pointer 643 movl %a0,%sp@(FR_SP) | the user stack pointer
644 jbsr _C_LABEL(nmihand) | call handler 644 jbsr _C_LABEL(nmihand) | call handler
645 movl %sp@(FR_SP),%a0 | restore 645 movl %sp@(FR_SP),%a0 | restore
646 movl %a0,%usp | user SP 646 movl %a0,%usp | user SP
647 moveml %sp@+,#0x7FFF | and remaining registers 647 moveml %sp@+,#0x7FFF | and remaining registers
648 addql #8,%sp | pop SP and stack adjust 648 addql #8,%sp | pop SP and stack adjust
649 jra _ASM_LABEL(rei) | all done 649 jra _ASM_LABEL(rei) | all done
650 650
651/* 651/*
652 * Emulation of VAX REI instruction. 652 * Emulation of VAX REI instruction.
@@ -834,29 +834,13 @@ GLOBAL(cputype) @@ -834,29 +834,13 @@ GLOBAL(cputype)
834 .long CPU_68020 | default to 68020 CPU 834 .long CPU_68020 | default to 68020 CPU
835GLOBAL(fputype) 835GLOBAL(fputype)
836 .long FPU_68881 | default to 68881 FPU 836 .long FPU_68881 | default to 68881 FPU
837GLOBAL(prototc) 837GLOBAL(prototc)
838 .long 0 | prototype translation control 838 .long 0 | prototype translation control
839 839
840#ifdef DEBUG 840#ifdef DEBUG
841 .globl fulltflush, fullcflush 841 .globl fulltflush, fullcflush
842fulltflush: 842fulltflush:
843 .long 0 843 .long 0
844fullcflush: 844fullcflush:
845 .long 0 845 .long 0
846#endif 846#endif
847 
848/* interrupt counters */ 
849GLOBAL(intrnames) 
850 .asciz "spur" 
851 .asciz "lev1" 
852 .asciz "lev2" 
853 .asciz "lev3" 
854 .asciz "lev4" 
855 .asciz "lev5" 
856 .asciz "clock" 
857 .asciz "nmi" 
858GLOBAL(eintrnames) 
859 .even 
860GLOBAL(intrcnt) 
861 .long 0,0,0,0,0,0,0,0 
862GLOBAL(eintrcnt) 

cvs diff -r1.16 -r1.17 src/sys/arch/cesfic/include/intr.h (expand / switch to unified diff)

--- src/sys/arch/cesfic/include/intr.h 2024/01/15 03:07:14 1.16
+++ src/sys/arch/cesfic/include/intr.h 2024/01/15 19:11:31 1.17
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: intr.h,v 1.16 2024/01/15 03:07:14 thorpej Exp $ */ 1/* $NetBSD: intr.h,v 1.17 2024/01/15 19:11:31 thorpej Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2024 The NetBSD Foundation, Inc. 4 * Copyright (c) 2024 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Jason R. Thorpe. 8 * by Jason R. Thorpe.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -31,16 +31,19 @@ @@ -31,16 +31,19 @@
31 31
32#ifndef _LUNA68K_INTR_H_ 32#ifndef _LUNA68K_INTR_H_
33#define _LUNA68K_INTR_H_ 33#define _LUNA68K_INTR_H_
34 34
35#include <m68k/psl.h> 35#include <m68k/psl.h>
36 36
37#define MACHINE_PSL_IPL_SOFTCLOCK PSL_IPL1 37#define MACHINE_PSL_IPL_SOFTCLOCK PSL_IPL1
38#define MACHINE_PSL_IPL_SOFTBIO PSL_IPL1 38#define MACHINE_PSL_IPL_SOFTBIO PSL_IPL1
39#define MACHINE_PSL_IPL_SOFTNET PSL_IPL1 39#define MACHINE_PSL_IPL_SOFTNET PSL_IPL1
40#define MACHINE_PSL_IPL_SOFTSERIAL PSL_IPL1 40#define MACHINE_PSL_IPL_SOFTSERIAL PSL_IPL1
41#define MACHINE_PSL_IPL_VM PSL_IPL4 41#define MACHINE_PSL_IPL_VM PSL_IPL4
42#define MACHINE_PSL_IPL_SCHED PSL_IPL6 42#define MACHINE_PSL_IPL_SCHED PSL_IPL6
43 43
 44#define MACHINE_INTREVCNT_NAMES \
 45 { "spur", "lev1", "lev2", "lev3", "lev4", "lev5", "clock", "nmi" }
 46
44#include <m68k/intr.h> 47#include <m68k/intr.h>
45 48
46#endif /* _LUNA68K_INTR_H */ 49#endif /* _LUNA68K_INTR_H */

cvs diff -r1.7 -r1.8 src/sys/arch/cesfic/include/types.h (expand / switch to unified diff)

--- src/sys/arch/cesfic/include/types.h 2021/04/01 04:43:00 1.7
+++ src/sys/arch/cesfic/include/types.h 2024/01/15 19:11:31 1.8
@@ -1,5 +1,3 @@ @@ -1,5 +1,3 @@
1/* $NetBSD: types.h,v 1.7 2021/04/01 04:43:00 simonb Exp $ */ 1/* $NetBSD: types.h,v 1.8 2024/01/15 19:11:31 thorpej Exp $ */
2 2
3#include <m68k/types.h> 3#include <m68k/types.h>
4 
5#define __HAVE_LEGACY_INTRCNT