/*! * ======== InterruptHost_intRegister ======== */ Void InterruptHost_intRegister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo, Fxn func, UArg arg) { UInt key; Hwi_Params hwiAttrs; /* Make sure that we're trying to talk to the HOST */ Assert_isTrue(remoteProcId == MultiProc_getId("DSP"), ti_sdo_ipc_Ipc_A_invArgument); /* Disable global interrupts */ key = Hwi_disable(); InterruptHost_intClear(remoteProcId, intInfo); /* Register interrupt for communication between ARM and DSP */ Hwi_Params_init(&hwiAttrs); hwiAttrs.maskSetting = Hwi_MaskingOption_SELF; hwiAttrs.arg = arg; Hwi_create(HOSTINT, (Hwi_FuncPtr)func, &hwiAttrs, NULL); /* Enable the mailbox interrupt to the DSP */ REG32(MAILBOX_IRQENABLE_GPP) = 0x4; /* Mailbox 0 */ /* Restore global interrupts */ Hwi_restore(key); /* Unmask IVA_2_IRQ[10] to allow interrupt to come into DSP */ Hwi_enableInterrupt(HOSTINT); }
/* * ======== InterruptHost_intRegister ======== */ Void InterruptHost_intRegister(UInt16 remoteProcId, IInterrupt_IntInfo *intInfo, Fxn func, UArg arg) { UInt key; Int index; Error_Block eb; InterruptHost_FxnTable *table; /* init error block */ Error_init(&eb); if (remoteProcId == InterruptHost_dspProcId) { index = 0; } else if (remoteProcId == InterruptHost_videoProcId) { index = 1; } else if (remoteProcId == InterruptHost_vpssProcId) { index = 2; } else if (remoteProcId == InterruptHost_eveProcId) { index = 3; } else { Assert_isTrue(FALSE, ti_sdo_ipc_Ipc_A_internal); return; /* should never get here, but keep Coverity happy */ } /* Disable global interrupts */ key = Hwi_disable(); table = &(InterruptHost_module->fxnTable[index]); table->func = func; table->arg = arg; InterruptHost_intClear(remoteProcId, intInfo); if (remoteProcId == InterruptHost_eveProcId) { /* Register interrupt for eve mailbox */ Hwi_create(EVE_MAILBOX_HOSTINT, (Hwi_FuncPtr)InterruptHost_intEveShmStub, NULL, &eb); Hwi_enableInterrupt(EVE_MAILBOX_HOSTINT); } else { /* Make sure the interrupt only gets plugged once */ InterruptHost_module->numPlugged++; if (InterruptHost_module->numPlugged == 1) { /* Register interrupt for system mailbox */ Hwi_create(MAILBOX_HOSTINT, (Hwi_FuncPtr)InterruptHost_intShmStub, NULL, &eb); Hwi_enableInterrupt(MAILBOX_HOSTINT); } } /* Enable the mailbox interrupt to the HOST core */ InterruptHost_intEnable(remoteProcId, intInfo); /* Restore global interrupts */ Hwi_restore(key); }