From b40a64ce552a42598f1499ed21ac973fa7c3785b Mon Sep 17 00:00:00 2001 From: wpaul Date: Mon, 19 Apr 2004 22:39:04 +0000 Subject: Try to handle recursive attempts to raise IRQL to DISPATCH_LEVEL better (among other things). --- sys/compat/ndis/subr_hal.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'sys') diff --git a/sys/compat/ndis/subr_hal.c b/sys/compat/ndis/subr_hal.c index 9111cb2..deae5ef 100644 --- a/sys/compat/ndis/subr_hal.c +++ b/sys/compat/ndis/subr_hal.c @@ -313,9 +313,13 @@ hal_raise_irql(/*irql*/ void) if (irql < hal_irql()) panic("IRQL_NOT_LESS_THAN"); + if (hal_irql() == DISPATCH_LEVEL) + return(DISPATCH_LEVEL); + mtx_lock_spin(&sched_lock); - oldirql = curthread->td_priority; + oldirql = curthread->td_base_pri; sched_prio(curthread, PI_REALTIME); + curthread->td_base_pri = PI_REALTIME; mtx_unlock_spin(&sched_lock); return(oldirql); @@ -328,10 +332,14 @@ hal_lower_irql(/*oldirql*/ void) __asm__ __volatile__ ("" : "=c" (oldirql)); + if (oldirql == DISPATCH_LEVEL) + return; + if (hal_irql() != DISPATCH_LEVEL) panic("IRQL_NOT_GREATER_THAN"); mtx_lock_spin(&sched_lock); + curthread->td_base_pri = oldirql; sched_prio(curthread, oldirql); mtx_unlock_spin(&sched_lock); -- cgit v1.1