/* ARGSUSED */ Void SMGRMP_delete(LockMP_Handle lock, SMGRMP_Handle handle) { #ifdef xdc_target__os_Linux Int shmId = handle->sharedMemId; /* Shared Mem Id */ #endif Void * base = (Void *)(shmAddrs[handle->shmCount]); /* Base Address */ /* Decrease the refCount */ handle->refCount--; /* If the referenceCount is zero, call the SMGR delete */ if (0 == handle->refCount) { SMGR_delete(SMGRHANDLE(handle)); shmAddrs[handle->shmCount] = NULL; shmIndex[handle->shmCount] = NULL; shmTotal--; if (shmTotal == 0) { shmCount = 0; } } #ifdef xdc_target__os_Linux /* Free the shared memory segment */ SHM_freeObj(lock, base, shmId); #else free(base); #endif }
/* * ======== freeInternalState ======== */ static void freeInternalState() { #ifdef xdc_target__os_Linux SHM_freeObj(_resmanInternalState, _resmanInternalState->sharedMemId); #else _resmanInternalState = NULL; #endif }
int EDMA_exit(void) { Int refCount = state->refCount; #ifdef xdc_target__os_Linux SHM_freeObj(state, state->sharedMemId); state = NULL; #endif return (1); }
/* * ======== freeInternalState ======== */ static void freeInternalState() { CMEM_unregister(armtcmAddr, NULL); armtcmAddr = NULL; _resmanInternalState->numOpens--; if (_resmanInternalState->numOpens == 0) { //Do whatever, CMEM_free no longer needed } SHM_freeObj(_MEMTCM_lock, (Void *)_resmanInternalState, (Int)_resmanInternalState->sharedMemId); }
/* * ======== freeInternalState ======== */ static void freeInternalState() { if (rmanInternalState->info.numOpens == 0) { } #ifdef xdc_target__os_Linux SHM_freeObj(rmanInternalState, rmanInternalState->info.sharedMemId); #else if (algresVTable) { free(algresVTable); algresVTable = NULL; } rmanInternalState = NULL; #endif }
/* * ======== RMP_delete ======== */ Void RMP_delete(RMP_Handle handle) { #ifdef xdc_target__os_Linux Int shmId = handle->sharedMemId; /* Shared Mem Id */ #endif Void * base = (Void *)(shmAddrs[handle->shmCount]); /* Base Address */ /* Decrease the refCount */ handle->refCount--; /* If the referenceCount is zero, call the RMM delete */ if (0 == handle->refCount) { RMM_delete(RMMHANDLE(handle)); } #ifdef xdc_target__os_Linux /* Free the shared memory segment */ SHM_freeObj(base, shmId); #else free(base); #endif }