//------------------------------------------------------------------------------ tHostifReturn hostif_deleteInt(tHostif* pHostif_p) { tHostifReturn ret = kHostifSuccessful; int i; // deactivate bridge (ignore ret) ret = controlBridge(pHostif_p, FALSE); // Free init parameter if (pHostif_p->pInitParam != NULL) { HOSTIF_UNCACHED_FREE(pHostif_p->pInitParam); } hostif_writeInitBase(pHostif_p->pBase, (UINT32)NULL); // Free buffers for (i = 0; i < kHostifInstIdLast; i++) { if (pHostif_p->aBufMap[i].pBase != NULL) { HOSTIF_UNCACHED_FREE(pHostif_p->aBufMap[i].pBase); } hostif_writeBufPcp(pHostif_p->pBase, i, (UINT32)NULL); } return ret; }
//------------------------------------------------------------------------------ tQueueReturn lfq_delete (tQueueInstance pInstance_p) { tQueue *pQueue = (tQueue*)pInstance_p; if(pQueue == NULL) return kQueueInvalidParameter; switch(pQueue->config.queueRole) { case kQueueProducer: break; case kQueueConsumer: case kQueueBoth: setHwQueueState(pQueue, kQueueStateInvalid); } /// free memory for queue if(pQueue->config.fAllocHeap != FALSE) HOSTIF_UNCACHED_FREE(pQueue->pBase); /// free memory for queue instance freePtr(pQueue); return kQueueSuccessful; }