VOID OEMProfileTimerDisable() { BOOL enabled; UINT32 irq; OALMSG(TRUE, (L"+OEMProfileTimerDisable()\r\n")); // No disable without enable if (!g_profiler.enabled) goto cleanUp; // Following code should not be interrupted enabled = INTERRUPTS_ENABLE(FALSE); // Disable the profile timer interrupt irq = IRQ_TIMER2; OALIntrDisableIrqs(1, &irq); // Deconfigure profiling ISR callback function. g_pProfilerISR = NULL; // Reset flag g_profiler.enabled = FALSE; // Enable interrupts INTERRUPTS_ENABLE(enabled); cleanUp: OALMSG(TRUE, (L"-OEMProfileTimerDisable\r\n")); }
//------------------------------------------------------------------------------ // // Function: OEMInterruptDisable // // This function disables the IRQ given its corresponding SysIntr value. // VOID OEMInterruptDisable(DWORD SysIntr) { OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+OEMInterruptDisable(%d)\r\n", SysIntr)); // Disable interrupts OALIntrDisableIrqs(1, &g_oalSysIntr2Irq[SysIntr]); OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OEMInterruptDisable\r\n")); }
//------------------------------------------------------------------------------ // // Function: OEMInterruptMask // // This function masks the IRQ given its corresponding SysIntr value. // // VOID OEMInterruptMask(DWORD SysIntr, BOOL mask) { OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+OEMInterruptMask(%d, %d)\r\n", SysIntr, mask)); // Based on mask enable or disable if (mask) { OALIntrDisableIrqs(1, &g_oalSysIntr2Irq[SysIntr]); } else { OALIntrEnableIrqs(1, &g_oalSysIntr2Irq[SysIntr]); } OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OEMInterruptMask\r\n")); }
//------------------------------------------------------------------------------ // // Function: OEMInterruptDisable(DWORD sysIntr) // // This function disables the IRQ given its corresponding SysIntr value. // // VOID OEMInterruptDisable(DWORD sysIntr) { const UINT32 *pIrqs; UINT32 count; OALMSG(OAL_INTR&&OAL_VERBOSE, (L"+OEMInterruptDisable(%d)\r\n", sysIntr)); // 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; } // Disable the interrupt OALIntrDisableIrqs(count, pIrqs); cleanUp: // Indicate exit OALMSG(OAL_INTR&&OAL_VERBOSE, (L"-OEMInterruptDisable\r\n")); }