interrupt logic, making sure the lock is not taken for clock interrupts.
Tested on aviion and luna88k.
-/* $OpenBSD: av400_machdep.c,v 1.27 2014/11/16 12:30:56 deraadt Exp $ */
+/* $OpenBSD: av400_machdep.c,v 1.28 2015/05/18 04:06:37 miod Exp $ */
/*
* Copyright (c) 2006, 2007, Miodrag Vallat.
*
}
#endif
-#ifdef MULTIPROCESSOR
- if (old_spl < IPL_SCHED)
- __mp_lock(&kernel_lock);
-#endif
-
/*
* We want to service all interrupts marked in the IST register
* They are all valid because the mask would have prevented them
*/
ret = 0;
SLIST_FOREACH(intr, list, ih_link) {
+#ifdef MULTIPROCESSOR
+ if (intr->ih_ipl < IPL_CLOCK)
+ __mp_lock(&kernel_lock);
+#endif
if (ISSET(intr->ih_flags, INTR_WANTFRAME))
ret = (*intr->ih_fn)((void *)eframe);
else
ret = (*intr->ih_fn)(intr->ih_arg);
+#ifdef MULTIPROCESSOR
+ if (intr->ih_ipl < IPL_CLOCK)
+ __mp_unlock(&kernel_lock);
+#endif
if (ret != 0) {
intr->ih_count.ec_count++;
break;
problems = 0;
#endif
-#ifdef MULTIPROCESSOR
- if (old_spl < IPL_SCHED)
- __mp_unlock(&kernel_lock);
-#endif
-
out:
/*
* process any remaining data access exceptions before
-/* $OpenBSD: av530_machdep.c,v 1.15 2015/04/25 21:15:08 miod Exp $ */
+/* $OpenBSD: av530_machdep.c,v 1.16 2015/05/18 04:06:37 miod Exp $ */
/*
* Copyright (c) 2006, 2007, 2010 Miodrag Vallat.
*
#ifdef DIAGNOSTIC
static int problems = 0;
#endif
-#ifdef MULTIPROCESSOR
- int need_lock;
-#endif
cur_mask = ISR_GET_CURRENT_MASK(cpu);
cur_exmask = EXISR_GET_CURRENT_MASK(cpu);
ret = 0;
SLIST_FOREACH(intr, list, ih_link) {
#ifdef MULTIPROCESSOR
- need_lock = intr->ih_ipl < IPL_SCHED &&
- intr->ih_ipl != IPL_CLOCK;
- if (need_lock)
+ if (intr->ih_ipl < IPL_CLOCK)
__mp_lock(&kernel_lock);
#endif
if (ISSET(intr->ih_flags, INTR_WANTFRAME))
else
ret = (*intr->ih_fn)(intr->ih_arg);
#ifdef MULTIPROCESSOR
- if (need_lock)
+ if (intr->ih_ipl < IPL_CLOCK)
__mp_unlock(&kernel_lock);
#endif
if (ret != 0) {
-/* $OpenBSD: isr.c,v 1.9 2010/12/21 14:56:24 claudio Exp $ */
+/* $OpenBSD: isr.c,v 1.10 2015/05/18 04:06:37 miod Exp $ */
/* $NetBSD: isr.c,v 1.5 2000/07/09 08:08:20 nisimura Exp $ */
/*-
/* Give all the handlers a chance. */
LIST_FOREACH(isr, list, isr_link) {
+#ifdef MULTIPROCESSOR
+ if (isr->isr_ipl < IPL_CLOCK)
+ __mp_lock(&kernel_lock);
+#endif
rc = (*isr->isr_func)(isr->isr_arg);
+#ifdef MULTIPROCESSOR
+ if (isr->isr_ipl < IPL_CLOCK)
+ __mp_unlock(&kernel_lock);
+#endif
if (rc != 0)
isr->isr_count.ec_count++;
handled |= rc;
-/* $OpenBSD: machdep.c,v 1.116 2015/02/25 17:41:22 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.117 2015/05/18 04:06:37 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
case 5:
case 4:
case 3:
-#ifdef MULTIPROCESSOR
- if (CPU_IS_PRIMARY(ci)) {
- if (old_spl < IPL_SCHED)
- __mp_lock(&kernel_lock);
-#endif
+ if (CPU_IS_PRIMARY(ci))
isrdispatch_autovec(cur_int_level);
-#ifdef MULTIPROCESSOR
- if (old_spl < IPL_SCHED)
- __mp_unlock(&kernel_lock);
- }
-#endif
break;
default:
printf("%s: cpu%d level %d interrupt.\n",