|
WaitForSingleObject Exception "PreFetch Abort"
[复制链接]
各位大大,我是個ce的新手,寫了一個ce的gpio driver
其中需要用到interrupt的方式來偵測gpio的變動
現在interrupthandler可以偵測到gpio的變動
也會正確返回sysintr
thread也正常進入,可是在gpio產生interrupt後
WaitForSingleObject卻會因為等待的gIntrEvent 發生而產生exception
之後就沒動作了,也沒有正常的往下執行
請問我這樣的寫法還是有什麼可能的失敗原因
程式碼
INT WINAPI IntrThread(void)
{
DWORD sys_intr;
gIntrEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
KernelIoControl(IOCTL_HAL_REQUEST_SYSINTR, &irq, sizeof(UINT32), &sys_intr, sizeof(UINT32), NULL);
if (gIntrEvent != NULL)
{
if(InterruptInitialize(sys_intr, gIntrEvent, NULL, 0))
{
while(1)
{
if (WaitForSingleObject(gIntrEvent, INFINITE) == WAIT_OBJECT_0)// INFINITE
{
RETAILMSG(1, (TEXT("----Interrupt Sucessfully.-------- \r\n")));
InterruptDone(sys_intr);
}
}
}
return TRUE;
}
}
錯誤訊息如下:
Exception 'Prefetch Abort' (3): Thread-Id=02e40002(pth=81327000), Proc-Id=00400002(pprc=8117f308) 'NK.EXE', VM-active=009c0006(pprc=83251d6c) 'shell.exe'
PC=c0991fcc(???+0xc0991fcc) RA=c0991fcc(???+0xc0991fcc) SP=d29afe78, BVA=c0991fcc
請大大指導一下小弟,感激不盡,謝謝!!!
|
|