Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbmips/evbmips Make this reentrant / MP safe



details:   https://anonhg.NetBSD.org/src/rev/c97037103420
branches:  trunk
changeset: 817569:c97037103420
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Aug 26 07:07:29 2016 +0000

description:
Make this reentrant / MP safe

diffstat:

 sys/arch/evbmips/evbmips/interrupt.c |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (46 lines):

diff -r 4b39c527545c -r c97037103420 sys/arch/evbmips/evbmips/interrupt.c
--- a/sys/arch/evbmips/evbmips/interrupt.c      Fri Aug 26 05:56:03 2016 +0000
+++ b/sys/arch/evbmips/evbmips/interrupt.c      Fri Aug 26 07:07:29 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: interrupt.c,v 1.22 2015/06/06 22:22:03 matt Exp $      */
+/*     $NetBSD: interrupt.c,v 1.23 2016/08/26 07:07:29 skrll Exp $     */
 
 /*-
  * Copyright (c) 2001 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.22 2015/06/06 22:22:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: interrupt.c,v 1.23 2016/08/26 07:07:29 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/cpu.h>
@@ -40,8 +40,6 @@
 #include <mips/locore.h>
 #include <mips/mips3_clock.h>
 
-struct clockframe cf;
-
 void
 intr_init(void)
 {
@@ -74,12 +72,15 @@
                    "%s: cpl (%d) != ipl (%d)", __func__, ci->ci_cpl, ipl);
                KASSERT(pending != 0);
 
-               cf.pc = pc;
-               cf.sr = status;
-               cf.intr = (ci->ci_idepth > 1);
 
 #ifdef MIPS3_ENABLE_CLOCK_INTR
                if (pending & MIPS_INT_MASK_5) {
+                       struct clockframe cf;
+
+                       cf.pc = pc;
+                       cf.sr = status;
+                       cf.intr = (ci->ci_idepth > 1);
+
                        KASSERTMSG(ipl == IPL_SCHED,
                            "%s: ipl (%d) != IPL_SCHED (%d)",
                             __func__, ipl, IPL_SCHED);



Home | Main Index | Thread Index | Old Index