X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fcm%2Fcm_mem_wl.c;h=6372891c1e6e546fd579f148a613ca5baa2511d4;hb=def50dc175cebc67238db5f1acd5ff322a2279bd;hp=7d857cd201e5af3006603992864ef0e480b84ef3;hpb=694adde1a08c393a8443fd5bbd4f036f5cf85403;p=o-du%2Fl2.git diff --git a/src/cm/cm_mem_wl.c b/src/cm/cm_mem_wl.c index 7d857cd20..6372891c1 100755 --- a/src/cm/cm_mem_wl.c +++ b/src/cm/cm_mem_wl.c @@ -125,8 +125,8 @@ extern S32 clusterMode; /*ccpu00142274 - UL mem based flow control changes */ #ifdef TENB_T2K3K_SPECIFIC_CHANGES /* selva */ -U32 gMemoryAlarm; -PRIVATE U32 memoryCheckCounter; +uint32_t gMemoryAlarm; +PRIVATE uint32_t memoryCheckCounter; #define NUM_CALLS_TO_CHECK_MEM_AGAIN 80 /* Number of calls after which need to check mem */ #ifndef L2_L3_SPLIT @@ -205,7 +205,7 @@ typedef struct cmMemFreeInfo #define NUM_FREE_BUFFERS 128 typedef struct cmBtInfo { - U32 btInfoIdx; + uint32_t btInfoIdx; CmMemFreeInfo btInfo[NUM_FREE_BUFFERS]; } CmBtInfo; @@ -220,7 +220,7 @@ typedef struct cmMemDoubleFree }CmMemDoubleFree; PTR prvAllocPtr[8]; -U8 stopBtInfo = FALSE; +uint8_t stopBtInfo = FALSE; Buffer *palBuffer; EXTERN Buffer *mtTskBuffer1; EXTERN Buffer *mtTskBuffer2; @@ -237,45 +237,45 @@ PRIVATE S16 cmInitBtInfo ARGS((void)); #ifdef SS_USE_ICC_MEMORY #ifdef T2K_MEM_LEAK_DBG -PRIVATE S16 cmIccAlloc ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr, char*, U32)); -PRIVATE S16 cmIccFree ARGS((Void *regionCb, Data *ptr, Size size,char*, U32)); -PRIVATE S16 cmIccAllocWithLock ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr, char*, U32)); -PRIVATE S16 cmIccFreeWithLock ARGS((Void *regionCb, Data *ptr, Size size,char*, U32)); -void InsertToT2kMemLeakInfo ARGS((U32 address, U32 size, U32 lineNo, char* fileName)); -void RemoveFromT2kMemLeakInfo ARGS((U32 address, char *file, U32 line)); -PRIVATE U32 getT2kMemLeakIndex ARGS((U32 address)); -#else -PRIVATE S16 cmIccAlloc ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr)); +PRIVATE S16 cmIccAlloc ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr, char*, uint32_t)); +PRIVATE S16 cmIccFree ARGS((Void *regionCb, Data *ptr, Size size,char*, uint32_t)); +PRIVATE S16 cmIccAllocWithLock ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr, char*, uint32_t)); +PRIVATE S16 cmIccFreeWithLock ARGS((Void *regionCb, Data *ptr, Size size,char*, uint32_t)); +void InsertToT2kMemLeakInfo ARGS((uint32_t address, uint32_t size, uint32_t lineNo, char* fileName)); +void RemoveFromT2kMemLeakInfo ARGS((uint32_t address, char *file, uint32_t line)); +PRIVATE uint32_t getT2kMemLeakIndex ARGS((uint32_t address)); +#else +PRIVATE S16 cmIccAlloc ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr)); PRIVATE S16 cmIccFree ARGS((Void *regionCb, Data *ptr, Size size)); -PRIVATE S16 cmIccAllocWithLock ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr)); +PRIVATE S16 cmIccAllocWithLock ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr)); PRIVATE S16 cmIccFreeWithLock ARGS((Void *regionCb, Data *ptr, Size size)); #endif #else /* SS_USE_ICC_MEMORY */ -PRIVATE S16 cmDynAllocWithLock ARGS((Void *regionCb,Size *size,U32 flags,Data **ptr)); +PRIVATE S16 cmDynAllocWithLock ARGS((Void *regionCb,Size *size,uint32_t flags,Data **ptr)); PRIVATE S16 cmDynFreeWithLock ARGS((Void *regionCb,Data *ptr, Size size)); -PRIVATE S16 cmDynAlloc ARGS((Void *regionCb,Size *size,U32 flags,Data **ptr)); +PRIVATE S16 cmDynAlloc ARGS((Void *regionCb,Size *size,uint32_t flags,Data **ptr)); PRIVATE S16 cmDynFree ARGS((Void *regionCb,Data *ptr, Size size)); #endif /* SS_USE_ICC_MEMORY */ #ifdef T2K_MEM_LEAK_DBG -PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr,char*,U32)); -PRIVATE S16 cmFreeWL ARGS((Void *regionCb, Data *ptr, Size size,char*, U32)); +PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr,char*,uint32_t)); +PRIVATE S16 cmFreeWL ARGS((Void *regionCb, Data *ptr, Size size,char*, uint32_t)); -PRIVATE S16 cmAlloc ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr,char*,U32)); -PRIVATE S16 cmFree ARGS((Void *regionCb, Data *ptr, Size size,char*, U32)); +PRIVATE S16 cmAlloc ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr,char*,uint32_t)); +PRIVATE S16 cmFree ARGS((Void *regionCb, Data *ptr, Size size,char*, uint32_t)); #else -PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr)); +PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr)); PRIVATE S16 cmFreeWL ARGS((Void *regionCb, Data *ptr, Size size)); -PRIVATE S16 cmAlloc ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr)); +PRIVATE S16 cmAlloc ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr)); PRIVATE S16 cmFree ARGS((Void *regionCb, Data *ptr, Size size)); #endif #ifdef T2K_MEM_LEAK_DBG -PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr,char*,U32)); -PRIVATE S16 cmFreeWL ARGS((Void *regionCb, Data *ptr, Size size,char*, U32)); +PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr,char*,uint32_t)); +PRIVATE S16 cmFreeWL ARGS((Void *regionCb, Data *ptr, Size size,char*, uint32_t)); #else -PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, U32 flags, Data **ptr)); +PRIVATE S16 cmAllocWL ARGS((Void *regionCb, Size *size, uint32_t flags, Data **ptr)); PRIVATE S16 cmFreeWL ARGS((Void *regionCb, Data *ptr, Size size)); #endif #ifndef USE_PURE @@ -312,7 +312,7 @@ MemLkCb memLkCb; /* cm_mem_c_008.104 - Addition for memory calculator tool */ #ifdef MEMCAL_DEBUG PRIVATE Txt prntBuf[200]; /* print buffer */ -PRIVATE U8 tryHeap=0; +PRIVATE uint8_t tryHeap=0; #endif /* cm_mem_c_001.main_12 - addition for ssi enhancements prints */ @@ -333,7 +333,7 @@ PRIVATE Txt dbgPrntBuf[200]; /* print buffer */ #define T2K_MEM_LEAK_START_ADDR 0x9d200000 /*New Sercomm Board*/ #endif -U32 num_times = 0; +uint32_t num_times = 0; EXTERN pthread_t tmpRegTidMap[20]; extern Bool g_usettitmr; void DumpLayersDebugInformation() @@ -394,26 +394,26 @@ PRIVATE Void cmMmStatBktInit Data **memAddr, CmMmRegCb *regCb, CmMmRegCfg *cfg, -U16 bktIdx, -U16 *lstMapIdx +uint16_t bktIdx, +uint16_t *lstMapIdx ) #else PRIVATE Void cmMmStatBktInit (memAddr, regCb, cfg, bktIdx, lstMapIdx) Data **memAddr; CmMmRegCb *regCb; CmMmRegCfg *cfg; -U16 bktIdx; -U16 *lstMapIdx; +uint16_t bktIdx; +uint16_t *lstMapIdx; #endif { - U32 cnt; - U16 idx; - U32 numBlks; + uint32_t cnt; + uint16_t idx; + uint32_t numBlks; Size size; /* cm_mem_c_001.main_12 - addition for temporary variables */ #ifdef SSI_DEBUG_LEVEL1 CmMmBlkHdr **nextBlk; - U32 sigCnt; + uint32_t sigCnt; #else Data **next; #endif /* SSI_DEBUG_LEVEL1 */ @@ -525,7 +525,7 @@ U16 *lstMapIdx; cmHstGrmHashListInit(&(regCb->bktTbl[bktIdx].hstGrmHashListCp)); #endif /* SS_HISTOGRAM_SUPPORT */ - RETVOID; + return; } /* end of cmMmStatBktInit */ /* @@ -568,8 +568,8 @@ CmMmRegCfg *cfg; #endif { Data *memAddr; - U16 bktIdx; - U16 lstMapIdx; + uint16_t bktIdx; + uint16_t lstMapIdx; #if (ERRCLASS & ERRCLS_INT_PAR) Size lstQnSize; @@ -819,12 +819,12 @@ CmMmGlobRegCb *regCb; { Data **memAddr; Data **next; - U16 bktIdx; - U16 bucketSetSize; - U16 cnt; + uint16_t bktIdx; + uint16_t bucketSetSize; + uint16_t cnt; Size size; CmMmBlkSetElement *blkLstElem; - U16 numBlks; + uint16_t numBlks; #if (ERRCLASS & ERRCLS_INT_PAR) Size lstQnSize; @@ -904,10 +904,10 @@ PRIVATE S16 cmIccAllocWithLock ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -U32 flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr, /* Reference to pointer for which need to be allocate */ char *file, -U32 line +uint32_t line ) #endif #else @@ -916,14 +916,14 @@ PRIVATE S16 cmIccAllocWithLock ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -U32 flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) #else PRIVATE S16 cmIccAllocWithLock(regionCb, size, flags, ptr) Void *regionCb; /* Pointer to a region */ Size *size; /* size needs to be allocated */ -U32 flags; /* Flags used */ +uint32_t flags; /* Flags used */ Data **ptr; /* Reference to pointer for which need to be allocate */ #endif #endif @@ -958,12 +958,12 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ } #ifdef T2K_MEM_LEAK_DBG - if(((U32)(memPtr - T2K_MEM_LEAK_START_ADDR) & 0xff) != 0) + if(((uint32_t)(memPtr - T2K_MEM_LEAK_START_ADDR) & 0xff) != 0) { printf("Address returned is %p size = %ld\n",memPtr,*size); } - InsertToT2kMemLeakInfo((U32)memPtr,*size,line,file); + InsertToT2kMemLeakInfo((uint32_t)memPtr,*size,line,file); #endif *ptr = memPtr; @@ -998,7 +998,7 @@ Void *regionCb, /* Pointer to region cb */ Data *ptr, /* Memory block needs to be freed */ Size size, /* Size of the block */ char *file, -U32 line +uint32_t line ) #endif #else @@ -1029,7 +1029,7 @@ Size size; /* Size of the block */ } #ifdef T2K_MEM_LEAK_DBG - RemoveFromT2kMemLeakInfo((U32)ptr - ((U32)ptr % 512),file,line); + RemoveFromT2kMemLeakInfo((uint32_t)ptr - ((uint32_t)ptr % 512),file,line); #endif TL_Free(regCb->iccHdl, ptr); @@ -1064,10 +1064,10 @@ PRIVATE S16 cmIccAlloc ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -U32 flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr, /* Reference to pointer for which need to be allocate */ char *file, -U32 line +uint32_t line ) #else #endif @@ -1077,14 +1077,14 @@ PRIVATE S16 cmIccAlloc ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -U32 flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) #else PRIVATE S16 cmIccAlloc(regionCb, size, flags, ptr) Void *regionCb; /* Pointer to a region */ Size *size; /* size needs to be allocated */ -U32 flags; /* Flags used */ +uint32_t flags; /* Flags used */ Data **ptr; /* Reference to pointer for which need to be allocate */ #endif @@ -1107,12 +1107,12 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ *p = 10; } #ifdef T2K_MEM_LEAK_DBG - if(((U32)(memPtr - T2K_MEM_LEAK_START_ADDR) & 0xff) != 0) + if(((uint32_t)(memPtr - T2K_MEM_LEAK_START_ADDR) & 0xff) != 0) { printf("Address returned is %p size = %ld\n",memPtr,*size); } - InsertToT2kMemLeakInfo((U32)memPtr,*size,line,file); + InsertToT2kMemLeakInfo((uint32_t)memPtr,*size,line,file); #endif #ifdef YS_PHY_3_8_2 *ptr = memPtr;/*TL_VA2TRUEVA(regCb->iccHdl, memPtr); */ @@ -1147,7 +1147,7 @@ Void *regionCb, /* Pointer to region cb */ Data *ptr, /* Memory block needs to be freed */ Size size, /* Size of the block */ char* file, -U32 line +uint32_t line ) #else #ifdef ANSI @@ -1173,7 +1173,7 @@ Size size; /* Size of the block */ // memPtr = TL_TRUEVA2VA(regCb->iccHdl, ptr); { #ifdef T2K_MEM_LEAK_DBG - RemoveFromT2kMemLeakInfo((U32)ptr - ((U32)ptr % 512),file,line); + RemoveFromT2kMemLeakInfo((uint32_t)ptr - ((uint32_t)ptr % 512),file,line); #endif } @@ -1334,15 +1334,15 @@ CmMmDynRegCb *regCb; #endif { Region region; - U16 lstMapIdx; - U16 cnt; + uint16_t lstMapIdx; + uint16_t cnt; Size size; CmMmBlkSetElement *blkLstElem; SRegInfo regInfo; Size bktQnSize = MT_BKTQNSIZE; - U16 idx; - U16 idx1; - U16 numBkts; + uint16_t idx; + uint16_t idx1; + uint16_t numBkts; /* Initialize the region control block */ @@ -1464,7 +1464,7 @@ S16 cmMmRegDeInit(regCb) CmMmRegCb *regCb; #endif { - U16 bktIdx; + uint16_t bktIdx; #if (ERRCLASS & ERRCLS_INT_PAR) @@ -1556,12 +1556,12 @@ CmMmRegCb *regCb; #ifdef ANSI PRIVATE CmMmBlkSetElement* cmGetMemBlkSetForAlloc ( -U8 bucketIndex, /* Index to the bucket list */ +uint8_t bucketIndex, /* Index to the bucket list */ CmMmDynBktCb *bkt /* Bucket list control block */ ) #else PRIVATE CmMmBlkSetElement* cmGetMemBlkSetForAlloc(bucketIndex, bkt) -U8 bucketIndex; /* Index to the bucket list */ +uint8_t bucketIndex; /* Index to the bucket list */ CmMmDynBktCb *bkt; /* Bucket list control block */ #endif { @@ -1680,12 +1680,12 @@ CmMmDynBktCb *bkt; /* Bucket list control block */ #ifdef ANSI PRIVATE CmMmBlkSetElement* cmGetMemBlkSetForFree ( -U8 bucketIndex, /* Index to the bucket list */ +uint8_t bucketIndex, /* Index to the bucket list */ CmMmDynBktCb *bkt /* Bucket list control block */ ) #else PRIVATE CmMmBlkSetElement* cmGetMemBlkSetForFree(bucketIndex, bkt) -U8 bucketIndex; /* Index to the bucket list */ +uint8_t bucketIndex; /* Index to the bucket list */ CmMmDynBktCb *bkt; /* Bucket list control block */ #endif { @@ -1809,13 +1809,13 @@ PTR ptr; CmMemDoubleFree *memNode = NULLP; SLock(&memDoubleFreeLock); - if((cmHashListFind(&(memDoubleFree), (U8*)&ptr, - sizeof(U32), 0, (PTR *)&memNode)) != ROK) + if((cmHashListFind(&(memDoubleFree), (uint8_t*)&ptr, + sizeof(uint32_t), 0, (PTR *)&memNode)) != ROK) { Void *tmpBtArr[10]; - U16 tmpBtSize; + uint16_t tmpBtSize; S8 **strings; - U16 idx; + uint16_t idx; tmpBtSize = backtrace(tmpBtArr, 10); strings = backtrace_symbols(tmpBtArr, tmpBtSize); @@ -1882,7 +1882,7 @@ PTR ptr; memNode->memBlkPtr = ptr; SLock(&memDoubleFreeLock); - if((cmHashListInsert(&(memDoubleFree), (PTR)memNode, (U8*)&memNode->memBlkPtr, + if((cmHashListInsert(&(memDoubleFree), (PTR)memNode, (uint8_t*)&memNode->memBlkPtr, sizeof(PTR))) != ROK) { SUnlock(&memDoubleFreeLock); @@ -1918,14 +1918,14 @@ PRIVATE S16 cmDynAllocWithLock ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -U32 flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) #else PRIVATE S16 cmDynAllocWithLock(regionCb, size, flags, ptr) Void *regionCb; /* Pointer to a region */ Size *size; /* size needs to be allocated */ -U32 flags; /* Flags used */ +uint32_t flags; /* Flags used */ Data **ptr; /* Reference to pointer for which need to be allocate */ #endif { @@ -1971,14 +1971,14 @@ PRIVATE S16 cmDynAlloc ( Void *regionCb, /* Pointer to a region */ Size *size, /* size needs to be allocated */ -U32 flags, /* Flags used */ +uint32_t flags, /* Flags used */ Data **ptr /* Reference to pointer for which need to be allocate */ ) #else PRIVATE S16 cmDynAlloc(regionCb, size, flags, ptr) Void *regionCb; /* Pointer to a region */ Size *size; /* size needs to be allocated */ -U32 flags; /* Flags used */ +uint32_t flags; /* Flags used */ Data **ptr; /* Reference to pointer for which need to be allocate */ #endif { @@ -2016,9 +2016,9 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ if ( (*size) <= regCb->bktMaxBlkSize) #endif { - U32 idx; + uint32_t idx; CmMmBlkSetElement *dynMemElem; - U32 bktIdx; + uint32_t bktIdx; CmMmDynBktCb *bkt; /* Get the map to the mapping table */ @@ -2069,7 +2069,7 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ #ifdef SS_MEM_WL_DEBUG if(dynMemElem->nextBktPtr == prvAllocPtr[regCb->region]) { - U32 *tmpDump; + uint32_t *tmpDump; *tmpDump = 100; } #endif @@ -2085,16 +2085,16 @@ Data **ptr; /* Reference to pointer for which need to be allocate */ #ifdef SS_MEM_WL_DEBUG prvAllocPtr[regCb->region] = *ptr; - **ptr = (U8) bktIdx; + **ptr = (uint8_t) bktIdx; *(*ptr+1) = 0xde; *(*ptr+2) = 0xad; *(*ptr+3) = 0xbe; - *ptr += sizeof (U32); + *ptr += sizeof (uint32_t); if ((bktIdx == 0) && (!stopBtInfo)) { CmBtInfo *btInfo; - U32 btIdx; + uint32_t btIdx; btInfo = &allocBtInfo[regCb->region]; btIdx = btInfo->btInfoIdx; btInfo->btInfo[btIdx].ptr = (PTR) *ptr; @@ -2187,10 +2187,10 @@ PRIVATE S16 cmAlloc ( Void *regionCb, Size *size, - U32 flags, + uint32_t flags, Data **ptr , char* file, - U32 line + uint32_t line ) #else #ifdef SS_HISTOGRAM_SUPPORT @@ -2200,24 +2200,24 @@ PRIVATE S16 cmAlloc ( Void *regionCb, Size *size, -U32 flags, +uint32_t flags, Data **ptr, -U32 memType, -U32 line, -U8 *fileName, -U8 entId, +uint32_t memType, +uint32_t line, +uint8_t *fileName, +uint8_t entId, Bool hstReg ) #else PRIVATE S16 cmAlloc(regionCb, size, flags, ptr, memType, line, fileName, entId, hstReg) Void *regionCb; Size *size; -U32 flags; +uint32_t flags; Data **ptr; -U32 memType; -U32 line; -U8 *fileName; -U8 entId; +uint32_t memType; +uint32_t line; +uint8_t *fileName; +uint8_t entId; Bool hstReg; #endif #else @@ -2226,22 +2226,22 @@ PRIVATE S16 cmAlloc ( Void *regionCb, Size *size, -U32 flags, +uint32_t flags, Data **ptr, -U32 line, -U8 *fileName, -U8 entId, +uint32_t line, +uint8_t *fileName, +uint8_t entId, Bool hstReg ) #else PRIVATE S16 cmAlloc(regionCb, size, flags, ptr, line, fileName, entId, hstReg) Void *regionCb; Size *size; -U32 flags; +uint32_t flags; Data **ptr; -U32 line; -U8 *fileName; -U8 entId; +uint32_t line; +uint8_t *fileName; +uint8_t entId; Bool hstReg; #endif #endif /* SSI_DEBUG_LEVEL1 */ @@ -2254,17 +2254,17 @@ PRIVATE S16 cmAlloc ( Void *regionCb, Size *size, -U32 flags, +uint32_t flags, Data **ptr, -U32 memType +uint32_t memType ) #else PRIVATE S16 cmAlloc(regionCb, size, flags, ptr, memType) Void *regionCb; Size *size; -U32 flags; +uint32_t flags; Data **ptr; -U32 memType; +uint32_t memType; #endif #else #ifdef ANSI @@ -2272,14 +2272,14 @@ PRIVATE S16 cmAlloc ( Void *regionCb, Size *size, -U32 flags, +uint32_t flags, Data **ptr ) #else PRIVATE S16 cmAlloc(regionCb, size, flags, ptr) Void *regionCb; Size *size; -U32 flags; +uint32_t flags; Data **ptr; #endif @@ -2291,14 +2291,14 @@ Data **ptr; { /* cm_mem_c_001.main_26 : Fixes for Compilation Warnings */ #ifndef USE_PURE - U16 idx; + uint16_t idx; CmMmBkt *bkt; - U16 bktIdx; + uint16_t bktIdx; #endif CmMmRegCb *regCb; /* cm_mem_c_001.main_26 : Fixes for Compilation Warnings */ #ifndef USE_PURE - U16 cnt; + uint16_t cnt; #endif /* cm_mem_c_001.main_15 : Additions */ #ifdef SS_MEM_LEAK_STS @@ -2709,14 +2709,14 @@ Void S16 cmInitDoubleFreeList() #endif { - U16 offset; + uint16_t offset; CmMemDoubleFree memNode; - offset = (U16)((PTR)(&memNode.tmpListEnt) - (PTR)&memNode); + offset = (uint16_t)((PTR)(&memNode.tmpListEnt) - (PTR)&memNode); if((cmHashListInit(&(memDoubleFree), 1000, offset, 0, - CM_HASH_KEYTYPE_U32MOD, 0, 0)) != ROK); + CM_HASH_KEYTYPE_UINT32_MOD, 0, 0)) != ROK); { return RFAILED; } @@ -2784,18 +2784,18 @@ PRIVATE S16 cmInitBtInfo (Void) Void cmAnalyseBtInfo ( PTR ptr, /* Memory block needs to be freed */ -U32 idx +uint32_t idx ) #else Void cmAnalyseBtInfo (ptr,idx) PTR ptr; /* Memory block needs to be freed */ -U32 idx; +uint32_t idx; #endif { - U32 tmpCnt; - U32 btIdx; + uint32_t tmpCnt; + uint32_t btIdx; CmBtInfo *btInfo; - U8 regIdx; + uint8_t regIdx; /* for(regIdx = 0; regIdx < 8; regIdx++) { */ @@ -2809,7 +2809,7 @@ U32 idx; (btInfo->btInfo[btIdx].ptr + 128 ) >= ptr) */ if(btInfo->btInfo[btIdx].btSize != 0) { - U32 i; + uint32_t i; char **strings; strings = backtrace_symbols( btInfo->btInfo[btIdx].btArr,btInfo->btInfo[btIdx].btSize); printf("*** Last Allocation Region = %d PTR %x Timestamp sec = (%ld) usec = (%ld) ***\n", idx, ptr, btInfo->btInfo[btIdx].timeStamp.tv_sec, btInfo->btInfo[btIdx].timeStamp.tv_usec); @@ -2830,7 +2830,7 @@ U32 idx; } /* } */ - RETVOID; + return; } #endif @@ -2917,14 +2917,14 @@ Size size; /* Size of the block */ { CmMmDynRegCb *regCb; #ifndef USE_PURE - U32 idx; - U32 bktIdx; + uint32_t idx; + uint32_t bktIdx; CmMmDynBktCb *bkt = NULLP; CmMmBlkSetElement *dynMemElem; #endif #ifdef SS_MEM_WL_DEBUG - U8 tmpBktIdx; - U8 tmpVal; + uint8_t tmpBktIdx; + uint8_t tmpVal; #endif @@ -2959,7 +2959,7 @@ Size size; /* Size of the block */ #endif #ifdef SS_MEM_WL_DEBUG - ptr -= sizeof (U32); + ptr -= sizeof (uint32_t); size += 4; #endif /* The memory block was allocated from the bucket pool */ @@ -2996,7 +2996,7 @@ Size size; /* Size of the block */ { printf("2nd time Size = %d bucket size = %d\n", size, bkt->size); exit(-1); - U8 *tmpptr = NULLP; + uint8_t *tmpptr = NULLP; printf("Bucket Size wrong \n"); *tmpptr = 10; } @@ -3011,12 +3011,12 @@ Size size; /* Size of the block */ } #ifdef SS_MEM_WL_DEBUG - tmpBktIdx = (U8)*ptr; - tmpVal = (U8)*(ptr+1); + tmpBktIdx = (uint8_t)*ptr; + tmpVal = (uint8_t)*(ptr+1); if ((tmpBktIdx != bktIdx) || (tmpVal != 0xde)) { - U8 *tmpptr = NULLP; + uint8_t *tmpptr = NULLP; printf("bktIdx wrong \n"); *tmpptr = 10; } @@ -3024,7 +3024,7 @@ Size size; /* Size of the block */ if ((bktIdx == 0) && (!stopBtInfo)) { CmBtInfo *btInfo; - U32 btIdx; + uint32_t btIdx; btInfo = ®BtInfo[regCb->region]; btIdx = btInfo->btInfoIdx; btInfo->btInfo[btIdx].ptr = (PTR) ptr; @@ -3106,7 +3106,7 @@ PRIVATE S16 cmFree Data *ptr, Size size, char* file, - U32 line + uint32_t line ) #else #ifdef SS_HISTOGRAM_SUPPORT @@ -3116,9 +3116,9 @@ PRIVATE S16 cmFree Void *regionCb, Data *ptr, Size size, -U32 line, -U8 *fileName, -U8 entId, +uint32_t line, +uint8_t *fileName, +uint8_t entId, Bool hstReg ) #else @@ -3126,9 +3126,9 @@ PRIVATE S16 cmFree(regionCb, ptr, size, line, fileName, entId, hstReg) Void *regionCb; Data *ptr; Size size; -U32 line; -U8 *fileName; -U8 entId; +uint32_t line; +uint8_t *fileName; +uint8_t entId; Bool hstReg; #endif @@ -3154,9 +3154,9 @@ Size size; { /* cm_mem_c_001.main_26 : Fixes for Compilation Warnings */ #ifndef USE_PURE - U16 idx; + uint16_t idx; CmMmBkt *bkt; - U16 bktIdx; + uint16_t bktIdx; #endif CmMmRegCb *regCb; /* cm_mem_c_001.main_12 - addition for holding the free pointer */ @@ -3486,10 +3486,10 @@ PRIVATE S16 cmAllocWL ( Void *regionCb, Size *size, -U32 flags, +uint32_t flags, Data **ptr , char* file, -U32 line +uint32_t line ) #else #ifdef ANSI @@ -3497,20 +3497,20 @@ PRIVATE S16 cmAllocWL ( Void *regionCb, Size *size, -U32 flags, +uint32_t flags, Data **ptr ) #else PRIVATE S16 cmAllocWL(regionCb, size, flags, ptr) Void *regionCb; Size *size; -U32 flags; +uint32_t flags; Data **ptr; #endif #endif { #ifndef USE_PURE - U16 idx; + uint16_t idx; CmMmBkt *bkt = NULLP; #endif CmMmRegCb *regCb; @@ -3650,7 +3650,7 @@ Void *regionCb, Data *ptr, Size size, char* file, -U32 line +uint32_t line ) #else #ifdef ANSI @@ -3669,7 +3669,7 @@ Size size; #endif { #ifndef USE_PURE - U16 idx; + uint16_t idx; CmMmBkt *bkt = NULLP; #endif CmMmRegCb *regCb; @@ -3871,9 +3871,9 @@ SMemCtl *memCtl; /* Check if the Bucket pool is configured */ if (regCb->bktSize) { - U16 idx; + uint16_t idx; CmMmBkt *bkt; - U32 avlSize, totSize; + uint32_t avlSize, totSize; /* * The bucket pool is configured. The status value returned * does reflect on the memory availabilty in the bucket pool. @@ -3951,7 +3951,7 @@ Size size; { /* cm_mem_c_001.main_12 - addition for ssi enhancements */ #ifdef SSI_DEBUG_LEVEL1 - U16 idx; + uint16_t idx; #endif /* SSI_DEBUG_LEVEL1 */ /* Initialize the heap control block */ @@ -3995,7 +3995,7 @@ Size size; /* Initialise the memory histogram hash list */ cmHstGrmHashListInit(&(heapCb->heapHstGrmHashListCp)); #endif /* SS_HISTOGRAM_SUPPORT */ - RETVOID; + return; } /* end of cmMmHeapInit */ @@ -4030,10 +4030,10 @@ PRIVATE S16 cmHeapAlloc CmMmHeapCb *heapCb, Data **ptr, Size *size, -U32 memType, -U32 line, -U8 *fileName, -U8 entId, +uint32_t memType, +uint32_t line, +uint8_t *fileName, +uint8_t entId, Bool hstReg ) #else @@ -4041,10 +4041,10 @@ PRIVATE S16 cmHeapAlloc (heapCb, ptr, size, memType, line, fileName, entId, hst CmMmHeapCb *heapCb; Data **ptr; Size *size; -U32 memType; -U32 line; -U8 *fileName; -U8 entId; +uint32_t memType; +uint32_t line; +uint8_t *fileName; +uint8_t entId; Bool hstReg; #endif #else @@ -4054,9 +4054,9 @@ PRIVATE S16 cmHeapAlloc CmMmHeapCb *heapCb, Data **ptr, Size *size, -U32 line, -U8 *fileName, -U8 entId, +uint32_t line, +uint8_t *fileName, +uint8_t entId, Bool hstReg ) #else @@ -4064,9 +4064,9 @@ PRIVATE S16 cmHeapAlloc (heapCb, ptr, size, line, fileName, entId, hstReg) CmMmHeapCb *heapCb; Data **ptr; Size *size; -U32 line; -U8 *fileName; -U8 entId; +uint32_t line; +uint8_t *fileName; +uint8_t entId; Bool hstReg; #endif #endif /* SSI_DEBUG_LEVEL1 */ @@ -4078,14 +4078,14 @@ PRIVATE S16 cmHeapAlloc CmMmHeapCb *heapCb, Data **ptr, Size *size, -U32 memType +uint32_t memType ) #else PRIVATE S16 cmHeapAlloc (heapCb, ptr, size, memType) CmMmHeapCb *heapCb; Data **ptr; Size *size; -U32 memType; +uint32_t memType; #endif #else #ifdef ANSI @@ -4117,7 +4117,7 @@ Size *size; CmHEntry *alocHeapBlk; Size requestedSize; Size hdr; - U16 idx; + uint16_t idx; #endif /* SSI_DEBUG_LEVEL1 */ /* cm_mem_c_001.main_15 : Additions */ #ifdef SS_HISTOGRAM_SUPPORT @@ -4385,9 +4385,9 @@ PRIVATE S16 cmHeapFree CmMmHeapCb *heapCb, Data *ptr, Size size, -U32 line, -U8 *fileName, -U8 entId, +uint32_t line, +uint8_t *fileName, +uint8_t entId, Bool hstReg ) #else @@ -4395,9 +4395,9 @@ PRIVATE S16 cmHeapFree (heapCb, ptr, size, line, fileName, entId, hstReg) CmMmHeapCb *heapCb; Data *ptr; Size size; -U32 line; -U8 *fileName; -U8 entId; +uint32_t line; +uint8_t *fileName; +uint8_t entId; Bool hstReg; #endif #else @@ -4796,7 +4796,7 @@ Size size; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -4813,8 +4813,8 @@ Void Void cmInitMemLeakMdl (Void) #endif { - U8 memMdl; - U8 hashIdx; + uint8_t memMdl; + uint8_t hashIdx; memLkCb.memLkMdlInit = FALSE; @@ -4824,7 +4824,7 @@ Void cmInitMemLeakMdl (Void) { SInitLock(&memLkCb.memUsrMdl[memMdl][hashIdx].memLck, 1); cmHashListInit(&memLkCb.memUsrMdl[memMdl][hashIdx].memHashCp, - 500, 0, FALSE, CM_HASH_KEYTYPE_U32MOD, 0, 0); + 500, 0, FALSE, CM_HASH_KEYTYPE_UINT32_MOD, 0, 0); memLkCb.memUsrMdl[memMdl][hashIdx].used = FALSE; } } @@ -4834,7 +4834,7 @@ Void cmInitMemLeakMdl (Void) } memLkCb.memLkMdlInit = TRUE; - RETVOID; + return; } /* cmInitMemLeakMdl */ /* cm_mem_c_002.main_21 Added for shutdown procedure */ /* @@ -4844,7 +4844,7 @@ Void cmInitMemLeakMdl (Void) * Desc: De-initializes the memory leak detection module * * - * Ret: RETVOID + * Ret: void * * Notes: This function de-initializes the memory leak detection module. * @@ -4861,8 +4861,8 @@ Void Void cmDeinitMemLeakMdl (Void) #endif { - U8 memMdl; - U8 hashIdx; + uint8_t memMdl; + uint8_t hashIdx; memLkCb.memLkMdlInit = FALSE; @@ -4875,7 +4875,7 @@ Void cmDeinitMemLeakMdl (Void) memLkCb.memUsrMdl[memMdl][hashIdx].used = FALSE; } } - RETVOID; + return; } /* * @@ -4884,7 +4884,7 @@ Void cmDeinitMemLeakMdl (Void) * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -4904,7 +4904,7 @@ S8 *msOptArg; { memLkCb.fileLkLog = NULLP; memLkCb.fileLkLog = fopen(arg, "w"); - RETVOID; + return; } /* @@ -4914,7 +4914,7 @@ S8 *msOptArg; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -4934,14 +4934,14 @@ Void SLogLkInfo (Void) MemAllocInfo *oldMemInfo; MemAllocInfo *newMemInfo; - U8 memMdl; - U8 hashIdx; - U8 idx; + uint8_t memMdl; + uint8_t hashIdx; + uint8_t idx; Txt prntBuf[255]; S8 **funcNm; if( memLkCb.memLkMdlInit == FALSE) { - RETVOID; + return; } sprintf(prntBuf, "\n------- START OF LEAK LOG -------\n"); fwrite(prntBuf, strlen(prntBuf), 1, memLkCb.fileLkLog); @@ -4997,7 +4997,7 @@ Void SLogLkInfo (Void) } sprintf(prntBuf, "\n------- END OF LEAK LOG -------\n"); fwrite(prntBuf, strlen(prntBuf), 1, memLkCb.fileLkLog); - RETVOID; + return; } /* @@ -5007,7 +5007,7 @@ Void SLogLkInfo (Void) * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5025,16 +5025,16 @@ Void SFlushLkInfo (Void) #endif { MemAllocInfo *newMemInfo; - U8 memMdl; - U8 hashIdx; + uint8_t memMdl; + uint8_t hashIdx; S8 **funcNm; #ifdef SS_MEM_LEAK_SOL - U8 i; + uint8_t i; #endif /* SS_MEM_LEAK_SOL */ if( memLkCb.memLkMdlInit == FALSE) { - RETVOID; + return; } for(memMdl = 0; memMdl < CM_MEM_USR_MDL; memMdl++) @@ -5060,7 +5060,7 @@ Void SFlushLkInfo (Void) #else free(funcNm[i]); #endif - /* SPutSBuf(DFLT_REGION, DFLT_POOL, funcNm[i], sizeof(U32) * CM_MAX_STACK_TRACE); */ + /* SPutSBuf(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*/ @@ -5075,7 +5075,7 @@ Void SFlushLkInfo (Void) SUnlock(&memLkCb.memUsrMdl[memMdl][hashIdx].memLck); } } - RETVOID; + return; } /* @@ -5085,7 +5085,7 @@ Void SFlushLkInfo (Void) * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5096,17 +5096,17 @@ Void SFlushLkInfo (Void) #ifdef ANSI Void cmStorAllocBlk ( -U32 addr, +uint32_t addr, Size reqSz, Size allocSz, -U16 bktIdx +uint16_t bktIdx ) #else Void cmStorAllocBlk (addr, reqSz, allocSz, bktIdx) -U32 addr; +uint32_t addr; Size reqSz; Size allocSz; -U16 bktIdx; +uint16_t bktIdx; #endif /* ANSI */ { #ifndef SS_MEM_LEAK_SOL @@ -5115,11 +5115,11 @@ U16 bktIdx; S8 **funcNm; S32 traceSize; MemAllocInfo *allocInfo; - U8 moduleId; + uint8_t moduleId; if( memLkCb.memLkMdlInit == FALSE) { - RETVOID; + return; } #ifdef SS_MEM_LEAK_SOL @@ -5128,12 +5128,12 @@ U16 bktIdx; * implementation. */ /*cm_mem_c_001.main_27 SSI-4GMX specfic changes*/ #ifdef SS_4GMX_LCORE - funcNm = (S8 **)MxHeapAlloc(SsiHeap, (sizeof(U32) * CM_MAX_STACK_TRACE)); - memset(funcNm, 0, (sizeof(U32) * CM_MAX_STACK_TRACE)); + funcNm = (S8 **)MxHeapAlloc(SsiHeap, (sizeof(uint32_t) * CM_MAX_STACK_TRACE)); + memset(funcNm, 0, (sizeof(uint32_t) * CM_MAX_STACK_TRACE)); #else - funcNm = (S8 **)calloc(1, (sizeof(U32) * CM_MAX_STACK_TRACE)); + funcNm = (S8 **)calloc(1, (sizeof(uint32_t) * CM_MAX_STACK_TRACE)); #endif - /* SGetSBuf(DFLT_REGION, DFLT_POOL, &funcNm, sizeof(U32) * CM_MAX_STACK_TRACE); */ + /* SGetSBuf(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); @@ -5160,12 +5160,12 @@ U16 bktIdx; allocInfo->bTrcSz = traceSize; cmHashListInsert(&memLkCb.memUsrMdl[moduleId][addr & 0x3].memHashCp, - (PTR)allocInfo, (U8 *)&(allocInfo->memAddr), + (PTR)allocInfo, (uint8_t *)&(allocInfo->memAddr), sizeof(allocInfo->memAddr)); memLkCb.memUsrMdl[moduleId][addr & 0x3].used = TRUE; (Void) SUnlock(&(memLkCb.memUsrMdl[moduleId][addr & 0x3].memLck)); - RETVOID; + return; } /* cmStorAllocBlk */ /* @@ -5175,7 +5175,7 @@ U16 bktIdx; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5184,20 +5184,20 @@ U16 bktIdx; * */ #ifdef ANSI -U8 cmMemGetModuleId +uint8_t cmMemGetModuleId ( S8 **funNm, S32 traceSize ) #else -U8 cmMemGetModuleId (funNm, traceSize) +uint8_t cmMemGetModuleId (funNm, traceSize) S8 **funNm; S32 traceSize; #endif /* ANSI */ { - U8 idx; - U8 memStrIdx; - U32 len; + uint8_t idx; + uint8_t memStrIdx; + uint32_t len; S32 retVal; S16 memReqIdx; S16 mdlFunStrIdx; @@ -5251,7 +5251,7 @@ S32 traceSize; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5262,25 +5262,25 @@ S32 traceSize; #ifdef ANSI S16 cmMemGetStrMtchIdx ( -U8 strtIdx, -U8 endIdx, +uint8_t strtIdx, +uint8_t endIdx, S8 *str, S8 **strLst ) #else S16 cmMemGetStrMtchIdx(strtIdx, endIdx, str, strLst) -U8 strtIdx; -U8 endIdx; +uint8_t strtIdx; +uint8_t endIdx; S8 *str; S8 **strLst; #endif { S8 cmpStr[255]; - U32 len; + uint32_t len; Bool found; - U32 tempLen; - U8 idx; + uint32_t tempLen; + uint8_t idx; S32 retVal; len = strlen((const S8 *)str); @@ -5324,7 +5324,7 @@ S8 **strLst; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5335,24 +5335,24 @@ S8 **strLst; #ifdef ANSI Void cmRlsAllocBlk ( -U32 addr +uint32_t addr ) #else Void cmRlsAllocBlk(addr) -U32 addr; +uint32_t addr; #endif { Ptr trace[CM_MAX_STACK_TRACE]; S8 **funcNm; - U8 idx; - U8 i; + uint8_t idx; + uint8_t i; S16 retVal; S32 traceSize; MemAllocInfo *memAllocInfo; if( memLkCb.memLkMdlInit == FALSE) { - RETVOID; + return; } @@ -5360,7 +5360,7 @@ U32 addr; { SLock(&memLkCb.memUsrMdl[idx][addr & 0x3].memLck); retVal = cmHashListFind(&memLkCb.memUsrMdl[idx][addr & 0x3].memHashCp, - (U8 *)&addr, sizeof(U32), 0, + (uint8_t *)&addr, sizeof(uint32_t), 0, (PTR *)&memAllocInfo); if(retVal == ROK) { @@ -5451,7 +5451,7 @@ U32 addr; #endif /* SS_MEM_LEAK_SOL */ /*cm_mem_c_001.main_25 : */ - RETVOID; + return; } /* cmRlsAllocBlk */ @@ -5463,7 +5463,7 @@ U32 addr; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5519,7 +5519,7 @@ S32 size; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5567,7 +5567,7 @@ Void *arg; * Desc: Initializes the memory leak detection module * * -* Ret: RETVOID +* Ret: void * * Notes: This function initializes the memory leak detection module. * @@ -5641,7 +5641,7 @@ CmMmBkt *bkt; #endif { CmMmBlkHdr *ptrBlk; - U32 blkCnt; + uint32_t blkCnt; bkt->trampleCount = 0; @@ -5738,7 +5738,7 @@ S16 cmMmRegIsBlkSane(blkPtr) CmMmBlkHdr *blkPtr; #endif { - U32 sigCnt; + uint32_t sigCnt; for ( sigCnt=0; sigCnt < CMM_TRAMPLING_SIGNATURE_LEN; sigCnt++) @@ -5772,18 +5772,18 @@ CmMmBlkHdr *blkPtr; PRIVATE S16 cmMmHashFunc ( CmMmHashListCp *hashListCp, -U32 key, -U16 *idx +uint32_t key, +uint16_t *idx ) #else PRIVATE S16 cmMmHashFunc (hashListCp, key, idx) CmMmHashListCp *hashListCp; /* hash list control point */ -U32 key; /* key string */ -U16 *idx; /* idx to return */ +uint32_t key; /* key string */ +uint16_t *idx; /* idx to return */ #endif { - *idx = (U16)(key % hashListCp->numOfbins); + *idx = (uint16_t)(key % hashListCp->numOfbins); return ROK; @@ -5814,19 +5814,19 @@ U16 *idx; /* idx to return */ PRIVATE S16 cmMmHashListInit ( CmMmHashListCp *hashListCp, /* hash list to initialize */ -U16 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 PRIVATE S16 cmMmHashListInit(hashListCp, nmbBins, region, pool) CmMmHashListCp *hashListCp; /* hash list to initialize */ -U16 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 */ #endif { - U16 i; + uint16_t i; CmMmHashListEnt *hl; @@ -5925,17 +5925,17 @@ Pool pool; /* memory pool to allocate bins */ PRIVATE S16 cmMmHashListInsert ( CmMmHashListCp *hashListCp, /* hash list to add to */ -U32 key /* pointer to key */ +uint32_t key /* pointer to key */ ) #else PRIVATE S16 cmMmHashListInsert(hashListCp, key) CmMmHashListCp *hashListCp; /* hash list to add to */ -U32 key; /* pointer to key */ +uint32_t key; /* pointer to key */ #endif { CmMmHashListEnt *hashListEnt; /* pointer to hash list entry header */ - U16 idx; /* index for insertion into hash list */ - U16 i; + uint16_t idx; /* index for insertion into hash list */ + uint16_t i; /* check if hashListCp is initialised yet */ @@ -6093,23 +6093,23 @@ CmHstGrmHashListCp *hashListCp; /* hash list to initialize */ PRIVATE S16 cmHstGrmFreeInsert ( CmHstGrmHashListCp* hashListCp, /* hash list cp */ -U32 blkSz, /* size of the block freed */ -U32 line, /* Line number */ -U8 *fileName, /* file name */ -U8 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 PRIVATE S16 cmHstGrmFreeInsert(hashListCp, blkSz, line, fileName, entId) CmHstGrmHashListCp* hashListCp; /* hash list cp */ -U32 blkSz; /* size of the block freed */ -U32 line; /* line number */ -U8 *fileName; /* file Name */ -U8 entId; /* Tapa task which frees 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 frees the memory */ #endif { - U32 binIdx = 0; /* Bin index to insert the entry into the hash list */ - U32 key = 0; /* Key to fine the bin index */ - U32 ret = 0; /* Return value */ + 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 */ @@ -6175,25 +6175,25 @@ U8 entId; /* Tapa task which frees the memory */ PRIVATE S16 cmHstGrmAllocInsert ( CmHstGrmHashListCp *hashListCp, -U32 blkSz, -U32 *reqSz, -U32 line, -U8 *fileName, -U8 entId +uint32_t blkSz, +uint32_t *reqSz, +uint32_t line, +uint8_t *fileName, +uint8_t entId ) #else PRIVATE S16 cmHstGrmAllocInsert(hashListCp, blkSz, reqSz, line, fileName, entId) CmHstGrmHashListCp *hashListCp; -U32 blkSz; -U32 *reqSz; -U32 line; -U8 *fileName; -U8 entId; +uint32_t blkSz; +uint32_t *reqSz; +uint32_t line; +uint8_t *fileName; +uint8_t entId; #endif { - U32 binIdx = 0; - U32 key = 0; - U32 ret = 0; + uint32_t binIdx = 0; + uint32_t key = 0; + uint32_t ret = 0; CmMemEntries *entry = NULLP; @@ -6261,21 +6261,21 @@ U8 entId; #ifdef ANSI PRIVATE S16 cmHstGrmGetHashIdxAndKey ( -U8 *fileName, -U32 line, -U32 *binIdx, -U32 *key +uint8_t *fileName, +uint32_t line, +uint32_t *binIdx, +uint32_t *key ) #else PRIVATE S16 cmHstGrmGetHashIdxAndKey(fileName, line, binIdx, key) -U8 *fileName; -U32 line; -U32 *binIdx; -U32 *key; +uint8_t *fileName; +uint32_t line; +uint32_t *binIdx; +uint32_t *key; #endif { - U32 i = 0; + uint32_t i = 0; /* Calculate the key using file name and line number */ for(i = 0 ; fileName[i] != '\0'; i++) @@ -6311,22 +6311,22 @@ U32 *key; PRIVATE S16 cmHstGrmFillEntry ( CmMemEntries *entry, -U32 key, -U32 line, -U8 *fileName, -U8 entId +uint32_t key, +uint32_t line, +uint8_t *fileName, +uint8_t entId ) #else PRIVATE S16 cmHstGrmFillEntry(entry, key, line, fileName, entId) CmMemEntries *entry; -U32 key; -U32 line; -U8 *fileName; -U8 entId; +uint32_t key; +uint32_t line; +uint8_t *fileName; +uint8_t entId; #endif { - U32 idx = 0; + uint32_t idx = 0; entry->key = key; entry->line = line; entry->entId = entId; @@ -6359,21 +6359,21 @@ U8 entId; PRIVATE S16 cmHstGrmFindEntry ( CmHstGrmHashListCp *hashListCp, -U32 key, -U32 *binIdx, +uint32_t key, +uint32_t *binIdx, CmMemEntries **entry ) #else PRIVATE S16 cmHstGrmFindEntry(hashListCp, key, binIdx, entry) CmHstGrmHashListCp *hashListCp; -U32 key; -U32 *binIdx; +uint32_t key; +uint32_t *binIdx; CmMemEntries **entry; #endif { - U32 numEnt = 0; - U32 numBin = 0; + uint32_t numEnt = 0; + uint32_t numBin = 0; CmHstGrmHashListEnt *tmpBin = NULLP; @@ -6423,19 +6423,19 @@ CmMemEntries **entry; #endif /* SS_HISTOGRAM_SUPPORT */ #ifdef T2K_MEM_LEAK_DBG T2kMeamLeakInfo gMemLeakInfo[T2K_MEM_LEAK_INFO_TABLE_SIZE]; -U32 getT2kMemLeakIndex(U32 address) +uint32_t getT2kMemLeakIndex(uint32_t address) { return ((address - T2K_MEM_LEAK_START_ADDR) >> 8); } -static U32 t2kMemAllocTick; -static U32 smallTick; +static uint32_t t2kMemAllocTick; +static uint32_t smallTick; -void InsertToT2kMemLeakInfo(U32 address, U32 size, U32 lineNo, char* fileName) +void InsertToT2kMemLeakInfo(uint32_t address, uint32_t size, uint32_t lineNo, char* fileName) { - U32 idx = getT2kMemLeakIndex(address); + uint32_t idx = getT2kMemLeakIndex(address); - if(((U32)(address - T2K_MEM_LEAK_START_ADDR) & 0xff) !=0) + if(((uint32_t)(address - T2K_MEM_LEAK_START_ADDR) & 0xff) !=0) { printf("address in InsertToT2kMemLeakInfo is %lx size = %ld file is %s" "line is %ld \n", address, size, fileName, lineNo); @@ -6470,9 +6470,9 @@ void InsertToT2kMemLeakInfo(U32 address, U32 size, U32 lineNo, char* fileName) } -void RemoveFromT2kMemLeakInfo(U32 address, char *file, U32 line) +void RemoveFromT2kMemLeakInfo(uint32_t address, char *file, uint32_t line) { - U32 idx = getT2kMemLeakIndex(address); + uint32_t idx = getT2kMemLeakIndex(address); if(idx >= T2K_MEM_LEAK_INFO_TABLE_SIZE) { @@ -6553,23 +6553,23 @@ void DumpT2kMemLeakInfoToFile() #ifdef ANSI S16 UpdateSocMemInfo ( -U8 areaIndex, +uint8_t areaIndex, CmLteMemInfo *mInfo ) #else S16 UpdateSocMemInfo(areaIndex,mInfo) -U8 areaIndex; +uint8_t areaIndex; CmLteMemInfo *mInfo; #endif { - U8 idxReg; - U8 idxPool; - U16 numPool; + uint8_t idxReg; + uint8_t idxPool; + uint16_t numPool; void *iccHdl = NULLP; - U32 poolFreeCnt[4]; - U32 poolUsedCnt[4]; - U32 poolSize[4]; - U32 poolTotAvail[4]; + uint32_t poolFreeCnt[4]; + uint32_t poolUsedCnt[4]; + uint32_t poolSize[4]; + uint32_t poolTotAvail[4]; idxReg = mInfo->numRegions; mInfo->numRegions = mInfo->numRegions + 1; @@ -6637,18 +6637,18 @@ CmLteMemInfo *mInfo; * */ #ifdef ANSI -U32 isL2MemUsageBelowLowerThreshold( +uint32_t isL2MemUsageBelowLowerThreshold( Region region ) #else -U32 isL2MemUsageBelowLowerThreshold(region) +uint32_t isL2MemUsageBelowLowerThreshold(region) Region region; #endif { void * iccHdl = ssGetIccHdl(region); - U32 poolZeroFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ZERO_SIZE); - U32 poolOneFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ONE_SIZE); + uint32_t poolZeroFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ZERO_SIZE); + uint32_t poolOneFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ONE_SIZE); /* We are below the threshold if free count in BOTH of the pools * is above the ICC_MEM_LOWER_THRESHOLD % */ @@ -6681,20 +6681,20 @@ Region region; * */ #ifdef ANSI -U32 isMemUsageBelowLowerThreshold( +uint32_t isMemUsageBelowLowerThreshold( Region region ) #else -U32 isMemUsageBelowLowerThreshold(region) +uint32_t isMemUsageBelowLowerThreshold(region) Region region; #endif { void * iccHdl = ssGetIccHdl(region); - U32 poolZeroFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ZERO_SIZE); - U32 poolOneFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ONE_SIZE); - U32 poolTwoFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_TWO_SIZE); - U32 poolThreeFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_THREE_SIZE); + uint32_t poolZeroFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ZERO_SIZE); + uint32_t poolOneFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ONE_SIZE); + uint32_t poolTwoFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_TWO_SIZE); + uint32_t poolThreeFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_THREE_SIZE); /* We are below the threshold if free count in BOTH of the pools * is above the ICC_MEM_LOWER_THRESHOLD % */ @@ -6730,20 +6730,20 @@ Region region; * */ #ifdef ANSI -PRIVATE U32 isMemUsageAboveUpperThreshold( +PRIVATE uint32_t isMemUsageAboveUpperThreshold( Region region ) #else -PRIVATE U32 isMemUsageAboveUpperThreshold(region) +PRIVATE uint32_t isMemUsageAboveUpperThreshold(region) Region region; #endif { void * iccHdl = ssGetIccHdl(region); - U32 poolZeroFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ZERO_SIZE); - U32 poolOneFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ONE_SIZE); - U32 poolTwoFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_TWO_SIZE); - U32 poolThreeFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_THREE_SIZE); + uint32_t poolZeroFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ZERO_SIZE); + uint32_t poolOneFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_ONE_SIZE); + uint32_t poolTwoFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_TWO_SIZE); + uint32_t poolThreeFreeCnt = TL_GetFreeBlocks(iccHdl, ICC_POOL_THREE_SIZE); /* We are above the threshold if free count in either of the pools * is below the ICC_MEM_UPPER_THRESHOLD % */ @@ -6793,11 +6793,11 @@ Region region; * */ #ifdef ANSI -U32 isMemThreshReached( +uint32_t isMemThreshReached( Region reg ) #else -U32 isMemThreshReached(reg) +uint32_t isMemThreshReached(reg) Region reg; #endif {