Merge "[Epic-ID: ODUHIGH-517][Task-ID: ODUHIGH-540][SubTask-Id: ODUHIGH-549] Multi...
[o-du/l2.git] / src / cm / cm_mem.c
index 6bda4fb..a507098 100755 (executable)
@@ -294,7 +294,7 @@ void InsertToT2kMemLeakInfo(uint64_t address, uint32_t size, uint32_t lineNo, ch
 
    if(((uint64_t)(address - regMemLeakInfo.regStartAddr[region]) & regMinBktSzInfo[region].minBktSzMins1) !=0)
    {
-     printf("address in InsertToT2kMemLeakInfo is %ld size = %d file is %s line is %d \n", address, size, fileName, lineNo);
+      DU_LOG("\nINFO  --> address in InsertToT2kMemLeakInfo is %ld size = %d file is %s line is %d \n", address, size, fileName, lineNo);
    }
 
    leakInfo = (((T2kMeamLeakInfo*)(regMemLeakInfo.gMemLeakInfo[region])) + index1);
@@ -308,7 +308,8 @@ void InsertToT2kMemLeakInfo(uint64_t address, uint32_t size, uint32_t lineNo, ch
       leakInfo->prevRemLineNo = 0;
       leakInfo->prevRemFileName = '\0';
 
-      //printf("InsertToT2kMemLeakInfo  the adress from List  Address = %x, index1 = %d   from File=%s, line=%d \n",address,index1,fileName,lineNo);
+      //DU_LOG("\nINFO  --> InsertToT2kMemLeakInfo  the adress from List  Address = %x, index1 = %d   \
+      from File=%s, line=%d \n",address,index1,fileName,lineNo);
       if(smallTick++ == 4096)
       {
          smallTick = 0;
@@ -317,8 +318,8 @@ void InsertToT2kMemLeakInfo(uint64_t address, uint32_t size, uint32_t lineNo, ch
    }
    else
    {
-         printf("Something is wrong, trying to insert %ld index1 = %d file is %s line is %d \n",address, index1, fileName, lineNo);
-         printf("Address present :%ld, from File:%s, Line:%d, Size:%d, Age:%d",
+         DU_LOG("\nERROR  --> Something is wrong, trying to insert %ld index1 = %d file is %s line is %d \n",address, index1, fileName, lineNo);
+         DU_LOG("\nINFO  --> Address present :%ld, from File:%s, Line:%d, Size:%d, Age:%d",
                leakInfo->address, leakInfo->fileName,
                leakInfo->lineNo, leakInfo->size,
                leakInfo->age);
@@ -339,7 +340,7 @@ void RemoveFromT2kMemLeakInfo(uint64_t address, char *file, uint32_t line,Region
 
    if(index1 >= T2K_MEM_LEAK_INFO_TABLE_SIZE)
    {
-      printf("index1 out of range = %d address is %ld file = %s line = %d. We are going to crash!!!\n",
+      DU_LOG("\nERROR  --> index1 out of range = %d address is %ld file = %s line = %d. We are going to crash!!!\n",
               index1,
               address,
               file,
@@ -358,14 +359,14 @@ void RemoveFromT2kMemLeakInfo(uint64_t address, char *file, uint32_t line,Region
    }
    else
    {
-         printf("Something is wrong, trying to remove %ld index1 = %d  from File=%s, line=%d address present is %ld region%d \n",address, index1, file,line,leakInfo->address,region);
+         DU_LOG("\nERROR  --> Something is wrong, trying to remove %ld index1 = %d  from File=%s, line=%d address present is %ld region%d \n",address, index1, file,line,leakInfo->address,region);
 
-         printf("\n Last Del file %s line %d\n",leakInfo->lastDelFileName,
+         DU_LOG("\nINFO  -->  Last Del file %s line %d\n",leakInfo->lastDelFileName,
                  leakInfo->lastDelLineNum);
 
          if(leakInfo->prevRemFileName != NULLP)
          {
-            printf("Previous File:%s, Previous Line:%d\n",
+             DU_LOG("\nINFO  --> Previous File:%s, Previous Line:%d\n",
                   leakInfo->prevRemFileName, leakInfo->prevRemLineNo);
          }
    }
@@ -380,7 +381,7 @@ void DumpT2kMemLeakInfoToFile()
 
    if(fp == NULL)
    {
-      printf("Could not open file for dumping mem leak info\n");
+      DU_LOG("\nERROR  --> Could not open file for dumping mem leak info\n");
       return;
    }
    for(reg=0; reg <regMemLeakInfo.numActvRegions; reg++)
@@ -461,23 +462,11 @@ uint32_t cmDblFreeAttempts = 0;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-S16 cmMmRegInit
-(
-Region       region,
-CmMmRegCb   *regCb,
-CmMmRegCfg  *cfg
-)
-#else
-S16 cmMmRegInit(region, regCb, cfg)
-Region       region;
-CmMmRegCb   *regCb;
-CmMmRegCfg  *cfg;
-#endif
+S16 cmMmRegInit(Region region,CmMmRegCb *regCb,CmMmRegCfg  *cfg)
 {
    Data *memAddr;
-   uint16_t   bktIdx;
-   uint16_t   lstMapIdx;
+   uint16_t bktIdx;
+   uint16_t lstMapIdx;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    Size  lstQnSize;
@@ -759,7 +748,7 @@ CmMmRegCfg  *cfg;
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
     /* Initialize the hast list to maintain the SSI memory information for Broadcom */
     offset = (uint16_t)((PTR)(&ptrHdr.ent) - (PTR) &ptrHdr);
-    printf("###########offset is %d region %d\n", offset, region);
+    DU_LOG("\nINFO  --> offset is %d region %d\n", offset, region);
     if(cmHashListInit(&regCb->brdcmSsiLstCp, 1000, offset, FALSE, 
        CM_HASH_KEYTYPE_UINT32_MOD, region, 0) != ROK)
     {
@@ -797,15 +786,7 @@ CmMmRegCfg  *cfg;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-S16 cmMmRegDeInit
-(
-CmMmRegCb   *regCb
-)
-#else
-S16 cmMmRegDeInit(regCb)
-CmMmRegCb   *regCb;
-#endif
+S16 cmMmRegDeInit(CmMmRegCb   *regCb)
 {
    uint16_t  bktIdx; 
 
@@ -927,144 +908,82 @@ int regFreeBktSts[10][2][6]={{0}};
 /* cm_mem_c_001.main_15 : Additions */
 #ifdef SS_HISTOGRAM_SUPPORT
 #ifdef SSI_DEBUG_LEVEL1
-#ifdef ANSI
 static S16  cmAlloc
 (
-Void   *regionCb,
-Size   *size,
+Void         *regionCb,
+Size         *size,
 uint32_t     flags,
-Data  **ptr,
+Data         **ptr,
 uint32_t     memType,
 uint32_t     line,
 uint8_t     *fileName,
 uint8_t      entId,
-Bool    hstReg
+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,
-Size   *size,
+Void         *regionCb,
+Size         *size,
 uint32_t     flags,
-Data  **ptr,
+Data         **ptr,
 uint32_t     line,
-uint8_t     *fileName,
+uint8_t      *fileName,
 uint8_t      entId,
-Bool    hstReg
+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 SS_LIGHT_MEM_LEAK_STS
-#ifdef ANSI
 static S16  cmAlloc
 (
-Void   *regionCb,
-Size   *size,
+Void         *regionCb,
+Size         *size,
 uint32_t     flags,
-Data  **ptr,
+Data         **ptr,
 uint32_t     memType,
 uint32_t     lineNo,
-uint8_t     *funcName
+uint8_t      *funcName
 )
-#else
-static S16  cmAlloc(regionCb, size, flags, ptr ,memType, lineNo, funcName)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-uint32_t     memType;
-uint32_t     lineNo;
-uint8_t     *funcName;
-#endif
 #else /*SS_LIGHT_MEM_LEAK_STS */
 #ifdef SSI_DEBUG_LEVEL1
-#ifdef ANSI
 static S16  cmAlloc
 (
-Void   *regionCb,
-Size   *size,
+Void         *regionCb,
+Size                *size,
 uint32_t     flags,
-Data  **ptr,
+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 BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-#ifdef ANSI
 static S16  cmAlloc
 (
-Void   *regionCb,
-Size   *size,
+Void         *regionCb,
+Size         *size,
 uint32_t     flags,
-Data  **ptr,
+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 T2K_MEM_LEAK_DBG
 static S16  cmAlloc
 (
- Void   *regionCb,
- Size   *size,
+ Void         *regionCb,
+ Size         *size,
  uint32_t     flags,
- Data   **ptr ,
- char*  file,
- uint32_t    line
+ Data         **ptr,
+ char*        file,
+ uint32_t     line
  )
 #else
-#ifdef ANSI
 static S16  cmAlloc
 (
-Void   *regionCb,
-Size   *size,
+Void         *regionCb,
+Size         *size,
 uint32_t     flags,
-Data  **ptr 
+Data         **ptr 
 )
-#else
-static S16  cmAlloc(regionCb, size, flags, ptr)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-#endif
 #endif
 #endif /* BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1 */
 #endif /* SSI_DEBUG_LEVEL1 */
@@ -1075,7 +994,7 @@ Data  **ptr;
 {
 /* cm_mem_c_001.main_26 : Fixes for Compilation Warnings */
 #ifndef USE_PURE
-   uint16_t        idx;
+   uint16_t  idx;
    CmMmBkt   *bkt;
 #endif
    CmMmRegCb *regCb;
@@ -1287,7 +1206,7 @@ Data  **prevptr;
       /* Initialize the elements with 0xAB */
       memset(*ptr, 0xAB, *size);
 #endif
-//      printf("Pointer allocated %8p size %d\n", *ptr, *size);
+//      DU_LOG("\nINFO  --> Pointer allocated %8p size %d\n", *ptr, *size);
       /* Store this pointer in hash list */
       if ((bkt->nextBlk) && *ptr)
 #elif SS_LIGHT_MEM_LEAK_STS
@@ -1392,7 +1311,7 @@ Data  **prevptr;
                if (g_overused[bktIdx] == 0 && OVERUSED(bkt))
                {
                   g_overused[bktIdx] = 1;
-                  /*printf("cmAlloc: bktIdx %u overused %u numAlloc %u\n", bktIdx, g_overused[bktIdx], bkt->numAlloc); */
+                  /*DU_LOG("\nINFO  --> cmAlloc: bktIdx %u overused %u numAlloc %u\n", bktIdx, g_overused[bktIdx], bkt->numAlloc); */
                }
             }
 #endif
@@ -1609,71 +1528,44 @@ Data  **prevptr;
 
 /*  cm_mem_c_001.main_15 : Additions */
 #ifdef SS_LIGHT_MEM_LEAK_STS
-#ifdef ANSI
 static S16  cmFree
 (
-Void   *regionCb,
-Data   *ptr, 
-Size    size,
-uint32_t     lineNo,
-uint8_t      *funcName
+Void     *regionCb,
+Data     *ptr, 
+Size     size,
+uint32_t lineNo,
+uint8_t  *funcName
 )
-#else
-static S16  cmFree(regionCb, ptr, size, lineNo, funcName)
-Void   *regionCb;
-Data   *ptr;
-Size    size;
-uint32_t     lineNo;
-uint8_t      *funcName;
-#endif
 #else /*SS_LIGHT_MEM_LEAK_STS */
 #ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
 static S16  cmFree
 (
-Void   *regionCb,
-Data   *ptr,
-Size    size,
-uint32_t     line,
-uint8_t     *fileName,
-uint8_t      entId,
-Bool    hstReg
+Void     *regionCb,
+Data     *ptr,
+Size     size,
+uint32_t line,
+uint8_t  *fileName,
+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 T2K_MEM_LEAK_DBG
 static S16  cmFree
 (
- Void   *regionCb,
- Data   *ptr,
- Size   size,
- char*  file,
- uint32_t    line
+Void   *regionCb,
+Data   *ptr,
+Size   size,
+char*  file,
+uint32_t line
  )
 #else /* T2K_MEM_LEAK_DBG */
-#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 */ 
@@ -1812,13 +1704,13 @@ Size    size;
                size(%d) %8p, Bucket Id:%03d\n",
                size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
 #endif
-         printf("Passed size (%d) does not match with allocated \
+         DU_LOG("\nERROR  --> Passed size (%d) does not match with allocated \
                size(%d) %8p, Bucket Id:%03d\n",
                size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
          abort();
       }
       /* Validate the tail part to see if there is any over run */
-//      printf("Pointer free request %8p, size %d\n", ptr, size);
+//      DU_LOG("\nINFO  --> Pointer free request %8p, size %d\n", ptr, size);
 #endif
 
       /* validate the block to be freed for trampling */
@@ -1879,7 +1771,7 @@ Size    size;
                 return (RTRAMPLINGNOK);
            }
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-         printf("Memory signature is invalid\n");
+         DU_LOG("\nERROR  --> Memory signature is invalid\n");
          abort();
 #endif
       }
@@ -1915,7 +1807,7 @@ Size    size;
           (Void) SUnlock(&(bkt->bktLock));
 #endif
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-         printf("Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
+         DU_LOG("\nERROR  --> Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
                  size %u bytes \n", ptr, regCb->mapTbl[idx].bktIdx, bkt->size);
           abort();
 #endif
@@ -2245,62 +2137,34 @@ Size    size;
 /* cm_mem_c_001.main_15 : Additions */
 #ifdef SS_HISTOGRAM_SUPPORT
 #ifdef SSI_DEBUG_LEVEL1
-#ifdef ANSI
 S16  cmAllocNL
 (
 Void   *regionCb,
 Size   *size,
-uint32_t     flags,
+uint32_t flags,
 Data  **ptr,
-uint32_t     memType,
-uint32_t     line,
-uint8_t     *fileName,
-uint8_t      entId,
+uint32_t memType,
+uint32_t line,
+uint8_t  *fileName,
+uint8_t  entId,
 Bool    hstReg
 )
 #else
-S16  cmAllocNL(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
 S16  cmAllocNL
 (
 Void   *regionCb,
 Size   *size,
-uint32_t     flags,
+uint32_t flags,
 Data  **ptr,
-uint32_t     line,
-uint8_t     *fileName,
-uint8_t      entId,
+uint32_t line,
+uint8_t  *fileName,
+uint8_t  entId,
 Bool    hstReg
 )
-#else
-S16  cmAllocNL(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 SS_LIGHT_MEM_LEAK_STS
-#ifdef ANSI
 S16  cmAllocNL
 (
 Void   *regionCb,
@@ -2311,38 +2175,18 @@ uint32_t     memType,
 uint32_t     lineNo,
 uint8_t     *funcName
 )
-#else
-S16  cmAllocNL(regionCb, size, flags, ptr ,memType, lineNo, funcName)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-uint32_t     memType;
-uint32_t     lineNo;
-uint8_t     *funcName;
-#endif
 #else /*SS_LIGHT_MEM_LEAK_STS */
 #ifdef SSI_DEBUG_LEVEL1
-#ifdef ANSI
 S16  cmAllocNL
 (
 Void   *regionCb,
 Size   *size,
-uint32_t     flags,
+uint32_t flags,
 Data  **ptr,
-uint32_t     memType
+uint32_t memType
 )
 #else
-S16  cmAllocNL(regionCb, size, flags, ptr, memType)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-uint32_t     memType;
-#endif
-#else
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-#ifdef ANSI
 S16  cmAllocNL
 (
 Void   *regionCb,
@@ -2352,15 +2196,6 @@ Data  **ptr,
 uint32_t     memType
 )
 #else
-S16  cmAllocNL(regionCb, size, flags, ptr, memType)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-uint32_t     memType;
-#endif
-#else
-#ifdef ANSI
 S16  cmAllocNL
 (
 Void   *regionCb,
@@ -2368,13 +2203,6 @@ Size   *size,
 uint32_t     flags,
 Data  **ptr 
 )
-#else
-S16  cmAllocNL(regionCb, size, flags, ptr)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-#endif
 #endif /* BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1 */
 #endif /* SSI_DEBUG_LEVEL1 */
    /* cm_mem_c_001.main_15: Additions */
@@ -2812,7 +2640,6 @@ Data  **ptr;
 
 /*  cm_mem_c_001.main_15 : Additions */
 #ifdef SS_LIGHT_MEM_LEAK_STS
-#ifdef ANSI
 S16  cmFreeNL
 (
 Void   *regionCb,
@@ -2821,18 +2648,9 @@ Size    size,
 uint32_t     lineNo,
 uint8_t      *funcName
 )
-#else
-S16  cmFreeNL(regionCb, ptr, size, lineNo, funcName)
-Void   *regionCb;
-Data   *ptr;
-Size    size;
-uint32_t     lineNo;
-uint8_t      *funcName;
-#endif
 #else /*SS_LIGHT_MEM_LEAK_STS */
 
 #ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
 S16  cmFreeNL
 (
 Void   *regionCb,
@@ -2843,32 +2661,14 @@ uint8_t     *fileName,
 uint8_t      entId,
 Bool    hstReg
 )
-#else
-S16  cmFreeNL(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
 S16  cmFreeNL
 (
 Void   *regionCb,
 Data   *ptr, 
 Size    size
 )
-#else
-S16  cmFreeNL(regionCb, ptr, size)
-Void   *regionCb;
-Data   *ptr;
-Size    size;
-#endif
    /*  cm_mem_c_001.main_15 : Additions */
 #endif /* SS_HISTOGRAM_SUPPORT */ 
 #endif /*SS_LIGHT_MEM_LEAK_STS */
@@ -2983,7 +2783,7 @@ Size    size;
          sprintf(dbgPrntBuf, "Passed size (%d) does not match with allocated size(%d):%8p, Bucket Id:%03d\n",
                  size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
 #endif
-         printf("Passed size (%d) does not match with allocated size(%d):%8p, Bucket Id:%03d\n",
+         DU_LOG("\nERROR  --> Passed size (%d) does not match with allocated size(%d):%8p, Bucket Id:%03d\n",
                  size, ptrHdr->requestedSize, ptr, regCb->mapTbl[idx].bktIdx);
          abort();
       }
@@ -3027,7 +2827,7 @@ Size    size;
          }
 #endif
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-         printf("Memory signature is invalid\n");
+         DU_LOG("\nERROR  --> Memory signature is invalid\n");
          abort();
 #endif
       }
@@ -3057,7 +2857,7 @@ Size    size;
          SDisplay(0, dbgPrntBuf);
 #endif /* DEBUGP */
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-         printf("Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
+         DU_LOG("\nERROR  --> Attempt to double deallocate memory at: %8p, Bucket Id:%03d,\
                  size %u bytes \n", ptr, regCb->mapTbl[idx].bktIdx, bkt->size);
           abort();
 #endif
@@ -3219,23 +3019,15 @@ Size    size;
 /*cm_mem_c_001.main_21-added new function*/
 /*cm_mem_c_001.main_23 Removed support of SSI_DEBUG_LEVEL1 and SS_HISTOGRAM_SUPPORT for SS_FAP*/
 #ifdef SS_FAP
-#ifdef ANSI
 static S16  cmAllocWL
 (
 Void   *regionCb,
 Size   *size,
-uint32_t     flags,
+uint32_t flags,
 Data  **ptr 
 )
-#else
-static S16  cmAllocWL(regionCb, size, flags, ptr)
-Void   *regionCb;
-Size   *size;
-uint32_t     flags;
-Data  **ptr;
-#endif
 {
-   uint16_t        idx;
+   uint16_t  idx;
    CmMmBkt   *bkt;
    CmMmRegCb *regCb;
    /*cm_mem_c_001.main_23 Removed support of SSI_DEBUG_LEVEL1 and SS_HISTOGRAM_SUPPORT for SS_FAP*/
@@ -3342,21 +3134,9 @@ Data  **ptr;
 *
 */
 
-#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
+static S16  cmFreeWL(Void *regionCb,Data *ptr, Size size)
 {
-   uint16_t        idx;
+   uint16_t  idx;
    CmMmBkt   *bkt;
    CmMmRegCb *regCb;
    /*cm_mem_c_001.main_23 Removed support of SSI_DEBUG_LEVEL1 and SS_HISTOGRAM_SUPPORT for SS_FAP*/
@@ -3470,19 +3250,7 @@ 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
+static S16  cmCtl(Void *regionCb,Event event, SMemCtl *memCtl)
 {
    CmMmRegCb *regCb;
 
@@ -3602,23 +3370,14 @@ SMemCtl *memCtl;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
 static Void cmMmBktInit
 (
-Data      **memAddr,
+Data       **memAddr,
 CmMmRegCb  *regCb,
 CmMmRegCfg *cfg,
-uint16_t         bktIdx,
-uint16_t        *lstMapIdx
+uint16_t   bktIdx,
+uint16_t   *lstMapIdx
 )
-#else
-static Void cmMmBktInit (memAddr, regCb, cfg, bktIdx, lstMapIdx)
-Data      **memAddr;
-CmMmRegCb  *regCb;
-CmMmRegCfg *cfg;
-uint16_t         bktIdx;
-uint16_t        *lstMapIdx;
-#endif
 {
    uint32_t   cnt;
    uint16_t   idx;
@@ -3857,19 +3616,7 @@ uint16_t        *lstMapIdx;
 *       File:  cm_mem.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
+static Void  cmMmHeapInit(Data *memAddr,CmMmHeapCb  *heapCb,Size size)
 {
 /* cm_mem_c_001.main_12 - addition for ssi enhancements */
 #ifdef SSI_DEBUG_LEVEL1
@@ -3948,7 +3695,6 @@ uint8_t ysCellConfigDone;
 #endif
 #ifdef SS_HISTOGRAM_SUPPORT 
 #ifdef SSI_DEBUG_LEVEL1
-#ifdef ANSI
 static S16  cmHeapAlloc
 (
 CmMmHeapCb  *heapCb,
@@ -3961,18 +3707,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,
@@ -3983,20 +3717,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,
@@ -4005,26 +3728,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 */ 
@@ -4315,7 +4024,6 @@ Size        *size;
 */
 /*  cm_mem_c_001.main_15 : Additions */
 #ifdef SS_HISTOGRAM_SUPPORT  
-#ifdef ANSI
 static S16  cmHeapFree 
 (
 CmMmHeapCb  *heapCb,
@@ -4327,29 +4035,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 */ 
 {
@@ -4724,14 +4415,7 @@ Size         size;
 } /* end of cmHeapFree */
 #endif/*USE_PURE*/
 #ifdef SS_LIGHT_MEM_LEAK_STS
-#ifdef ANSI
-uint32_t cmGetFreeIndx
-(
-Void
-)
-#else
 uint32_t cmGetFreeIndx(Void)
-#endif
 {
 
     if(gmemLkCb.head == gmemLkCb.tail)
@@ -4747,16 +4431,7 @@ uint32_t cmGetFreeIndx(Void)
     }
  
 }
-#ifdef ANSI
-uint32_t cmPutFreeIndx
-(
-uint32_t   allocQIndx
-)
-#else
-uint32_t cmPutFreeIndx(allocQIndx)
-uint32_t   allocQIndx;
-#endif
-
+uint32_t cmPutFreeIndx(uint32_t allocQIndx)
 {
     uint32_t tmpTail = (gmemLkCb.tail+1)% CM_MAX_ALLOC_ENTERIES;
     if(tmpTail == gmemLkCb.head)
@@ -4786,14 +4461,7 @@ uint32_t   allocQIndx;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-Void cmInitMemLeak
-(
-Void
-)
-#else
 Void cmInitMemLeak (Void)
-#endif
 {
    uint32_t   indx;  
 
@@ -4825,14 +4493,7 @@ Void cmInitMemLeak (Void)
  * File:  cm_mem.c
  * 
  **/
-#ifdef ANSI
-Void cmDeinitMemLeak
-(
-Void
-)
-#else
-Void cmDeinitMemLeak (Void)
-#endif
+Void cmDeinitMemLeak(Void)
 {
    uint32_t   indx;  
 
@@ -4862,16 +4523,7 @@ Void cmDeinitMemLeak (Void)
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-uint32_t cmStorAllocBlk
-(
-Void    *addr
-)
-#else
-uint32_t cmStorAllocBlk (addr)
-Void    *addr;
-#endif /* ANSI */
-
+uint32_t cmStorAllocBlk(Void  *addr)
 {
    uint32_t allocQIndx;
 
@@ -4904,15 +4556,7 @@ Void    *addr;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-Void cmRlsAllocBlk
-(
-uint32_t    allocQIndx
-)
-#else
-Void cmRlsAllocBlk(allocQIndx)
-uint32_t    allocQIndx;
-#endif
+Void cmRlsAllocBlk(uint32_t allocQIndx)
 {
    
    if(allocQIndx < CM_MAX_ALLOC_ENTERIES)
@@ -4940,24 +4584,17 @@ uint32_t    allocQIndx;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-Void cmStartStopLeakLog
-(
-Void
-)
-#else
 Void cmStartStopLeakLog(Void)
-#endif
 {
    if (FALSE == gmemLkCb.isStarted)
    {
-      printf("!!leak capturing started\n");
+      DU_LOG("\nINFO  --> leak capturing started\n");
       gmemLkCb.isStarted = TRUE;
    }
    else
    {
       gmemLkCb.isStarted = FALSE;
-      printf("!!leak capturing stopped\n");
+      DU_LOG("\nINFO  --> leak capturing stopped\n");
       cmPrintLeakLog();
    }
    return;
@@ -4976,14 +4613,7 @@ Void cmStartStopLeakLog(Void)
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-Void cmPrintLeakLog
-(
-Void
-)
-#else
 Void cmPrintLeakLog(Void)
-#endif
 {
  
    uint32_t   indx;  
@@ -4991,18 +4621,18 @@ Void cmPrintLeakLog(Void)
    static uint32_t leakCount =0; 
 
 
-   printf("---- START OF LEAK LOG ----");
+   DU_LOG("\nINFO  --> START OF LEAK LOG ");
    SLock(&gmemLkCb.memLock);
-   printf("---- Lock Acquired ----");
+   DU_LOG("\nINFO  -->  Lock Acquired");
    for(indx = 0; indx < CM_MAX_ALLOC_ENTERIES; indx++)
    {
       if(gmemLkCb.allocInfo[indx].used == TRUE)
       {
          leakCount++;
          aBkt =(CmMmBlkHdr *)gmemLkCb.allocInfo[indx].memAddr;
-         printf("LeakCnt(%ld)Addr(0x%p)RqSz(%ld)",
+         DU_LOG("LeakCnt(%ld)Addr(0x%p)RqSz(%ld)",
             leakCount,gmemLkCb.allocInfo[indx].memAddr, aBkt->requestedSize);
-         printf("LineNo(%ld)funcName(%s)\n",
+         DU_LOG("LineNo(%ld)funcName(%s)\n",
             aBkt->lineNo, aBkt->currFuncName);
          gmemLkCb.allocInfo[indx].used = FALSE;
          cmPutFreeIndx(indx);
@@ -5010,9 +4640,9 @@ Void cmPrintLeakLog(Void)
       //if(leakCount % 10 == 0)
         // sleep(1);
    }
-   printf("---- END OF LEAK LOG ----");
+   DU_LOG("\nINFO  -->  END OF LEAK LOG ");
    SUnlock(&gmemLkCb.memLock);
-   printf("---- Lock Released ----");
+   DU_LOG("\nINFO  -->  Lock Released");
    leakCount =0; 
    return;
 }
@@ -5036,19 +4666,12 @@ Void cmPrintLeakLog(Void)
 *
 */
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
-#ifdef ANSI
 Void cmRlsAllocBlk
 (
 CmMmBlkHdr  *ptrHdr,
 CmMmRegCb *regCb
 )
 #else
-Void cmRlsAllocBlk(ptrHdr, regCb)
-CmMmBlkHdr  *ptrHdr;
-CmMmRegCb *regCb;
-#endif
-#else
-#ifdef ANSI
 Void cmRlsAllocBlk
 (
 #ifdef BIT_64
@@ -5057,20 +4680,12 @@ uint64_t    addr
 uint32_t    addr
 #endif
 )
-#else
-Void cmRlsAllocBlk(addr)
-#ifdef BIT_64
-uint64_t    addr;
-#else
-uint32_t    addr;
-#endif
-#endif
 #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;
 #ifndef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
@@ -5216,7 +4831,6 @@ uint32_t    addr;
 *
 */
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
-#ifdef ANSI
 Void cmStorAllocBlk
 (
 CmMmBlkHdr    *ptrHdr, 
@@ -5226,15 +4840,6 @@ uint16_t           bktIdx,
 CmMmRegCb     *regCb
 )
 #else
-Void cmStorAllocBlk (ptrHdr, reqSz, allocSz, bktIdx, regCb)
-CmMmBlkHdr    *ptrHdr;
-Size          reqSz;
-Size          allocSz;
-uint16_t           bktIdx;
-CmMmRegCb     *regCb;
-#endif
-#else
-#ifdef ANSI
 Void cmStorAllocBlk
 (
 #ifdef BIT_64
@@ -5246,17 +4851,6 @@ Size   reqSz,
 Size   allocSz,
 uint16_t    bktIdx
 )
-#else
-Void cmStorAllocBlk (addr, reqSz, allocSz, bktIdx)
-#ifdef BIT_64
-uint64_t    addr;
-#else
-uint32_t    addr;
-#endif
-Size   reqSz;
-Size   allocSz;
-uint16_t    bktIdx;
-#endif /* ANSI */
 #endif /* BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1 */
 {
 #ifndef SS_MEM_LEAK_SOL
@@ -5288,7 +4882,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 */
 #ifndef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
@@ -5311,7 +4905,7 @@ uint16_t    bktIdx;
    allocInfo = (MemAllocInfo *)calloc(1, sizeof(MemAllocInfo));  
 #endif
 #endif
-       /* SGetSBuf(DFLT_REGION, DFLT_POOL, &allocInfo,  sizeof(MemAllocInfo)); */
+       /* SGetSBufNewForDebug(__FILE__,__FUNCTION__,__LINE__,DFLT_REGION, DFLT_POOL, &allocInfo,  sizeof(MemAllocInfo)); */
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
    /* check if hashListCp is initialised yet */
    if ( regCb->brdcmSsiLstCp.nmbBins == 0)
@@ -5361,14 +4955,7 @@ uint16_t    bktIdx;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-Void SLogLkInfo
-(
-Void
-)
-#else
 Void SLogLkInfo (Void)
-#endif
 {
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
    uint8_t                 idx;
@@ -5518,17 +5105,10 @@ Void SLogLkInfo (Void)
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-Void cmInitMemLeakMdl
-(
-Void
-)
-#else
 Void cmInitMemLeakMdl (Void)
-#endif
 {
    uint8_t   memMdl;
-       uint8_t   hashIdx;
+   uint8_t   hashIdx;
 
 
    memLkCb.memLkMdlInit = FALSE;
@@ -5566,14 +5146,7 @@ Void cmInitMemLeakMdl (Void)
  * File:  cm_mem.c
  * 
  **/
-#ifdef ANSI
-Void cmDeinitMemLeakMdl
-(
-Void
-)
-#else
 Void cmDeinitMemLeakMdl (Void)
-#endif
 {
   uint8_t   memMdl;
   uint8_t   hashIdx;
@@ -5606,15 +5179,7 @@ Void cmDeinitMemLeakMdl (Void)
 *       File:  cm_mem.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");
@@ -5635,19 +5200,12 @@ S8 *msOptArg;
 *       File:  cm_mem.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;
 #endif /* SS_MEM_LEAK_SOL */
@@ -5680,7 +5238,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*/   
@@ -5712,21 +5270,11 @@ Void SFlushLkInfo (Void)
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-uint8_t cmMemGetModuleId
-(
-S8     **funNm,
-S32    traceSize
-)
-#else
-uint8_t cmMemGetModuleId (funNm, traceSize)
-S8     **funNm;
-S32    traceSize;
-#endif /* ANSI */
+uint8_t cmMemGetModuleId(S8 **funNm,S32 traceSize)
 {
-   uint8_t    idx;
-   uint8_t    memStrIdx;
-   uint32_t   len;
+   uint8_t  idx;
+   uint8_t  memStrIdx;
+   uint32_t len;
    S32   retVal;
    S16   memReqIdx;
    S16   mdlFunStrIdx;
@@ -5788,7 +5336,6 @@ S32    traceSize;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
 S16 cmMemGetStrMtchIdx  
 (
 uint8_t strtIdx, 
@@ -5796,13 +5343,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];
@@ -5861,19 +5401,7 @@ S8 **strLst;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
-S32 cmAddrToSymStr
-(
-Void   *pc, 
-S8     *buffer, 
-S32    size
-)
-#else
-S32 cmAddrToSymStr(pc, buffer, size)
-Void   *pc;
-S8     *buffer;
-S32    size;
-#endif
+S32 cmAddrToSymStr(Void *pc, S8 *buffer, S32 size)
 {
 
    Dl_info info;
@@ -5917,19 +5445,7 @@ S32    size;
 *       File:  cm_mem.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
+S32 cmLeakCallBack(uintptr_t pc,S32  sigNo, Void *arg)
 {
     S8   *buffer;
 
@@ -5943,7 +5459,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;
 
@@ -5972,27 +5488,9 @@ Void      *arg;
 *
 */
 #ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL1
-#ifdef ANSI
-S16 cmMmRegIsBlkSane
-(
-CmMmBlkHdr *blkPtr,
-Size       size
-)
-#else
-S16 cmMmRegIsBlkSane(blkPtr, size)
-CmMmBlkHdr *blkPtr;
-Size       size;
-#endif
+S16 cmMmRegIsBlkSane(CmMmBlkHdr *blkPtr,Size  size)
 #else
-#ifdef ANSI
-S16 cmMmRegIsBlkSane
-(
-CmMmBlkHdr *blkPtr
-)
-#else
-S16 cmMmRegIsBlkSane(blkPtr)
-CmMmBlkHdr *blkPtr;
-#endif
+S16 cmMmRegIsBlkSane(CmMmBlkHdr *blkPtr)
 #endif
 {
    uint32_t sigCnt;
@@ -6041,15 +5539,7 @@ CmMmBlkHdr *blkPtr;
 *       File:  cm_mem.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;
@@ -6101,18 +5591,9 @@ CmMmBkt  *bkt;
 *       File:  cm_mem.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++;
 
@@ -6139,19 +5620,7 @@ CmMmHeapCb  *heapCb;
 *       File:  cm_mem.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
+static S16 cmMmHashFunc(CmMmHashListCp *hashListCp,uint32_t key,uint16_t *idx)
 {
 
    *idx = (uint16_t)(key % hashListCp->numOfbins);
@@ -6181,21 +5650,13 @@ uint16_t *idx; /* idx to return */
 *       File:  cm_mem.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;
@@ -6209,7 +5670,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;
 
@@ -6246,24 +5707,17 @@ Pool         pool;         /* memory pool to allocate bins */
 *       File:  cm_mem.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 */
+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)));
 
@@ -6292,17 +5746,11 @@ Pool         pool;         /* memory pool to allocate bins */
 *       File:  cm_mem.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 */
@@ -6376,15 +5824,10 @@ uint32_t           key;         /* pointer to key */
 *       File:  cm_mem.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
@@ -6416,15 +5859,10 @@ CmHstGrmHashListCp *hashListCp;  /* hash list to initialize */
 *       File:  cm_mem.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
@@ -6460,28 +5898,19 @@ CmHstGrmHashListCp *hashListCp;  /* hash list to initialize */
 *       File:  cm_mem.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 */
 
 
 
@@ -6502,7 +5931,7 @@ uint8_t        entId; /* Tapa task which frees the memory */
    /* If hash list is full then print the error tna continue */
    if(hashListCp->totalNumEntries == (CMM_HIST_MAX_MEM_BIN * CMM_HIST_MAX_MEM_ENTRY_PER_BIN))
    {
-        printf("No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN \n");
+        DU_LOG("\nERROR  --> No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN \n");
         return RFAILED;
    } /* End of if */
 
@@ -6542,30 +5971,20 @@ uint8_t        entId; /* Tapa task which frees the memory */
 *       File:  cm_mem.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. *
@@ -6586,7 +6005,7 @@ uint8_t        entId;
 
    if(hashListCp->totalNumEntries == (CMM_HIST_MAX_MEM_BIN * CMM_HIST_MAX_MEM_ENTRY_PER_BIN))
    {
-        printf("No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN\n");
+        DU_LOG("\nERROR  --> No place in the hash list. Increase the value of macro CMM_HIST_MAX_MEM_BIN and CMM_HIST_MAX_MEM_ENTRY_PER_BIN\n");
         return RFAILED;
    } /* End of if */
 
@@ -6629,21 +6048,13 @@ uint8_t        entId;
 *       File:  cm_mem.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;
@@ -6678,23 +6089,14 @@ uint32_t                *key;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
 static S16 cmHstGrmFillEntry
 (
-CmMemEntries       *entry,
-uint32_t                key,
-uint32_t                line,
-uint8_t                 *fileName,
-uint8_t                 entId
+CmMemEntries *entry,
+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;
@@ -6726,25 +6128,17 @@ uint8_t                 entId;
 *       File:  cm_mem.c
 *
 */
-#ifdef ANSI
 static S16 cmHstGrmFindEntry
 (
 CmHstGrmHashListCp  *hashListCp,
-uint32_t                 key,
-uint32_t                 *binIdx,
-CmMemEntries        **entry
+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++)
@@ -6780,12 +6174,12 @@ CmMemEntries        **entry;
       } /* End of if (numEnt) */
       else
       {
-         printf ("Unable to find the entry in hash list\n");
+         DU_LOG("\nERROR  --> Unable to find the entry in hash list\n");
          return RFAILED;
       }/* End of else (numEnt) */
    }/* end of for (numBin = 0) */
 
-   printf("Unable to find the entry in the hash list\n");
+   DU_LOG("\nERROR  --> Unable to find the entry in the hash list\n");
    return RFAILED;
 } /* end of cmHstGrmFindEntry */