Esempio n. 1
0
/*
 *  ======== MessageQ_Instance_finalize ========
 */
Void ti_sdo_ipc_MessageQ_Instance_finalize(
        ti_sdo_ipc_MessageQ_Object* obj, Int status)
{
    UInt key;
    MessageQ_QueueIndex index = (MessageQ_QueueIndex)(obj->queue);
    List_Handle listHandle;

    if (obj->syncSemHandle != NULL) {
        SyncSem_delete(&obj->syncSemHandle);
    }

    listHandle = ti_sdo_ipc_MessageQ_Instance_State_normalList(obj);
    
    /* Destruct the list */
    List_destruct(List_struct(listHandle));
    
    listHandle = ti_sdo_ipc_MessageQ_Instance_State_highList(obj);
    
    /* Destruct the list */
    List_destruct(List_struct(listHandle));
    
    /* lock */
    key = IGateProvider_enter(MessageQ_module->gate);    
        
    /* Null out entry in the array. */
    MessageQ_module->queues[index] = NULL;
        
    /* unlock scheduler */
    IGateProvider_leave(MessageQ_module->gate, key);    
    
    if (obj->nsKey != NULL) {
        NameServer_removeEntry((NameServer_Handle)MessageQ_module->nameServer, 
            obj->nsKey);
    }
}
Esempio n. 2
0
/*
 *  ======== ti_sdo_ipc_Notify_Instance_finalize ========
 */
Void ti_sdo_ipc_Notify_Instance_finalize(ti_sdo_ipc_Notify_Object *obj,
        Int status)
{
    UInt    i;
    UInt16  clusterId = ti_sdo_utils_MultiProc_getClusterId(obj->remoteProcId);

    switch (status) {
    case 0:
        /* Unregister the notify instance from the Notify module */
        Notify_module->notifyHandles[clusterId][obj->lineId] = NULL;

        /* Destruct the event lists */
        for (i = 0; i < ti_sdo_ipc_Notify_numEvents; i++) {
            List_destruct(List_struct(List_Object_get(obj->eventList, i)));
        }

        /* Free memory used for the List.Objects */
        Memory_free(ti_sdo_ipc_Notify_Object_heap(), obj->eventList,
                    sizeof(List_Struct) * ti_sdo_ipc_Notify_numEvents);

    /* OK to fall through */

    case 1:
        /* Free memory used for callbacks array */
        Memory_free(ti_sdo_ipc_Notify_Object_heap(), obj->callbacks,
                    sizeof(ti_sdo_ipc_Notify_EventCallback) *
                    ti_sdo_ipc_Notify_numEvents);
    }
}
Esempio n. 3
0
/*
 *  ======== Stream_Instance_finalize ========
 */
Void Stream_Instance_finalize(Stream_Object *obj, Int status)
{    
    List_Handle freeList;
    SyncSemThread_Handle tempSyncHdl;

    Assert_isTrue((obj->issued == 0), Stream_A_pendingReclaims);

    /* fall through in switch below is intentional */
    switch (status) {
        /* Stream_delete() */
        case 0:        
            IConverter_close(obj->convHandle, NULL);
                
        /* IConverter_open failed */
        case 5:
           if (obj->drvAdapHdl == TRUE) {
               IConverter_delete(&obj->convHandle);
           }
               
        /* DriverAdapter create failed */
        case 4:
        
        /* name not found */
        case 3:
            Memory_free(obj->packetHeap, obj->packets, 
            sizeof(DriverTypes_Packet) * obj->maxIssues);
        
        /* alloc packets failed */
        case 2:
            
            freeList = Stream_Instance_State_freeList(obj);
            List_destruct(List_struct(freeList));
            
            if (obj->userSync == FALSE) {
                tempSyncHdl = SyncSemThread_Handle_downCast(obj->complete);
                SyncSemThread_delete(&tempSyncHdl);
            }

        /* Sync_create failed */
        case 1:

        default:
            break;
    };

}
/*
 *  ======== SystemCfg_exit ========
 */
Void SystemCfg_exit(Void)
{
//  Registry_Result result;


    if (curInit-- != 1) {
        return;  /* object still being used */
    }

    /* unregister from xdc.runtime */
//  result = Registry_removeModule(MODULE_NAME);
//  Assert_isTrue(result == Registry_SUCCESS, (Assert_Id)NULL);

    List_destruct(&Mod_objListStruct);
    Mod_objList = NULL;

    GateHwi_destruct(&Mod_gateStruct);
    Mod_gate = NULL;
}