X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fcm_mem_wl.c;h=cd042a4335edb2f169b2a28db8e2068371ab2350;hb=f0f43ed6f745eec0ceb4e204c62f4dc36f1e8d7f;hp=7c60b2a59cbc3a6fd6ca50d9f4b2123dd1b200d7;hpb=65443172dd60a6ea312bd3a15959dbf54ad7f045;p=o-du%2Fl2.git diff --git a/src/cm/cm_mem_wl.c b/src/cm/cm_mem_wl.c index 7c60b2a59..cd042a433 100755 --- a/src/cm/cm_mem_wl.c +++ b/src/cm/cm_mem_wl.c @@ -119,7 +119,7 @@ S32 clusterMode; #endif #include "cm_lte.x" - +#include "du_log.h" /* local defines */ /*ccpu00142274 - UL mem based flow control changes */ @@ -388,7 +388,6 @@ void DumpLayersDebugInformation() * File: cm_mem_wl.c * */ -#ifdef ANSI static Void cmMmStatBktInit ( Data **memAddr, @@ -397,14 +396,6 @@ CmMmRegCfg *cfg, uint16_t bktIdx, uint16_t *lstMapIdx ) -#else -static Void cmMmStatBktInit (memAddr, regCb, cfg, bktIdx, lstMapIdx) -Data **memAddr; -CmMmRegCb *regCb; -CmMmRegCfg *cfg; -uint16_t bktIdx; -uint16_t *lstMapIdx; -#endif { uint32_t cnt; uint16_t idx; @@ -553,19 +544,12 @@ uint16_t *lstMapIdx; * File: cm_mem_wl.c * */ -#ifdef ANSI S16 cmMmStatRegInit ( Region region, CmMmRegCb *regCb, CmMmRegCfg *cfg ) -#else -S16 cmMmStatRegInit(region, regCb, cfg) -Region region; -CmMmRegCb *regCb; -CmMmRegCfg *cfg; -#endif { Data *memAddr; uint16_t bktIdx; @@ -807,15 +791,10 @@ CmMmRegCfg *cfg; * File: cm_mem_wl.c * */ -#ifdef ANSI S16 cmMmGlobRegInit ( CmMmGlobRegCb *regCb ) -#else -S16 cmMmGlobRegInit(regCb) -CmMmGlobRegCb *regCb; -#endif { Data **memAddr; Data **next; @@ -899,7 +878,6 @@ CmMmGlobRegCb *regCb; * */ #ifdef T2K_MEM_LEAK_DBG -#ifdef ANSI static S16 cmIccAllocWithLock ( Void *regionCb, /* Pointer to a region */ @@ -909,9 +887,7 @@ Data **ptr, /* Reference to pointer for which need to be allocate */ char *file, uint32_t line ) -#endif #else -#ifdef ANSI static S16 cmIccAllocWithLock ( Void *regionCb, /* Pointer to a region */ @@ -919,13 +895,6 @@ Size *size, /* size needs to be allocated */ uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) -#else -static S16 cmIccAllocWithLock(regionCb, size, flags, ptr) -Void *regionCb; /* Pointer to a region */ -Size *size; /* size needs to be allocated */ -uint32_t flags; /* Flags used */ -Data **ptr; /* Reference to pointer for which need to be allocate */ -#endif #endif { CmMmDynRegCb *regCb; @@ -991,7 +960,6 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ * */ #ifdef T2K_MEM_LEAK_DBG -#ifdef ANSI static S16 cmIccFreeWithLock ( Void *regionCb, /* Pointer to region cb */ @@ -1000,21 +968,13 @@ Size size, /* Size of the block */ char *file, uint32_t line ) -#endif #else -#ifdef ANSI static S16 cmIccFreeWithLock ( Void *regionCb, /* Pointer to region cb */ Data *ptr, /* Memory block needs to be freed */ Size size /* Size of the block */ ) -#else -static S16 cmIccFreeWithLock(regionCb, ptr, size) -Void *regionCb; /* Pointer to region cb */ -Data *ptr; /* Memory block needs to be freed */ -Size size; /* Size of the block */ -#endif #endif { CmMmDynRegCb *regCb; @@ -1059,7 +1019,6 @@ Size size; /* Size of the block */ * */ #ifdef T2K_MEM_LEAK_DBG -#ifdef ANSI static S16 cmIccAlloc ( Void *regionCb, /* Pointer to a region */ @@ -1070,9 +1029,6 @@ char *file, uint32_t line ) #else -#endif -#else -#ifdef ANSI static S16 cmIccAlloc ( Void *regionCb, /* Pointer to a region */ @@ -1080,13 +1036,6 @@ Size *size, /* size needs to be allocated */ uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) -#else -static S16 cmIccAlloc(regionCb, size, flags, ptr) -Void *regionCb; /* Pointer to a region */ -Size *size; /* size needs to be allocated */ -uint32_t flags; /* Flags used */ -Data **ptr; /* Reference to pointer for which need to be allocate */ -#endif #endif { @@ -1150,19 +1099,12 @@ char* file, uint32_t line ) #else -#ifdef ANSI static S16 cmIccFree ( Void *regionCb, /* Pointer to region cb */ Data *ptr, /* Memory block needs to be freed */ Size size /* Size of the block */ ) -#else -static S16 cmIccFree(regionCb, ptr, size) -Void *regionCb; /* Pointer to region cb */ -Data *ptr; /* Memory block needs to be freed */ -Size size; /* Size of the block */ -#endif #endif { CmMmDynRegCb *regCb; @@ -1214,15 +1156,10 @@ Size size; /* Size of the block */ * File: cm_mem_wl.c * */ -#ifdef ANSI S16 cmMmDynRegInit ( CmMmDynRegCb *regCb ) -#else -S16 cmMmDynRegInit(regCb) -CmMmDynRegCb *regCb; -#endif { SRegInfo regInfo; #ifdef T2200_2GB_DDR_CHANGES @@ -1323,15 +1260,10 @@ CmMmDynRegCb *regCb; * File: cm_mem_wl.c * */ -#ifdef ANSI S16 cmMmDynRegInit ( CmMmDynRegCb *regCb ) -#else -S16 cmMmDynRegInit(regCb) -CmMmDynRegCb *regCb; -#endif { Region region; uint16_t lstMapIdx; @@ -1454,15 +1386,7 @@ CmMmDynRegCb *regCb; * File: cm_mem_wl.c * */ -#ifdef ANSI -S16 cmMmRegDeInit -( -CmMmRegCb *regCb -) -#else -S16 cmMmRegDeInit(regCb) -CmMmRegCb *regCb; -#endif +S16 cmMmRegDeInit(CmMmRegCb *regCb) { uint16_t bktIdx; @@ -1553,17 +1477,11 @@ CmMmRegCb *regCb; * */ -#ifdef ANSI static CmMmBlkSetElement* cmGetMemBlkSetForAlloc ( -uint8_t bucketIndex, /* Index to the bucket list */ +uint8_t bucketIndex, /* Index to the bucket list */ CmMmDynBktCb *bkt /* Bucket list control block */ ) -#else -static CmMmBlkSetElement* cmGetMemBlkSetForAlloc(bucketIndex, bkt) -uint8_t bucketIndex; /* Index to the bucket list */ -CmMmDynBktCb *bkt; /* Bucket list control block */ -#endif { CmMmBlkSetElement *memBlkSetElem; CmMmBlkSetElement *nextMemBlkSetElem; @@ -1677,17 +1595,11 @@ CmMmDynBktCb *bkt; /* Bucket list control block */ * */ -#ifdef ANSI static CmMmBlkSetElement* cmGetMemBlkSetForFree ( -uint8_t bucketIndex, /* Index to the bucket list */ +uint8_t bucketIndex, /* Index to the bucket list */ CmMmDynBktCb *bkt /* Bucket list control block */ ) -#else -static CmMmBlkSetElement* cmGetMemBlkSetForFree(bucketIndex, bkt) -uint8_t bucketIndex; /* Index to the bucket list */ -CmMmDynBktCb *bkt; /* Bucket list control block */ -#endif { CmMmBlkSetElement *memBlkSetElem; CmMmBlkSetElement *nextMemBlkSetElem; @@ -1793,17 +1705,11 @@ CmMmDynBktCb *bkt; /* Bucket list control block */ * */ -#ifdef ANSI static S16 cmRemoveAllocPtrFromList ( CmMmDynRegCb *regionCb, /* Pointer to a region */ PTR ptr ) -#else -static S16 cmRemoveAllocPtrFromList(regionCb, ptr) -CmMmDynRegCb *regionCb; /* Pointer to a region */ -PTR ptr; -#endif { CmMemDoubleFree *memNode = NULLP; @@ -1837,7 +1743,7 @@ PTR ptr; return RFAILED; } SUnlock(&memDoubleFreeLock); - SPutSBuf(regionCb->region, 0, (Data *)memNode, sizeof(CmMemDoubleFree)); + SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,regionCb->region, 0, (Data *)memNode, sizeof(CmMemDoubleFree)); return ROK; } @@ -1859,22 +1765,16 @@ PTR ptr; * */ -#ifdef ANSI static S16 cmInsertAllocPtrToList ( CmMmDynRegCb *regionCb, /* Pointer to a region */ PTR ptr ) -#else -static S16 cmInsertAllocPtrToList(regionCb, ptr) -CmMmDynRegCb *regionCb; /* Pointer to a region */ -PTR ptr; -#endif { CmMemDoubleFree *memNode; - SGetSBuf(regionCb->region, 0, (Data **)&memNode, sizeof(CmMemDoubleFree)); + SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,regionCb->region, 0, (Data **)&memNode, sizeof(CmMemDoubleFree)); if(memNode == NULLP) { return RFAILED; @@ -1913,7 +1813,6 @@ PTR ptr; */ /* cm_mem_c_001.main_15 : Additions */ -#ifdef ANSI static S16 cmDynAllocWithLock ( Void *regionCb, /* Pointer to a region */ @@ -1921,17 +1820,9 @@ Size *size, /* size needs to be allocated */ uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) -#else -static S16 cmDynAllocWithLock(regionCb, size, flags, ptr) -Void *regionCb; /* Pointer to a region */ -Size *size; /* size needs to be allocated */ -uint32_t flags; /* Flags used */ -Data **ptr; /* Reference to pointer for which need to be allocate */ -#endif { S16 ret; - if((SLock(&dynAllocFreeLock)) != ROK) { printf("cmDynAllocWithLock: Failed to get the dyn lock\n"); @@ -1966,21 +1857,13 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ */ /* cm_mem_c_001.main_15 : Additions */ -#ifdef ANSI static S16 cmDynAlloc ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -uint32_t flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) -#else -static S16 cmDynAlloc(regionCb, size, flags, ptr) -Void *regionCb; /* Pointer to a region */ -Size *size; /* size needs to be allocated */ -uint32_t flags; /* Flags used */ -Data **ptr; /* Reference to pointer for which need to be allocate */ -#endif { CmMmDynRegCb *regCb; @@ -1997,8 +1880,27 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ #if (ERRCLASS & ERRCLS_INT_PAR) /* error check on parameters */ - if ((regCb == NULLP) || (size == NULLP) || !(*size) || (ptr == NULLP)) + if(regCb == NULLP) + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory region pointer is null"); + return RFAILED; + } + + if(ptr == NULLP) + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory block pointer is null"); + return RFAILED; + } + + if(size == NULLP) + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory size pointer null"); + return RFAILED; + } + + if(!(*size)) { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory block size is 0"); return RFAILED; } #endif @@ -2030,14 +1932,15 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ #if (ERRCLASS & ERRCLS_DEBUG) if (regCb->mapTbl[idx].bktIdx == 0xFF) - { - printf("Failed to get the buffer of size %d\n", *size); + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Failed to get the buffer of size %d\n", *size); /* Some fatal error in the map table initialization. */ return RFAILED; } #endif if (idx > 512) { + DU_LOG("\nERROR --> CM: cmDynAlloc(): idx value is greater than 512"); return RFAILED; } /* Dequeue the memory block and return it to the user */ @@ -2059,9 +1962,9 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ if(dynMemElem == NULLP) { #ifndef ALIGN_64BIT - printf("Failed to get the buffer of size %ld\n", *size); + DU_LOG("\nERROR --> CM: cmDynAlloc(): Failed to get the buffer of size %ld\n", *size); #else - printf("Failed to get the buffer of size %d\n", *size); + printf("\nERROR --> CM: cmDynAlloc(): Failed to get the buffer of size %d\n", *size); #endif return RFAILED; } @@ -2077,6 +1980,7 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ *ptr = dynMemElem->nextBktPtr; if (*ptr == NULLP) { + DU_LOG("\nERROR --> CM: cmDynAlloc(): nextBktPtr is null"); return RFAILED; } dynMemElem->nextBktPtr = *((CmMmEntry **)(*ptr)); @@ -2118,9 +2022,9 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ /* If the size is not matching, return failure to caller */ #ifndef ALIGN_64BIT - printf("Failed to get the buffer of size %ld\n", *size); + DU_LOG("\nERROR --> CM : cmDynAlloc(): Failed to get the buffer of size %ld\n", *size); #else - printf("Failed to get the buffer of size %d\n", *size); + DU_LOG("\nERROR --> CM: cmDynAlloc(): Failed to get the buffer of size %d\n", *size); #endif return RFAILED; @@ -2135,7 +2039,10 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ *ptr = (Data *)malloc(*size); if ( (*ptr) == NULLP) - return RFAILED; + { + DU_LOG("\nERROR --> CM : cmDynAlloc(): Data ptr is null"); + return RFAILED; + } /* avail_size -= *size; */ return ROK; #endif /* USE_PURE */ @@ -2195,7 +2102,6 @@ static S16 cmAlloc #else #ifdef SS_HISTOGRAM_SUPPORT #ifdef SSI_DEBUG_LEVEL1 -#ifdef ANSI static S16 cmAlloc ( Void *regionCb, @@ -2209,19 +2115,6 @@ uint8_t entId, Bool hstReg ) #else -static S16 cmAlloc(regionCb, size, flags, ptr, memType, line, fileName, entId, hstReg) -Void *regionCb; -Size *size; -uint32_t flags; -Data **ptr; -uint32_t memType; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -Bool hstReg; -#endif -#else -#ifdef ANSI static S16 cmAlloc ( Void *regionCb, @@ -2233,23 +2126,11 @@ uint8_t *fileName, uint8_t entId, Bool hstReg ) -#else -static S16 cmAlloc(regionCb, size, flags, ptr, line, fileName, entId, hstReg) -Void *regionCb; -Size *size; -uint32_t flags; -Data **ptr; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -Bool hstReg; -#endif #endif /* SSI_DEBUG_LEVEL1 */ #else #ifdef SSI_DEBUG_LEVEL1 -#ifdef ANSI static S16 cmAlloc ( Void *regionCb, @@ -2259,15 +2140,6 @@ Data **ptr, uint32_t memType ) #else -static S16 cmAlloc(regionCb, size, flags, ptr, memType) -Void *regionCb; -Size *size; -uint32_t flags; -Data **ptr; -uint32_t memType; -#endif -#else -#ifdef ANSI static S16 cmAlloc ( Void *regionCb, @@ -2275,13 +2147,6 @@ Size *size, uint32_t flags, Data **ptr ) -#else -static S16 cmAlloc(regionCb, size, flags, ptr) -Void *regionCb; -Size *size; -uint32_t flags; -Data **ptr; -#endif #endif #endif /* SSI_DEBUG_LEVEL1 */ @@ -2327,8 +2192,27 @@ Data **ptr; #if (ERRCLASS & ERRCLS_INT_PAR) /* error check on parameters */ - if ((regCb == NULLP) || (size == NULLP) || !(*size) || (ptr == NULLP)) + if(regCb == NULL) + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory region pointer is null"); + return RFAILED; + } + + if(ptr == NULLP) + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory block pointer is null"); + return RFAILED; + } + + if(size == NULLP) + { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory size pointer null"); + return RFAILED; + } + + if(!(*size)) { + DU_LOG("\nERROR --> CM: cmDynAlloc(): Received memory block size is 0"); return RFAILED; } #endif @@ -2338,6 +2222,7 @@ Data **ptr; #if (ERRCLASS & ERRCLS_INT_PAR) if ((memType != CMM_STATIC_MEM_FLAG) && (memType != CMM_DYNAMIC_MEM_FLAG)) { + DU_LOG("\nERROR --> CM : cmAlloc(): memType[%d] is invalid",memType); return RFAILED; } #endif /* (ERRCLASS & ERRCLS_INT_PAR) */ @@ -2382,6 +2267,7 @@ Data **ptr; if (regCb->mapTbl[idx].bktIdx == 0xFF) { /* Some fatal error in the map table initialization. */ + DU_LOG("\nERROR --> CM : cmAlloc(): bktIdx is invalid"); return RFAILED; } #endif @@ -2470,6 +2356,7 @@ Data **ptr; #else (Void) SUnlock(&(bkt->bktLock)); #endif + DU_LOG("\nERROR --> CM : cmAlloc(): Sanity check returns failure"); /* return RFAILED */ return RFAILED; } @@ -2667,6 +2554,7 @@ Data **ptr; } /* No memory available */ + DU_LOG("\nERROR --> CM : cmAlloc(): No memory available in heap"); return RFAILED; #else /* use pure is on */ /*cm_mem_c_001.main_27 SSI-4GMX specfic changes*/ @@ -2677,7 +2565,10 @@ Data **ptr; *ptr = (Data*) malloc(*size); #endif if ( (*ptr) == NULLP) + { + DU_LOG("\nERROR --> CM : cmAlloc(): ptr is null"); return RFAILED; + } avail_size -= *size; return ROK; #endif /* USE_PURE */ @@ -2700,19 +2591,11 @@ Data **ptr; * File: cm_mem_wl.c * */ -#ifdef ANSI -S16 cmInitDoubleFreeList -( -Void -) -#else -S16 cmInitDoubleFreeList() -#endif +S16 cmInitDoubleFreeList(void) { - uint16_t offset; + uint16_t offset; CmMemDoubleFree memNode; - offset = (uint16_t)((PTR)(&memNode.tmpListEnt) - (PTR)&memNode); if((cmHashListInit(&(memDoubleFree), 1000, offset, 0, @@ -2742,13 +2625,7 @@ S16 cmInitDoubleFreeList() * File: cm_mem_wl.c * */ -#ifdef ANSI -static S16 cmInitBtInfo -( -) -#else -static S16 cmInitBtInfo (Void) -#endif +static S16 cmInitBtInfo() { regBtInfo = (CmBtInfo *)calloc(1, 8 * sizeof (CmBtInfo)); if (regBtInfo == NULLP) @@ -2780,17 +2657,11 @@ static S16 cmInitBtInfo (Void) * File: cm_mem_wl.c * */ -#ifdef ANSI Void cmAnalyseBtInfo ( PTR ptr, /* Memory block needs to be freed */ uint32_t idx ) -#else -Void cmAnalyseBtInfo (ptr,idx) -PTR ptr; /* Memory block needs to be freed */ -uint32_t idx; -#endif { uint32_t tmpCnt; uint32_t btIdx; @@ -2851,22 +2722,15 @@ uint32_t idx; * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmDynFreeWithLock ( Void *regionCb, /* Pointer to region cb */ Data *ptr, /* Memory block needs to be freed */ Size size /* Size of the block */ ) -#else -static S16 cmDynFreeWithLock(regionCb, ptr, size) -Void *regionCb; /* Pointer to region cb */ -Data *ptr; /* Memory block needs to be freed */ -Size size; /* Size of the block */ -#endif { S16 ret; - + if((SLock(&dynAllocFreeLock)) != ROK) { printf("dynAllocWithLock: Failed to get the DYN lock\n"); @@ -2901,19 +2765,12 @@ Size size; /* Size of the block */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmDynFree ( Void *regionCb, /* Pointer to region cb */ Data *ptr, /* Memory block needs to be freed */ Size size /* Size of the block */ ) -#else -static S16 cmDynFree(regionCb, ptr, size) -Void *regionCb; /* Pointer to region cb */ -Data *ptr; /* Memory block needs to be freed */ -Size size; /* Size of the block */ -#endif { CmMmDynRegCb *regCb; #ifndef USE_PURE @@ -2941,6 +2798,7 @@ Size size; /* Size of the block */ /* error check on parameters */ if ((regCb == NULLP) || (!size) || (ptr == NULLP)) { + DU_LOG("\nERROR --> CM : cmDynFree(): Received memory region[%p] or size[%p] or block[%p] is invalid",regCb,size,ptr); return RFAILED; } @@ -2948,12 +2806,14 @@ Size size; /* Size of the block */ if (ptr >= ((CmMmRegCb *)regCb)->regInfo.start + ((CmMmRegCb *)regCb)->regInfo.size) { + DU_LOG("\nERROR --> CM : cmDynFree(): Memory block[%p] not from region[%d]", ptr, ((CmMmRegCb *)regCb)->region); return RFAILED; } /* cm_mem_c_001.main_20 Addition */ if (ptr < regCb->regInfo.start) { - return RFAILED; + DU_LOG("\nERROR --> CM : cmDynFree(): Memory block[%p] not from region[%d]", ptr, ((CmMmRegCb *)regCb)->region); + return RFAILED; } #endif @@ -2970,6 +2830,7 @@ Size size; /* Size of the block */ #if (ERRCLASS & ERRCLS_DEBUG) if (regCb->mapTbl[idx].bktIdx == 0xFF) { + DU_LOG("\nERROR --> CM : cmDynFree(): bktIdx is not valid"); /* Some fatal error in the map table initialization. */ return RFAILED; } @@ -2988,13 +2849,13 @@ Size size; /* Size of the block */ #ifdef SS_MEM_WL_DEBUG if (size > bkt->size) { - printf("Size = %d bucket size = %d\n", size, bkt->size); + DU_LOG("Size = %d bucket size = %d\n", size, bkt->size); exit(-1); bkt = &(regCb->bktTbl[bktIdx = regCb->mapTbl[++idx].bktIdx]); } if(size > bkt->size) { - printf("2nd time Size = %d bucket size = %d\n", size, bkt->size); + DU_LOG("2nd time Size = %d bucket size = %d\n", size, bkt->size); exit(-1); uint8_t *tmpptr = NULLP; printf("Bucket Size wrong \n"); @@ -3007,6 +2868,7 @@ Size size; /* Size of the block */ /* Check if the bucket index, if its not valid, return failure */ if(dynMemElem == NULLP) { + DU_LOG("\nERROR --> CM : cmDynFree(): dynMemElem is null"); return RFAILED; } @@ -3049,7 +2911,6 @@ Size size; /* Size of the block */ memset(ptr, (regCb->region+1), bkt->size); #endif - /* Get the bucket node from the index returned and allocate the memory */ *((CmMmEntry **)ptr) = dynMemElem->nextBktPtr; dynMemElem->nextBktPtr = ptr; @@ -3110,7 +2971,6 @@ static S16 cmFree ) #else #ifdef SS_HISTOGRAM_SUPPORT -#ifdef ANSI static S16 cmFree ( Void *regionCb, @@ -3122,31 +2982,12 @@ uint8_t entId, Bool hstReg ) #else -static S16 cmFree(regionCb, ptr, size, line, fileName, entId, hstReg) -Void *regionCb; -Data *ptr; -Size size; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -Bool hstReg; -#endif - -#else - -#ifdef ANSI static S16 cmFree ( Void *regionCb, Data *ptr, Size size ) -#else -static S16 cmFree(regionCb, ptr, size) -Void *regionCb; -Data *ptr; -Size size; -#endif #endif /* cm_mem_c_001.main_15 : Additions */ #endif /* SS_HISTOGRAM_SUPPORT */ @@ -3177,6 +3018,7 @@ Size size; /* error check on parameters */ if ((regCb == NULLP) || (!size) || (ptr == NULLP)) { + DU_LOG("\nERROR --> CM : cmFree(): Received memory region[%p] or size[%p] or block[%p] is invalid",regCb,size,ptr); return RFAILED; } @@ -3184,11 +3026,13 @@ Size size; if (ptr >= ((CmMmRegCb *)regCb)->regInfo.start + ((CmMmRegCb *)regCb)->regInfo.size) { + DU_LOG("\nERROR --> CM : cmFree(): Memory block[%p] not from region[%d]",ptr,regCb.region); return RFAILED; } /* cm_mem_c_001.main_20 Addition */ if (ptr < regCb->regInfo.start) { + DU_LOG("\nERROR --> CM : cmFree(): Memory block[%p] not from region[%d]",ptr,regCb.region); return RFAILED; } @@ -3214,6 +3058,7 @@ Size size; if (regCb->mapTbl[idx].bktIdx == 0xFF) { /* Some fatal error in the map table initialization. */ + DU_LOG("\nERROR --> CM : cmFree(): Invalid bktIdx"); return RFAILED; } #endif @@ -3297,6 +3142,7 @@ Size size; #endif /* handle RTRAMPLINGNOK in SFree/SPutSBuf */ + DU_LOG("\nERROR --> CM : cmFree(): Sanity check returns failure"); return (RTRAMPLINGNOK); } } @@ -3329,6 +3175,7 @@ Size size; #endif /* handle RDBLFREE in SFree/SPutSBuf */ + DU_LOG("\nERROR --> CM : cmFree(): Memory block is already freed"); return (RDBLFREE); } if (CMM_IS_STATIC(ptrHdr->memFlags)) @@ -3385,6 +3232,7 @@ Size size; #endif /* handle RTRAMPLINGNOK in SFree/SPutSBuf */ + DU_LOG("\nERROR --> CM : cmFree(): Sanity check returns failure"); return (RTRAMPLINGNOK); } } @@ -3492,7 +3340,6 @@ char* file, uint32_t line ) #else -#ifdef ANSI static S16 cmAllocWL ( Void *regionCb, @@ -3500,13 +3347,6 @@ Size *size, uint32_t flags, Data **ptr ) -#else -static S16 cmAllocWL(regionCb, size, flags, ptr) -Void *regionCb; -Size *size; -uint32_t flags; -Data **ptr; -#endif #endif { #ifndef USE_PURE @@ -3653,19 +3493,12 @@ char* file, uint32_t line ) #else -#ifdef ANSI static S16 cmFreeWL ( Void *regionCb, Data *ptr, Size size ) -#else -static S16 cmFreeWL(regionCb, ptr, size) -Void *regionCb; -Data *ptr; -Size size; -#endif #endif { #ifndef USE_PURE @@ -3803,19 +3636,12 @@ Size size; * */ -#ifdef ANSI static S16 cmCtl ( Void *regionCb, Event event, SMemCtl *memCtl ) -#else -static S16 cmCtl(regionCb, event, memCtl) -Void *regionCb; -Event event; -SMemCtl *memCtl; -#endif { CmMmRegCb *regCb; @@ -3935,19 +3761,12 @@ SMemCtl *memCtl; * File: cm_mem_wl.c * */ -#ifdef ANSI static Void cmMmHeapInit ( Data *memAddr, CmMmHeapCb *heapCb, Size size ) -#else -static Void cmMmHeapInit (memAddr, heapCb, size) -Data *memAddr; -CmMmHeapCb *heapCb; -Size size; -#endif { /* cm_mem_c_001.main_12 - addition for ssi enhancements */ #ifdef SSI_DEBUG_LEVEL1 @@ -4024,7 +3843,6 @@ Size size; /* cm_mem_c_001.main_15 : Additions */ #ifdef SS_HISTOGRAM_SUPPORT #ifdef SSI_DEBUG_LEVEL1 -#ifdef ANSI static S16 cmHeapAlloc ( CmMmHeapCb *heapCb, @@ -4037,18 +3855,6 @@ uint8_t entId, Bool hstReg ) #else -static S16 cmHeapAlloc (heapCb, ptr, size, memType, line, fileName, entId, hstReg) -CmMmHeapCb *heapCb; -Data **ptr; -Size *size; -uint32_t memType; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -Bool hstReg; -#endif -#else -#ifdef ANSI static S16 cmHeapAlloc ( CmMmHeapCb *heapCb, @@ -4059,20 +3865,9 @@ uint8_t *fileName, uint8_t entId, Bool hstReg ) -#else -static S16 cmHeapAlloc (heapCb, ptr, size, line, fileName, entId, hstReg) -CmMmHeapCb *heapCb; -Data **ptr; -Size *size; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -Bool hstReg; -#endif #endif /* SSI_DEBUG_LEVEL1 */ #else #ifdef SSI_DEBUG_LEVEL1 -#ifdef ANSI static S16 cmHeapAlloc ( CmMmHeapCb *heapCb, @@ -4081,26 +3876,12 @@ Size *size, uint32_t memType ) #else -static S16 cmHeapAlloc (heapCb, ptr, size, memType) -CmMmHeapCb *heapCb; -Data **ptr; -Size *size; -uint32_t memType; -#endif -#else -#ifdef ANSI static S16 cmHeapAlloc ( CmMmHeapCb *heapCb, Data **ptr, Size *size ) -#else -static S16 cmHeapAlloc (heapCb, ptr, size) -CmMmHeapCb *heapCb; -Data **ptr; -Size *size; -#endif #endif /* SSI_DEBUG_LEVEL1 */ /* cm_mem_c_001.main_15 : Additions */ #endif /* SS_HISTOGRAM_SUPPORT */ @@ -4379,7 +4160,6 @@ Size *size; */ /* cm_mem_c_001.main_15 : Additions */ #ifdef SS_HISTOGRAM_SUPPORT -#ifdef ANSI static S16 cmHeapFree ( CmMmHeapCb *heapCb, @@ -4391,29 +4171,12 @@ uint8_t entId, Bool hstReg ) #else -static S16 cmHeapFree (heapCb, ptr, size, line, fileName, entId, hstReg) -CmMmHeapCb *heapCb; -Data *ptr; -Size size; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -Bool hstReg; -#endif -#else -#ifdef ANSI static S16 cmHeapFree ( CmMmHeapCb *heapCb, Data *ptr, Size size ) -#else -static S16 cmHeapFree (heapCb, ptr, size) -CmMmHeapCb *heapCb; -Data *ptr; -Size size; -#endif /* cm_mem_c_001.main_15 : Additions */ #endif /* SS_HISTOGRAM_SUPPORT */ { @@ -4804,17 +4567,10 @@ Size size; * File: cm_mem_wl.c * */ -#ifdef ANSI -Void cmInitMemLeakMdl -( -Void -) -#else -Void cmInitMemLeakMdl (Void) -#endif +Void cmInitMemLeakMdl(Void) { uint8_t memMdl; - uint8_t hashIdx; + uint8_t hashIdx; memLkCb.memLkMdlInit = FALSE; @@ -4852,14 +4608,7 @@ Void cmInitMemLeakMdl (Void) * File: cm_mem_wl.c * **/ -#ifdef ANSI -Void cmDeinitMemLeakMdl -( -Void -) -#else Void cmDeinitMemLeakMdl (Void) -#endif { uint8_t memMdl; uint8_t hashIdx; @@ -4892,15 +4641,7 @@ Void cmDeinitMemLeakMdl (Void) * File: cm_mem_wl.c * */ -#ifdef ANSI -Void cmMemOpenMemLkFile -( -S8 *arg -) -#else -Void cmMemOpenMemLkFile (arg) -S8 *msOptArg; -#endif +Void cmMemOpenMemLkFile(S8 *arg) { memLkCb.fileLkLog = NULLP; memLkCb.fileLkLog = fopen(arg, "w"); @@ -4922,23 +4663,16 @@ S8 *msOptArg; * File: cm_mem_wl.c * */ -#ifdef ANSI -Void SLogLkInfo -( -Void -) -#else Void SLogLkInfo (Void) -#endif { - MemAllocInfo *oldMemInfo; - MemAllocInfo *newMemInfo; - uint8_t memMdl; - uint8_t hashIdx; - uint8_t idx; - Txt prntBuf[255]; - S8 **funcNm; + MemAllocInfo *oldMemInfo; + MemAllocInfo *newMemInfo; + uint8_t memMdl; + uint8_t hashIdx; + uint8_t idx; + Txt prntBuf[255]; + S8 **funcNm; if( memLkCb.memLkMdlInit == FALSE) { return; @@ -5015,21 +4749,14 @@ Void SLogLkInfo (Void) * File: cm_mem_wl.c * */ -#ifdef ANSI -Void SFlushLkInfo -( -Void -) -#else Void SFlushLkInfo (Void) -#endif { - MemAllocInfo *newMemInfo; - uint8_t memMdl; - uint8_t hashIdx; - S8 **funcNm; + MemAllocInfo *newMemInfo; + uint8_t memMdl; + uint8_t hashIdx; + S8 **funcNm; #ifdef SS_MEM_LEAK_SOL - uint8_t i; + uint8_t i; #endif /* SS_MEM_LEAK_SOL */ if( memLkCb.memLkMdlInit == FALSE) @@ -5060,7 +4787,7 @@ Void SFlushLkInfo (Void) #else free(funcNm[i]); #endif - /* SPutSBuf(DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(uint32_t) * CM_MAX_STACK_TRACE); */ + /* SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(uint32_t) * CM_MAX_STACK_TRACE); */ } #endif /* SS_MEM_LEAK_SOl */ /*cm_mem_c_001.main_27 SSI-4GMX specfic changes*/ @@ -5093,7 +4820,6 @@ Void SFlushLkInfo (Void) * File: cm_mem_wl.c * */ -#ifdef ANSI Void cmStorAllocBlk ( uint32_t addr, @@ -5101,13 +4827,6 @@ Size reqSz, Size allocSz, uint16_t bktIdx ) -#else -Void cmStorAllocBlk (addr, reqSz, allocSz, bktIdx) -uint32_t addr; -Size reqSz; -Size allocSz; -uint16_t bktIdx; -#endif /* ANSI */ { #ifndef SS_MEM_LEAK_SOL Ptr trace[CM_MAX_STACK_TRACE]; @@ -5133,7 +4852,7 @@ uint16_t bktIdx; #else funcNm = (S8 **)calloc(1, (sizeof(uint32_t) * CM_MAX_STACK_TRACE)); #endif - /* SGetSBuf(DFLT_REGION, DFLT_POOL, &funcNm, sizeof(uint32_t) * CM_MAX_STACK_TRACE); */ + /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &funcNm, sizeof(uint32_t) * CM_MAX_STACK_TRACE); */ traceSize = backtrace((Void **)funcNm, CM_MAX_STACK_TRACE); #else /* SS_MEM_LEAK_SOL */ traceSize = backtrace(trace, CM_MAX_STACK_TRACE); @@ -5150,7 +4869,7 @@ uint16_t bktIdx; #else allocInfo = (MemAllocInfo *)calloc(1, sizeof(MemAllocInfo)); #endif - /* SGetSBuf(DFLT_REGION, DFLT_POOL, &allocInfo, sizeof(MemAllocInfo)); */ + /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &allocInfo, sizeof(MemAllocInfo)); */ allocInfo->memAddr = addr; allocInfo->reqSz = reqSz; allocInfo->allocSz = allocSz; @@ -5183,17 +4902,11 @@ uint16_t bktIdx; * File: cm_mem_wl.c * */ -#ifdef ANSI uint8_t cmMemGetModuleId ( S8 **funNm, S32 traceSize ) -#else -uint8_t cmMemGetModuleId (funNm, traceSize) -S8 **funNm; -S32 traceSize; -#endif /* ANSI */ { uint8_t idx; uint8_t memStrIdx; @@ -5259,7 +4972,6 @@ S32 traceSize; * File: cm_mem_wl.c * */ -#ifdef ANSI S16 cmMemGetStrMtchIdx ( uint8_t strtIdx, @@ -5267,13 +4979,6 @@ uint8_t endIdx, S8 *str, S8 **strLst ) -#else -S16 cmMemGetStrMtchIdx(strtIdx, endIdx, str, strLst) -uint8_t strtIdx; -uint8_t endIdx; -S8 *str; -S8 **strLst; -#endif { S8 cmpStr[255]; @@ -5332,20 +5037,15 @@ S8 **strLst; * File: cm_mem_wl.c * */ -#ifdef ANSI Void cmRlsAllocBlk ( uint32_t addr ) -#else -Void cmRlsAllocBlk(addr) -uint32_t addr; -#endif { Ptr trace[CM_MAX_STACK_TRACE]; S8 **funcNm; - uint8_t idx; - uint8_t i; + uint8_t idx; + uint8_t i; S16 retVal; S32 traceSize; MemAllocInfo *memAllocInfo; @@ -5471,19 +5171,12 @@ uint32_t addr; * File: cm_mem_wl.c * */ -#ifdef ANSI S32 cmAddrToSymStr ( Void *pc, S8 *buffer, S32 size ) -#else -S32 cmAddrToSymStr(pc, buffer, size) -Void *pc; -S8 *buffer; -S32 size; -#endif { Dl_info info; @@ -5527,19 +5220,12 @@ S32 size; * File: cm_mem_wl.c * */ -#ifdef ANSI S32 cmLeakCallBack ( uintptr_t pc, S32 sigNo, Void *arg ) -#else -S32 cmLeakCallBack(pc, sigNo, arg) -uintptr_t pc; -S32 sigNo; -Void *arg; -#endif { S8 *buffer; @@ -5553,7 +5239,7 @@ Void *arg; #else buffer = (S8 *)calloc(1, 510); #endif - /* SGetSBuf(DFLT_REGION, DFLT_POOL, &buffer, 510); */ + /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &buffer, 510); */ (void) cmAddrToSymStr((void *)pc, buffer, 505); bt->bt_buffer[bt->bt_actcount++] = (S8 *)buffer; @@ -5575,17 +5261,11 @@ Void *arg; * File: cm_mem_wl.c * */ -#ifdef ANSI S32 backtrace ( -Void **buffer, -S32 count +Void **buffer, +S32 count ) -#else -S32 backtrace(buffer, count) -Void **buffer; -S32 count; -#endif { Backtrace_t bt; @@ -5630,15 +5310,7 @@ S32 count; * File: cm_mem_wl.c * */ -#ifdef ANSI -static S16 cmMmBktSanityChk -( -CmMmBkt *bkt -) -#else -static S16 cmMmBktSanityChk(bkt) -CmMmBkt *bkt; -#endif +static S16 cmMmBktSanityChk(CmMmBkt *bkt) { CmMmBlkHdr *ptrBlk; uint32_t blkCnt; @@ -5691,18 +5363,9 @@ CmMmBkt *bkt; * File: cm_mem_wl.c * */ -#ifdef ANSI -static S16 cmMmHeapSanityChk -( -CmMmHeapCb *heapCb -) -#else -static S16 cmMmHeapSanityChk(heapCb) -CmMmHeapCb *heapCb; -#endif +static S16 cmMmHeapSanityChk(CmMmHeapCb *heapCb) { - /* increment the trample count */ heapCb->trampleCount++; @@ -5728,15 +5391,7 @@ CmMmHeapCb *heapCb; * File: cm_mem_wl.c * */ -#ifdef ANSI -S16 cmMmRegIsBlkSane -( -CmMmBlkHdr *blkPtr -) -#else -S16 cmMmRegIsBlkSane(blkPtr) -CmMmBlkHdr *blkPtr; -#endif +S16 cmMmRegIsBlkSane(CmMmBlkHdr *blkPtr) { uint32_t sigCnt; @@ -5768,19 +5423,12 @@ CmMmBlkHdr *blkPtr; * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmMmHashFunc ( CmMmHashListCp *hashListCp, uint32_t key, uint16_t *idx ) -#else -static S16 cmMmHashFunc (hashListCp, key, idx) -CmMmHashListCp *hashListCp; /* hash list control point */ -uint32_t key; /* key string */ -uint16_t *idx; /* idx to return */ -#endif { *idx = (uint16_t)(key % hashListCp->numOfbins); @@ -5810,21 +5458,13 @@ uint16_t *idx; /* idx to return */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmMmHashListInit ( CmMmHashListCp *hashListCp, /* hash list to initialize */ -uint16_t nmbBins, /* number of hash list bins */ +uint16_t nmbBins, /* number of hash list bins */ Region region, /* memory region to allocate bins */ Pool pool /* memory pool to allocate bins */ ) -#else -static S16 cmMmHashListInit(hashListCp, nmbBins, region, pool) -CmMmHashListCp *hashListCp; /* hash list to initialize */ -uint16_t nmbBins; /* number of hash list bins */ -Region region; /* memory region to allocate bins */ -Pool pool; /* memory pool to allocate bins */ -#endif { uint16_t i; CmMmHashListEnt *hl; @@ -5838,7 +5478,7 @@ Pool pool; /* memory pool to allocate bins */ /* allocate memory for bins */ if (nmbBins) { - if (SGetSBuf(region, pool, (Data **) &hashListCp->hashList, + if (SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data **) &hashListCp->hashList, (Size)(nmbBins * sizeof(CmMmHashListEnt))) != ROK) return RFAILED; @@ -5875,24 +5515,17 @@ Pool pool; /* memory pool to allocate bins */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmMmHashListDeinit ( CmMmHashListCp *hashListCp, /* hash list to deinitialize */ Region region, /* memory region to allocate bins */ Pool pool /* memory pool to allocate bins */ ) -#else -static S16 cmMmHashListDeinit(hashListCp, region, pool) -CmMmHashListCp *hashListCp; /* hash list to deinitialize */ -Region region; /* memory region to allocate bins */ -Pool pool; /* memory pool to allocate bins */ -#endif { /* deallocate memory for bins */ if (hashListCp->numOfbins) - (Void) SPutSBuf(region, pool, + (Void) SPutSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,region, pool, (Data *) hashListCp->hashList, (Size) (hashListCp->numOfbins * sizeof(CmMmHashListEnt))); @@ -5921,17 +5554,11 @@ Pool pool; /* memory pool to allocate bins */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmMmHashListInsert ( CmMmHashListCp *hashListCp, /* hash list to add to */ -uint32_t key /* pointer to key */ +uint32_t key /* pointer to key */ ) -#else -static S16 cmMmHashListInsert(hashListCp, key) -CmMmHashListCp *hashListCp; /* hash list to add to */ -uint32_t key; /* pointer to key */ -#endif { CmMmHashListEnt *hashListEnt; /* pointer to hash list entry header */ uint16_t idx; /* index for insertion into hash list */ @@ -6005,15 +5632,10 @@ uint32_t key; /* pointer to key */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmHashListInit ( CmHstGrmHashListCp *hashListCp /* hash list to initialize */ ) -#else -static S16 cmHstGrmHashListInit(hashListCp) -CmHstGrmHashListCp *hashListCp; /* hash list to initialize */ -#endif { /*cm_mem_c_001.main_25 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ #ifdef DEBUGP @@ -6045,15 +5667,10 @@ CmHstGrmHashListCp *hashListCp; /* hash list to initialize */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmHashListDeInit ( CmHstGrmHashListCp *hashListCp /* hash list to initialize */ ) -#else -static S16 cmHstGrmHashListDeInit(hashListCp) -CmHstGrmHashListCp *hashListCp; /* hash list to initialize */ -#endif { /*cm_mem_c_001.main_25 : Fix for TRACE5 feature crash due to missing TRC MACRO*/ #ifdef DEBUGP @@ -6089,28 +5706,19 @@ CmHstGrmHashListCp *hashListCp; /* hash list to initialize */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmFreeInsert ( CmHstGrmHashListCp* hashListCp, /* hash list cp */ -uint32_t blkSz, /* size of the block freed */ -uint32_t line, /* Line number */ -uint8_t *fileName, /* file name */ -uint8_t entId /* Tapa task which free the memory */ +uint32_t blkSz, /* size of the block freed */ +uint32_t line, /* Line number */ +uint8_t *fileName, /* file name */ +uint8_t entId /* Tapa task which free the memory */ ) -#else -static S16 cmHstGrmFreeInsert(hashListCp, blkSz, line, fileName, entId) -CmHstGrmHashListCp* hashListCp; /* hash list cp */ -uint32_t blkSz; /* size of the block freed */ -uint32_t line; /* line number */ -uint8_t *fileName; /* file Name */ -uint8_t entId; /* Tapa task which frees the memory */ -#endif { - uint32_t binIdx = 0; /* Bin index to insert the entry into the hash list */ - uint32_t key = 0; /* Key to fine the bin index */ - uint32_t ret = 0; /* Return value */ - CmMemEntries *entry = NULLP; /* Entry which contains the information */ + uint32_t binIdx = 0; /* Bin index to insert the entry into the hash list */ + uint32_t key = 0; /* Key to fine the bin index */ + uint32_t ret = 0; /* Return value */ + CmMemEntries *entry = NULLP; /* Entry which contains the information */ @@ -6171,30 +5779,20 @@ uint8_t entId; /* Tapa task which frees the memory */ * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmAllocInsert ( CmHstGrmHashListCp *hashListCp, -uint32_t blkSz, -uint32_t *reqSz, -uint32_t line, -uint8_t *fileName, -uint8_t entId +uint32_t blkSz, +uint32_t *reqSz, +uint32_t line, +uint8_t *fileName, +uint8_t entId ) -#else -static S16 cmHstGrmAllocInsert(hashListCp, blkSz, reqSz, line, fileName, entId) -CmHstGrmHashListCp *hashListCp; -uint32_t blkSz; -uint32_t *reqSz; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -#endif { - uint32_t binIdx = 0; - uint32_t key = 0; - uint32_t ret = 0; - CmMemEntries *entry = NULLP; + uint32_t binIdx = 0; + uint32_t key = 0; + uint32_t ret = 0; + CmMemEntries *entry = NULLP; /* check for the total number of entries in the hash list. * @@ -6258,21 +5856,13 @@ uint8_t entId; * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmGetHashIdxAndKey ( -uint8_t *fileName, -uint32_t line, -uint32_t *binIdx, -uint32_t *key +uint8_t *fileName, +uint32_t line, +uint32_t *binIdx, +uint32_t *key ) -#else -static S16 cmHstGrmGetHashIdxAndKey(fileName, line, binIdx, key) -uint8_t *fileName; -uint32_t line; -uint32_t *binIdx; -uint32_t *key; -#endif { uint32_t i = 0; @@ -6307,23 +5897,14 @@ uint32_t *key; * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmFillEntry ( CmMemEntries *entry, -uint32_t key, -uint32_t line, -uint8_t *fileName, -uint8_t entId +uint32_t key, +uint32_t line, +uint8_t *fileName, +uint8_t entId ) -#else -static S16 cmHstGrmFillEntry(entry, key, line, fileName, entId) -CmMemEntries *entry; -uint32_t key; -uint32_t line; -uint8_t *fileName; -uint8_t entId; -#endif { uint32_t idx = 0; @@ -6355,29 +5936,20 @@ uint8_t entId; * File: cm_mem_wl.c * */ -#ifdef ANSI static S16 cmHstGrmFindEntry ( CmHstGrmHashListCp *hashListCp, -uint32_t key, -uint32_t *binIdx, +uint32_t key, +uint32_t *binIdx, CmMemEntries **entry ) -#else -static S16 cmHstGrmFindEntry(hashListCp, key, binIdx, entry) -CmHstGrmHashListCp *hashListCp; -uint32_t key; -uint32_t *binIdx; -CmMemEntries **entry; -#endif { - uint32_t numEnt = 0; - uint32_t numBin = 0; + uint32_t numEnt = 0; + uint32_t numBin = 0; CmHstGrmHashListEnt *tmpBin = NULLP; - for(numBin = 0; numBin < CMM_HIST_MAX_MEM_BIN; numBin++) { /* find for the entry in the bin */ @@ -6550,17 +6122,11 @@ void DumpT2kMemLeakInfoToFile() #ifdef TENB_T2K3K_SPECIFIC_CHANGES /* For Updating SOC Specific Memory Information */ -#ifdef ANSI S16 UpdateSocMemInfo ( uint8_t areaIndex, CmLteMemInfo *mInfo ) -#else -S16 UpdateSocMemInfo(areaIndex,mInfo) -uint8_t areaIndex; -CmLteMemInfo *mInfo; -#endif { uint8_t idxReg; uint8_t idxPool; @@ -6636,14 +6202,9 @@ CmLteMemInfo *mInfo; * File: cm_mem_wl.c * */ -#ifdef ANSI uint32_t isL2MemUsageBelowLowerThreshold( Region region ) -#else -uint32_t isL2MemUsageBelowLowerThreshold(region) -Region region; -#endif { void * iccHdl = ssGetIccHdl(region); @@ -6680,14 +6241,9 @@ Region region; * File: cm_mem_wl.c * */ -#ifdef ANSI uint32_t isMemUsageBelowLowerThreshold( Region region ) -#else -uint32_t isMemUsageBelowLowerThreshold(region) -Region region; -#endif { void * iccHdl = ssGetIccHdl(region); @@ -6729,14 +6285,9 @@ Region region; * File: cm_mem_wl.c * */ -#ifdef ANSI static uint32_t isMemUsageAboveUpperThreshold( Region region ) -#else -static uint32_t isMemUsageAboveUpperThreshold(region) -Region region; -#endif { void * iccHdl = ssGetIccHdl(region); @@ -6792,14 +6343,9 @@ Region region; * File: cm_mem_wl.c * */ -#ifdef ANSI uint32_t isMemThreshReached( Region reg ) -#else -uint32_t isMemThreshReached(reg) -Region reg; -#endif { if(gMemoryAlarm) {