Daniel Simard wrote:
How this protect code against two differents DPC on two different cpus if
there is one queue per cpu ?
A DPC object will never be queued simultaneously on two or more CPUs.
Once a DPC object is dequeued in preparation for calling the DPC
routine, however, it’s possible for it to be queued on a different CPU.
You can end up with the same DPC routine running simultaneously on
serveral CPUs.
You can avoid this in several ways: claim a private spin lock in your
DPC routine, use KeSetTargetProcessorDpc, etc. Much of the time,
however, you need to synchronize your DPC routine and your ISR, and
these techniques don’t work because of the difference in IRQ level. So
you just have to program your driver to cope with the problem. There are
a couple of suggestions on pp. 387-88 of my book using InterlockedOr and
the ExInterlockedXxx list routines.
–
Walter Oney, Consulting and Training
Basic and Advanced Driver Programming Seminars
Check out our schedule at http://www.oneysoft.com