X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmt%2Fss_gen.c;h=d7ef85650fa5d199c9410431ff3547ff4757443b;hb=324bffe05ee2a2a3754150dea9c17dc5cb06565b;hp=83c06c07a44f15f3bf97ee3625dae49baaef8d0a;hpb=def50dc175cebc67238db5f1acd5ff322a2279bd;p=o-du%2Fl2.git diff --git a/src/mt/ss_gen.c b/src/mt/ss_gen.c index 83c06c07a..d7ef85650 100644 --- a/src/mt/ss_gen.c +++ b/src/mt/ss_gen.c @@ -110,34 +110,34 @@ /*ss014.301: SSI-4GMX related changes*/ #ifdef SS_4GMX_LCORE -VOLATILE SsOs osCp; /* common OS control point */ +volatile SsOs osCp; /* common OS control point */ #else SsOs osCp; /* common OS control point */ #endif -EXTERN Cntr cfgNumRegs; -EXTERN SsRegCfg cfgRegInfo[SS_MAX_REGS]; +Cntr cfgNumRegs; +SsRegCfg cfgRegInfo[SS_MAX_REGS]; /* ss029.103: modification: multiple procId related changes */ #ifdef SS_MULTIPLE_PROCS -/* PRIVATE functions */ -PRIVATE S16 SInsProcId ARGS((ProcId proc)); -PRIVATE S16 SRemProcId ARGS((ProcId proc)); -PRIVATE S16 SLockOsCp ARGS((Void)); -PRIVATE S16 SULockOsCp ARGS((Void)); +/* static functions */ +static S16 SInsProcId ARGS((ProcId proc)); +static S16 SRemProcId ARGS((ProcId proc)); +static S16 SLockOsCp ARGS((Void)); +static S16 SULockOsCp ARGS((Void)); #endif /* SS_MULTIPLE_PROCS */ #ifdef SSI_STATIC_MEM_LEAK_DETECTION -PRIVATE void InitializeForStaticMemLeak ARGS((void)); -PRIVATE void InitializeStaticMemAllocInfo ARGS((StaticMemAllocInfo* memAllocInfo)); +static void InitializeForStaticMemLeak ARGS((void)); +static void InitializeStaticMemAllocInfo ARGS((StaticMemAllocInfo* memAllocInfo)); uint32_t GetNextFreeIdx ARGS((StaticMemAllocInfo * memAllocInfo)); void FreeIdx ARGS((uint8_t* ptr, uint32_t idx, StaticMemAllocInfo* memAllocInfo,uint32_t size, char* file, uint32_t line)); void LogForStaticMemLeak ARGS((StaticMemAllocInfo* memAllocInfo, char* file, uint32_t line, uint32_t size, void* ptr, uint32_t idx)); -PRIVATE void PrintStaticMemAllocInfo ARGS((StaticMemAllocInfo* memAllocInfo, FILE +static void PrintStaticMemAllocInfo ARGS((StaticMemAllocInfo* memAllocInfo, FILE *opFile)); #endif /* ss001.301: additions */ @@ -169,7 +169,7 @@ Void mtSigSegvHndlr() { int i; - printf("Backtrace for thread Id (%lu) total threads = %d\n", (unsigned long) pthread_self(), osCp.numSTsks); + printf("\nBacktrace for thread Id (%lu) total threads = %d\n", (unsigned long) pthread_self(), osCp.numSTsks); ysPrntBkTrace(); for(i = 0; i < osCp.numSTsks; i++) { @@ -185,7 +185,7 @@ Void mtSigSegvHndlr() Void mtSigUsr2Hndlr() { - printf("Backtrace for thread Id (%lu) cause:SIGUSR2(%d)\n",(unsigned long) pthread_self(),SIGUSR2); + printf("\nBacktrace for thread Id (%lu) cause:SIGUSR2(%d)\n",(unsigned long) pthread_self(),SIGUSR2); pthread_mutex_lock(&dumpingLock); ysPrntBkTrace(); @@ -216,14 +216,7 @@ Void mtSigUsr2Hndlr() * File: ss_gen.c * */ -#ifdef ANSI -S16 SInit -( -void -) -#else -S16 SInit() -#endif +S16 SInit(void) { S16 ret; REG1 S16 i; @@ -743,14 +736,7 @@ cleanup0: * File: ss_gen.c * */ -#ifdef ANSI -S16 SDeInit -( -void -) -#else -S16 SDeInit() -#endif +S16 SDeInit(void) { /* ss007.301 */ uint16_t regCnt; @@ -805,15 +791,10 @@ S16 SDeInit() } /* ss001.301: additions */ #ifdef SS_LOGGER_SUPPORT -#ifdef ANSI S16 SWrtLogBuf ( Txt *buf /* buffer */ ) -#else -S16 SWrtLogBuf(buf) -Txt *buf; /* buffer */ -#endif { S16 bufSz; /* buffer synchronisation*/ @@ -866,15 +847,10 @@ Txt *buf; /* buffer */ * File: ss_gen.c * */ -#ifdef ANSI S16 SPrint ( Txt *buf /* buffer */ ) -#else -S16 SPrint(buf) -Txt *buf; /* buffer */ -#endif { /* ss001.301: additions */ @@ -903,17 +879,11 @@ Txt *buf; /* buffer */ * File: ss_gen.c * */ -#ifdef ANSI S16 SError ( Seq seq, /* sequence */ Reason reason /* reason */ ) -#else -S16 SError(seq, reason) -Seq seq; /* sequence */ -Reason reason; /* reason */ -#endif { S16 ret; DateTime dt; @@ -946,7 +916,6 @@ Reason reason; /* reason */ * File: ss_gen.c * */ -#ifdef ANSI Void SLogError ( Ent ent, /* Calling layer's entity id */ @@ -959,19 +928,6 @@ ErrCode errCode, /* layer unique error code */ ErrVal errVal, /* error value */ Txt *errDesc /* description of error */ ) -#else -Void SLogError(ent, inst, procId, file, line, - errCls, errCode, errVal, errDesc) -Ent ent; /* Calling layer's entity id */ -Inst inst; /* Calling layer's instance id */ -ProcId procId; /* Calling layer's processor id */ -Txt *file; /* file name where error occured */ -S32 line; /* line in file where error occured */ -ErrCls errCls; /* error class */ -ErrCode errCode; /* layer unique error code */ -ErrVal errVal; /* error value */ -Txt *errDesc; /* description of error */ -#endif { DateTime dt; Txt errBuf[512]; @@ -1015,14 +971,7 @@ Txt *errDesc; /* description of error */ * File: ss_gen.c * */ -#ifdef ANSI -ProcId SFndProcId -( -void -) -#else -ProcId SFndProcId() -#endif +ProcId SFndProcId(void) { return (osCp.procId); @@ -1042,15 +991,7 @@ ProcId SFndProcId() * File: ss_gen.c * */ -#ifdef ANSI -Void SSetProcId -( -ProcId procId -) -#else -Void SSetProcId(procId) -ProcId procId; -#endif +Void SSetProcId(ProcId procId) { osCp.procId = procId; @@ -1076,15 +1017,7 @@ ProcId procId; * File: ss_gen.c * */ -#ifdef ANSI -uint16_t SGetProcIdIdx -( -ProcId proc -) -#else -uint16_t SGetProcIdIdx(proc) -ProcId proc; -#endif +uint16_t SGetProcIdIdx(ProcId proc) { uint16_t i; uint16_t idx; @@ -1117,15 +1050,7 @@ ProcId proc; * File: ss_gen.c * */ -#ifdef ANSI -PRIVATE S16 SInsProcId -( -ProcId proc -) -#else -PRIVATE S16 SInsProcId(proc) -ProcId proc; -#endif +static S16 SInsProcId(ProcId proc) { uint16_t i; uint16_t idx; @@ -1167,15 +1092,7 @@ ProcId proc; * File: ss_gen.c * */ -#ifdef ANSI -PRIVATE S16 SRemProcId -( -ProcId proc -) -#else -PRIVATE S16 SRemProcId(proc) -ProcId proc; -#endif +static S16 SRemProcId(ProcId proc) { uint16_t i; uint16_t idx; @@ -1217,14 +1134,7 @@ ProcId proc; * File: ss_gen.c * */ -#ifdef ANSI -PRIVATE S16 SLockOsCp -( -Void -) -#else -PRIVATE S16 SLockOsCp(Void) -#endif +static S16 SLockOsCp(void) { S16 ret; @@ -1276,14 +1186,7 @@ PRIVATE S16 SLockOsCp(Void) * File: ss_gen.c * */ -#ifdef ANSI -PRIVATE S16 SULockOsCp -( -Void -) -#else -PRIVATE S16 SULockOsCp(Void) -#endif +static S16 SULockOsCp(Void) { /* unlock the table */ @@ -1317,17 +1220,7 @@ PRIVATE S16 SULockOsCp(Void) * File: ss_gen.c * */ -#ifdef ANSI -S16 SAddProcIdLst -( -uint16_t numPIds, -ProcId *pIdLst -) -#else -S16 SAddProcIdLst(numPIds, pIdLst) -uint16_t numPIds; -ProcId *pIdLst; -#endif +S16 SAddProcIdLst(uint16_t numPIds,ProcId *pIdLst) { uint16_t i; S16 ret; @@ -1412,17 +1305,7 @@ exceeds"); * File: ss_gen.c * */ -#ifdef ANSI -S16 SRemProcIdLst -( -uint16_t numPIds, -ProcId *pIdLst -) -#else -S16 SRemProcIdLst(numPIds, pIdLst) -uint16_t numPIds; -ProcId *pIdLst; -#endif +S16 SRemProcIdLst(uint16_t numPIds,ProcId *pIdLst) { uint16_t i; @@ -1476,17 +1359,7 @@ ProcId *pIdLst; * File: ss_gen.c * */ -#ifdef ANSI -S16 SGetProcIdLst -( -uint16_t *numPIds, -ProcId *pIdLst -) -#else -S16 SGetProcIdLst(numPIds, pIdLst) -uint16_t *numPIds; -ProcId *pIdLst; -#endif +S16 SGetProcIdLst(uint16_t *numPIds,ProcId *pIdLst) { uint16_t i; uint16_t count = 0; @@ -1535,7 +1408,6 @@ ProcId *pIdLst; * File: ss_gen.c * */ -#ifdef ANSI S16 SGetXxCb ( ProcId proc, @@ -1543,13 +1415,6 @@ Ent ent, Inst inst, Void **xxCb ) -#else -S16 SGetXxCb(proc, ent, inst, xxCb) -ProcId proc; -Ent ent; -Inst inst; -Void **xxCb; -#endif { uint16_t procIdIdx; SsIdx idx; @@ -1612,14 +1477,7 @@ Void **xxCb; * File: ss_gen.c * */ -#ifdef ANSI -S16 SFillEntIds -( -Void -) -#else S16 SFillEntIds(Void) -#endif { uint8_t entInfo[26][26] = { @@ -1804,17 +1662,7 @@ S16 SFillEntIds(Void) * * */ -#ifdef ANSI -S16 SGetEntInd -( -Ent *entId, -uint8_t *fileName -) -#else -S16 SGetEntInd(entId, fileName) -Ent *entId; -uint8_t *fileName; -#endif +S16 SGetEntInd(Ent *entId,uint8_t *fileName) { @@ -1909,18 +1757,7 @@ uint8_t *fileName; * File: mt_ss.c * */ -#ifdef ANSI -S16 SLockNew -( -SLockInfo *lockId, -uint8_t lockType - -) -#else -S16 SLockNew(lockId, lockType) -SLockInfo *lockId; -uint8_t lockType; -#endif +S16 SLockNew(SLockInfo *lockId,uint8_t lockType) { S16 retVal = ROK; @@ -1946,17 +1783,7 @@ uint8_t lockType; * File: mt_ss.c * */ -#ifdef ANSI -S16 SInitLockNew -( -SLockInfo *lockId, -uint8_t lockType -) -#else -S16 SInitLockNew(lockId, lockType) -SLockInfo *lockId; -uint8_t lockType; -#endif +S16 SInitLockNew(SLockInfo *lockId,uint8_t lockType) { S16 retVal = ROK; @@ -1982,17 +1809,7 @@ uint8_t lockType; * File: mt_ss.c * */ -#ifdef ANSI -S16 SUnlockNew -( -SLockInfo *lockId, -uint8_t lockType -) -#else -S16 SUnlockNew(lockId, lockType) -SLockInfo *lockId; -uint8_t lockType; -#endif +S16 SUnlockNew(SLockInfo *lockId,uint8_t lockType) { S16 retVal = ROK; @@ -2018,17 +1835,7 @@ uint8_t lockType; * File: mt_ss.c * */ -#ifdef ANSI -S16 SDestroyLockNew -( -SLockInfo *lockId, -uint8_t lockType -) -#else -S16 SDestroyLockNew(lockId, lockType) -SLockInfo *lockId; -uint8_t lockType; -#endif +S16 SDestroyLockNew(SLockInfo *lockId,uint8_t lockType) { S16 retVal = ROK; @@ -2093,7 +1900,7 @@ uint32_t GetNextFreeIdx(StaticMemAllocInfo * memAllocInfo) if(newNextFreeIdx == 0 || newNextFreeIdx >= MAX_MEM_ALLOCATIONS) { - printf("Something wrong in GetNextFreeIdx newNextIdx = %ld\n",newNextFreeIdx); + printf("\nSomething wrong in GetNextFreeIdx newNextIdx = %ld\n",newNextFreeIdx); } memAllocInfo->nextFreeIdx = newNextFreeIdx; @@ -2118,7 +1925,7 @@ void FreeIdx(uint8_t* ptr, uint32_t idx, StaticMemAllocInfo* memAllocInfo,uint32 CRASH_ENB #endif - printf("Freeing wrong ptr stored = %p trying to free %p freeing size (%ld)" + printf("\nFreeing wrong ptr stored = %p trying to free %p freeing size (%ld)" "allocated size(%ld) from %s:%ld\n", memAllocInfo->allocations[idx].ptr, ptr, @@ -2126,8 +1933,8 @@ CRASH_ENB memAllocInfo->allocations[idx].size, file, line); - printf("Allocation was done from %s:%ld\n",memAllocInfo->allocations[idx].file, memAllocInfo->allocations[idx].lineNo); - printf("***********************************************************\n"); + printf("\nAllocation was done from %s:%ld\n",memAllocInfo->allocations[idx].file, memAllocInfo->allocations[idx].lineNo); + printf("\n***********************************************************\n"); CRASH_ENB } @@ -2167,7 +1974,7 @@ void InitializeForStaticMemLeak() StaticMemLeakFileArr[3] == NULL) { int *p = 0; - printf("Could not open files for Static Mem Leak detection logging :( crashing...\n"); + printf("\nCould not open files for Static Mem Leak detection logging :( crashing...\n"); *p = 100; } @@ -2203,14 +2010,7 @@ void DumpStaticMemLeakFiles() * File: mt_ss.c * */ -#ifdef ANSI -S16 SReInitTmr -( -void -) -#else -S16 SReInitTmr() -#endif +S16 SReInitTmr(void) { uint8_t ret = ROK; Txt prntBuf[PRNTSZE];