G/C __HAVE_LEGACY_INTRCNT from cesfic.diff -r1.21 -r1.22 src/sys/arch/cesfic/cesfic/genassym.cf
(thorpej)
--- 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 | |||
34 | include <sys/param.h> | 34 | include <sys/param.h> | |
35 | include <sys/buf.h> | 35 | include <sys/buf.h> | |
36 | include <sys/proc.h> | 36 | include <sys/proc.h> | |
37 | include <sys/mbuf.h> | 37 | include <sys/mbuf.h> | |
38 | include <sys/msgbuf.h> | 38 | include <sys/msgbuf.h> | |
39 | include <sys/syscall.h> | 39 | include <sys/syscall.h> | |
40 | include <sys/device.h> | 40 | include <sys/device.h> | |
41 | include <sys/intr.h> | |||
41 | 42 | |||
42 | include <uvm/uvm_extern.h> | 43 | include <uvm/uvm_extern.h> | |
43 | 44 | |||
44 | include <machine/cpu.h> | 45 | include <machine/cpu.h> | |
45 | include <machine/fcode.h> | 46 | include <machine/fcode.h> | |
46 | include <machine/psl.h> | 47 | include <machine/psl.h> | |
47 | include <machine/pcb.h> | 48 | include <machine/pcb.h> | |
48 | include <machine/pte.h> | 49 | include <machine/pte.h> | |
49 | 50 | |||
50 | # values for mmutype | 51 | # values for mmutype | |
51 | define MMU_68040 MMU_68040 | 52 | define MMU_68040 MMU_68040 | |
52 | define MMU_68030 MMU_68030 | 53 | define MMU_68030 MMU_68030 | |
53 | define MMU_HP MMU_HP | 54 | define MMU_HP MMU_HP | |
@@ -94,28 +95,34 @@ export MMU51_SRP_BITS | @@ -94,28 +95,34 @@ export MMU51_SRP_BITS | |||
94 | export MMU51_CRP_BITS | 95 | export MMU51_CRP_BITS | |
95 | export MMU51_TCR_BITS | 96 | export MMU51_TCR_BITS | |
96 | export MMU40_TCR_BITS | 97 | export MMU40_TCR_BITS | |
97 | 98 | |||
98 | # lwp & proc fields and values | 99 | # lwp & proc fields and values | |
99 | define L_PCB offsetof(struct lwp, l_addr) | 100 | define L_PCB offsetof(struct lwp, l_addr) | |
100 | define L_PROC offsetof(struct lwp, l_proc) | 101 | define L_PROC offsetof(struct lwp, l_proc) | |
101 | define L_MD_REGS offsetof(struct lwp, l_md.md_regs) | 102 | define L_MD_REGS offsetof(struct lwp, l_md.md_regs) | |
102 | define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) | 103 | define L_MD_FLAGS offsetof(struct lwp, l_md.md_flags) | |
103 | define P_FLAG offsetof(struct proc, p_flag) | 104 | define P_FLAG offsetof(struct proc, p_flag) | |
104 | define P_RASLIST offsetof(struct proc, p_raslist) | 105 | define P_RASLIST offsetof(struct proc, p_raslist) | |
105 | define P_VMSPACE offsetof(struct proc, p_vmspace) | 106 | define P_VMSPACE offsetof(struct proc, p_vmspace) | |
106 | 107 | |||
108 | # event counter | |||
109 | define EVCNT_COUNT offsetof(struct evcnt, ev_count) | |||
110 | ||||
107 | # interrupt/fault metering | 111 | # interrupt/fault metering | |
108 | define CI_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr) | 112 | define CI_NINTR offsetof(struct cpu_info, ci_data.cpu_nintr) | |
113 | define SPUR_INTRCNT ((sizeof(struct evcnt)*0) + offsetof(struct evcnt, ev_count32)) | |||
114 | define CLOCK_INTRCNT ((sizeof(struct evcnt)*6) + offsetof(struct evcnt, ev_count32)) | |||
115 | define 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?) | |
111 | define PSL_S PSL_S | 118 | define PSL_S PSL_S | |
112 | define PSL_IPL7 PSL_IPL7 | 119 | define PSL_IPL7 PSL_IPL7 | |
113 | define PSL_LOWIPL PSL_LOWIPL | 120 | define PSL_LOWIPL PSL_LOWIPL | |
114 | define PSL_HIGHIPL PSL_HIGHIPL | 121 | define PSL_HIGHIPL PSL_HIGHIPL | |
115 | define PSL_USER PSL_USER | 122 | define PSL_USER PSL_USER | |
116 | define PSL_TS PSL_T | PSL_S | 123 | define PSL_TS PSL_T | PSL_S | |
117 | define SPL1 PSL_S | PSL_IPL1 | 124 | define SPL1 PSL_S | PSL_IPL1 | |
118 | define SPL2 PSL_S | PSL_IPL2 | 125 | define SPL2 PSL_S | PSL_IPL2 | |
119 | define SPL3 PSL_S | PSL_IPL3 | 126 | define SPL3 PSL_S | PSL_IPL3 | |
120 | define SPL4 PSL_S | PSL_IPL4 | 127 | define SPL4 PSL_S | PSL_IPL4 | |
121 | define SPL5 PSL_S | PSL_IPL5 | 128 | define 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 | |||
165 | define FPF_FPCR offsetof(struct fpframe, fpf_fpcr) | 172 | define FPF_FPCR offsetof(struct fpframe, fpf_fpcr) | |
166 | define FPF_FPSR offsetof(struct fpframe, fpf_fpsr) | 173 | define FPF_FPSR offsetof(struct fpframe, fpf_fpsr) | |
167 | define FPF_FPI offsetof(struct fpframe, fpf_fpiar) | 174 | define FPF_FPI offsetof(struct fpframe, fpf_fpiar) | |
168 | 175 | |||
169 | # system calls | 176 | # system calls | |
170 | define SYS_exit SYS_exit | 177 | define SYS_exit SYS_exit | |
171 | define SYS_execve SYS_execve | 178 | define SYS_execve SYS_execve | |
172 | define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14 | 179 | define SYS_compat_16___sigreturn14 SYS_compat_16___sigreturn14 | |
173 | define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13 | 180 | define SYS_compat_13_sigreturn13 SYS_compat_13_sigreturn13 | |
174 | 181 | |||
175 | # errno | 182 | # errno | |
176 | define EFAULT EFAULT | 183 | define EFAULT EFAULT | |
177 | define ENAMETOOLONG ENAMETOOLONG | 184 | define ENAMETOOLONG ENAMETOOLONG | |
178 | ||||
179 | # event counter | |||
180 | define EVCNT_COUNT offsetof(struct evcnt, ev_count) |
--- 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 | |||
609 | ENTRY_NOPROFILE(spurintr) /* level 0 */ | 609 | ENTRY_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 | |||
616 | ENTRY_NOPROFILE(lev6intr) /* Level 6: clock */ | 616 | ENTRY_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 | |
630 | 1: | 630 | 1: | |
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 | |
634 | 2: | 634 | 2: | |
635 | INTERRUPT_RESTOREREG | 635 | INTERRUPT_RESTOREREG | |
636 | jra _ASM_LABEL(rei) | all done | 636 | jra _ASM_LABEL(rei) | all done | |
637 | 637 | |||
638 | ENTRY_NOPROFILE(lev7intr) /* level 7: parity errors, reset key */ | 638 | ENTRY_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 | |
835 | GLOBAL(fputype) | 835 | GLOBAL(fputype) | |
836 | .long FPU_68881 | default to 68881 FPU | 836 | .long FPU_68881 | default to 68881 FPU | |
837 | GLOBAL(prototc) | 837 | GLOBAL(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 | |
842 | fulltflush: | 842 | fulltflush: | |
843 | .long 0 | 843 | .long 0 | |
844 | fullcflush: | 844 | fullcflush: | |
845 | .long 0 | 845 | .long 0 | |
846 | #endif | 846 | #endif | |
847 | ||||
848 | /* interrupt counters */ | |||
849 | GLOBAL(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" | |||
858 | GLOBAL(eintrnames) | |||
859 | .even | |||
860 | GLOBAL(intrcnt) | |||
861 | .long 0,0,0,0,0,0,0,0 | |||
862 | GLOBAL(eintrcnt) |
--- 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 */ |
--- 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 |