Littleswanhouse

Hi all,
I try to call OALIoCtlHalRequestSysIntr two times to translate the same irq into two sysintr.
Then I try to use InterruptInitialize() to map this two sysintr into different event for different IST.
After interrupt occurs, only one IST which has higher prioriry has been wakeup. That is, if I set
IST1 has higher prioryty, only IST1 has been wakeup. But, if I set IST1 has lower priority, only IST2
has been wakeup.
I think both IST1 and IST2 should be wakeup. Why not
My code is as below:
DWORD IST1(PVOID pArg)
{
UINT32 KeyPadIrq = IRQ_EINT0;
UINT32 KeyPadSysIntr;

HANDLE event = CreateEvent(NULL, FALSE, FALSE, NULL);
//call OALIoCtlHalRequestSysIntr
if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &KeyPadIrq, sizeof(UINT32),
&KeyPadSysIntr, sizeof(UINT32), NULL)){
RETAILMSG(1, (TEXT("KeyPadIST:Failed to request sysintr value.\r\n")));
return(0);
}

if (!(InterruptInitialize (KeyPadSysIntr, event, 0, 0))) {
RETAILMSG(1, (TEXT("KeyPadIST: InterruptInitialize failed.\r\n")));
}

while(TRUE) {
WaitForSingleObject(event, INFINITE);
RETAILMSG(1, (TEXT("IST1 has been wakeup\r\n")));
InterruptDone(KeyPadSysIntr);
}

return 0;
}
DWORD IST2(PVOID pArg)
{
UINT32 KeyPadIrq = IRQ_EINT0;
UINT32 KeyPadSysIntr;

HANDLE event = CreateEvent(NULL, FALSE, FALSE, NULL);
//call OALIoCtlHalRequestSysIntr
if (!KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &KeyPadIrq, sizeof(UINT32),
&KeyPadSysIntr, sizeof(UINT32), NULL)){
RETAILMSG(1, (TEXT("KeyPadIST:Failed to request sysintr value.\r\n")));
return(0);
}

if (!(InterruptInitialize (KeyPadSysIntr, event, 0, 0))) {
RETAILMSG(1, (TEXT("KeyPadIST: InterruptInitialize failed.\r\n")));
}

while(TRUE) {
WaitForSingleObject(event, INFINITE);
RETAILMSG(1, (TEXT("IST2 has been wakeup\r\n")));
I nterruptDone(KeyPadSysIntr);
}

return 0;
}

DWORD KPD_Init(LPCTSTR pContext, DWORD dwBusContext)
{
//Create IST1
CreateThread(0, 0, (LPTHREAD_START_ROUTINE) IST1,
NULL, 0, NULL);
//Create IST2
CreateThread(0, 0, (LPTHREAD_START_ROUTINE) IST2,
NULL, 0, NULL);

return TRUE;
}



Re: Smart Devices General Why can't I map two sysintr into one irq?

Littleswanhouse

Hi all,
In OAL, I can use OALVAtoPA to translate virtual address to physical address.
How can I do that in application or driver
Is there any API to instead of OALVAtoPA
Can I add a new IOCTL ofl KernelIoControl to call OAL's OALVAtoPA in application or driver directly
-----------------
Best Regards,
James