Hi,
I have a global variable "x" in my DDK kernel-mode continuous data acquisition driver that I access several times in my ISR. In my particular case this is a fixed-size buffer in kernel space that I store read data in. I would like the access to that variable to be atomic in the ISR. Do you have suggestions how this can happen? I am thinking of three ways, but I have doubts about each:
1) Disable other interrupts from my device (at same DIRQL).
A. What happens if a higher-priority interrupt writes to "x"? Is this something I cannot avoid?
B. Is it true that another device wired to memory directly can write to this location?
2) Delay hardware writing to "x" (such as a DMA transfer running at the same time as the ISR).
A. Is this a scenario and a option?
3) Copy "x" to a temporary "y" in the beginning of the ISR.
A. Is this really a solution? In my opinion this might be expensive for a big buffer and someone can write to parts of it while I am copying.
Thanks.