阅读:1610回复:3
为什么中断服务程序只能进一次?????????
各位大侠,小弟在写一个驱动时,发现我的中断服务程序只能进入一次.去掉KeInsertQueueDpc时就能正常.但我想在DPC里都数据.
status = IoConnectInterrupt(&pdx->pInterruptObject, OnInterrupt,pdx,NULL,vector, IrqL,IrqL,mode,irqshare,affinity,FALSE); KeInitializeDpc(&(pdx->ReadDataDPC),ReadDataDPC,pdx); BOOLEAN OnInterrupt( PKINTERRUPT pInterrupt, PVOID pdx ) { U32 RegPciInt; U32 InterruptSource; U8 i,Int1510Temp; DEVICE_EXTENSION *pdx1; pdx1 = (DEVICE_EXTENSION *)pdx; // Read interrupt status register RegPciInt = PLX_REG_READ( (DEVICE_EXTENSION *)pdx, PCI9030_INT_CTRL_STAT ); // Check for master PCI interrupt enable if ((RegPciInt & (1 << 6)) == 0) return FALSE; // Verify that an interrupt is truly active i = 0; { Int1510Temp = Read1510(pdx1 , i , 0x0d); if((Int1510Temp&0xff) != 0x00) { if((Int1510Temp&0x02) == 0x02) { if(pdx1->bStartRecFlag == 1) { KeInsertQueueDpc(&(((DEVICE_EXTENSION *)pdx)->ReadDataDPC),NULL,NULL); } } pdx1->bIntService = Int1510Temp; pdx1->bIntTimes++; if(pdx1->bIntTimes > 0xfffff0) pdx1->bIntTimes = 0; Int1510Temp = Read1510(pdx1,i,0x0e); } } return TRUE; } VOID ReadDataDPC( IN PKDPC Dpc, IN PVOID DeferredContext, IN PVOID SystemArgument1, IN PVOID SystemArgument2 ) { U32 j; U8 i,temp; DEVICE_EXTENSION *pdx; pdx = (DEVICE_EXTENSION *)DeferredContext; i=0; { if(pdx->bStartRecFlag == 1) { if((pdx->bIntService&0x02) == 0x02) { (PUSHORT)(pdx->PciBar[i+2].pVa) = 0x00; for( j=0; j<256; j++ ) { temp = (U8)*(pdx->PciBar[i+2].pVa + 1); } } } } } |
|
沙发#
发布于:2002-07-04 16:04
你在中断调用DPC使用KeInsertQueueDpc函数,不知道和调用IoRequestDpc()函数有什么区别? KeInsertQuesueDpc一般用于维护自己的DPC队列 |
|
板凳#
发布于:2002-07-04 15:35
你在中断调用DPC使用KeInsertQueueDpc函数,不知道和调用IoRequestDpc()函数有什么区别?
是不是KeInsertQuesueDpc能够确保相同的Dpc例程能够被加入队列中去? |
|
|
地板#
发布于:2002-07-04 11:26
用户被禁言,该主题自动屏蔽! |
|