Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/alpha The Alpha AXP Architecture Reference Manual i...



details:   https://anonhg.NetBSD.org/src/rev/115a9202c459
branches:  trunk
changeset: 984686:115a9202c459
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Jul 16 19:02:22 2021 +0000

description:
The Alpha AXP Architecture Reference Manual is explcit that the only
valid bits in the PSL are the IPL and USER bits, the latter of which
will always be clear when in the kernel, and that all other bits MBZ.
So, when reading the PSL to get the current IPL, don't bother masking
with ALPHA_PSL_IPL_MASK.

diffstat:

 sys/arch/alpha/alpha/interrupt.c |  11 +++++------
 sys/arch/alpha/alpha/pmap.c      |   8 ++++----
 sys/arch/alpha/include/intr.h    |   4 ++--
 3 files changed, 11 insertions(+), 12 deletions(-)

diffs (100 lines):

diff -r e802d307887d -r 115a9202c459 sys/arch/alpha/alpha/interrupt.c
--- a/sys/arch/alpha/alpha/interrupt.c  Fri Jul 16 18:50:19 2021 +0000
+++ b/sys/arch/alpha/alpha/interrupt.c  Fri Jul 16 19:02:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: interrupt.c,v 1.98 2021/07/04 22:42:35 thorpej Exp $ */
+/* $NetBSD: interrupt.c,v 1.99 2021/07/16 19:02:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -65,7 +65,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.98 2021/07/04 22:42:35 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.99 2021/07/16 19:02:22 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -502,7 +502,7 @@
 softint_trigger(uintptr_t const machdep)
 {
        /* No need for an atomic; called at splhigh(). */
-       KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) == ALPHA_PSL_IPL_HIGH);
+       KASSERT(alpha_pal_rdps() == ALPHA_PSL_IPL_HIGH);
        curcpu()->ci_ssir |= machdep;
 }
 
@@ -534,8 +534,7 @@
                ci->ci_ssir &= ~SOFTINT_##level##_MASK;                 \
                alpha_softint_switchto(l, IPL_SOFT##level,              \
                    ci->ci_silwps[SOFTINT_##level]);                    \
-               KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) ==      \
-                   ALPHA_PSL_IPL_HIGH);                                \
+               KASSERT(alpha_pal_rdps() == ALPHA_PSL_IPL_HIGH);        \
                continue;                                               \
        }                                                               \
 
@@ -553,7 +552,7 @@
        unsigned long ssir;
        const unsigned long eligible = SOFTINTS_ELIGIBLE(ipl);
 
-       KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) == ALPHA_PSL_IPL_HIGH);
+       KASSERT(alpha_pal_rdps() == ALPHA_PSL_IPL_HIGH);
 
        for (;;) {
                ssir = ci->ci_ssir & eligible;
diff -r e802d307887d -r 115a9202c459 sys/arch/alpha/alpha/pmap.c
--- a/sys/arch/alpha/alpha/pmap.c       Fri Jul 16 18:50:19 2021 +0000
+++ b/sys/arch/alpha/alpha/pmap.c       Fri Jul 16 19:02:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.297 2021/07/10 20:22:37 thorpej Exp $ */
+/* $NetBSD: pmap.c,v 1.298 2021/07/16 19:02:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008, 2020
@@ -135,7 +135,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.297 2021/07/10 20:22:37 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.298 2021/07/16 19:02:22 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1027,7 +1027,7 @@
         * interrupts and disable preemption.  It is critically important
         * that IPIs not be blocked in this routine.
         */
-       KASSERT((alpha_pal_rdps() & ALPHA_PSL_IPL_MASK) < ALPHA_PSL_IPL_CLOCK);
+       KASSERT(alpha_pal_rdps() < ALPHA_PSL_IPL_CLOCK);
        mutex_spin_enter(&tlb_lock);
        tlb_evcnt.ev_count++;
 
@@ -1121,7 +1121,7 @@
                                    tlb_pending);
                                printf("TLB CONTEXT = %p\n", tlb_context);
                                printf("TLB LOCAL IPL = %lu\n",
-                                   alpha_pal_rdps() & ALPHA_PSL_IPL_MASK);
+                                   alpha_pal_rdps());
                                panic("pmap_tlb_shootnow");
                        }
                }
diff -r e802d307887d -r 115a9202c459 sys/arch/alpha/include/intr.h
--- a/sys/arch/alpha/include/intr.h     Fri Jul 16 18:50:19 2021 +0000
+++ b/sys/arch/alpha/include/intr.h     Fri Jul 16 19:02:22 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: intr.h,v 1.84 2021/07/04 22:36:43 thorpej Exp $ */
+/* $NetBSD: intr.h,v 1.85 2021/07/16 19:02:22 thorpej Exp $ */
 
 /*-
  * Copyright (c) 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -157,7 +157,7 @@
 static __inline int
 _splraise(int s)
 {
-       int cur = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK;
+       int cur = (int)alpha_pal_rdps();
        return (s > cur ? (int)alpha_pal_swpipl(s) : cur);
 }
 



Home | Main Index | Thread Index | Old Index