* 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;
* File: cm_mem.c
*
*/
-#ifdef ANSI
-S16 cmMmRegDeInit
-(
-CmMmRegCb *regCb
-)
-#else
-S16 cmMmRegDeInit(regCb)
-CmMmRegCb *regCb;
-#endif
+S16 cmMmRegDeInit(CmMmRegCb *regCb)
{
uint16_t bktIdx;
/* 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 */
{
/* cm_mem_c_001.main_26 : Fixes for Compilation Warnings */
#ifndef USE_PURE
- uint16_t idx;
+ uint16_t idx;
CmMmBkt *bkt;
#endif
CmMmRegCb *regCb;
/* 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 */
/* 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,
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,
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,
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 */
/* cm_mem_c_001.main_15 : Additions */
#ifdef SS_LIGHT_MEM_LEAK_STS
-#ifdef ANSI
S16 cmFreeNL
(
Void *regionCb,
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,
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 */
/*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*/
*
*/
-#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*/
*
*/
-#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;
* 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;
* 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
#endif
#ifdef SS_HISTOGRAM_SUPPORT
#ifdef SSI_DEBUG_LEVEL1
-#ifdef ANSI
static S16 cmHeapAlloc
(
CmMmHeapCb *heapCb,
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,
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,
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 */
*/
/* cm_mem_c_001.main_15 : Additions */
#ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
static S16 cmHeapFree
(
CmMmHeapCb *heapCb,
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 */
{
} /* 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)
}
}
-#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)
* File: cm_mem.c
*
*/
-#ifdef ANSI
-Void cmInitMemLeak
-(
-Void
-)
-#else
Void cmInitMemLeak (Void)
-#endif
{
uint32_t indx;
* File: cm_mem.c
*
**/
-#ifdef ANSI
-Void cmDeinitMemLeak
-(
-Void
-)
-#else
-Void cmDeinitMemLeak (Void)
-#endif
+Void cmDeinitMemLeak(Void)
{
uint32_t indx;
* 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;
* 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)
* File: cm_mem.c
*
*/
-#ifdef ANSI
-Void cmStartStopLeakLog
-(
-Void
-)
-#else
Void cmStartStopLeakLog(Void)
-#endif
{
if (FALSE == gmemLkCb.isStarted)
{
* File: cm_mem.c
*
*/
-#ifdef ANSI
-Void cmPrintLeakLog
-(
-Void
-)
-#else
Void cmPrintLeakLog(Void)
-#endif
{
uint32_t indx;
*
*/
#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
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
*
*/
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
-#ifdef ANSI
Void cmStorAllocBlk
(
CmMmBlkHdr *ptrHdr,
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
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
* File: cm_mem.c
*
*/
-#ifdef ANSI
-Void SLogLkInfo
-(
-Void
-)
-#else
Void SLogLkInfo (Void)
-#endif
{
#ifdef BRDCM_SSI_MEM_LEAK_DEBUG_LEVEL2
uint8_t idx;
* 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;
* File: cm_mem.c
*
**/
-#ifdef ANSI
-Void cmDeinitMemLeakMdl
-(
-Void
-)
-#else
Void cmDeinitMemLeakMdl (Void)
-#endif
{
uint8_t memMdl;
uint8_t hashIdx;
* 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");
* 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 */
* 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;
* File: cm_mem.c
*
*/
-#ifdef ANSI
S16 cmMemGetStrMtchIdx
(
uint8_t strtIdx,
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];
* 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;
* 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;
*
*/
#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;
* 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;
* 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++;
* 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);
* 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;
* 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 */
* 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 */
* 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
* 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
* 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 */
* 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. *
* 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;
* 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;
* 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++)