U8, U16, U32 data type changes
[o-du/l2.git] / src / mt / ss_gen.c
index e7f308d..83c06c0 100644 (file)
 
 /*ss014.301: SSI-4GMX related changes*/
 #ifdef SS_4GMX_LCORE
-PUBLIC VOLATILE SsOs     osCp;           /* common OS control point */
+VOLATILE SsOs     osCp;           /* common OS control point */
 #else
-PUBLIC SsOs     osCp;           /* common OS control point */
+SsOs     osCp;           /* common OS control point */
 #endif
 
  
@@ -132,19 +132,19 @@ PRIVATE S16 SULockOsCp ARGS((Void));
 #ifdef SSI_STATIC_MEM_LEAK_DETECTION
 PRIVATE void InitializeForStaticMemLeak ARGS((void));
 PRIVATE void InitializeStaticMemAllocInfo ARGS((StaticMemAllocInfo* memAllocInfo));
-PUBLIC U32 GetNextFreeIdx ARGS((StaticMemAllocInfo * memAllocInfo));
-PUBLIC void FreeIdx ARGS((U8* ptr, U32 idx, StaticMemAllocInfo* memAllocInfo,U32 size, char*
-      file, U32 line));
-PUBLIC void LogForStaticMemLeak ARGS((StaticMemAllocInfo* memAllocInfo, char* file,
-      U32 line, U32 size, void* ptr, U32 idx));
+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
       *opFile));
 #endif
 /* ss001.301: additions */
 
-PUBLIC void DumpSSIDemandQDebugInformation()
+void DumpSSIDemandQDebugInformation()
 {
-   U32 i,j;
+   uint32_t i,j;
    RTLIN_DUMP_DEBUG("Demand Q Information\n");
    RTLIN_DUMP_DEBUG("====================\n");
    for(i = 0; i < osCp.numSTsks; i++)
@@ -165,7 +165,7 @@ PUBLIC void DumpSSIDemandQDebugInformation()
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
 pthread_mutex_t dumpingLock = PTHREAD_MUTEX_INITIALIZER;
 
-PUBLIC Void mtSigSegvHndlr()
+Void mtSigSegvHndlr()
 {
    int i;
 
@@ -183,7 +183,7 @@ PUBLIC Void mtSigSegvHndlr()
    sleep(5);
 }
 
-PUBLIC Void mtSigUsr2Hndlr()
+Void mtSigUsr2Hndlr()
 {
    printf("Backtrace for thread Id (%lu) cause:SIGUSR2(%d)\n",(unsigned long) pthread_self(),SIGUSR2);   
 
@@ -217,12 +217,12 @@ PUBLIC Void mtSigUsr2Hndlr()
 *
 */
 #ifdef ANSI
-PUBLIC S16 SInit
+S16 SInit
 (
 void
 )
 #else
-PUBLIC S16 SInit()
+S16 SInit()
 #endif
 {
    S16 ret;
@@ -239,7 +239,6 @@ PUBLIC S16 SInit()
    SsDrvrTskEntry *drvrTsk;
 #endif
 /* ss002.301 : Modications */
-   TRC1(SInit);
 
    osCp.configFilePath = "/mnt/tmp/configFile";
 
@@ -263,7 +262,7 @@ PUBLIC S16 SInit()
 #endif /* SS_MULTIPLE_PROCS */
 
 #ifdef SS_THR_REG_MAP
-   cmMemset(osCp.threadMemoryRegionMap, SS_INVALID_THREAD_REG_MAP, 
+   memset(osCp.threadMemoryRegionMap, SS_INVALID_THREAD_REG_MAP, 
             (sizeof(Region) * SS_MAX_THREAD_REGION_MAP));
    ssRegMainThread();
 #endif
@@ -646,7 +645,7 @@ PUBLIC S16 SInit()
 #ifdef SS_FBSED_TSK_REG
    /* Configure task registration based on the configuration */
    /*ss013.301 : Fixed warnings for 32/64 bit compilation*/
-   cmCfgrTskReg((U8 *)"task_info.t");
+   cmCfgrTskReg((uint8_t *)"task_info.t");
 #endif /* SS_FBSED_TSK_REG  */
 
 /*ss011.301 : RMIOS release related changes*/
@@ -745,18 +744,16 @@ cleanup0:
 *
 */
 #ifdef ANSI
-PUBLIC S16 SDeInit
+S16 SDeInit
 (
 void
 )
 #else
-PUBLIC S16 SDeInit()
+S16 SDeInit()
 #endif
 {
   /* ss007.301 */
-  U16    regCnt;
-
-   TRC1(SDeInit);
+  uint16_t    regCnt;
 
 
    ssdDeinitTmr();
@@ -809,19 +806,18 @@ PUBLIC S16 SDeInit()
 /* ss001.301: additions */
 #ifdef SS_LOGGER_SUPPORT 
 #ifdef ANSI
-PUBLIC S16 SWrtLogBuf
+S16 SWrtLogBuf
 (
 Txt *buf                        /* buffer */
 )
 #else
-PUBLIC S16 SWrtLogBuf(buf)
+S16 SWrtLogBuf(buf)
 Txt *buf;                       /* buffer */
 #endif
 {
    S16 bufSz;
-   TRC1(SWrtLogBuf);
    /* buffer synchronisation*/
-   bufSz = cmStrlen((U8 *)buf);
+   bufSz = cmStrlen((uint8_t *)buf);
    SLock(&osCp.logger.bufLock);
    if(osCp.logger.started == FALSE)
    {
@@ -836,7 +832,7 @@ Txt *buf;                       /* buffer */
    {
       SFlushBufToLog(osCp.logger.buffer);
       osCp.logger.curBufSiz = 0;
-      cmMemset((U8 *)osCp.logger.buffer, '\0', osCp.logger.maxBufSiz);
+      memset(osCp.logger.buffer, '\0', osCp.logger.maxBufSiz);
       sprintf(osCp.logger.buffer, "%s", buf);
       osCp.logger.curBufSiz += bufSz;
    }
@@ -871,16 +867,15 @@ Txt *buf;                       /* buffer */
 *
 */
 #ifdef ANSI
-PUBLIC S16 SPrint
+S16 SPrint
 (
 Txt *buf                        /* buffer */
 )
 #else
-PUBLIC S16 SPrint(buf)
+S16 SPrint(buf)
 Txt *buf;                       /* buffer */
 #endif
 {
-   TRC1(SPrint);
 
 /* ss001.301: additions */
    SDisplay(0, buf);
@@ -909,13 +904,13 @@ Txt *buf;                       /* buffer */
 *
 */
 #ifdef ANSI
-PUBLIC S16 SError
+S16 SError
 (
 Seq seq,                    /* sequence */
 Reason reason               /* reason */
 )
 #else
-PUBLIC S16 SError(seq, reason)
+S16 SError(seq, reason)
 Seq seq;                    /* sequence */
 Reason reason;              /* reason */
 #endif
@@ -924,10 +919,6 @@ Reason reason;              /* reason */
    DateTime dt;
    Txt errBuf[256];
 
-
-   TRC1(SError);
-
-
    SGetDateTime(&dt);
    sprintf(errBuf, "\n\ndate: %02d/%02d/%04d time: %02d:%02d:%02d\n",
           (int)dt.month,(int)dt.day,(int)dt.year + 1900,
@@ -956,7 +947,7 @@ Reason reason;              /* reason */
 *
 */
 #ifdef ANSI
-PUBLIC Void SLogError
+Void SLogError
 (
 Ent ent,                    /* Calling layer's entity id */
 Inst inst,                  /* Calling layer's instance id */
@@ -969,7 +960,7 @@ ErrVal errVal,              /* error value */
 Txt *errDesc                /* description of error */
 )
 #else
-PUBLIC Void SLogError(ent, inst, procId, file, line,
+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 */
@@ -986,8 +977,6 @@ Txt *errDesc;               /* description of error */
    Txt errBuf[512];
 
 
-   TRC1(SLogError);
-
 /*ss014.301: SSI-4GMX related changes*/
 #ifndef SS_4GMX_LCORE
    SGetDateTime(&dt);
@@ -1006,7 +995,7 @@ Txt *errDesc;               /* description of error */
                      errCls, errCode, errVal, errDesc);
 
 
-   RETVOID;
+   return;
 }
 
 /* ss029.103: modification: 
@@ -1027,15 +1016,14 @@ Txt *errDesc;               /* description of error */
 *
 */
 #ifdef ANSI
-PUBLIC ProcId SFndProcId
+ProcId SFndProcId
 (
 void
 )
 #else
-PUBLIC ProcId SFndProcId()
+ProcId SFndProcId()
 #endif
 {
-   TRC1(SFndProcId);
 
    return (osCp.procId);
 } /* end of SFndProcId */
@@ -1055,20 +1043,19 @@ PUBLIC ProcId SFndProcId()
 *
 */
 #ifdef ANSI
-PUBLIC Void SSetProcId
+Void SSetProcId
 (
 ProcId procId
 )
 #else
-PUBLIC Void SSetProcId(procId)
+Void SSetProcId(procId)
 ProcId procId;
 #endif
 {
-   TRC1(SSetProcId);
 
    osCp.procId = procId;
 
-   RETVOID;
+   return;
 }
 
 #endif /* SS_MULTIPLE_PROCS */
@@ -1090,19 +1077,17 @@ ProcId procId;
 *
 */
 #ifdef ANSI
-PUBLIC U16 SGetProcIdIdx
+uint16_t SGetProcIdIdx
 (
 ProcId proc
 )
 #else
-PUBLIC U16 SGetProcIdIdx(proc)
+uint16_t SGetProcIdIdx(proc)
 ProcId proc; 
 #endif
 {
-   U16 i;
-   U16 idx;
-
-   TRC1(SGetProcIdIdx);
+   uint16_t i;
+   uint16_t idx;
 
    idx = SS_HASH_IDX(proc);
 
@@ -1142,10 +1127,9 @@ PRIVATE S16 SInsProcId(proc)
 ProcId proc; 
 #endif
 {
-   U16 i;
-   U16 idx;
+   uint16_t i;
+   uint16_t idx;
 
-   TRC1(SInsProcId);
 
    idx = SS_HASH_IDX(proc);
 
@@ -1193,10 +1177,9 @@ PRIVATE S16 SRemProcId(proc)
 ProcId proc; 
 #endif
 {
-   U16 i;
-   U16 idx;
+   uint16_t i;
+   uint16_t idx;
 
-   TRC1(SRemProcId);
 
    idx = SS_HASH_IDX(proc);
 
@@ -1245,7 +1228,6 @@ PRIVATE S16 SLockOsCp(Void)
 {
    S16 ret;
 
-   TRC1(SLockOsCp);
 
    ret = SLock(&osCp.sTskTblLock);
    if (ret != ROK)
@@ -1303,7 +1285,6 @@ Void
 PRIVATE S16 SULockOsCp(Void)
 #endif
 {
-   TRC1(SULockOsCp);
 
    /* unlock the table */
    SS_RELEASE_ALL_SEMA(&osCp.tTskTblSem);
@@ -1337,21 +1318,20 @@ PRIVATE S16 SULockOsCp(Void)
 *
 */
 #ifdef ANSI
-PUBLIC S16 SAddProcIdLst
+S16 SAddProcIdLst
 (
-U16 numPIds,
+uint16_t numPIds,
 ProcId *pIdLst
 )
 #else
-PUBLIC S16 SAddProcIdLst(numPIds, pIdLst)
-U16 numPIds;
+S16 SAddProcIdLst(numPIds, pIdLst)
+uint16_t numPIds;
 ProcId *pIdLst;
 #endif
 {
-   U16 i;
+   uint16_t i;
    S16 ret;
 
-   TRC1(SAddProcIdLst);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    /* range check */
@@ -1433,20 +1413,19 @@ exceeds");
 *
 */
 #ifdef ANSI
-PUBLIC S16 SRemProcIdLst
+S16 SRemProcIdLst
 (
-U16 numPIds,
+uint16_t numPIds,
 ProcId *pIdLst
 )
 #else
-PUBLIC S16 SRemProcIdLst(numPIds, pIdLst)
-U16 numPIds;
+S16 SRemProcIdLst(numPIds, pIdLst)
+uint16_t numPIds;
 ProcId *pIdLst;
 #endif
 {
-   U16 i;
+   uint16_t i;
 
-   TRC1(SRemProcIdLst);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    /* range check */
@@ -1498,21 +1477,20 @@ ProcId *pIdLst;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SGetProcIdLst
+S16 SGetProcIdLst
 (
-U16 *numPIds,
+uint16_t *numPIds,
 ProcId *pIdLst
 )
 #else
-PUBLIC S16 SGetProcIdLst(numPIds, pIdLst)
-U16 *numPIds;
+S16 SGetProcIdLst(numPIds, pIdLst)
+uint16_t *numPIds;
 ProcId *pIdLst;
 #endif
 {
-   U16 i;
-   U16 count = 0;
+   uint16_t i;
+   uint16_t count = 0;
 
-   TRC1(SGetProcIdLst);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if ((numPIds == NULLP) || (pIdLst == NULLP))
@@ -1558,7 +1536,7 @@ ProcId *pIdLst;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SGetXxCb
+S16 SGetXxCb
 (
 ProcId proc,
 Ent ent,
@@ -1566,17 +1544,16 @@ Inst inst,
 Void **xxCb
 )
 #else
-PUBLIC S16 SGetXxCb(proc, ent, inst, xxCb)
+S16 SGetXxCb(proc, ent, inst, xxCb)
 ProcId proc;
 Ent ent;
 Inst inst;
 Void **xxCb;
 #endif
 {
-   U16 procIdIdx;
+   uint16_t procIdIdx;
    SsIdx idx;
 
-   TRC1(SGetXxCb);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if ((proc == SS_INV_PROCID) || (ent >= SS_MAX_ENT) ||  (inst >= SS_MAX_INST))
@@ -1636,16 +1613,16 @@ Void **xxCb;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SFillEntIds
+S16 SFillEntIds
 (
 Void
 )
 #else
-PUBLIC S16 SFillEntIds(Void)
+S16 SFillEntIds(Void)
 #endif
 {
 
-   U8 entInfo[26][26] = {
+   uint8_t entInfo[26][26] = {
                            /* A      B      C      D      E      F      G      H      I      J      K  *
                               L      M      N      O      P      Q      R      S      T      U      V  *
                               W      X      Y      Z */
@@ -1712,7 +1689,7 @@ PUBLIC S16 SFillEntIds(Void)
                               W      X      Y      Z */
                            {ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC,
                   /* K */   ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC, ENTNC,
-                            ENTKW, ENTNC, ENTNC, ENTNC},
+                            ENTRLC, ENTNC, ENTNC, ENTNC},
                            /* A      B      C      D      E      F      G      H      I      J      K  *
                               L      M      N      O      P      Q      R      S      T      U      V  *
                               W      X      Y      Z */
@@ -1806,8 +1783,7 @@ PUBLIC S16 SFillEntIds(Void)
                         };
 
    /*ss013.301 :Adding  TRC MACRO*/
-   TRC2(SFillEntIds)
-            memcpy((U8*)osCp.entId, (U8*)entInfo, sizeof(entInfo));
+            memcpy(osCp.entId, entInfo, sizeof(entInfo));
 
    return ROK;
 } /* SFillEntIds */
@@ -1829,33 +1805,32 @@ PUBLIC S16 SFillEntIds(Void)
 *
 */
 #ifdef ANSI
-PUBLIC S16 SGetEntInd 
+S16 SGetEntInd 
 (
 Ent      *entId,
-U8       *fileName
+uint8_t       *fileName
 )
 #else
-PUBLIC S16 SGetEntInd(entId, fileName)
+S16 SGetEntInd(entId, fileName)
 Ent      *entId;
-U8       *fileName;
+uint8_t       *fileName;
 #endif
 {
 
 
-       U8   *letter = NULLP;
+       uint8_t   *letter = NULLP;
    /* ss002.301 Additions */
        S8   *strippedName = NULLP;
-       U8   count = 0;
-       U8   tempIdx = 0;
-       U8   firstIdx = 0;
-       U8   secondIdx = 0;
+       uint8_t   count = 0;
+       uint8_t   tempIdx = 0;
+       uint8_t   firstIdx = 0;
+       uint8_t   secondIdx = 0;
 
-   TRC1(SGetEntInd);
 
    /* ss002.301 Additions */
        if ((strippedName = strrchr((const char *)fileName, '/')))
        {
-          fileName = (U8 *)strippedName + 1;
+          fileName = (uint8_t *)strippedName + 1;
        }
 
        if(fileName[0] =='l' && fileName[3] == '.')
@@ -1935,21 +1910,20 @@ U8       *fileName;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SLockNew 
+S16 SLockNew 
 (
 SLockInfo *lockId,
-U8         lockType
+uint8_t         lockType
 
 )
 #else
-PUBLIC S16 SLockNew(lockId, lockType)
+S16 SLockNew(lockId, lockType)
 SLockInfo *lockId;
-U8         lockType;
+uint8_t         lockType;
 #endif
 {
    S16    retVal = ROK;
 
-  TRC1(SLockNew);
 
   if((retVal = ssdLockNew(lockId, lockType)) != ROK) 
   {
@@ -1973,20 +1947,19 @@ U8         lockType;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SInitLockNew 
+S16 SInitLockNew 
 (
 SLockInfo *lockId,
-U8         lockType
+uint8_t         lockType
 )
 #else
-PUBLIC S16 SInitLockNew(lockId, lockType)
+S16 SInitLockNew(lockId, lockType)
 SLockInfo *lockId;
-U8         lockType;
+uint8_t         lockType;
 #endif
 {
    S16    retVal = ROK;
 
-  TRC1(SInitLockNew);
 
   if((retVal = ssdInitLockNew(lockId, lockType)) != ROK) 
   {
@@ -2010,20 +1983,19 @@ U8         lockType;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SUnlockNew 
+S16 SUnlockNew 
 (
 SLockInfo *lockId,
-U8         lockType
+uint8_t         lockType
 )
 #else
-PUBLIC S16 SUnlockNew(lockId, lockType)
+S16 SUnlockNew(lockId, lockType)
 SLockInfo *lockId;
-U8         lockType;
+uint8_t         lockType;
 #endif
 {
    S16    retVal = ROK;
 
-  TRC1(SUnlockNew);
 
   if((retVal = ssdUnlockNew(lockId, lockType)) != ROK) 
   {
@@ -2047,20 +2019,19 @@ U8         lockType;
 *
 */
 #ifdef ANSI
-PUBLIC S16 SDestroyLockNew 
+S16 SDestroyLockNew 
 (
 SLockInfo *lockId,
-U8         lockType
+uint8_t         lockType
 )
 #else
-PUBLIC S16 SDestroyLockNew(lockId, lockType)
+S16 SDestroyLockNew(lockId, lockType)
 SLockInfo *lockId;
-U8         lockType;
+uint8_t         lockType;
 #endif
 {
    S16    retVal = ROK;
 
-  TRC1(SDestroyLockNew);
 
   if((retVal = ssdDestroyLockNew(lockId, lockType)) != ROK) 
   {
@@ -2073,8 +2044,8 @@ U8         lockType;
 
 #ifdef SSI_STATIC_MEM_LEAK_DETECTION
 /* Static memory leak detection changes */
-static U32 StaticMemLeakAge;
-static U32 StaticMemLeakIntCount = 1;
+static uint32_t StaticMemLeakAge;
+static uint32_t StaticMemLeakIntCount = 1;
 
 void PrintStaticMemAllocInfo(StaticMemAllocInfo* memAllocInfo, FILE *opFile)
 {
@@ -2100,7 +2071,7 @@ void PrintStaticMemAllocInfo(StaticMemAllocInfo* memAllocInfo, FILE *opFile)
 
 void InitializeStaticMemAllocInfo(StaticMemAllocInfo* memAllocInfo)
 {
-   U32 i;
+   uint32_t i;
    /* index 0 is not used; nextIdx as 0 means end of list */
    memAllocInfo->nextFreeIdx = 1;
 
@@ -2114,11 +2085,11 @@ void InitializeStaticMemAllocInfo(StaticMemAllocInfo* memAllocInfo)
    memAllocInfo->allocations[MAX_MEM_ALLOCATIONS - 1].listInfo.nextIdx = 0;
 }
 
-U32 GetNextFreeIdx(StaticMemAllocInfo * memAllocInfo)
+uint32_t GetNextFreeIdx(StaticMemAllocInfo * memAllocInfo)
 {
-   U32 toBeReturned = memAllocInfo->nextFreeIdx;
+   uint32_t toBeReturned = memAllocInfo->nextFreeIdx;
 
-   U32 newNextFreeIdx = memAllocInfo->allocations[memAllocInfo->nextFreeIdx].listInfo.nextIdx;
+   uint32_t newNextFreeIdx = memAllocInfo->allocations[memAllocInfo->nextFreeIdx].listInfo.nextIdx;
 
    if(newNextFreeIdx == 0 || newNextFreeIdx >= MAX_MEM_ALLOCATIONS)
    {
@@ -2131,7 +2102,7 @@ U32 GetNextFreeIdx(StaticMemAllocInfo * memAllocInfo)
 }
 
 #define CRASH_ENB {int *p = 0; *p = 100;}
-void FreeIdx(U8* ptr, U32 idx, StaticMemAllocInfo* memAllocInfo,U32 size, char* file, U32 line)
+void FreeIdx(uint8_t* ptr, uint32_t idx, StaticMemAllocInfo* memAllocInfo,uint32_t size, char* file, uint32_t line)
 {
    if(idx == 0 || idx >= MAX_MEM_ALLOCATIONS)
    {
@@ -2166,7 +2137,7 @@ CRASH_ENB
 }
 
 
-void LogForStaticMemLeak(StaticMemAllocInfo* memAllocInfo, char* file, U32 line, U32 size, void* ptr, U32 idx)
+void LogForStaticMemLeak(StaticMemAllocInfo* memAllocInfo, char* file, uint32_t line, uint32_t size, void* ptr, uint32_t idx)
 {
 
    memAllocInfo->allocations[idx].file = file;
@@ -2206,7 +2177,7 @@ void InitializeForStaticMemLeak()
    }
 }
 
-PUBLIC void DumpStaticMemLeakFiles()
+void DumpStaticMemLeakFiles()
 {
    int i;
 
@@ -2233,15 +2204,15 @@ PUBLIC void DumpStaticMemLeakFiles()
  *
  */
 #ifdef ANSI
-PUBLIC S16 SReInitTmr
+S16 SReInitTmr
 (
 void
 )
 #else
-PUBLIC S16 SReInitTmr()
+S16 SReInitTmr()
 #endif
 {
-   U8 ret = ROK;
+   uint8_t ret = ROK;
    Txt prntBuf[PRNTSZE];
 
    sprintf(prntBuf, "\n SReInitTmr(): ReStarting the Tmr\n");
@@ -2269,7 +2240,7 @@ PUBLIC S16 SReInitTmr()
  *       File: ss_gen.c
  *
  */
-PUBLIC S8* SGetConfigPath(Void)
+S8* SGetConfigPath(Void)
 {
    return osCp.configFilePath;
 }