引用: 引用 4 楼 Reallyu 的回复:
光改这个sysINT Numbe 还不行,需要修改platform/common下的文件,具体的发消息给你了
谢谢你的回复,
我看了中断转换的几个FUN, 能改的只是宏定义 SYSINTR_MAXIMUM 和 OAL_INTR_IRQ_MAXIMUM 的大小
SYSINTR_MAXIMUM 本来是64+8,我没有做修改,
OAL_INTR_IRQ_MAXIMUM 原来是64,我改成66,
还需要改到别的地方吗?
VOID OALIntrStaticTranslate(UINT32 sysIntr, UINT32 irq)
{
OALMSG(OAL_FUNC&&OAL_INTR, (
L"+OALIntrStaticTranslate(%d, %d)\r\n", sysIntr, irq
));
if (irq < OAL_INTR_IRQ_MAXIMUM && sysIntr < SYSINTR_MAXIMUM) {
g_oalSysIntr2Irq[sysIntr] = irq;
g_oalIrq2SysIntr[irq] = sysIntr;
}
OALMSG(OAL_FUNC&&OAL_INTR, (L"-OALIntrStaticTranslate\r\n"));
}
BOOL OALIntrTranslateSysIntr(
UINT32 sysIntr, UINT32 *pCount, const UINT32 **ppIrqs
) {
BOOL rc;
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+OALTranslateSysIntr(%d)\r\n", sysIntr));
// Valid SYSINTR?
if (sysIntr >= SYSINTR_MAXIMUM) {
rc = FALSE;
goto cleanUp;
}
*pCount = 1;
*ppIrqs = &g_oalSysIntr2Irq[sysIntr];
rc = TRUE;
cleanUp:
OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OALTranslateSysIntr(rc = %d)\r\n", rc));
return rc;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrTranslateIrq
//
// This function maps a IRQ to its corresponding SYSINTR.
//
UINT32 OALIntrTranslateIrq(UINT32 irq)
{
UINT32 sysIntr = SYSINTR_UNDEFINED;
OALMSG(OAL_FUNC&&OAL_VERBOSE, (L"+OALIntrTranslateIrq(%d)\r\n", irq));
if (irq >= OAL_INTR_IRQ_MAXIMUM) goto cleanUp;
sysIntr = g_oalIrq2SysIntr[irq];
cleanUp:
OALMSG(OAL_FUNC&&OAL_VERBOSE, (
L"-OEMTranslateIrq(sysIntr = %d)\r\n", sysIntr
));
return sysIntr;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrRequestSysIntr
//
// This function allocate new SYSINTR for given IRQ and it there isn't
// static mapping for this IRQ it will create it.
//
UINT32 OALIntrRequestSysIntr(UINT32 count, const UINT32 *pIrqs, UINT32 flags)
{
UINT32 irq, sysIntr;
OALMSG(OAL_INTR&&OAL_FUNC, (
L"+OALIntrRequestSysIntr(%d, 0x%08x, 0x%08x)\r\n", count, pIrqs, flags
));
// Valid IRQ?
if (count != 1 || pIrqs[0] >= OAL_INTR_IRQ_MAXIMUM) {
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
irq = pIrqs[0];
// If there is mapping for given irq check for special cases
if (g_oalIrq2SysIntr[irq] != SYSINTR_UNDEFINED) {
// If static mapping is requested we fail
if ((flags & OAL_INTR_STATIC) != 0) {
OALMSG(OAL_ERROR, (L"ERROR: OALIntrRequestSysIntr: "
L"Static mapping for IRQ %d already assigned\r\n", irq
));
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
// If we should translate, return existing SYSINTR
if ((flags & OAL_INTR_TRANSLATE) != 0) {
sysIntr = g_oalIrq2SysIntr[irq];
goto cleanUp;
}
}
// Find next available SYSINTR value...
for (sysIntr = SYSINTR_FIRMWARE; sysIntr < SYSINTR_MAXIMUM; sysIntr++) {
if (g_oalSysIntr2Irq[sysIntr] == OAL_INTR_IRQ_UNDEFINED) break;
}
// Any available SYSINTRs left?
if (sysIntr >= SYSINTR_MAXIMUM) {
OALMSG(OAL_ERROR, (L"ERROR: OALIntrRequestSysIntr: "
L"No avaiable SYSINTR found\r\n"
));
sysIntr = SYSINTR_UNDEFINED;
goto cleanUp;
}
// Make SYSINTR -> IRQ association.
g_oalSysIntr2Irq[sysIntr] = irq;
// Make IRQ -> SYSINTR association if required
if ((flags & OAL_INTR_DYNAMIC) != 0) goto cleanUp;
if (
g_oalIrq2SysIntr[irq] == SYSINTR_UNDEFINED ||
(flags & OAL_INTR_FORCE_STATIC) != 0
) {
g_oalIrq2SysIntr[irq] = sysIntr;
}
cleanUp:
OALMSG(OAL_INTR&&OAL_FUNC, (
L"-OALIntrRequestSysIntr(sysIntr = %d)\r\n", sysIntr
));
return sysIntr;
}
//------------------------------------------------------------------------------
//
// Function: OALIntrReleaseSysIntr
//
// This function release given SYSINTR and remove static mapping if exists.
//
BOOL OALIntrReleaseSysIntr(UINT32 sysIntr)
{
BOOL rc = FALSE;
UINT32 irq;
OALMSG(OAL_INTR&&OAL_FUNC, (L"+OALIntrReleaseSysIntr(%d)\r\n", sysIntr));
// Is the SYSINTR already released?
if (g_oalSysIntr2Irq[sysIntr] == OAL_INTR_IRQ_UNDEFINED) goto cleanUp;
// Remove the SYSINTR -> IRQ mapping
irq = g_oalSysIntr2Irq[sysIntr];
g_oalSysIntr2Irq[sysIntr] = OAL_INTR_IRQ_UNDEFINED;
// If we're releasing the SYSINTR directly mapped in the IRQ mapping,
// remove the IRQ mapping also
if (g_oalIrq2SysIntr[irq] == sysIntr) {
g_oalIrq2SysIntr[irq] = SYSINTR_UNDEFINED;
}
cleanUp:
OALMSG(OAL_INTR&&OAL_FUNC, (L"-OALIntrReleaseSysIntr(rc = %d)\r\n", rc));
return rc;
}