valgrind memory leak fixes
[o-du/l2.git] / src / mt / ss_task.c
index 5255445..4c71a4e 100644 (file)
 #include "signal.h"
 #include "mt_plat_t33.h"
 #include "mt_4gmx.x"
-EXTERN S32 clusterMode;
+S32 clusterMode;
 #endif 
 
-PUBLIC pthread_t tmpRegTidMap[20];
+pthread_t tmpRegTidMap[20];
 
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
-EXTERN unsigned int tlPost(void *handle);
+unsigned int tlPost(void *handle);
 #ifdef XEON_SPECIFIC_CHANGES
-EXTERN int          WLS_WakeUp(void* h);
+int          WLS_WakeUp(void* h);
 #endif
 #endif
 
@@ -165,25 +165,17 @@ EXTERN int          WLS_WakeUp(void* h);
 *
 */
   
-#ifdef ANSI
-PUBLIC S16 SRegInit
+S16 SRegInit
 (
 Ent ent,                    /* entity */
 Inst inst,                  /* instance */
 PAIFS16 initFnct            /* initialization function */
 )
-#else
-PUBLIC S16 SRegInit(ent, inst, initFnct)
-Ent ent;                    /* entity */
-Inst inst;                  /* instance */
-PAIFS16 initFnct;           /* initialization function */
-#endif
 {
    /* ss021.103 - Addition for return value and pointer */
    S16         ret;     /* return value */
    SsTTskEntry *tTsk;
 
-   TRC1(SRegInit);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -344,8 +336,7 @@ PAIFS16 initFnct;           /* initialization function */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SRegActvTsk
+S16 SRegActvTsk
 (
 Ent ent,                       /* entity */
 Inst inst,                     /* instance */
@@ -353,14 +344,6 @@ Ttype ttype,                   /* task type */
 Prior prior,                   /* task priority */
 ActvTsk actvTsk                /* activate task function */
 )
-#else
-PUBLIC S16 SRegActvTsk(ent, inst, ttype, prior, actvTsk)
-Ent ent;                       /* entity */
-Inst inst;                     /* instance */
-Ttype ttype;                   /* task type */
-Prior prior;                   /* task priority */
-ActvTsk actvTsk;               /* activate task function */
-#endif
 {
    S16 ret;
    SSTskId sTskId;
@@ -368,7 +351,6 @@ ActvTsk actvTsk;               /* activate task function */
    /* ss021.103 - Addition for pointer */
    SsTTskEntry *tTsk;
 
-   TRC1(SRegActvTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -574,17 +556,11 @@ ActvTsk actvTsk;               /* activate task function */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SDeregInitTskTmr
+S16 SDeregInitTskTmr
 (
 Ent ent,                       /* entity */
 Inst inst                      /* instance */
 )
-#else
-PUBLIC S16 SDeregInitTskTmr(ent, inst)
-Ent ent;                       /* entity */
-Inst inst;                     /* instance */
-#endif
 {
    SsTTskEntry *tTsk;
    SsSTskEntry *sTsk;
@@ -594,7 +570,6 @@ Inst inst;                     /* instance */
    Bool        destroySTsk;
 
 
-   TRC1(SDeregInitTskTmr);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -812,8 +787,7 @@ Inst inst;                     /* instance */
 /* ss029.103: modification: procId added */ 
 #ifndef SS_MULTIPLE_PROCS
 
-#ifdef ANSI
-PUBLIC S16 SRegTTsk
+S16 SRegTTsk
 (
 Ent ent,                        /* entity */
 Inst inst,                      /* instance */
@@ -822,20 +796,9 @@ Prior prior,                    /* task priority */
 PAIFS16 initTsk,                /* initialization function */
 ActvTsk actvTsk                 /* activation function */
 )
-#else
-PUBLIC S16 SRegTTsk(ent, inst, type, prior, initTsk, actvTsk)
-Ent ent;                        /* entity */
-Inst inst;                      /* instance */
-Ttype type;                     /* task type */
-Prior prior;                    /* task priority */
-PAIFS16 initTsk;                /* initialization function */
-ActvTsk actvTsk;                /* activation function */
-#endif
-
 #else /* SS_MULTIPLE_PROCS */
 
-#ifdef ANSI
-PUBLIC S16 SRegTTsk
+S16 SRegTTsk
 (
 ProcId proc,                    /* processor */
 Ent ent,                        /* entity */
@@ -845,17 +808,6 @@ Prior prior,                    /* task priority */
 PAIFS16 initTsk,                /* initialization function */
 ActvTsk actvTsk                 /* activation function */
 )
-#else
-PUBLIC S16 SRegTTsk(proc, ent, inst, type, prior, initTsk, actvTsk)
-ProcId proc;                    /* processor */
-Ent ent;                        /* entity */
-Inst inst;                      /* instance */
-Ttype type;                     /* task type */
-Prior prior;                    /* task priority */
-PAIFS16 initTsk;                /* initialization function */
-ActvTsk actvTsk;                /* activation function */
-#endif
-
 #endif /* SS_MULTIPLE_PROCS */
 
 {
@@ -863,10 +815,9 @@ ActvTsk actvTsk;                /* activation function */
    SsTTskEntry *tTsk;
 /* ss029.103: addition: multiple procIds related changes */ 
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif
 
-   TRC1(SRegTTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -1133,47 +1084,30 @@ ActvTsk actvTsk;                /* activation function */
 *
 **/
 #ifndef SS_MULTIPLE_PROCS
-#ifdef ANSI
-PUBLIC S16 SRegCbTsk
+S16 SRegCbTsk
 (
 Ent ent,                        /* entity */
 Inst inst,                      /* instance */
 ActvTsk cbTsk                   /* Callback Function */
 )
-#else
-PUBLIC S16 SRegCbTsk(ent, inst, cbTsk)
-Ent ent;                        /* entity */
-Inst inst;                      /* instance */
-ActvTsk cbTsk;
-#endif
-
 #else /* SS_MULTIPLE_PROCS */
 
-#ifdef ANSI
-PUBLIC S16 SRegCbTsk 
+S16 SRegCbTsk 
 (
 ProcId proc,                    /* processor */
 Ent ent,                        /* entity */
 Inst inst,                       /* instance */
 ActvTsk cbTsk 
 )
-#else
-PUBLIC S16 SRegCbTsk(proc, ent, inst, cbTsk)
-ProcId proc;                    /* processor */
-Ent ent;                        /* entity */
-Inst inst;                      /* instance */
-ActvTsk cbTsk;
-#endif
 #endif /* SS_MULTIPLE_PROCS */
 {
    SsTTskEntry *tTsk;
    SsIdx idx;
        S16   ret = ROK;
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif /* SS_MULTIPLE_PROCS */
 
-   TRC1(SRegCbTsk);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (ent >= SS_MAX_ENT ||  inst >= SS_MAX_INST)
@@ -1258,33 +1192,19 @@ ActvTsk cbTsk;
 /* ss029.103: addition: procId added */ 
 #ifndef SS_MULTIPLE_PROCS
 
-#ifdef ANSI
-PUBLIC S16 SDeregTTsk
+S16 SDeregTTsk
 (
 Ent ent,                        /* entity */
 Inst inst                       /* instance */
 )
-#else
-PUBLIC S16 SDeregTTsk(ent, inst)
-Ent ent;                        /* entity */
-Inst inst;                      /* instance */
-#endif
-
 #else /* SS_MULTIPLE_PROCS */
 
-#ifdef ANSI
-PUBLIC S16 SDeregTTsk
+S16 SDeregTTsk
 (
 ProcId proc,                    /* processor */
 Ent ent,                        /* entity */
 Inst inst                       /* instance */
 )
-#else
-PUBLIC S16 SDeregTTsk(proc, ent, inst)
-ProcId proc;                    /* processor */
-Ent ent;                        /* entity */
-Inst inst;                      /* instance */
-#endif
 #endif /* SS_MULTIPLE_PROCS */
 {
    S16          ret;
@@ -1294,13 +1214,12 @@ Inst inst;                      /* instance */
    SsTmrEntry  *tmr;
 /* ss029.103: addition: multiple procIds related changes */ 
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif /* SS_MULTIPLE_PROCS */
  /* ss002.301 Additions */
    Buffer *mBuf;
    SsMsgInfo *mInfo;
 
-   TRC1(SDeregTTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -1554,23 +1473,16 @@ Inst inst;                      /* instance */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SCreateSTsk
+S16 SCreateSTsk
 (
 SSTskPrior tskPrior,            /* task priority */
 SSTskId *tskId                  /* filled in with system task ID */
 )
-#else
-PUBLIC S16 SCreateSTsk(tskPrior, tskId)
-SSTskPrior tskPrior;            /* task priority */
-SSTskId *tskId;                 /* filled in with system task ID */
-#endif
 {
-   S16 ret;
-   SsSTskEntry *sTsk;
+   S16 ret = ROK;
+   SsSTskEntry *sTsk = NULLP;
 
 
-   TRC1(SCreateSTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -1810,35 +1722,25 @@ SSTskId *tskId;                 /* filled in with system task ID */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SRegLogCfg
+S16 SRegLogCfg
 (
-U8 mode,
+uint8_t mode,
 S8 *path,
-U32 size,
+uint32_t size,
 S8 *IPA,
-U16 port
+uint16_t port
 )
-#else
-PUBLIC S16 SRegLogCfg(mode, path, size, IPA, port)
-U8 mode;
-S8 *path;
-U32 size;
-S8 *IPA;
-U16 port
-#endif
 {
 
 #ifdef WIN32
    WSADATA wsaData;
-       U32 iRes;
+       uint32_t iRes;
 #endif
 
    /*ss013.301: Fixed Warnings for 32/64 bit compilation*/ 
    struct sockaddr_in localAddr={0};
    struct sockaddr_in remoteAddr ={0};
 
-   TRC1(SRegLogCfg);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
 #endif
@@ -1944,7 +1846,7 @@ U16 port
 
        }
 
-   cmMemset((U8*)osCp.logger.buffer, '\0', sizeof(osCp.logger.buffer));
+   memset(osCp.logger.buffer, '\0', sizeof(osCp.logger.buffer));
    
    osCp.logger.maxBufSiz = SS_MAX_LOGBUF_SIZE;
    osCp.logger.curBufSiz = 0;
@@ -1974,18 +1876,10 @@ U16 port
 *       File:  ss_task.c
 *
 --*/
-#ifdef ANSI
-PUBLIC S16 SFlushBufToLog 
-(
-S8 *logBuf
-)
-#else
-PUBLIC S16 SFlushBufToLog(logBuf)
-S8 *logBuf
-#endif
+S16 SFlushBufToLog (S8 *logBuf)
 {
    S8 *buffer;
-   PRIVATE U16 logFileCnt = 0;
+   static uint16_t logFileCnt = 0;
    S8 newFileName[SS_MAX_PATH];
 #ifdef WIN32
    size_t writeNum;
@@ -1994,25 +1888,24 @@ S8 *logBuf
 #endif
    FILE* oldFileP;
    /*ss013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
-   TRC1(SFlushBufToLog)
 
    buffer = logBuf;
 
        if (osCp.logger.opt & 0x01)
        {
-      writeNum = fwrite(buffer, sizeof(U8), cmStrlen((U8 *)buffer), 
+      writeNum = fwrite(buffer, sizeof(uint8_t), cmStrlen((uint8_t *)buffer), 
                                  osCp.logger.filep);
        }
        if (osCp.logger.opt & 0x02)
        {
-      writeNum = sendto(osCp.logger.socketdes, buffer, cmStrlen((U8 *)buffer), 0, (struct sockaddr*)&osCp.logger.remoteAddr, sizeof(osCp.logger.remoteAddr));
+      writeNum = sendto(osCp.logger.socketdes, buffer, cmStrlen((uint8_t *)buffer), 0, (struct sockaddr*)&osCp.logger.remoteAddr, sizeof(osCp.logger.remoteAddr));
       /*ss013.301 : Returned after sending to socket*/
       return ROK;
        }
    osCp.logger.curNumFlush++;
    if(osCp.logger.curNumFlush == osCp.logger.maxNumFlush)
    {
-      cmMemset((U8 *)newFileName,'\0',sizeof(newFileName));
+      memset(newFileName,'\0',sizeof(newFileName));
       /*Store the current File*/
       oldFileP = osCp.logger.filep;
       /*Open a new file and use it as a new log file*/
@@ -2046,17 +1939,9 @@ S8 *logBuf
 *       File:  ss_task.c
 *
 --*/
-#ifdef ANSI
-PUBLIC S16 SCleanUp
-(
-Void
-)
-#else
-PUBLIC S16 SCleanUp()
-#endif
+S16 SCleanUp(Void)
 {
 
-   TRC1(SCleanUp);
    /*Flush the remaining data in the log file*/
    SLock(&osCp.logger.bufLock);
    if(osCp.logger.started == FALSE)
@@ -2108,17 +1993,10 @@ PUBLIC S16 SCleanUp()
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SDeregLogCfg
-(
-)
-#else
-PUBLIC S16 SDeregLogCfg()
-#endif
+S16 SDeregLogCfg()
 {
 
 
-   TRC1(SDeregLogCfg);
  
    SCleanUp();   
 
@@ -2139,14 +2017,7 @@ PUBLIC S16 SDeregLogCfg()
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC Void SStartLogger
-(
-void
-)
-#else
-PUBLIC Void SStartLogger()
-#endif
+Void SStartLogger(void)
 {
        if (osCp.logger.configured == TRUE)
        {
@@ -2168,14 +2039,7 @@ PUBLIC Void SStartLogger()
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC Void SStopLogger
-(
-void
-)
-#else
-PUBLIC Void SStopLogger()
-#endif
+Void SStopLogger(void)
 {
    osCp.logger.started = FALSE;
 }
@@ -2201,20 +2065,14 @@ PUBLIC Void SStopLogger()
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SRegCpuInfo 
+S16 SRegCpuInfo 
 (
 SCpuInfo *cpuInfo    /* Information about the cores/threads per core */
 )
-#else
-PUBLIC S16 SRegCpuInfo (cpuInfo)
-SCpuInfo *cpuInfo;  /* Information about the cores/threads per core */
-#endif
 {
-   U32 coreCount = 0;
+   uint32_t coreCount = 0;
 
    /*ss013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
-   TRC1(SRegCpuInfo)
    /* check the number of cores */
    if ( cpuInfo->numCores > SS_MAX_CORES || 
         cpuInfo->threadsPerCore > SS_MAX_THREADS_PER_CORE || 
@@ -2231,7 +2089,7 @@ SCpuInfo *cpuInfo;  /* Information about the cores/threads per core */
    /* if the cpu register is supplied then use it */
    for (; coreCount < cpuInfo->numCores; coreCount++)
    {
-      U32 thrCnt = 0;
+      uint32_t thrCnt = 0;
       for (;thrCnt < SS_MAX_THREADS_PER_CORE;thrCnt++)
       {
          osCp.mCInfo.coreInfo[coreCount].tskPerCoreLst[thrCnt] = -1;
@@ -2265,22 +2123,15 @@ SCpuInfo *cpuInfo;  /* Information about the cores/threads per core */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SGetAffinity
+S16 SGetAffinity
 (
 SSTskId *tskId,                  /* filled in with system task ID */
-U32 *coreId                      /* the core/processor id to which the affinity is set */
+uint32_t *coreId                      /* the core/processor id to which the affinity is set */
 )
-#else
-PUBLIC S16 SGetAffinity(tskId, coreId)
-SSTskId *tskId;                 /* filled in with system task ID */
-U32 *coreId;                    /* the core/processor id to which the affinity is set */
-#endif
 {
    S16 ret;
 
     /*ss013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
-    TRC1(SGetAffinity)
     /* implementation specific */
     ret = ssdGetAffinity(tskId, coreId);
 
@@ -2310,26 +2161,17 @@ U32 *coreId;                    /* the core/processor id to which the affinity i
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SSetAffinity
+S16 SSetAffinity
 (
 SSTskId *tskId,                  /* filled in with system task ID */
 SsAffinityMode mode,             /* the mode according to which the affinty is set */
-U32 coreId,                      /* the core/processor id to which the affinity has to be set */
+uint32_t coreId,                      /* the core/processor id to which the affinity has to be set */
 SSTskId *tskAssociatedTskId      /* filled in with system task ID of the associated layer */
 )
-#else
-PUBLIC S16 SSetAffinity(tskId, mode, coreId, tskAssociatedTskId)
-SSTskId *tskId;                 /* filled in with system task ID */
-SsAffinityMode mode;            /* the mode according to which the affinty is set */
-U32 coreId;                     /* the core/processor id to which the affinity has to be set */
-SSTskId *tskAssociatedTskId;    /* filled in with system task ID of the associated layer */
-#endif
 {
    S16 ret;
   
    /*ss013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
-   TRC1(SSetAffinity)
    /* validate the mode */
    if (mode < SS_AFFINITY_MODE_DEFAULT || 
        mode > SS_AFFINITY_MODE_EXCL)
@@ -2351,7 +2193,7 @@ SSTskId *tskAssociatedTskId;    /* filled in with system task ID of the associat
    {
        case SS_AFFINITY_MODE_DEFAULT:
        {
-           U32 coreCounter = 0, coreIndex = 0;
+           uint32_t coreCounter = 0, coreIndex = 0;
            S8 repeatFlag = 1;
            SEARCH_FOR_CORE:
               /*ss013.301: Fixed Warnings for 32/64 bit compilation*/ 
@@ -2452,7 +2294,7 @@ SSTskId *tskAssociatedTskId;    /* filled in with system task ID of the associat
           case SS_AFFINITY_MODE_ASSOC:
           {
               /* search for the associated tsk id in osCp */
-              U32 coreIndex = 0, threadIndex = 0;
+              uint32_t coreIndex = 0, threadIndex = 0;
               Bool tskNotFound = TRUE;
               for (;tskNotFound && coreIndex < SS_MAX_CORES; coreIndex++)
               {
@@ -2549,8 +2391,8 @@ SSTskId *tskAssociatedTskId;    /* filled in with system task ID of the associat
              } /* end if */
              else if (coreId == SS_DEFAULT_CORE)
              {
-                 U32 coreCounter = 0;
-                 U32 coreIndex = 0;
+                 uint32_t coreCounter = 0;
+                 uint32_t coreIndex = 0;
                  /*ss013.301: Fixed Warnings for 32/64 bit compilation*/ 
                  for (coreIndex = osCp.mCInfo.currentCore;  
                       coreCounter < osCp.mCInfo.cpuInfo.numCores; 
@@ -2648,15 +2490,10 @@ SSTskId *tskAssociatedTskId;    /* filled in with system task ID of the associat
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SDestroySTsk
+S16 SDestroySTsk
 (
 SSTskId tskId                   /* system task to be destroyed */
 )
-#else
-PUBLIC S16 SDestroySTsk(tskId)
-SSTskId tskId;                  /* system task to be destroyed */
-#endif
 {
    S16 ret;
    /* ss029.103: modification: the subscript should be of same type */
@@ -2666,11 +2503,10 @@ SSTskId tskId;                  /* system task to be destroyed */
        /* ss002.301 Additions */
 /*ss013.301 : changes related to SS_AFFINITY_SUPPORT*/
 #if defined(SS_MULTICORE_SUPPORT) || defined(SS_AFFINITY_SUPPORT)
-   U32 tskInd = 0;
+   uint32_t tskInd = 0;
 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT*/
 
 
-   TRC1(SDestroySTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -2888,10 +2724,10 @@ SSTskId tskId;                  /* system task to be destroyed */
       if (osCp.sTskTbl[tskInd].tskId == sTsk->tskId)
       {
           /* search for the tskId in coreInfo */
-          U32 coreId = 0;
+          uint32_t coreId = 0;
           for (coreId = 0; coreId < SS_MAX_CORES; coreId++)
           {
-             U32 thrId = 0;
+             uint32_t thrId = 0;
              for (thrId = 0; thrId < SS_MAX_THREADS_PER_CORE; thrId++)
              {
                 if (sTsk->tskId == osCp.mCInfo.coreInfo[coreId].tskPerCoreLst[thrId])
@@ -2962,40 +2798,23 @@ SSTskId tskId;                  /* system task to be destroyed */
 /* ss029.103: addition: procId added */ 
 #ifndef SS_MULTIPLE_PROCS
 
-#ifdef ANSI
-PUBLIC S16 SAttachTTsk
+S16 SAttachTTsk
 (
 Ent ent,                        /* entity ID of the task */
 Inst inst,                      /* instance ID of the task */
 SSTskId sTskId                  /* system task to use */
 )
-#else
-PUBLIC S16 SAttachTTsk(ent, inst, sTskId)
-Ent ent;                        /* entity ID of the task */
-Inst inst;                      /* instance ID of the task */
-SSTskId sTskId;                 /* system task to use */
-#endif
 
 #else /* SS_MULTIPLE_PROCS */
 
-#ifdef ANSI
-PUBLIC S16 SAttachTTsk
+S16 SAttachTTsk
 (
 ProcId proc,                    /* processor ID of the task */
 Ent ent,                        /* entity ID of the task */
 Inst inst,                      /* instance ID of the task */
 SSTskId sTskId                  /* system task to use */
 )
-#else
-PUBLIC S16 SAttachTTsk(proc, ent, inst, sTskId)
-ProcId proc;                    /* processor ID of the task */
-Ent ent;                        /* entity ID of the task */
-Inst inst;                      /* instance ID of the task */
-SSTskId sTskId;                 /* system task to use */
-#endif
-
 #endif /* SS_MULTIPLE_PROCS */
-
 {
    S16 ret;
    S16 i;
@@ -3003,7 +2822,7 @@ SSTskId sTskId;                 /* system task to use */
    SsSTskEntry *sTsk;
 /* ss029.103: addition: multiple procIds related changes */ 
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif /* SS_MULTIPLE_PROCS */
 #ifdef SS_MULTICORE_SUPPORT
    SsTTskEntry *tTsk;
@@ -3013,7 +2832,6 @@ SSTskId sTskId;                 /* system task to use */
 #endif
 
 
-   TRC1(SAttachTTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -3426,33 +3244,20 @@ SSTskId sTskId;                 /* system task to use */
 /* ss029.103: addition: procId added */ 
 #ifndef SS_MULTIPLE_PROCS
 
-#ifdef ANSI
-PUBLIC S16 SDetachTTsk
+S16 SDetachTTsk
 (
 Ent ent,                        /* entity ID of the task */
 Inst inst                       /* instance ID of the task */
 )
-#else
-PUBLIC S16 SDetachTTsk(ent, inst)
-Ent ent;                        /* entity ID of the task */
-Inst inst;                      /* instance ID of the task */
-#endif
 
 #else /* SS_MULTIPLE_PROCS */
 
-#ifdef ANSI
-PUBLIC S16 SDetachTTsk
+S16 SDetachTTsk
 (
 ProcId proc,                    /* processor ID of the task */
 Ent ent,                        /* entity ID of the task */
 Inst inst                       /* instance ID of the task */
 )
-#else
-PUBLIC S16 SDetachTTsk(proc, ent, inst)
-ProcId proc;                    /* processor ID of the task */
-Ent ent;                        /* entity ID of the task */
-Inst inst;                      /* instance ID of the task */
-#endif
 
 #endif /* SS_MULTIPLE_PROCS */
 
@@ -3464,10 +3269,9 @@ Inst inst;                      /* instance ID of the task */
    SsSTskEntry *sTsk;
 /* ss029.103: addition: multiple procIds related changes */ 
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif /* SS_MULTIPLE_PROCS */
 
-   TRC1(SDetachTTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -3761,17 +3565,11 @@ Inst inst;                      /* instance ID of the task */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SPstTsk
+S16 SPstTsk
 (
 Pst *pst,                       /* post information */
 Buffer *mBuf                    /* message to post */
 )
-#else
-PUBLIC S16 SPstTsk(pst, mBuf)
-Pst *pst;                       /* post information */
-Buffer *mBuf;                   /* message to post */
-#endif
 {
    S16 r;
    S16 i;
@@ -3794,8 +3592,8 @@ Buffer *mBuf;                   /* message to post */
 #endif
 /* ss029.103: addition: multiple procIds related changes */ 
 #ifdef SS_MULTIPLE_PROCS
-   U16 srcProcIdIdx;
-   U16 dstProcIdIdx;
+   uint16_t srcProcIdIdx;
+   uint16_t dstProcIdIdx;
 #endif /* SS_MULTIPLE_PROCS */
 /*ss004.301: Cavium changes */
 #ifdef SS_SEUM_CAVIUM
@@ -3808,10 +3606,9 @@ Buffer *mBuf;                   /* message to post */
    Pst  tempPst;
 
 #ifdef MSPD_MLOG_NEW
-   U32 t = MacGetTick();
+   uint32_t t = MacGetTick();
 #endif
  
-   TRC1(SPstTsk);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -3898,7 +3695,7 @@ Buffer *mBuf;                   /* message to post */
       /* copy the Pst structure into a local duplicate */
       for (i = 0;  i < (S16)sizeof(Pst);  i++)
       {
-         *(((U8 *)(&nPst)) + i) = *(((U8 *) pst) + i);
+         *(((uint8_t *)(&nPst)) + i) = *(((uint8_t *) pst) + i);
       }
       pst = &nPst;
 #ifdef SS_DRVR_SUPPORT
@@ -4064,7 +3861,7 @@ Buffer *mBuf;                   /* message to post */
             {
                for (j = 0;  j < (S16)sizeof(Pst);  j++)
                {
-                  *(((U8 *)(&nPst)) + j) = *(((U8 *) pst) + j);
+                  *(((uint8_t *)(&nPst)) + j) = *(((uint8_t *) pst) + j);
                }
                pst = &nPst;
                nPstUsed = TRUE;
@@ -4169,7 +3966,7 @@ Buffer *mBuf;                   /* message to post */
     */
    tTsk = &osCp.tTskTbl[dstIdx];
 
-       cmMemcpy((U8*)&tempPst, (U8*)pst, sizeof(Pst));
+   memcpy(&tempPst, pst, sizeof(Pst));
    if(tTsk->cbTsk != NULLP)
    {
       retValue = tTsk->cbTsk(&tempPst,mBuf);
@@ -4202,7 +3999,7 @@ Buffer *mBuf;                   /* message to post */
    /* plug the Pst structure into the message information portion */
    msgInfo = (SsMsgInfo *) (mBuf->b_rptr);
    for (i = 0;  i < (S16 )sizeof(Pst);  i++)
-      *(((U8 *)(&msgInfo->pst)) + i) = *(((U8 *) &(tempPst)) + i);
+      *(((uint8_t *)(&msgInfo->pst)) + i) = *(((uint8_t *) &(tempPst)) + i);
 
 /* ss004.301 : Cavium cahnges */
 #ifdef SS_SEUM_CAVIUM
@@ -4298,7 +4095,7 @@ Buffer *mBuf;                   /* message to post */
                            ((prior * SS_MAX_MSG_PRI) + tempPst.prior));
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
    {
-      extern Bool g_usettitmr;
+      Bool g_usettitmr;
       if (g_usettitmr)
       {
          if (tTsk->sTsk->tskPrior == PRIOR0)
@@ -4308,8 +4105,8 @@ Buffer *mBuf;                   /* message to post */
             if ((srctTsk->sTsk == tTsk->sTsk)
 #if defined(SPLIT_RLC_DL_TASK) && !defined(RLC_MAC_DAT_REQ_RBUF)
                 ||
-                ((pst->dstEnt == ENTRG) && 
-                 (pst->srcEnt == ENTKW) && 
+                ((pst->dstEnt == ENTMAC) && 
+                 (pst->srcEnt == ENTRLC) && 
                  (pst->event == EVTRGUDDATREQ))
 #endif
                )
@@ -4410,20 +4207,14 @@ Buffer *mBuf;                   /* message to post */
 */
 /* ss029.103: modification: procId added */
 
-#ifdef ANSI
-PUBLIC S16 SGetTapaTskEntIds
+S16 SGetTapaTskEntIds
 (
 Ent *ent                        /* entity */
 )
-#else
-PUBLIC S16 SGetTapaTskEntIds(ent)
-Ent *ent;                        /* entity */
-#endif
 {
 
-   U32 tskCnt = 0;
+   uint32_t tskCnt = 0;
 
-   TRC1(SGetTapaTskEntIds);
    /* Get the tapa task entity Ids from the osCp structure */
    for(tskCnt = 0; tskCnt < osCp.numTTsks; tskCnt++)
    {
@@ -4451,21 +4242,15 @@ Ent *ent;                        /* entity */
 */
 /* ss029.103: modification: procId added */
 
-#ifdef ANSI
-PUBLIC S16 SRegForHstGrm
+S16 SRegForHstGrm
 (
 Ent ent                        /* entity */
 )
-#else
-PUBLIC S16 SRegForHstGrm(ent)
-Ent ent;                        /* entity */
-#endif
 {
 
-   U32 tskCnt = 0;
+   uint32_t tskCnt = 0;
    S16 r = 0;
 
-   TRC1(SRegForHstGrm);
 
    SS_ACQUIRE_SEMA(&osCp.tTskTblSem, r);
    if (r != ROK)
@@ -4514,24 +4299,17 @@ Ent ent;                        /* entity */
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SGetHstGrmInfo
+S16 SGetHstGrmInfo
 (
 Ent   *entId,
 Bool  *hstReg                        /* entity */
 )
-#else
-PUBLIC S16 SGetHstGrmInfo(entId, hstReg)
-Ent   *entId;
-Bool  *hstReg;                        /* entity */
-#endif
 {
 
-   U32 tskCnt = 0;
+   uint32_t tskCnt = 0;
    Bool found = FALSE;
    *hstReg = 0;
 
-   TRC1(SGetHstGrmInfo);
    for(tskCnt = 0; tskCnt < osCp.numTTsks; tskCnt++)
    {
       if( *entId == osCp.tTskTbl[tskCnt].ent)
@@ -4554,44 +4332,25 @@ Bool  *hstReg;                        /* entity */
 #endif /* SS_HISTOGRAM_SUPPORT */
 
 #ifdef SS_WATCHDOG
-#ifdef ANSI
-PUBLIC S16 SInitWatchdog
-(
-U16 port
-)
-#else
-PUBLIC S16 SInitWatchdog(port)
-U16 port;
-#endif
+S16 SInitWatchdog(uint16_t port)
 {
  return ssdInitWatchDog(port);
 }
 
-#ifdef ANSI
-PUBLIC S16 SRegCfgWd
+S16 SRegCfgWd
 (
-U32 numNodes,
-U8  *addr[],
-U16 port[],
-U32 timeout,
+uint32_t numNodes,
+uint8_t  *addr[],
+uint16_t port[],
+uint32_t timeout,
 WdUserCallback callback,
 void *data
 )
-#else
-PUBLIC S16 SRegCfgWd(numNodes, addr, port, timeout, callback, data)
-U32 numNodes;
-U8  *addr[];
-U16 port[];
-U32 timeout;
-WdUserCallback callback;
-void *data;
-#endif
 {
    Txt prntBuf[PRNTSZE];
    int i = 0;
 
    /*ss013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
-   TRC1(SRegCfgWd)
 
    osCp.wdCp.globWd.timeout = timeout;
    osCp.wdCp.globWd.callback = callback;
@@ -4624,21 +4383,12 @@ void *data;
    return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 SDeregCfgWd
-(
-void
-)
-#else
-PUBLIC S16 SDeregCfgWd(void)
-void;
-#endif
+S16 SDeregCfgWd(void)
 {
    Txt prntBuf[PRNTSZE];
    int i = 0;
 
    /*ss013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
-   TRC1(SDeregCfgWd)
 
    osCp.wdCp.globWd.timeout = 0;
    osCp.wdCp.globWd.callback = 0;
@@ -4663,17 +4413,11 @@ void;
    return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 SStartHrtBt
+S16 SStartHrtBt
 (
-U8 timeInterval /* time interval */
+uint8_t timeInterval /* time interval */
 )
-#else
-PUBLIC S16 SStartHrtBt(timeInterval)
-U8 timeInterval;
-#endif
 {
-   TRC1(SStartHrtBt);
 
    ssdStartWatchDgTmr(NULLP, SS_TMR_HRTBT, timeInterval);
    ssdSndHrtBtMsg(TRUE, SS_WD_HB_REQ);
@@ -4681,34 +4425,19 @@ U8 timeInterval;
    return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 SStopHrtBt
-(
-void
-)
-#else
-PUBLIC S16 SStopHrtBt()
-void
-#endif
+S16 SStopHrtBt(void)
 {
-   TRC1(SStopHrtBt);
 
    osCp.wdCp.globWd.watchdogStop = 1;
 
    return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 watchDgActvTsk
+S16 watchDgActvTsk
 (
 Pst *pst,                   /* post */
 Buffer *mBuf                /* message buffer */
 )
-#else
-PUBLIC S16 watchDgActvTsk(pst, mBuf)
-Pst *pst;                   /* post */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 /* ss002.301 Fixed warnings */
 #ifdef DEBUGP
@@ -4716,7 +4445,6 @@ Buffer *mBuf;               /* message buffer */
    Txt prntBuf[PRNTSZE];
 #endif /* DEBUGP */
 
-   TRC3(watchDgActvTsk)
 #ifdef DEBUGP
    SGetDateTime(&dt);
    sprintf(prntBuf,"watchDgActvTsk: Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec
@@ -4726,23 +4454,17 @@ Buffer *mBuf;               /* message buffer */
        return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 watchDgRcvrActvTsk
+S16 watchDgRcvrActvTsk
 (
 Pst *pst,                   /* post */
 Buffer *mBuf                /* message buffer */
 )
-#else
-PUBLIC S16 watchDgRcvrActvTsk(pst, mBuf)
-Pst *pst;                   /* post */
-Buffer *mBuf;               /* message buffer */
-#endif
 {
 #ifdef DEBUGP
    DateTime dt;
 #endif /* DEBUGP */
    Txt prntBuf[PRNTSZE];
-   U16           n;
+   uint16_t           n;
    S16                   err;
    struct sockaddr_in tmpaddr;
    Txt           hbMsg[SS_WD_HB_MSG_SIZE];
@@ -4753,7 +4475,6 @@ Buffer *mBuf;               /* message buffer */
    int           socklen = sizeof(struct sockaddr);
 #endif
 
-   TRC3(watchDgActvTsk)
 
 #ifdef DEBUGP
    SGetDateTime(&dt);
@@ -4834,58 +4555,36 @@ Buffer *mBuf;               /* message buffer */
 *
 */
 #ifdef SS_MULTIPLE_PROCS
-#ifdef ANSI
-PUBLIC S16 SGetThrdProf
+S16 SGetThrdProf
 (
 SSTskId *sTskId,
 ProcId procId,
 Ent ent,                       /* entity */
 Inst inst,
 Event *curEvent,
-U32 *curEvtTime,
-U64 *totTime
+uint32_t *curEvtTime,
+uint64_t *totTime
 )
 #else
-PUBLIC S16 SGetThrdProf(sTskId, procId, ent, inst, evnt, curEvent, curEvtTime, totTime)
-SSTskId *sTskId;
-ProcId procId;
-Ent ent;                      /* entity */
-Inst inst;
-Event *curEvent;
-U32 *curEvtTime;
-U64 *totTime;
-#endif
-#else
-#ifdef ANSI
-PUBLIC S16 SGetThrdProf
+S16 SGetThrdProf
 (
 SSTskId *sTskId,
 Ent ent,                       /* entity */
 Inst inst,
 Event *curEvent,
-U32 *curEvtTime,
-U64 *totTime
+uint32_t *curEvtTime,
+uint64_t *totTime
 )
-#else
-PUBLIC S16 SGetThrdProf(sTskId, ent, inst, curEvent,curEvtTime, totTime)
-SSTskId *sTskId;
-Ent ent;                      /* entity */
-Inst inst;
-Event *curEvent;
-U32 *curEvtTime;
-U64 *totTime;
-#endif
 #endif /* SS_MULTIPLE_PROCS */
 {
   S16 ret;
    SsIdx idx;
    SsTTskEntry *tTsk;
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif
 
 
-   TRC1(SGetThrdProf);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    /* check entity and instance range */
@@ -4957,15 +4656,7 @@ U64 *totTime;
 *       File:  ss_task.c
 *
 */
-#ifdef ANSI
-PUBLIC S16 SRegTskInfo
-(
-U8 *cfgFile
-)
-#else
-PUBLIC S16 SRegTskInfo(cfgFile)
-U8 *cfgFile;
-#endif
+S16 SRegTskInfo(uint8_t *cfgFile)
 {
    return cmCfgrTskReg(cfgFile); 
 }