|
但是在OEM开头的一系列函数是微软自己实现的了的,在wince5.0它的目录是
D:\WINCE500\PLATFORM\COMMON\SRC\COMMON\INTR\COMMON
贴一段它的代码
BOOL OEMInterruptEnable(DWORD sysIntr, LPVOID pvData, DWORD cbData)
{
BOOL rc = FALSE;
const UINT32 *pIrqs;
UINT32 count;
OALMSG(OAL_INTR&&OAL_VERBOSE,
(L"+OEMInterruptEnable(%d, 0x%x, %d)\r\n", sysIntr, pvData, cbData
));
// SYSINTR_VMINI & SYSINTR_TIMING are special cases
if (sysIntr == SYSINTR_VMINI || sysIntr == SYSINTR_TIMING) {
rc = TRUE;
goto cleanUp;
}
// Obtain the SYSINTR's underlying IRQ number
if (!OALIntrTranslateSysIntr(sysIntr, &count, &pIrqs)) {
// Indicate invalid SysIntr
OALMSG(OAL_ERROR, (
L"ERROR: OEMInterruptEnable: IRQs are undefined for SysIntr %d\r\n",
sysIntr
));
goto cleanUp;
}
// Enable the interrupt
rc = OALIntrEnableIrqs(count, pIrqs);
cleanUp:
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OEMInterruptEnable(rc = 1)\r\n"));
return rc;
}
这个函数明显的是去调用了具体的BSP当中OOALIntrEnableIrqs函数吗!
而我想要说的,在EP9315当中,它自己也有定义了OEMInterruptEnable(DWORD sysIntr, LPVOID pvData, DWORD cbData),在这里面它直完成了对应的任务,不需要去实现OAL函数。按PQOAL概念,如果是ep9315的BSP,系统启动后,不是要出错了吗!因为EP9315当中根本就没有实现OALOALIntrEnableIrqs函数,反而是有一个和WINCE定义的相同的函数OEMInterruptEnable()
BOOL OEMInterruptEnable(DWORD idInt, LPVOID pvData, DWORD cbData)
{
BOOL bRet = TRUE;
ULONG ulIntMask1, ulIntMask2;
bRet = SysIntrNumToInterruptMask(idInt, &ulIntMask1, &ulIntMask2);
INTERRUPTS_OFF();
if(ulIntMask1)
{
*VIC1_INTENABLE = ulIntMask1;
gdwInterruptMask1 |= ulIntMask1;
}
if(ulIntMask2)
{
*VIC2_INTENABLE = ulIntMask2;
gdwInterruptMask2 |= ulIntMask2;
}
if(idInt ==SYSINTR_SPI)
{
fPS2Int = 0;
}
if((idInt == SYSINTR_PIO_PLAYBACK) && (cbData == sizeof(PIOBufferParameters)) )
{
PIOBufferParameters *pPIO = (PIOBufferParameters *)pvData;
sPlayBack.pulPosition = sPlayBack.pulBuffer = pPIO->pulBuffer = gulTransmitBuffer;
sPlayBack.ulBufferSize = pPIO->ulBufferSize;
sPlayBack.pulBufferEnd = sPlayBack.pulBuffer + (sPlayBack.ulBufferSize>>2);
sPlayBack.pulBufferHalf = sPlayBack.pulBuffer + (sPlayBack.ulBufferSize>>3);
sPlayBack.bEnabled
}
|
|