Hi community
I observed the following behaviour:
My IST receives the interrupt and signals the completion of interrupt processing with "InterruptDone()".
However, by only invoking "InterruptDone()" the WaitForSingleObject returns immediately even there is no hardware interrupt pending.
The TISR status bit is remains unchanged and the while loop executes as fast as possible.
// Associate this thread with the registered event.
MyISTRoutine(HANDLE hEvent) {
InterruptDone(InterruptId);
while (1) {
WaitForSingleObject(hEvent, INFINITE);
// Check for thread exit signal and exit if set
// Interrupt processing here.
// On completion, call InterruptDone.
InterruptDone(InterruptId);
// Loop and wait for the kernel to set the event.
}
}
By unmasking the TISR register manually, the Thread only wakes up after the hardware interrupt gets fired (which is correct).
// Associate this thread with the registered event.
MyISTRoutine(HANDLE hEvent) {
PHYSICAL_ADDRESS pa;
pa.QuadPart = OMAP_GPTIMER4_REGS_PA;
volatile OMAP_GPTIMER_REGS* pTimerReg = reinterpret_cast<OMAP_GPTIMER_REGS*>(MmMapIoSpace(pa, sizeof(OMAP_GPTIMER_REGS),FALSE));
InterruptDone(InterruptId);
while (1) {
WaitForSingleObject(hEvent, INFINITE);
// Check for thread exit signal and exit if set
// Interrupt processing here.
// On completion, call InterruptDone.
// clear all interrupts flags
OUTREG32(&pTimerReg->TISR, 0x07);
InterruptDone(InterruptId);
// Loop and wait for the kernel to set the event.
}
}
Question:
Is it the responsibility of the IST or the InterruptDone to clear the TISR status bit?
Thanks