#include <pthread.h>
#ifdef XEON_SPECIFIC_CHANGES
uint32_t startMemLeak=0;
-extern pthread_mutex_t memLock;
+pthread_mutex_t memLock;
#endif
#if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
S16 ssGetDBufOfSize ARGS((Region region, Size size, Buffer **dBuf));
S16 SIncMsgRef(Buffer *srcBuf,Region dstRegion, Pool dstPool,Buffer **dstBuf);
#ifdef SSI_STATIC_MEM_LEAK_DETECTION
-EXTERN uint32_t GetNextFreeIdx ARGS((StaticMemAllocInfo * memAllocInfo));
-EXTERN void LogForStaticMemLeak ARGS((StaticMemAllocInfo* memAllocInfo, char*
+uint32_t GetNextFreeIdx ARGS((StaticMemAllocInfo * memAllocInfo));
+void LogForStaticMemLeak ARGS((StaticMemAllocInfo* memAllocInfo, char*
file, uint32_t line, uint32_t size, void* ptr, uint32_t idx));
-EXTERN void FreeIdx ARGS((uint8_t* ptr, uint32_t idx, StaticMemAllocInfo*
+void FreeIdx ARGS((uint8_t* ptr, uint32_t idx, StaticMemAllocInfo*
memAllocInfo,uint32_t size, char* file, uint32_t line));
#endif
#ifdef SS_USE_ZBC_MEMORY
#ifdef T2K_MEM_LEAK_DBG
-PRIVATE S16 SPutZbcDBufNew ARGS((Region region, Buffer *buf,char*,uint32_t));
+static S16 SPutZbcDBufNew ARGS((Region region, Buffer *buf,char*,uint32_t));
#else
-PRIVATE S16 SPutZbcDBuf ARGS((Region region, Buffer *buf));
+static S16 SPutZbcDBuf ARGS((Region region, Buffer *buf));
S16 SAttachPtrToBuf ARGS(( Region region, Pool pool, Data *ptr,
MsgLen totalLen, Buffer** mBuf));
#endif
#ifdef SS_M_PROTO_REGION
#ifdef T2K_MEM_LEAK_DBG
#define DupMsg(region,buffer) DupMsgNew(region,buffer,file,line)
-PRIVATE Buffer *DupMsgNew ARGS((Region region, Buffer *buffer,char*,uint32_t));
+static Buffer *DupMsgNew ARGS((Region region, Buffer *buffer,char*,uint32_t));
#else
#ifdef INTEL_WLS
#ifdef T2K_MEM_LEAK_DBG
#endif /* INTEL_WLS */
-PRIVATE Buffer *DupMsg ARGS((Region region, Buffer *buffer));
+static Buffer *DupMsg ARGS((Region region, Buffer *buffer));
#endif
#endif /* SS_M_PROTO_REGION */
}
-EXTERN pthread_t tmpRegTidMap[20];
+pthread_t tmpRegTidMap[20];
#define CM_MEM_GET_REGION(_region) \
{ \
uint8_t _regCnt; \
}
#if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF) || defined(L2_OPTMZ))
-extern S32 clusterMode;
+S32 clusterMode;
#endif
/*
*
uint32_t line
)
#else
-#ifdef ANSI
S16 ssGetDBufOfSize
(
Region region,
Size size,
Buffer **dBuf
)
-#else
-S16 ssGetDBufOfSize(region, size, dBuf)
-Region region;
-Size size;
-Buffer **dBuf;
-#endif
#endif
{
Size mdsize;
*/
/* ss001.301: additions */
#ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
S16 SGetMsgNew
(
Region region, /* region id */
uint32_t line,
uint8_t *fileName
)
-#else
-S16 SGetMsgNew(region, pool, mBuf, line, fileName)
-Region region; /* region id */
-Pool pool; /* pool id */
-Buffer **mBuf; /* pointer to message buffer */
-uint32_t line;
-uint8_t *fileName;
-#endif
#else /* SS_HISTOGRAM_SUPPORT */
#ifdef T2K_MEM_LEAK_DBG
S16 SGetMsgNew
uint32_t line
)
#else
-#ifdef ANSI
S16 SGetMsg
(
Region region, /* region id */
Pool pool, /* pool id */
Buffer **mBuf /* pointer to message buffer */
)
-#else
-S16 SGetMsg(region, pool, mBuf)
-Region region; /* region id */
-Pool pool; /* pool id */
-Buffer **mBuf; /* pointer to message buffer */
-#endif
#endif
#endif /* SS_HISTOGRAM_SUPPORT */
{
*/
/* ss001.301: additions */
#ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
S16 SPutMsgNew
(
Buffer *mBuf,
uint32_t line,
uint8_t *fileName
)
-#else
-S16 SPutMsgNew(mBuf, line, fileName)
-Buffer *mBuf;
-uint32_t line;
-uint8_t *fileName;
-#endif
#else /* SS_HISTOGRAM_SUPPORT */
#ifdef T2K_MEM_LEAK_DBG
S16 SPutMsgNew
uint32_t line
)
#else
-#ifdef ANSI
S16 SPutMsg
(
Buffer *mBuf
)
-#else
-S16 SPutMsg(mBuf)
-Buffer *mBuf;
-#endif
#endif
#endif /* SS_HISTOGRAM_SUPPORT */
{
#endif
#if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
{
- extern pthread_t gMacTId,gRlcTId;
- extern S32 clusterMode;
+ pthread_t gMacTId,gRlcTId;
+ S32 clusterMode;
if(clusterMode == RADIO_CLUSTER_MODE)
{
CM_MEM_GET_REGION(tmpThrReg)
if(tmpThrReg == 0xFF)
{
+#ifdef ERROR_PRINT
printf("\n Not able to get region \n");
+#endif
return RFAILED;
}
#endif
uint32_t line
)
#else
-#ifdef ANSI
S16 SPutStaticBuffer
(
Region region, /* region ID */
Size size, /* size */
uint8_t memType /* memory type used if shareable or not */
)
-#else
-S16 SPutStaticBuffer(region, pool, ptr, size)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data *ptr; /* pointer to buffer */
-Size size; /* size */
-uint8_t memType; /* memory type used if shareable or not */
-#endif
#endif
{
S16 ret = RFAILED;
#endif
#if (defined (MAC_FREE_RING_BUF) || defined (RLC_FREE_RING_BUF))
{
- extern pthread_t gMacTId,gRlcTId;
+ pthread_t gMacTId,gRlcTId;
if(clusterMode == RADIO_CLUSTER_MODE)
{
uint32_t line
)
#else
-#ifdef ANSI
S16 SGetStaticBuffer
(
Region region, /* region ID */
Size size, /* size requested */
uint8_t memType /* memory type used if shareable or not */
)
-#else
-S16 SGetStaticBuffer(region, pool, ptr, size)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data **ptr; /* pointer to buffer */
-Size size; /* size requested */
-uint8_t memType; /* memory type used if shareable or not */
-#endif
#endif
{
S16 ret = RFAILED;
}
#endif /* SS_LOCKLESS_MEMORY */
-#ifdef INTEL_WLS
+#ifdef INTEL_WLS_MEM
#ifndef SS_LOCKLESS_MEMORY
-#ifdef ANSI
S16 SGetStaticBuffer
(
Region region, /* region ID */
Size size, /* size requested */
uint8_t memType /* memory type used if shareable or not */
)
-#else
-S16 SGetStaticBuffer(region, pool, ptr, size)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data **ptr; /* pointer to buffer */
-Size size; /* size requested */
-uint8_t memType; /* memory type used if shareable or not */
-#endif
{
S16 ret;
}
-#ifdef ANSI
S16 SPutStaticBuffer
(
Region region, /* region ID */
Size size, /* size */
uint8_t memType /* memory type used if shareable or not */
)
-#else
-S16 SPutStaticBuffer(region, pool, ptr, size)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data *ptr; /* pointer to buffer */
-Size size; /* size */
-uint8_t memType; /* memory type used if shareable or not */
-#endif
{
S16 ret;
*/
/* ss001.301: additions */
#ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
S16 SGetSBufNew
(
Region region, /* region ID */
uint32_t line,
uint8_t *fileName
)
-#else
-S16 SGetSBufNew(region, pool, ptr, size, line, fileName)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data **ptr; /* pointer to buffer */
-Size size; /* size requested */
-uint32_t line;
-uint8_t *fileName;
-#endif
#else /* SS_HISTOGRAM_SUPPORT */
#if (defined(SSI_STATIC_MEM_LEAK_DETECTION) || defined(T2K_MEM_LEAK_DBG))
-#ifdef ANSI
S16 SGetSBuf1
(
Region region, /* region ID */
uint32_t line
)
#else
-S16 SGetSBuf1(region, pool, ptr, size, file, line)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data **ptr; /* pointer to buffer */
-Size size; /* size requested */
-char* file;
-uint32_t line;
-#endif
-#else
-#ifdef ANSI
S16 SGetSBuf
(
Region region, /* region ID */
Data **ptr, /* pointer to buffer */
Size size /* size requested */
)
-#else
-S16 SGetSBuf(region, pool, ptr, size)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data **ptr; /* pointer to buffer */
-Size size; /* size requested */
-#endif
#endif
#endif /* SS_HISTOGRAM_SUPPORT */
{
#endif
/*size = tmpSize - 4;*/
{
- /*printf("ptr = %p *ptr = %p\n",ptr,*ptr);*/
+ /*printf("\nptr = %p *ptr = %p\n",ptr,*ptr);*/
#ifdef XEON_SPECIFIC_CHANGES
pthread_mutex_lock(&(memLock));
#endif
/* store the index in the memory allocated itself */
/**((uint32_t*)*((uint32_t*)allocatedPtr)) = idx;*/
*((uint32_t*)allocatedPtr) = idx;
- /*printf("region = %d idx = %d ptr = %p *ptr = %p actual = %p allocated = %p content = %d\n",region, idx, ptr, *ptr, actualPtr, allocatedPtr, *((uint32_t*)allocatedPtr));*/
+ /*printf("\nregion = %d idx = %d ptr = %p *ptr = %p actual = %p allocated = %p content = %d\n",region, idx, ptr, *ptr, actualPtr, allocatedPtr, *((uint32_t*)allocatedPtr));*/
LogForStaticMemLeak(&SMemLeakInfo[region],
file,
*/
/* ss001.301: additions */
#ifdef SS_HISTOGRAM_SUPPORT
-#ifdef ANSI
S16 SPutSBufNew
(
Region region, /* region ID */
uint32_t line,
uint8_t *fileName
)
-#else
-S16 SPutSBufNew(region, pool, ptr, size, line, fileName)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data *ptr; /* pointer to buffer */
-Size size; /* size */
-uint32_t line;
-uint8_t *fileName;
-#endif
#else /* SS_HISTOGRAM_SUPPORT */
#if (defined(SSI_STATIC_MEM_LEAK_DETECTION) || defined(T2K_MEM_LEAK_DBG))
-#ifdef ANSI
S16 SPutSBuf1
(
Region region, /* region ID */
uint32_t line
)
#else
-S16 SPutSBuf1(region, pool, ptr, size, file, line)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data *ptr; /* pointer to buffer */
-Size size; /* size */
-char* file;
-uint32_t line;
-#endif
-#else
-#ifdef ANSI
S16 SPutSBuf
(
Region region, /* region ID */
Data *ptr, /* pointer to buffer */
Size size /* size */
)
-#else
-S16 SPutSBuf(region, pool, ptr, size)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Data *ptr; /* pointer to buffer */
-Size size; /* size */
-#endif
#endif
#endif /* SS_HISTOGRAM_SUPPORT */
{
*
*/
-#ifdef ANSI
-S16 SInitMsg
-(
-Buffer *mBuf
-)
-#else
-S16 SInitMsg(mBuf)
-Buffer *mBuf;
-#endif
+S16 SInitMsg(Buffer *mBuf)
{
SsMsgInfo *minfo;
Buffer *tmp;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SAddPreMsgMultInOrder
(
- Data *src,
- MsgLen cnt,
- Buffer *mBuf
- )
-#else
-S16 SAddPreMsgMultInOrder(src, cnt, mBuf)
- Data *src;
- MsgLen cnt;
- Buffer *mBuf;
-#endif
+Data *src,
+MsgLen cnt,
+Buffer *mBuf
+)
{
SsMsgInfo *minfo; /* Message info */
Buffer *tmp;
*/
-#ifdef ANSI
S16 SAddPreMsg
(
Data data,
Buffer *mBuf
)
-#else
-S16 SAddPreMsg (data, mBuf)
-Data data;
-Buffer *mBuf;
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SAddPstMsg
(
Data data,
Buffer *mBuf
)
-#else
-S16 SAddPstMsg (data, mBuf)
-Data data;
-Buffer *mBuf;
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
)
#else
-#ifdef ANSI
S16 SAddPreMsgMult
(
Data *src,
MsgLen cnt,
Buffer *mBuf
)
-#else
-S16 SAddPreMsgMult(src, cnt, mBuf)
-Data *src;
-MsgLen cnt;
-Buffer *mBuf;
-#endif
#endif
{
SsMsgInfo *minfo; /* Message info */
uint32_t line
)
#else
-#ifdef ANSI
S16 SAddPstMsgMult
(
Data *src,
MsgLen cnt,
Buffer *mBuf
)
-#else
-S16 SAddPstMsgMult(src, cnt, mBuf)
-Data *src;
-MsgLen cnt;
-Buffer *mBuf;
-#endif
#endif
{
SsMsgInfo *minfo;
*/
-#ifdef ANSI
S16 SRemPreMsg
(
Data *dataPtr,
Buffer *mBuf
)
-#else
-S16 SRemPreMsg(dataPtr, mBuf)
-Data *dataPtr;
-Buffer *mBuf;
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SRemPstMsg
(
Data *dataPtr, /* pointer to data */
Buffer *mBuf
)
-#else
-S16 SRemPstMsg(dataPtr, mBuf)
-Data *dataPtr; /* pointer to data */
-Buffer *mBuf; /* message buffer */
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*
*/
-#ifdef ANSI
S16 SRemPreMsgMult
(
Data *dst, /* destination */
MsgLen cnt, /* count */
Buffer *mBuf
)
-#else
-S16 SRemPreMsgMult(dst, cnt, mBuf)
-Data *dst; /* destination */
-MsgLen cnt; /* count */
-Buffer *mBuf; /* message buffer */
-#endif
{
- SsMsgInfo *minfo;
- Buffer *tmp;
- MsgLen numBytes;
+ SsMsgInfo *minfo = NULLP;
+ Buffer *tmp = NULLP;
+ MsgLen numBytes =0;
#ifdef T2K_MEM_LEAK_DBG
char* file = __FILE__;
uint32_t line = __LINE__;
*
*/
-#ifdef ANSI
S16 SRemPstMsgMult
(
Data *dst, /* destination */
MsgLen cnt, /* count */
Buffer *mBuf
)
-#else
-S16 SRemPstMsgMult(dst, cnt, mBuf)
-Data *dst; /* destination */
-MsgLen cnt; /* count */
-Buffer *mBuf; /* message buffer */
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SExamMsg
(
Data *dataPtr, /* pointer to data */
Buffer *mBuf, /* message buffer */
MsgLen idx
)
-#else
-S16 SExamMsg(dataPtr, mBuf, idx)
-Data *dataPtr; /* pointer to data */
-Buffer *mBuf; /* message buffer */
-MsgLen idx; /* index */
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SGetDataFrmMsg
(
Buffer *mBuf, /* message buffer */
MsgLen idx,
MsgLen dataLen
)
-#else
-S16 SGetDataFrmMsg(mBuf, dataPtr, idx, dataLen)
-Buffer *mBuf; /* message buffer */
-Data *dataPtr; /* pointer to data */
-MsgLen idx; /* index */
-MsgLen dataLen;
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SFndLenMsg
(
REG1 Buffer *mBuf, /* message buffer */
MsgLen *lngPtr
)
-#else
-S16 SFndLenMsg(mBuf, lngPtr)
-REG1 Buffer *mBuf; /* message buffer */
-MsgLen *lngPtr; /* pointer to length */
-#endif
{
SsMsgInfo *minfo;
uint32_t line
)
#else
-#ifdef ANSI
S16 SSegMsg
(
Buffer *mBuf1, /* message 1 */
MsgLen idx, /* index */
Buffer **mBuf2
)
-#else
-S16 SSegMsg(mBuf1, idx, mBuf2)
-Buffer *mBuf1; /* message 1 */
-MsgLen idx; /* index */
-Buffer **mBuf2; /* message 2 */
-#endif
#endif
{
SsMsgInfo *minfo1;
*
*/
-#ifdef ANSI
S16 SCpyFixMsg
(
Data *srcBuf, /* source buffer */
MsgLen cnt, /* count */
MsgLen *cCnt
)
-#else
-S16 SCpyFixMsg(srcBuf, dstMbuf, dstIdx, cnt, cCnt)
-Data *srcBuf; /* source buffer */
-Buffer *dstMbuf; /* destination message buffer */
-MsgLen dstIdx; /* destination index */
-MsgLen cnt; /* count */
-MsgLen *cCnt; /* copied count */
-#endif
{
S16 ret;
SsMsgInfo *minfo;
*
*/
-#ifdef ANSI
S16 SCpyMsgFix
(
Buffer *srcMbuf, /* source message buffer */
Data *dstBuf, /* destination buffer */
MsgLen *cCnt
)
-#else
-S16 SCpyMsgFix(srcMbuf, srcIdx, cnt, dstBuf, cCnt)
-Buffer *srcMbuf; /* source message buffer */
-MsgLen srcIdx; /* source index */
-MsgLen cnt; /* count */
-Data *dstBuf; /* destination buffer */
-MsgLen *cCnt; /* copied count */
-#endif
{
- Data *cptr;
- Buffer *tmp;
- SsMsgInfo *minfo;
- MsgLen numBytes;
+ Data *cptr = NULLP;
+ Buffer *tmp = NULLP;
+ SsMsgInfo *minfo = NULLP;
+ MsgLen numBytes =0;
#if (ERRCLASS & ERRCLS_INT_PAR)
/* check source message buffer */
uint32_t line
)
#else
-#ifdef ANSI
S16 SCpyMsgMsg
(
Buffer *srcBuf,
Pool dstPool,
Buffer **dstBuf
)
-#else
-S16 SCpyMsgMsg(srcBuf, dstRegion, dstPool, dstBuf)
-Buffer *srcBuf;
-Region dstRegion;
-Pool dstPool;
-Buffer **dstBuf;
-#endif
#endif
{
SsMsgInfo *minfo1;
(Void) SPutDBuf(minfo1->region, minfo1->pool, newblk);
newblk = curblk;
}
- printf("Failed to get the buffer of size %s %d\n", __FILE__, __LINE__);
+#ifdef ERROR_PRINT
+ printf("\nFailed to get the buffer of size %s %d\n", __FILE__, __LINE__);
+#endif
(Void) SPutMsg(*dstBuf);
return (ROUTRES);
}
uint32_t line
)
#else
-#ifdef ANSI
S16 SAddMsgRef
(
Buffer *srcBuf,
Pool dstPool,
Buffer **dstBuf
)
-#else
-S16 SAddMsgRef(srcBuf, dstRegion, dstPool, dstBuf)
-Buffer *srcBuf;
-Region dstRegion;
-Pool dstPool;
-Buffer **dstBuf;
-#endif
#endif
{
SsMsgInfo *minfo1;
*
*/
#ifdef T2K_MEM_LEAK_DBG
-PRIVATE Buffer *DupMsgNew
+static Buffer *DupMsgNew
(
Region region, /* region id */
Buffer *mp, /* message block */
uint32_t line
)
#else
-#ifdef ANSI
-PRIVATE Buffer *DupMsg
+static Buffer *DupMsg
(
Region region, /* region id */
Buffer *mp /* message block */
)
-#else
-PRIVATE Buffer *DupMsg(region, mp)
-Region region; /* region id */
-Buffer *mp; /* message block */
-#endif
#endif
{
Buffer *bp; /* mblk for iteration */
uint32_t line
)
#else
-#ifdef ANSI
S16 SGetDBuf
(
Region region, /* region id */
Pool pool, /* pool id */
Buffer **bufPtr
)
-#else
-S16 SGetDBuf(region, pool, bufPtr)
-Region region; /* region id */
-Pool pool; /* pool id */
-Buffer **bufPtr; /* pointer to buffer */
-#endif
#endif
{
Size size;
#ifndef SS_DBUF_REFLOCK_DISABLE
if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
{
- printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+ printf("\nFalied to destroy lock\n");
+#endif
}
#endif
uint32_t line
)
#else
-#ifdef ANSI
S16 SPutDBuf
(
Region region,
Pool pool,
Buffer *buf
)
-#else
-S16 SPutDBuf(region, pool, buf)
-Region region;
-Pool pool;
-Buffer *buf;
-#endif
#endif
{
- register SsDblk *dptr;
+ register SsDblk *dptr = NULLP;
/* ss021.103 - Addition to check return value of SFree */
- S16 ret;
+ S16 ret = ROK;
#if (defined(SS_USE_ZBC_MEMORY) && defined (TENB_DPDK_BUF))
- Data *dpdkBuf;
+ Data *dpdkBuf = NULLP;
#endif
ret = SUnlock(&dptr->dBufLock) ;
if((SDestroyLock(&dptr->dBufLock)) != 0)
{
- printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+ printf("\nFalied to destroy lock\n");
+#endif
}
#endif
/* free buffer to region */
*/
-#ifdef ANSI
S16 SCatMsg
(
Buffer *mBuf1, /* message 1 */
Buffer *mBuf2, /* message 2 */
Order order
)
-#else
-S16 SCatMsg(mBuf1, mBuf2, order)
-Buffer *mBuf1; /* message 1 */
-Buffer *mBuf2; /* message 2 */
-Order order; /* order */
-#endif
{
SsMsgInfo *minfo1;
SsMsgInfo *minfo2;
*/
-#ifdef ANSI
S16 SRepMsg
(
Data data, /* data */
Buffer *mBuf, /* message buffer */
MsgLen idx
)
-#else
-S16 SRepMsg(data, mBuf, idx)
-Data data; /* data */
-Buffer *mBuf; /* message buffer */
-MsgLen idx; /* index */
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SUpdMsg
(
Buffer *mBuf, /* message buffer */
Buffer *dBuf, /* data buffer */
MsgLen dLen
)
-#else
-S16 SUpdMsg(mBuf, dBuf, dLen)
-Buffer *mBuf; /* message buffer */
-Buffer *dBuf; /* data buffer */
-MsgLen dLen; /* data length */
-#endif
{
SsMsgInfo *minfo;
*/
-#ifdef ANSI
S16 SAddDBufPst
(
Buffer *mBuf, /* message buffer */
Buffer *dBuf
)
-#else
-S16 SAddDBufPst(mBuf, dBuf)
-Buffer *mBuf; /* message buffer */
-Buffer *dBuf; /* data buffer */
-#endif
{
SsMsgInfo *minfo;
*/
-#ifdef ANSI
S16 SAddDBufPre
(
Buffer *mBuf, /* message buffer */
Buffer *dBuf
)
-#else
-S16 SAddDBufPre(mBuf, dBuf)
-Buffer *mBuf; /* message buffer */
-Buffer *dBuf; /* data buffer */
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SRemDBufPre
(
Buffer *mBuf, /* message buffer */
Buffer **dBufPtr
)
-#else
-S16 SRemDBufPre(mBuf, dBufPtr)
-Buffer *mBuf; /* message buffer */
-Buffer **dBufPtr; /* pointer to data buffer */
-#endif
{
SsMsgInfo *minfo;
*/
-#ifdef ANSI
S16 SRemDBufPst
(
Buffer *mBuf, /* message buffer */
Buffer **dBufPtr
)
-#else
-S16 SRemDBufPst(mBuf, dBufPtr)
-Buffer *mBuf; /* message buffer */
-Buffer **dBufPtr; /* pointer to data buffer */
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
*/
-#ifdef ANSI
S16 SInitNxtDBuf
(
Buffer *mBuf
)
-#else
-S16 SInitNxtDBuf(mBuf)
-Buffer *mBuf; /* message buffer */
-#endif
{
SsMsgInfo *minfo;
*/
-#ifdef ANSI
S16 SGetNxtDBuf
(
Buffer *mBuf, /* message buffer */
Buffer **dBuf
)
-#else
-S16 SGetNxtDBuf(mBuf, dBuf)
-Buffer *mBuf; /* message buffer */
-Buffer **dBuf; /* data buffer return */
-#endif
{
SsMsgInfo *minfo;
*
*/
-#ifdef ANSI
S16 SChkNxtDBuf
(
Buffer *mBuf
)
-#else
-S16 SChkNxtDBuf(mBuf)
-Buffer *mBuf; /* message buffer */
-#endif
{
SsMsgInfo *minfo;
*/
-#ifdef ANSI
S16 SGetDataRx
(
Buffer *dBuf, /* data buffer */
Data **retDatPtr, /* return data pointer */
MsgLen *retDatLen
)
-#else
-S16 SGetDataRx(dBuf, pad, retDatPtr, retDatLen)
-Buffer *dBuf; /* data buffer */
-MsgLen pad; /* pad */
-Data **retDatPtr; /* return data pointer */
-MsgLen *retDatLen; /* return data length */
-#endif
{
#if (ERRCLASS & ERRCLS_INT_PAR)
*/
-#ifdef ANSI
S16 SGetDataTx
(
Buffer *dBuf, /* data buffer */
Data **retDatPtr, /* return data pointer */
MsgLen *retDatLen /* return data length */
)
-#else
-S16 SGetDataTx(dBuf, retDatPtr, retDatLen)
-Buffer *dBuf; /* data buffer */
-Data **retDatPtr; /* return data pointer */
-MsgLen *retDatLen; /* return data length */
-#endif
{
#if (ERRCLASS & ERRCLS_INT_PAR)
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SGetBufRegionPool
(
Buffer *mBuf, /* message buffer */
Region *region, /* region */
Pool *pool /* pool */
)
-#else
-S16 SGetBufRegionPool(mBuf, region, pool)
-Buffer *mBuf; /* message buffer */
-Region *region; /* region */
-Pool *pool; /* pool */
-#endif
{
SsMsgInfo *mInfo; /* message info pointer */
*/
-#ifdef ANSI
S16 SCompressMsg
(
Buffer *mBuf
)
-#else
-S16 SCompressMsg(mBuf)
-Buffer *mBuf; /* message buffer */
-#endif
{
SsMsgInfo *minfo;
MsgLen numBytes;
*
*/
-#ifdef ANSI
S16 SPrntMsg
(
Buffer *mBuf, /* message buffer */
S16 src, /* source id */
S16 dst /* destination id */
)
-#else
-S16 SPrntMsg(mBuf, src, dst)
-Buffer *mBuf; /* message buffer */
-S16 src; /* source id */
-S16 dst; /* destination id */
-#endif
{
- QLen qlen; /* queue length */
- MsgLen mlen; /* message length */
+ QLen qlen =0; /* queue length */
+ MsgLen mlen =0; /* message length */
/*
* SDeRegTTsk patch
*/
/* ss038.103 : 102061 Changed to MsgLen from S16 */
- MsgLen i; /* counter */
- S16 j; /* counter */
- S16 k; /* counter */
- uint8_t data; /* data */
+ MsgLen i =0; /* counter */
+ S16 j =0; /* counter */
+ S16 k =0; /* counter */
+ uint8_t data =0; /* data */
uint8_t tdata[16] = {0}; /* temporary data */
- S8 prntBuf[256]; /* print buffer */
- Buffer *tmp; /* buffer ptr */
- Data *cptr;
+ S8 prntBuf[256] ={0}; /* print buffer */
+ Buffer *tmp = NULLP; /* buffer ptr */
+ Data *cptr =NULLP;
/* ss012.13: Addition */
- Data reg;
+ Data reg =0;
mlen = ((SsMsgInfo*)(mBuf->b_rptr))->len;
reg = ((SsMsgInfo*)(mBuf->b_rptr))->region;
/*ss013.301: Fixed Warnings for 32/64 bit compilation*/
+#ifdef DEBUG_PRINT
sprintf(prntBuf,"\nmsg: qlen: %04d mlen: %04d %02d-->%02d region: %02d\n",
(uint16_t)qlen,(uint16_t)mlen,src,dst,reg);
SPrint( prntBuf);
SPrint((S8*) "dat: ");
#ifdef XEON_SPECIFIC_CHANGES
printf("\ndat: ");
+#endif
#endif
if (mlen == 0)
/* print hex */
tdata[j]=data;
sprintf( prntBuf,"%02x ",(uint16_t) data);
+#ifdef DEBUG_PRINT
SPrint( prntBuf);
#ifdef XEON_SPECIFIC_CHANGES
printf("%s\n", prntBuf);
+#endif
#endif
if (cptr == tmp->b_wptr)
{
else
{
sprintf( prntBuf," ");
+#ifdef DEBUG_PRINT
SPrint( prntBuf );
#ifdef XEON_SPECIFIC_CHANGES
printf("%s\n", prntBuf);
+#endif
#endif
}
}
{
/* print character if printable */
sprintf(prntBuf,"%c",tdata[k]);
+#ifdef DEBUG_PRINT
SPrint( prntBuf);
#ifdef XEON_SPECIFIC_CHANGES
printf("%s\n", prntBuf);
+#endif
#endif
}
else
{
/* print . if non printable */
+#ifdef DEBUG_PRINT
SPrint((S8*) ".");
#ifdef XEON_SPECIFIC_CHANGES
printf(".");
#endif
+#endif
}
}
sprintf(prntBuf,"\n ");
+#ifdef DEBUG_PRINT
SPrint(prntBuf);
#ifdef XEON_SPECIFIC_CHANGES
printf("%s\n", prntBuf);
#endif
+#endif
}
return ROK;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SGetPstMsgMult
(
MsgLen cnt, /* count */
Buffer *mBuf /* message buffer */
)
-#else
-S16 SGetPstMsgMult(cnt, mBuf)
-MsgLen cnt; /* count */
-Buffer *mBuf; /* message buffer */
-#endif
{
Buffer *tmp;
Buffer *newb;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SChkMsg
(
Buffer *mBuf
)
-#else
-S16 SChkMsg(mBuf)
-Buffer *mBuf;
-#endif
{
SsMsgInfo *minfo;
Buffer *tmp;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SAlignDBufEven
(
Buffer *dBuf /* data buffer */
)
-#else
-S16 SAlignDBufEven(dBuf)
-Buffer *dBuf; /* data buffer */
-#endif
{
MsgLen len;
Data *src;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SAlignDBuf
(
Buffer *dBuf, /* data buffer */
uint32_t align /* alignemnt required */
)
-#else
-S16 SAlignDBuf(dBuf, align)
-Buffer *dBuf; /* data buffer */
-uint32_t align; /* alignemnt required */
-#endif
{
MsgLen len;
Data *src;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SGetSMem
(
Region region, /* region ID */
Size size, /* size */
Pool *pool /* pointer to pool ID */
)
-#else
-S16 SGetSMem(region, size, pool)
-Region region; /* region ID */
-Size size; /* size */
-Pool *pool; /* pointer to pool ID */
-#endif
{
UNUSED(size);
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SPutSMem
(
Region region, /* region ID */
Pool pool /* pool ID */
)
-#else
-S16 SPutSMem(region, pool)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-#endif
{
/* ss021.103 - Addition of return value */
#if (ERRCLASS & ERRCLS_INT_PAR)
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SChkRes
(
Region region, /* region ID */
Pool pool, /* pool ID */
Status *status /* pointer to status */
)
-#else
-S16 SChkRes(region, pool, status)
-Region region; /* region ID */
-Pool pool; /* pool ID */
-Status *status; /* pointer to status */
-#endif
{
S16 ret;
SMemCtl mctl;
*/
-#ifdef ANSI
S16 SSwapMsg
(
Buffer *mBuf1, /* message 1 */
Buffer *mBuf2 /* message 2 */
)
-#else
-S16 SSwapMsg(mBuf1, mBuf2)
-Buffer *mBuf1; /* message 1 */
-Buffer *mBuf2; /* message 2 */
-#endif
{
SsMsgInfo *minfop;
SsMsgInfo minfo;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SConvPtrPhy
(
Buffer **mBuf
)
-#else
-S16 SConvPtrPhy (mBuf)
- Buffer **mBuf;
-#endif
{
Buffer *curPtr;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SConvPhyPtr
(
- Buffer **workPtr
- )
-#else
-S16 SConvPhyPtr (workPtr)
- Buffer **workPtr;
-#endif
+Buffer **workPtr
+)
{
Buffer *curPtr;
* File:
*
*/
-#ifdef ANSI
S16 SCpyFpaMsg
(
- Buffer *srcBuf,
- Region dstRegion,
- Pool dstPool,
- Buffer **dstBuf
- )
-#else
-S16 SCpyFpaMsg (srcBuf, dstRegion, dstPool, dstBuf)
- Buffer *srcBuf;
- Region dstRegion;
- Pool dstPool;
- Buffer **dstBuf;
-#endif
+Buffer *srcBuf,
+Region dstRegion,
+Pool dstPool,
+Buffer **dstBuf
+)
{
Size numBytes;
* File:
*
*/
-#ifdef ANSI
S16 SCpyMsgFpa
(
- Buffer *srcBuf,
- Buffer **dstBuf
- )
-#else
-S16 SCpyMsgFpa (srcBuf, dstBuf)
- Buffer *srcBuf;
- Buffer **dstBuf;
-#endif
+Buffer *srcBuf,
+Buffer **dstBuf
+)
{
Buffer *curPtr = NULLP;
* File:
*
*/
-#ifdef ANSI
S16 SPutFpaMsg
(
- Buffer *fpaBuf
+Buffer *fpaBuf
)
-#else
-S16 SPutFpaMsg(fpaBuf)
-Buffer *fpaBuf;
-#endif
{
uint16_t size;
Buffer *curBlk;
*
*/
-#ifdef ANSI
S16 SCpyPartMsg
(
Buffer *srcBuf,
MsgLen cnt,
Buffer *dstBuf
)
-#else
-S16 SCpyPartMsg(srcBuf, idx, cnt, dstBuf)
-Buffer *srcBuf;
-MsgLen idx;
-MsgLen cnt;
-Buffer *dstBuf;
-#endif
{
SsMsgInfo *sMinfo;
SsMsgInfo *dMinfo;
*
*/
-#ifdef ANSI
S16 SRepPartMsg
(
Buffer *srcBuf,
MsgLen cnt,
Buffer *dstBuf
)
-#else
-S16 SRepPartMsg(srcBuf, idx, cnt, dstBuf)
-Buffer *srcBuf;
-MsgLen idx;
-MsgLen cnt;
-Buffer *dstBuf;
-#endif
{
SsMsgInfo *sMinfo;
SsMsgInfo *dMinfo;
*/
-#ifdef ANSI
S16 SMovPartMsg
(
Buffer *srcBuf, /* message 1 */
MsgLen idx, /* index */
Buffer *dstBuf /* message 2 */
)
-#else
-S16 SMovPartMsg(srcBuf, idx, dstBuf)
-Buffer *srcBuf; /* message 1 */
-MsgLen idx; /* index */
-Buffer *dstBuf; /* message 2 */
-#endif
{
MsgLen dCnt;
MsgLen sCnt;
idx -= sCnt;
/* deallocate the sBuf here */
tmp = sBuf->b_cont;
- /* printf("SMovPartMsg() sBuf is completely copied sBuf->b_cont(%p)\n", sBuf->b_cont); */
+ /* printf("\nSMovPartMsg() sBuf is completely copied sBuf->b_cont(%p)\n", sBuf->b_cont); */
(Void)SPutDBuf(sMinfo->region, sMinfo->pool, sBuf);
srcBuf->b_cont = sBuf = tmp;
}
*
*/
-#ifdef ANSI
S16 SPkMsgMult
(
Data *src,
MsgLen cnt,
Buffer *mBuf
)
-#else
-S16 SPkMsgMult(src, cnt, mBuf)
-Data *src;
-MsgLen cnt;
-Buffer *mBuf;
-#endif
{
SsMsgInfo *minfo; /* Message info */
Buffer *tmp;
* File: ss_msg.c
*
*/
-#ifdef ANSI
S16 SGetReadPtr
(
- Buffer *mBuf,
- uint8_t** data,
- MsgLen *len
+Buffer *mBuf,
+uint8_t** data,
+MsgLen *len
)
-#else
-S16 SGetReadPtr (mBuf, data, len)
-Buffer *mBuf;
-uint8_t** data;
-MsgLen *len;
-#endif
{
/* Buffer *tmp; */
uint32_t line
)
#else
-#ifdef ANSI
S16 SAttachPtrToBuf
(
Region region,
MsgLen totalLen,
Buffer** mBuf
)
-#else
-S16 SAttachPtrToBuf(region, pool, ptr, totalLen, mBuf)
-Region region;
-Pool pool;
-Data *ptr;
-MsgLen totalLen;
-Buffer** mBuf;
-#endif
#endif
{
SsMsgInfo *minfo; /* Message info */
#ifndef SS_DBUF_REFLOCK_DISABLE
if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
{
- printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+ printf("\nFalied to destroy lock\n");
+#endif
}
#endif
*/
#ifdef T2K_MEM_LEAK_DBG
-PRIVATE S16 SPutZbcDBufNew
+static S16 SPutZbcDBufNew
(
Region region,
Buffer *buf,
uint32_t line
)
#else
-#ifdef ANSI
-PRIVATE S16 SPutZbcDBuf
+static S16 SPutZbcDBuf
(
Region region,
Buffer *buf
)
-#else
-PRIVATE S16 SPutZbcDBuf(region, buf)
-Region region;
-Buffer *buf;
-#endif
#endif
{
register SsDblk *dptr;
ret = SUnlock(&dptr->dBufLock) ;
if((SDestroyLock(&dptr->dBufLock)) != 0)
{
- printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+ printf("\nFalied to destroy lock\n");
+#endif
}
#endif
#ifdef SS_HISTOGRAM_SUPPORT
uint32_t line
)
#else
-#ifdef ANSI
S16 SAttachPtrToMBuf
(
Region region,
MsgLen ptrLen,
Buffer** mBuf
)
-#else
-S16 SAttachPtrToMBuf(region, pool, ptr, totalLen, ptrLen, mBuf)
-Region region;
-Pool pool;
-Data *ptr;
-MsgLen totalLen;
-MsgLen ptrLen;
-Buffer** mBuf;
-#endif
#endif
{
SsMsgInfo *minfo; /* Message info */
#ifndef SS_DBUF_REFLOCK_DISABLE
if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
{
- printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+ printf("\nFalied to destroy lock\n");
+#endif
}
#endif
minfo->len = totalLen;
minfo->endptr = newblk;
- //printf("Mbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
+ //printf("\nMbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
return ROK;
}
#endif /* INTEL_WLS */
if(tmp)
{
- // printf("SResetMBuf The write & read ptr is %p %p %p %p \n", tmp->b_wptr, tmp->b_rptr, tmp->b_datap->db_base, tmp->b_datap->db_lim );
+ // printf("\nSResetMBuf The write & read ptr is %p %p %p %p \n", tmp->b_wptr, tmp->b_rptr, tmp->b_datap->db_base, tmp->b_datap->db_lim );
// tmp->b_wptr = tmp->b_rptr = tmp->b_datap->db_base;
tmp->b_wptr = tmp->b_rptr = (tmp->b_datap->db_base + 5);
tmp->b_datap->db_ref = 1;
uint32_t line
)
#else
-#ifdef ANSI
S16 SAttachWlsPtrToMBuf
(
Region region,
MsgLen ptrLen,
Buffer** mBuf
)
-#else
-S16 SAttachWlsPtrToMBuf(region, pool, ptr, readPtr, totalLen, ptrLen, mBuf)
-Region region;
-Pool pool;
-Data *ptr;
-Data *readPtr;
-MsgLen totalLen;
-MsgLen ptrLen;
-Buffer** mBuf;
-#endif
#endif
{
SsMsgInfo *minfo; /* Message info */
#ifndef SS_DBUF_REFLOCK_DISABLE
if((SInitLock (&(dptr->dBufLock), SS_LOCK_MUTEX)) != 0)
{
- printf("Falied to destroy lock\n");
+#ifdef ERROR_PRINT
+ printf("\nFalied to destroy lock\n");
+#endif
}
#endif
minfo->len = totalLen;
minfo->endptr = newblk;
- //printf("Mbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
+ //printf("\nMbuf PTR = %x, DBlk PTR = %x, PTR = %x\n", *mBuf, newblk, ptr);
return ROK;
}
#ifdef TENB_DPDK_BUF
-extern uint32_t numeTti;
+uint32_t numeTti;
S16 SGetSBufDpdk
(
Data *ptr /* pointer to buffer */
)
{
- S16 ret;
+ S16 ret = ROK;
uint32_t flags = 0;
ntl_free(mtGetNtlHdl(), ptr);
}
-#ifdef ANSI
S16 SAttachDpdkPtrToMBuf
(
Region region,
MsgLen totalLen,
Buffer** mBuf
)
-#else
-S16 SAttachDpdkPtrToMBuf(region, pool, ptr, readPtr, msgLen, totalLen, mBuf)
-Region region;
-Pool pool;
-Data *ptr;
-Data *readPtr;
-MsgLen msgLen;
-MsgLen totalLen;
-Buffer** mBuf;
-#endif
{
SsDblk *dptr;