中断挂接方式说明:
在VxWorks6.8/vxWorks6.9上,大多数情况下会使用到SYMMETRIC IO MODE模式。而该模式下的中断挂机方式有别于之前老的PIC方式。
具体如下所示:
#if 0
/* Map intLine to our ISR */
pIRQ=INUM_TO_IVEC((int)intLine);
printf("the pIRQ =0x%x",pIRQ);
st=pciIntConnect(pIRQ,(void*)tyCoXRPCIInt, 0); /* initial channel number '0' as the param*/
if(st==OK)
{
logMsg("XRPCI-ISR tyCoXRPCIInt connected.\n", intLine,0,0,0,0,0);
}
/* Enable the interrupt line. */
st=intEnable((int)intLine);
if(st==OK)
{
logMsg("XRPCI Interrupt Line 0x%.2x enabled.\n", intLine,0,0,0,0,0);
}
else
{
logMsg("Could not enable XRPCI Interrupt Line 0x%.2x.\n", intLine,0,0,0,0,0);
}
#else
vector= (VOIDFUNCPTR *)INUM_TO_IVEC(sysInumTbl[(int)intLine]);
printf("the vector =0x%x",vector);
st=pciIntConnect(vector,(void*)tyCoXRPCIInt, 0); /* initial channel number '0' as the param*/
if(st==OK)
{
logMsg("ISR tyCoXRPCIInt connected.\n", intLine,0,0,0,0,0);
}
/* Enable the interrupt line. */
st=pciIntEnable();
st=intEnable((int)intLine);
if(st==OK)
{
logMsg("ISR Interrupt Line 0x%.2x enabled.\n", intLine,0,0,0,0,0);
}
else
{
logMsg("Could not enable Interrupt Line 0x%.2x.\n", intLine,0,0,0,0,0);
}
#endif
#if 0 和#else之间代码为老的PIC中断挂机方式,#else和#endif之间为SYMMETRIC IO MODE的中断挂接方式。只是从PCI设备的配置空间的intLine读取中断号之后,在sysInumTbl[]表中进行中断向量的查找。找到相应的中断向量之后进行中断挂接。
5818

被折叠的 条评论
为什么被折叠?



