Index: include/cpu.h =================================================================== RCS file: /cvs/src/sys/arch/alpha/include/cpu.h,v retrieving revision 1.54 diff -u -p -r1.54 cpu.h --- include/cpu.h 17 Dec 2014 15:23:42 -0000 1.54 +++ include/cpu.h 23 Jun 2015 23:58:26 -0000 @@ -199,6 +199,7 @@ struct cpu_info { struct device *ci_dev; /* pointer to our device */ u_long ci_want_resched; /* preempt current process */ u_long ci_intrdepth; /* interrupt trap depth */ + int ci_handled_intr_level; struct trapframe *ci_db_regs; /* registers for debuggers */ #if defined(MULTIPROCESSOR) Index: alpha/interrupt.c =================================================================== RCS file: /cvs/src/sys/arch/alpha/alpha/interrupt.c,v retrieving revision 1.35 diff -u -p -r1.35 interrupt.c --- alpha/interrupt.c 19 May 2015 20:28:14 -0000 1.35 +++ alpha/interrupt.c 23 Jun 2015 23:58:26 -0000 @@ -258,13 +258,25 @@ interrupt(unsigned long a0, unsigned lon case ALPHA_INTR_DEVICE: /* I/O device interrupt */ { struct scbvec *scb; + int curipl = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK; + int floor; KDASSERT(a1 >= SCB_IOVECBASE && a1 < SCB_SIZE); + /* + * Depending on the system, hardware interrupts may occur + * either at level 3 or level 4. + */ + if (curipl == ALPHA_PSL_IPL_IO - 1) + curipl = ALPHA_PSL_IPL_IO; + atomic_add_ulong(&ci->ci_intrdepth, 1); atomic_add_int(&uvmexp.intrs, 1); scb = &scb_iovectab[SCB_VECTOIDX(a1 - SCB_IOVECBASE)]; + floor = ci->ci_handled_intr_level; + ci->ci_handled_intr_level = curipl; (*scb->scb_func)(scb->scb_arg, a1); + ci->ci_handled_intr_level = floor; atomic_sub_ulong(&ci->ci_intrdepth, 1); break; } @@ -606,6 +618,7 @@ _splraise(int s) void splassert_check(int wantipl, const char *func) { + struct cpu_info *ci = curcpu(); int curipl = alpha_pal_rdps() & ALPHA_PSL_IPL_MASK; /* @@ -617,11 +630,14 @@ splassert_check(int wantipl, const char if (curipl < wantipl) { splassert_fail(wantipl, curipl, func); + } + + if (ci->ci_handled_intr_level > wantipl) { /* - * If splassert_ctl is set to not panic, raise the ipl - * in a feeble attempt to reduce damage. + * XXX - need to show difference between what's blocked and + * what's running. */ - alpha_pal_swpipl(wantipl); + splassert_fail(wantipl, ci->ci_handled_intr_level, func); } } #endif