diff options
author | wpaul <wpaul@FreeBSD.org> | 2004-04-19 22:39:04 +0000 |
---|---|---|
committer | wpaul <wpaul@FreeBSD.org> | 2004-04-19 22:39:04 +0000 |
commit | b40a64ce552a42598f1499ed21ac973fa7c3785b (patch) | |
tree | 9b284eccc340486015066f51668ce490961e6ae5 /sys/compat | |
parent | 6dec29ccab64b0a7e6129283a7b7e311c79fb893 (diff) | |
download | FreeBSD-src-b40a64ce552a42598f1499ed21ac973fa7c3785b.zip FreeBSD-src-b40a64ce552a42598f1499ed21ac973fa7c3785b.tar.gz |
Try to handle recursive attempts to raise IRQL to DISPATCH_LEVEL better
(among other things).
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/ndis/subr_hal.c | 10 |
1 files changed, 9 insertions, 1 deletions
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); |