-/* $OpenBSD: acpi_machdep.c,v 1.67 2014/12/18 05:33:48 mlarkin Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.68 2015/01/06 12:50:47 dlg Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
pcb->pcb_rbp = 0;
ci->ci_idepth = 0;
+ ci->ci_handled_intr_level = IPL_NONE;
ci->ci_flags &= ~CPUF_PRESENT;
cpu_start_secondary(ci);
-/* $OpenBSD: cpu.c,v 1.76 2014/12/18 16:23:26 deraadt Exp $ */
+/* $OpenBSD: cpu.c,v 1.77 2015/01/06 12:50:47 dlg Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
ci->ci_cpuid = 0; /* False for APs, but they're not used anyway */
#endif
ci->ci_func = caa->cpu_func;
+ ci->ci_handled_intr_level = IPL_NONE;
#if defined(MULTIPROCESSOR)
/*
-/* $OpenBSD: intr.c,v 1.39 2014/12/02 18:13:10 tedu Exp $ */
+/* $OpenBSD: intr.c,v 1.40 2015/01/06 12:50:47 dlg Exp $ */
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
/*
int
intr_handler(struct intrframe *frame, struct intrhand *ih)
{
+ struct cpu_info *ci = curcpu();
+ int floor;
int rc;
#ifdef MULTIPROCESSOR
int need_lock;
if (need_lock)
__mp_lock(&kernel_lock);
#endif
+ floor = ci->ci_handled_intr_level;
+ ci->ci_handled_intr_level = ih->ih_level;
rc = (*ih->ih_fun)(ih->ih_arg ? ih->ih_arg : frame);
+ ci->ci_handled_intr_level = floor;
#ifdef MULTIPROCESSOR
if (need_lock)
__mp_unlock(&kernel_lock);
-/* $OpenBSD: ipi.c,v 1.12 2015/01/06 00:38:32 dlg Exp $ */
+/* $OpenBSD: ipi.c,v 1.13 2015/01/06 12:50:47 dlg Exp $ */
/* $NetBSD: ipi.c,v 1.2 2003/03/01 13:05:37 fvdl Exp $ */
/*-
struct cpu_info *ci = curcpu();
u_int32_t pending;
int bit;
+ int floor;
- pending = atomic_swap_uint(&ci->ci_ipis, 0);
+ floor = ci->ci_handled_intr_level;
+ ci->ci_handled_intr_level = ci->ci_ilevel;
+ pending = atomic_swap_uint(&ci->ci_ipis, 0);
for (bit = 0; bit < X86_NIPI && pending; bit++) {
if (pending & (1<<bit)) {
pending &= ~(1<<bit);
ipi_count.ec_count++;
}
}
+
+ ci->ci_handled_intr_level = floor;
}
-/* $OpenBSD: lapic.c,v 1.36 2014/12/18 05:33:48 mlarkin Exp $ */
+/* $OpenBSD: lapic.c,v 1.37 2015/01/06 12:50:47 dlg Exp $ */
/* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */
/*-
void
lapic_clockintr(void *arg, struct intrframe frame)
{
+ struct cpu_info *ci = curcpu();
+ int floor;
+ floor = ci->ci_handled_intr_level;
+ ci->ci_handled_intr_level = ci->ci_ilevel;
hardclock((struct clockframe *)&frame);
+ ci->ci_handled_intr_level = floor;
clk_count.ec_count++;
}
-/* $OpenBSD: machdep.c,v 1.204 2014/12/21 16:27:07 mlarkin Exp $ */
+/* $OpenBSD: machdep.c,v 1.205 2015/01/06 12:50:47 dlg Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
splassert_check(int wantipl, const char *func)
{
int cpl = curcpu()->ci_ilevel;
+ int floor = curcpu()->ci_handled_intr_level;
if (cpl < wantipl) {
splassert_fail(wantipl, cpl, func);
}
-
- if (wantipl == IPL_NONE && curcpu()->ci_idepth != 0) {
- splassert_fail(-1, curcpu()->ci_idepth, func);
+ if (floor > wantipl) {
+ splassert_fail(wantipl, floor, func);
}
+
}
#endif
-/* $OpenBSD: softintr.c,v 1.6 2014/07/12 18:44:41 tedu Exp $ */
+/* $OpenBSD: softintr.c,v 1.7 2015/01/06 12:50:48 dlg Exp $ */
/* $NetBSD: softintr.c,v 1.1 2003/02/26 21:26:12 fvdl Exp $ */
/*-
void
softintr_dispatch(int which)
{
+ struct cpu_info *ci = curcpu();
struct x86_soft_intr *si = &x86_soft_intrs[which];
struct x86_soft_intrhand *sih;
+ int floor;
+
+ floor = ci->ci_handled_intr_level;
+ ci->ci_handled_intr_level = ci->ci_ilevel;
for (;;) {
mtx_enter(&si->softintr_lock);
(*sih->sih_fn)(sih->sih_arg);
}
+
+ ci->ci_handled_intr_level = floor;
}
/*
-/* $OpenBSD: cpu.h,v 1.88 2014/12/16 21:20:23 tedu Exp $ */
+/* $OpenBSD: cpu.h,v 1.89 2015/01/06 12:50:48 dlg Exp $ */
/* $NetBSD: cpu.h,v 1.1 2003/04/26 18:39:39 fvdl Exp $ */
/*-
u_int64_t ci_ipending;
int ci_ilevel;
int ci_idepth;
+ int ci_handled_intr_level;
u_int64_t ci_imask[NIPL];
u_int64_t ci_iunmask[NIPL];
#ifdef DIAGNOSTIC