Module Name:    src
Committed By:   skrll
Date:           Fri Aug 26 07:07:29 UTC 2016

Modified Files:
        src/sys/arch/evbmips/evbmips: interrupt.c

Log Message:
Make this reentrant / MP safe


To generate a diff of this commit:
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/evbmips/evbmips/interrupt.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/evbmips/evbmips/interrupt.c
diff -u src/sys/arch/evbmips/evbmips/interrupt.c:1.22 src/sys/arch/evbmips/evbmips/interrupt.c:1.23
--- src/sys/arch/evbmips/evbmips/interrupt.c:1.22	Sat Jun  6 22:22:03 2015
+++ src/sys/arch/evbmips/evbmips/interrupt.c	Fri Aug 26 07:07:29 2016
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: interrupt.c,
 #include <mips/locore.h>
 #include <mips/mips3_clock.h>
 
-struct clockframe cf;
-
 void
 intr_init(void)
 {
@@ -74,12 +72,15 @@ cpu_intr(int ppl, vaddr_t pc, uint32_t s
 		    "%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);

Reply via email to