Up until now i thought that if i call IoConnectInterrupt() once per
device and store the returned PKINTERRUPT pointer in the device
extension then the first parameter of my ISR will have the same value
as the pointer in my device extension.
e.g. :
NTSTATUS StartDevice(…)
{
…
Status = IoConnectInterrupt(&pDevExt->pIntObj, ISR, …);
…
}
BOOLEAN ISR(PKINTERRUPT pIntObj, PVOID pContext)
{
DEVICEEXTENSION *pDevExt = (DEVICEEXTENSION*)pContext;
if (pDevExt->pIntObj != pIntObj)
{
// not my IntObj. No need to waste time for
// asking HW if it did interrupt
return FALSE;
}
int Reason = AskHwForIntReason()
if (Reason == 0)
{
// HW did not interrupt
return FALSE;
}
…
return TRUE;
}
That kind of code worked for several month until i began to use
different CPUs/Motherboards. On my current testsystem the expression
‘pDevExt->pIntObj != pIntObj’ is true although the interrupt was definitly
generated by my HW and since the code above does not handle the interrupt
i get an never ending interrupt storm.
Just removing the ‘if (pDevExt->pIntObj != pIntObj)’ block solves that
problem.
So i tried to find some information about this subject in the DDK. The
only thing i found so far is this:
The system creates an interrupt object for each processor the device is
capable of interrupting.
Does that mean that when i call IoConnectInterrupt on a SMP system the OS
creates an interrupt object for each processor but returns just a pointer
to one of them while the parameter to the ISR can be a pointer to any of
them?
regards,
poltrone