Wed Mar 16 20:31:02 2022 UTC ()
s/paniced/panicked/ and s/borken/broken/ in comments.


(andvar)
diff -r1.159 -r1.160 src/sys/arch/amiga/amiga/locore.s
diff -r1.114 -r1.115 src/sys/arch/atari/atari/locore.s
diff -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/locore.S
diff -r1.66 -r1.67 src/sys/arch/next68k/dev/mb8795.c
diff -r1.45 -r1.46 src/sys/arch/powerpc/booke/e500_intr.c
diff -r1.48 -r1.49 src/sys/arch/sparc64/sparc64/ofw_machdep.c
diff -r1.28 -r1.29 src/sys/arch/sun2/sun2/locore.s
diff -r1.100 -r1.101 src/sys/arch/sun3/sun3/locore.s
diff -r1.68 -r1.69 src/sys/arch/sun3/sun3x/locore.s
diff -r1.186 -r1.187 src/sys/kern/subr_prf.c
diff -r1.88 -r1.89 src/sys/kern/vfs_mount.c

cvs diff -r1.159 -r1.160 src/sys/arch/amiga/amiga/locore.s (expand / switch to unified diff)

--- src/sys/arch/amiga/amiga/locore.s 2020/07/21 06:39:31 1.159
+++ src/sys/arch/amiga/amiga/locore.s 2022/03/16 20:31:01 1.160
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.159 2020/07/21 06:39:31 rin Exp $ */ 1/* $NetBSD: locore.s,v 1.160 2022/03/16 20:31:01 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1980, 1990 The Regents of the University of California. 5 * Copyright (c) 1980, 1990 The Regents of the University of California.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department. 10 * Science Department.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -695,27 +695,27 @@ ENTRY_NOPROFILE(lev7intr) @@ -695,27 +695,27 @@ ENTRY_NOPROFILE(lev7intr)
695 * (profiling, scheduling) and software interrupts (network, softclock). 695 * (profiling, scheduling) and software interrupts (network, softclock).
696 * We check for ASTs first, just like the VAX. To avoid excess overhead 696 * We check for ASTs first, just like the VAX. To avoid excess overhead
697 * the T_ASTFLT handling code will also check for software interrupts so we 697 * the T_ASTFLT handling code will also check for software interrupts so we
698 * do not have to do it here. After identifing that we need an AST we 698 * do not have to do it here. After identifing that we need an AST we
699 * drop the IPL to allow device interrupts. 699 * drop the IPL to allow device interrupts.
700 * 700 *
701 * This code is complicated by the fact that sendsig may have been called 701 * This code is complicated by the fact that sendsig may have been called
702 * necessitating a stack cleanup. A cleanup should only be needed at this 702 * necessitating a stack cleanup. A cleanup should only be needed at this
703 * point for coprocessor mid-instruction frames (type 9), but we also test 703 * point for coprocessor mid-instruction frames (type 9), but we also test
704 * for bus error frames (type 10 and 11). 704 * for bus error frames (type 10 and 11).
705 */ 705 */
706ASENTRY_NOPROFILE(rei) 706ASENTRY_NOPROFILE(rei)
707#ifdef DEBUG 707#ifdef DEBUG
708 tstl _C_LABEL(panicstr) | have we paniced? 708 tstl _C_LABEL(panicstr) | have we panicked?
709 jne Ldorte | yes, do not make matters worse 709 jne Ldorte | yes, do not make matters worse
710#endif 710#endif
711 tstl _C_LABEL(astpending) | AST pending? 711 tstl _C_LABEL(astpending) | AST pending?
712 jeq Ldorte | no, done 712 jeq Ldorte | no, done
713Lrei1: 713Lrei1:
714 btst #5,%sp@ | yes, are we returning to user mode? 714 btst #5,%sp@ | yes, are we returning to user mode?
715 jne Ldorte | no, done 715 jne Ldorte | no, done
716 movw #PSL_LOWIPL,%sr | lower SPL 716 movw #PSL_LOWIPL,%sr | lower SPL
717 clrl %sp@- | stack adjust 717 clrl %sp@- | stack adjust
718 moveml %d0-%d7/%a0-%a7,%sp@- | save all registers 718 moveml %d0-%d7/%a0-%a7,%sp@- | save all registers
719 movl %usp,%a1 | including 719 movl %usp,%a1 | including
720 movl %a1,%sp@(FR_SP) | the users SP 720 movl %a1,%sp@(FR_SP) | the users SP
721 clrl %sp@- | VA == none 721 clrl %sp@- | VA == none

cvs diff -r1.114 -r1.115 src/sys/arch/atari/atari/locore.s (expand / switch to unified diff)

--- src/sys/arch/atari/atari/locore.s 2019/05/03 01:08:28 1.114
+++ src/sys/arch/atari/atari/locore.s 2022/03/16 20:31:01 1.115
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.114 2019/05/03 01:08:28 tsutsui Exp $ */ 1/* $NetBSD: locore.s,v 1.115 2022/03/16 20:31:01 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1980, 1990 The Regents of the University of California. 5 * Copyright (c) 1980, 1990 The Regents of the University of California.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department. 10 * Science Department.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -769,27 +769,27 @@ ENTRY_NOPROFILE(lev7intr) @@ -769,27 +769,27 @@ ENTRY_NOPROFILE(lev7intr)
769 * (profiling, scheduling) and software interrupts (network, softclock). 769 * (profiling, scheduling) and software interrupts (network, softclock).
770 * We check for ASTs first, just like the VAX. To avoid excess overhead 770 * We check for ASTs first, just like the VAX. To avoid excess overhead
771 * the T_ASTFLT handling code will also check for software interrupts so we 771 * the T_ASTFLT handling code will also check for software interrupts so we
772 * do not have to do it here. After identifing that we need an AST we 772 * do not have to do it here. After identifing that we need an AST we
773 * drop the IPL to allow device interrupts. 773 * drop the IPL to allow device interrupts.
774 * 774 *
775 * This code is complicated by the fact that sendsig may have been called 775 * This code is complicated by the fact that sendsig may have been called
776 * necessitating a stack cleanup. A cleanup should only be needed at this 776 * necessitating a stack cleanup. A cleanup should only be needed at this
777 * point for coprocessor mid-instruction frames (type 9), but we also test 777 * point for coprocessor mid-instruction frames (type 9), but we also test
778 * for bus error frames (type 10 and 11). 778 * for bus error frames (type 10 and 11).
779 */ 779 */
780ASENTRY_NOPROFILE(rei) 780ASENTRY_NOPROFILE(rei)
781#ifdef DEBUG 781#ifdef DEBUG
782 tstl _C_LABEL(panicstr) | have we paniced? 782 tstl _C_LABEL(panicstr) | have we panicked?
783 jne Ldorte | yes, do not make matters worse 783 jne Ldorte | yes, do not make matters worse
784#endif 784#endif
785 tstl _C_LABEL(astpending) | AST pending? 785 tstl _C_LABEL(astpending) | AST pending?
786 jeq Lchksir | no, go check for SIR 786 jeq Lchksir | no, go check for SIR
787Lrei1: 787Lrei1:
788 btst #5,%sp@ | yes, are we returning to user mode? 788 btst #5,%sp@ | yes, are we returning to user mode?
789 jne Lchksir | no, go check for SIR 789 jne Lchksir | no, go check for SIR
790 movw #PSL_LOWIPL,%sr | lower SPL 790 movw #PSL_LOWIPL,%sr | lower SPL
791 clrl %sp@- | stack adjust 791 clrl %sp@- | stack adjust
792 moveml #0xFFFF,%sp@- | save all registers 792 moveml #0xFFFF,%sp@- | save all registers
793 movl %usp,%a1 | including 793 movl %usp,%a1 | including
794 movl %a1,%sp@(FR_SP) | the users SP 794 movl %a1,%sp@(FR_SP) | the users SP
795 clrl %sp@- | VA == none 795 clrl %sp@- | VA == none

cvs diff -r1.14 -r1.15 src/sys/arch/luna68k/stand/boot/locore.S (expand / switch to unified diff)

--- src/sys/arch/luna68k/stand/boot/locore.S 2018/09/28 04:34:02 1.14
+++ src/sys/arch/luna68k/stand/boot/locore.S 2022/03/16 20:31:01 1.15
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.S,v 1.14 2018/09/28 04:34:02 isaki Exp $ */ 1/* $NetBSD: locore.S,v 1.15 2022/03/16 20:31:01 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992 OMRON Corporation. 4 * Copyright (c) 1992 OMRON Corporation.
5 * 5 *
6 * This code is derived from software contributed to Berkeley by 6 * This code is derived from software contributed to Berkeley by
7 * OMRON Corporation. 7 * OMRON Corporation.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -539,27 +539,27 @@ ENTRY_NOPROFILE(lev6intr) @@ -539,27 +539,27 @@ ENTRY_NOPROFILE(lev6intr)
539 * We check for ASTs first, just like the VAX. To avoid excess overhead 539 * We check for ASTs first, just like the VAX. To avoid excess overhead
540 * the T_ASTFLT handling code will also check for software interrupts so we 540 * the T_ASTFLT handling code will also check for software interrupts so we
541 * do not have to do it here. 541 * do not have to do it here.
542 * 542 *
543 * This code is complicated by the fact that sendsig may have been called 543 * This code is complicated by the fact that sendsig may have been called
544 * necessitating a stack cleanup. A cleanup should only be needed at this 544 * necessitating a stack cleanup. A cleanup should only be needed at this
545 * point for coprocessor mid-instruction frames (type 9), but we also test 545 * point for coprocessor mid-instruction frames (type 9), but we also test
546 * for bus error frames (type 10 and 11). 546 * for bus error frames (type 10 and 11).
547 */ 547 */
548#if 0 548#if 0
549 .comm _ssir,1 549 .comm _ssir,1
550ASENTRY_NOPROFILE(rei) 550ASENTRY_NOPROFILE(rei)
551#ifdef DEBUG 551#ifdef DEBUG
552 tstl _C_LABEL(panicstr) | have we paniced? 552 tstl _C_LABEL(panicstr) | have we panicked?
553 jne Ldorte | yes, do not make matters worse 553 jne Ldorte | yes, do not make matters worse
554#endif 554#endif
555 btst #PCB_ASTB,_u+PCB_FLAGS+1| AST pending? 555 btst #PCB_ASTB,_u+PCB_FLAGS+1| AST pending?
556 jeq Lchksir | no, go check for SIR 556 jeq Lchksir | no, go check for SIR
557 btst #5,%sp@ | yes, are we returning to user mode? 557 btst #5,%sp@ | yes, are we returning to user mode?
558 jne Lchksir | no, go check for SIR 558 jne Lchksir | no, go check for SIR
559 clrw %sp@- | pad SR to longword 559 clrw %sp@- | pad SR to longword
560 moveml #0xFFFF,%sp@- | save all registers 560 moveml #0xFFFF,%sp@- | save all registers
561 movl %usp,%a1 | including 561 movl %usp,%a1 | including
562 movl %a1,%sp@(60) | the users SP 562 movl %a1,%sp@(60) | the users SP
563 clrl %sp@- | VA == none 563 clrl %sp@- | VA == none
564 clrl %sp@- | code == none 564 clrl %sp@- | code == none
565 movl #T_ASTFLT,%sp@- | type == async system trap 565 movl #T_ASTFLT,%sp@- | type == async system trap

cvs diff -r1.66 -r1.67 src/sys/arch/next68k/dev/mb8795.c (expand / switch to unified diff)

--- src/sys/arch/next68k/dev/mb8795.c 2020/01/29 05:31:10 1.66
+++ src/sys/arch/next68k/dev/mb8795.c 2022/03/16 20:31:01 1.67
@@ -1,41 +1,41 @@ @@ -1,41 +1,41 @@
1/* $NetBSD: mb8795.c,v 1.66 2020/01/29 05:31:10 thorpej Exp $ */ 1/* $NetBSD: mb8795.c,v 1.67 2022/03/16 20:31:01 andvar Exp $ */
2/* 2/*
3 * Copyright (c) 1998 Darrin B. Jewell 3 * Copyright (c) 1998 Darrin B. Jewell
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright 11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the 12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution. 13 * documentation and/or other materials provided with the distribution.
14 * 14 *
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 */ 25 */
26 26
27#include <sys/cdefs.h> 27#include <sys/cdefs.h>
28__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.66 2020/01/29 05:31:10 thorpej Exp $"); 28__KERNEL_RCSID(0, "$NetBSD: mb8795.c,v 1.67 2022/03/16 20:31:01 andvar Exp $");
29 29
30#include "opt_inet.h" 30#include "opt_inet.h"
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/systm.h> 33#include <sys/systm.h>
34#include <sys/mbuf.h> 34#include <sys/mbuf.h>
35#include <sys/syslog.h> 35#include <sys/syslog.h>
36#include <sys/socket.h> 36#include <sys/socket.h>
37#include <sys/device.h> 37#include <sys/device.h>
38#include <sys/malloc.h> 38#include <sys/malloc.h>
39#include <sys/ioctl.h> 39#include <sys/ioctl.h>
40#include <sys/errno.h> 40#include <sys/errno.h>
41#include <sys/rndsource.h> 41#include <sys/rndsource.h>
@@ -506,27 +506,27 @@ mb8795_init(struct mb8795_softc *sc) @@ -506,27 +506,27 @@ mb8795_init(struct mb8795_softc *sc)
506 506
507 s = spldma(); 507 s = spldma();
508 if ((ifp->if_flags & IFF_RUNNING) == 0) 508 if ((ifp->if_flags & IFF_RUNNING) == 0)
509 mb8795_reset(sc); 509 mb8795_reset(sc);
510 510
511 if (ifp->if_flags & IFF_PROMISC) 511 if (ifp->if_flags & IFF_PROMISC)
512 rxmode = MB8795_RXMODE_PROMISCUOUS; 512 rxmode = MB8795_RXMODE_PROMISCUOUS;
513 else 513 else
514 rxmode = MB8795_RXMODE_NORMAL; 514 rxmode = MB8795_RXMODE_NORMAL;
515 /* XXX add support for multicast */ 515 /* XXX add support for multicast */
516 if (turbo) 516 if (turbo)
517 rxmode |= MB8795_RXMODE_TEST; 517 rxmode |= MB8795_RXMODE_TEST;
518 518
519 /* switching mode probably borken now with turbo */ 519 /* switching mode probably broken now with turbo */
520 MB_WRITE_REG(sc, MB8795_TXMODE, 520 MB_WRITE_REG(sc, MB8795_TXMODE,
521 turbo ? MB8795_TXMODE_TURBO1 : MB8795_TXMODE_LB_DISABLE); 521 turbo ? MB8795_TXMODE_TURBO1 : MB8795_TXMODE_LB_DISABLE);
522 MB_WRITE_REG(sc, MB8795_RXMODE, rxmode); 522 MB_WRITE_REG(sc, MB8795_RXMODE, rxmode);
523 523
524 if ((ifp->if_flags & IFF_RUNNING) == 0) { 524 if ((ifp->if_flags & IFF_RUNNING) == 0) {
525 MBDMA_RX_SETUP(sc); 525 MBDMA_RX_SETUP(sc);
526 MBDMA_TX_SETUP(sc); 526 MBDMA_TX_SETUP(sc);
527 527
528 ifp->if_flags |= IFF_RUNNING; 528 ifp->if_flags |= IFF_RUNNING;
529 ifp->if_flags &= ~IFF_OACTIVE; 529 ifp->if_flags &= ~IFF_OACTIVE;
530 ifp->if_timer = 0; 530 ifp->if_timer = 0;
531 531
532 MBDMA_RX_GO(sc); 532 MBDMA_RX_GO(sc);
@@ -708,27 +708,27 @@ mb8795_start_dma(struct mb8795_softc *sc @@ -708,27 +708,27 @@ mb8795_start_dma(struct mb8795_softc *sc
708{ 708{
709 struct ifnet *ifp = &sc->sc_ethercom.ec_if; 709 struct ifnet *ifp = &sc->sc_ethercom.ec_if;
710 struct mbuf *m; 710 struct mbuf *m;
711 u_char txmask; 711 u_char txmask;
712 712
713 DPRINTF(("%s: mb8795_start_dma()\n", device_xname(sc->sc_dev))); 713 DPRINTF(("%s: mb8795_start_dma()\n", device_xname(sc->sc_dev)));
714 714
715#if (defined(DIAGNOSTIC)) 715#if (defined(DIAGNOSTIC))
716 { 716 {
717 u_char txstat; 717 u_char txstat;
718 txstat = MB_READ_REG(sc, MB8795_TXSTAT); 718 txstat = MB_READ_REG(sc, MB8795_TXSTAT);
719 if (!turbo && !(txstat & MB8795_TXSTAT_READY)) { 719 if (!turbo && !(txstat & MB8795_TXSTAT_READY)) {
720 /* 720 /*
721 * @@@ I used to panic here, but then it paniced once. 721 * @@@ I used to panic here, but then it panicked once.
722 * Let's see if I can just reset instead. 722 * Let's see if I can just reset instead.
723 * [ dbj 980706.1900 ] 723 * [ dbj 980706.1900 ]
724 */ 724 */
725 printf("%s: transmitter not ready\n", 725 printf("%s: transmitter not ready\n",
726 device_xname(sc->sc_dev)); 726 device_xname(sc->sc_dev));
727 ifp->if_flags &= ~IFF_RUNNING; 727 ifp->if_flags &= ~IFF_RUNNING;
728 mb8795_init(sc); 728 mb8795_init(sc);
729 return; 729 return;
730 } 730 }
731 } 731 }
732#endif 732#endif
733 733
734#if 0 734#if 0

cvs diff -r1.45 -r1.46 src/sys/arch/powerpc/booke/e500_intr.c (expand / switch to unified diff)

--- src/sys/arch/powerpc/booke/e500_intr.c 2021/09/11 20:28:04 1.45
+++ src/sys/arch/powerpc/booke/e500_intr.c 2022/03/16 20:31:01 1.46
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: e500_intr.c,v 1.45 2021/09/11 20:28:04 andvar Exp $ */ 1/* $NetBSD: e500_intr.c,v 1.46 2022/03/16 20:31:01 andvar Exp $ */
2/*- 2/*-
3 * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc. 3 * Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
4 * All rights reserved. 4 * All rights reserved.
5 * 5 *
6 * This code is derived from software contributed to The NetBSD Foundation 6 * This code is derived from software contributed to The NetBSD Foundation
7 * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects 7 * by Raytheon BBN Technologies Corp and Defense Advanced Research Projects
8 * Agency and which was developed by Matt Thomas of 3am Software Foundry. 8 * Agency and which was developed by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * This material is based upon work supported by the Defense Advanced Research 10 * This material is based upon work supported by the Defense Advanced Research
11 * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under 11 * Projects Agency and Space and Naval Warfare Systems Center, Pacific, under
12 * Contract No. N66001-09-C-2073. 12 * Contract No. N66001-09-C-2073.
13 * Approved for Public Release, Distribution Unlimited 13 * Approved for Public Release, Distribution Unlimited
14 * 14 *
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 27 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE. 34 * POSSIBILITY OF SUCH DAMAGE.
35 */ 35 */
36 36
37#define __INTR_PRIVATE 37#define __INTR_PRIVATE
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.45 2021/09/11 20:28:04 andvar Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: e500_intr.c,v 1.46 2022/03/16 20:31:01 andvar Exp $");
41 41
42#ifdef _KERNEL_OPT 42#ifdef _KERNEL_OPT
43#include "opt_mpc85xx.h" 43#include "opt_mpc85xx.h"
44#include "opt_multiprocessor.h" 44#include "opt_multiprocessor.h"
45#endif 45#endif
46 46
47#include <sys/param.h> 47#include <sys/param.h>
48#include <sys/proc.h> 48#include <sys/proc.h>
49#include <sys/intr.h> 49#include <sys/intr.h>
50#include <sys/cpu.h> 50#include <sys/cpu.h>
51#include <sys/kmem.h> 51#include <sys/kmem.h>
52#include <sys/atomic.h> 52#include <sys/atomic.h>
53#include <sys/bus.h> 53#include <sys/bus.h>
@@ -541,27 +541,27 @@ e500_spl0(void) @@ -541,27 +541,27 @@ e500_spl0(void)
541 } 541 }
542#endif /* __HAVE_FAST_SOFTINTS */ 542#endif /* __HAVE_FAST_SOFTINTS */
543 e500_splset(ci, IPL_NONE); 543 e500_splset(ci, IPL_NONE);
544 544
545 wrtee(PSL_EE); 545 wrtee(PSL_EE);
546} 546}
547 547
548static void 548static void
549e500_splx(int ipl) 549e500_splx(int ipl)
550{ 550{
551 struct cpu_info * const ci = curcpu(); 551 struct cpu_info * const ci = curcpu();
552 const int old_ipl = ci->ci_cpl; 552 const int old_ipl = ci->ci_cpl;
553 553
554 /* if we paniced because of watchdog, PSL_CE will be clear. */ 554 /* if we panicked because of watchdog, PSL_CE will be clear. */
555 KASSERT(wdog_barked || (mfmsr() & PSL_CE)); 555 KASSERT(wdog_barked || (mfmsr() & PSL_CE));
556 556
557 if (ipl == old_ipl) 557 if (ipl == old_ipl)
558 return; 558 return;
559 559
560 if (__predict_false(ipl > old_ipl)) { 560 if (__predict_false(ipl > old_ipl)) {
561 printf("%s: %p: cpl=%u: ignoring splx(%u) to raise ipl\n", 561 printf("%s: %p: cpl=%u: ignoring splx(%u) to raise ipl\n",
562 __func__, __builtin_return_address(0), old_ipl, ipl); 562 __func__, __builtin_return_address(0), old_ipl, ipl);
563 if (old_ipl == IPL_NONE) 563 if (old_ipl == IPL_NONE)
564 Debugger(); 564 Debugger();
565 } 565 }
566 566
567 // const 567 // const
@@ -580,27 +580,27 @@ e500_splx(int ipl) @@ -580,27 +580,27 @@ e500_splx(int ipl)
580#if 1 580#if 1
581 if (ipl < IPL_VM && old_ipl >= IPL_VM) 581 if (ipl < IPL_VM && old_ipl >= IPL_VM)
582 msr = PSL_EE; 582 msr = PSL_EE;
583#endif 583#endif
584 wrtee(msr); 584 wrtee(msr);
585} 585}
586 586
587static int 587static int
588e500_splraise(int ipl) 588e500_splraise(int ipl)
589{ 589{
590 struct cpu_info * const ci = curcpu(); 590 struct cpu_info * const ci = curcpu();
591 const int old_ipl = ci->ci_cpl; 591 const int old_ipl = ci->ci_cpl;
592 592
593 /* if we paniced because of watchdog, PSL_CE will be clear. */ 593 /* if we panicked because of watchdog, PSL_CE will be clear. */
594 KASSERT(wdog_barked || (mfmsr() & PSL_CE)); 594 KASSERT(wdog_barked || (mfmsr() & PSL_CE));
595 595
596 if (old_ipl < ipl) { 596 if (old_ipl < ipl) {
597 //const 597 //const
598 register_t msr = wrtee(0); 598 register_t msr = wrtee(0);
599 e500_splset(ci, ipl); 599 e500_splset(ci, ipl);
600#if 0 600#if 0
601 if (old_ipl < IPL_VM && ipl >= IPL_VM) 601 if (old_ipl < IPL_VM && ipl >= IPL_VM)
602 msr = 0; 602 msr = 0;
603#endif 603#endif
604 wrtee(msr); 604 wrtee(msr);
605 } 605 }
606#if 0 606#if 0
@@ -928,27 +928,27 @@ e500_wdogintr(struct trapframe *tf) @@ -928,27 +928,27 @@ e500_wdogintr(struct trapframe *tf)
928 panic("%s: tf=%p tb=%"PRId64" srr0/srr1=%#lx/%#lx" 928 panic("%s: tf=%p tb=%"PRId64" srr0/srr1=%#lx/%#lx"
929 " cpl=%d idepth=%d, mtxcount=%d", 929 " cpl=%d idepth=%d, mtxcount=%d",
930 __func__, tf, mftb(), tf->tf_srr0, tf->tf_srr1, 930 __func__, tf, mftb(), tf->tf_srr0, tf->tf_srr1,
931 ci->ci_cpl, ci->ci_idepth, ci->ci_mtx_count); 931 ci->ci_cpl, ci->ci_idepth, ci->ci_mtx_count);
932} 932}
933 933
934static void 934static void
935e500_extintr(struct trapframe *tf) 935e500_extintr(struct trapframe *tf)
936{ 936{
937 struct cpu_info * const ci = curcpu(); 937 struct cpu_info * const ci = curcpu();
938 struct cpu_softc * const cpu = ci->ci_softc; 938 struct cpu_softc * const cpu = ci->ci_softc;
939 const int old_ipl = ci->ci_cpl; 939 const int old_ipl = ci->ci_cpl;
940 940
941 /* if we paniced because of watchdog, PSL_CE will be clear. */ 941 /* if we panicked because of watchdog, PSL_CE will be clear. */
942 KASSERT(wdog_barked || (mfmsr() & PSL_CE)); 942 KASSERT(wdog_barked || (mfmsr() & PSL_CE));
943 943
944#if 0 944#if 0
945// printf("%s(%p): idepth=%d enter\n", __func__, tf, ci->ci_idepth); 945// printf("%s(%p): idepth=%d enter\n", __func__, tf, ci->ci_idepth);
946 if ((register_t)tf >= (register_t)curlwp->l_addr + USPACE  946 if ((register_t)tf >= (register_t)curlwp->l_addr + USPACE
947 || (register_t)tf < (register_t)curlwp->l_addr + NBPG) {  947 || (register_t)tf < (register_t)curlwp->l_addr + NBPG) {
948 printf("%s(entry): pid %d.%d (%s): srr0/srr1=%#lx/%#lx: invalid tf addr %p\n",  948 printf("%s(entry): pid %d.%d (%s): srr0/srr1=%#lx/%#lx: invalid tf addr %p\n",
949 __func__, curlwp->l_proc->p_pid, curlwp->l_lid, 949 __func__, curlwp->l_proc->p_pid, curlwp->l_lid,
950 curlwp->l_proc->p_comm, tf->tf_srr0, tf->tf_srr1, tf); 950 curlwp->l_proc->p_comm, tf->tf_srr0, tf->tf_srr1, tf);
951 }  951 }
952#endif 952#endif
953 953
954 954

cvs diff -r1.48 -r1.49 src/sys/arch/sparc64/sparc64/ofw_machdep.c (expand / switch to unified diff)

--- src/sys/arch/sparc64/sparc64/ofw_machdep.c 2022/01/10 20:14:54 1.48
+++ src/sys/arch/sparc64/sparc64/ofw_machdep.c 2022/03/16 20:31:02 1.49
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ofw_machdep.c,v 1.48 2022/01/10 20:14:54 palle Exp $ */ 1/* $NetBSD: ofw_machdep.c,v 1.49 2022/03/16 20:31:02 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1996 Wolfgang Solfrank. 4 * Copyright (C) 1996 Wolfgang Solfrank.
5 * Copyright (C) 1996 TooLs GmbH. 5 * Copyright (C) 1996 TooLs GmbH.
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
11 * 1. Redistributions of source code must retain the above copyright 11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer. 12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright 13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the 14 * notice, this list of conditions and the following disclaimer in the
@@ -24,27 +24,27 @@ @@ -24,27 +24,27 @@
24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 27 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 28 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 29 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 30 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#include "opt_multiprocessor.h" 34#include "opt_multiprocessor.h"
35 35
36#include <sys/cdefs.h> 36#include <sys/cdefs.h>
37__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.48 2022/01/10 20:14:54 palle Exp $"); 37__KERNEL_RCSID(0, "$NetBSD: ofw_machdep.c,v 1.49 2022/03/16 20:31:02 andvar Exp $");
38 38
39#include <sys/param.h> 39#include <sys/param.h>
40#include <sys/buf.h> 40#include <sys/buf.h>
41#include <sys/conf.h> 41#include <sys/conf.h>
42#include <sys/device.h> 42#include <sys/device.h>
43#include <sys/disk.h> 43#include <sys/disk.h>
44#include <sys/disklabel.h> 44#include <sys/disklabel.h>
45#include <sys/fcntl.h> 45#include <sys/fcntl.h>
46#include <sys/ioctl.h> 46#include <sys/ioctl.h>
47#include <sys/kprintf.h> 47#include <sys/kprintf.h>
48#include <sys/malloc.h> 48#include <sys/malloc.h>
49#include <sys/stat.h> 49#include <sys/stat.h>
50#include <sys/systm.h> 50#include <sys/systm.h>
@@ -826,27 +826,27 @@ OF_mapintr(int node, int *interrupt, int @@ -826,27 +826,27 @@ OF_mapintr(int node, int *interrupt, int
826 && !strcmp(model, "SUNW,psycho")) { 826 && !strcmp(model, "SUNW,psycho")) {
827 DPRINTF(("OF_mapintr: interrupt %x already mapped\n", 827 DPRINTF(("OF_mapintr: interrupt %x already mapped\n",
828 *interrupt)); 828 *interrupt));
829 return validlen; 829 return validlen;
830 } 830 }
831 } 831 }
832 832
833 /* 833 /*
834 * If there is no interrupt map in the bus node, we  834 * If there is no interrupt map in the bus node, we
835 * need to convert the slot address to its parent 835 * need to convert the slot address to its parent
836 * bus format, and hunt up the parent bus to see if 836 * bus format, and hunt up the parent bus to see if
837 * we need to remap. 837 * we need to remap.
838 * 838 *
839 * The specification for interrupt mapping is borken. 839 * The specification for interrupt mapping is broken.
840 * You are supposed to query the interrupt parent in 840 * You are supposed to query the interrupt parent in
841 * the interrupt-map specification to determine the 841 * the interrupt-map specification to determine the
842 * number of address and interrupt cells, but we need 842 * number of address and interrupt cells, but we need
843 * to know how many address and interrupt cells to skip 843 * to know how many address and interrupt cells to skip
844 * to find the phandle... 844 * to find the phandle...
845 * 845 *
846 */ 846 */
847 if ((len = OF_getprop(node, "reg", &reg, sizeof(reg))) <= 0) { 847 if ((len = OF_getprop(node, "reg", &reg, sizeof(reg))) <= 0) {
848 printf("OF_mapintr: no reg property?\n"); 848 printf("OF_mapintr: no reg property?\n");
849 return (-1); 849 return (-1);
850 } 850 }
851 851
852 while (node) { 852 while (node) {

cvs diff -r1.28 -r1.29 src/sys/arch/sun2/sun2/locore.s (expand / switch to unified diff)

--- src/sys/arch/sun2/sun2/locore.s 2021/03/31 09:48:15 1.28
+++ src/sys/arch/sun2/sun2/locore.s 2022/03/16 20:31:02 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.28 2021/03/31 09:48:15 simonb Exp $ */ 1/* $NetBSD: locore.s,v 1.29 2022/03/16 20:31:02 andvar 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
@@ -468,27 +468,27 @@ GLOBAL(eintrcnt) @@ -468,27 +468,27 @@ GLOBAL(eintrcnt)
468 * This code deals with checking for and servicing ASTs 468 * This code deals with checking for and servicing ASTs
469 * (profiling, scheduling) and software interrupts (network, softclock). 469 * (profiling, scheduling) and software interrupts (network, softclock).
470 * We check for ASTs first, just like the VAX. To avoid excess overhead 470 * We check for ASTs first, just like the VAX. To avoid excess overhead
471 * the T_ASTFLT handling code will also check for software interrupts so we 471 * the T_ASTFLT handling code will also check for software interrupts so we
472 * do not have to do it here. After identifying that we need an AST we 472 * do not have to do it here. After identifying that we need an AST we
473 * drop the IPL to allow device interrupts. 473 * drop the IPL to allow device interrupts.
474 * 474 *
475 * This code is complicated by the fact that sendsig may have been called 475 * This code is complicated by the fact that sendsig may have been called
476 * necessitating a stack cleanup. 476 * necessitating a stack cleanup.
477 */ 477 */
478 478
479ASGLOBAL(rei) 479ASGLOBAL(rei)
480#ifdef DIAGNOSTIC 480#ifdef DIAGNOSTIC
481 tstl _C_LABEL(panicstr) | have we paniced? 481 tstl _C_LABEL(panicstr) | have we panicked?
482 jne Ldorte | yes, do not make matters worse 482 jne Ldorte | yes, do not make matters worse
483#endif 483#endif
484 tstl _C_LABEL(astpending) | AST pending? 484 tstl _C_LABEL(astpending) | AST pending?
485 jeq Ldorte | no, done 485 jeq Ldorte | no, done
486Lrei1: 486Lrei1:
487 btst #5,%sp@ | yes, are we returning to user mode? 487 btst #5,%sp@ | yes, are we returning to user mode?
488 jne Ldorte | no, done 488 jne Ldorte | no, done
489 movw #PSL_LOWIPL,%sr | lower SPL 489 movw #PSL_LOWIPL,%sr | lower SPL
490 clrl %sp@- | stack adjust 490 clrl %sp@- | stack adjust
491 moveml #0xFFFF,%sp@- | save all registers 491 moveml #0xFFFF,%sp@- | save all registers
492 movl %usp,%a1 | including 492 movl %usp,%a1 | including
493 movl %a1,%sp@(FR_SP) | the users SP 493 movl %a1,%sp@(FR_SP) | the users SP
494 clrl %sp@- | VA == none 494 clrl %sp@- | VA == none

cvs diff -r1.100 -r1.101 src/sys/arch/sun3/sun3/locore.s (expand / switch to unified diff)

--- src/sys/arch/sun3/sun3/locore.s 2021/03/31 09:48:15 1.100
+++ src/sys/arch/sun3/sun3/locore.s 2022/03/16 20:31:02 1.101
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.100 2021/03/31 09:48:15 simonb Exp $ */ 1/* $NetBSD: locore.s,v 1.101 2022/03/16 20:31:02 andvar 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
@@ -514,27 +514,27 @@ GLOBAL(eintrcnt) @@ -514,27 +514,27 @@ GLOBAL(eintrcnt)
514 * This code deals with checking for and servicing ASTs 514 * This code deals with checking for and servicing ASTs
515 * (profiling, scheduling) and software interrupts (network, softclock). 515 * (profiling, scheduling) and software interrupts (network, softclock).
516 * We check for ASTs first, just like the VAX. To avoid excess overhead 516 * We check for ASTs first, just like the VAX. To avoid excess overhead
517 * the T_ASTFLT handling code will also check for software interrupts so we 517 * the T_ASTFLT handling code will also check for software interrupts so we
518 * do not have to do it here. After identifying that we need an AST we 518 * do not have to do it here. After identifying that we need an AST we
519 * drop the IPL to allow device interrupts. 519 * drop the IPL to allow device interrupts.
520 * 520 *
521 * This code is complicated by the fact that sendsig may have been called 521 * This code is complicated by the fact that sendsig may have been called
522 * necessitating a stack cleanup. 522 * necessitating a stack cleanup.
523 */ 523 */
524 524
525ASGLOBAL(rei) 525ASGLOBAL(rei)
526#ifdef DIAGNOSTIC 526#ifdef DIAGNOSTIC
527 tstl _C_LABEL(panicstr) | have we paniced? 527 tstl _C_LABEL(panicstr) | have we panicked?
528 jne Ldorte | yes, do not make matters worse 528 jne Ldorte | yes, do not make matters worse
529#endif 529#endif
530 tstl _C_LABEL(astpending) | AST pending? 530 tstl _C_LABEL(astpending) | AST pending?
531 jeq Ldorte | no, done 531 jeq Ldorte | no, done
532Lrei1: 532Lrei1:
533 btst #5,%sp@ | yes, are we returning to user mode? 533 btst #5,%sp@ | yes, are we returning to user mode?
534 jne Ldorte | no, done 534 jne Ldorte | no, done
535 movw #PSL_LOWIPL,%sr | lower SPL 535 movw #PSL_LOWIPL,%sr | lower SPL
536 clrl %sp@- | stack adjust 536 clrl %sp@- | stack adjust
537 moveml #0xFFFF,%sp@- | save all registers 537 moveml #0xFFFF,%sp@- | save all registers
538 movl %usp,%a1 | including 538 movl %usp,%a1 | including
539 movl %a1,%sp@(FR_SP) | the users SP 539 movl %a1,%sp@(FR_SP) | the users SP
540 clrl %sp@- | VA == none 540 clrl %sp@- | VA == none

cvs diff -r1.68 -r1.69 src/sys/arch/sun3/sun3x/locore.s (expand / switch to unified diff)

--- src/sys/arch/sun3/sun3x/locore.s 2021/03/31 09:48:15 1.68
+++ src/sys/arch/sun3/sun3x/locore.s 2022/03/16 20:31:02 1.69
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.68 2021/03/31 09:48:15 simonb Exp $ */ 1/* $NetBSD: locore.s,v 1.69 2022/03/16 20:31:02 andvar Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1980, 1990, 1993 5 * Copyright (c) 1980, 1990, 1993
6 * The Regents of the University of California. All rights reserved. 6 * The Regents of the University of California. All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department. 10 * Science Department.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -499,27 +499,27 @@ GLOBAL(eintrcnt) @@ -499,27 +499,27 @@ GLOBAL(eintrcnt)
499 * This code deals with checking for and servicing ASTs 499 * This code deals with checking for and servicing ASTs
500 * (profiling, scheduling) and software interrupts (network, softclock). 500 * (profiling, scheduling) and software interrupts (network, softclock).
501 * We check for ASTs first, just like the VAX. To avoid excess overhead 501 * We check for ASTs first, just like the VAX. To avoid excess overhead
502 * the T_ASTFLT handling code will also check for software interrupts so we 502 * the T_ASTFLT handling code will also check for software interrupts so we
503 * do not have to do it here. After identifying that we need an AST we 503 * do not have to do it here. After identifying that we need an AST we
504 * drop the IPL to allow device interrupts. 504 * drop the IPL to allow device interrupts.
505 * 505 *
506 * This code is complicated by the fact that sendsig may have been called 506 * This code is complicated by the fact that sendsig may have been called
507 * necessitating a stack cleanup. 507 * necessitating a stack cleanup.
508 */ 508 */
509 509
510ASGLOBAL(rei) 510ASGLOBAL(rei)
511#ifdef DIAGNOSTIC 511#ifdef DIAGNOSTIC
512 tstl _C_LABEL(panicstr) | have we paniced? 512 tstl _C_LABEL(panicstr) | have we panicked?
513 jne Ldorte | yes, do not make matters worse 513 jne Ldorte | yes, do not make matters worse
514#endif 514#endif
515 tstl _C_LABEL(astpending) | AST pending? 515 tstl _C_LABEL(astpending) | AST pending?
516 jeq Ldorte | no, done 516 jeq Ldorte | no, done
517Lrei1: 517Lrei1:
518 btst #5,%sp@ | yes, are we returning to user mode? 518 btst #5,%sp@ | yes, are we returning to user mode?
519 jne Ldorte | no, done 519 jne Ldorte | no, done
520 movw #PSL_LOWIPL,%sr | lower SPL 520 movw #PSL_LOWIPL,%sr | lower SPL
521 clrl %sp@- | stack adjust 521 clrl %sp@- | stack adjust
522 moveml #0xFFFF,%sp@- | save all registers 522 moveml #0xFFFF,%sp@- | save all registers
523 movl %usp,%a1 | including 523 movl %usp,%a1 | including
524 movl %a1,%sp@(FR_SP) | the users SP 524 movl %a1,%sp@(FR_SP) | the users SP
525 clrl %sp@- | VA == none 525 clrl %sp@- | VA == none

cvs diff -r1.186 -r1.187 src/sys/kern/subr_prf.c (expand / switch to unified diff)

--- src/sys/kern/subr_prf.c 2021/03/10 13:27:51 1.186
+++ src/sys/kern/subr_prf.c 2022/03/16 20:31:02 1.187
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: subr_prf.c,v 1.186 2021/03/10 13:27:51 simonb Exp $ */ 1/* $NetBSD: subr_prf.c,v 1.187 2022/03/16 20:31:02 andvar Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1986, 1988, 1991, 1993 4 * Copyright (c) 1986, 1988, 1991, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc. 6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed 7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph 8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc. 10 * the permission of UNIX System Laboratories, Inc.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -27,27 +27,27 @@ @@ -27,27 +27,27 @@
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * @(#)subr_prf.c 8.4 (Berkeley) 5/4/95 36 * @(#)subr_prf.c 8.4 (Berkeley) 5/4/95
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.186 2021/03/10 13:27:51 simonb Exp $"); 40__KERNEL_RCSID(0, "$NetBSD: subr_prf.c,v 1.187 2022/03/16 20:31:02 andvar Exp $");
41 41
42#ifdef _KERNEL_OPT 42#ifdef _KERNEL_OPT
43#include "opt_ddb.h" 43#include "opt_ddb.h"
44#include "opt_kgdb.h" 44#include "opt_kgdb.h"
45#include "opt_dump.h" 45#include "opt_dump.h"
46#include "opt_rnd_printf.h" 46#include "opt_rnd_printf.h"
47#endif 47#endif
48 48
49#include <sys/param.h> 49#include <sys/param.h>
50#include <sys/stdint.h> 50#include <sys/stdint.h>
51#include <sys/systm.h> 51#include <sys/systm.h>
52#include <sys/buf.h> 52#include <sys/buf.h>
53#include <sys/device.h> 53#include <sys/device.h>
@@ -96,27 +96,27 @@ static bool kprintf_inited = false; @@ -96,27 +96,27 @@ static bool kprintf_inited = false;
96 */ 96 */
97 97
98static void putchar(int, int, struct tty *); 98static void putchar(int, int, struct tty *);
99 99
100 100
101/* 101/*
102 * globals 102 * globals
103 */ 103 */
104 104
105extern struct tty *constty; /* pointer to console "window" tty */ 105extern struct tty *constty; /* pointer to console "window" tty */
106extern int log_open; /* subr_log: is /dev/klog open? */ 106extern int log_open; /* subr_log: is /dev/klog open? */
107const char *panicstr; /* arg to first call to panic (used as a flag 107const char *panicstr; /* arg to first call to panic (used as a flag
108 to indicate that panic has already been called). */ 108 to indicate that panic has already been called). */
109struct cpu_info *paniccpu; /* cpu that first paniced */ 109struct cpu_info *paniccpu; /* cpu that first panicked */
110long panicstart, panicend; /* position in the msgbuf of the start and 110long panicstart, panicend; /* position in the msgbuf of the start and
111 end of the formatted panicstr. */ 111 end of the formatted panicstr. */
112int doing_shutdown; /* set to indicate shutdown in progress */ 112int doing_shutdown; /* set to indicate shutdown in progress */
113 113
114#ifdef RND_PRINTF 114#ifdef RND_PRINTF
115static krndsource_t rnd_printf_source; 115static krndsource_t rnd_printf_source;
116#endif 116#endif
117 117
118#ifndef DUMP_ON_PANIC 118#ifndef DUMP_ON_PANIC
119#define DUMP_ON_PANIC 1 119#define DUMP_ON_PANIC 1
120#endif 120#endif
121int dumponpanic = DUMP_ON_PANIC; 121int dumponpanic = DUMP_ON_PANIC;
122 122
@@ -214,27 +214,27 @@ void @@ -214,27 +214,27 @@ void
214vpanic(const char *fmt, va_list ap) 214vpanic(const char *fmt, va_list ap)
215{ 215{
216 CPU_INFO_ITERATOR cii; 216 CPU_INFO_ITERATOR cii;
217 struct cpu_info *ci, *oci; 217 struct cpu_info *ci, *oci;
218 int bootopt; 218 int bootopt;
219 static char scratchstr[384]; /* stores panic message */ 219 static char scratchstr[384]; /* stores panic message */
220 220
221 spldebug_stop(); 221 spldebug_stop();
222 222
223 if (lwp0.l_cpu && curlwp) { 223 if (lwp0.l_cpu && curlwp) {
224 /* 224 /*
225 * Disable preemption. If already panicing on another CPU, sit 225 * Disable preemption. If already panicing on another CPU, sit
226 * here and spin until the system is rebooted. Allow the CPU that 226 * here and spin until the system is rebooted. Allow the CPU that
227 * first paniced to panic again. 227 * first panicked to panic again.
228 */ 228 */
229 kpreempt_disable(); 229 kpreempt_disable();
230 ci = curcpu(); 230 ci = curcpu();
231 oci = atomic_cas_ptr((void *)&paniccpu, NULL, ci); 231 oci = atomic_cas_ptr((void *)&paniccpu, NULL, ci);
232 if (oci != NULL && oci != ci) { 232 if (oci != NULL && oci != ci) {
233 /* Give interrupts a chance to try and prevent deadlock. */ 233 /* Give interrupts a chance to try and prevent deadlock. */
234 for (;;) { 234 for (;;) {
235#ifndef _RUMPKERNEL /* XXXpooka: temporary build fix, see kern/40505 */ 235#ifndef _RUMPKERNEL /* XXXpooka: temporary build fix, see kern/40505 */
236 DELAY(10); 236 DELAY(10);
237#endif /* _RUMPKERNEL */ 237#endif /* _RUMPKERNEL */
238 } 238 }
239 } 239 }
240 240

cvs diff -r1.88 -r1.89 src/sys/kern/vfs_mount.c (expand / switch to unified diff)

--- src/sys/kern/vfs_mount.c 2022/03/12 15:32:32 1.88
+++ src/sys/kern/vfs_mount.c 2022/03/16 20:31:02 1.89
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vfs_mount.c,v 1.88 2022/03/12 15:32:32 riastradh Exp $ */ 1/* $NetBSD: vfs_mount.c,v 1.89 2022/03/16 20:31:02 andvar Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1997-2020 The NetBSD Foundation, Inc. 4 * Copyright (c) 1997-2020 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 of the Numerical Aerospace Simulation Facility, 8 * by Jason R. Thorpe of the Numerical Aerospace Simulation Facility,
9 * NASA Ames Research Center, by Charles M. Hannum, and by Andrew Doran. 9 * NASA Ames Research Center, by Charles M. Hannum, and by Andrew Doran.
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
@@ -57,27 +57,27 @@ @@ -57,27 +57,27 @@
57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 57 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 58 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 59 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 60 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 61 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE. 64 * SUCH DAMAGE.
65 * 65 *
66 * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 66 * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94
67 */ 67 */
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.88 2022/03/12 15:32:32 riastradh Exp $"); 70__KERNEL_RCSID(0, "$NetBSD: vfs_mount.c,v 1.89 2022/03/16 20:31:02 andvar Exp $");
71 71
72#include <sys/param.h> 72#include <sys/param.h>
73#include <sys/kernel.h> 73#include <sys/kernel.h>
74 74
75#include <sys/atomic.h> 75#include <sys/atomic.h>
76#include <sys/buf.h> 76#include <sys/buf.h>
77#include <sys/conf.h> 77#include <sys/conf.h>
78#include <sys/fcntl.h> 78#include <sys/fcntl.h>
79#include <sys/filedesc.h> 79#include <sys/filedesc.h>
80#include <sys/device.h> 80#include <sys/device.h>
81#include <sys/kauth.h> 81#include <sys/kauth.h>
82#include <sys/kmem.h> 82#include <sys/kmem.h>
83#include <sys/module.h> 83#include <sys/module.h>
@@ -1100,27 +1100,27 @@ vfs_sync_all(struct lwp *l) @@ -1100,27 +1100,27 @@ vfs_sync_all(struct lwp *l)
1100} 1100}
1101 1101
1102/* 1102/*
1103 * Sync and unmount file systems before shutting down. 1103 * Sync and unmount file systems before shutting down.
1104 */ 1104 */
1105void 1105void
1106vfs_shutdown(void) 1106vfs_shutdown(void)
1107{ 1107{
1108 lwp_t *l = curlwp; 1108 lwp_t *l = curlwp;
1109 1109
1110 vfs_sync_all(l); 1110 vfs_sync_all(l);
1111 1111
1112 /* 1112 /*
1113 * If we have paniced - do not make the situation potentially 1113 * If we have panicked - do not make the situation potentially
1114 * worse by unmounting the file systems. 1114 * worse by unmounting the file systems.
1115 */ 1115 */
1116 if (panicstr != NULL) { 1116 if (panicstr != NULL) {
1117 return; 1117 return;
1118 } 1118 }
1119 1119
1120 /* Unmount file systems. */ 1120 /* Unmount file systems. */
1121 vfs_unmountall(l); 1121 vfs_unmountall(l);
1122} 1122}
1123 1123
1124/* 1124/*
1125 * Print a list of supported file system types (used by vfs_mountroot) 1125 * Print a list of supported file system types (used by vfs_mountroot)
1126 */ 1126 */