Re: Disabling interrupts in Windows
- From: "Gary G. Little" <gary.g.little@xxxxxxxxxxx>
- Date: Wed, 11 Jan 2006 09:10:44 -0600
You can't do what you state you want to do, mostly because the OS will not
let you. "cli/sti" at one time guaranteed uninteruptable code in such OSs as
DOS, but from NT on and the advent of more usage of NMI as well as
multi-processor systems, the ability to produce totally non-interruptible
code is nearly impossible, unless you write your own HAL.
The question then becomes what exactly are you trying to do that you thought
setting and clearing the interrupt mask would solve your problem? Many of us
here have dealt with some very hairy interrupt issues and found solutions.
We just might be able to point you to a better way if we know the details.
--
The personal opinion of
Gary G. Litte
"ravi" <ravisrm@xxxxxxxxx> wrote in message
news:1136971188.567762.10850@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>I am executing a piece of code within a callback function for a USB
> driver which I want to protect from getting interrupted on a Pentium 4
> Hyperthreaded PC. I want to disable all other interrupts before this
> piece of code and then enable the interrupts when I am done. I used the
> assembly cli/sti for disabling the interrupts but this causes the PC to
> freeze when I run the USB driver with HYPERTHREADING enabled. With HT
> disabled the code runs fine.. So, I tried raising the Irql level to
> HIGH_LEVEL using the KeRaiseIrql function and then restoring the Irql
> to the old level using KeLowerIrql but it seems that some tasks DO
> interrupt my function. Is there any other way by which I can disable
> all other interrupts before my code??
> OS is WinXp/Win2000.
> - Thanks!!
>
.
- Follow-Ups:
- Re: Disabling interrupts in Windows
- From: ravi
- Re: Disabling interrupts in Windows
- From: ravi
- Re: Disabling interrupts in Windows
- References:
- Disabling interrupts in Windows
- From: ravi
- Disabling interrupts in Windows
- Prev by Date: Re: Win98SE driver installation
- Next by Date: Re: How can I check if the device object is valid?
- Previous by thread: Re: Disabling interrupts in Windows
- Next by thread: Re: Disabling interrupts in Windows
- Index(es):
Relevant Pages
|