Re: Disabling interrupts in Windows

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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!!
>


.



Relevant Pages

  • Re: sony vaio pcg-gr390
    ... PCI-Only Interrupts: none ... Location Bus Device Pin Link IRQs ... penalty: 1050 ... isa_probe_children: disabling PnP devices ...
    (freebsd-current)
  • Re: [RFC/PATCH] Kdump: Disabling PCI interrupts in capture kernel
    ... I know very little about consoles and their working. ... >> console driver needed interrupts to be enabled at the controller. ... looking at disabling the DMA from the devices. ... interrupt disable bit in PCI-PCI bridge is optional and if implemented, ...
    (Linux-Kernel)
  • Re: [RFC] mmiotrace full patch, preview 1
    ... the "first" probe gets selected and executed. ... kmmio_handler, where-ever it was triggered, executes with interrupts ... enable single-stepping. ... or does disabling interrupts guarantee that? ...
    (Linux-Kernel)
  • Re: Guarantee Critical Regions in Portable code. Portable Semaphores?
    ... Disabling interrupts is the kernel level operation. ... You cannot know it's safe for sure, but a single increment or decrement ... How can the FAT driver know when it is safe to disable the interrupts ...
    (comp.arch.embedded)
  • Re: IIgs Debuggers?
    ... Are you directly disabling any interrupts? ... I do disable interrupts on the initial loading of the wavebank into the DOC RAM, but I do so *exactly* as you have mentioned. ... I deliberately chose MIDI Synth sequences that all share the same instruments and wavebank file - thereby eliminating the need to reload them. ...
    (comp.sys.apple2.programmer)