/* * FinishDebugging - undo all the stuff done by InitDebugging */ void FinishDebugging( void ) { InterruptUnRegister( NULL ); if( faultInstance != NULL ) { FreeProcInstance( faultInstance ); } NotifyUnRegister( NULL ); if( notifyInstance != NULL ) { FreeProcInstance( notifyInstance ); } if( WDebug386 ) { ResetDebugInterrupts32(); DebuggerIsExecuting( -1 ); Out((OUT_INIT,"Debug interrupts reset")); FreeLibrary( wint32 ); } KillWDebug386(); // FreeProcInstance( SubClassProcInstance ); FiniDebugHook(); WasInt32 = FALSE; if( CSAlias != NULL ) { FreeSelector( CSAlias ); } CSAlias = 0; DisableHookEvents(); HookRtn = NULL; } /* FinishDebugging */
static HAL_Status RtkI2SIrqDeInit( IN PHAL_I2S_ADAPTER pI2SAdapter ) { if (pI2SAdapter->DevNum > I2S_MAX_ID) { DBG_I2S_ERR("RtkI2SIrqDeInit: Invalid I2S Index(&d)\r\n", pI2SAdapter->DevNum); return HAL_ERR_PARA; } InterruptDis(&pI2SAdapter->IrqHandle); InterruptUnRegister(&pI2SAdapter->IrqHandle); return HAL_OK; }
void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) { #ifdef CONFIG_MBED_ENABLED if (obj->index == UART_3) { if (irq == RxIrq) { log_uart_irq_set(&stdio_uart_log, IIR_RX_RDY, enable); } else { log_uart_irq_set(&stdio_uart_log, IIR_THR_EMPTY, enable); } return; } #endif PHAL_RUART_ADAPTER pHalRuartAdapter; PHAL_RUART_OP pHalRuartOp; u8 uart_idx; pHalRuartAdapter = &(obj->hal_uart_adp); pHalRuartOp = &(obj->hal_uart_op); uart_idx = pHalRuartAdapter->UartIndex; if (enable) { if (irq == RxIrq) { pHalRuartAdapter->Interrupts |= RUART_IER_ERBI | RUART_IER_ELSI; serial_irq_en[uart_idx] |= SERIAL_RX_IRQ_EN; HalRuartSetIMRRtl8195a (pHalRuartAdapter); } else { serial_irq_en[uart_idx] |= SERIAL_TX_IRQ_EN; } pHalRuartOp->HalRuartRegIrq(pHalRuartAdapter); //log_uart pHalRuartOp->HalRuartIntEnable(pHalRuartAdapter); } else { // disable if (irq == RxIrq) { pHalRuartAdapter->Interrupts &= ~(RUART_IER_ERBI | RUART_IER_ELSI); serial_irq_en[uart_idx] &= ~SERIAL_RX_IRQ_EN; } else { pHalRuartAdapter->Interrupts &= ~RUART_IER_ETBEI; serial_irq_en[uart_idx] &= ~SERIAL_TX_IRQ_EN; } HalRuartSetIMRRtl8195a (pHalRuartAdapter); if (pHalRuartAdapter->Interrupts == 0) { InterruptUnRegister(&pHalRuartAdapter->IrqHandle); InterruptDis(&pHalRuartAdapter->IrqHandle); } } }
//--------------------------------------------------------------------------------------------------- //Function Name: // RtkI2CIrqDeInit // // Description: // I2C interrupt de-initialization function. // According to the given I2C device number, the I2C interrupt will be unreigster // from the platform and the relative interrupt handler will be cleared. // // Arguments: // [in] VOID *Data - // I2C SAL handle // // Return: // The status of the I2C interrupt de-initialization process. // _EXIT_SUCCESS if the RtkI2CIrqDeInit succeeded. // _EXIT_FAILURE if the RtkI2CIrqDeInit failed. // // Note: // NA // // See Also: // NA // // Author: // By Jason Deng, 2014-04-03. // //---------------------------------------------------------------------------------------------------- static RTK_STATUS RtkDACIrqDeInit( IN PSAL_DAC_HND pSalDACHND ){ PSAL_DAC_HND_PRIV pSalDACHNDPriv = NULL; PSAL_DAC_MNGT_ADPT pSalDACMngtAdpt = NULL; PIRQ_HANDLE pIrqHandle = NULL; /*To Get the SAL_I2C_MNGT_ADPT Pointer*/ pSalDACHNDPriv = CONTAINER_OF(pSalDACHND, SAL_DAC_HND_PRIV, SalDACHndPriv); pSalDACMngtAdpt = CONTAINER_OF(pSalDACHNDPriv->ppSalDACHnd, SAL_DAC_MNGT_ADPT, pSalHndPriv); pIrqHandle = pSalDACMngtAdpt->pIrqHnd; if (RtkDACIdxChk(pSalDACHND->DevNum)) return _EXIT_FAILURE; InterruptUnRegister(pIrqHandle); return _EXIT_SUCCESS; }
void serial_irq_set(serial_t *obj, SerialIrq irq, uint32_t enable) { PHAL_RUART_ADAPTER pHalRuartAdapter; PHAL_RUART_OP pHalRuartOp; u8 uart_idx; pHalRuartAdapter = &(obj->hal_uart_adp); pHalRuartOp = &(obj->hal_uart_op); uart_idx = pHalRuartAdapter->UartIndex; if (enable) { if (irq == RxIrq) { pHalRuartAdapter->Interrupts |= RUART_IER_ERBI | RUART_IER_ELSI; serial_irq_en[uart_idx] |= SERIAL_RX_IRQ_EN; HalRuartSetIMRRtl8195a (pHalRuartAdapter); } else { serial_irq_en[uart_idx] |= SERIAL_TX_IRQ_EN; } pHalRuartOp->HalRuartRegIrq(pHalRuartAdapter); pHalRuartOp->HalRuartIntEnable(pHalRuartAdapter); } else { // disable if (irq == RxIrq) { pHalRuartAdapter->Interrupts &= ~(RUART_IER_ERBI | RUART_IER_ELSI); serial_irq_en[uart_idx] &= ~SERIAL_RX_IRQ_EN; } else { pHalRuartAdapter->Interrupts &= RUART_IER_ETBEI; serial_irq_en[uart_idx] &= ~SERIAL_TX_IRQ_EN; } HalRuartSetIMRRtl8195a (pHalRuartAdapter); if (pHalRuartAdapter->Interrupts == 0) { InterruptUnRegister(&pHalRuartAdapter->IrqHandle); InterruptDis(&pHalRuartAdapter->IrqHandle); } } }
//--------------------------------------------------------------------------------------------------- //Function Name: // RtkI2CIrqDeInit // // Description: // I2C interrupt de-initialization function. // According to the given I2C device number, the I2C interrupt will be unreigster // from the platform and the relative interrupt handler will be cleared. // // Arguments: // [in] VOID *Data - // I2C SAL handle // // Return: // The status of the I2C interrupt de-initialization process. // _EXIT_SUCCESS if the RtkI2CIrqDeInit succeeded. // _EXIT_FAILURE if the RtkI2CIrqDeInit failed. // // Note: // NA // // See Also: // NA // // Author: // By Jason Deng, 2014-04-03. // //---------------------------------------------------------------------------------------------------- static RTK_STATUS RtkDACDMADeInit( IN PSAL_DAC_HND pSalDACHND ){ PSAL_DAC_HND_PRIV pSalDACHNDPriv = NULL; PSAL_DAC_MNGT_ADPT pSalDACMngtAdpt = NULL; PHAL_GDMA_ADAPTER pHALDACGdmaAdpt = NULL; PHAL_GDMA_OP pHALDACGdmaOp = NULL; PIRQ_HANDLE pIrqHandleDACGdma = NULL; /*To Get the SAL_I2C_MNGT_ADPT Pointer*/ pSalDACHNDPriv = CONTAINER_OF(pSalDACHND, SAL_DAC_HND_PRIV, SalDACHndPriv); pSalDACMngtAdpt = CONTAINER_OF(pSalDACHNDPriv->ppSalDACHnd, SAL_DAC_MNGT_ADPT, pSalHndPriv); pHALDACGdmaAdpt = pSalDACMngtAdpt->pHalGdmaAdp; pHALDACGdmaOp = pSalDACMngtAdpt->pHalGdmaOp; pIrqHandleDACGdma = pSalDACMngtAdpt->pIrqGdmaHnd; if (RtkDACIdxChk(pSalDACHND->DevNum)) return _EXIT_FAILURE; HalGdmaOpInit(pHALDACGdmaOp); pHALDACGdmaAdpt->IsrCtrl = DISABLE; pHALDACGdmaOp->HalGdmaChIsrEnAndDis((VOID*)pHALDACGdmaAdpt); pHALDACGdmaOp->HalGdmaChIsrClean((VOID*)pHALDACGdmaAdpt); pHALDACGdmaOp->HalGdmaChDis((VOID*)pHALDACGdmaAdpt); InterruptUnRegister(pIrqHandleDACGdma); #if 0 _memset((void *)pIrqHandleDACGdma , 0, sizeof(IRQ_HANDLE)); _memset((void *)pHALDACGdmaOp , 0, sizeof(HAL_GDMA_OP)); _memset((void *)pHALDACGdmaAdpt , 0, sizeof(HAL_GDMA_ADAPTER)); #endif return _EXIT_SUCCESS; }