[Task-ID: ODUHIGH-455] Changes to support new L1 20.11
[o-du/l2.git] / src / mt / mt_ss.c
index b72c9e3..03e7a28 100644 (file)
@@ -36,9 +36,6 @@
 #define _POSIX_C_SOURCE         199309L
 #endif
 /* mt003.301 moved env files to use the __USE_UNIX98 flag in sys includes */
-#include "envopt.h"        /* environment options */
-#include "envdep.h"        /* environment dependent */
-#include "envind.h"        /* environment independent */
 
 #include <fcntl.h>
 #include <pthread.h>
 /* header include files (.h) */
 
 
-#include "gen.h"           /* general layer */
-#include "ssi.h"           /* system services */
-
-#include "cm5.h"           /* common timers */
-
+#include "common_def.h"
 #include "mt_ss.h"         /* MTSS specific */
 #include "mt_err.h"        /* MTSS error defines */
 
@@ -78,7 +71,6 @@
 /* mt003.301 Additions - Task deregistration */
 #include "ss_err.h"        /* error */
 #include "cm_mem.h"        /* common memory manager */
-#include "cm_lte.h"        /* common lte param */
 /* mt001.301 : Additions */
 #ifdef SS_THREAD_PROFILE
 #include "ss_err.h"
 #include <arpa/inet.h>
 #endif /* SS_WATCHDOG */
 
+#ifdef SS_USE_WLS_MEM
+#include <rte_common.h>
+#include <rte_debug.h>
+#include <rte_eal.h>
+#endif
+
 /* header/extern include files (.x) */
 
 #include "gen.x"           /* general layer */
 #include "sys/syscall.h"
 #endif
 
-#ifdef RGL_SPECIFIC_CHANGES
+#if defined(RGL_SPECIFIC_CHANGES) || defined(INTEL_WLS) || defined(SS_USE_WLS_MEM)
 #include <wls_lib.h>
 #include <hugetlbfs.h>
 #endif
 
 #if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
-EXTERN S16 rgBatchProc (Void);
+S16 rgBatchProc (Void);
 #endif
 #ifdef RLC_MAC_DAT_REQ_RBUF
-EXTERN S16 rgDlDatReqBatchProc ARGS(( 
+S16 rgDlDatReqBatchProc ARGS(( 
          Void));
 #endif
 #if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
-EXTERN S16 rgBatchProc ARGS((
+S16 rgBatchProc ARGS((
     Void));
 #endif  
 
@@ -183,7 +181,8 @@ EXTERN S16 rgBatchProc ARGS((
 char            my_buffer2[4096 * 4] = { 0 };
 char            my_buffer[4096] = { 0 };
 int             my_buffer_idx = 0;
-
+uint64_t        nWlsMacMemorySize = 0;
+uint64_t        nWlsPhyMemorySize = 0;
 
 
 #define sigsegv_print(x, ...)    my_buffer_idx += sprintf(&my_buffer[my_buffer_idx], x "\n", ##__VA_ARGS__)
@@ -206,14 +205,7 @@ Void cmPrcTmr ARGS((CmTqCp* tqCp, CmTqType* tq, PFV func));
 
 void            dump_external(void);
 
-#ifdef ANSI
-PRIVATE Void mtDelSigals
-(
-Void
-)
-#else
-PRIVATE Void mtDelSignals()
-#endif
+static Void mtDelSigals(Void)
 {
    struct sigaction sa;
 
@@ -227,83 +219,83 @@ PRIVATE Void mtDelSignals()
    sa.sa_handler = SIG_DFL;
    sigaction(SIGILL, &sa, NULL);
 
-   RETVOID;
+   return;
 }
 static void signal_segv(int signum, siginfo_t * info, void *ptr)
 {
-    static const char *si_codes[3] = { "", "SEGV_MAPERR", "SEGV_ACCERR" };
-    int             sz;
-    int             i;
-    ucontext_t     *ucontext = (ucontext_t *) ptr;
+   static const char *si_codes[3] = { "", "SEGV_MAPERR", "SEGV_ACCERR" };
+   int             sz;
+   int             i;
+   ucontext_t     *ucontext = (ucontext_t *) ptr;
 #ifdef XEON_SPECIFIC_CHANGES
 #else
-    int            *p32 = (int *) 0x2fff0000;
+   int            *p32 = (int *) 0x2fff0000;
 #endif
-    void           *buffer[100];
-    char          **strings;
+   void           *buffer[100];
+   char          **strings;
 
-    printf("segv ooops @ %p\n", info->si_addr);
-    my_buffer2[0] = 1;
+   printf("\nsegv ooops @ %p\n", info->si_addr);
+   my_buffer2[0] = 1;
 
-    printf("Segmentation Fault!\n");
-    printf("info.si_signo = %d\n", signum);
-    printf("info.si_errno = %d\n", info->si_errno);
-    printf("info.si_code  = %d (%s)\n", info->si_code, si_codes[info->si_code]);
-    printf("info.si_addr  = %p\n", info->si_addr);
+   printf("\nSegmentation Fault!\n");
+   printf("\ninfo.si_signo = %d\n", signum);
+   printf("\ninfo.si_errno = %d\n", info->si_errno);
+   printf("\ninfo.si_code  = %d (%s)\n", info->si_code, si_codes[info->si_code]);
+   printf("\ninfo.si_addr  = %p\n", info->si_addr);
 
-    memcpy(&my_uc_mcontext, &ucontext->uc_mcontext, sizeof(struct sigcontext));
+   memcpy(&my_uc_mcontext, &ucontext->uc_mcontext, sizeof(struct sigcontext));
 
-    i = 0;
+   i = 0;
 #ifndef RGL_SPECIFIC_CHANGES
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r0);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r1);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r2);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r3);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r4);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r5);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r6);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r7);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r8);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r9);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r10);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_fp);
-    printf("reg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_ip);
-    printf("reg[sp]       = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_sp);
-    printf("reg[lr]       = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_lr);
-    printf("reg[pc]       = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_pc);
-    printf("reg[cpsr]     = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_cpsr);
-#endif
-
-    printf("Stack trace (non-dedicated):\n");
-
-    sz = backtrace(buffer, 50);
-    strings = backtrace_symbols(buffer, sz);
-    for (i = 0; i < sz; ++i)
-        printf("%s\n", strings[i]);
-
-    printf("End of stack trace.");
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r0);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r1);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r2);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r3);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r4);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r5);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r6);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r7);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r8);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r9);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r10);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_fp);
+   printf("\nreg[%02d]       = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_ip);
+   printf("\nreg[sp]       = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_sp);
+   printf("\nreg[lr]       = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_lr);
+   printf("\nreg[pc]       = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_pc);
+   printf("\nreg[cpsr]     = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_cpsr);
+#endif
+
+   printf("\nStack trace (non-dedicated):\n");
+
+   sz = backtrace(buffer, 50);
+   strings = backtrace_symbols(buffer, sz);
+   for (i = 0; i < sz; ++i)
+      printf("%s\n", strings[i]);
+
+   printf("\nEnd of stack trace\n");
 
 #ifdef XEON_SPECIFIC_CHANGES
 #else
-    p32[0] = 1;
-#endif
-
-    /* Lets first print our debug information */
-    printf("Before dumping our Debug info\n");
-    mtStopHndlr();
-    printf("After dumping our Debug info\n");
-
-    /* Disable the signal and make the enodeb to dump. This will make
-     * eNB to generate the core with dumping the ccpu log
-     */
-    {
-       char           *abc = NULL;
-       mtDelSigals();
-       *abc = 100;
-    }
-    /* End printing debug information */
-    exit(1);
-    /*while (1);*/
+   p32[0] = 1;
+#endif
+
+   /* Lets first print our debug information */
+   printf("\nBefore dumping our Debug info\n");
+   mtStopHndlr();
+   printf("\nAfter dumping our Debug info\n");
+
+   /* Disable the signal and make the enodeb to dump. This will make
+    * eNB to generate the core with dumping the ccpu log
+    */
+   {
+      char           *abc = NULL;
+      mtDelSigals();
+      *abc = 100;
+   }
+   /* End printing debug information */
+   exit(1);
+   /*while (1);*/
 }
 #endif
 /*** TBD: IMPORTANT ***
@@ -322,90 +314,90 @@ typedef struct _SPThreadCreateArg
    void *(*start_routine) (void *); /* function from which pthread starts */   
 }SPThreadCreateArg;
 
-PUBLIC void *pthreadCreateHdlr(void*  arg);
+void *pthreadCreateHdlr(void*  arg);
 
 #ifdef SS_LOCKLESS_MEMORY
-PUBLIC Buffer *mtTskBuffer1;
-PUBLIC Buffer *mtTskBuffer2;
+Buffer *mtTskBuffer1;
+Buffer *mtTskBuffer2;
 
-EXTERN pthread_t tmpRegTidMap[20];
-EXTERN U8 stopBtInfo;
-EXTERN  S16 SGlobMemInfoShow(void);
+pthread_t tmpRegTidMap[20];
+uint8_t stopBtInfo;
+S16 SGlobMemInfoShow(void);
 #endif /* SS_LOCKLESS_MEMORY */
 
 #ifdef L2_L3_SPLIT
-EXTERN APP_CONTEXT AppContext;
-EXTERN S32 clusterMode;
+APP_CONTEXT AppContext;
+S32 clusterMode;
 #endif
 
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
-EXTERN unsigned int tlPost(void *handle);
+unsigned int tlPost(void *handle);
 #endif
 \f
 /* forward references */
 /* mt003.301 Modifications - Moved to ss_gen.x */
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
-PUBLIC Void *mtTskHdlrT2kL2 ARGS((Void*));
-PUBLIC  void mtSigSegvHndlr ARGS((void));
-PUBLIC  void mtSigUsr2Hndlr ARGS((void));
+Void *mtTskHdlrT2kL2 ARGS((Void*));
+void mtSigSegvHndlr ARGS((void));
+void mtSigUsr2Hndlr ARGS((void));
 #endif
 
-PRIVATE S16 ssdSetPthreadAttr ARGS ((S32 tskPrior, pthread_attr_t *attr));
-PRIVATE Void *mtTskHdlr ARGS((void *));
-PRIVATE S16 mtTskHdlMsg ARGS((SsSTskEntry *sTsk));
+static S16 ssdSetPthreadAttr ARGS ((S32 tskPrior, pthread_attr_t *attr));
+static Void *mtTskHdlr ARGS((void *));
+static S16 mtTskHdlMsg ARGS((SsSTskEntry *sTsk));
 
-PRIVATE Void *mtTmrHdlr ARGS((void *));
-PRIVATE Void mtTimeout ARGS((PTR tCb, S16 evnt));
+static Void *mtTmrHdlr ARGS((void *));
+static Void mtTimeout ARGS((PTR tCb, S16 evnt));
 
 /*mt010.301 Fix for core when run with -o option and when killed with SIGINT*/
-PRIVATE Void mtIntSigHndlr ARGS((int));
-PRIVATE Void mtExitClnup ARGS((void));
+static Void mtIntSigHndlr ARGS((int));
+static Void mtExitClnup ARGS((void));
 
 #ifdef CONAVL
-PRIVATE Void *mtConHdlr ARGS((void *));
+static Void *mtConHdlr ARGS((void *));
 #endif
 
 #ifndef L2_L3_SPLIT
 #ifdef SS_DRVR_SUPPORT
-PRIVATE Void *mtIsTskHdlr ARGS((void *));
+static Void *mtIsTskHdlr ARGS((void *));
 #endif
 #endif
 
 /* mt020.201 - Addition for no command line available */
 #ifndef NOCMDLINE
-PRIVATE Void mtGetOpts ARGS((void));
+static Void mtGetOpts ARGS((void));
 /* mt003.301 Additions - File Based task registration made
  * common for both MULTICORE and NON-MULTICORE
  */
-PRIVATE Bool fileBasedMemCfg = FALSE;
+static Bool fileBasedMemCfg = FALSE;
 #endif
 
 /* mt033.201 - addition of local function to print the statistics such as
-* (size vs. numAttempts) and (allocations vs. deallocations)
-*/
+ * (size vs. numAttempts) and (allocations vs. deallocations)
+ */
 #ifdef SSI_DEBUG_LEVEL1
-PRIVATE S16 SPrintRegMemStats ARGS((Region region));
+static S16 SPrintRegMemStats ARGS((Region region));
 #endif /* SSI_DEBUG_LEVEL1 */
 \f
 #ifdef SS_MULTICORE_SUPPORT
-PRIVATE SsSTskEntry* ssdAddTmrSTsk(Void);
-PRIVATE SsSTskEntry* ssdReAddTmrSTsk ARGS((U8 idx));
+static SsSTskEntry* ssdAddTmrSTsk(Void);
+static SsSTskEntry* ssdReAddTmrSTsk ARGS((uint8_t idx));
 #ifndef SS_LOCKLESS_MEMORY
 #ifndef RGL_SPECIFIC_CHANGES
-PRIVATE S16 ssdInitMemInfo ARGS((void));
+static S16 ssdInitMemInfo ARGS((void));
 #endif
 #endif
 #endif
 
 /* mt005.301: Cavium changes */
 #ifdef SS_SEUM_CAVIUM
-PRIVATE Void *workRcvTsk ARGS((void *));
+static Void *workRcvTsk ARGS((void *));
 #endif /* SS_SEUM_CAVIUM */
 
 #ifdef SS_THR_REG_MAP
-PUBLIC S32 ssCheckAndAddMemoryRegionMap ARGS((pthread_t  threadId,
-                                               Region region));
-PUBLIC S32 ssCheckAndDelMemoryRegionMap ARGS((pthread_t  threadId));
+S32 ssCheckAndAddMemoryRegionMap ARGS((pthread_t  threadId,
+        Region region));
+S32 ssCheckAndDelMemoryRegionMap ARGS((pthread_t  threadId));
 #endif /* SS_THR_REG_MAP */
 \f
 /* type declarations */
@@ -413,8 +405,8 @@ PUBLIC S32 ssCheckAndDelMemoryRegionMap ARGS((pthread_t  threadId));
 #ifdef SS_DRVR_SUPPORT
 typedef struct mtIsFlag
 {
-   U16 id;
-   U8 action;
+   uint16_t id;
+   uint8_t  action;
 
 } MtIsFlag;
 #endif
@@ -423,80 +415,122 @@ typedef struct mtIsFlag
 \f
 /* public variable declarations */
 
-PUBLIC Cntr cfgNumRegs = SS_MAX_REGS;
+Cntr cfgNumRegs = SS_MAX_REGS;
 /* Set memory configuration as false.
  * Set to true if memory configuration through file is successfull.
  */
-PUBLIC Bool memConfigured = FALSE;
+Bool memConfigured = FALSE;
 /* mt022.201 - Modification for shared memory relay region and memcal tool */
-PUBLIC SsRegCfg cfgRegInfo[SS_MAX_REGS] =
+SsRegCfg cfgRegInfo[SS_MAX_REGS] =
 {
    {
       SS_DFLT_REGION, SS_MAX_POOLS_PER_REG - 1,
       {
-         { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
-         { SS_POOL_STATIC, 0 }
+        { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+        { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+        { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+        { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+        { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+        { SS_POOL_STATIC, 0 }
       }
    }
 #ifdef INTEL_WLS
    ,
-   {
-      SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
       {
-         { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
-         { SS_POOL_STATIC, 0 }
+        SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
       }
-   }
 #endif /* INTEL_WLS */
 
 #ifdef SS_LOCKLESS_MEMORY
    ,
-   {
-      SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
       {
-         { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
-         { SS_POOL_STATIC, 0 }
-      }
-   },
-   {
-      SS_DFLT_REGION + 2, SS_MAX_POOLS_PER_REG - 1,
+        SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
+      },
       {
-         { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
-         { SS_POOL_STATIC, 0 }
-      }
-   },
-    {
-      SS_DFLT_REGION + 3, SS_MAX_POOLS_PER_REG - 1,
+        SS_DFLT_REGION + 2, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
+      },
+      {
+        SS_DFLT_REGION + 3, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
+      }, 
       {
-         { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
-         { SS_POOL_STATIC, 0 }
+        SS_DFLT_REGION + 4, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
+      },
+      {
+        SS_DFLT_REGION + 5, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
+      },
+      {
+        SS_DFLT_REGION + 6, SS_MAX_POOLS_PER_REG - 1,
+        {
+           { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+           { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+           { SS_POOL_STATIC, 0 }
+        }
       }
-   }, 
-    {
-      SS_DFLT_REGION + 4, SS_MAX_POOLS_PER_REG - 1,
+#ifndef INTEL_WLS_MEM
+   ,
       {
-         { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
-         { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
-         { SS_POOL_STATIC, 0 }
+         SS_DFLT_REGION + 7, SS_MAX_POOLS_PER_REG - 1,
+         {
+            { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+            { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+            { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+            { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+            { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+            { SS_POOL_STATIC, 0 }
+         }
       }
-   } 
+#endif
+
 #endif /* SS_LOCKLESS_MEMORY */
 };
 /* mt003.301 Modifications - File Based task registration made
@@ -504,84 +538,128 @@ PUBLIC SsRegCfg cfgRegInfo[SS_MAX_REGS] =
  */
 
 #ifdef SS_LOCKLESS_MEMORY
-PUBLIC MtDynMemCfg mtDynMemoCfg =
-{
-  SS_MAX_REGS,                                /* number of regions */
-  {
-     {
-        SS_DFLT_REGION,                         /* region id */
-        MT_MAX_BKTS,                            /* number of buckets */
-        {
-           /* block size, no. of blocks, Upper threshold, lower threshold */
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
-        }
-     },
-     {
-        SS_DFLT_REGION + 1,                         /* region id */
-        MT_MAX_BKTS,                            /* number of buckets */
-        {
-           /* block size, no. of blocks, Upper threshold, lower threshold */
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
-        }
-     },
-     {
-        SS_DFLT_REGION + 2,                         /* region id */
-        MT_MAX_BKTS,                            /* number of buckets */
-        {
-           /* block size, no. of blocks, Upper threshold, lower threshold */
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
-        }
-     },
+MtDynMemCfg mtDynMemoCfg =
+{
+   SS_MAX_REGS,                                /* number of regions */
+   {
+      {
+        SS_DFLT_REGION,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}, 
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+        }
+      },
+      {
+        SS_DFLT_REGION + 1,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
+        }
+      },
+      {
+        SS_DFLT_REGION + 2,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+        }
+      },
       {
-        SS_DFLT_REGION + 3,                         /* region id */
-        MT_MAX_BKTS,                            /* number of buckets */
-        {
-           /* block size, no. of blocks, Upper threshold, lower threshold */
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
-        }
-     },
+        SS_DFLT_REGION + 3,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
+        }
+      },
+      {
+        SS_DFLT_REGION + 4,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+        }
+      },
+      {
+        SS_DFLT_REGION + 5,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+        }
+      },
       {
-        SS_DFLT_REGION + 4,                         /* region id */
-        MT_MAX_BKTS,                            /* number of buckets */
-        {
-           /* block size, no. of blocks, Upper threshold, lower threshold */
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
-        }
-     }
+        SS_DFLT_REGION + 6,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        {
+           /* block size, no. of blocks, Upper threshold, lower threshold */
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+        }
+      }
+#ifndef INTEL_WLS_MEM
+      ,
+         {
+            SS_DFLT_REGION + 7,                         /* region id */
+            MT_MAX_BKTS,                            /* number of buckets */
+            {
+               /* block size, no. of blocks, Upper threshold, lower threshold */
+               {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+               {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+               {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+               {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+               {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+            }
+         }
+#endif
 #if ((defined (SPLIT_RLC_DL_TASK)) && (!defined (L2_L3_SPLIT)))
-     ,
-     {
-        SS_DFLT_REGION + 4,                         /* region id */
-        MT_MAX_BKTS,                            /* number of buckets */
-        {
-           /* block size, no. of blocks, Upper threshold, lower threshold */
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
-           {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
-        }
-     }
-#endif
-  }
+      ,
+        {
+           SS_DFLT_REGION + 7,                         /* region id */
+           MT_MAX_BKTS,                            /* number of buckets */
+           {
+              /* block size, no. of blocks, Upper threshold, lower threshold */
+              {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+              {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+              {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+              {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} 
+           }
+        }
+#endif
+   }
 
 };
 
-PUBLIC MtGlobMemCfg mtGlobMemoCfg =
+MtGlobMemCfg mtGlobMemoCfg =
 {
    MT_MAX_BKTS,                            /* number of buckets */
    {
@@ -590,12 +668,13 @@ PUBLIC MtGlobMemCfg mtGlobMemoCfg =
       {MT_BKT_0_DSIZE, (MT_BKT_0_NUMBLKS + MT_BKT_0_NUMBLKS), SS_DFLT_MEM_BLK_SET_SIZE},
       {MT_BKT_1_DSIZE, MT_BKT_1_NUMBLKS, SS_DFLT_MEM_BLK_SET_SIZE},
       {MT_BKT_2_DSIZE, MT_BKT_2_NUMBLKS, SS_DFLT_MEM_BLK_SET_SIZE},
-      {MT_BKT_3_DSIZE, MT_BKT_3_NUMBLKS, SS_DFLT_MEM_BLK_SET_SIZE}
+      {MT_BKT_3_DSIZE, MT_BKT_3_NUMBLKS, SS_DFLT_MEM_BLK_SET_SIZE},
+      {MT_BKT_4_DSIZE, MT_BKT_4_NUMBLKS, SS_DFLT_MEM_BLK_SET_SIZE}
 #else
       {1024, 12800 /* MT_BKT_0_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE},
-      {1664, 12800 /* MT_BKT_1_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE},
-      {4096, 3840 /* MT_BKT_2_NUMBLKS*/, SS_DFLT_MEM_BLK_SET_SIZE},
-      {MT_BKT_3_DSIZE, 12800 /* MT_BKT_3_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE}
+        {1664, 12800 /* MT_BKT_1_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE},
+        {4096, 3840 /* MT_BKT_2_NUMBLKS*/, SS_DFLT_MEM_BLK_SET_SIZE},
+        {MT_BKT_3_DSIZE, 12800 /* MT_BKT_3_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE}
 #endif
    }
 };
@@ -603,164 +682,230 @@ PUBLIC MtGlobMemCfg mtGlobMemoCfg =
 
 /* mt022.201 - Modification for memory calculator tool */
 /* mt018.201 - added memory configuration matrix */
-PUBLIC MtMemCfg mtMemoCfg =
+MtMemCfg mtMemoCfg =
 {
 #ifdef  RY_ENBS5SHM
-  SS_MAX_REGS - 1,                            /* number of regions */
+   SS_MAX_REGS - 1,                            /* number of regions */
 #else
 #ifndef XEON_SPECIFIC_CHANGES  
-  SS_MAX_REGS,                                /* number of regions */
+   SS_MAX_REGS,                                /* number of regions */
 #else
-  2,
+   2,
 #endif  
 #endif
-  {
-    {
-      SS_DFLT_REGION,                         /* region id */
-      MT_MAX_BKTS,                            /* number of buckets */
-      MT_HEAP_SIZE,                           /* heap size */
+   {
       {
+        SS_DFLT_REGION,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
 #ifndef XEON_SPECIFIC_CHANGES  
-         {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
-         {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
-         {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
-         {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}    /* block size, no. of blocks */
-#else
-#if 0
-        {256, 500000},
-         {512, 11000},
-         {2048, 100000},
-         {8192, 75128},
-        {16384, 4096}
-#else  /* Page boundary alignment */
-         {256, 491520}, /* 60 pages of 2M*/
-         {512, 12288},  /* 3 pages of 2M */
-         {2048, 99328}, /* 97 Pages of 2M */
-         {8192, 75008}, /* 293 Pages of 2M */
-         {16384, 4096}  /* 32 pages of 2M */
-#endif
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}
+#else
+           {256, 491520}, /* 60 pages of 2M*/
+              {512, 12288},  /* 3 pages of 2M */
+              {2048, 99328}, /* 97 Pages of 2M */
+              {8192, 75008}, /* 293 Pages of 2M */
+              {16384, 4096}  /* 32 pages of 2M */
 #endif        
-      }
-    },
+        }
+      },
 #ifdef INTEL_WLS
 #ifndef SS_LOCKLESS_MEMORY    
-    {
-      SS_DFLT_REGION + 1,                         /* region id */
-      MT_MAX_BKTS,                            /* number of buckets */
-      /*MT_HEAP_SIZE 7194304 */ 10485760,                           /* heap size */
       {
-        //{MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        //{MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
-        //{MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        //{MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}    /* block size, no. of blocks */
-        {128,   500000},
-        {256,   500000},
-        {2048,  200000},
-        {4096,  40960},
-        {18432, 10240}
-      }
-    },
+        SS_DFLT_REGION + 1,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        /*MT_HEAP_SIZE 7194304 */ 10485760,                           /* heap size */
+        {
+           //{MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           //{MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           //{MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           //{MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}    /* block size, no. of blocks */
+           {128,   500000},
+           {256,   500000},
+           {2048,  200000},
+           {4096,  40960},
+           {18432, 10240}
+        }
+      },
 #endif /* SS_LOCKLESS_MEMORY */
 #endif /* INTEL_WLS */
 #ifdef SS_LOCKLESS_MEMORY
-    {
-      SS_DFLT_REGION + 1,                         /* region id */
-      MT_MAX_BKTS,                            /* number of buckets */
-      MT_HEAP_SIZE,                           /* heap size */
       {
-        {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
-        {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}    /* block size, no. of blocks */
-      }
-    },
-    {
-      SS_DFLT_REGION + 2,                         /* region id */
-      MT_MAX_BKTS,                            /* number of buckets */
-      MT_HEAP_SIZE,                           /* heap size */
+        SS_DFLT_REGION + 1,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        }
+      },
       {
-        {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
-        {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}    /* block size, no. of blocks */
-      }
-    },
-     {
-      SS_DFLT_REGION + 3,                         /* region id */
-      MT_MAX_BKTS,                            /* number of buckets */
-      MT_HEAP_SIZE,                           /* heap size */
+        SS_DFLT_REGION + 2,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        }
+      },
+      {
+        SS_DFLT_REGION + 3,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        }
+      },
+      {
+        SS_DFLT_REGION + 4,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        }
+      },
+      {
+        SS_DFLT_REGION + 5,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        }
+      },
       {
-        {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
-        {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
-        {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        SS_DFLT_REGION + 6,                         /* region id */
+        MT_MAX_BKTS,                            /* number of buckets */
+        MT_HEAP_SIZE,                           /* heap size */
+        {
+           {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+           {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+           {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+        }
       }
-    }
+#ifndef INTEL_WLS_MEM
+      ,
+         {
+            SS_DFLT_REGION + 7,                         /* region id */
+            MT_MAX_BKTS,                            /* number of buckets */
+            MT_HEAP_SIZE,                           /* heap size */
+            {
+               {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS},   /* block size, no. of blocks */
+               {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS},    /* block size, no. of blocks */
+               {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS},   /* block size, no. of blocks */
+               {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS},    /* block size, no. of blocks */
+               {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}    /* block size, no. of blocks */
+            }
+         }
+#endif
 #endif /* SS_LOCKLESS_MEMORY */
-    STATIC_MEM_CFG
-  }
+      STATIC_MEM_CFG
+   }
 };
 /* mt003.301 Modifications - File Based task registration made
  * common for both MULTICORE and NON-MULTICORE
  * bucket info, as different regions may request for different no.
  * of blocks
  */
-PUBLIC MtBktCfg mtBktInfo[MT_MAX_BKTS];
-PUBLIC S16 msArgc;              /* argc */
-PUBLIC Txt **msArgv;            /* argv */
-PUBLIC S16 msOptInd;            /* SGetOpt vars */
-PUBLIC S8 *msOptArg;            /* SGetOpt vars */
+MtBktCfg mtBktInfo[MT_MAX_BKTS];
+S16 msArgc;              /* argc */
+Txt **msArgv;            /* argv */
+S16 msOptInd;            /* SGetOpt vars */
+S8 *msOptArg;            /* SGetOpt vars */
 
 
-#ifdef INTEL_WLS
+#if defined (INTEL_WLS) || defined (SS_USE_WLS_MEM)
 typedef struct _MtRegMemSz
 {
-   U32   reqdSz;
-   U8    *startAddr;
+   uint32_t   reqdSz;
+   uint8_t    *startAddr;
 }MtRegMemSz;
 
-PRIVATE MtRegMemSz mtRegMemSz[MT_MAX_BKTS+1];
+#ifdef SS_USE_WLS_MEM
+static MtRegMemSz mtDynMemSz[MT_MAX_BKTS];
+static S16 SPartitionWlsDynMem();
+static S16 SAllocateWlsDynMem();
+#endif
+#ifdef INTEL_WLS
+static MtRegMemSz mtRegMemSz[MT_MAX_BKTS+1];
+#endif
 #endif
 
 \f
 /* private variable declarations */
 /* mt018.201 - change mtCMMRegCfg as array of pointers */
-PRIVATE CmMmRegCfg *mtCMMRegCfg[SS_MAX_REGS];
-PRIVATE CmMmRegCb *mtCMMRegCb[SS_MAX_REGS];
+static CmMmRegCfg *mtCMMRegCfg[SS_MAX_REGS];
+static CmMmRegCb *mtCMMRegCb[SS_MAX_REGS];
 /* mt003.301 - Fixed compilation warnings */
 /*mt004.301-addede new veriable for FAP*/
 /*mt010.301 - removed veriable defined for FA*/
 
 
-#ifdef INTEL_WLS
+#if defined (INTEL_WLS) || defined (SS_USE_WLS_MEM)
 
 #ifdef NTL_LIB
 void mtSetNtlHdl(unsigned int hdl)
 {
-    osCp.ntl.hdl =  hdl;
+   osCp.ntl.hdl =  hdl;
 }
 
 unsigned int mtGetNtlHdl()
 {
-    return(osCp.ntl.hdl);
+   return(osCp.ntl.hdl);
 }
 
 #endif  /* NTL_LIB */
-
-void * mtGetWlsHdl()
+void mtGetWlsHdl(void **hdlr)
 {
-   RETVALUE(osCp.wls.intf);
-}
+   *hdlr = osCp.wls.intf;
+}      
 
 #ifdef XEON_MULTIPLE_CELL_CHANGES
-EXTERN S8 gWrWlsDeviceName[MAX_WLS_DEVICE_NAME_LEN];
-EXTERN S16 smWrReadWlsConfigParams (Void);
+S8 gWrWlsDeviceName[MAX_WLS_DEVICE_NAME_LEN];
+S16 smWrReadWlsConfigParams (Void);
 #endif
 
-PRIVATE int SOpenWlsIntf()
+static int SOpenWlsIntf()
 {
-   void *hdl;
-   #define WLS_DEVICE_NAME "/dev/wls"
+   uint8_t i;
+   void *hdl = NULLP;
+#define WLS_DEVICE_NAME "wls0"
+
+   char *my_argv[] = {"gnodeb", "-c3", "--proc-type=auto", "--file-prefix", WLS_DEVICE_NAME, "--iova-mode=pa"};
+   printf("\nCalling rte_eal_init: ");
+   for (i = 0; i < RTE_DIM(my_argv); i++)
+   {
+      printf("%s ", my_argv[i]); 
+   }
+   printf("\n");
+
+   if (rte_eal_init(RTE_DIM(my_argv), my_argv) < 0)
+      rte_panic("\nCannot init EAL\n");
+
 
 #ifdef XEON_SPECIFIC_CHANGES
 #ifdef XEON_MULTIPLE_CELL_CHANGES
@@ -769,18 +914,27 @@ PRIVATE int SOpenWlsIntf()
    hdl = WLS_Open(WLS_DEVICE_NAME, 1);
 #endif
 #else
-   hdl = WLS_Open(WLS_DEVICE_NAME, 0);
+#ifdef INTEL_L1_V19_10
+   hdl = WLS_Open(WLS_DEVICE_NAME, WLS_MASTER_CLIENT, WLS_MEM_SIZE);
+#elif INTEL_L1
+   hdl = WLS_Open(WLS_DEVICE_NAME, WLS_MASTER_CLIENT, &nWlsMacMemorySize, &nWlsPhyMemorySize);
+
+   if(hdl == NULL)
+   {
+      printf("\nERROR: WLS_Open > DEVICE_NAME mismatch. WLS Device Name should be same as 'wls_dev_name' parameter in 'phycfg_xran.xml' file");
+   }
+#endif
 #endif
 
    osCp.wls.intf = hdl;
 
    if(!osCp.wls.intf)
    {
-     printf("Could not open WLS Interface \n");
-     RETVALUE(0);
+      printf("\nCould not open WLS Interface \n");
+      return (0);
    }
 
-   RETVALUE(1);
+   return (1);
 }
 #endif
 
@@ -788,95 +942,81 @@ PRIVATE int SOpenWlsIntf()
 #ifndef API_MAIN
 \f
 /*
-*
-*       Fun:   main
-*
-*       Desc:  This function is the entry point for the final binary. It
-*              calls SInit() in the common code. It can be replaced by a
-*              user function if required (SInit() must still be called).
-*
-*       Ret:   none on success
-*              exit on failure
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC int main
+ *
+ *       Fun:   main
+ *
+ *       Desc:  This function is the entry point for the final binary. It
+ *              calls SInit() in the common code. It can be replaced by a
+ *              user function if required (SInit() must still be called).
+ *
+ *       Ret:   none on success
+ *              exit on failure
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   int main
 (
-int argc,                       /* argument count */
-char **argv                     /* argument vector */
-)
-#else
-PUBLIC int main(argc, argv)
-int argc;                       /* argument count */
-char **argv;                    /* argument vector */
-#endif
+ int argc,                       /* argument count */
+ char **argv                     /* argument vector */
+ )
 {
-   TRC0(main);
 
 #ifdef XEON_MULTIPLE_CELL_CHANGES
    /* Read the WLS parameters from the file and copy into global control block */
    if(smWrReadWlsConfigParams() != ROK)
    {
       fprintf(stderr, "Failed to read WLS params from file wr_cfg.txt");
-      RETVALUE(RFAILED);
+      return RFAILED;
    } /* end of if statement */
 #endif
 
-#ifdef INTEL_WLS
+#if defined (INTEL_WLS) || defined (SS_USE_WLS_MEM)
    if(!SOpenWlsIntf())
-    RETVALUE(0);
+      return (0);
 #endif /* INTEL_WLS */
 
    msArgc = argc;
    msArgv = argv;
    /* mt003.301 Modifications */
    if( ROK != SInit())
-       {
-               printf("\n SInit failed, SSI could not start \n");
-               /* pthread_exit(NULLP);*/ /* Commented to Come out of Main thread*/
+   {
+      printf("\n SInit failed, SSI could not start \n");
+      /* pthread_exit(NULLP);*/ /* Commented to Come out of Main thread*/
 
-               RETVALUE(0);
-       }
+      return (0);
+   }
    /*mt010.301  cleanup part exposed to user*/
    SFini();
-   RETVALUE(0);
+   return (0);
 }
 
 #else
 \f
 /*
-*
-*       Fun:   ssMain
-*
-*       Desc:  This function is the entry point for the final binary. It
-*              calls SInit() in the common code. It can be replaced by a
-*              user function if required (SInit() must still be called).
-*
-*       Ret:   none on success
-*              exit on failure
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC int ssMain
+ *
+ *       Fun:   ssMain
+ *
+ *       Desc:  This function is the entry point for the final binary. It
+ *              calls SInit() in the common code. It can be replaced by a
+ *              user function if required (SInit() must still be called).
+ *
+ *       Ret:   none on success
+ *              exit on failure
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   int ssMain
 (
-int argc,                       /* argument count */
-char **argv                     /* argument vector */
-)
-#else
-PUBLIC int ssMain(argc, argv)
-int argc;                       /* argument count */
-char **argv;                    /* argument vector */
-#endif
+ int argc,                       /* argument count */
+ char **argv                     /* argument vector */
+ )
 {
-   TRC0(ssMain);
 
 
    msArgc = argc;
@@ -885,36 +1025,29 @@ char **argv;                    /* argument vector */
 
    SInit();
 
-   RETVALUE(0);
+   return (0);
 }
 
 #endif
 /*
-*  initialization functions
-*/
+ *  initialization functions
+ */
 
 /*
-*
-*       Fun:   Initialize OS control point
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the OS control point.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitGen
-(
-void
-)
-#else
-PUBLIC S16 ssdInitGen()
-#endif
+ *
+ *       Fun:   Initialize OS control point
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the OS control point.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitGen(void)
 {
    struct sigaction act;
    sigset_t set;
@@ -922,16 +1055,15 @@ PUBLIC S16 ssdInitGen()
    struct sigaction sa;
 #endif
 
-   TRC0(ssdInitGen);
 
-  /*mt014.301 : 4GMX release related changes*/
+   /*mt014.301 : 4GMX release related changes*/
 #ifdef SS_4GMX_UCORE
    uarmInit();
 #endif
-/* mt005.301 : Cavium changes */
+   /* mt005.301 : Cavium changes */
 #ifdef SS_SEUM_CAVIUM
-       /* set group mask for the core */
-       cvmx_pow_set_group_mask(cvmx_get_core_num(), SS_CVMX_GRP_MASK);
+   /* set group mask for the core */
+   cvmx_pow_set_group_mask(cvmx_get_core_num(), SS_CVMX_GRP_MASK);
 #endif /* SS_SEUM_CAVIUM */
 
    osCp.dep.sysTicks = 0;
@@ -940,12 +1072,12 @@ PUBLIC S16 ssdInitGen()
 #ifndef NOCMDLINE
    /* parse command line */
    mtGetOpts();
-       /* mt003.301 Additions */
-       if(fileBasedMemCfg == TRUE && memConfigured == FALSE)
-       {
-               printf("\n File Based Memory configuration failed \n");
-               RETVALUE(RFAILED);
-       }
+   /* mt003.301 Additions */
+   if(fileBasedMemCfg == TRUE && memConfigured == FALSE)
+   {
+      printf("\n File Based Memory configuration failed \n");
+      return RFAILED;
+   }
 #endif
 
 #ifndef RGL_SPECIFIC_CHANGES /* ANOOP :: This ssdInitMemInfo() was present in 2.1 */
@@ -960,7 +1092,7 @@ PUBLIC S16 ssdInitGen()
    /* initialize the started semaphore */
    if (sem_init(&osCp.dep.ssStarted, 0, 0) != 0)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* mt028.201 added compile time flag to allow not to mask signals */
@@ -987,45 +1119,45 @@ PUBLIC S16 ssdInitGen()
    /*Initialize SIGSEGV Signal */
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
 #if 1
-    memset(&sa, 0, sizeof(struct sigaction));
-    sigemptyset(&sa.sa_mask);
-    sa.sa_sigaction = signal_segv;
-    sa.sa_flags = SA_SIGINFO;
+   memset(&sa, 0, sizeof(struct sigaction));
+   sigemptyset(&sa.sa_mask);
+   sa.sa_sigaction = signal_segv;
+   sa.sa_flags = SA_SIGINFO;
 #ifndef XEON_SPECIFIC_CHANGES
-    sigaction(SIGSEGV, &sa, NULL);
+   sigaction(SIGSEGV, &sa, NULL);
 
-    memset(&sa, 0, sizeof(struct sigaction));
-    sigemptyset(&sa.sa_mask);
-    sa.sa_sigaction = signal_segv;
-    sa.sa_flags = SA_SIGINFO;
+   memset(&sa, 0, sizeof(struct sigaction));
+   sigemptyset(&sa.sa_mask);
+   sa.sa_sigaction = signal_segv;
+   sa.sa_flags = SA_SIGINFO;
 
-    sigaction(SIGILL, &sa, NULL);
+   sigaction(SIGILL, &sa, NULL);
 #else
-    if(sigaction(SIGILL, &sa, NULL) != 0)
-    {
-       printf("Failed to process sigaction for the SIGILL\n");
-       RETVALUE(RFAILED);
-    }
-    if(sigaction(SIGSEGV, &sa, NULL) != 0)
-    {
-       printf("Failed to process sigaction for the SIGSEGV\n");
-       RETVALUE(RFAILED);
-    }
-    if(sigaction(SIGABRT, &sa, NULL) != 0)
-    {
-       printf("Failed to process sigaction for the SIGABRT\n");
-       RETVALUE(RFAILED);
-    }
-    if(sigaction(SIGTERM, &sa, NULL) != 0)
-    {
-       printf("Failed to process sigaction for the SIGTERM\n");
-       RETVALUE(RFAILED);
-    }
-    if(sigaction(SIGHUP, &sa, NULL) != 0)
-    {
-       printf("Failed to process sigaction for the SIGHUP\n");
-       RETVALUE(RFAILED);
-    }
+   if(sigaction(SIGILL, &sa, NULL) != 0)
+   {
+      printf("\nFailed to process sigaction for the SIGILL\n");
+      return RFAILED;
+   }
+   if(sigaction(SIGSEGV, &sa, NULL) != 0)
+   {
+      printf("\nFailed to process sigaction for the SIGSEGV\n");
+      return RFAILED;
+   }
+   if(sigaction(SIGABRT, &sa, NULL) != 0)
+   {
+      printf("\nFailed to process sigaction for the SIGABRT\n");
+      return RFAILED;
+   }
+   if(sigaction(SIGTERM, &sa, NULL) != 0)
+   {
+      printf("\nFailed to process sigaction for the SIGTERM\n");
+      return RFAILED;
+   }
+   if(sigaction(SIGHUP, &sa, NULL) != 0)
+   {
+      printf("\nFailed to process sigaction for the SIGHUP\n");
+      return RFAILED;
+   }
 #endif    
 #else
    signal (SIGSEGV, mtSigSegvHndlr);
@@ -1043,89 +1175,74 @@ PUBLIC S16 ssdInitGen()
    act.sa_flags = 0;
    if (sigaction(SIGINT, &act, NULLP) != 0)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
    /* mt040.201 initialise random seed */
    osCp.dep.randSeed = time(NULLP);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   De-initialize OS control point
-*
-*       Desc:  This function reverses the initialization in ssdInitGen().
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdDeinitGen
-(
-void
-)
-#else
-PUBLIC Void ssdDeinitGen()
-#endif
+ *
+ *       Fun:   De-initialize OS control point
+ *
+ *       Desc:  This function reverses the initialization in ssdInitGen().
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void ssdDeinitGen(void)
 {
-   TRC0(ssdDeinitGen);
 
 
    sem_destroy(&osCp.dep.ssStarted);
 
 
-   RETVOID;
+   return;
 }
 #ifdef SS_LOCKLESS_MEMORY
 #ifdef USE_MALLOC
 /*
-*
-*       Fun:   ssPutDynMemBlkSet
-*
-*       Desc:  Returns the set of dynamic Blocks into the global region
-*
-*
-*       Ret:   ROK     - successful, 
-*              RFAILED - unsuccessful.
-*
-*       Notes: 
-*
-*       File:  cm_mem.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssPutDynMemBlkSet
+ *
+ *       Fun:   ssPutDynMemBlkSet
+ *
+ *       Desc:  Returns the set of dynamic Blocks into the global region
+ *
+ *
+ *       Ret:   ROK     - successful, 
+ *              RFAILED - unsuccessful.
+ *
+ *       Notes: 
+ *
+ *       File:  cm_mem.c
+ *
+ */
+S16 ssPutDynMemBlkSet
 (
-U8                    bktIdx,        /* Index to bucket list */
-CmMmBlkSetElement    *dynMemSetElem  /* Memory set element which is needs to be 
-                                        added to global region */
-)
-#else
-PUBLIC S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem)
-U8                    bktIdx;        /* Index to bucket list */
-CmMmBlkSetElement    *dynMemSetElem; /* Memory set element which is needs to be 
-                                        added to global region */
-#endif
+ uint8_t                    bktIdx,        /* Index to bucket list */
+ CmMmBlkSetElement    *dynMemSetElem  /* Memory set element which is needs to be 
+                                        added to global region */
+ )
 {
    CmMmGlobRegCb        *globReg;
    CmMmGlobalBktCb      *bktCb;
    Data                 *blkPtr;
-   U8                    blkCnt;
+   uint8_t                    blkCnt;
 
    globReg = osCp.globRegCb;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if(bktIdx >= globReg->numBkts)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
@@ -1141,51 +1258,44 @@ CmMmBlkSetElement    *dynMemSetElem; /* Memory set element which is needs to be
    dynMemSetElem->nextBktPtr = NULLP;
    dynMemSetElem->numFreeBlks = 0;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*
-*
-*       Fun:   ssGetDynMemBlkSet
-*
-*       Desc:  Gets the set of dynamic memory blocks from the global region
-*
-*
-*       Ret:   ROK     - successful, 
-*              RFAILED - unsuccessful.
-*
-*       Notes: 
-*
-*       File:  cm_mem.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssGetDynMemBlkSet
+ *
+ *       Fun:   ssGetDynMemBlkSet
+ *
+ *       Desc:  Gets the set of dynamic memory blocks from the global region
+ *
+ *
+ *       Ret:   ROK     - successful, 
+ *              RFAILED - unsuccessful.
+ *
+ *       Notes: 
+ *
+ *       File:  cm_mem.c
+ *
+ */
+S16 ssGetDynMemBlkSet
 (
-U8                     bktIdx,        /* Index to bucket list */
-CmMmBlkSetElement     *dynMemSetElem  /* Memory set element which is updated 
-                                      with new set values */
-)
-#else
-PUBLIC S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem)
-U8                     bktIdx;        /* Index to bucket list */
-CmMmBlkSetElement     *dynMemSetElem; /* Memory set element which is updated 
-                                      with new set values */
-#endif
+ uint8_t               bktIdx,        /* Index to bucket list */
+ CmMmBlkSetElement     *dynMemSetElem  /* Memory set element which is updated 
+                                         with new set values */
+ )
 {
 
    CmMmGlobRegCb        *globReg;
    CmMmGlobalBktCb      *bktCb;
    Data                **basePtr;
    Data                 *blkPtr;
-   U8                    blkCnt;
+   uint8_t                    blkCnt;
 
    globReg = osCp.globRegCb;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if(bktIdx >= globReg->numBkts)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
@@ -1201,41 +1311,33 @@ CmMmBlkSetElement     *dynMemSetElem; /* Memory set element which is updated
 
    dynMemSetElem->numFreeBlks = bktCb->bucketSetSize;
 
-   RETVALUE(ROK);
+   return ROK;
 
 } /* ssGetDynMemBlkSet */
 
 #else
 /*
-*
-*       Fun:   ssPutDynMemBlkSet
-*
-*       Desc:  Returns the set of dynamic Blocks into the global region
-*
-*
-*       Ret:   ROK     - successful, 
-*              RFAILED - unsuccessful.
-*
-*       Notes: 
-*
-*       File:  cm_mem.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssPutDynMemBlkSet
+ *
+ *       Fun:   ssPutDynMemBlkSet
+ *
+ *       Desc:  Returns the set of dynamic Blocks into the global region
+ *
+ *
+ *       Ret:   ROK     - successful, 
+ *              RFAILED - unsuccessful.
+ *
+ *       Notes: 
+ *
+ *       File:  cm_mem.c
+ *
+ */
+S16 ssPutDynMemBlkSet
 (
-U8                    bktIdx,               /* Index to bucket list */
-CmMmBlkSetElement    *dynMemSetElem,        /* Memory set element which is needs to be 
-                                               added to global region */
-U32                    doNotBlockForLock    /* Boolean whether to block for lock or not */
-)
-#else
-PUBLIC S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem)
-U8                    bktIdx;               /* Index to bucket list */
-CmMmBlkSetElement    *dynMemSetElem;        /* Memory set element which is needs to be 
-                                               added to global region */
-U32                    doNotBlockForLock;   /* Boolean whether to block for lock or not */
-#endif
+ uint8_t              bktIdx,               /* Index to bucket list */
+ CmMmBlkSetElement    *dynMemSetElem,        /* Memory set element which is needs to be 
+                                               added to global region */
+ uint32_t             doNotBlockForLock    /* Boolean whether to block for lock or not */
+ )
 {
    CmMmGlobRegCb       *globReg;
    CmMmGlobalBktCb     *bktCb;
@@ -1243,14 +1345,13 @@ U32                    doNotBlockForLock;   /* Boolean whether to block for lock
    CmMmBlkSetElement   *globMemNode;
    S16                  lockRet = 0;
 
-   TRC1(ssPutDynMemBlkSet);
 
    globReg = osCp.globRegCb;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if(bktIdx >= globReg->numBkts)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
@@ -1271,8 +1372,8 @@ U32                    doNotBlockForLock;   /* Boolean whether to block for lock
       lstNode = cmLListFirst(&(bktCb->listFreeBktSet));
       if(lstNode == NULLP)
       {
-         SUnlock(&(bktCb->bucketLock));
-         RETVALUE(RFAILED);
+        SUnlock(&(bktCb->bucketLock));
+        return RFAILED;
       }
 
       cmLListDelFrm(&(bktCb->listFreeBktSet), lstNode);
@@ -1290,40 +1391,32 @@ U32                    doNotBlockForLock;   /* Boolean whether to block for lock
       SUnlock(&(bktCb->bucketLock));
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*
-*
-*       Fun:   ssGetDynMemBlkSet
-*
-*       Desc:  Gets the set of dynamic memory blocks from the global region
-*
-*
-*       Ret:   ROK     - successful, 
-*              RFAILED - unsuccessful.
-*
-*       Notes: The parameter doNotBlockForLock specifies whether to block for lock
-*              or not 
-*
-*       File:  cm_mem.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssGetDynMemBlkSet
+ *
+ *       Fun:   ssGetDynMemBlkSet
+ *
+ *       Desc:  Gets the set of dynamic memory blocks from the global region
+ *
+ *
+ *       Ret:   ROK     - successful, 
+ *              RFAILED - unsuccessful.
+ *
+ *       Notes: The parameter doNotBlockForLock specifies whether to block for lock
+ *              or not 
+ *
+ *       File:  cm_mem.c
+ *
+ */
+S16 ssGetDynMemBlkSet
 (
-U8                     bktIdx,              /* Index to bucket list */
-CmMmBlkSetElement     *dynMemSetElem,       /* Memory set element which is updated 
-                                               with new set values */
-U32                    doNotBlockForLock    /* Boolean whether to block for lock or not */
-)
-#else
-PUBLIC S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem)
-U8                     bktIdx;              /* Index to bucket list */
-CmMmBlkSetElement     *dynMemSetElem;       /* Memory set element which is updated 
-                                               with new set values */
-U32                    doNotBlockForLock;   /* Boolean whether to block for lock or not */
-#endif
+ uint8_t                     bktIdx,              /* Index to bucket list */
+ CmMmBlkSetElement     *dynMemSetElem,       /* Memory set element which is updated 
+                                               with new set values */
+ uint32_t                    doNotBlockForLock    /* Boolean whether to block for lock or not */
+ )
 {
    CmMmGlobRegCb        *globReg;
    CmMmGlobalBktCb      *bktCb;
@@ -1331,14 +1424,13 @@ U32                    doNotBlockForLock;   /* Boolean whether to block for lock
    CmMmBlkSetElement    *globMemNode;
    S16                   lockRet = 0;
 
-   TRC1(ssGetDynMemBlkSet);
 
    globReg = osCp.globRegCb;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if(bktIdx >= globReg->numBkts)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
@@ -1358,8 +1450,8 @@ U32                    doNotBlockForLock;   /* Boolean whether to block for lock
 
       if(lstNode == NULLP)
       {
-         SUnlock(&(bktCb->bucketLock));
-         RETVALUE(RFAILED);
+        SUnlock(&(bktCb->bucketLock));
+        return RFAILED;
       }
 
       /* Delete the node from the valid linked list and copy the values of the
@@ -1375,35 +1467,26 @@ U32                    doNotBlockForLock;   /* Boolean whether to block for lock
       SUnlock(&(bktCb->bucketLock));
    }
 
-   RETVALUE(ROK);
+   return ROK;
 } /* ssGetDynMemBlkSet */
 
 
 #define NUM_CALLS_TO_CHECK_MEM_DYN_AGAIN 100
-U32 gDynMemAlrm[4];
-PRIVATE U32 memoryCheckCounter;
+uint32_t gDynMemAlrm[4];
+static uint32_t memoryCheckCounter;
 
-#ifdef ANSI
-PUBLIC U32 isMemThreshReached(
-Region reg
-)
-#else
-PUBLIC U32 isMemThreshReached(reg)
-Region reg;
-#endif
+uint32_t isMemThreshReached(Region reg)
 {
    CmMmGlobRegCb        *globReg;
    CmMmGlobalBktCb      *bktCb;
-   U8                    blkCnt;
-   U8 bktIdx= reg;
- TRC3(isMemThreshReached)
+   uint8_t bktIdx= reg;
 
    globReg = osCp.globRegCb;
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if(bktIdx >= globReg->numBkts)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* ERRCLASS & ERRCLS_INT_PAR */
 
@@ -1411,30 +1494,30 @@ Region reg;
 
    if(gDynMemAlrm[bktIdx])
    {
-   //        printf ("under memory   bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
-          SLock(&(bktCb->bucketLock));
-          if(bktCb->listValidBktSet.count > 25)
-            {
-          gDynMemAlrm[bktIdx] = FALSE;
-     //      printf ("recoverd bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
-             }
-          SUnlock(&(bktCb->bucketLock));
-          RETVALUE(RFAILED);
+      //        printf ("\nunder memory   bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
+      SLock(&(bktCb->bucketLock));
+      if(bktCb->listValidBktSet.count > 25)
+      {
+        gDynMemAlrm[bktIdx] = FALSE;
+        //      printf ("\nrecoverd bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
+      }
+      SUnlock(&(bktCb->bucketLock));
+      return RFAILED;
    }
    else
    {
 
-          if(memoryCheckCounter++ >= NUM_CALLS_TO_CHECK_MEM_DYN_AGAIN)
-          {
-       //    printf ("CHECK  bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
-                  SLock(&(bktCb->bucketLock));
-                  if(bktCb->listValidBktSet.count < 15 )
-                          gDynMemAlrm[bktIdx] = TRUE;
-                  memoryCheckCounter = 0;
-                  SUnlock(&(bktCb->bucketLock));
-          }
+      if(memoryCheckCounter++ >= NUM_CALLS_TO_CHECK_MEM_DYN_AGAIN)
+      {
+        //    printf ("\nCHECK  bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
+        SLock(&(bktCb->bucketLock));
+        if(bktCb->listValidBktSet.count < 15 )
+           gDynMemAlrm[bktIdx] = TRUE;
+        memoryCheckCounter = 0;
+        SUnlock(&(bktCb->bucketLock));
+      }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #endif /* USE_MALLOC */
@@ -1442,117 +1525,156 @@ Region reg;
 
 #ifdef SS_USE_ICC_MEMORY
 /*
-*
-*       Fun:   Initialize region/pool tables
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the region/pool tables and configures the common
-*              memory manager for use.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void * ssGetIccHdl  
-(
-Region region
-)
-#else
-PUBLIC Void * ssGetIccHdl()
-Region region;
-#endif
-{
-   CmMmDynRegCb *dynRegCb;
-
-   /* Klock work fix ccpu00148484 */
-   if(!(region < SS_MAX_REGS))
-   {
-      RETVALUE(NULLP);
-   }
-   
-   dynRegCb = (CmMmDynRegCb *)osCp.dynRegionTbl[region].regCb; 
+ *
+ *       Fun:   Initialize region/pool tables
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the region/pool tables and configures the common
+ *              memory manager for use.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void * ssGetIccHdl(Region region)
+{
+   CmMmDynRegCb *dynRegCb;
+
+   /* Klock work fix ccpu00148484 */
+   if(!(region < SS_MAX_REGS))
+   {
+      return (NULLP);
+   }
 
-   RETVALUE(dynRegCb->iccHdl);
+   dynRegCb = (CmMmDynRegCb *)osCp.dynRegionTbl[region].regCb; 
+
+   return (dynRegCb->iccHdl);
 }
 #endif /* SS_USE_ICC_MEMORY */
 
 #ifdef T2K_MEM_LEAK_DBG
-extern RegionMemLeakInfo regMemLeakInfo;
+RegionMemLeakInfo regMemLeakInfo;
 #endif /* T2K_MEM_LEAK_DBG */
 
+#ifdef SS_USE_WLS_MEM
+static S16 SPartitionWlsDynMem()
+{
+   uint32_t i;
+   uint8_t *bktMemStrtAddr = (uint8_t *)(((uint8_t*)osCp.wls.allocAddr) + (4 * 1024 * 1024));
+
+   for (i = 0 ; i < mtGlobMemoCfg.numBkts ; i++)
+   {
+      mtDynMemSz[i].startAddr = bktMemStrtAddr;
+      bktMemStrtAddr += mtDynMemSz[i].reqdSz;
+   }
+
+   printf("\nGlobal Memory Info: \n");
+   for (i = 0 ; i <  mtGlobMemoCfg.numBkts ; i++)
+   {
+      printf("mtDynMemSz[%d]: [0x%016lx]\n", i, (unsigned long int)mtDynMemSz[i].startAddr);
+   }
+   return ROK;
+}
+
+static S16 SAllocateWlsDynMem()
+{
+   uint32_t     reqdMemSz;
+   uint32_t     i;
+   reqdMemSz = 0;
+   memset(&mtDynMemSz[0], 0, sizeof(mtDynMemSz));
+
+   for (i = 0 ; i < mtGlobMemoCfg.numBkts ; i++)
+   {
+      reqdMemSz += (mtGlobMemoCfg.bkt[i].blkSize * mtGlobMemoCfg.bkt[i].numBlks);
+      mtDynMemSz[i].reqdSz += (mtGlobMemoCfg.bkt[i].blkSize * mtGlobMemoCfg.bkt[i].numBlks);
+   }
+   osCp.wls.allocAddr = WLS_Alloc(osCp.wls.intf,
+#ifdef INTEL_L1_V19_10
+        WLS_MEMORY_SIZE);
+#elif INTEL_L1
+    nWlsMacMemorySize+nWlsPhyMemorySize);   
+#else
+   (reqdMemSz + (4 * 1024 * 1024)));
+#endif
+   printf("\n *************** \n WLS memory: %lx, %d\n", (PTR)osCp.wls.allocAddr, reqdMemSz);
+   SPartitionWlsDynMem();
+   return ROK;
+}
+
+#endif
+
 #ifdef INTEL_WLS
 
-PUBLIC S16 SPartitionWlsMemory()
+S16 SPartitionWlsMemory()
 {
-   U32    i;
+   uint32_t    i;
 #ifndef ALIGN_64BIT
-   U64    reqdSz;
-   U64   pageSize[1], hugePageSize;
+   uint64_t    reqdSz;
+   uint64_t   pageSize[1], hugePageSize;
 #else
    long int reqdSz;
    long int pageSize[1], hugePageSize;
 #endif
-   U32 numHugePg;
-   #define DIV_ROUND_OFFSET(X,Y) ( X/Y + ((X%Y)?1:0) )
+   uint32_t numHugePg;
+#define DIV_ROUND_OFFSET(X,Y) ( X/Y + ((X%Y)?1:0) )
 
-   U8   *regMemStrtAddr = (U8 *)osCp.wls.allocAddr;
+   uint8_t   *regMemStrtAddr = (uint8_t *)osCp.wls.allocAddr;
 
    gethugepagesizes(pageSize,1);
    hugePageSize = pageSize[0];
    for (i = 0; i < 1; i++)
    {
       mtRegMemSz[i].startAddr = regMemStrtAddr;
-      CM_LOG_DEBUG(CM_LOG_ID_MT, "Global Region-->Bkt[%d] Addr:%p\n", i, mtRegMemSz[i].startAddr);
+      //CM_LOG_DEBUG(CM_LOG_ID_MT, "Global Region-->Bkt[%d] Addr:%p\n", i, mtRegMemSz[i].startAddr);
 
       numHugePg = DIV_ROUND_OFFSET(mtRegMemSz[i].reqdSz, hugePageSize);
       reqdSz    = numHugePg * hugePageSize;
       regMemStrtAddr += reqdSz;
 #ifdef T2K_MEM_LEAK_DBG
       /* Since wls is region 0 */
-      regMemLeakInfo.regStartAddr[i] = (U64)mtRegMemSz[i].startAddr;
+      regMemLeakInfo.regStartAddr[i] = (uint64_t)mtRegMemSz[i].startAddr;
       regMemLeakInfo.numActvRegions++;
 #endif /* T2K_MEM_LEAK_DBG */
    }
    //Store last region addr for validation
    mtRegMemSz[i].startAddr = regMemStrtAddr;
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #ifdef SS_MEM_WL_DEBUG
-PUBLIC Void SChkAddrValid(int type, int region, PTR ptr)
+Void SChkAddrValid(int type, int region, PTR ptr)
 {
    char *tryPtr = NULL;
    if(type == 0) //Global
    {
       if(ptr < mtRegMemSz[0].startAddr || ptr >=
-              (mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr + mtGlobMemoCfg.heapSize))
+           (mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr + mtGlobMemoCfg.heapSize))
       {
-         printf("****INVALID PTR in Global Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
-         *tryPtr = 0;
+        printf("\n****INVALID PTR in Global Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
+        *tryPtr = 0;
       }
    }
    else
    {
       if(ptr > mtRegMemSz[0].startAddr && ptr <= mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr )
       {
-         printf("****INVALID PTR in Static Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
-         *tryPtr = 0;
+        printf("\n****INVALID PTR in Static Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
+        *tryPtr = 0;
       }
 
    }
 }
 #endif /* SS_MEM_WL_DEBUG */
 
-PUBLIC S16 SPartitionStaticMemory(U8  *startAddr)
+S16 SPartitionStaticMemory(uint8_t  *startAddr)
 {
    int    i;
-   U32    reqdSz;
+   uint32_t    reqdSz;
 
-   U8   *regMemStrtAddr = (U8 *)startAddr;
+   uint8_t   *regMemStrtAddr = (uint8_t *)startAddr;
 
 
    //for (i = 0; i < mtMemoCfg.numRegions; i++)
@@ -1563,18 +1685,18 @@ PUBLIC S16 SPartitionStaticMemory(U8  *startAddr)
       regMemStrtAddr += reqdSz;
 #ifdef T2K_MEM_LEAK_DBG
       {  /* Since region 1 onwards are used for non wls */
-         regMemLeakInfo.regStartAddr[i] = (U64)mtRegMemSz[i].startAddr;
-         regMemLeakInfo.numActvRegions++;
+        regMemLeakInfo.regStartAddr[i] = (uint64_t)mtRegMemSz[i].startAddr;
+        regMemLeakInfo.numActvRegions++;
       }
 #endif /* T2K_MEM_LEAK_DBG */
    }
-   RETVALUE(ROK);
+   return ROK;
 }
-PUBLIC S16 SAllocateWlsMem()
+S16 SAllocateWlsMem()
 {
 
-   U32            reqdMemSz;
-   U32            i, j;
+   uint32_t            reqdMemSz;
+   uint32_t            i, j;
    MtRegCfg       *region;
 
    reqdMemSz = 0;
@@ -1590,8 +1712,8 @@ PUBLIC S16 SAllocateWlsMem()
 
       for (j = 0; j < region->numBkts; j++)
       {
-         reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
-         mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+        reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+        mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
       }
    }
    osCp.wls.allocAddr = WLS_Alloc(osCp.wls.intf, (512 *1024 * 1024));
@@ -1602,15 +1724,15 @@ PUBLIC S16 SAllocateWlsMem()
    printf("\n ************* \n WLS memory: %lx, %d\n ****** \n", (PTR)osCp.wls.allocAddr, reqdMemSz); 
 #endif
    SPartitionWlsMemory();
-   RETVALUE(ROK);
+   return ROK;
 }
-PUBLIC S16 SAllocateStaticMem()
+S16 SAllocateStaticMem()
 {
 
-   U32            reqdMemSz;
+   uint32_t            reqdMemSz;
    int            i, j;
    MtRegCfg       *region;
-   U8             *startAddr;
+   uint8_t             *startAddr;
 
    reqdMemSz = 0;
    //memset(&mtRegMemSz[0], sizeof(mtRegMemSz), 0);
@@ -1625,8 +1747,8 @@ PUBLIC S16 SAllocateStaticMem()
 
       for (j = 0; j < region->numBkts; j++)
       {
-         reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
-         mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+        reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+        mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
       }
    }
 
@@ -1637,52 +1759,44 @@ PUBLIC S16 SAllocateStaticMem()
    printf("\n ************* \n Static memory: %lx, %d\n ****** \n", (PTR)startAddr, reqdMemSz); 
 #endif
    SPartitionStaticMemory(startAddr);
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif /* INTEL_WLS */
 
 \f
 \f
 /*
-*
-*       Fun:   Initialize region/pool tables
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the region/pool tables and configures the common
-*              memory manager for use.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitMem
-(
-void
-)
-#else
-PUBLIC S16 ssdInitMem()
-#endif
+ *
+ *       Fun:   Initialize region/pool tables
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the region/pool tables and configures the common
+ *              memory manager for use.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitMem(void)
 {
    /* mt018.201 - added local variable */
-   U8              i;
-   U16             j;
-   U8              k;
-   MtRegCfg       *region;
+   uint8_t              i =0;
+   uint16_t             j =0;
+   uint8_t              k =0;
+   MtRegCfg       *region = NULLP;
    Txt             errMsg[256] = {'\0'};
 #ifdef SS_LOCKLESS_MEMORY
-   CmMmDynRegCb   *dynRegCb;
+   CmMmDynRegCb   *dynRegCb =0;
 #ifdef SS_USE_ICC_MEMORY
 #else
-   CmMmGlobRegCb  *globReg;
-   Size            memSize;
+   CmMmGlobRegCb  *globReg = NULLP;
+   Size            memSize =0;
 #endif
 #endif /* SS_LOCKLESS_MEMORY */
-   
-   TRC0(ssdInitMem);
+
 
    /* Use the default SSI memory manager if the ICC memory manager is not 
     * avilable. If ICC memory manager is avilable, it will be used for
@@ -1696,18 +1810,18 @@ PUBLIC S16 ssdInitMem()
       dynRegCb = (CmMmDynRegCb *)calloc(1, sizeof(CmMmDynRegCb));
       if(dynRegCb == NULLP)
       {
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
       for(k = 0; k < mtDynMemoCfg.region[i].numBkts; k++)
       {
-         dynRegCb->bktSize[k] = mtGlobMemoCfg.bkt[k].blkSize;
+        dynRegCb->bktSize[k] = mtGlobMemoCfg.bkt[k].blkSize;
       }
       dynRegCb->region = i;
       cmMmDynRegInit(dynRegCb);
-      printf("iccHdl = %lx\n", (PTR)dynRegCb->iccHdl);
+      printf("\niccHdl = %lx\n", (PTR)dynRegCb->iccHdl);
       sleep(1);
    }
- /*   ysIccHdl = dynRegCb->iccHdl; */
  /*   ysIccHdl = dynRegCb->iccHdl; */
 
 #else
    /* Initialize the global region first */
@@ -1715,22 +1829,31 @@ PUBLIC S16 ssdInitMem()
 
    if(osCp.globRegCb == NULLP)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    globReg = (CmMmGlobRegCb *)osCp.globRegCb;
 
+#ifdef SS_USE_WLS_MEM
+   SAllocateWlsDynMem();
+#endif
+
    for(i = 0; i < mtGlobMemoCfg.numBkts; i++)
    {
       memSize = (mtGlobMemoCfg.bkt[i].blkSize * mtGlobMemoCfg.bkt[i].numBlks);
+#if !defined (INTEL_WLS) && defined (SS_USE_WLS_MEM)
+      globReg->bktTbl[i].startAddr = (Data *)mtDynMemSz[i].startAddr;
+      printf("\nStarting Address of Bkt Entry [%d]: [0x%016lx], memSize[%d]\n", i, (unsigned long int)globReg->bktTbl[i].startAddr, memSize);
+#else
 #ifndef INTEL_WLS      
       globReg->bktTbl[i].startAddr = (Data *)calloc(memSize, sizeof(Data));
 #else
       globReg->bktTbl[i].startAddr = (Data *)mtRegMemSz[i].startAddr;
+#endif
 #endif
       if(globReg->bktTbl[i].startAddr == NULLP)
       {
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
       globReg->bktTbl[i].poolId = i;
       globReg->bktTbl[i].size = mtGlobMemoCfg.bkt[i].blkSize;
@@ -1748,28 +1871,29 @@ PUBLIC S16 ssdInitMem()
       dynRegCb = (CmMmDynRegCb *)calloc(1, sizeof(CmMmDynRegCb));
       if(dynRegCb == NULLP)
       {
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
       for(k = 0; k < mtDynMemoCfg.region[i].numBkts; k++)
       {
-         if((mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold < 
-                       mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold) ||
-             (mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold == 0) ||
-             (mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold == 0))
-         {
+        if((mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold < 
+                 mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold) ||
+              (mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold == 0) ||
+              (mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold == 0))
+        {
 #ifdef XEON_SPECIFIC_CHANGES
-            free(dynRegCb);
+           free(dynRegCb);
 #endif            
-            RETVALUE(RFAILED);
-         }
-         dynRegCb->bktTbl[k].size = mtGlobMemoCfg.bkt[k].blkSize;
-         dynRegCb->bktTbl[k].blkSetRelThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold;
-         dynRegCb->bktTbl[k].blkSetAcquireThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold;
-         dynRegCb->bktTbl[k].bucketSetSize = mtGlobMemoCfg.bkt[k].bucketSetSize;
-         if(dynRegCb->bktMaxBlkSize < dynRegCb->bktTbl[k].size)
-         {
-            dynRegCb->bktMaxBlkSize = dynRegCb->bktTbl[k].size;
-         }
+           return RFAILED;
+        }
+        dynRegCb->bktTbl[k].poolId = k;
+        dynRegCb->bktTbl[k].size = mtGlobMemoCfg.bkt[k].blkSize;
+        dynRegCb->bktTbl[k].blkSetRelThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold;
+        dynRegCb->bktTbl[k].blkSetAcquireThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold;
+        dynRegCb->bktTbl[k].bucketSetSize = mtGlobMemoCfg.bkt[k].bucketSetSize;
+        if(dynRegCb->bktMaxBlkSize < dynRegCb->bktTbl[k].size)
+        {
+           dynRegCb->bktMaxBlkSize = dynRegCb->bktTbl[k].size;
+        }
       }
       dynRegCb->region = i;
       dynRegCb->numBkts = mtDynMemoCfg.region[i].numBkts;
@@ -1779,24 +1903,24 @@ PUBLIC S16 ssdInitMem()
 #endif /* SS_LOCKLESS_MEMORY */
 
 #ifdef T2K_MEM_LEAK_DBG
-    U8 reg
-    /* Initailize mem leak tool memorys for debguing */
-    regMemLeakInfo.numActvRegions=0;
-    for(reg=0; reg <SS_MAX_REGS; reg++)
-    {   
-       regMemLeakInfo.gMemLeakInfo[reg] =  malloc(sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
-       memset(regMemLeakInfo.gMemLeakInfo[reg],0x0,
-             sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
-       regMemLeakInfo.regStartAddr[reg] = 0;
-
-
-       regMemLeakInfo.regStartAddr[reg] = 0;
-       if (pthread_mutex_init(&(regMemLeakInfo.memLock[reg]), NULL) != 0)
-       {
-          printf("\n mutex init failed\n");
-          RETVALUE(RFAILED);
-       }
-    }
+   uint8_t reg =0
+   /* Initailize mem leak tool memorys for debguing */
+   regMemLeakInfo.numActvRegions=0;
+   for(reg=0; reg <SS_MAX_REGS; reg++)
+   {   
+      regMemLeakInfo.gMemLeakInfo[reg] =  malloc(sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
+      memset(regMemLeakInfo.gMemLeakInfo[reg],0x0,
+           sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
+      regMemLeakInfo.regStartAddr[reg] = 0;
+
+
+      regMemLeakInfo.regStartAddr[reg] = 0;
+      if (pthread_mutex_init(&(regMemLeakInfo.memLock[reg]), NULL) != 0)
+      {
+        printf("\n mutex init failed\n");
+        return RFAILED;
+      }
+   }
 #endif
 #ifdef INTEL_WLS
    /* Now allocate WLS memory */
@@ -1813,17 +1937,17 @@ PUBLIC S16 ssdInitMem()
 #endif
       if (mtCMMRegCb[i] == NULLP)
       {
-                       sprintf(errMsg,"\n ssdInitMem(): Could not allocated memory \
-                                                               for the Region:%d control block\n",i);
-                       SPrint(errMsg);
-         for (k = 0; k < i; k++)
-         {
-            cmMmRegDeInit(mtCMMRegCb[k]);
-            free(mtCMMRegCfg[k]->vAddr);
-            free(mtCMMRegCb[k]);
+        sprintf(errMsg,"\n ssdInitMem(): Could not allocated memory \
+              for the Region:%d control block\n",i);
+        SPrint(errMsg);
+        for (k = 0; k < i; k++)
+        {
+           cmMmRegDeInit(mtCMMRegCb[k]);
+           free(mtCMMRegCfg[k]->vAddr);
+           free(mtCMMRegCb[k]);
            free(mtCMMRegCfg[k]);
-         }
-         RETVALUE(RFAILED);
+        }
+        return RFAILED;
       }
 
       mtCMMRegCfg[i] = (CmMmRegCfg *)calloc(1, sizeof(CmMmRegCfg));
@@ -1831,17 +1955,17 @@ PUBLIC S16 ssdInitMem()
       mlock(mtCMMRegCfg[i], sizeof(CmMmRegCfg));
 #endif
       if (mtCMMRegCfg[i] == NULLP)
-               {
-                 for (k = 0; k < i; k++)
-                 {
-                        cmMmRegDeInit(mtCMMRegCb[k]);
-                        free(mtCMMRegCfg[k]->vAddr);
-                        free(mtCMMRegCb[k]);
-                        free(mtCMMRegCfg[k]);
-                 }
-                 free(mtCMMRegCb[i]);
-                 RETVALUE(RFAILED);
-               }
+      {
+        for (k = 0; k < i; k++)
+        {
+           cmMmRegDeInit(mtCMMRegCb[k]);
+           free(mtCMMRegCfg[k]->vAddr);
+           free(mtCMMRegCb[k]);
+           free(mtCMMRegCfg[k]);
+        }
+        free(mtCMMRegCb[i]);
+        return RFAILED;
+      }
 
 
       /* allocate space for the region */
@@ -1849,23 +1973,23 @@ PUBLIC S16 ssdInitMem()
       mtCMMRegCfg[i]->size = region->heapsize;
       for (j = 0; j < region->numBkts; j++)
       {
-/* mt033.201 - addition for including the header size while computing the total size */
+        /* mt033.201 - addition for including the header size while computing the total size */
 #ifdef SSI_DEBUG_LEVEL1
-         mtCMMRegCfg[i]->size += (region->bkt[j].blkSize + sizeof(CmMmBlkHdr)) *\
-                                 (region->bkt[j].numBlks);
+        mtCMMRegCfg[i]->size += (region->bkt[j].blkSize + sizeof(CmMmBlkHdr)) *\
+                                (region->bkt[j].numBlks);
 #else
-         mtCMMRegCfg[i]->size += region->bkt[j].blkSize * region->bkt[j].numBlks;
+        mtCMMRegCfg[i]->size += region->bkt[j].blkSize * region->bkt[j].numBlks;
 #endif /* SSI_DEBUG_LEVEL1 */
       }
 #ifdef INTEL_WLS
       mtCMMRegCfg[i]->vAddr = (Data *)mtRegMemSz[i].startAddr;
 #else
       mtCMMRegCfg[i]->vAddr = (Data *)calloc(mtCMMRegCfg[i]->size,
-                                             sizeof(Data));
+           sizeof(Data));
 #endif
 #ifdef XEON_SPECIFIC_CHANGES
       CM_LOG_DEBUG(CM_LOG_ID_MT, "Static Region-->Bkt[%d] Addr:[%p] RegionId=[%d] Size=[%d] \n", 
-                                 i, mtCMMRegCfg[i]->vAddr, region->regionId, mtCMMRegCfg[i]->size);
+           i, mtCMMRegCfg[i]->vAddr, region->regionId, mtCMMRegCfg[i]->size);
 #endif      
 #ifdef TENB_RTLIN_CHANGES
       mlock(mtCMMRegCfg[i]->vAddr, mtCMMRegCfg[i]->size*sizeof(Data));
@@ -1873,19 +1997,19 @@ PUBLIC S16 ssdInitMem()
 
       if (mtCMMRegCfg[i]->vAddr == NULLP)
       {
-                       sprintf(errMsg,"\n ssdInitMem(): Could not allocate memory \
-                                                               for the Region:%d \n",i);
-                  SPrint(errMsg);
-         for (k = 0; k < i; k++)
-         {
-            cmMmRegDeInit(mtCMMRegCb[k]);
-            free(mtCMMRegCfg[k]->vAddr);
-            free(mtCMMRegCb[k]);
-            free(mtCMMRegCfg[k]);
-         }
-         free(mtCMMRegCb[i]);
-         free(mtCMMRegCfg[i]);
-         RETVALUE(RFAILED);
+        sprintf(errMsg,"\n ssdInitMem(): Could not allocate memory \
+              for the Region:%d \n",i);
+        SPrint(errMsg);
+        for (k = 0; k < i; k++)
+        {
+           cmMmRegDeInit(mtCMMRegCb[k]);
+           free(mtCMMRegCfg[k]->vAddr);
+           free(mtCMMRegCb[k]);
+           free(mtCMMRegCfg[k]);
+        }
+        free(mtCMMRegCb[i]);
+        free(mtCMMRegCfg[i]);
+        return RFAILED;
       }
 
 
@@ -1897,91 +2021,82 @@ PUBLIC S16 ssdInitMem()
 
       for (j = 0; j < region->numBkts; j++)
       {
-         mtCMMRegCfg[i]->bktCfg[j].size    = region->bkt[j].blkSize;
-         mtCMMRegCfg[i]->bktCfg[j].numBlks = region->bkt[j].numBlks;
+        mtCMMRegCfg[i]->bktCfg[j].size    = region->bkt[j].blkSize;
+        mtCMMRegCfg[i]->bktCfg[j].numBlks = region->bkt[j].numBlks;
       }
 
       /* initialize the CMM */
 #ifdef SS_LOCKLESS_MEMORY
       if (cmMmStatRegInit(region->regionId, mtCMMRegCb[i], mtCMMRegCfg[i]) != ROK)
 #else
-      if (cmMmRegInit(region->regionId, mtCMMRegCb[i], mtCMMRegCfg[i]) != ROK)
+        if (cmMmRegInit(region->regionId, mtCMMRegCb[i], mtCMMRegCfg[i]) != ROK)
 #endif /* SS_LOCKLESS_MEMORY */
-      {
-         for (k = 0; k < i; k++)
-         {
-            cmMmRegDeInit(mtCMMRegCb[k]);
-            free(mtCMMRegCfg[k]->vAddr);
-            free(mtCMMRegCb[k]);
-            free(mtCMMRegCfg[k]);
-         }
-         free(mtCMMRegCfg[i]->vAddr);
-         free(mtCMMRegCb[i]);
-         free(mtCMMRegCfg[i]);
-         RETVALUE(RFAILED);
-      }
+        {
+           for (k = 0; k < i; k++)
+           {
+              cmMmRegDeInit(mtCMMRegCb[k]);
+              free(mtCMMRegCfg[k]->vAddr);
+              free(mtCMMRegCb[k]);
+              free(mtCMMRegCfg[k]);
+           }
+           free(mtCMMRegCfg[i]->vAddr);
+           free(mtCMMRegCb[i]);
+           free(mtCMMRegCfg[i]);
+           return RFAILED;
+        }
 
 
       /* initialize the STREAMS module */
       /* mt019.201: STREAMS module will only apply to DFLT_REGION */
       if (region->regionId == 0)
       {
-         if (ssStrmCfg(region->regionId, region->regionId) != ROK)
-         {
-            for (k = 0; k < i; k++)
-            {
-               cmMmRegDeInit(mtCMMRegCb[k]);
-               free(mtCMMRegCfg[k]->vAddr);
-               free(mtCMMRegCb[k]);
-               free(mtCMMRegCfg[k]);
-            }
-            cmMmRegDeInit(mtCMMRegCb[i]);
-            free(mtCMMRegCfg[i]->vAddr);
-            free(mtCMMRegCb[i]);
-            free(mtCMMRegCfg[i]);
-            RETVALUE(RFAILED);
-         }
+        if (ssStrmCfg(region->regionId, region->regionId) != ROK)
+        {
+           for (k = 0; k < i; k++)
+           {
+              cmMmRegDeInit(mtCMMRegCb[k]);
+              free(mtCMMRegCfg[k]->vAddr);
+              free(mtCMMRegCb[k]);
+              free(mtCMMRegCfg[k]);
+           }
+           cmMmRegDeInit(mtCMMRegCb[i]);
+           free(mtCMMRegCfg[i]->vAddr);
+           free(mtCMMRegCb[i]);
+           free(mtCMMRegCfg[i]);
+           return RFAILED;
+        }
       }
    }
-/* mt001.301 : Additions */
+   /* mt001.301 : Additions */
 #ifdef SS_MEM_LEAK_STS
    cmInitMemLeakMdl();
 #endif /* SS_MEM_LEAK_STS */
 
-
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   De-initialize region/pool tables
-*
-*       Desc:  This function reverses the initialization in ssdInitMem().
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdDeinitMem
-(
-void
-)
-#else
-PUBLIC Void ssdDeinitMem()
-#endif
+ *
+ *       Fun:   De-initialize region/pool tables
+ *
+ *       Desc:  This function reverses the initialization in ssdInitMem().
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void ssdDeinitMem(void)
 {
    /* mt018.201 - added local variables */
-   U8     i;
+   uint8_t     i;
 
-   TRC0(ssdDeinitMem);
-       /* mt008.301 Additions */
+   /* mt008.301 Additions */
 #ifdef SS_MEM_LEAK_STS
-       cmDeinitMemLeakMdl();
+   cmDeinitMemLeakMdl();
 #endif /* SS_MEM_LEAK_STS */
 
    for (i = 0; i < mtMemoCfg.numRegions; i++)
@@ -1992,43 +2107,35 @@ PUBLIC Void ssdDeinitMem()
       free(mtCMMRegCfg[i]);
    }
 
-   RETVOID;
+   return;
 }
 
 \f
 /*
-*
-*       Fun:   Initialize task table
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the task table.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitTsk
-(
-void
-)
-#else
-PUBLIC S16 ssdInitTsk()
-#endif
+ *
+ *       Fun:   Initialize task table
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the task table.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitTsk(void)
 {
-/* mt001.301 : Additions */
-/*mt013.301 :Added SS_AFFINITY_SUPPORT  */
+   /* mt001.301 : Additions */
+   /*mt013.301 :Added 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 */
 
-   TRC0(ssdInitTsk);
 
 
-/*mt013.301 :Added SS_AFFINITY_SUPPORT  */
+   /*mt013.301 :Added SS_AFFINITY_SUPPORT  */
 #if defined(SS_MULTICORE_SUPPORT) || defined(SS_AFFINITY_SUPPORT)
    /* initialize system task information */
    for (tskInd = 0;  tskInd < SS_MAX_STSKS;  tskInd++)
@@ -2036,69 +2143,53 @@ PUBLIC S16 ssdInitTsk()
       osCp.sTskTbl[tskInd].dep.lwpId = 0;
    }
 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Deinitialize task table
-*
-*       Desc:  This function reverses the initialization perfomed in
-*              ssdInitTsk().
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdDeinitTsk
-(
-void
-)
-#else
-PUBLIC Void ssdDeinitTsk()
-#endif
+ *
+ *       Fun:   Deinitialize task table
+ *
+ *       Desc:  This function reverses the initialization perfomed in
+ *              ssdInitTsk().
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void ssdDeinitTsk(void)
 {
-   TRC0(ssdDeinitTsk);
 
-   RETVOID;
+   return;
 }
 
 \f
 #ifdef SS_DRVR_SUPPORT
 /*
-*
-*       Fun:   Initialize driver task table
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the driver task table.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitDrvr
-(
-void
-)
-#else
-PUBLIC S16 ssdInitDrvr()
-#endif
+ *
+ *       Fun:   Initialize driver task table
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the driver task table.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitDrvr(void)
 {
    S16 i;
 #ifndef L2_L3_SPLIT
    pthread_attr_t attr;
 #endif
 
-   TRC0(ssdInitDrvr);
 
 
    /* initialize the dependent portion of the driver task entries */
@@ -2113,7 +2204,7 @@ PUBLIC S16 ssdInitDrvr()
     */
    if (pipe(osCp.dep.isFildes) != 0)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 #ifndef L2_L3_SPLIT
@@ -2128,11 +2219,11 @@ PUBLIC S16 ssdInitDrvr()
       /* mt020.201 - Addition for destroying thread attribute object attr */
       pthread_attr_destroy(&attr);
 
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif   
 
-  /*mt014.301 : 4GMX release related changes*/
+   /*mt014.301 : 4GMX release related changes*/
 #ifdef SS_4GMX_UCORE
    uarmDrvrInit();
 #endif
@@ -2145,89 +2236,73 @@ PUBLIC S16 ssdInitDrvr()
    pthread_attr_destroy(&attr);
 #endif
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Deinitialize driver information
-*
-*       Desc:  This function reverses the initialization performed in
-*              ssdInitDrvr().
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdDeinitDrvr
-(
-void
-)
-#else
-PUBLIC Void ssdDeinitDrvr()
-#endif
+ *
+ *       Fun:   Deinitialize driver information
+ *
+ *       Desc:  This function reverses the initialization performed in
+ *              ssdInitDrvr().
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void ssdDeinitDrvr(void)
 {
-   TRC0(ssdDeinitDrvr);
-  /* mt008.301: Terminate the Driver Task on exit */
-  while(pthread_cancel(osCp.dep.isTskHdlrTID));
+   /* mt008.301: Terminate the Driver Task on exit */
+   while(pthread_cancel(osCp.dep.isTskHdlrTID));
 
 #ifdef L2_L3_SPLIT
-  TL_Close(AppContext.hUAII);
-  if (clusterMode == RADIO_CLUSTER_MODE)
-  {
+   TL_Close(AppContext.hUAII);
+   if (clusterMode == RADIO_CLUSTER_MODE)
+   {
       TL_Close(AppContext.hUAII_second);
-  }
+   }
 #endif
 
-   RETVOID;
+   return;
 }
 #endif /* SS_DRVR_SUPPORT */
 
 \f
 /*
-*
-*       Fun:   Initialize timer table
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the timer table.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitTmr
-(
-void
-)
-#else
-PUBLIC S16 ssdInitTmr()
-#endif
+ *
+ *       Fun:   Initialize timer table
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the timer table.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitTmr(void)
 {
    pthread_attr_t attr;
    struct sched_param param_sched;
-  /* mt010.21: addition */
+   /* mt010.21: addition */
    S32 i;
 #ifdef SS_MULTICORE_SUPPORT
    SsSTskEntry     *sTsk;
 #endif /* SS_MULTICORE_SUPPORT */
 #ifdef SS_THR_REG_MAP
-   U32 threadCreated = FALSE;
+   uint32_t threadCreated = FALSE;
 #endif /* SS_THR_REG_MAP */
 
-   TRC0(ssdInitTmr);
 
 
    osCp.dep.tmrTqCp.tmrLen = SS_MAX_TMRS;
-  /* mt010.21: addition */
+   /* mt010.21: addition */
    osCp.dep.tmrTqCp.nxtEnt = 0;
    for (i=0; i< SS_MAX_TMRS; i++)
    {
@@ -2238,7 +2313,7 @@ PUBLIC S16 ssdInitTmr()
    sTsk = ssdAddTmrSTsk();
    if(!sTsk)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* SS_MULTICORE_SUPPORT */
    /* create the timer handler thread */
@@ -2264,15 +2339,15 @@ PUBLIC S16 ssdInitTmr()
 #endif
       if ((pthread_create(&osCp.dep.tmrHdlrTID, &attr, mtTmrHdlr, NULLP)) != 0)
       {
-         /* mt020.201 - Addition for destroying thread attribute object attr */
-         pthread_attr_destroy(&attr);
+        /* mt020.201 - Addition for destroying thread attribute object attr */
+        pthread_attr_destroy(&attr);
 
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
 
 #ifdef SS_THR_REG_MAP
       threadCreated = ssCheckAndAddMemoryRegionMap(osCp.dep.tmrHdlrTID, 
-                                                   sTsk->region);
+           sTsk->region);
    }
 #endif /* SS_THR_REG_MAP */
 #ifdef SS_MEM_WL_DEBUG
@@ -2283,39 +2358,31 @@ PUBLIC S16 ssdInitTmr()
    pthread_attr_destroy(&attr);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Deinitialize timer table
-*
-*       Desc:  This function reverses the initialization performed in
-*              ssdInitTmr().
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdDeinitTmr
-(
-void
-)
-#else
-PUBLIC Void ssdDeinitTmr()
-#endif
+ *
+ *       Fun:   Deinitialize timer table
+ *
+ *       Desc:  This function reverses the initialization performed in
+ *              ssdInitTmr().
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void ssdDeinitTmr(void)
 {
 #ifdef SS_MULTICORE_SUPPORT
    SsSTskEntry *sTsk;
    S16         ret;
 #endif /* SS_MULTICORE_SUPPORT */
 
-   TRC0(ssdDeinitTmr);
 
 #ifdef SS_MULTICORE_SUPPORT
    ret = SLock(&osCp.sTskTblLock);
@@ -2324,9 +2391,9 @@ PUBLIC Void ssdDeinitTmr()
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT008, (ErrVal) ret,
-                 "Could not lock system task table");
+           "Could not lock system task table");
 #endif
-      RETVOID;
+      return;
    }
    sTsk = &osCp.sTskTbl[0]; /* first entry is timer entry always */
    /* clean up the system task entry */
@@ -2347,36 +2414,29 @@ PUBLIC Void ssdDeinitTmr()
    SUnlock(&osCp.sTskTblLock);
 
 #endif /* SS_MULTICORE_SUPPORT */
-  /* mt008.301: Terminate the timer thread on exit */
-  while(pthread_cancel(osCp.dep.tmrHdlrTID));
-  RETVOID;
+   /* mt008.301: Terminate the timer thread on exit */
+   while(pthread_cancel(osCp.dep.tmrHdlrTID));
+   return;
 }
 
 
 \f
 /*
-*
-*       Fun:   ssdInitLog
-*
-*       Desc:  Pre-tst() initialization.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitLog
-(
-void
-)
-#else
-PUBLIC S16 ssdInitLog()
-#endif
+ *
+ *       Fun:   ssdInitLog
+ *
+ *       Desc:  Pre-tst() initialization.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitLog(void)
 {
-/* mt027.201 - Modification to fix warnings with no STDIN and STDOUT */
+   /* mt027.201 - Modification to fix warnings with no STDIN and STDOUT */
 #ifdef CONAVL
 #ifndef CONRD
    S32 flags;
@@ -2388,15 +2448,14 @@ PUBLIC S16 ssdInitLog()
 #endif /* CONRD */
 #endif /* CONAVL */
 
-/* mt008.301: ssdInitFinal changed to ssdInitLog */
-   TRC0(ssdInitLog);
+   /* mt008.301: ssdInitFinal changed to ssdInitLog */
 
 
 #ifdef CONAVL
 
    osCp.dep.conInFp = (FILE *) stdin;
    osCp.dep.conOutFp = (FILE *) stdout;
-/* added compile time flag CONRD: mt017.21 */
+   /* added compile time flag CONRD: mt017.21 */
 #ifndef CONRD
 #ifndef CONSTDIO
 
@@ -2404,8 +2463,8 @@ PUBLIC S16 ssdInitLog()
    fd = fileno(osCp.dep.conInFp);
    if ((tcgetattr(fd, &tio)) != 0)
    {
-      printf("Error: disable canonical input processing\n");
-      RETVALUE(RFAILED);
+      printf("\nError: disable canonical input processing\n");
+      return RFAILED;
    }
 
    tio.c_lflag &= ~ICANON;
@@ -2413,8 +2472,8 @@ PUBLIC S16 ssdInitLog()
    tio.c_cc[VTIME] = 0;
    if ((tcsetattr(fd, TCSANOW, &tio)) != 0)
    {
-      printf("Error: while tcsetattr() processing\n");
-      RETVALUE(RFAILED);
+      printf("\nError: while tcsetattr() processing\n");
+      return RFAILED;
    }
 
 #endif /* CONSTDIO */
@@ -2426,8 +2485,8 @@ PUBLIC S16 ssdInitLog()
    flags &= ~O_NONBLOCK;
    if (fcntl(fd, F_SETFL, flags) == -1)
    {
-      printf("Error: while fcntl processing\n");
-      RETVALUE(RFAILED);
+      printf("\nError: while fcntl processing\n");
+      return RFAILED;
    }
 
 
@@ -2444,8 +2503,8 @@ PUBLIC S16 ssdInitLog()
       /* mt020.201 - Addition for destroying thread attribute object attr */
       pthread_attr_destroy(&attr);
 
-      printf("Error: Logging Thread creation failed \n");
-      RETVALUE(RFAILED);
+      printf("\nError: Logging Thread creation failed \n");
+      return RFAILED;
    }
 
    /* mt020.201 - Addition for destroying thread attribute object attr */
@@ -2455,60 +2514,44 @@ PUBLIC S16 ssdInitLog()
 #endif /* CONAVL */
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   ssdDeinitLog
-*
-*       Desc:  This function reverses the initialization performed in
-*              ssdInitLog().
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
+ *
+ *       Fun:   ssdDeinitLog
+ *
+ *       Desc:  This function reverses the initialization performed in
+ *              ssdInitLog().
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
 /* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */
-#ifdef ANSI
-PUBLIC Void ssdDeinitLog
-(
-void
-)
-#else
-PUBLIC Void ssdDeinitLog()
-#endif
+Void ssdDeinitLog(void)
 {
-/* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */
-   TRC0(ssdDeinitLog);
+   /* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */
 #ifdef CONAVL
 #ifndef CONRD
-  /* mt008.301: Terminate the console reader on exit */
-  while(pthread_cancel(osCp.dep.conHdlrTID));
+   /* mt008.301: Terminate the console reader on exit */
+   while(pthread_cancel(osCp.dep.conHdlrTID));
 #endif /* CONRD */
 #endif /* CONVAL */
 
-   RETVOID;
+   return;
 }
 /* mt001.301 : Additions */
 #ifdef SS_WATCHDOG
 
 
-#ifdef ANSI
-PUBLIC S16 ssdInitWatchDog
-(
-U16 port
-)
-#else
-PUBLIC S16 ssdInitWatchDog(port)
-U16 port;
-#endif
+S16 ssdInitWatchDog(uint16_t port)
 {
-   U8 idx;
+   uint8_t idx;
    Txt prntBuf[PRNTSZE];
    Pst     pst;
    Buffer *mBuf;
@@ -2521,11 +2564,10 @@ U16 port;
    ProcId procId = SS_WD_WDPROC;
    if (SAddProcIdLst(1, &procId) != ROK)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* SS_MULTIPLE_PROCS */
 
-   TRC0(ssdInitWatchDog);
 
    SInitLock(&osCp.wdCp.wdLock, SS_LOCK_MUTEX);
 
@@ -2564,7 +2606,7 @@ U16 port;
    ssdInitWatchDgPst(&(osCp.wdCp.watchDgPst));
    /* Initialize the watch dog timer resolution default is 1 sec */
 
-   cmInitTimers(osCp.wdCp.watchDgTmr, (U8)1);
+   cmInitTimers(osCp.wdCp.watchDgTmr, (uint8_t)1);
    osCp.wdCp.watchDgTqCp.nxtEnt = 0;
    osCp.wdCp.watchDgTqCp.tmrLen = 1;
    for(idx = 0; idx < 1; idx++)
@@ -2598,7 +2640,7 @@ U16 port;
 #endif /* SS_WATCHDOG_IPV6 */
 
    if(bind(osCp.wdCp.globWd.sock, (struct sockaddr *)&tmpaddr, sizeof(struct sockaddr)) != 0
-)
+     )
    {
       sprintf(prntBuf,"ssdInitWatchDog: bind failed errno [%d]\n", errno);
       SPrint(prntBuf);
@@ -2606,7 +2648,7 @@ U16 port;
 
    if (SGetMsg(SS_DFLT_REGION, SS_DFLT_POOL, &mBuf) != ROK)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #ifndef SS_MULTIPLE_PROCS
    pst.srcProcId = SFndProcId();
@@ -2619,20 +2661,11 @@ U16 port;
    ssdInitWatchDgPst(&pst);
    SPstTsk(&pst, mBuf);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 ssdInitWatchDgPst
-(
-Pst *pst
-)
-#else
-PUBLIC S16 ssdInitWatchDgPst(pst)
-Pst *pst;
-#endif
+S16 ssdInitWatchDgPst(Pst *pst)
 {
-   TRC1(ssInitWatchDgPst);
 
    pst->selector  = SS_LOOSE_COUPLING;
 
@@ -2647,51 +2680,33 @@ Pst *pst;
    pst->srcEnt    = ENTDW;                   /* source entity */
    pst->srcInst   = 0;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #ifdef SS_MULTIPLE_PROCS
-#ifdef ANSI
-PUBLIC S16 ssdWatchDgActvTmr
-(
-ProcId proc,
-Ent ent,
-Inst inst
-)
-#else
-PUBLIC S16 ssdWatchDgActvTmr(proc, ent, inst)
-#endif
-#else
-#ifdef ANSI
-PUBLIC S16 ssdWatchDgActvTmr
+   S16 ssdWatchDgActvTmr
 (
-Void
-)
+ ProcId proc,
+ Ent ent,
+ Inst inst
+ )
 #else
-PUBLIC S16 ssdWatchDgActvTmr()
-#endif
+S16 ssdWatchDgActvTmr(Void)
 #endif /* SS_MULTIPLE_PROCS */
 {
-   TRC3(ssWatchDgActvTmr);
 
    cmPrcTmr(&osCp.wdCp.watchDgTqCp, osCp.wdCp.watchDgTs, (PFV)ssdWatchDgTmrEvt);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
-#ifdef ANSI
-PUBLIC Void ssdWatchDgTmrEvt
+   Void ssdWatchDgTmrEvt
 (
-PTR       cb,        /* control block */
-S16       event      /* timer number */
-)
-#else
-PUBLIC Void ssdWatchDgTmrEvt(cb, event)
-PTR       cb;        /* control block */
-S16       event;     /* timer number */
-#endif
+ PTR       cb,        /* control block */
+ S16       event      /* timer number */
+ )
 {
-/* mt003.301 Fixed warings */
+   /* mt003.301 Fixed warings */
 #ifdef DEBUGP
    DateTime dt;
 #endif /* DEBUGP */
@@ -2699,60 +2714,52 @@ S16       event;     /* timer number */
    Bool restartTmr;
    int i;
 
-   TRC2(ssWatchDgTmrEvt);
 
    switch(event)
    {
       case SS_TMR_HRTBT:
 #ifdef DEBUGP
-        SPrint("Timer Heartbeat Request Expired");
-        SGetDateTime(&dt);
-        sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
-        SPrint(prntBuf);
-#endif
-        restartTmr=TRUE;
-
-        SLock(&osCp.wdCp.wdLock);
-        for(i=0; i < osCp.wdCp.globWd.numNodes; i++)
-        {
-           if(osCp.wdCp.globWd.wdsta[i].status == 0)
-           {
-              sprintf(prntBuf, "Node [ %s ] Down. Calling user callback\n", inet_ntoa(osCp.wdCp.globWd.wdsta[i].addr));
-              SPrint(prntBuf);
-              if(osCp.wdCp.globWd.callback != 0)
-              {
-                 osCp.wdCp.globWd.callback(osCp.wdCp.globWd.data);
-              }
-           }
-        }
-        SUnlock(&osCp.wdCp.wdLock);
-
-                 if(!osCp.wdCp.globWd.watchdogStop)
-                 {
-           ssdStartWatchDgTmr(NULLP, SS_TMR_HRTBT, osCp.wdCp.globWd.timeout);
-           ssdSndHrtBtMsg(restartTmr, SS_WD_HB_REQ);
-                 }
-        break;
+        SPrint("Timer Heartbeat Request Expired");
+        SGetDateTime(&dt);
+        sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
+        SPrint(prntBuf);
+#endif
+        restartTmr=TRUE;
+
+        SLock(&osCp.wdCp.wdLock);
+        for(i=0; i < osCp.wdCp.globWd.numNodes; i++)
+        {
+           if(osCp.wdCp.globWd.wdsta[i].status == 0)
+           {
+              sprintf(prntBuf, "Node [ %s ] Down. Calling user callback\n", inet_ntoa(osCp.wdCp.globWd.wdsta[i].addr));
+              SPrint(prntBuf);
+              if(osCp.wdCp.globWd.callback != 0)
+              {
+                 osCp.wdCp.globWd.callback(osCp.wdCp.globWd.data);
+              }
+           }
+        }
+        SUnlock(&osCp.wdCp.wdLock);
+
+        if(!osCp.wdCp.globWd.watchdogStop)
+        {
+           ssdStartWatchDgTmr(NULLP, SS_TMR_HRTBT, osCp.wdCp.globWd.timeout);
+           ssdSndHrtBtMsg(restartTmr, SS_WD_HB_REQ);
+        }
+        break;
 
       default:
-         break;
+        break;
    }
 
 }
 
-#ifdef ANSI
-PUBLIC Void ssdStartWatchDgTmr
+   Void ssdStartWatchDgTmr
 (
-void             *cb,
-S16              event,
-U16              wait
-)
-#else
-PUBLIC Void ssdStartWatchDgTmr(cb, event, wait)
-void             *cb;
-S16              event;
-U16              wait;
-#endif
+ void     *cb,
+ S16      event,
+ uint16_t wait
+ )
 {
    CmTmrArg    arg;
    int i;
@@ -2762,8 +2769,7 @@ U16              wait;
 #endif
 
 
-   TRC2(ssStartWatchDgTmr)
-       /* mt003.301 Modifications */
+   /* mt003.301 Modifications */
 #ifdef DEBUGP
    SGetDateTime(&dt);
    sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
@@ -2793,20 +2799,14 @@ U16              wait;
    arg.max    = 1;
    cmPlcCbTq(&arg);
 
-   RETVOID;
+   return;
 }
 
-#ifdef ANSI
-PUBLIC Void ssdStopWatchDgTmr
+   Void ssdStopWatchDgTmr
 (
-void             *cb,
-S16              event
-)
-#else
-PUBLIC Void ssdStopWatchDgTmr(cb, event)
-void             *cb;
-S16              event;
-#endif
+ void *cb,
+ S16  event
+ )
 {
    CmTmrArg    arg;
 #ifdef DEBUGP
@@ -2815,8 +2815,7 @@ S16              event;
    int i;
 #endif
 
-   TRC2(ssStopWatchDgTmr)
-       /* mt003.301 Modifications */
+   /* mt003.301 Modifications */
 #ifdef DEBUGP
    SGetDateTime(&dt);
    sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
@@ -2844,20 +2843,14 @@ S16              event;
    arg.max    = 1;
    cmRmvCbTq(&arg);
 
-   RETVOID;
+   return;
 }
 
-#ifdef ANSI
-PUBLIC S16 ssdSndHrtBtMsg
+   S16 ssdSndHrtBtMsg
 (
-Bool             restart,
-U32              type
-)
-#else
-PUBLIC S16 ssdSndHrtBtMsg(restart, type)
-Bool             restart;
-U32              type;
-#endif
+ Bool      restart,
+ uint32_t  type
+ )
 {
    S16     ret = ROK;
 #ifdef DEBUGP
@@ -2869,7 +2862,6 @@ U32              type;
    int             n;
    int             err;
 
-   TRC2(ssdSndHrtBtReq)
 
 #ifdef DEBUGP
    SGetDateTime(&dt);
@@ -2886,7 +2878,7 @@ U32              type;
    {
       if(osCp.wdCp.globWd.wdsta[n].addr.s_addr == 0)
       {
-         continue;
+        continue;
       }
 
       /* Identify the destination node */
@@ -2905,22 +2897,22 @@ U32              type;
       if(err == -1)
       {
 #ifdef DEBUGP
-      sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] failed status[%d]\n",
-                      inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, errno);
-      SPrint(prntBuf);
+        sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] failed status[%d]\n",
+              inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, errno);
+        SPrint(prntBuf);
 #endif /* DEBUGP */
       }
       else
       {
 #ifdef DEBUGP
-      sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] sent[%d]\n", inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, err);
-      SPrint(prntBuf);
+        sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] sent[%d]\n", inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, err);
+        SPrint(prntBuf);
 #endif /* DEBUGP */
       }
    }
    SUnlock(&osCp.wdCp.wdLock);
 
-   RETVALUE(ret);
+   return (ret);
 }
 
 #endif /* SS_WATCHDOG */
@@ -2930,36 +2922,29 @@ U32              type;
 /* mt022.201 - Modification to fix problem when NOCMDLINE is defined */
 #ifndef NOCMDLINE
 /*
-*
-*       Fun:   mtGetOpts
-*
-*       Desc:  This function gets command line options.
-*
-*       Ret:
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PRIVATE Void mtGetOpts
-(
-void
-)
-#else
-PRIVATE Void mtGetOpts()
-#endif
-{
-   S32 argc;
-   S8 **argv;
-   S16 ret;
+ *
+ *       Fun:   mtGetOpts
+ *
+ *       Desc:  This function gets command line options.
+ *
+ *       Ret:
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+static Void mtGetOpts(void)
+{
+   S32 argc;
+   S8 **argv;
+   S16 ret;
    /* mt028.201 */
 #ifndef NOFILESYS
    FILE         *memOpt;             /* memory options file pointer */
    Txt pBuf[128];
-   U8 i;
-/* mt007.301 : Fix related to file based mem config on 64 bit machine */
+   uint8_t i;
+   /* mt007.301 : Fix related to file based mem config on 64 bit machine */
    PTR numReg;
    PTR numBkts;
    PTR bktSz = NULLP;
@@ -2983,7 +2968,6 @@ PRIVATE Void mtGetOpts()
    Cntr   idx=0;
 #endif
 
-   TRC0(mtGetOpts);
 
 
    msOptInd = 1;
@@ -3004,342 +2988,335 @@ PRIVATE Void mtGetOpts()
       switch (ret)
       {
 #ifndef NOFILESYS
-/* mt001.301 : Additions */
+        /* mt001.301 : Additions */
 #ifdef SS_MEM_LEAK_STS
-         case 'm':
-            cmMemOpenMemLkFile(msOptArg);
-            break;
-#endif
-         case 'o':
-            osCp.dep.fileOutFp = fopen(msOptArg, "w");
-            break;
-         case 'f':
-                               fileBasedMemCfg = TRUE;
-            memOpt = fopen(msOptArg, "r");
-
-            /* if file does not exist or could not be opened then use the
-             * default memory configuration as defined in mt_ss.h
-             */
-            if (memOpt == (FILE *) NULLP)
-            {
-               sprintf(pBuf, "\nMTSS: Memory configuration file: %s could not\
-                                                                       be opened, using default mem configuration\n", msOptArg);
-               SPrint(pBuf);
-               break;
-            }
-            i = 0;
-            while (fgets((Txt *)line, 256, memOpt) != NULLP)
-            {
-               if(line[0] == '#' || line[0] < '0' || line[0] > '9') /* Comment line or non numeric character, so skip it and read next line */
-                   continue;
-               if(error == TRUE)
-                   break;
-               switch  (i)
-               {
-                  case 0:  /*** INPUT: Number of regions ***/
-                     sscanf(line, "%ld", (long *) &numReg);
-                     mtMemoCfg.numRegions = numReg;
-                     if(mtMemoCfg.numRegions > SS_MAX_REGS)
-                     {
-                                                               printf("\n No. of regions are > SS_MAX_REGS:%d \n",SS_MAX_REGS);
-                        error = TRUE;
-                        break;
-                     }
-                     i++;
-                     break;
-                  case 1: /*** INPUT: Number of buckets and number of Pools ***/
-                                                       sscanf(line, "%ld %ld", (long *) &numBkts, (long *) &numPools);
-                                                       if(numBkts > MT_MAX_BKTS)
-                                                       {
-                                                         printf("\n No. of buckets are > MT_MAX_BKTS :%d \n",MT_MAX_BKTS);
-                                                         error = TRUE;
-                                                         break;
-                                                       }
-                                                       if(numPools > SS_MAX_POOLS_PER_REG)
-                                                       {
-                                                         printf("\n No. of pools are > SS_MAX_POOLS_PER_REG:%d \n",SS_MAX_POOLS_PER_REG);
-                                                         error = TRUE;
-                                                         break;
-                                                       }
-                                                       /*
-                                                        * Delay updation from local variable to global
-                                                        * structure of number of regions and heap data to
-                                                        * counter error conditions present above.
-                                                        */
-                                                       for(idx = 0; idx < cfgNumRegs; idx++)
-                                                       {
-                                                         mtMemoCfg.region[idx].numBkts = numBkts;
-                                                         cfgRegInfo[idx].region = idx;
-                                                         cfgRegInfo[idx].numPools = numPools;
-                                                         /*
-                                                               * Initialize the pool info as static type with size zero
-                                                               */
-                                                         for(poolIdx = 0; poolIdx < numPools; poolIdx++)
-                                                         {
-                          cfgRegInfo[idx].pools[poolIdx].type = SS_POOL_STATIC;
-                          cfgRegInfo[idx].pools[poolIdx].size = 0;
-                                                         }
-                                                       }
-                                                       i++;
-                     break;
-                  case 2: /*** INPUT: Bucket Id and size of the bucket ***/
-                                                       if(bktUpdtCnt < numBkts) /* more set of bucket can be added */
-                                                       {
-                                                               sscanf(line, "%ld %ld",(long *)&bktIdx, (long *) &bktSz);
-                                                       }
-                                                       if(bktIdx >= numBkts)
-                                                       {
-                                                         printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
-                                                         error = TRUE;
-                                                         break;
-
-                                                       }
-                                                       mtBktInfo[bktIdx].blkSize  = bktSz;
-                                                       bktUpdtCnt++;
-                                                       if(bktUpdtCnt == numBkts)
-                                                       {
-                                                         i++; /*done reading bkt info, start reading individual region info*/
-                                                         bktUpdtCnt = 0;
-                                                       }
-                     break;
-                     case 3: /*** INPUT: Region Id (ranges from 0 to numRegions-1) **/
-                     sscanf(line,"%ld",(long *) &regId);
-                     if(regId >= mtMemoCfg.numRegions)
-                     {
-                       printf("\n Invalid Region Id, may be >= the No. of regions:%d\n",mtMemoCfg.numRegions);
+        case 'm':
+           cmMemOpenMemLkFile(msOptArg);
+           break;
+#endif
+        case 'o':
+           osCp.dep.fileOutFp = fopen(msOptArg, "w");
+           break;
+        case 'f':
+           fileBasedMemCfg = TRUE;
+           memOpt = fopen(msOptArg, "r");
+
+           /* if file does not exist or could not be opened then use the
+            * default memory configuration as defined in mt_ss.h
+            */
+           if (memOpt == (FILE *) NULLP)
+           {
+              sprintf(pBuf, "\nMTSS: Memory configuration file: %s could not\
+                    be opened, using default mem configuration\n", msOptArg);
+              SPrint(pBuf);
+              break;
+           }
+           i = 0;
+           while (fgets((Txt *)line, 256, memOpt) != NULLP)
+           {
+              if(line[0] == '#' || line[0] < '0' || line[0] > '9') /* Comment line or non numeric character, so skip it and read next line */
+                 continue;
+              if(error == TRUE)
+                 break;
+              switch  (i)
+              {
+                 case 0:  /*** INPUT: Number of regions ***/
+                    sscanf(line, "%ld", (long *) &numReg);
+                    mtMemoCfg.numRegions = numReg;
+                    if(mtMemoCfg.numRegions > SS_MAX_REGS)
+                    {
+                       printf("\n No. of regions are > SS_MAX_REGS:%d \n",SS_MAX_REGS);
+                       error = TRUE;
+                       break;
+                    }
+                    i++;
+                    break;
+                 case 1: /*** INPUT: Number of buckets and number of Pools ***/
+                    sscanf(line, "%ld %ld", (long *) &numBkts, (long *) &numPools);
+                    if(numBkts > MT_MAX_BKTS)
+                    {
+                       printf("\n No. of buckets are > MT_MAX_BKTS :%d \n",MT_MAX_BKTS);
+                       error = TRUE;
+                       break;
+                    }
+                    if(numPools > SS_MAX_POOLS_PER_REG)
+                    {
+                       printf("\n No. of pools are > SS_MAX_POOLS_PER_REG:%d \n",SS_MAX_POOLS_PER_REG);
+                       error = TRUE;
+                       break;
+                    }
+                    /*
+                     * Delay updation from local variable to global
+                     * structure of number of regions and heap data to
+                     * counter error conditions present above.
+                     */
+                    for(idx = 0; idx < cfgNumRegs; idx++)
+                    {
+                       mtMemoCfg.region[idx].numBkts = numBkts;
+                       cfgRegInfo[idx].region = idx;
+                       cfgRegInfo[idx].numPools = numPools;
+                       /*
+                        * Initialize the pool info as static type with size zero
+                        */
+                       for(poolIdx = 0; poolIdx < numPools; poolIdx++)
+                       {
+                          cfgRegInfo[idx].pools[poolIdx].type = SS_POOL_STATIC;
+                          cfgRegInfo[idx].pools[poolIdx].size = 0;
+                       }
+                    }
+                    i++;
+                    break;
+                 case 2: /*** INPUT: Bucket Id and size of the bucket ***/
+                    if(bktUpdtCnt < numBkts) /* more set of bucket can be added */
+                    {
+                       sscanf(line, "%ld %ld",(long *)&bktIdx, (long *) &bktSz);
+                    }
+                    if(bktIdx >= numBkts)
+                    {
+                       printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
+                       error = TRUE;
+                       break;
+
+                    }
+                    mtBktInfo[bktIdx].blkSize  = bktSz;
+                    bktUpdtCnt++;
+                    if(bktUpdtCnt == numBkts)
+                    {
+                       i++; /*done reading bkt info, start reading individual region info*/
+                       bktUpdtCnt = 0;
+                    }
+                    break;
+                 case 3: /*** INPUT: Region Id (ranges from 0 to numRegions-1) **/
+                    sscanf(line,"%ld",(long *) &regId);
+                    if(regId >= mtMemoCfg.numRegions)
+                    {
+                       printf("\n Invalid Region Id, may be >= the No. of regions:%d\n",mtMemoCfg.numRegions);
 #ifndef XEON_SPECIFIC_CHANGES                       
-                       error = TRUE;
+                       error = TRUE;
 #endif                       
-                       break;
-                     }
-                     mtMemoCfg.region[regId].regionId = regId;
-                     i++;
-                     break;
-                     case 4: /*** INPUT: BktId (ranges from 0 to numBkts-1), No. of blks ***/
-                     if(bktUpdtCnt < numBkts)
-                     {
-                       sscanf(line, "%ld %ld",(long *)&bktIdx, (long *)&bktNum);
-                       if(bktIdx >= numBkts)
-                       {
-                         printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
-                         error = TRUE;
-                         break;
-
-                       }
-                       if(bktIdx < MT_MAX_BKTS)
-                       {
-                         mtMemoCfg.region[regId].bkt[bktIdx].blkSize = mtBktInfo[bktIdx].blkSize;
-                         mtMemoCfg.region[regId].bkt[bktIdx].numBlks = bktNum;
-                         cfgRegInfo[regId].pools[bktIdx].type = SS_POOL_DYNAMIC;
-                         cfgRegInfo[regId].pools[bktIdx].size = mtBktInfo[bktIdx].blkSize - (sizeof(SsMblk)+sizeof(SsDblk));
-                       }
-                       bktUpdtCnt++;
-                       if(bktUpdtCnt == numBkts)
-                       {
-                          i++;
-                        bktUpdtCnt = 0;
-                       }
-                     }
-                     break;
-                     case 5: /* INPUT: Heapsize ***/
-                     sscanf(line, "%ld", (long *) &heapSz);
-                     mtMemoCfg.region[regId].heapsize = heapSz;
-                     regUpdtCnt++;
-                     if(regUpdtCnt != mtMemoCfg.numRegions)
-                     {
-                        i = 3;   
-                     }
-                     else
-                     {
-                        i++;
-                     }
-                     break;
+                       break;
+                    }
+                    mtMemoCfg.region[regId].regionId = regId;
+                    i++;
+                    break;
+                 case 4: /*** INPUT: BktId (ranges from 0 to numBkts-1), No. of blks ***/
+                    if(bktUpdtCnt < numBkts)
+                    {
+                       sscanf(line, "%ld %ld",(long *)&bktIdx, (long *)&bktNum);
+                       if(bktIdx >= numBkts)
+                       {
+                          printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
+                          error = TRUE;
+                          break;
+
+                       }
+                       if(bktIdx < MT_MAX_BKTS)
+                       {
+                          mtMemoCfg.region[regId].bkt[bktIdx].blkSize = mtBktInfo[bktIdx].blkSize;
+                          mtMemoCfg.region[regId].bkt[bktIdx].numBlks = bktNum;
+                          cfgRegInfo[regId].pools[bktIdx].type = SS_POOL_DYNAMIC;
+                          cfgRegInfo[regId].pools[bktIdx].size = mtBktInfo[bktIdx].blkSize - (sizeof(SsMblk)+sizeof(SsDblk));
+                       }
+                       bktUpdtCnt++;
+                       if(bktUpdtCnt == numBkts)
+                       {
+                          i++;
+                          bktUpdtCnt = 0;
+                       }
+                    }
+                    break;
+                 case 5: /* INPUT: Heapsize ***/
+                    sscanf(line, "%ld", (long *) &heapSz);
+                    mtMemoCfg.region[regId].heapsize = heapSz;
+                    regUpdtCnt++;
+                    if(regUpdtCnt != mtMemoCfg.numRegions)
+                    {
+                       i = 3;   
+                    }
+                    else
+                    {
+                       i++;
+                    }
+                    break;
 #ifdef SS_LOCKLESS_MEMORY
-                     case 6:
-                     sscanf(line, "%ld", (long *) &numBkts);
-                     mtGlobMemoCfg.numBkts = numBkts;
+                 case 6:
+                    sscanf(line, "%ld", (long *) &numBkts);
+                    mtGlobMemoCfg.numBkts = numBkts;
 #ifndef XEON_SPECIFIC_CHANGES                     
-                     mtDynMemoCfg.numRegions = mtMemoCfg.numRegions;
+                    mtDynMemoCfg.numRegions = mtMemoCfg.numRegions;
 #endif                     
 
 #ifdef XEON_SPECIFIC_CHANGES
-                     CM_LOG_DEBUG(CM_LOG_ID_MT, "numRegions = %d numBkts = %d\n",
-                                    mtDynMemoCfg.numRegions, mtGlobMemoCfg.numBkts);
-                     for(idx = 0; idx < mtDynMemoCfg.numRegions; idx++)
+                    CM_LOG_DEBUG(CM_LOG_ID_MT, "numRegions = %d numBkts = %d\n",
+                          mtDynMemoCfg.numRegions, mtGlobMemoCfg.numBkts);
+                    for(idx = 0; idx < mtDynMemoCfg.numRegions; idx++)
 #else                     
-                     for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
+                       for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
 #endif                        
-                     {
-                        mtDynMemoCfg.region[idx].regionId = idx;
-                        mtDynMemoCfg.region[idx].numBkts = numBkts;
-                     }
-
-                     bktUpdtCnt = 0;
-                     i++;
-                     break;
-
-                     case 7:
-                     if(bktUpdtCnt < numBkts)
-                     {
-                        sscanf(line, "%ld %ld %ld %ld %ld %ld", (long *) &bktIdx,
-                                      (long *) &bktSz, (long *) &bktNum,
-                                      (long *) &bktSetSize, (long *) &bktRelThr, 
-                                      (long *) &bktAqurThr);
-                        /* Klock work fix ccpu00148484 */
-                        if(bktIdx < SS_MAX_POOLS_PER_REG)
-                        {
-                           mtGlobMemoCfg.bkt[bktIdx].blkSize = bktSz;
-                           mtGlobMemoCfg.bkt[bktIdx].numBlks = bktNum;
-                           mtGlobMemoCfg.bkt[bktIdx].bucketSetSize = bktSetSize;
+                       {
+                          mtDynMemoCfg.region[idx].regionId = idx;
+                          mtDynMemoCfg.region[idx].numBkts = numBkts;
+                       }
+
+                    bktUpdtCnt = 0;
+                    i++;
+                    break;
+
+                 case 7:
+                    if(bktUpdtCnt < numBkts)
+                    {
+                       sscanf(line, "%ld %ld %ld %ld %ld %ld", (long *) &bktIdx,
+                             (long *) &bktSz, (long *) &bktNum,
+                             (long *) &bktSetSize, (long *) &bktRelThr, 
+                             (long *) &bktAqurThr);
+                       /* Klock work fix ccpu00148484 */
+                       if(bktIdx < SS_MAX_POOLS_PER_REG)
+                       {
+                          mtGlobMemoCfg.bkt[bktIdx].blkSize = bktSz;
+                          mtGlobMemoCfg.bkt[bktIdx].numBlks = bktNum;
+                          mtGlobMemoCfg.bkt[bktIdx].bucketSetSize = bktSetSize;
 #ifdef XEON_SPECIFIC_CHANGES
-                           CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSize %d numBlks %d bucketSetSize %d\n",
-                                 bktUpdtCnt, mtGlobMemoCfg.bkt[bktIdx].blkSize,
-                                 mtGlobMemoCfg.bkt[bktIdx].numBlks, mtGlobMemoCfg.bkt[bktIdx].bucketSetSize); 
+                          CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSize %d numBlks %d bucketSetSize %d\n",
+                                bktUpdtCnt, mtGlobMemoCfg.bkt[bktIdx].blkSize,
+                                mtGlobMemoCfg.bkt[bktIdx].numBlks, mtGlobMemoCfg.bkt[bktIdx].bucketSetSize); 
 
-                        if(bktIdx >= SS_MAX_POOLS_PER_REG)
-                        {
-                           printf("\nNo. of Buckets/pools are > SS_MAX_POOLS_PER_REG:%d\n",SS_MAX_POOLS_PER_REG);
-                           error = TRUE;
-                           break;
-                        }
+                          if(bktIdx >= SS_MAX_POOLS_PER_REG)
+                          {
+                             printf("\nNo. of Buckets/pools are > SS_MAX_POOLS_PER_REG:%d\n",SS_MAX_POOLS_PER_REG);
+                             error = TRUE;
+                             break;
+                          }
 
 #endif                           
-                        for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
-                        {
-                           mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold = bktRelThr;
-                           mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold = bktAqurThr;
+                          for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
+                          {
+                             mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold = bktRelThr;
+                             mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold = bktAqurThr;
 #ifdef XEON_SPECIFIC_CHANGES
-                           CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSetRelThreshold %d blkSetAcquireThreshold %d\n",
-                                 bktUpdtCnt, mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold,
-                                 mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold);
+                             CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSetRelThreshold %d blkSetAcquireThreshold %d\n",
+                                   bktUpdtCnt, mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold,
+                                   mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold);
 #endif                           
-                        } 
-                        }
-                        bktUpdtCnt++;
-                     }
+                          
+                       }
+                       bktUpdtCnt++;
+                    }
 #ifdef XEON_SPECIFIC_CHANGES
-                     if(bktUpdtCnt == numBkts)
-                     {   
-                        i=8;
-                     }
-                     break;
-
-                     case 8: /* INPUT: Global Heapsize ***/
-                     sscanf(line, "%ld", (long *) &heapSz);
-                     mtGlobMemoCfg.heapSize = heapSz;
-                     CM_LOG_DEBUG(CM_LOG_ID_MT, "Global Heap size = %d\n", mtGlobMemoCfg.heapSize);
+                    if(bktUpdtCnt == numBkts)
+                    {   
+                       i=8;
+                    }
+                    break;
+
+                 case 8: /* INPUT: Global Heapsize ***/
+                    sscanf(line, "%ld", (long *) &heapSz);
+                    mtGlobMemoCfg.heapSize = heapSz;
+                    CM_LOG_DEBUG(CM_LOG_ID_MT, "Global Heap size = %d\n", mtGlobMemoCfg.heapSize);
 #endif                           
-                     break;
+                    break;
 #endif
-               }
-            }
-            if(error == TRUE)
-            {
-               memConfigured = FALSE;
-            }
-            else
-            {
-               memConfigured = TRUE;
-            }
-            fclose (memOpt);
-            break;
+              }
+           }
+           if(error == TRUE)
+           {
+              memConfigured = FALSE;
+           }
+           else
+           {
+              memConfigured = TRUE;
+           }
+           fclose (memOpt);
+           break;
 #endif
 
 
-         case 's':
-/* mt028.201: modification: multiple procs support related changes */
+        case 's':
+           /* mt028.201: modification: multiple procs support related changes */
 #ifndef SS_MULTIPLE_PROCS
 
 #ifdef ENB_RELAY
-            osCp.procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
+           osCp.procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
 #else
-            osCp.procId = (ProcId) strtol(msOptArg, NULLP, 0);
+           osCp.procId = (ProcId) strtol(msOptArg, NULLP, 0);
 #endif
 
 #else /* SS_MULTIPLE_PROCS */
-        {
-           ProcId procId;
+           {
+              ProcId procId;
 #ifdef ENB_RELAY
-            procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
+              procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
 #else
-            procId = (ProcId) strtol(msOptArg, NULLP, 0);
+              procId = (ProcId) strtol(msOptArg, NULLP, 0);
 #endif
-           SAddProcIdLst(1, &procId);
-        }
+              SAddProcIdLst(1, &procId);
+           }
 
 #endif /* SS_MULTIPLE_PROCS */
-            break;
+           break;
 
-         case 'c':
-            osCp.configFilePath = msOptArg;
-            break;
+        case 'c':
+           osCp.configFilePath = msOptArg;
+           break;
 
-         case '?':
-            /* fall through */
+        case '?':
+           /* fall through */
 
 
-         default:
-            break;
+        default:
+           break;
       }
    }
 
    msOptInd = 1;
 
 
-   RETVOID;
+   return;
 }
 #endif
 
 \f
 /*
-*
-*       Fun:   SGetOpt
-*
-*       Desc:  Get options from command line
-*
-*       Ret:   option  - success
-*              '?'     - fail
-*              EOF     - end of options
-*
-*       Notes: Handles command lines like the following
-*
-*              if opts = "abc:d"
-*                 then command line should look like this...
-*                    -a foo -b foo1 -c -d foo
-*
-*              code usage:
-*
-*              while ((ret = SGetOpt(msArgc, msArgv, "ls")) != EOF )
-*              {
-*                 switch(ret)
-*                 {
-*                    case 'l':
-*                       nloops = atoi(msArgv[msOptInd]);
-*                       break;
-*                    case 's':
-*                       state1 = atoi(msArgv[msOptInd]);
-*                    case '?':
-*                    default:
-*                       break;
-*                 }
-*              }
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetOpt
+ *
+ *       Fun:   SGetOpt
+ *
+ *       Desc:  Get options from command line
+ *
+ *       Ret:   option  - success
+ *              '?'     - fail
+ *              EOF     - end of options
+ *
+ *       Notes: Handles command lines like the following
+ *
+ *              if opts = "abc:d"
+ *                 then command line should look like this...
+ *                    -a foo -b foo1 -c -d foo
+ *
+ *              code usage:
+ *
+ *              while ((ret = SGetOpt(msArgc, msArgv, "ls")) != EOF )
+ *              {
+ *                 switch(ret)
+ *                 {
+ *                    case 'l':
+ *                       nloops = atoi(msArgv[msOptInd]);
+ *                       break;
+ *                    case 's':
+ *                       state1 = atoi(msArgv[msOptInd]);
+ *                    case '?':
+ *                    default:
+ *                       break;
+ *                 }
+ *              }
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetOpt
 (
-int argc,                   /* argument count */
-char **argv,                /* argument value */
-char *opts                  /* options */
-)
-#else
-PUBLIC S16 SGetOpt(argc, argv, opts)
-int argc;                   /* argument count */
-char **argv;                /* argument value */
-char *opts;                 /* options */
-#endif
+ int argc,                   /* argument count */
+ char **argv,                /* argument value */
+ char *opts                  /* options */
+ )
 {
    /* mt020.201 - Removed for no command line */
 #ifndef NOCMDLINE
@@ -3348,7 +3325,6 @@ char *opts;                 /* options */
    S8 *cp;
 #endif
 
-   TRC1(SGetOpt);
 
    /* mt020.201 - Addition for no command line */
 #ifdef NOCMDLINE
@@ -3356,29 +3332,29 @@ char *opts;                 /* options */
    UNUSED(argv);
    UNUSED(opts);
 
-   RETVALUE(EOF);
+   return (EOF);
 #else
 
    sp = 1;
    if (sp == 1)
    {
-       /*mt013.301 : Changes as per coding standards*/
+      /*mt013.301 : Changes as per coding standards*/
       if (msOptInd >= (S16) argc  ||  argv[msOptInd][0] == '\0')
       {
-          RETVALUE(EOF);
+        return (EOF);
       }
       else
       {
-         if (!strcmp(argv[msOptInd], "--"))
-         {
-            msOptInd++;
-            RETVALUE(EOF);
-         }
-         else if (argv[msOptInd][0] != '-')
-         {
-            msOptInd++;
-            RETVALUE('?');
-         }
+        if (!strcmp(argv[msOptInd], "--"))
+        {
+           msOptInd++;
+           return (EOF);
+        }
+        else if (argv[msOptInd][0] != '-')
+        {
+           msOptInd++;
+           return ('?');
+        }
       }
    }
 
@@ -3387,11 +3363,11 @@ char *opts;                 /* options */
    {
       if (argv[msOptInd][++sp] == '\0')
       {
-         msOptInd++;
-         sp = 1;
+        msOptInd++;
+        sp = 1;
       }
 
-      RETVALUE('?');
+      return ('?');
    }
 
    if (*++cp == ':')
@@ -3399,62 +3375,54 @@ char *opts;                 /* options */
       if (argv[msOptInd][sp+1] != '\0') msOptArg = &argv[msOptInd++][sp+1];
       else
       {
-         if (++msOptInd >= (S16) argc)
-         {
-            sp = 1;
-            RETVALUE('?');
-         }
-         else msOptArg = argv[msOptInd++];
+        if (++msOptInd >= (S16) argc)
+        {
+           sp = 1;
+           return ('?');
+        }
+        else msOptArg = argv[msOptInd++];
 
-         sp = 1;
+        sp = 1;
       }
    }
    else
    {
       if (argv[msOptInd][++sp] == '\0')
       {
-         sp = 1;
-         msOptInd++;
+        sp = 1;
+        msOptInd++;
       }
 
       msOptArg = NULLP;
    }
 
 
-   RETVALUE(c);
+   return (c);
 
 #endif /* NOCMDLINE */
 }
 
 \f
 /*
-*
-*       Fun:   ssdStart
-*
-*       Desc:  This function starts system services execution; the
-*              permanent tasks are started and the system enters a
-*              ready state.
-*
-*       Ret:   Void
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdStart
-(
-void
-)
-#else
-PUBLIC Void ssdStart()
-#endif
+ *
+ *       Fun:   ssdStart
+ *
+ *       Desc:  This function starts system services execution; the
+ *              permanent tasks are started and the system enters a
+ *              ready state.
+ *
+ *       Ret:   Void
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void ssdStart(void)
 {
    S16 i;
 
 
-   TRC0(ssdStart);
 
 
    /* mt025.201 - Modification for adding lock to timer handler */
@@ -3464,47 +3432,38 @@ PUBLIC Void ssdStart()
    }
 
 
-   RETVOID;
+   return;
 }
 
 \f
 /*
-*     indirect interface functions to system services service user
-*/
+ *     indirect interface functions to system services service user
+ */
 
 \f
 /*
-*
-*       Fun:   ssdAttachTTsk
-*
-*       Desc:  This function sends the initial tick message to a TAPA
-*              task if the task is a permanent task.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdAttachTTsk
+ *
+ *       Fun:   ssdAttachTTsk
+ *
+ *       Desc:  This function sends the initial tick message to a TAPA
+ *              task if the task is a permanent task.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdAttachTTsk
 (
-SsTTskEntry *tTsk           /* pointer to TAPA task entry */
-)
-#else
-PUBLIC S16 ssdAttachTTsk(tTsk)
-SsTTskEntry *tTsk;          /* pointer to TAPA task entry */
-#endif
+ SsTTskEntry *tTsk           /* pointer to TAPA task entry */
+ )
 {
    Buffer *mBuf;
    SsMsgInfo *mInfo;
    S16 ret;
 
-
-   TRC0(ssdAttachTTsk);
-
-
    if (tTsk->tskType == SS_TSK_PERMANENT)
    {
       /* Send a permanent tick message to this task, to start
@@ -3514,16 +3473,16 @@ SsTTskEntry *tTsk;          /* pointer to TAPA task entry */
       if (ret != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-         MTLOGERROR(ERRCLS_DEBUG, EMT001, ret, "SGetMsg() failed");
+        MTLOGERROR(ERRCLS_DEBUG, EMT001, ret, "SGetMsg() failed");
 #endif
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
 
       mInfo = (SsMsgInfo *)mBuf->b_rptr;
       mInfo->eventInfo.event = SS_EVNT_PERMTICK;
 
       /* set up post structure */
-/* mt028.201: modification: multiple procs support related changes */
+      /* mt028.201: modification: multiple procs support related changes */
 #ifndef SS_MULTIPLE_PROCS
       mInfo->pst.dstProcId = SFndProcId();
       mInfo->pst.srcProcId = SFndProcId();
@@ -3543,107 +3502,95 @@ SsTTskEntry *tTsk;          /* pointer to TAPA task entry */
       mInfo->pst.srcInst   = tTsk->inst;
 
       ret = ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
-                           (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR3);
+           (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR3);
 
       if (ret != ROK)
       {
-         SPutMsg(mBuf);
+        SPutMsg(mBuf);
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-         MTLOGERROR(ERRCLS_DEBUG, EMT002, ret,
-                        "Could not write to demand queue");
+        MTLOGERROR(ERRCLS_DEBUG, EMT002, ret,
+              "Could not write to demand queue");
 #endif
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
    }
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   ssdDetachTTsk
-*
-*       Desc:  Does nothing.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdDetachTTsk
+ *
+ *       Fun:   ssdDetachTTsk
+ *
+ *       Desc:  Does nothing.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdDetachTTsk
 (
-SsTTskEntry *tTsk           /* pointer to TAPA task entry */
-)
-#else
-PUBLIC S16 ssdDetachTTsk(tTsk)
-SsTTskEntry *tTsk;          /* pointer to TAPA task entry */
-#endif
+ SsTTskEntry *tTsk           /* pointer to TAPA task entry */
+ )
 {
-   TRC0(ssdDetachTTsk);
-
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   ssdCreateSTsk
-*
-*       Desc:  This function creates a system task. A thread is started
-*              on the system task handler function defined later.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdCreateSTsk
+ *
+ *       Fun:   ssdCreateSTsk
+ *
+ *       Desc:  This function creates a system task. A thread is started
+ *              on the system task handler function defined later.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdCreateSTsk
 (
-SsSTskEntry *sTsk           /* pointer to system task entry */
-)
-#else
-PUBLIC S16 ssdCreateSTsk(sTsk)
-SsSTskEntry *sTsk;          /* pointer to system task entry */
-#endif
+ SsSTskEntry *sTsk           /* pointer to system task entry */
+ )
 {
+   S16  ret;
    pthread_attr_t attr;
    /* struct sched_param param_sched;*/
 
 #ifdef SS_THR_REG_MAP
-   U32 threadCreated = FALSE;
+   uint32_t threadCreated = FALSE;
 #endif
 
-   TRC0(ssdCreateSTsk);
 
 
 #ifdef SS_SINGLE_THREADED
-/* mt001.301 : Additions */
+   /* mt001.301 : Additions */
 #ifndef SS_WATCHDOG
 #ifdef SS_MULTICORE_SUPPORT
    if (osCp.numSTsks > 1)
 #else
-   if (osCp.numSTsks > 0)
+      if (osCp.numSTsks > 0)
 #endif /* SS_MULTICORE_SUPPORT */
 #else
 #ifdef SS_MULTICORE_SUPPORT
-   if (osCp.numSTsks > 3)
+        if (osCp.numSTsks > 3)
 #else
-   if (osCp.numSTsks > 2)
+           if (osCp.numSTsks > 2)
 #endif /* SS_MULTICORE_SUPPORT */
 #endif /* SS_WATCHDOG */
-   {
-      RETVALUE(ROK);
-   }
+           {
+              return ROK;
+           }
 #endif
 
 
@@ -3658,11 +3605,11 @@ SsSTskEntry *sTsk;          /* pointer to system task entry */
    pthread_attr_init(&attr);
    ssdSetPthreadAttr(sTsk->tskPrior, &attr);
 
-   printf("Creating thread here %s %d\n", __FILE__, __LINE__);
+   printf("\nCreating thread here %s %d\n", __FILE__, __LINE__);
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
    if (sTsk->tskPrior == 0)
    {
-      printf("Creating RT thread #######################\n");
+      printf("\nCreating RT thread #######################\n");
 #ifdef SS_THR_REG_MAP
       /* When the thread is created, we check for the memory mapping table if
        * threadId can be placed in thread memory map table. If it is not able to place
@@ -3673,20 +3620,21 @@ SsSTskEntry *sTsk;          /* pointer to system task entry */
       while(threadCreated == FALSE)
       {
 #endif
-         if ((pthread_create(&sTsk->dep.tId, &attr, mtTskHdlrT2kL2, (Ptr)sTsk)) != 0)
-         {
-
-            pthread_attr_destroy(&attr);
+        ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk);
+        if (ret != 0)
+        {
+           DU_LOG("\nDU APP : Failed to create thread. Cause[%d]",ret);
+           pthread_attr_destroy(&attr);
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-            MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
+           MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
 #endif
 
-            RETVALUE(RFAILED);
-         }
+           return RFAILED;
+        }
 #ifdef SS_THR_REG_MAP
-         threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId, 
-                                                      sTsk->region);
+        threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId, 
+              sTsk->region);
       }
 #endif
    }
@@ -3703,74 +3651,66 @@ SsSTskEntry *sTsk;          /* pointer to system task entry */
       while(threadCreated == FALSE)
       {
 #endif
-         if ((pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk)) != 0)
-         {
+        ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk);
+        if (ret != 0)
+        {
 
-            /* mt020.201 - Addition for destroying thread attribute object attr */
-            pthread_attr_destroy(&attr);
+           /* mt020.201 - Addition for destroying thread attribute object attr */
+           pthread_attr_destroy(&attr);
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-            MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
+           MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
 #endif
 
-            RETVALUE(RFAILED);
-         }
+           return RFAILED;
+        }
 #ifdef SS_THR_REG_MAP
-         threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId, 
-                                                      sTsk->region);
+        threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId, 
+              sTsk->region);
       }
 #endif
    }
 
 
-/*mt013.301 :Added SS_AFFINITY_SUPPORT  */
+   /*mt013.301 :Added SS_AFFINITY_SUPPORT  */
 #if defined(SS_MULTICORE_SUPPORT) ||defined(SS_AFFINITY_SUPPORT)
    {
-     static U32 stLwpId = 3;
-     sTsk->dep.lwpId = ++stLwpId;
+      static uint32_t stLwpId = 3;
+      sTsk->dep.lwpId = ++stLwpId;
    }
 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */
 
    /* mt020.201 - Addition for destroying thread attribute object attr */
    pthread_attr_destroy(&attr);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
-#ifdef ANSI
-PUBLIC int SCreatePThread
+   int SCreatePThread
 (
-pthread_t* tid,
-pthread_attr_t* attr,
-void *(*start_routine) (void *),
-void* arg
-)
-#else
-PUBLIC int SCreatePThread(tid, attr, start_routine, arg)
-pthread_t* tid;
-pthread_attr_t* attr;
-void *(*start_routine) (void *);
-void* arg;
-#endif
+ pthread_t* tid,
+ pthread_attr_t* attr,
+ void *(*start_routine) (void *),
+ void* arg
+ )
 {
    int retVal = 0;
 #ifdef SS_THR_REG_MAP
-   U32 threadCreated = FALSE;
+   uint32_t threadCreated = FALSE;
 #endif
 
    SPThreadCreateArg* threadArg = (SPThreadCreateArg*)malloc(sizeof(SPThreadCreateArg));
    /* Klock work fix ccpu00148484 */
    if(threadArg == NULLP)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    threadArg->argument = arg;
    threadArg->start_routine = start_routine;
-   
-   TRC0(SCreatePThread);
 
-   printf("Creating thread here %s %d\n", __FILE__, __LINE__);
+
+   printf("\nCreating thread here %s %d\n", __FILE__, __LINE__);
    {
 #ifdef SS_THR_REG_MAP
       /* When the thread is created, we check for the memory mapping table if
@@ -3782,52 +3722,45 @@ void* arg;
       while(threadCreated == FALSE)
       {
 #endif
-         /*pthreadCreateHdlr */
-         if (((retVal = pthread_create(tid, attr, pthreadCreateHdlr, threadArg))) != 0)
-         {
+        /*pthreadCreateHdlr */
+        if (((retVal = pthread_create(tid, attr, pthreadCreateHdlr, threadArg))) != 0)
+        {
 
-            RETVALUE(retVal);
-         }
+           return (retVal);
+        }
 #ifdef SS_THR_REG_MAP
-         threadCreated = ssCheckAndAddMemoryRegionMap(*tid, SS_MAX_REGS - 1);
+        threadCreated = ssCheckAndAddMemoryRegionMap(*tid, SS_MAX_REGS - 1);
       }
 #endif
    }
 
-   RETVALUE(retVal);
+   return (retVal);
 }
 
 
 /*
-*
-*       Fun:   Set Pthread Attributes
-*
-*       Desc:  This function is used to set various explicit
-*              pthread attributes like, priority scheduling,etc
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-
-#ifdef ANSI
-PRIVATE S16 ssdSetPthreadAttr
+ *
+ *       Fun:   Set Pthread Attributes
+ *
+ *       Desc:  This function is used to set various explicit
+ *              pthread attributes like, priority scheduling,etc
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+
+   static S16 ssdSetPthreadAttr
 (
-S32              tskPrior,
-pthread_attr_t  *attr
-)
-#else
-PRIVATE S16 ssdSetPthreadAttr(sTsk, attr)
-S32               tskPrior,
-pthread_attr_t   *attr
-#endif
+ S32              tskPrior,
+ pthread_attr_t  *attr
+ )
 {
    struct sched_param    param;
 
-   TRC0 (ssdSetPthreadAttr)
 
    SMemSet(&param, 0, sizeof(param));
 
@@ -3841,18 +3774,18 @@ pthread_attr_t   *attr
    /* TODO:: This can be avoided by reducing the priority
     * of iccserv thread in l1_master.sh*/
 #ifdef L2_L3_SPLIT
-         if (clusterMode == RADIO_CLUSTER_MODE)
-         {
-            if(tskPrior == PRIOR1)
-            {/* DL RLC */
-               param.sched_priority = 91;
-            }
-         }
+   if (clusterMode == RADIO_CLUSTER_MODE)
+   {
+      if(tskPrior == PRIOR1)
+      {/* DL RLC */
+        param.sched_priority = 91;
+      }
+   }
 
 #endif
 #endif
 
-   printf("Set priority %u\n", param.sched_priority);
+   printf("\nSet priority %u\n", param.sched_priority);
 
    /* Set Scheduler to explicit, without this non of the below
       pthread attr works */
@@ -3868,7 +3801,7 @@ pthread_attr_t   *attr
 #endif
    pthread_attr_setschedparam(attr, &param);
 
-   RETVALUE (ROK);
+   return  (ROK);
 
 } /* ssdSetPthreadAttr */
 
@@ -3877,63 +3810,56 @@ pthread_attr_t   *attr
 #if defined(SS_MULTICORE_SUPPORT) ||defined(SS_AFFINITY_SUPPORT)
 
 /*
-*
-*       Fun:   Get the current core/cpu affinity for a thread/lwp
-*
-*       Desc:  This function is used to get the current processor/core
-*              affinity for a a system task (thread/lwp). It sets the
-*              affinity based on the mode supplied by the caller.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - failed, general (optional)
-*
-*       Notes:
-*
-*       File:  ss_task.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdGetAffinity
+ *
+ *       Fun:   Get the current core/cpu affinity for a thread/lwp
+ *
+ *       Desc:  This function is used to get the current processor/core
+ *              affinity for a a system task (thread/lwp). It sets the
+ *              affinity based on the mode supplied by the caller.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - failed, general (optional)
+ *
+ *       Notes:
+ *
+ *       File:  ss_task.c
+ *
+ */
+   S16 ssdGetAffinity
 (
-SSTskId *tskId,                  /* filled in with system task ID */
-U32 *coreId                      /* the core/processor id to which the affinity is set */
-)
-#else
-PUBLIC S16 ssdGetAffinity(tskId, coreId)
-SSTskId *tskId;                 /* filled in with system task ID */
-U32 *coreId;                    /* the core/processor id to which the affinity is set */
-#endif
+ SSTskId *tskId,                  /* filled in with system task ID */
+ uint32_t *coreId                      /* the core/processor id to which the affinity is set */
+ )
 {
 
-   U32 tskInd;
+   uint32_t tskInd;
 
 #ifdef SS_LINUX
 
    pthread_t tId =0;
    cpu_set_t cpuSet;
-   U32 cpuInd = 0;
+   uint32_t cpuInd = 0;
    /*mt013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
 #else
 #ifdef SUNOS
-   U32 lwpId = *tskId;
+   uint32_t lwpId = *tskId;
 #endif /*SUNOS*/
 #endif /*SS_LINUX*/
-   TRC0(ssdGetAffinity);
 #ifdef SS_LINUX
    for (tskInd = 0;  tskInd < SS_MAX_STSKS;  tskInd++)
    {
       if (osCp.sTskTbl[tskInd].tskId == *tskId)
       {
-         tId = osCp.sTskTbl[tskInd].dep.tId;
-         break;
+        tId = osCp.sTskTbl[tskInd].dep.tId;
+        break;
       } /* end if */
    } /* end for */
 
    /* if tskId is not found in the tskTbl */
    if (tskInd == SS_MAX_STSKS)
    {
-       MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
-       RETVALUE(RFAILED);
+      MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
+      return RFAILED;
    }
 
 
@@ -3941,21 +3867,21 @@ U32 *coreId;                    /* the core/processor id to which the affinity i
    CPU_ZERO( &cpuSet);
 
    /* set thread affinity for linux */
-    if (pthread_getaffinity_np(tId, sizeof(cpuSet), &cpuSet) < 0)
-    {
+   if (pthread_getaffinity_np(tId, sizeof(cpuSet), &cpuSet) < 0)
+   {
 #if (ERRCLASS & ERRCLS_DEBUG)
-        MTLOGERROR(ERRCLS_DEBUG, EMT037, ERRZERO, "Could not get thread affinity\n");
+      MTLOGERROR(ERRCLS_DEBUG, EMT037, ERRZERO, "Could not get thread affinity\n");
 #endif
-       RETVALUE(RFAILED);
-    } /* end if pthread_setaffinity fails */
+      return RFAILED;
+   } /* end if pthread_setaffinity fails */
 
    for (cpuInd = 0; cpuInd <CPU_SETSIZE; cpuInd++)
    {
-       if (CPU_ISSET (cpuInd, & cpuSet))
-       {
-           *coreId = cpuInd;
-           break;
-       } /* end if */
+      if (CPU_ISSET (cpuInd, & cpuSet))
+      {
+        *coreId = cpuInd;
+        break;
+      } /* end if */
    } /* end for */
 
 #else
@@ -3964,16 +3890,16 @@ U32 *coreId;                    /* the core/processor id to which the affinity i
    {
       if (osCp.sTskTbl[tskInd].tskId == *tskId)
       {
-         lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
-         break;
+        lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
+        break;
       } /* end if */
    } /* end for */
 
    /* if tskId is not found in the tskTbl */
    if (tskInd == SS_MAX_STSKS)
    {
-       MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
-       RETVALUE(RFAILED);
+      MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
+      return RFAILED;
    }
 
    /* set thread affinity for Solaris */
@@ -3982,47 +3908,41 @@ U32 *coreId;                    /* the core/processor id to which the affinity i
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT037, ERRZERO, "Could not get thread affinity\n");
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    } /* end if processor_bind fails */
 
 #endif /* SUNOS */
 #endif /* SS_LINUX */
 
-   RETVALUE(ROK);
+   return ROK;
 
 } /* ssdGetAffinity */
 
 
 /*
-*
-*       Fun:   Set the core/cpu affinity for a thread/lwp
-*
-*       Desc:  This function is used to set processor/core affinity for a
-*              a system task (thread/lwp). It sets the affinity based on the
-*              mode supplied by the caller.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - failed, general (optional)
-*
-*       Notes:
-*
-*       File:  ss_task.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdSetAffinity
+ *
+ *       Fun:   Set the core/cpu affinity for a thread/lwp
+ *
+ *       Desc:  This function is used to set processor/core affinity for a
+ *              a system task (thread/lwp). It sets the affinity based on the
+ *              mode supplied by the caller.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - failed, general (optional)
+ *
+ *       Notes:
+ *
+ *       File:  ss_task.c
+ *
+ */
+   S16 ssdSetAffinity
 (
-SSTskId *tskId,                  /* filled in with system task ID */
-U32 coreId                       /* the core/processor id to which the affinity has to be set */
-)
-#else
-PUBLIC S16 ssdSetAffinity(tskId, coreId)
-SSTskId *tskId;                 /* filled in with system task ID */
-U32 coreId;                     /* the core/processor id to which the affinity has to be set */
-#endif
+ SSTskId *tskId,                  /* filled in with system task ID */
+ uint32_t coreId                       /* the core/processor id to which the affinity has to be set */
+ )
 {
 
-   U32 tskInd = 0;
+   uint32_t tskInd = 0;
 #ifdef SS_LINUX
 
    pthread_t tId = 0;
@@ -4030,30 +3950,29 @@ U32 coreId;                     /* the core/processor id to which the affinity h
    /*mt013.301 :Fix for TRACE5 feature crash due to missing TRC MACRO*/
 #else
 #ifdef SUNOS
-   U32 lwpId = *tskId;
+   uint32_t lwpId = *tskId;
 #endif /*SUNOS*/
 #endif /*SS_LINUX*/
 
-   TRC0(ssdSetAffinity)
 
 #ifdef SS_LINUX
    for (tskInd = 0;  tskInd < SS_MAX_STSKS;  tskInd++)
    {
-   /* Here tskId can not be used as index as the task may be terminated if
-      there is a TERM even for that tsk, thus breaking the task Id numbering
-      sequence  */
+      /* Here tskId can not be used as index as the task may be terminated if
+        there is a TERM even for that tsk, thus breaking the task Id numbering
+        sequence  */
       if (osCp.sTskTbl[tskInd].tskId == *tskId)
       {
-         tId = osCp.sTskTbl[tskInd].dep.tId;
-         break;
+        tId = osCp.sTskTbl[tskInd].dep.tId;
+        break;
       } /* end if */
    } /* end for */
 
    /* if tskId is not found in the tskTbl */
    if (tskInd == SS_MAX_STSKS)
    {
-       MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
-       RETVALUE(RFAILED);
+      MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
+      return RFAILED;
    }
 
    /* initialize the cpu mask */
@@ -4068,7 +3987,7 @@ U32 coreId;                     /* the core/processor id to which the affinity h
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT038, ERRZERO, "Could not set thread affinity\n");
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    } /* end if pthread_setaffinity fails */
 
 #else
@@ -4078,8 +3997,8 @@ U32 coreId;                     /* the core/processor id to which the affinity h
       /* comment: modify to use tskId as lwpId to avoid the loop and the new lwpId variable  in dep */
       if (osCp.sTskTbl[tskInd].tskId == *tskId)
       {
-         lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
-         break;
+        lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
+        break;
       } /* end if */
    } /* end for */
 
@@ -4087,7 +4006,7 @@ U32 coreId;                     /* the core/processor id to which the affinity h
    if (tskInd == SS_MAX_STSKS)
    {
       MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    /* set thread affinity for Solaris */
@@ -4096,12 +4015,12 @@ U32 coreId;                     /* the core/processor id to which the affinity h
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT038, ERRZERO, "Could not set thread affinity\n");
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    } /* end if processor_bind fails */
 
 #endif /* SUNOS */
 #endif /* SS_LINUX */
-   RETVALUE(ROK);
+   return ROK;
 } /* ssdSetAffinity */
 
 #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */
@@ -4109,34 +4028,28 @@ U32 coreId;                     /* the core/processor id to which the affinity h
 
 \f
 /*
-*
-*       Fun:   ssdDestroySTsk
-*
-*       Desc:  This function destroys a system task. A terminate
-*              event message is sent to the thread function.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdDestroySTsk
+ *
+ *       Fun:   ssdDestroySTsk
+ *
+ *       Desc:  This function destroys a system task. A terminate
+ *              event message is sent to the thread function.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdDestroySTsk
 (
-SsSTskEntry *sTsk           /* pointer to system task entry */
-)
-#else
-PUBLIC S16 ssdDestroySTsk(sTsk)
-SsSTskEntry *sTsk;          /* pointer to system task entry */
-#endif
+ SsSTskEntry *sTsk           /* pointer to system task entry */
+ )
 {
    Buffer *mBuf;
    SsMsgInfo *mInfo;
 
 
-   TRC0(ssdDestroySTsk);
 
 
    /* we send a message to this system task to tell it to die */
@@ -4147,7 +4060,7 @@ SsSTskEntry *sTsk;          /* pointer to system task entry */
       MTLOGERROR(ERRCLS_DEBUG, EMT005, ERRZERO, "Could not get a message");
 #endif
 
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
    mInfo = (SsMsgInfo *)mBuf->b_rptr;
@@ -4159,45 +4072,37 @@ SsSTskEntry *sTsk;          /* pointer to system task entry */
 
 #if (ERRCLASS & ERRCLASS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT006, ERRZERO,
-                     "Could not write to demand queue");
+           "Could not write to demand queue");
 #endif
 
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /* mt023.201 - Added SThreadYield function to yield CPU
-*
-*       Fun:   SThreadYield
-*
-*       Desc:  This function defers thread execution to any other ready
-*              thread.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - failure
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SThreadYield
-(
-void
-)
-#else
-PUBLIC S16 SThreadYield()
-#endif
+ *
+ *       Fun:   SThreadYield
+ *
+ *       Desc:  This function defers thread execution to any other ready
+ *              thread.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - failure
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SThreadYield(void)
 {
 
-   TRC0(SThreadYield);
 
-/* mt024.201 - seperated Linux and other UNIX implementations
- */
+   /* mt024.201 - seperated Linux and other UNIX implementations
   */
 #ifdef SS_LINUX
    {
       struct timeval tw;
@@ -4206,11 +4111,11 @@ PUBLIC S16 SThreadYield()
       tw.tv_sec=0;
       tw.tv_usec=0;
 
-      RETVALUE(select(0,0,0,0,&tw) == 0 ? ROK : RFAILED);
+      return (select(0,0,0,0,&tw) == 0 ? ROK : RFAILED);
    }
 #else /* other UNICes */
 
-   RETVALUE(sleep(0) == 0 ? ROK : RFAILED);
+   return (sleep(0) == 0 ? ROK : RFAILED);
 
 #endif /* SS_LINUX */
 
@@ -4218,38 +4123,32 @@ PUBLIC S16 SThreadYield()
 
 \f
 /*
-*
-*       Fun:   Register timer
-*
-*       Desc:  This function is used to register a timer
-*              function for the service user. System services
-*              will invoke the timer activation function
-*              passed to it at the specified intervals.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Timing is handled by the common timers. The
-*              ticks are handled by a thread that uses
-*              nanosleep() and thus timing precision will not
-*              be very accurate.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdRegTmr
+ *
+ *       Fun:   Register timer
+ *
+ *       Desc:  This function is used to register a timer
+ *              function for the service user. System services
+ *              will invoke the timer activation function
+ *              passed to it at the specified intervals.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Timing is handled by the common timers. The
+ *              ticks are handled by a thread that uses
+ *              nanosleep() and thus timing precision will not
+ *              be very accurate.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdRegTmr
 (
-SsTmrEntry *tmr             /* pointer to timer entry */
-)
-#else
-PUBLIC S16 ssdRegTmr(tmr)
-SsTmrEntry *tmr;            /* pointer to timer entry */
-#endif
+ SsTmrEntry *tmr             /* pointer to timer entry */
+ )
 {
    CmTmrArg arg;
 
 
-   TRC0(ssdRegTmr);
 
 
    /* initialize common timers */
@@ -4269,37 +4168,31 @@ SsTmrEntry *tmr;            /* pointer to timer entry */
    cmPlcCbTq(&arg);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Deregister timer
-*
-*       Desc:  This function is used to deregister a timer function.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdDeregTmr
+ *
+ *       Fun:   Deregister timer
+ *
+ *       Desc:  This function is used to deregister a timer function.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdDeregTmr
 (
-SsTmrEntry *tmr             /* pointer to timer entry */
-)
-#else
-PUBLIC S16 ssdDeregTmr(tmr)
-SsTmrEntry *tmr;            /* pointer to timer entry */
-#endif
+ SsTmrEntry *tmr             /* pointer to timer entry */
+ )
 {
    CmTmrArg arg;
 
 
-   TRC0(ssdDeregTmr);
 
 
    /* stop the timer */
@@ -4315,41 +4208,34 @@ SsTmrEntry *tmr;            /* pointer to timer entry */
    cmRmvCbTq(&arg);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Critical error
-*
-*       Desc:  This function is called when a critical error occurs.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdError
+ *
+ *       Fun:   Critical error
+ *
+ *       Desc:  This function is called when a critical error occurs.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdError
 (
-Seq seq,                    /* sequence number */
-Reason reason               /* reset reason */
-)
-#else
-PUBLIC S16 ssdError(seq, reason)
-Seq seq;                    /* sequence number */
-Reason reason;              /* reset reason */
-#endif
+ Seq seq,                    /* sequence number */
+ Reason reason               /* reset reason */
+ )
 {
    S16 i;
    pthread_t tId;
    Txt errBuf[256];
 
 
-   TRC0(ssdError);
 
 
    /* get calling task ID */
@@ -4358,7 +4244,7 @@ Reason reason;              /* reset reason */
 
    /* set up the message to display */
    sprintf(errBuf, "\n\nFATAL ERROR - taskid = %x, errno = %d,"
-            "reason = %d\n\n", (U8)tId, seq, reason);
+        "reason = %d\n\n", (uint8_t)tId, seq, reason);
    SPrint(errBuf);
 
 
@@ -4366,9 +4252,9 @@ Reason reason;              /* reset reason */
    for (i = 0;  i < SS_MAX_STSKS;  i++)
    {
       if (osCp.sTskTbl[i].used
-            &&  !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
+           &&  !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
       {
-         pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
+        pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
       }
    }
 
@@ -4378,49 +4264,35 @@ Reason reason;              /* reset reason */
 
 
    /* won't reach here */
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Log error
-*
-*       Desc:  This function is called to log an error.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void ssdLogError
+ *
+ *       Fun:   Log error
+ *
+ *       Desc:  This function is called to log an error.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   Void ssdLogError
 (
-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 */
-)
-#else
-PUBLIC Void ssdLogError(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
+ 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 */
+ )
 {
 #ifndef DEBUGNOEXIT
    S16 i;
@@ -4430,7 +4302,6 @@ Txt *errDesc;               /* description of error */
    Txt errBuf[512];
 
 
-   TRC0(ssdLogError);
 
 
    /* get calling task ID */
@@ -4442,44 +4313,44 @@ Txt *errDesc;               /* description of error */
    switch(errCls)
    {
       case ERRCLS_ADD_RES:
-         errClsMsg = "ERRCLS_ADD_RES";
-         break;
+        errClsMsg = "ERRCLS_ADD_RES";
+        break;
 
       case ERRCLS_INT_PAR:
-         errClsMsg = "ERRCLS_INT_PAR";
-         break;
+        errClsMsg = "ERRCLS_INT_PAR";
+        break;
 
       case ERRCLS_DEBUG:
-         errClsMsg = "ERRCLS_DEBUG";
-         break;
+        errClsMsg = "ERRCLS_DEBUG";
+        break;
 
-/* mt028.201 : Addition - ERRCLS_FTHA changes */
+        /* mt028.201 : Addition - ERRCLS_FTHA changes */
       case ERRCLS_FTHA:
-         errClsMsg = "ERRCLS_FTHA";
-         break;
+        errClsMsg = "ERRCLS_FTHA";
+        break;
 
       default:
-         errClsMsg = "INVALID ERROR CLASS!";
-         break;
+        errClsMsg = "INVALID ERROR CLASS!";
+        break;
    }
 
 
-/*mt009.301 Fixed 64BIT compilation warnings*/
+   /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
    sprintf(errBuf,
-             "\nmtss(posix): sw error:  ent: %03d  inst: %03d  proc id: %03d \n"
-             "file: %s line: %03d errcode: %05d errcls: %s\n"
-             "errval: %05d  errdesc: %s\n",
-           ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
+        "\nmtss(posix): sw error:  ent: %03d  inst: %03d  proc id: %03d \n"
+        "file: %s line: %03d errcode: %05d errcls: %s\n"
+        "errval: %05d  errdesc: %s\n",
+        ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
 #else
    sprintf(errBuf,
-             "\nmtss(posix): sw error:  ent: %03d  inst: %03d  proc id: %03d \n"
-             "file: %s line: %03ld errcode: %05ld errcls: %s\n"
-             "errval: %05ld  errdesc: %s\n",
-           ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
+        "\nmtss(posix): sw error:  ent: %03d  inst: %03d  proc id: %03d \n"
+        "file: %s line: %03ld errcode: %05ld errcls: %s\n"
+        "errval: %05ld  errdesc: %s\n",
+        ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
 #endif
    SDisplay(0, errBuf);
-/* mt001.301 : Additions */
+   /* mt001.301 : Additions */
 #ifdef SS_LOGGER_SUPPORT
    SWrtLogBuf(errBuf);
 #endif /* SS_LOGGER_SUPPORT  */
@@ -4489,18 +4360,18 @@ Txt *errDesc;               /* description of error */
    /* debug errors halt the system */
    if (errCls == ERRCLS_DEBUG)
    {
-/* mt001.301 : Additions */
+      /* mt001.301 : Additions */
 #ifdef SS_LOGGER_SUPPORT
-     SCleanUp();
+      SCleanUp();
 #endif /* SS_LOGGER_SUPPORT  */
       /* delete all system tasks */
       for (i = 0;  i < SS_MAX_STSKS;  i++)
       {
-         if (osCp.sTskTbl[i].used
-               &&  !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
-         {
-            pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
-         }
+        if (osCp.sTskTbl[i].used
+              &&  !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
+        {
+           pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
+        }
       }
 
 
@@ -4510,69 +4381,57 @@ Txt *errDesc;               /* description of error */
 #endif
 
 
-   RETVOID;
+   return;
 }
 
 #ifdef ENB_RELAY
 \f
 /*
-*
-*       Fun:   Register driver task
-*
-*       Desc:  This function is called to register the handlers for a
-*              driver task.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdRegDrvrTsk
+ *
+ *       Fun:   Register driver task
+ *
+ *       Desc:  This function is called to register the handlers for a
+ *              driver task.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdRegDrvrTsk
 (
-SsDrvrTskEntry *drvrTsk         /* driver task entry */
-)
-#else
-PUBLIC S16 ssdRegDrvrTsk(drvrTsk)
-SsDrvrTskEntry *drvrTsk;        /* driver task entry */
-#endif
+ SsDrvrTskEntry *drvrTsk         /* driver task entry */
+ )
 {
-   TRC0(ssdRegDrvrTsk);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 /* mt001.30 : Additions */
 /*
-*
-*       Fun:   Deregister driver task
-*
-*       Desc:  This function is called to deregister the handlers for a
-*              driver task.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdDeregDrvrTsk
+ *
+ *       Fun:   Deregister driver task
+ *
+ *       Desc:  This function is called to deregister the handlers for a
+ *              driver task.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 ssdDeregDrvrTsk
 (
-SsDrvrTskEntry *drvrTsk         /* driver task entry */
-)
-#else
-PUBLIC S16 ssdDeregDrvrTsk(drvrTsk)
-SsDrvrTskEntry *drvrTsk;        /* driver task entry */
-#endif
+ SsDrvrTskEntry *drvrTsk         /* driver task entry */
+ )
 {
-   TRC0(ssdDeregDrvrTsk);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif
 
@@ -4583,31 +4442,18 @@ SsDrvrTskEntry *drvrTsk;        /* driver task entry */
  * mt003.301 Additions - SDeRegTTsk fix
  */
 #ifdef SS_MULTIPLE_PROCS
-#ifdef ANSI
-PUBLIC S16 ssdProcTTskTerm
+   S16 ssdProcTTskTerm
 (
-ProcId procIdx,
-SsTTskEntry *tTsk,
-SsIdx idx
-)
-#else
-PUBLIC S16 ssdProcTTskTerm(procIdx, tTsk, idx)
-ProcId procIdx;
-SsTTskEntry *tTsk;
-SsIdx idx;
-#endif
+ ProcId procIdx,
+ SsTTskEntry *tTsk,
+ SsIdx idx
+ )
 #else /*SS_MULTIPLE_PROCS*/
-#ifdef ANSI
-PUBLIC S16 ssdProcTTskTerm
+   S16 ssdProcTTskTerm
 (
-SsTTskEntry *tTsk,
-SsIdx idx
-)
-#else
-PUBLIC S16 ssdProcTTskTerm(tTsk, idx)
-SsTTskEntry *tTsk;
-SsIdx idx;
-#endif
+ SsTTskEntry *tTsk,
+ SsIdx idx
+ )
 #endif /*SS_MULTIPLE_PROCS*/
 {
 #ifdef SS_MULTIPLE_PROCS
@@ -4617,24 +4463,23 @@ SsIdx idx;
    Inst inst;
    SsSTskEntry *sTsk;
    S16 n;
-       S16  ret;
+   S16  ret;
 
-   TRC0(ssdProcTTskTerm);
 
 
    ent = tTsk->ent;
    inst = tTsk->inst;
-    /* We check the sTsk element; if it is not NULLP, the
-     *  task is attached. So we have to detach it before
-     *  deregistering the task.
-     */
+   /* We check the sTsk element; if it is not NULLP, the
+    *  task is attached. So we have to detach it before
+    *  deregistering the task.
+    */
    ret = SLock(&osCp.sTskTblLock);
    if (ret != ROK)
    {
-       MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not lock system task table");
-       RETVALUE(RFAILED);
+      MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not lock system task table");
+      return RFAILED;
    }
-       SS_ACQUIRE_ALL_SEMA(&osCp.tTskTblSem, ret);
+   SS_ACQUIRE_ALL_SEMA(&osCp.tTskTblSem, ret);
    if (ret != ROK)
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
@@ -4643,12 +4488,12 @@ SsIdx idx;
       if ( SUnlock(&osCp.sTskTblLock) != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-               MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table");
-          RETVALUE(RFAILED);
+        MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table");
+        return RFAILED;
 #endif
       }
 
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 #ifdef SS_MULTIPLE_PROCS
@@ -4657,14 +4502,14 @@ SsIdx idx;
    {
 #ifndef USE_MEMCAL
       (Void)(*(tTsk->initTsk))(proc, ent, inst,
-                              DFLT_REGION,
-                              NRM_TERM,
-                              &(osCp.tTskTbl[idx].xxCb));
+           DFLT_REGION,
+           NRM_TERM,
+           &(osCp.tTskTbl[idx].xxCb));
 #else
       (Void)(*(tTsk->initTsk))(proc, ent, inst,
-                              SS_STATIC_REGION,
-                              NRM_TERM,
-                              &(osCp.tTskTbl[idx].xxCb));
+           SS_STATIC_REGION,
+           NRM_TERM,
+           &(osCp.tTskTbl[idx].xxCb));
 #endif /* USE_MEMCAL */
    }
 #endif /* SS_MULTIPLE_PROCS */
@@ -4678,48 +4523,48 @@ SsIdx idx;
 
       for (n = 0;  n < SS_MAX_TTSKS;  n++)
       {
-         if (sTsk->tTsks[n] == idx)
-         {
-            sTsk->tTsks[n] = SS_INVALID_IDX;
-            sTsk->numTTsks--;
-            break;
-         }
+        if (sTsk->tTsks[n] == idx)
+        {
+           sTsk->tTsks[n] = SS_INVALID_IDX;
+           sTsk->numTTsks--;
+           break;
+        }
       }
 
-       /* call the implementation to detach the task */
-       ssdDetachTTsk(tTsk);
-       /* 100178 */
-       sTsk->dep.ent = ENTNC;
-       sTsk->dep.inst = INSTNC;
+      /* call the implementation to detach the task */
+      ssdDetachTTsk(tTsk);
+      /* 100178 */
+      sTsk->dep.ent = ENTNC;
+      sTsk->dep.inst = INSTNC;
    }
 
-    /* Now we empty the entry for this task and update the table
-     *  information
-     */
+   /* Now we empty the entry for this task and update the table
+    *  information
+    */
 #ifdef SS_MULTIPLE_PROCS
-    osCp.tTskIds[procIdx][ent][inst] = SS_TSKNC;
+   osCp.tTskIds[procIdx][ent][inst] = SS_TSKNC;
 #else /* SS_MULTIPLE_PROCS */
-    osCp.tTskIds[ent][inst] = SS_TSKNC;
+   osCp.tTskIds[ent][inst] = SS_TSKNC;
 #endif /* SS_MULTIPLE_PROCS */
 
-    tTsk->used    = FALSE;
+   tTsk->used    = FALSE;
 #ifdef SS_MULTIPLE_PROCS
-    tTsk->proc    = PROCNC;
+   tTsk->proc    = PROCNC;
 #endif /* SS_MULTIPLE_PROCS */
-    tTsk->ent     = ENTNC;
-    tTsk->inst    = INSTNC;
-    tTsk->tskType = TTUND;
-    tTsk->initTsk = NULLP;
-    tTsk->actvTsk = NULLP;
-    tTsk->sTsk    = NULLP;
+   tTsk->ent     = ENTNC;
+   tTsk->inst    = INSTNC;
+   tTsk->tskType = TTUND;
+   tTsk->initTsk = NULLP;
+   tTsk->actvTsk = NULLP;
+   tTsk->sTsk    = NULLP;
 
-    tTsk->nxt = osCp.nxtTTskEntry;
-    osCp.nxtTTskEntry = idx;
-    osCp.numTTsks--;
+   tTsk->nxt = osCp.nxtTTskEntry;
+   osCp.nxtTTskEntry = idx;
+   osCp.numTTsks--;
 
 #ifdef SS_MULTIPLE_PROCS
-    /* mark the control block for this task as invalid */
-    osCp.tTskTbl[idx].xxCb = NULLP;
+   /* mark the control block for this task as invalid */
+   osCp.tTskTbl[idx].xxCb = NULLP;
 #endif
 
    SS_RELEASE_ALL_SEMA(&osCp.tTskTblSem);
@@ -4728,35 +4573,30 @@ SsIdx idx;
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table");
 #endif
-       RETVALUE(RFAILED);
+      return RFAILED;
    }
-       RETVALUE(ROK);
+   return ROK;
 }
 
 //#ifndef SPLIT_RLC_DL_TASK
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
 #if defined (L2_L3_SPLIT) && defined(SPLIT_RLC_DL_TASK) 
-EXTERN Void ysMtTskHdlr(Void);
-EXTERN Void ysMtPollPhyMsg(U8 region);
-EXTERN Void ysMtRcvPhyMsg(Void);
-#ifdef ANSI
-PUBLIC Void *mtTskHdlrT2kL2
+Void ysMtTskHdlr(Void);
+Void ysMtPollPhyMsg(uint8_t region);
+Void ysMtRcvPhyMsg(Void);
+   Void *mtTskHdlrT2kL2
 (
-Ptr tskPtr                      /* pointer to task entry */
-)
-#else
-PUBLIC Void *mtTskHdlrT2kL2(tskPtr)
-Ptr tskPtr;                     /* pointer to task entry */
-#endif
+ Ptr tskPtr                      /* pointer to task entry */
+ )
 {
    S16 ret;
 
 
    /* wait for SS to come up */
    /* It is required to block on this semaphore before starting actual processing of 
-     the thread becasue the creator of this thread might want to cance it without
-     doing any processing. When this semaphore is released, means the creator gives
-     the go ahead for actual processing and we should never come back to this point */
+      the thread becasue the creator of this thread might want to cance it without
+      doing any processing. When this semaphore is released, means the creator gives
+      the go ahead for actual processing and we should never come back to this point */
    while ((ret = sem_wait(&osCp.dep.ssStarted) != ROK) && (errno == EINTR))
       continue;
 
@@ -4767,23 +4607,18 @@ Ptr tskPtr;                     /* pointer to task entry */
    while(1)
    {
       ysMtPollPhyMsg(0); /* blocks, waiting for messages for L2
-                      * (processes L1 msgs) */
-  }
+                         * (processes L1 msgs) */
+   }
 
-  RETVALUE(NULLP);
+   return (NULLP);
 }
 #else
-EXTERN Void ysMtTskHdlr(Void);
-EXTERN Void YsPhyRecvMsg();
-#ifdef ANSI
-PUBLIC Void *mtTskHdlrT2kL2
+Void ysMtTskHdlr(Void);
+Void YsPhyRecvMsg();
+   Void *mtTskHdlrT2kL2
 (
-Ptr tskPtr                      /* pointer to task entry */
-)
-#else
-PUBLIC Void *mtTskHdlrT2kL2(tskPtr)
-Ptr tskPtr;                     /* pointer to task entry */
-#endif
+ Ptr tskPtr                      /* pointer to task entry */
+ )
 {
    S16 ret;
    SsSTskEntry *sTsk;
@@ -4793,9 +4628,9 @@ Ptr tskPtr;                     /* pointer to task entry */
 
    /* wait for SS to come up */
    /* It is required to block on this semaphore before starting actual processing of 
-     the thread becasue the creator of this thread might want to cance it without
-     doing any processing. When this semaphore is released, means the creator gives
-     the go ahead for actual processing and we should never come back to this point */
+      the thread becasue the creator of this thread might want to cance it without
+      doing any processing. When this semaphore is released, means the creator gives
+      the go ahead for actual processing and we should never come back to this point */
    while ((ret = sem_wait(&osCp.dep.ssStarted) != ROK) && (errno == EINTR))
       continue;
 
@@ -4811,7 +4646,7 @@ Ptr tskPtr;                     /* pointer to task entry */
       YsPhyRecvMsg();      
 #else      
       ysMtTskHdlr(); /* blocks, waiting for messages for L2
-                      * (processes L1 msgs) */
+                     * (processes L1 msgs) */
 #endif
       /* get a message from the demand queue */
       /* RT Processing */
@@ -4822,28 +4657,20 @@ Ptr tskPtr;                     /* pointer to task entry */
       ret = mtTskHdlMsg(sTsk); 
       if (ret != ROK)
       {
-         /* exit the for loop here */
-         break;
+        /* exit the for loop here */
+        break;
       }
 #if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
-       rgBatchProc();
+      rgBatchProc();
 #endif  
    }
 
-   RETVALUE(NULLP);
+   return (NULLP);
 }
 #endif /* TENB_T2K3K_SPECIFIC_CHANGES */
 #endif
 
-#ifdef ANSI
-PUBLIC void *pthreadCreateHdlr
-(
-void * arg
-)
-#else
-PUBLIC void *pthreadCreateHdlr(pthreadCreateArg)
-void *arg;
-#endif
+void *pthreadCreateHdlr(void * arg)
 {
    S16 ret;
    SPThreadCreateArg*  pthreadCreateArg = (SPThreadCreateArg*)arg;
@@ -4852,39 +4679,34 @@ void *arg;
       continue;
 
    pthreadCreateArg->start_routine(pthreadCreateArg->argument);
-   RETVALUE(ROK);
+   return ROK;
 }
 \f
 /*
-*
-*       Fun:   Task handler
-*
-*       Desc:  This is the system task handler function. It blocks on
-*              the system task's demand queue. On receiving a message,
-*              it identifies the target TAPA task, verifies that the
-*              TAPA task belongs to this system task and if so, calls
-*              the activation function of that TAPA task with the
-*              received message. The task activation function or the
-*              timer activation function may be called.
-*
-*       Ret:   (thread function)
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void *mtTskHdlr
+ *
+ *       Fun:   Task handler
+ *
+ *       Desc:  This is the system task handler function. It blocks on
+ *              the system task's demand queue. On receiving a message,
+ *              it identifies the target TAPA task, verifies that the
+ *              TAPA task belongs to this system task and if so, calls
+ *              the activation function of that TAPA task with the
+ *              received message. The task activation function or the
+ *              timer activation function may be called.
+ *
+ *       Ret:   (thread function)
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   Void *mtTskHdlr
 (
-Ptr tskPtr                      /* pointer to task entry */
-)
-#else
-PUBLIC Void *mtTskHdlr(tskPtr)
-Ptr tskPtr;                     /* pointer to task entry */
-#endif
+ Ptr tskPtr                      /* pointer to task entry */
+ )
 {
-   S16 ret;
+   S16 ret = ROK;
    SsSTskEntry *sTsk;
 
    /* get out the system task entry from the parameter */
@@ -4908,59 +4730,54 @@ Ptr tskPtr;                     /* pointer to task entry */
       ret = ssDmndQWait(&sTsk->dQ);
 #endif
       if (ret != ROK)
-         continue;
+        continue;
 
       ret = mtTskHdlMsg(sTsk); 
       if (ret != ROK)
       {
-         break;
+        break;
       }
    }
 
-   RETVALUE(NULLP);
+   return (NULLP);
 }
 
 \f
 /*
-*
-*       Fun:   Task handler
-*
-*       Desc:  This is the system task handler function. It blocks on
-*              the system task's demand queue. On receiving a message,
-*              it identifies the target TAPA task, verifies that the
-*              TAPA task belongs to this system task and if so, calls
-*              the activation function of that TAPA task with the
-*              received message. The task activation function or the
-*              timer activation function may be called.
-*
-*       Ret:   (thread function)
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 mtTskHdlMsg
+ *
+ *       Fun:   Task handler
+ *
+ *       Desc:  This is the system task handler function. It blocks on
+ *              the system task's demand queue. On receiving a message,
+ *              it identifies the target TAPA task, verifies that the
+ *              TAPA task belongs to this system task and if so, calls
+ *              the activation function of that TAPA task with the
+ *              received message. The task activation function or the
+ *              timer activation function may be called.
+ *
+ *       Ret:   (thread function)
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 mtTskHdlMsg
 (
-SsSTskEntry *sTsk
-)
-#else
-PUBLIC S16 mtTskHdlMsg(sTsk)
-SsSTskEntry *sTsk
-#endif
+ SsSTskEntry *sTsk
+ )
 {
-   S16 i;
-   S16 ret;
-   SsIdx idx;
-   SsTTskEntry *tTsk;
-   Buffer *mBuf;
+   S16 i =0;
+   S16 ret =0;
+   SsIdx idx =0;
+   SsTTskEntry *tTsk=NULLP;
+   Buffer *mBuf=NULLP;
 #ifdef SS_PERF
-   Buffer *mBuf2;
+   Buffer *mBuf2=NULLP;
 #endif
-   SsMsgInfo *mInfo;
+   SsMsgInfo *mInfo=NULLP;
    Pst nPst;
-/* mt028.201: modification: multiple procs support related changes */
+   /* mt028.201: modification: multiple procs support related changes */
 #ifndef SS_MULTIPLE_PROCS
 #ifdef SS_MT_TMR
    PAIFTMRS16 tmrActvFnMt = NULLP;
@@ -4968,12 +4785,12 @@ SsSTskEntry *sTsk
    /* mt015.301 Initialized the timer activation functions with NULLP */
    PFS16 tmrActvFn = NULLP;
 #else
-   PAIFTMRS16 tmrActvFn;
-   U16 procIdIdx;
+   PAIFTMRS16 tmrActvFn =NULLP;
+   uint16_t procIdIdx =0;
 #endif /* SS_MULTIPLE_PROCS */
-       /* mt003.301 Modifications */
+   /* mt003.301 Modifications */
 #ifdef SS_THREAD_PROFILE
-  EpcTime et1,et2;
+   EpcTime et1,et2;
 #endif /* SS_THREAD_PROFILE */
 
 
@@ -4981,7 +4798,7 @@ SsSTskEntry *sTsk
    if (ret != ROK)
    {
       /* nothing to receive */
-      RETVALUE(ROK);
+      return ROK;
    }
 
    /* if we can't lock this system task entry, return the message */
@@ -4991,13 +4808,13 @@ SsSTskEntry *sTsk
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT007, (ErrVal) ret,
-                     "Could not lock system task entry");
+           "Could not lock system task entry");
 #endif
       SPutMsg(mBuf);
-      RETVALUE(ROK);
+      return ROK;
    }
 
-/* mt034.201 */
+   /* mt034.201 */
 #ifdef SS_PERF
    do 
    {
@@ -5008,325 +4825,325 @@ SsSTskEntry *sTsk
 #ifdef SS_MEM_WL_DEBUG
       mtTskBuffer1 = mBuf2;
       if(mBuf2)
-      mtTskBuffer2 = mBuf2->b_next;
+        mtTskBuffer2 = mBuf2->b_next;
 
       if(mInfo == 0x5050505)
       {
-         stopBtInfo = TRUE;
-         SGlobMemInfoShow();
-         cmAnalyseBtInfo((PTR) mBuf,4);
-         SGlobMemInfoShow();
-         printf("\n In trouble .... \n");
+        stopBtInfo = TRUE;
+        SGlobMemInfoShow();
+        cmAnalyseBtInfo((PTR) mBuf,4);
+        SGlobMemInfoShow();
+        printf("\n In trouble .... \n");
       }
       else if (mInfo == 0x2020202)
       {
-         stopBtInfo = TRUE;
-         cmAnalyseBtInfo((PTR) mBuf,1);
-         printf("\n In trouble .... \n");
+        stopBtInfo = TRUE;
+        cmAnalyseBtInfo((PTR) mBuf,1);
+        printf("\n In trouble .... \n");
       }
 #endif /* SS_MEM_WL_DEBUG */
       switch (mInfo->eventInfo.event)
       {
-         /* this is a termination event, we die */
-         case SS_EVNT_TERM:
-            /* release the message */
-            SPutMsg(mBuf);
-
-            /* Unlock the system task entry and lock the system
-             *  task table to clean our entry up.
-             */
-            SUnlock(&sTsk->lock);
-
-            ret = SLock(&osCp.sTskTblLock);
-            if (ret != ROK)
-            {
-
-#if (ERRCLASS & ERRCLS_DEBUG)
-               MTLOGERROR(ERRCLS_DEBUG, EMT008, (ErrVal) ret,
-                           "Could not lock system task table");
-#endif
-               /* what to do here? */
-               RETVALUE(ROK);
-            }
+        /* this is a termination event, we die */
+        case SS_EVNT_TERM:
+           /* release the message */
+           SPutMsg(mBuf);
 
-            /* clean up the system task entry */
-            sTsk->used = FALSE;
-            sTsk->tskPrior = 0;
-                               /* mt003.301 Modifications - SDeRegTTsk */
-                               /* sTsk->numTTsks = 0; */
-            SDestroyLock(&sTsk->lock);
-            ssDestroyDmndQ(&sTsk->dQ);
+           /* Unlock the system task entry and lock the system
+            *  task table to clean our entry up.
+            */
+           SUnlock(&sTsk->lock);
 
-            /* lock for current executing TAPA task ID */
+           ret = SLock(&osCp.sTskTblLock);
+           if (ret != ROK)
+           {
 
-            /* make this entry available in the system task table */
-            sTsk->nxt = osCp.nxtSTskEntry;
-            for (i = 0;  i < SS_MAX_STSKS;  i++)
-            {
-               if (sTsk == &osCp.sTskTbl[i])
-               {
-                  osCp.nxtSTskEntry = i;
-                  break;
-               }
-            }
+#if (ERRCLASS & ERRCLS_DEBUG)
+              MTLOGERROR(ERRCLS_DEBUG, EMT008, (ErrVal) ret,
+                    "Could not lock system task table");
+#endif
+              /* what to do here? */
+              return ROK;
+           }
+
+           /* clean up the system task entry */
+           sTsk->used = FALSE;
+           sTsk->tskPrior = 0;
+           /* mt003.301 Modifications - SDeRegTTsk */
+           /* sTsk->numTTsks = 0; */
+           SDestroyLock(&sTsk->lock);
+           ssDestroyDmndQ(&sTsk->dQ);
+
+           /* lock for current executing TAPA task ID */
+
+           /* make this entry available in the system task table */
+           sTsk->nxt = osCp.nxtSTskEntry;
+           for (i = 0;  i < SS_MAX_STSKS;  i++)
+           {
+              if (sTsk == &osCp.sTskTbl[i])
+              {
+                 osCp.nxtSTskEntry = i;
+                 break;
+              }
+           }
 
-            osCp.numSTsks--;
+           osCp.numSTsks--;
 
-            /* unlock the system task table */
-            SUnlock(&osCp.sTskTblLock);
+           /* unlock the system task table */
+           SUnlock(&osCp.sTskTblLock);
 
-            RETVALUE(RFAILED);
+           return RFAILED;
 
 
-         /* this is a data message or a permanent task keep-alive message */
-         case SS_EVNT_DATA:
-         case SS_EVNT_PERMTICK:
-            /* message to a task. find the destination task */
-/* mt028.201: modification: multiple procs support related changes */
+           /* this is a data message or a permanent task keep-alive message */
+        case SS_EVNT_DATA:
+        case SS_EVNT_PERMTICK:
+           /* message to a task. find the destination task */
+           /* mt028.201: modification: multiple procs support related changes */
 #ifdef SS_MULTIPLE_PROCS
-            procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
+           procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
 
-            if (procIdIdx == SS_INV_PROCID_IDX)
-            {
-               SPutMsg(mBuf);
-               break;
-            }
+           if (procIdIdx == SS_INV_PROCID_IDX)
+           {
+              SPutMsg(mBuf);
+              break;
+           }
 
-            idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
+           idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
 #else /* SS_MULTIPLE_PROCS */
-            idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
+           idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
 #endif /* SS_MULTIPLE_PROCS */
 
-            /* verify that it hasn't been deregistered */
-            if (idx == SS_TSKNC)
-            {
-               SPutMsg(mBuf);
-               break;
-            }
-
-            /* verify that this system task is still running it */
-            tTsk = &osCp.tTskTbl[idx];
-            if (tTsk->sTsk != sTsk)
-            {
-               SPutMsg(mBuf);
-               break;
-            }
-
-               /* set the current executing TAPA task ID */
-               sTsk->dep.ent = mInfo->pst.dstEnt;
-               sTsk->dep.inst = mInfo->pst.dstInst;
-
-            /* copy the Pst structure into a local duplicate */
-            for (i = 0;  i < (S16) sizeof(Pst);  i++)
-               *(((U8 *)(&nPst)) + i) = *(((U8 *)&mInfo->pst) + i);
-
-            /* Give the message to the task activation function. If
-             *  its a normal data message, we pass it, if this is a
-             *  keep-alive message for a permanent task then we pass
-             *  NULLP in place of the message to the task activation
-             *  function.
-             */
-            if (mInfo->eventInfo.event == SS_EVNT_DATA)
-            {
+           /* verify that it hasn't been deregistered */
+           if (idx == SS_TSKNC)
+           {
+              SPutMsg(mBuf);
+              break;
+           }
+
+           /* verify that this system task is still running it */
+           tTsk = &osCp.tTskTbl[idx];
+           if (tTsk->sTsk != sTsk)
+           {
+              SPutMsg(mBuf);
+              break;
+           }
+
+           /* set the current executing TAPA task ID */
+           sTsk->dep.ent = mInfo->pst.dstEnt;
+           sTsk->dep.inst = mInfo->pst.dstInst;
+
+           /* copy the Pst structure into a local duplicate */
+           for (i = 0;  i < (S16) sizeof(Pst);  i++)
+              *(((uint8_t *)(&nPst)) + i) = *(((uint8_t *)&mInfo->pst) + i);
+
+           /* Give the message to the task activation function. If
+            *  its a normal data message, we pass it, if this is a
+            *  keep-alive message for a permanent task then we pass
+            *  NULLP in place of the message to the task activation
+            *  function.
+            */
+           if (mInfo->eventInfo.event == SS_EVNT_DATA)
+           {
 #ifndef RGL_SPECIFIC_CHANGES
 #ifdef SS_TSKLOG_ENABLE
-              U32 t = MacGetTick();
+              uint32_t t = MacGetTick();
 #endif
 #endif
-                                 /* mt003.301 Modifications */
+              /* mt003.301 Modifications */
 #if SS_THREAD_PROFILE
-                tTsk->curEvent = nPst.event;
-                SGetEpcTime(&et1);
+              tTsk->curEvent = nPst.event;
+              SGetEpcTime(&et1);
 #endif /* SS_THREAD_PROFILE */
-               tTsk->actvTsk(&nPst, mBuf);
+              tTsk->actvTsk(&nPst, mBuf);
 #ifndef RGL_SPECIFIC_CHANGES
 #ifdef SS_TSKLOG_ENABLE
-               SStopTask(t,PID_SSI_TSK);
+              SStopTask(t,PID_SSI_TSK);
 #endif
 #endif
 #if SS_THREAD_PROFILE
-                SGetEpcTime(&et2);
-                tTsk->curEvtTime = (U32)(et2 - et1);
-                tTsk->totTime += (U64)tTsk->curEvtTime;
+              SGetEpcTime(&et2);
+              tTsk->curEvtTime = (uint32_t)(et2 - et1);
+              tTsk->totTime += (uint64_t)tTsk->curEvtTime;
 #endif /* SS_THREAD_PROFILE */
-            }
-            else
-            {
+           }
+           else
+           {
 #if (ERRCLASS & ERRCLS_DEBUG)
-               /* this message should only come to a permanent task */
-               if (tTsk->tskType != SS_TSK_PERMANENT)
-               {
-                  MTLOGERROR(ERRCLS_DEBUG, EMT009, ERRZERO, "Logic failure");
-                  break;
-               }
-#endif
-               tTsk->actvTsk(&nPst, NULLP);
-
-               /* We need to re-send this message back to ourselves so
-                *  the permanent task continues to run.
-                */
-               /* Check if this task got deregistered or detached
-                *  by the activation function; if so, there's nothing
-                *  more to do here, otherwise go ahead.
-                */
-               ret = ROK;
-               if (tTsk->used == TRUE  &&  tTsk->sTsk != NULLP)
-               {
-                  ret = ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
-                              ((tTsk->tskPrior) * SS_MAX_MSG_PRI) +
-                              mInfo->pst.prior);
-               }
-
-               /* failure here is a real problem */
-               if (ret != ROK)
-               {
+              /* this message should only come to a permanent task */
+              if (tTsk->tskType != SS_TSK_PERMANENT)
+              {
+                 MTLOGERROR(ERRCLS_DEBUG, EMT009, ERRZERO, "Logic failure");
+                 break;
+              }
+#endif
+              tTsk->actvTsk(&nPst, NULLP);
+
+              /* We need to re-send this message back to ourselves so
+               *  the permanent task continues to run.
+               */
+              /* Check if this task got deregistered or detached
+               *  by the activation function; if so, there's nothing
+               *  more to do here, otherwise go ahead.
+               */
+              ret = ROK;
+              if (tTsk->used == TRUE  &&  tTsk->sTsk != NULLP)
+              {
+                 ret = ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
+                       ((tTsk->tskPrior) * SS_MAX_MSG_PRI) +
+                       mInfo->pst.prior);
+              }
+
+              /* failure here is a real problem */
+              if (ret != ROK)
+              {
 #if (ERRCLASS & ERRCLS_DEBUG)
-                  MTLOGERROR(ERRCLS_DEBUG, EMT010, ERRZERO,
-                              "Could not write to demand queue");
+                 MTLOGERROR(ERRCLS_DEBUG, EMT010, ERRZERO,
+                       "Could not write to demand queue");
 #endif
-                  SPutMsg(mBuf);
-               }
-            }
+                 SPutMsg(mBuf);
+              }
+           }
 
-            /* unset the current executing TAPA task ID */
-               sTsk->dep.ent = ENTNC;
-               sTsk->dep.inst = INSTNC;
-            break;
+           /* unset the current executing TAPA task ID */
+           sTsk->dep.ent = ENTNC;
+           sTsk->dep.inst = INSTNC;
+           break;
 
 
-         case SS_EVNT_TIMER:
-            /* timer event. find the timer entry */
-            idx = mInfo->eventInfo.u.tmr.tmrIdx;
+        case SS_EVNT_TIMER:
+           /* timer event. find the timer entry */
+           idx = mInfo->eventInfo.u.tmr.tmrIdx;
 
-            /* lock the timer table, coz we're going to peek in it */
-            ret = SLock(&osCp.tmrTblLock);
-            if (ret != ROK)
-            {
+           /* lock the timer table, coz we're going to peek in it */
+           ret = SLock(&osCp.tmrTblLock);
+           if (ret != ROK)
+           {
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-               MTLOGERROR(ERRCLS_DEBUG, EMT011, (ErrVal) ret,
-                              "Could not lock timer table");
-#endif
-               SPutMsg(mBuf);
-               break;
-            }
-
-            /* Verify that this timer entry is still around and that it
-             *  belongs to our task.
-             */
-            if (osCp.tmrTbl[idx].used == FALSE
-/* mt028.201: modification: multiple procs support related changes */
+              MTLOGERROR(ERRCLS_DEBUG, EMT011, (ErrVal) ret,
+                    "Could not lock timer table");
+#endif
+              SPutMsg(mBuf);
+              break;
+           }
+
+           /* Verify that this timer entry is still around and that it
+            *  belongs to our task.
+            */
+           if (osCp.tmrTbl[idx].used == FALSE
+                 /* mt028.201: modification: multiple procs support related changes */
 #ifdef SS_MULTIPLE_PROCS
-                  ||  osCp.tmrTbl[idx].ownerProc != mInfo->pst.dstProcId
+                 ||  osCp.tmrTbl[idx].ownerProc != mInfo->pst.dstProcId
 #endif /* SS_MULTIPLE_PROCS */
-                  ||  osCp.tmrTbl[idx].ownerEnt != mInfo->pst.dstEnt
-                  ||  osCp.tmrTbl[idx].ownerInst != mInfo->pst.dstInst)
-            {
-               SUnlock(&osCp.tmrTblLock);
-               SPutMsg(mBuf);
-               break;
-            }
-
- /* mt005.21: addition */
-            /* set the current executing TAPA task ID */
-               sTsk->dep.ent = mInfo->pst.dstEnt;
-               sTsk->dep.inst = mInfo->pst.dstInst;
+                 ||  osCp.tmrTbl[idx].ownerEnt != mInfo->pst.dstEnt
+                 ||  osCp.tmrTbl[idx].ownerInst != mInfo->pst.dstInst)
+           {
+              SUnlock(&osCp.tmrTblLock);
+              SPutMsg(mBuf);
+              break;
+           }
+
          /* mt005.21: addition */
+           /* set the current executing TAPA task ID */
+           sTsk->dep.ent = mInfo->pst.dstEnt;
+           sTsk->dep.inst = mInfo->pst.dstInst;
 
 #ifndef SS_MULTIPLE_PROCS
 #ifdef SS_MT_TMR
-            /*mt006.301 Adding Initializing the tmrActvFnMt*/
-            tmrActvFnMt = NULLP;
-            if (osCp.tmrTbl[idx].ssTmrActvFn.mtFlag == TRUE)
-            {
-               tmrActvFnMt = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFnMt;
-            }
-            else
+           /*mt006.301 Adding Initializing the tmrActvFnMt*/
+           tmrActvFnMt = NULLP;
+           if (osCp.tmrTbl[idx].ssTmrActvFn.mtFlag == TRUE)
+           {
+              tmrActvFnMt = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFnMt;
+           }
+           else
 #endif
 #endif
-            {
-               tmrActvFn = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFn;
-            }
+           {
+              tmrActvFn = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFn;
+           }
 
-            /* unlock the timer table */
-            SUnlock(&osCp.tmrTblLock);
+           /* unlock the timer table */
+           SUnlock(&osCp.tmrTblLock);
 
-            /* activate the timer function */
-/* mt028.201: modification: multiple procs support related changes */
+           /* activate the timer function */
+           /* mt028.201: modification: multiple procs support related changes */
 #ifndef SS_MULTIPLE_PROCS
 #ifdef SS_MT_TMR
-            if (tmrActvFnMt)
-            {
-               tmrActvFnMt(osCp.tmrTbl[idx].ownerEnt,
-                           osCp.tmrTbl[idx].ownerInst);
-            }
-            else
-#endif
-            {
-               tmrActvFn();
-            }
-#else
-            tmrActvFn(osCp.tmrTbl[idx].ownerProc, osCp.tmrTbl[idx].ownerEnt,
-                        osCp.tmrTbl[idx].ownerInst);
+           if (tmrActvFnMt)
+           {
+              tmrActvFnMt(osCp.tmrTbl[idx].ownerEnt,
+                    osCp.tmrTbl[idx].ownerInst);
+           }
+           else
+#endif
+           {
+              tmrActvFn();
+           }
+#else
+           tmrActvFn(osCp.tmrTbl[idx].ownerProc, osCp.tmrTbl[idx].ownerEnt,
+                 osCp.tmrTbl[idx].ownerInst);
 #endif /* SS_MULTIPLE_PROCS */
 
- /*mt005.21: addition */
-            /* unset the current executing TAPA task ID */
-               sTsk->dep.ent = ENTNC;
-               sTsk->dep.inst = INSTNC;
          /*mt005.21: addition */
+           /* unset the current executing TAPA task ID */
+           sTsk->dep.ent = ENTNC;
+           sTsk->dep.inst = INSTNC;
 
 
-            /* return the message buffer */
-            SPutMsg(mBuf);
-            break;
-                               /*
-                                * mt003.301 - SDeRegTTsk fix
-                                */
-         case SS_EVNT_TTSK_TERM:
+           /* return the message buffer */
+           SPutMsg(mBuf);
+           break;
+           /*
+            * mt003.301 - SDeRegTTsk fix
+            */
+        case SS_EVNT_TTSK_TERM:
 #ifdef SS_MULTIPLE_PROCS
-            procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
+           procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
 
-            if (procIdIdx == SS_INV_PROCID_IDX)
-            {
-               SPutMsg(mBuf);
-               break;
-            }
+           if (procIdIdx == SS_INV_PROCID_IDX)
+           {
+              SPutMsg(mBuf);
+              break;
+           }
 
-            idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
+           idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
 #else /* SS_MULTIPLE_PROCS */
-            idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
+           idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
 #endif /* SS_MULTIPLE_PROCS */
 
-            /* verify that it hasn't been deregistered */
-            if (idx == SS_TSKNC)
-            {
-               SPutMsg(mBuf);
-               break;
-            }
-
-            /* verify that this system task is still running it */
-            tTsk = &osCp.tTskTbl[idx];
-            if (tTsk->sTsk != sTsk)
-            {
-               SPutMsg(mBuf);
-               break;
-            }
+           /* verify that it hasn't been deregistered */
+           if (idx == SS_TSKNC)
+           {
+              SPutMsg(mBuf);
+              break;
+           }
+
+           /* verify that this system task is still running it */
+           tTsk = &osCp.tTskTbl[idx];
+           if (tTsk->sTsk != sTsk)
+           {
+              SPutMsg(mBuf);
+              break;
+           }
 #ifdef SS_MULTIPLE_PROCS
-            ssdProcTTskTerm(procIdIdx, tTsk, idx);
+           ssdProcTTskTerm(procIdIdx, tTsk, idx);
 #else
-            ssdProcTTskTerm(tTsk, idx);
+           ssdProcTTskTerm(tTsk, idx);
 #endif
-            SPutMsg(mBuf);
-            break;
+           SPutMsg(mBuf);
+           break;
 
-         default:
+        default:
 #if (ERRCLASS & ERRCLS_DEBUG)
-            MTLOGERROR(ERRCLS_DEBUG, EMT012, (ErrVal) ret,
-                        "Illegal event");
+           MTLOGERROR(ERRCLS_DEBUG, EMT012, (ErrVal) ret,
+                 "Illegal event");
 #endif
-            break;
+           break;
       }
 #ifdef SS_PERF
-         mBuf = mBuf2;
+      mBuf = mBuf2;
    } while (mBuf != NULLP);
 #endif
 
@@ -5339,20 +5156,14 @@ SsSTskEntry *sTsk
    SThreadYield();
 #endif
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 Bool g_usettitmr;
 /*
-*       Fun:   mtTmrHdlrPublic
-*/
-#ifdef ANSI
-PUBLIC Void mtTmrHdlrPublic
-(
-)
-#else
-PUBLIC Void mtTmrHdlrPublic()
-#endif
+ *       Fun:   mtTmrHdlrPublic
+ */
+Void mtTmrHdlrPublic()
 {
    if (SLock(&osCp.tmrTblLock) != ROK)
    {
@@ -5368,45 +5179,39 @@ PUBLIC Void mtTmrHdlrPublic()
 
 \f
 /*
-*
-*       Fun:   mtTmrHdlr
-*
-*       Desc:  The timer handler thread function. Counts time
-*              and invokes the common timer function on each
-*              tick.
-*
-*       Ret:   (thread function)
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
+ *
+ *       Fun:   mtTmrHdlr
+ *
+ *       Desc:  The timer handler thread function. Counts time
+ *              and invokes the common timer function on each
+ *              tick.
+ *
+ *       Ret:   (thread function)
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
 /*mt041.201 Modified SSI tick handling in mtTmrHdlr() */
-#ifdef ANSI
-PRIVATE Void *mtTmrHdlr
+   static Void *mtTmrHdlr
 (
-void *parm                        /* unused */
-)
-#else
-   /* mt009.21: addition */
-PRIVATE Void *mtTmrHdlr(parm)
-void *parm;                       /* unused */
-#endif
+ void *parm                        /* unused */
+ )
 {
-/*mt004.301-addede new region*/
-/* mt010.301 Removed SS_FAP portion and
- * enabled oroginal code in function mtTmrHdlr */
+   /*mt004.301-addede new region*/
+   /* mt010.301 Removed SS_FAP portion and
   * enabled oroginal code in function mtTmrHdlr */
 
    struct timespec ts;
-   U32 time_int;
-   U32 i, cnt, oldTicks, newTicks;
+   uint32_t time_int;
+   uint32_t i, cnt, oldTicks, newTicks;
    struct timeval tv1,tv2;
    /* mt038.201 added return */
    S16 ret;
    /* mt039.201 changes for nanosleep */
    struct timespec tsN;
-   PRIVATE U32 err_in_usec;
+   static uint32_t err_in_usec;
 
    /*mt013.301 : doesn't need TRC macro ,as this will never return*/
 
@@ -5439,8 +5244,8 @@ void *parm;                       /* unused */
    if (gettimeofday(&tv1, NULL) == -1)
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
-            MTLOGERROR(ERRCLS_DEBUG, EMT014, (ErrVal) errno,
-                        "Error in clock_gettime");
+      MTLOGERROR(ERRCLS_DEBUG, EMT014, (ErrVal) errno,
+           "Error in clock_gettime");
 #endif
    }
 
@@ -5448,115 +5253,109 @@ void *parm;                       /* unused */
    for (; ;)
    {
 #if 1
-     if (g_usettitmr)
-     {
+      if (g_usettitmr)
+      {
 #ifndef STUB_TTI_HANDLING_5GTF        
-        printf("Returning from mtTmrHdlr()\n");
-        return NULL;
+        printf("\nReturning from mtTmrHdlr()\n");
+        return NULL;
 #endif        
-     }
+      }
 #endif
-     /* mt039.201 changes for nanosleep */
+      /* mt039.201 changes for nanosleep */
       /* sleep for MT_TICK_CNT milli seconds */
       ts.tv_nsec = (MT_TICK_CNT - err_in_usec) * 1000;
       while ((ret = nanosleep (&ts, &tsN) != ROK) && (errno == EINTR))
       {
-         ts.tv_nsec = tsN.tv_nsec;
-         tsN.tv_nsec = 0;
-         continue;
+        ts.tv_nsec = tsN.tv_nsec;
+        tsN.tv_nsec = 0;
+        continue;
       }
 
       if (gettimeofday(&tv2,NULL) == -1)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-            MTLOGERROR(ERRCLS_DEBUG, EMT015, (ErrVal) errno,
-                        "Error in clock_gettime");
+        MTLOGERROR(ERRCLS_DEBUG, EMT015, (ErrVal) errno,
+              "Error in clock_gettime");
 #endif
       }
 
-     /*mt013.301 : changed check while calculating timer to fix
-      * diffrence between MTSS time and real unix time
-      */
-     if ((tv2.tv_sec == tv1.tv_sec)&&(tv2.tv_usec > tv1.tv_usec))
-     {
-        time_int = (tv2.tv_usec - tv1.tv_usec);
-     }
-     else if (tv2.tv_sec > tv1.tv_sec)
-     {
-        time_int = ((tv2.tv_sec - tv1.tv_sec)*1000000) + (tv2.tv_usec - tv1.tv_usec);
-     }
-     else /*  ts2 < ts1, this will not happen in normal scenario */
-     {
-        /* to make sure cnt = 1  */
-        err_in_usec = 0;
-        time_int = MT_TICK_CNT;
-     }
-
-     oldTicks = osCp.dep.sysTicks;
-     osCp.dep.sysTicks += (time_int/(MT_TICK_CNT - err_in_usec));
-     err_in_usec = (time_int % (MT_TICK_CNT - err_in_usec));
-     newTicks = osCp.dep.sysTicks;
-     tv1.tv_usec = tv2.tv_usec;
-     tv1.tv_sec = tv2.tv_sec;
-
-     cnt = newTicks - oldTicks;
-
-     while(err_in_usec >= MT_TICK_CNT)
-     {
-        cnt++;
-        err_in_usec -= MT_TICK_CNT;
-     }
-     if( cnt >= MT_MAX_TICK_CNT_VAL)
-        cnt = MT_MIN_TICK_CNT_VAL;
-     /* call the common timer tick handler */
-         for (i = 0; i < cnt; i++)
-         {
-                /* mt008.301: cmPrcTmr is guarded with a lock */
-                /* lock the timer table */
-                if (SLock(&osCp.tmrTblLock) != ROK)
-                {
+      /*mt013.301 : changed check while calculating timer to fix
+       * diffrence between MTSS time and real unix time
+       */
+      if ((tv2.tv_sec == tv1.tv_sec)&&(tv2.tv_usec > tv1.tv_usec))
+      {
+        time_int = (tv2.tv_usec - tv1.tv_usec);
+      }
+      else if (tv2.tv_sec > tv1.tv_sec)
+      {
+        time_int = ((tv2.tv_sec - tv1.tv_sec)*1000000) + (tv2.tv_usec - tv1.tv_usec);
+      }
+      else /*  ts2 < ts1, this will not happen in normal scenario */
+      {
+        /* to make sure cnt = 1  */
+        err_in_usec = 0;
+        time_int = MT_TICK_CNT;
+      }
+
+      oldTicks = osCp.dep.sysTicks;
+      osCp.dep.sysTicks += (time_int/(MT_TICK_CNT - err_in_usec));
+      err_in_usec = (time_int % (MT_TICK_CNT - err_in_usec));
+      newTicks = osCp.dep.sysTicks;
+      tv1.tv_usec = tv2.tv_usec;
+      tv1.tv_sec = tv2.tv_sec;
+
+      cnt = newTicks - oldTicks;
+
+      while(err_in_usec >= MT_TICK_CNT)
+      {
+        cnt++;
+        err_in_usec -= MT_TICK_CNT;
+      }
+      if( cnt >= MT_MAX_TICK_CNT_VAL)
+        cnt = MT_MIN_TICK_CNT_VAL;
+      /* call the common timer tick handler */
+      for (i = 0; i < cnt; i++)
+      {
+        /* mt008.301: cmPrcTmr is guarded with a lock */
+        /* lock the timer table */
+        if (SLock(&osCp.tmrTblLock) != ROK)
+        {
 #if (ERRCLASS & ERRCLS_DEBUG)
-                       MTLOGERROR(ERRCLS_DEBUG, EMT016, ERRZERO, "Could not lock timer table");
+           MTLOGERROR(ERRCLS_DEBUG, EMT016, ERRZERO, "Could not lock timer table");
 #endif
-                       continue;
-                }
-                cmPrcTmr(&osCp.dep.tmrTqCp, osCp.dep.tmrTq, mtTimeout);
-                /* unlock the timer table */
-                SUnlock(&osCp.tmrTblLock);
-         }
+           continue;
+        }
+        cmPrcTmr(&osCp.dep.tmrTqCp, osCp.dep.tmrTq, mtTimeout);
+        /* unlock the timer table */
+        SUnlock(&osCp.tmrTblLock);
+      }
    }
 
    /* mt009.21: addition */
-   RETVALUE( (Void *) NULLP);
+   return ( (Void *) NULLP);
    /* will not reach here */
 }
 
 \f
 /*
-*
-*       Fun:   mtTimeout
-*
-*       Desc:  Process timer event. Called from the common timer
-*              code when a timeout occurs.
-*
-*       Ret:   Void
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void mtTimeout
+ *
+ *       Fun:   mtTimeout
+ *
+ *       Desc:  Process timer event. Called from the common timer
+ *              code when a timeout occurs.
+ *
+ *       Ret:   Void
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   Void mtTimeout
 (
-PTR tCb,                        /* control block */
-S16 evnt                        /* event */
-)
-#else
-PUBLIC Void mtTimeout(tCb, evnt)
-PTR tCb;                        /* control block */
-S16 evnt;                       /* event */
-#endif
+ PTR tCb,                        /* control block */
+ S16 evnt                        /* event */
+ )
 {
    Buffer *mBuf;
    SsMsgInfo *mInfo;
@@ -5567,17 +5366,16 @@ S16 evnt;                       /* event */
 #ifndef TENB_RTLIN_CHANGES
    S16 ret;
 #endif
-/* mt028.201: modification: multiple procs support related changes */
+   /* mt028.201: modification: multiple procs support related changes */
 #ifdef SS_MULTIPLE_PROCS
-   U16 procIdIdx;
+   uint16_t procIdIdx;
 #endif /* SS_MULTIPLE_PROCS */
 #ifdef RGL_SPECIFIC_CHANGES
 #ifdef MSPD_MLOG_NEW
-   U32 t = GetTIMETICK();
+   uint32_t t = GetTIMETICK();
 #endif
 #endif
 
-   TRC0(mtTimeout);
 
 
    /* get the timer entry */
@@ -5587,10 +5385,10 @@ S16 evnt;                       /* event */
    /* if the timer was deleted, this will be NULL, so drop it */
    if (tEnt == NULL)
    {
-      RETVOID;
+      return;
    }
 
-/* mt008.301 Deletion: tmrTbl Lock is moved to mtTmrHdlr */
+   /* mt008.301 Deletion: tmrTbl Lock is moved to mtTmrHdlr */
 
 
    /* Hmmmm, the timer might have been deleted while we've been
@@ -5598,7 +5396,7 @@ S16 evnt;                       /* event */
     */
    if (tEnt->used == FALSE)
    {
-      RETVOID;
+      return;
    }
 
 
@@ -5609,19 +5407,19 @@ S16 evnt;                       /* event */
    if (SGetMsg(SS_DFLT_REGION, SS_DFLT_POOL, &mBuf) != ROK)
 #else
 #ifdef RGL_SPECIFIC_CHANGES
-   if (SGetMsg((SS_DFLT_REGION), SS_DFLT_POOL, &mBuf) != ROK)
+      if (SGetMsg((SS_DFLT_REGION), SS_DFLT_POOL, &mBuf) != ROK)
 #else
-   if (SGetMsg((osCp.sTskTbl[0].region), SS_DFLT_POOL, &mBuf) != ROK)
+        if (SGetMsg((osCp.sTskTbl[0].region), SS_DFLT_POOL, &mBuf) != ROK)
 #endif
 #endif
-   {
+        {
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-      MTLOGERROR(ERRCLS_DEBUG, EMT017, ERRZERO, "Could not get message");
+           MTLOGERROR(ERRCLS_DEBUG, EMT017, ERRZERO, "Could not get message");
 #endif
 
-      RETVOID;
-   }
+           return;
+        }
 
    mInfo = (SsMsgInfo *)mBuf->b_rptr;
    mInfo->eventInfo.event = SS_EVNT_TIMER;
@@ -5631,7 +5429,7 @@ S16 evnt;                       /* event */
    mInfo->pst.dstInst = tEnt->ownerInst;
    mInfo->pst.srcEnt = tEnt->ownerEnt;
    mInfo->pst.srcInst = tEnt->ownerInst;
-/* mt028.201: modification: multiple procs support related changes */
+   /* mt028.201: modification: multiple procs support related changes */
 #ifndef SS_MULTIPLE_PROCS
    mInfo->pst.dstProcId = SFndProcId();
    mInfo->pst.srcProcId = SFndProcId();
@@ -5661,13 +5459,13 @@ S16 evnt;                       /* event */
       MTLOGERROR(ERRCLS_DEBUG, EMT018, ret, "Could not lock TAPA task table");
 #endif
 
-      RETVOID;
+      return;
    }
 #endif
 
 
    /* find the owner TAPA task */
-/* mt028.201: modification: multiple procs support related changes */
+   /* mt028.201: modification: multiple procs support related changes */
 #ifdef SS_MULTIPLE_PROCS
    procIdIdx = SGetProcIdIdx(tEnt->ownerProc);
    idx = osCp.tTskIds[procIdIdx][tEnt->ownerEnt][tEnt->ownerInst];
@@ -5680,7 +5478,7 @@ S16 evnt;                       /* event */
       SS_RELEASE_SEMA(&osCp.tTskTblSem);
 #endif
       SPutMsg(mBuf);
-      RETVOID;
+      return;
    }
 
 
@@ -5692,11 +5490,11 @@ S16 evnt;                       /* event */
       SS_RELEASE_SEMA(&osCp.tTskTblSem);
 #endif
       SPutMsg(mBuf);
-      RETVOID;
+      return;
    }
    /* Klock work fix ccpu00148484 */
    /* write the timer message to the queue of the destination task */
-       /* mt008.301 : check sTsk before putting into it's DQ */
+   /* mt008.301 : check sTsk before putting into it's DQ */
    if (tTsk->sTsk == NULLP)
    {
 #ifndef TENB_RTLIN_CHANGES
@@ -5706,17 +5504,17 @@ S16 evnt;                       /* event */
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT019, ERRZERO,
-                        "Could not write to demand queue");
+           "Could not write to demand queue");
 #endif
 
-      RETVOID;
+      return;
    }
 #ifdef SS_LOCKLESS_MEMORY
    mInfo->pst.region = tTsk->sTsk->region;
    mInfo->region = tTsk->sTsk->region;
 #endif /* SS_LOCKLESS_MEMORY */
    if (ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
-               (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR0) != ROK)
+           (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR0) != ROK)
    {
 #ifndef TENB_RTLIN_CHANGES
       SS_RELEASE_SEMA(&osCp.tTskTblSem);
@@ -5725,17 +5523,17 @@ S16 evnt;                       /* event */
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT019, ERRZERO,
-                        "Could not write to demand queue");
+           "Could not write to demand queue");
 #endif
 
-      RETVOID;
+      return;
    }
-/* Fix for ccpu00130657 */
+   /* Fix for ccpu00130657 */
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
    if (tTsk->sTsk->tskPrior == PRIOR0)
    {
 #ifdef INTEL_WLS
-        WLS_WakeUp(mtGetWlsHdl());
+      WLS_WakeUp(mtGetWlsHdl());
 #else
       tlPost(NULLP);
 #endif
@@ -5764,35 +5562,29 @@ S16 evnt;                       /* event */
    MLogTask(131313, RESOURCE_LARM, t, GetTIMETICK());
 #endif
 #endif
-   RETVOID;
+   return;
 }
 
 \f
 #ifdef CONAVL
 /*
-*
-*       Fun:   mtConHdlr
-*
-*       Desc:  This thread reads the console and hands over any
-*              data read to a user function.
-*
-*       Ret:   (thread function)
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PRIVATE Void *mtConHdlr
+ *
+ *       Fun:   mtConHdlr
+ *
+ *       Desc:  This thread reads the console and hands over any
+ *              data read to a user function.
+ *
+ *       Ret:   (thread function)
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   static Void *mtConHdlr
 (
-Ptr parm                        /* unused */
-)
-#else
-  /* mt009.21: addition */
-PRIVATE Void *mtConHdlr(parm)
-Ptr parm;                       /* unused */
-#endif
+ Ptr parm                        /* unused */
+ )
 {
    int fd;
    Data data;
@@ -5808,7 +5600,7 @@ Ptr parm;                       /* unused */
    if (osCp.dep.conInFp == NULLP)
    {
       /* die */
-      RETVALUE(NULLP);
+      return (NULLP);
    }
 
    fd = fileno(osCp.dep.conInFp);
@@ -5818,7 +5610,7 @@ Ptr parm;                       /* unused */
    {
       if ((read(fd, &data, 1)) != 1)
       {
-         continue;
+        continue;
       }
 
 
@@ -5834,111 +5626,101 @@ Ptr parm;                       /* unused */
 #ifndef L2_L3_SPLIT
 #ifdef SS_DRVR_SUPPORT
 /*
-*
-*       Fun:   Interrupt service task handler
-*
-*       Desc:  This is the interrupt service task handler. It blocks
-*              on a pipe from which it reads an isFlag structure. The
-*              structure indicates which interrupt service task is to
-*              be executed. The thread identifies the task, calls the
-*              isTsk function and sends itself a message to repeat
-*              this operation until it receives a message to cease.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-  /* mt009.21: addition */
-PRIVATE Void *mtIsTskHdlr
+ *
+ *       Fun:   Interrupt service task handler
+ *
+ *       Desc:  This is the interrupt service task handler. It blocks
+ *              on a pipe from which it reads an isFlag structure. The
+ *              structure indicates which interrupt service task is to
+ *              be executed. The thread identifies the task, calls the
+ *              isTsk function and sends itself a message to repeat
+ *              this operation until it receives a message to cease.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+/* mt009.21: addition */
+   static Void *mtIsTskHdlr
 (
-Ptr tskPtr                      /* pointer to task entry */
-)
-#else
-  /* mt009.21: addition */
-PRIVATE Void *mtIsTskHdlr(tskPtr)
-Ptr tskPtr;                     /* pointer to task entry */
-#endif
+ Ptr tskPtr                      /* pointer to task entry */
+ )
 {
 #if (ERRCLASS & ERRCLS_DEBUG)
    int ret;
 #endif
    MtIsFlag isFlag;
 
-
-   TRC0(mtIsTskHdlr);
-
-
    for (; ;)
    {
       if (read(osCp.dep.isFildes[0], &isFlag, sizeof(isFlag)) != sizeof(isFlag))
       {
-         continue;
+        continue;
       }
 
       switch (isFlag.action)
       {
-         case MT_IS_SET:
-            osCp.drvrTskTbl[isFlag.id].dep.flag = TRUE;
+        case MT_IS_SET:
+           osCp.drvrTskTbl[isFlag.id].dep.flag = TRUE;
 
-            /* call the interrupt service task activation function */
-            osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
+           /* call the interrupt service task activation function */
+           osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
 
-            /* send self a message to keep doing this */
-            isFlag.action = MT_IS_RESET;
+           /* send self a message to keep doing this */
+           isFlag.action = MT_IS_RESET;
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-            ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
-            if (ret != sizeof(isFlag))
-            {
-               MTLOGERROR(ERRCLS_DEBUG, EMT020, ERRZERO,
-                              "write() to pipe failed");
-            }
+           ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+           if (ret != sizeof(isFlag))
+           {
+              MTLOGERROR(ERRCLS_DEBUG, EMT020, ERRZERO,
+                    "write() to pipe failed");
+           }
 #else
-            write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+           write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
 #endif
 
-            break;
+           break;
 
 
-         case MT_IS_UNSET:
-            osCp.drvrTskTbl[isFlag.id].dep.flag = FALSE;
-            break;
+        case MT_IS_UNSET:
+           osCp.drvrTskTbl[isFlag.id].dep.flag = FALSE;
+           break;
 
 
-         case MT_IS_RESET:
-            if (osCp.drvrTskTbl[isFlag.id].dep.flag)
-            {
-               /* call the interrupt service task activation function */
-               osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
+        case MT_IS_RESET:
+           if (osCp.drvrTskTbl[isFlag.id].dep.flag)
+           {
+              /* call the interrupt service task activation function */
+              osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
 
 #if (ERRCLASS & ERRCLS_DEBUG)
-               /* send self a message to do this again */
-               ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
-
-               if (ret != sizeof(isFlag))
-               {
-                  MTLOGERROR(ERRCLS_DEBUG, EMT021, ERRZERO,
-                                 "write() to pipe failed");
-               }
+              /* send self a message to do this again */
+              ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+
+              if (ret != sizeof(isFlag))
+              {
+                 MTLOGERROR(ERRCLS_DEBUG, EMT021, ERRZERO,
+                       "write() to pipe failed");
+              }
 #else
-               write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+              write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
 #endif
 
-            }
-            break;
+           }
+           break;
 
 
-         default:
-            /* where did THIS come from?? */
-            break;
+        default:
+           /* where did THIS come from?? */
+           break;
       }
    }
-  /* mt009.21: addition */
-  RETVALUE( (Void *) NULLP);
+   /* mt009.21: addition */
+   return ( (Void *) NULLP);
 
    /* not reached */
 }
@@ -5948,31 +5730,21 @@ Ptr tskPtr;                     /* pointer to task entry */
 /*mt010.301 Fix for core when run with -o option and when killed with SIGINT*/
 \f
 /*
-*
-*       Fun:   mtIntSigHndlr
-*
-*       Desc:  Exit function, shuts down.
-*
-*       Ret:   Void
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void mtIntSigHndlr
-(
-int arg
-)
-#else
-PUBLIC Void mtIntSigHndlr(arg)
-int arg;
-#endif
+ *
+ *       Fun:   mtIntSigHndlr
+ *
+ *       Desc:  Exit function, shuts down.
+ *
+ *       Ret:   Void
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void mtIntSigHndlr(int arg)
 {
 
-   TRC0(mtIntSigHndlr);
-
    osCp.dep.sigEvnt=TRUE;
 
 #ifdef MSPD
@@ -5981,38 +5753,29 @@ int arg;
 #endif
 #endif
 
-   RETVOID;
+   return;
 }
 
 /*mt010.301 Fix for core when run with -o option and when killed with SIGINT*/
 /*
-*
-*       Fun:   mtExitClnup
-*
-*       Desc:   function, shuts down.
-*
-*       Ret:   Void
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void mtExitClnup
-(
-void
-)
-#else
-PUBLIC Void mtExitClnup()
-#endif
+ *
+ *       Fun:   mtExitClnup
+ *
+ *       Desc:   function, shuts down.
+ *
+ *       Ret:   Void
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+Void mtExitClnup(void)
 {
    Ticks ticks;
    S8 buf[128];
 
 
-   TRC0(mtExitClnup);
-
    SGetSysTime(&ticks);
 #ifdef ALIGN_64BIT
    sprintf(buf, "\n\nmtss(posix) ends\nticks: %u\n", ticks);
@@ -6046,61 +5809,54 @@ Ticks SGetTtiCount(Void)
 }
 
 /*
-*
-*       Fun:   SDisplay
-*
-*       Desc:  This function displays a string to a given output
-*              channel.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Buffer should be null terminated.
-*
-*              channel 0 is reserved for backwards compatibility
-*              with SPrint
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SDisplay
+ *
+ *       Fun:   SDisplay
+ *
+ *       Desc:  This function displays a string to a given output
+ *              channel.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Buffer should be null terminated.
+ *
+ *              channel 0 is reserved for backwards compatibility
+ *              with SPrint
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SDisplay
 (
-S16 chan,                   /* channel */
-Txt *buf                    /* buffer */
-)
-#else
-PUBLIC S16 SDisplay(chan, buf)
-S16 chan;                   /* channel */
-Txt *buf;                   /* buffer */
-#endif
+ S16 chan,                   /* channel */
+ Txt *buf                    /* buffer */
+ )
 {
-   TRC1(SDisplay);
 
-/* mt020.201 - Fixed typo */
+   /* mt020.201 - Fixed typo */
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (buf == NULLP)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT022, ERRZERO, "Null pointer");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
 #ifndef XEON_SPECIFIC_CHANGES
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
    ssMemlog(buf, strlen(buf));
-   RETVALUE(ROK);
+   return ROK;
 #endif
 #endif
 
- /* mt012.301 :FIX for LOG RELATED ISSUE  */
  /* mt012.301 :FIX for LOG RELATED ISSUE  */
 #ifdef CONAVL
    if(chan==1)
    {
-       printf("%s",buf);
+      printf("%s",buf);
    }
    else
    {
-    if (osCp.dep.conOutFp) fwrite(buf, strlen(buf), 1, osCp.dep.conOutFp);
+      if (osCp.dep.conOutFp) fwrite(buf, strlen(buf), 1, osCp.dep.conOutFp);
    }
 #endif
 
@@ -6116,33 +5872,25 @@ Txt *buf;                   /* buffer */
 #endif
 #endif
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*mt010.301 */
 /*
-*
-*       Fun:   SFini
-*
-*       Desc:  function, shuts down.
-*
-*       Ret:   Void
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SFini
-(
-void
-)
-#else
-PUBLIC S16 SFini()
-#endif
+ *
+ *       Fun:   SFini
+ *
+ *       Desc:  function, shuts down.
+ *
+ *       Ret:   Void
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SFini(void)
 {
-   TRC1(SFini);
 
    /* mt030.201 added under compilet time flag SS_LINUX and SLES9_PLUS
       a loop to overcome the child processes being killed upon exiting the
@@ -6155,74 +5903,62 @@ PUBLIC S16 SFini()
       pause();
       if(osCp.dep.sigEvnt==TRUE)
       {
-         mtExitClnup();
+        mtExitClnup();
       }
    }
 
 #endif
    pthread_exit(NULLP);
-   RETVALUE(0);
+   return (0);
 }
 \f
 /*
-*
-*       Fun:   Set date and time
-*
-*       Desc:  This function is used to set the calendar
-*              date and time.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Unimplemented
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SSetDateTime
+ *
+ *       Fun:   Set date and time
+ *
+ *       Desc:  This function is used to set the calendar
+ *              date and time.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Unimplemented
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SSetDateTime
 (
-REG1 DateTime *dt           /* date and time */
-)
-#else
-PUBLIC S16 SSetDateTime(dt)
-REG1 DateTime *dt;          /* date and time */
-#endif
+ REG1 DateTime *dt           /* date and time */
+ )
 {
-   TRC1(SSetDateTime);
-
 
    UNUSED(dt);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Get date and time
-*
-*       Desc:  This function is used to determine the calendar
-*              date and time. This information may be used for
-*              some management functions.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - error
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetDateTime
+ *
+ *       Fun:   Get date and time
+ *
+ *       Desc:  This function is used to determine the calendar
+ *              date and time. This information may be used for
+ *              some management functions.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - error
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetDateTime
 (
-REG1 DateTime *dt           /* date and time */
-)
-#else
-PUBLIC S16 SGetDateTime(dt)
-REG1 DateTime *dt;          /* date and time */
-#endif
+ REG1 DateTime *dt           /* date and time */
+ )
 {
    /*-- mt035.201 : SSI enhancements for micro second in datetime struct --*/
    /* time_t tt; --*/
@@ -6235,36 +5971,34 @@ REG1 DateTime *dt;          /* date and time */
    struct tm tme;
 
 
-   TRC1(SGetDateTime);
-
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (dt == NULLP)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT023, ERRZERO, "Null pointer");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
 
-/*-- mt035.201 --*/
+   /*-- mt035.201 --*/
    /*--
-   time(&tt);
-   localtime_r(&tt, &tme);
-   --*/
+     time(&tt);
+     localtime_r(&tt, &tme);
+     --*/
 #ifndef SS_LINUX
-  clock_gettime(CLOCK_REALTIME, &ptime);
+   clock_gettime(CLOCK_REALTIME, &ptime);
 #else
-  gettimeofday(&ptime, NULL);
+   gettimeofday(&ptime, NULL);
 #endif
    localtime_r(&ptime.tv_sec, &tme);
 
-   dt->month = (U8) tme.tm_mon + 1;
-   dt->day = (U8) tme.tm_mday;
-   dt->year = (U8) tme.tm_year;
-   dt->hour = (U8) tme.tm_hour;
-   dt->min = (U8) tme.tm_min;
-   dt->sec = (U8) tme.tm_sec;
+   dt->month = (uint8_t) tme.tm_mon + 1;
+   dt->day = (uint8_t) tme.tm_mday;
+   dt->year = (uint8_t) tme.tm_year;
+   dt->hour = (uint8_t) tme.tm_hour;
+   dt->min = (uint8_t) tme.tm_min;
+   dt->sec = (uint8_t) tme.tm_sec;
    dt->tenths = 0;
 
 #ifdef SS_DATETIME_USEC
@@ -6275,111 +6009,99 @@ REG1 DateTime *dt;          /* date and time */
 #endif
 #endif /*-- SS_DATETIME_USEC --*/
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*
-* Get time from epoch in milliseconds
-*
-*       Fun:   Get time from epoch in milliseconds
-*
-*       Desc:  This function is used to get the time from epoch in milli seconds.
-*              This information may be used for calculating a layer's activation function
-*              execution time used for thread profiling.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - error
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*/
+ * Get time from epoch in milliseconds
+ *
+ *       Fun:   Get time from epoch in milliseconds
+ *
+ *       Desc:  This function is used to get the time from epoch in milli seconds.
+ *              This information may be used for calculating a layer's activation function
+ *              execution time used for thread profiling.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - error
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ */
 /* mt003.301 Modifications */
-#ifdef ANSI
-PUBLIC S16 SGetEpcTime
+   S16 SGetEpcTime
 (
-EpcTime *et           /* date and time */
-)
-#else
-PUBLIC S16 SGetEpcTime(et)
-EpcTime *et;          /* date and time */
-#endif
+ EpcTime *et           /* date and time */
+ )
 {
-/* mt003.301 Modifications */
-PRIVATE U64 now;
-                 U64  to_sec  = 1000000;
-                 U64  to_nsec = 1000;
+   /* mt003.301 Modifications */
+   static uint64_t now;
+   uint64_t  to_sec  = 1000000;
+   uint64_t  to_nsec = 1000;
 #ifndef SS_LINUX
    struct timespec ptime;
 #else
    struct timeval ptime;
 #endif
 
-   TRC1(SEpcTime);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (et == NULLP)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
 
 #ifndef SS_LINUX
-  clock_gettime(CLOCK_REALTIME, &ptime);
+   clock_gettime(CLOCK_REALTIME, &ptime);
 #else
-  gettimeofday(&ptime, NULL);
+   gettimeofday(&ptime, NULL);
 #endif /* SS_LINUX */
 
-    now = (ptime.tv_sec * to_sec);
+   now = (ptime.tv_sec * to_sec);
 
 #ifndef SS_LINUX
    now += (ptime.tv_nsec / to_nsec);
 #else /* SS_LINUX */
-    now += (ptime.tv_usec);
+   now += (ptime.tv_usec);
 
 #endif /* SS_LINUX */
-    now = (now / to_nsec);
+   now = (now / to_nsec);
 
    *et = now;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
 \f
 /*
-*
-*       Fun:   Get system time
-*
-*       Desc:  This function is used to determine the system time.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: osCp.dep.sysTicks is updated by the timer thread.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetSysTime
+ *
+ *       Fun:   Get system time
+ *
+ *       Desc:  This function is used to determine the system time.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: osCp.dep.sysTicks is updated by the timer thread.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetSysTime
 (
-Ticks *sysTime              /* system time */
-)
-#else
-PUBLIC S16 SGetSysTime(sysTime)
-Ticks *sysTime;             /* system time */
-#endif
+ Ticks *sysTime              /* system time */
+ )
 {
-   TRC1(SGetSysTime);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (sysTime == NULLP)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT024, ERRZERO, "Null pointer");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -6387,42 +6109,35 @@ Ticks *sysTime;             /* system time */
    *sysTime = osCp.dep.sysTicks;
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /* mt021.201 - Addition of SGetRefTime function */
 /*
-*
-*       Fun:   Get referenced time
-*
-*       Desc:  This function is used to determine the time in seconds
-*              and microseconds from a reference time.  The reference
-*              time is expressed in seconds from UTC EPOC, January 1,
-*              1970.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - fail
-*
-*       Notes: Macros are defined for reference times:
-*                 SS_REFTIME_01_01_1970
-*                 SS_REFTIME_01_01_2002
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetRefTime
+ *
+ *       Fun:   Get referenced time
+ *
+ *       Desc:  This function is used to determine the time in seconds
+ *              and microseconds from a reference time.  The reference
+ *              time is expressed in seconds from UTC EPOC, January 1,
+ *              1970.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - fail
+ *
+ *       Notes: Macros are defined for reference times:
+ *                 SS_REFTIME_01_01_1970
+ *                 SS_REFTIME_01_01_2002
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetRefTime
 (
-U32 refTime,             /* reference time */
-U32 *sec,
-U32 *usec
-)
-#else
-PUBLIC S16 SGetRefTime(refTime, sec, usec)
-U32 refTime;             /* reference time */
-U32 *sec;
-U32 *usec;
-#endif
+ uint32_t refTime,             /* reference time */
+ uint32_t *sec,
+ uint32_t *usec
+ )
 {
 
 #ifndef SS_LINUX
@@ -6431,25 +6146,24 @@ U32 *usec;
    struct timeval ptime;
 #endif
 
-   TRC1(SGetSysTime);
 
 #ifndef SS_LINUX
-  clock_gettime(CLOCK_REALTIME, &ptime);
+   clock_gettime(CLOCK_REALTIME, &ptime);
 #else
-  gettimeofday(&ptime, NULL);
+   gettimeofday(&ptime, NULL);
 #endif
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (sec == NULLP || usec == NULLP)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT025, ERRZERO, "Null pointer");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    /* mt022.201 - Modification to fix compile warning */
-   if (refTime > (U32)(ptime.tv_sec))
+   if (refTime > (uint32_t)(ptime.tv_sec))
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT026, ERRZERO, "Reference time exceeds present time");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -6460,45 +6174,39 @@ U32 *usec;
    *usec = ptime.tv_usec;
 #endif
 
-  RETVALUE(ROK);
+   return ROK;
 
 }
 
 \f
 /*
-*
-*       Fun:   Get Random Number
-*
-*       Desc:  Invoked by layer when a pseudorandom number is required.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Suggested approach uses shuffled Linear Congruential
-*              Operators as described in Byte magazine October
-*              1984; "Generating and Testing Pseudorandom Numbers"
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SRandom
+ *
+ *       Fun:   Get Random Number
+ *
+ *       Desc:  Invoked by layer when a pseudorandom number is required.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Suggested approach uses shuffled Linear Congruential
+ *              Operators as described in Byte magazine October
+ *              1984; "Generating and Testing Pseudorandom Numbers"
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SRandom
 (
-Random *value               /* random number */
-)
-#else
-PUBLIC S16 SRandom(value)
-Random *value;              /* random number */
-#endif
+ Random *value               /* random number */
+ )
 {
-   TRC1(SRandom);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (value == NULLP)
    {
- /* mt011.21: addition */
     /* mt011.21: addition */
       MTLOGERROR(ERRCLS_INT_PAR, EMT028, (ErrVal)0 , "Null pointer");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -6506,292 +6214,224 @@ Random *value;              /* random number */
    *value = (Random) rand_r(&osCp.dep.randSeed);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Exit Task
-*
-*       Desc:  This function exits from a task.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SExitTsk
-(
-void
-)
-#else
-PUBLIC S16 SExitTsk()
-#endif
+ *
+ *       Fun:   Exit Task
+ *
+ *       Desc:  This function exits from a task.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SExitTsk(void)
 {
-   TRC1(SExitTsk);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Exit Interrupt
-*
-*       Desc:  This function exits from an interrupt.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SExitInt
-(
-void
-)
-#else
-PUBLIC S16 SExitInt()
-#endif
+ *
+ *       Fun:   Exit Interrupt
+ *
+ *       Desc:  This function exits from an interrupt.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SExitInt(void)
 {
-   TRC1(SExitInt);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Hold Interrupt
-*
-*       Desc:  This function prohibits interrupts from being enabled until
-*              release interrupt. This function should be called when
-*              interrupts are disabled and prior to any call to system
-*              services either by entry to an interrupt service routine or
-*              by explicit call to disable interrupt.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Currently does nothing
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SHoldInt
-(
-void
-)
-#else
-PUBLIC S16 SHoldInt()
-#endif
+ *
+ *       Fun:   Hold Interrupt
+ *
+ *       Desc:  This function prohibits interrupts from being enabled until
+ *              release interrupt. This function should be called when
+ *              interrupts are disabled and prior to any call to system
+ *              services either by entry to an interrupt service routine or
+ *              by explicit call to disable interrupt.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Currently does nothing
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SHoldInt(void)
 {
-   TRC1(SHoldInt);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Release Interrupt
-*
-*       Desc:  This function allows interrupts to be enabled.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SRelInt
-(
-void
-)
-#else
-PUBLIC S16 SRelInt()
-#endif
+ *
+ *       Fun:   Release Interrupt
+ *
+ *       Desc:  This function allows interrupts to be enabled.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SRelInt(void)
 {
-   TRC1(SRelInt);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   SEnbInt
-*
-*       Desc:  Enable interrupts
-*
-*       Ret:   ROK on success
-*              RFAILED on error
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC INLINE S16 SEnbInt
-(
-void
-)
-#else
-PUBLIC INLINE S16 SEnbInt()
-#endif
+ *
+ *       Fun:   SEnbInt
+ *
+ *       Desc:  Enable interrupts
+ *
+ *       Ret:   ROK on success
+ *              RFAILED on error
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+inline S16 SEnbInt(void)
 {
-   TRC1(SEnbInt);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   SDisInt
-*
-*       Desc:  Disable interrupts
-*
-*       Ret:   ROK on success
-*              RFAILED on error
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC INLINE S16 SDisInt
-(
-void
-)
-#else
-PUBLIC INLINE S16 SDisInt()
-#endif
+ *
+ *       Fun:   SDisInt
+ *
+ *       Desc:  Disable interrupts
+ *
+ *       Ret:   ROK on success
+ *              RFAILED on error
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+inline S16 SDisInt(void)
 {
-   TRC1(SDisInt);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Get Vector
-*
-*       Desc:  This function gets the function address stored at the
-*              specified interrupt vector.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetVect
+ *
+ *       Fun:   Get Vector
+ *
+ *       Desc:  This function gets the function address stored at the
+ *              specified interrupt vector.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetVect
 (
-VectNmb vectNmb,                /* vector number */
-PIF *vectFnct                   /* vector function */
-)
-#else
-PUBLIC S16 SGetVect(vectNmb, vectFnct)
-VectNmb vectNmb;                /* vector number */
-PIF *vectFnct;                  /* vector function */
-#endif
+ VectNmb vectNmb,                /* vector number */
+ PIF *vectFnct                   /* vector function */
+ )
 {
-   TRC1(SGetVect);
 
 
    UNUSED(vectNmb);
    UNUSED(vectFnct);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 \f
 /*
-*
-*       Fun:   Put Vector
-*
-*       Desc:  This function installs the specified function at the
-*              specified interrupt vector.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes: Currently does nothing.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SPutVect
+ *
+ *       Fun:   Put Vector
+ *
+ *       Desc:  This function installs the specified function at the
+ *              specified interrupt vector.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes: Currently does nothing.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SPutVect
 (
-VectNmb vectNmb,                /* vector number */
-PIF vectFnct                    /* vector function */
-)
-#else
-PUBLIC S16 SPutVect(vectNmb, vectFnct)
-VectNmb vectNmb;                /* vector number */
-PIF vectFnct;                   /* vector function */
-#endif
+ VectNmb vectNmb,                /* vector number */
+ PIF vectFnct                    /* vector function */
+ )
 {
-   TRC1(SPutVect);
 
 
    UNUSED(vectNmb);
    UNUSED(vectFnct);
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /* mt028.201: modification: multiple procs support related changes */
 #ifndef SS_MULTIPLE_PROCS
 \f
 /*
-*
-*       Fun:   SGetEntInst
-*
-*       Desc:  This function gets the current entity and instance.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - failed, general (optional)
-*
-*       Notes: This function may be called by the OS or Layer 1
-*              hardware drivers.
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetEntInst
+ *
+ *       Fun:   SGetEntInst
+ *
+ *       Desc:  This function gets the current entity and instance.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - failed, general (optional)
+ *
+ *       Notes: This function may be called by the OS or Layer 1
+ *              hardware drivers.
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetEntInst
 (
-Ent *ent,                       /* entity */
-Inst *inst                      /* instance */
-)
-#else
-PUBLIC S16 SGetEntInst(ent, inst)
-Ent *ent;                       /* entity */
-Inst *inst;                     /* instance */
-#endif
+ Ent *ent,                       /* entity */
+ Inst *inst                      /* instance */
+ )
 {
    S16 i;
    S16 ret;
@@ -6799,7 +6439,6 @@ Inst *inst;                     /* instance */
    SsSTskEntry *sTsk;
 
 
-   TRC1(SGetEntInst);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -6807,7 +6446,7 @@ Inst *inst;                     /* instance */
    if (ent == NULLP  ||  inst == NULLP)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT029, ERRZERO, "Null pointer");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -6821,52 +6460,46 @@ Inst *inst;                     /* instance */
    ret = SLock(&osCp.sTskTblLock);
    if (ret != ROK)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    for (i = 0;  i < SS_MAX_STSKS;  i++)
    {
       if (pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
       {
-         sTsk = &osCp.sTskTbl[i];
-         break;
+        sTsk = &osCp.sTskTbl[i];
+        break;
       }
    }
    if (sTsk != NULLP)
    {
-         *ent = sTsk->dep.ent;
-         *inst = sTsk->dep.inst;
+      *ent = sTsk->dep.ent;
+      *inst = sTsk->dep.inst;
    }
    SUnlock(&osCp.sTskTblLock);
 
 
-   RETVALUE(ret == ROK ? ROK : RFAILED);
+   return (ret == ROK ? ROK : RFAILED);
 }
 
 \f
 /*
-*
-*       Fun:   SSetEntInst
-*
-*       Desc:  This function sets the current entity and instance.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SSetEntInst
+ *
+ *       Fun:   SSetEntInst
+ *
+ *       Desc:  This function sets the current entity and instance.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SSetEntInst
 (
-Ent ent,                    /* entity */
-Inst inst                   /* instance */
-)
-#else
-PUBLIC S16 SSetEntInst(ent, inst)
-Ent ent;                    /* entity */
-Inst inst;                  /* instance */
-#endif
+ Ent ent,                    /* entity */
+ Inst inst                   /* instance */
+ )
 {
    S16 i;
    S16 ret;
@@ -6874,7 +6507,6 @@ Inst inst;                  /* instance */
    SsSTskEntry *sTsk;
 
 
-   TRC1(SSetEntInst);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
@@ -6882,7 +6514,7 @@ Inst inst;                  /* instance */
    if (ent >= ENTNC  ||  inst >= INSTNC)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT030, ERRZERO, "Invalid entity/instance");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -6896,25 +6528,25 @@ Inst inst;                  /* instance */
    ret = SLock(&osCp.sTskTblLock);
    if (ret != ROK)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    for (i = 0;  i < SS_MAX_STSKS;  i++)
    {
       if (pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
       {
-         sTsk = &osCp.sTskTbl[i];
-         break;
+        sTsk = &osCp.sTskTbl[i];
+        break;
       }
    }
    if (sTsk != NULLP)
    {
-         sTsk->dep.ent = ent;
-         sTsk->dep.inst = inst;
+      sTsk->dep.ent = ent;
+      sTsk->dep.inst = inst;
    }
    SUnlock(&osCp.sTskTblLock);
 
 
-   RETVALUE(ret == ROK ? ROK : RFAILED);
+   return (ret == ROK ? ROK : RFAILED);
 }
 
 #endif /* SS_MULTIPLE_PROCS */
@@ -6922,42 +6554,35 @@ Inst inst;                  /* instance */
 #ifdef SS_DRVR_SUPPORT
 \f
 /*
-*
-*       Fun:   SSetIntPend
-*
-*       Desc:  Set interrupt pending flag
-*
-*       Ret:   ROK on success
-*              RFAILED on error
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC INLINE S16 SSetIntPend
+ *
+ *       Fun:   SSetIntPend
+ *
+ *       Desc:  Set interrupt pending flag
+ *
+ *       Ret:   ROK on success
+ *              RFAILED on error
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   inline S16 SSetIntPend
 (
-U16 id,                         /* driver task identifier */
-Bool flag                       /* flag */
-)
-#else
-PUBLIC INLINE S16 SSetIntPend(id, flag)
-U16 id;                         /* driver task identifier */
-Bool flag;                      /* flag */
-#endif
+ uint16_t id,                         /* driver task identifier */
+ Bool flag                       /* flag */
+ )
 {
    MtIsFlag isFlag;
 
 
-   TRC1(SSetIntPend);
 
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (id >= SS_MAX_DRVRTSKS  ||  osCp.drvrTskTbl[id].used == FALSE)
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT031, id, "Invalid instance");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -6967,44 +6592,36 @@ Bool flag;                      /* flag */
 
    if (write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag)) != sizeof(isFlag))
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif  /* SS_DRVR_SUPPORT */
 
 
 #ifdef SS_LOCKLESS_MEMORY
 /*
-*
-*       Fun:   SGlobMemInfoShow
-*
-*       Desc:  This function displays the memory usage information
-*              for the destined region. It will show the usage of
-*              each configured bucket and the heap for the specified region.
-*
-*       Ret:   ROK             OK
-*              RFAILED         Region not registered
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGlobMemInfoShow
-(
-Void
-)
-#else
-PUBLIC S16 SGlobMemInfoShow()
-#endif
+ *
+ *       Fun:   SGlobMemInfoShow
+ *
+ *       Desc:  This function displays the memory usage information
+ *              for the destined region. It will show the usage of
+ *              each configured bucket and the heap for the specified region.
+ *
+ *       Ret:   ROK            OK
+ *              RFAILED                Region not registered
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 SGlobMemInfoShow(Void)
 {
-   U16   idx;
+   uint16_t   idx;
    Txt   prntBuf[100];
    CmMmGlobRegCb   *globReg;
-   
-   TRC1(SGlobMemInfoShow);
+
 
    globReg = osCp.globRegCb;
 
@@ -7018,20 +6635,20 @@ PUBLIC S16 SGlobMemInfoShow()
    SDisplay(0, prntBuf);
    sprintf(prntBuf, "====================================================\n");
    SDisplay(0, prntBuf);
-   
+
 
    for (idx = 0; idx < globReg->numBkts; idx++)
    {
 #ifdef XEON_SPECIFIC_CHANGES
       sprintf(prntBuf, "%2u  %12lu  %12lu  %8lu %9lu\n",
-              idx, globReg->bktTbl[idx].size, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
+           idx, globReg->bktTbl[idx].size, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
 #else      
 #ifndef ALIGN_64BIT
       sprintf(prntBuf, "%2u  %12lu  %8lu %9lu\n", 
-              idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
+           idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
 #else
       sprintf(prntBuf, "%2u  %12u  %8u %9u\n", 
-              idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
+           idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
 #endif
 #endif      
       SDisplay(0, prntBuf);
@@ -7039,82 +6656,75 @@ PUBLIC S16 SGlobMemInfoShow()
    sprintf(prntBuf, "--------------------------------------------------------------\n");
    SDisplay(0, prntBuf);
 
-   RETVALUE(ROK);
+   return ROK;
 }   
 
 #endif /* SS_LOCKLESS_MEMORY */
 
 /*
-Bool IsMemoryThresholdHit(Region reg, Pool pool)
-{
-  if((mtCMMRegCb[reg]->bktTbl[pool].numAlloc * 100 )/mtCMMRegCb[reg]->bktTbl[pool].numBlks > 70)
-  {
-     MSPD_DBG("Threshold reached reg(%d) pool(%d) numAllc(%d) numBlks(%d)\n",
-               reg,
-               pool,
-               mtCMMRegCb[reg]->bktTbl[pool].numAlloc,
-               mtCMMRegCb[reg]->bktTbl[pool].numBlks);
-     RETVALUE(TRUE);
-  }
-  RETVALUE(FALSE);
-}
-*/
+   Bool IsMemoryThresholdHit(Region reg, Pool pool)
+   {
+   if((mtCMMRegCb[reg]->bktTbl[pool].numAlloc * 100 )/mtCMMRegCb[reg]->bktTbl[pool].numBlks > 70)
+   {
+   MSPD_DBG("Threshold reached reg(%d) pool(%d) numAllc(%d) numBlks(%d)\n",
+   reg,
+   pool,
+   mtCMMRegCb[reg]->bktTbl[pool].numAlloc,
+   mtCMMRegCb[reg]->bktTbl[pool].numBlks);
+   return (TRUE);
+   }
+   return (FALSE);
+   }
+ */
 
 /* mt022.201 - Addition of SRegInfoShow function */
 /*
-*
-*       Fun:   SRegInfoShow
-*
-*       Desc:  This function displays the memory usage information
-*              for the destined region. It will show the usage of
-*              each configured bucket and the heap for the specified region.
-*
-*       Ret:   ROK             OK
-*              RFAILED         Region not registered
-*
-*       Notes: A Sample Output from the function
-*       Bucket Memory: region 1
-*       ====================================================
-*       Bucket  Number of Blks configured  Size  Allocated
-*       ====================================================
-*       0                     1             16         1
-*       1                     1             32         0
-*       2                     1             80         0
-*       3                     1            256         0
-*       4                     1            320         0
-*
-*       ---------------
-*       Heap Memory: region 1
-*       Heap Size: 0
-*       Heap Allocated: 0
-*       Heap Segmented blocks: 0
-*
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SRegInfoShow
+ *
+ *       Fun:   SRegInfoShow
+ *
+ *       Desc:  This function displays the memory usage information
+ *              for the destined region. It will show the usage of
+ *              each configured bucket and the heap for the specified region.
+ *
+ *       Ret:   ROK            OK
+ *              RFAILED                Region not registered
+ *
+ *       Notes: A Sample Output from the function
+ *       Bucket Memory: region 1
+ *       ====================================================
+ *       Bucket  Number of Blks configured  Size  Allocated
+ *       ====================================================
+ *       0                     1             16         1
+ *       1                     1             32         0
+ *       2                     1             80         0
+ *       3                     1            256         0
+ *       4                     1            320         0
+ *
+ *       ---------------
+ *       Heap Memory: region 1
+ *       Heap Size: 0
+ *       Heap Allocated: 0
+ *       Heap Segmented blocks: 0
+ *
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SRegInfoShow
 (
-Region region,
-U32 *availmem
-)
-#else
-PUBLIC S16 SRegInfoShow(region, availmem)
-Region region;
-U32 *availmem;
-#endif
+ Region region,
+ uint32_t *availmem
+ )
 {
-   U16   idx;
+   uint16_t   idx;
    Txt   prntBuf[100];
 
-   TRC1(SRegInfoShow);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (region > (SS_MAX_REGS-1) )
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT032, ERRZERO, "Invalid Region");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -7137,109 +6747,97 @@ U32 *availmem;
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
 #ifdef ALIGN_64BIT
       sprintf((char *)prntBuf, "%2u              %8u          %5u  %8u  %8u\n",
-            idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
-            mtCMMRegCb[region]->bktTbl[idx].size,
-            mtCMMRegCb[region]->bktTbl[idx].numAlloc,
-            mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
+           idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+           mtCMMRegCb[region]->bktTbl[idx].size,
+           mtCMMRegCb[region]->bktTbl[idx].numAlloc,
+           mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
 #else
       sprintf((char *)prntBuf, "%2u              %8lu          %5lu  %8lu  %8lu\n",
-            idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
-            mtCMMRegCb[region]->bktTbl[idx].size,
-            mtCMMRegCb[region]->bktTbl[idx].numAlloc,
-            mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
+           idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+           mtCMMRegCb[region]->bktTbl[idx].size,
+           mtCMMRegCb[region]->bktTbl[idx].numAlloc,
+           mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
 #endif
 #else
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "%2u              %8u          %5u  %8u\n",
-              idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
-              mtCMMRegCb[region]->bktTbl[idx].size,
-              mtCMMRegCb[region]->bktTbl[idx].numAlloc);
+           idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+           mtCMMRegCb[region]->bktTbl[idx].size,
+           mtCMMRegCb[region]->bktTbl[idx].numAlloc);
 #else
       sprintf(prntBuf, "%2u              %8lu          %5lu  %8lu\n",
-              idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
-              mtCMMRegCb[region]->bktTbl[idx].size,
-              mtCMMRegCb[region]->bktTbl[idx].numAlloc);
+           idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+           mtCMMRegCb[region]->bktTbl[idx].size,
+           mtCMMRegCb[region]->bktTbl[idx].numAlloc);
 #endif
 #endif /* not TENB_RTLIN_CHANGES */
       SDisplay(0, prntBuf);
       *availmem = *availmem + (mtCMMRegCb[region]->bktTbl[idx].size * \
-          (mtCMMRegCb[region]->bktTbl[idx].numBlks -  \
-          mtCMMRegCb[region]->bktTbl[idx].numAlloc));
+           (mtCMMRegCb[region]->bktTbl[idx].numBlks -  \
+            mtCMMRegCb[region]->bktTbl[idx].numAlloc));
    }
    sprintf(prntBuf, "\n---------------\n");
    SDisplay(0, prntBuf);
    sprintf(prntBuf, "Heap Memory: region %d\n", region);
    SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+   /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
    sprintf(prntBuf, "Heap Size: %u\n", mtCMMRegCb[region]->heapSize);
 #else
    sprintf(prntBuf, "Heap Size: %lu\n", mtCMMRegCb[region]->heapSize);
 #endif
    SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+   /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
    sprintf(prntBuf, "Heap Allocated: %u\n",
-           (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
+        (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
 #else
    sprintf(prntBuf, "Heap Allocated: %lu\n",
-           (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
+        (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
 #endif
    SDisplay(0, prntBuf);
    *availmem = *availmem + mtCMMRegCb[region]->heapCb.avlSize;
 #if (ERRCLASS & ERRCLS_DEBUG)
    sprintf(prntBuf, "Heap Segmented blocks: %d\n",
-                    mtCMMRegCb[region]->heapCb.numFragBlk);
+        mtCMMRegCb[region]->heapCb.numFragBlk);
    SDisplay(0, prntBuf);
 #endif
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #ifdef XEON_SPECIFIC_CHANGES
 #define  SSI_MAX_BKT_THRESHOLD 6
 #define  SSI_MAX_REG_THRESHOLD 2
-U32 SMemMaxThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
-U32 SMemMidThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
-U32 SMemLowThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
+uint32_t SMemMaxThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
+uint32_t SMemMidThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
+uint32_t SMemLowThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
 
-#ifdef ANSI
-PRIVATE Void SInitMemThreshold
+   static Void SInitMemThreshold
 (
-Region region,
-U8     maxBkt
-)
-#else
-PRIVATE Void SInitMemThreshold(region, maxBkt)
-Region region;
-U8     maxBkt;
-#endif
+ Region region,
+ uint8_t     maxBkt
+ )
 {
-   U8   idx = 0;
+   uint8_t   idx = 0;
    for (idx = 0; (idx < maxBkt && idx < mtCMMRegCb[region]->numBkts); idx++)
    {
       SMemMaxThreshold[region][idx] = (mtCMMRegCb[region]->bktTbl[idx].numBlks*95)/100;
       SMemMidThreshold[region][idx] = (mtCMMRegCb[region]->bktTbl[idx].numBlks*85)/100;
       SMemLowThreshold[region][idx] = (mtCMMRegCb[region]->bktTbl[idx].numBlks*80)/100;
-      printf("REGION:%d, BKT:%d max:%d mid:%d low:%d\n", region, idx, SMemMaxThreshold[region][idx], SMemMidThreshold[region][idx], SMemLowThreshold[region][idx]);
+      printf("\nREGION:%d, BKT:%d max:%d mid:%d low:%d\n", region, idx, SMemMaxThreshold[region][idx], SMemMidThreshold[region][idx], SMemLowThreshold[region][idx]);
    }
 }
 
-#ifdef ANSI
-PUBLIC S16 SRegReachedMemThreshold
+   S16 SRegReachedMemThreshold
 (
-Region region,
-U8     maxBkt
-)
-#else
-PUBLIC S16 SRegReachedMemThreshold(region, maxBkt)
-Region region;
-U8     maxBkt;
-#endif
+ Region region,
+ uint8_t     maxBkt
+ )
 {
-   U8           idx       = 0;
-   U8           memStatus = 3;
-   PRIVATE U8   initFlag  = 1;
+   uint8_t           idx       = 0;
+   uint8_t           memStatus = 3;
+   static uint8_t   initFlag  = 1;
    if(initFlag)
    {
       initFlag = 0;
@@ -7250,59 +6848,52 @@ U8     maxBkt;
    {
       if(mtCMMRegCb[region]->bktTbl[idx].numAlloc >= SMemMaxThreshold[region][idx])
       {
-         memStatus = 0;
-         break;
+        memStatus = 0;
+        break;
       }
       else if((mtCMMRegCb[region]->bktTbl[idx].numAlloc >= SMemMidThreshold[region][idx]) && (memStatus >1))
       {
-         memStatus = 1;
+        memStatus = 1;
       }
       else if((mtCMMRegCb[region]->bktTbl[idx].numAlloc >= SMemLowThreshold[region][idx]) && (memStatus >2))
       {
-         memStatus = 2;
+        memStatus = 2;
       }
    }
-   RETVALUE(memStatus);
+   return (memStatus);
 }
 #endif
 /* mt033.201 - addition of API to return the memory statistical data */
 /*
-*
-*       Fun:   SGetRegInfo
-*
-*       Desc:  This function returns the memory usage information
-*              for the destined region. It will return the usage of
-*              each configured bucket and the heap for the specified region.
-*
-*       Ret:   ROK   OK
-*              RFAILED   Region not registered
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SGetRegInfo
+ *
+ *       Fun:   SGetRegInfo
+ *
+ *       Desc:  This function returns the memory usage information
+ *              for the destined region. It will return the usage of
+ *              each configured bucket and the heap for the specified region.
+ *
+ *       Ret:   ROK   OK
+ *              RFAILED   Region not registered
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SGetRegInfo
 (
-Region region,
-SsMemDbgInfo *dbgInfo
-)
-#else
-PUBLIC S16 SGetRegInfo(region, dbgInfo)
-Region region;
-SsMemDbgInfo *dbgInfo;
-#endif
+ Region region,
+ SsMemDbgInfo *dbgInfo
+ )
 {
-   U32 idx;
+   uint32_t idx;
 
-   TRC1(SGetRegInfo);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (region >= mtMemoCfg.numRegions )
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT033, ERRZERO, "Invalid Region");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -7320,8 +6911,8 @@ SsMemDbgInfo *dbgInfo;
       dbgInfo->bktDbgTbl[idx].numAlloc = mtCMMRegCb[region]->bktTbl[idx].numAlloc;
 
       dbgInfo->availmem += (mtCMMRegCb[region]->bktTbl[idx].size * \
-                           (mtCMMRegCb[region]->bktTbl[idx].numBlks -  \
-                            mtCMMRegCb[region]->bktTbl[idx].numAlloc));
+           (mtCMMRegCb[region]->bktTbl[idx].numBlks -  \
+            mtCMMRegCb[region]->bktTbl[idx].numAlloc));
    }
 
    dbgInfo->region = region;
@@ -7329,7 +6920,7 @@ SsMemDbgInfo *dbgInfo;
    dbgInfo->heapSize = mtCMMRegCb[region]->heapSize;
 
    dbgInfo->heapAlloc = (mtCMMRegCb[region]->heapSize - \
-                         mtCMMRegCb[region]->heapCb.avlSize);
+        mtCMMRegCb[region]->heapCb.avlSize);
 
    dbgInfo->availmem += mtCMMRegCb[region]->heapCb.avlSize;
 
@@ -7337,27 +6928,21 @@ SsMemDbgInfo *dbgInfo;
    dbgInfo->numFragBlk = mtCMMRegCb[region]->heapCb.numFragBlk;
 #endif
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 SGetRegPoolInfo
+   S16 SGetRegPoolInfo
 (
-U8 *numRegion,
-U8 *numPool
-)
-#else
-PUBLIC S16 SGetRegPoolInfo(numRegion, numPool)
-U8 *numRegion;
-U8 *numPool;
-#endif
+ uint8_t *numRegion,
+ uint8_t *numPool
+ )
 {
    /* Send number of Region available */
    *numRegion = mtMemoCfg.numRegions;
    /* Send number of Pools available */
    *numPool = cfgRegInfo[0].numPools;
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /* mt033.201 - addition of APIs to print the memory statistical data
@@ -7372,41 +6957,34 @@ U8 *numPool;
  *              for the destined region. It will show the total memory
  *              used for static and dynamic memory if typeFlag is
  *              SS_MEM_BKT_ALLOC_PROFILE. It will show the number of
-*              memory block allocated for a particular size if typeFlag
-*              is SS_MEM_BLK_SIZE_PROFILE from the hash list by
-*              calling SRegPrintMemStats.
-*
-*       Ret:   ROK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SPrintRegMemStatusInfo
+ *              memory block allocated for a particular size if typeFlag
+ *              is SS_MEM_BLK_SIZE_PROFILE from the hash list by
+ *              calling SRegPrintMemStats.
+ *
+ *       Ret:   ROK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SPrintRegMemStatusInfo
 (
-Region region,
-U8 typeFlag
-)
-#else
-PUBLIC S16 SPrintRegMemStatusInfo(region, typeFlag)
-Region region;
-U8 typeFlag;
-#endif
+ Region region,
+ uint8_t typeFlag
+ )
 {
    Txt prntBuf[150];
-   U32 idx;
-   U32 statMemSize;
-   U32 dynMemSize;
+   uint32_t idx;
+   uint32_t statMemSize;
+   uint32_t dynMemSize;
 
-   TRC1(SPrintRegMemStatusInfo);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (region >= mtMemoCfg.numRegions )
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT034, ERRZERO, "Invalid Region");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -7427,23 +7005,23 @@ U8 typeFlag;
       SDisplay(0, prntBuf);
       for (idx = 0; idx < mtCMMRegCb[region]->numBkts; idx++)
       {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-         sprintf(prntBuf, "%2u           %8u           %8u\n", idx,
-                     mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
-                     mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
-#else
-         sprintf(prntBuf, "%2lu           %8lu           %8lu\n", idx,
-                     mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
-                     mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
-#endif
-         SDisplay(0, prntBuf);
-         /* update the total count */
-         statMemSize += mtCMMRegCb[region]->bktTbl[idx].staticMemUsed;
-         dynMemSize += mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed;
+        sprintf(prntBuf, "%2u           %8u           %8u\n", idx,
+              mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
+              mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
+#else
+        sprintf(prntBuf, "%2lu           %8lu           %8lu\n", idx,
+              mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
+              mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
+#endif
+        SDisplay(0, prntBuf);
+        /* update the total count */
+        statMemSize += mtCMMRegCb[region]->bktTbl[idx].staticMemUsed;
+        dynMemSize += mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed;
       }
       /* from buckets */
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "Total Static Memory allocated from buckets: %u\n", statMemSize);
       SDisplay(0, prntBuf);
@@ -7458,20 +7036,20 @@ U8 typeFlag;
       /* from heap */
       sprintf(prntBuf, "\n\nAllocated Memory profile from Heap of region: %d \n", region);
       SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "STATIC MEMORY: %u      DYNAMIC MEMORY:%u \n",
-         mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
+           mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
 #else
       sprintf(prntBuf, "STATIC MEMORY: %lu     DYNAMIC MEMORY:%lu \n",
-         mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
+           mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
 #endif
       SDisplay(0, prntBuf);
    }
    else if (typeFlag == SS_MEM_BLK_SIZE_PROFILE)
    {
       /* Bucket Memory allocation Statistics */
-      RETVALUE(SPrintRegMemStats(region));
+      return (SPrintRegMemStats(region));
    }
    else
    {
@@ -7480,47 +7058,38 @@ U8 typeFlag;
       SDisplay(0, prntBuf);
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*
-*
-*       Fun:   SPrintRegMemStats
-*
-*       Desc:  This function displays the memory usage information for
-*              the destined region. It will show the number of memory
-*              block allocated for a particular size from the hash list.
-*
-*       Ret:   ROK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PRIVATE S16 SPrintRegMemStats
-(
-Region region
-)
-#else
-PRIVATE S16 SPrintRegMemStats(region)
-Region region;
-#endif
+ *
+ *       Fun:   SPrintRegMemStats
+ *
+ *       Desc:  This function displays the memory usage information for
+ *              the destined region. It will show the number of memory
+ *              block allocated for a particular size from the hash list.
+ *
+ *       Ret:   ROK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+static S16 SPrintRegMemStats(Region region)
 {
    CmMmHashListCp *hashListCp;
    Txt prntBuf[150];
-   U32 idx;
-   U32 cntEnt;
+   uint32_t idx;
+   uint32_t cntEnt;
 
-   TRC1(SPrintRegMemStats);
 
    hashListCp = &mtCMMRegCb[region]->hashListCp;
 
    sprintf(prntBuf, "\n\nSize Vs. NumAttempts and Alloc/Dealloc profile of region %d\n", region);
    SDisplay(0, prntBuf);
    sprintf(prntBuf, "Maximum Entries: %u    Current Entries: %u\n",
-                     hashListCp->numOfbins, hashListCp->numOfEntries);
+        hashListCp->numOfbins, hashListCp->numOfEntries);
    SDisplay(0, prntBuf);
    sprintf(prntBuf, "===================================\n");
    SDisplay(0, prntBuf);
@@ -7530,20 +7099,20 @@ Region region;
    SDisplay(0, prntBuf);
 
    for (idx = 0, cntEnt=0; (cntEnt < hashListCp->numOfEntries) &&
-               (idx < CMM_STAT_HASH_TBL_LEN); idx++)
+        (idx < CMM_STAT_HASH_TBL_LEN); idx++)
    {
       if (hashListCp->hashList[idx].numAttempts)
       {
-         cntEnt++;
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        cntEnt++;
+        /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-         sprintf(prntBuf, "%8u           %8u\n", hashListCp->hashList[idx].size,
-                     hashListCp->hashList[idx].numAttempts);
+        sprintf(prntBuf, "%8u           %8u\n", hashListCp->hashList[idx].size,
+              hashListCp->hashList[idx].numAttempts);
 #else
-         sprintf(prntBuf, "%8lu           %8lu\n", hashListCp->hashList[idx].size,
-                     hashListCp->hashList[idx].numAttempts);
+        sprintf(prntBuf, "%8lu           %8lu\n", hashListCp->hashList[idx].size,
+              hashListCp->hashList[idx].numAttempts);
 #endif
-         SDisplay(0, prntBuf);
+        SDisplay(0, prntBuf);
       }
    }
 
@@ -7559,69 +7128,61 @@ Region region;
    /* Print the statistics of total number of alloc/de-alloc attempts in each bucket of this region */
    for (idx = 0; idx < mtCMMRegCb[region]->numBkts; idx++)
    {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "%4u        %8u             %8u\n", idx,
-                           mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
-                           mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
+           mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
+           mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
 #else
       sprintf(prntBuf, "%4lu        %8lu             %8lu\n", idx,
-                           mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
-                           mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
+           mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
+           mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
 #endif
       SDisplay(0, prntBuf);
    }
    sprintf(prntBuf, "\nAllocation/De-allocation profile in Heap\n");
    SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+   /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
    sprintf(prntBuf, "Num of Alloc Attempts: %u      Num of De-alloc Attempts: %u\n",
-                           mtCMMRegCb[region]->heapCb.numAllocAttempts,
-                           mtCMMRegCb[region]->heapCb.numDeallocAttempts);
+        mtCMMRegCb[region]->heapCb.numAllocAttempts,
+        mtCMMRegCb[region]->heapCb.numDeallocAttempts);
 #else
    sprintf(prntBuf, "Num of Alloc Attempts: %lu      Num of De-alloc Attempts: %lu\n",
-                           mtCMMRegCb[region]->heapCb.numAllocAttempts,
-                           mtCMMRegCb[region]->heapCb.numDeallocAttempts);
+        mtCMMRegCb[region]->heapCb.numAllocAttempts,
+        mtCMMRegCb[region]->heapCb.numDeallocAttempts);
 #endif
    SDisplay(0, prntBuf);
    sprintf(prntBuf, "\n");
    SDisplay(0, prntBuf);
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*
-*
-*       Fun:   SRegMemErrHdlr
-*
-*       Desc:  This function handles the errors returned from the memory
-*              related functions. Customers are suggested to modify this
-*              API according to their specific requirement.
-*
-*       Ret:   ROK   OK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC Void SRegMemErrHdlr
+ *
+ *       Fun:   SRegMemErrHdlr
+ *
+ *       Desc:  This function handles the errors returned from the memory
+ *              related functions. Customers are suggested to modify this
+ *              API according to their specific requirement.
+ *
+ *       Ret:   ROK   OK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   Void SRegMemErrHdlr
 (
-Region region,
-Data *ptr,
-S16 errCode
-)
-#else
-PUBLIC Void SRegMemErrHdlr(region, ptr, errCode)
-Region region;
-Data *ptr;
-S16 errCode;
-#endif
+ Region region,
+ Data *ptr,
+ S16 errCode
+ )
 {
    Txt prntBuf[150];
 
-   TRC1(SRegMemErrHdlr);
 
    if (errCode == RDBLFREE)
    {
@@ -7634,34 +7195,29 @@ S16 errCode;
       SDisplay(0, prntBuf);
    }
 
-   RETVOID;
+   return;
 }
 
 /*
-*
-*       Fun:   SPrintRegMemProfile
-*
-*       Desc:  This function displays the memory profile information
-*              for the destined region. This function prints for:
-*              1) each memory bucket-Block address, size, size for which it is allocated, free/allocated, static/dynamic
-*              2) heap - memory block address, size, requested size, free/allocated, static/dynamic
-*
-*       Ret:   ROK   OK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SPrintRegMemProfile
+ *
+ *       Fun:   SPrintRegMemProfile
+ *
+ *       Desc:  This function displays the memory profile information
+ *              for the destined region. This function prints for:
+ *              1) each memory bucket-Block address, size, size for which it is allocated, free/allocated, static/dynamic
+ *              2) heap - memory block address, size, requested size, free/allocated, static/dynamic
+ *
+ *       Ret:   ROK   OK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+   S16 SPrintRegMemProfile
 (
-Region region
-)
-#else
-PUBLIC S16 SPrintRegMemProfile(region)
-Region region;
-#endif
+ Region region
+ )
 {
    CmMmHeapCb *heapCb;
    CmMmRegCb *regCb;
@@ -7670,17 +7226,16 @@ Region region;
    Size offsetToNxtBlk;
    Size hdrSize;
    Txt prntBuf[250];
-   U32 idx;
-   U32 blkCnt;
+   uint32_t idx;
+   uint32_t blkCnt;
 
 
-   TRC1(SPrintRegMemProfile);
 
 #if (ERRCLASS & ERRCLS_INT_PAR)
    if (region >= mtMemoCfg.numRegions )
    {
       MTLOGERROR(ERRCLS_INT_PAR, EMT035, ERRZERO, "Invalid Region");
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif
 
@@ -7697,13 +7252,13 @@ Region region;
    for (idx = 0; idx < regCb->numBkts; idx++)
    {
 
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "\nBucket number:%4u  of Size:%u  Num of Blocks: %u\n",
-                        idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
+           idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
 #else
       sprintf(prntBuf, "\nBucket number:%4lu  of Size:%lu  Num of Blocks: %lu\n",
-                        idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
+           idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
 #endif
       SDisplay(0, prntBuf);
 
@@ -7717,60 +7272,60 @@ Region region;
       offsetToNxtBlk = regCb->bktTbl[idx].size + sizeof(CmMmBlkHdr);
 
       for (blkCnt=0, curBktBlk = (CmMmBlkHdr *)(regCb->bktTbl[idx].bktStartPtr);
-            ((curBktBlk) && (blkCnt < regCb->bktTbl[idx].numBlks));
-            curBktBlk = (CmMmBlkHdr *)((Data *)curBktBlk + offsetToNxtBlk), blkCnt++)
+           ((curBktBlk) && (blkCnt < regCb->bktTbl[idx].numBlks));
+           curBktBlk = (CmMmBlkHdr *)((Data *)curBktBlk + offsetToNxtBlk), blkCnt++)
       {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-         sprintf(prntBuf, "%6u   %8p", blkCnt, (void *)curBktBlk);
+        sprintf(prntBuf, "%6u   %8p", blkCnt, (void *)curBktBlk);
 #else
-         sprintf(prntBuf, "%6lu   %8p", blkCnt, (void *)curBktBlk);
+        sprintf(prntBuf, "%6lu   %8p", blkCnt, (void *)curBktBlk);
 #endif
-         SDisplay(0, prntBuf);
-         /* check if it is a sane block, elxe jump to next block */
-         if (cmMmRegIsBlkSane(curBktBlk) != ROK)
-         {
-            sprintf(prntBuf, "     Trampled                         \n");
-            SDisplay(0, prntBuf);
+        SDisplay(0, prntBuf);
+        /* check if it is a sane block, elxe jump to next block */
+        if (cmMmRegIsBlkSane(curBktBlk) != ROK)
+        {
+           sprintf(prntBuf, "     Trampled                         \n");
+           SDisplay(0, prntBuf);
 
-            continue;
-         }
+           continue;
+        }
 
-         if (CMM_IS_STATIC(curBktBlk->memFlags))
-         {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        if (CMM_IS_STATIC(curBktBlk->memFlags))
+        {
+           /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-            sprintf(prntBuf, "     Allocated     Static      %8u\n", curBktBlk->requestedSize);
+           sprintf(prntBuf, "     Allocated     Static      %8u\n", curBktBlk->requestedSize);
 #else
-            sprintf(prntBuf, "     Allocated     Static      %8lu\n", curBktBlk->requestedSize);
+           sprintf(prntBuf, "     Allocated     Static      %8lu\n", curBktBlk->requestedSize);
 #endif
-            SDisplay(0, prntBuf);
-         }
-         else if (CMM_IS_DYNAMIC(curBktBlk->memFlags))
-         {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+           SDisplay(0, prntBuf);
+        }
+        else if (CMM_IS_DYNAMIC(curBktBlk->memFlags))
+        {
+           /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-            sprintf(prntBuf, "     Allocated       Dynamic      %8u\n", curBktBlk->requestedSize);
+           sprintf(prntBuf, "     Allocated       Dynamic      %8u\n", curBktBlk->requestedSize);
 #else
-            sprintf(prntBuf, "     Allocated       Dynamic      %8lu\n", curBktBlk->requestedSize);
+           sprintf(prntBuf, "     Allocated       Dynamic      %8lu\n", curBktBlk->requestedSize);
 #endif
-            SDisplay(0, prntBuf);
-         }
-         else if (CMM_IS_FREE(curBktBlk->memFlags))
-         {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+           SDisplay(0, prntBuf);
+        }
+        else if (CMM_IS_FREE(curBktBlk->memFlags))
+        {
+           /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-            sprintf(prntBuf, "     Free                        %8u\n", curBktBlk->requestedSize);
+           sprintf(prntBuf, "     Free                        %8u\n", curBktBlk->requestedSize);
 #else
-            sprintf(prntBuf, "     Free                        %8lu\n", curBktBlk->requestedSize);
+           sprintf(prntBuf, "     Free                        %8lu\n", curBktBlk->requestedSize);
 #endif
-            SDisplay(0, prntBuf);
-         }
-         else
-         {
-            sprintf(prntBuf, "     Trampled                         \n");
-            SDisplay(0, prntBuf);
-         }
+           SDisplay(0, prntBuf);
+        }
+        else
+        {
+           sprintf(prntBuf, "     Trampled                         \n");
+           SDisplay(0, prntBuf);
+        }
       }
    }
 
@@ -7793,9 +7348,9 @@ Region region;
    /* traverse the entire heap to output the heap profile */
    hdrSize = sizeof(CmHEntry);
    for (blkCnt=0, curHBlk = (CmHEntry *)heapCb->vStart;
-            ((curHBlk) && (curHBlk < (CmHEntry *)heapCb->vEnd)); blkCnt++)
+        ((curHBlk) && (curHBlk < (CmHEntry *)heapCb->vEnd)); blkCnt++)
    {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "%6u   %8p", blkCnt, (void *)curHBlk);
 #else
@@ -7806,22 +7361,22 @@ Region region;
       /* check if it is a sane block, elxe jump to next block */
       if (cmMmRegIsBlkSane((CmMmBlkHdr *)curHBlk) != ROK)
       {
-         sprintf(prntBuf, "                Trampled                         \n");
-         SDisplay(0, prntBuf);
-
-         sprintf(prntBuf, "Trampled block encountered: Stopping heap profile\n");
-         SDisplay(0, prntBuf);
-
-         /*
-         * To go to next block in the heap we do not have any offset value
-         * other than curHBlk->size. As the block is already trampled
-         * we cannot rely on this size. So it is better to stop here unless there
-         * exists any other mechanism(?) to know the offset to next block.
-         */
-         RETVALUE(ROK);
+        sprintf(prntBuf, "                Trampled                         \n");
+        SDisplay(0, prntBuf);
+
+        sprintf(prntBuf, "Trampled block encountered: Stopping heap profile\n");
+        SDisplay(0, prntBuf);
+
+        /*
+         * To go to next block in the heap we do not have any offset value
+         * other than curHBlk->size. As the block is already trampled
+         * we cannot rely on this size. So it is better to stop here unless there
+         * exists any other mechanism(?) to know the offset to next block.
+         */
+        return ROK;
       }
 
-/*mt009.301 Fixed 64BIT compilation warnings*/
+      /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
       sprintf(prntBuf, "   %8u", curHBlk->size);
 #else
@@ -7831,72 +7386,67 @@ Region region;
 
       if (CMM_IS_STATIC(curHBlk->memFlags))
       {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-         sprintf(prntBuf, "     Allocated       Static       %8u\n", curHBlk->requestedSize);
+        sprintf(prntBuf, "     Allocated       Static       %8u\n", curHBlk->requestedSize);
 #else
-         sprintf(prntBuf, "     Allocated       Static       %8lu\n", curHBlk->requestedSize);
+        sprintf(prntBuf, "     Allocated       Static       %8lu\n", curHBlk->requestedSize);
 #endif
-         SDisplay(0, prntBuf);
+        SDisplay(0, prntBuf);
       }
       else if (CMM_IS_DYNAMIC(curHBlk->memFlags))
       {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-         sprintf(prntBuf, "     Allocated       Dynamic      %8u\n", curHBlk->requestedSize);
+        sprintf(prntBuf, "     Allocated       Dynamic      %8u\n", curHBlk->requestedSize);
 #else
-         sprintf(prntBuf, "     Allocated       Dynamic      %8lu\n", curHBlk->requestedSize);
+        sprintf(prntBuf, "     Allocated       Dynamic      %8lu\n", curHBlk->requestedSize);
 #endif
-         SDisplay(0, prntBuf);
+        SDisplay(0, prntBuf);
       }
       else if (CMM_IS_FREE(curHBlk->memFlags))
       {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+        /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
-         sprintf(prntBuf, "     Free                      %8u\n", curHBlk->requestedSize);
+        sprintf(prntBuf, "     Free                      %8u\n", curHBlk->requestedSize);
 #else
-         sprintf(prntBuf, "     Free                      %8lu\n", curHBlk->requestedSize);
+        sprintf(prntBuf, "     Free                      %8lu\n", curHBlk->requestedSize);
 #endif
-         SDisplay(0, prntBuf);
+        SDisplay(0, prntBuf);
       }
       else
       {
-         sprintf(prntBuf, "     Trampled                         \n");
-         SDisplay(0, prntBuf);
+        sprintf(prntBuf, "     Trampled                         \n");
+        SDisplay(0, prntBuf);
       }
       /* goto next block in the heap */
       curHBlk = (CmHEntry *)((Data *)curHBlk + hdrSize + curHBlk->size);
 
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif /* SSI_DEBUG_LEVEL1 */
 
 /*-- mt035.201 : Added new API for timestamp --*/
 /*--
-*
-*       Fun:   Get TimeStamp
-*
-*       Desc:  This function is used to Get TimeStamp in micro seconds
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - error
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
---*/
-#ifdef ANSI
-PUBLIC S16 SGetTimeStamp
+ *
+ *       Fun:   Get TimeStamp
+ *
+ *       Desc:  This function is used to Get TimeStamp in micro seconds
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - error
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ --*/
+   S16 SGetTimeStamp
 (
-S8    *ts
-)
-#else
-PUBLIC S16 SGetTimeStamp(ts)
-S8    *ts;
-#endif
+ S8    *ts
+ )
 {
 
 #ifndef SS_LINUX
@@ -7909,12 +7459,11 @@ S8    *ts;
    S8 time_string[40];
    S32 microseconds;
 
-   TRC1(SGetTimeStamp);
 
 #ifndef SS_LINUX
-  clock_gettime(CLOCK_REALTIME, &ptime);
+   clock_gettime(CLOCK_REALTIME, &ptime);
 #else
-  gettimeofday(&ptime, NULL);
+   gettimeofday(&ptime, NULL);
 #endif
 
    /* Obtain the time of day, and convert it to a tm struct. --*/
@@ -7922,8 +7471,8 @@ S8    *ts;
    /* Klock work fix ccpu00148484 */
    if(ptm != NULLP)
    {
-   /* Format the date and time, down to a single second. --*/
-   strftime (time_string, sizeof (time_string), "%a %b %d %Y %H:%M:%S", ptm);
+      /* Format the date and time, down to a single second. --*/
+      strftime (time_string, sizeof (time_string), "%a %b %d %Y %H:%M:%S", ptm);
    }
 
    /* Compute microseconds. --*/
@@ -7935,70 +7484,57 @@ S8    *ts;
 
    /* Print the formatted time, in seconds, followed by a decimal point
       and the microseconds. --*/
-/*mt009.301 Fixed 64BIT compilation warnings*/
+   /*mt009.301 Fixed 64BIT compilation warnings*/
 #ifdef ALIGN_64BIT
    sprintf(ts, "%s.%03d", time_string, microseconds);
 #else
    sprintf(ts, "%s.%03ld", time_string, microseconds);
 #endif
 
-   RETVALUE(ROK);
+   return ROK;
 
 }
 /*-- mt037.201 : Added new API for SGetSystemTsk --*/
 /*
-*
-*       Fun:   Get SGetSystemTsk
-*
-*       Desc:  This function is used to Get sytem task id
-*
-*       Ret:   task id
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
---*/
-#ifdef ANSI
-PUBLIC U32 SGetSystemTsk
-(
-Void
-)
-#else
-PUBLIC U32 SGetSystemTsk()
-#endif
+ *
+ *       Fun:   Get SGetSystemTsk
+ *
+ *       Desc:  This function is used to Get sytem task id
+ *
+ *       Ret:   task id
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ --*/
+uint32_t SGetSystemTsk(Void)
 {
-   TRC1(SGetSystemTskS);
 
-   RETVALUE(pthread_self());
+   return (pthread_self());
 
 } /* end of SGetSystemTsk */
 
 #ifdef SS_MULTICORE_SUPPORT
 /*
-*
-*       Fun:   Add Timer thread into system task table
-*
-*       Desc:  This function is used to add the system task
-*              associated with Timer thread.
-*
-*       Ret:   None
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
---*/
-#ifdef ANSI
-PRIVATE SsSTskEntry* ssdAddTmrSTsk(Void)
-#else
-PRIVATE SsSTskEntry* ssdAddTmrSTsk()
-#endif
+ *
+ *       Fun:   Add Timer thread into system task table
+ *
+ *       Desc:  This function is used to add the system task
+ *              associated with Timer thread.
+ *
+ *       Ret:   None
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ --*/
+static SsSTskEntry* ssdAddTmrSTsk(Void)
 {
    SsSTskEntry *sTsk;
    S16 ret;
 
-   TRC1(ssdAddTmrSTsk);
    sTsk = NULLP;
    /* lock the system task table */
    ret = SLock(&osCp.sTskTblLock);
@@ -8007,10 +7543,10 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk()
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT039, (ErrVal) ret,
-                     "Could not lock system task table");
+           "Could not lock system task table");
 #endif
 
-      RETVALUE(sTsk);
+      return (sTsk);
    }
 
    /* check count of system tasks */
@@ -8020,9 +7556,9 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk()
       if ( SUnlock(&osCp.sTskTblLock) != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT040, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(sTsk);
+        MTLOGERROR(ERRCLS_DEBUG, EMT040, ERRZERO,
+              "Could not give the Semaphore");
+        return (sTsk);
 #endif
       }
 
@@ -8030,7 +7566,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk()
       MTLOGERROR(ERRCLS_ADD_RES, EMT041, ERRZERO, "Too many system tasks");
 #endif
 
-      RETVALUE(sTsk);
+      return (sTsk);
    }
 
 
@@ -8047,18 +7583,18 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk()
       if ( SUnlock(&osCp.sTskTblLock) != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(NULLP);
+        MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
+              "Could not give the Semaphore");
+        return (NULLP);
 #endif
       }
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT043, (ErrVal) ret,
-                  "Could not initialize demand queue");
+           "Could not initialize demand queue");
 #endif
 
-      RETVALUE(NULLP);
+      return (NULLP);
    }
 
    /* initialize the system task entry lock */
@@ -8069,18 +7605,18 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk()
       if ( SUnlock(&osCp.sTskTblLock) != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(NULLP);
+        MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
+              "Could not give the Semaphore");
+        return (NULLP);
 #endif
       }
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT045, (ErrVal) ret,
-                  "Could not initialize system task entry lock");
+           "Could not initialize system task entry lock");
 #endif
 
-      RETVALUE(NULLP);
+      return (NULLP);
    }
 
 
@@ -8093,341 +7629,297 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk()
 
    /* unlock the system task table */
 
-      if ( SUnlock(&osCp.sTskTblLock) != ROK)
-      {
+   if ( SUnlock(&osCp.sTskTblLock) != ROK)
+   {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(NULLP);
+      MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
+           "Could not give the Semaphore");
+      return (NULLP);
 #endif
-      }
+   }
 
-   RETVALUE(sTsk);
+   return (sTsk);
 }
 #endif /* SS_MULTICORE_SUPPORT */
 /* mt003.301 Readwrite lock and recursive mutex additions */
 #ifdef SS_LOCK_SUPPORT
 /*
-*
-*       Fun:   ssdInitLockNew
-*
-*       Desc:  This function is used to initialise lock/mutex
-*
-*       Ret:   ROK   OK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdInitLockNew
-(
-SLockInfo *lockId,
-U8        lockType
-)
-#else
-PUBLIC S16 ssdInitLockNew(lockId, lockType)
-SLockInfo *lockId;
-U8        lockType;
-#endif
+ *
+ *       Fun:   ssdInitLockNew
+ *
+ *       Desc:  This function is used to initialise lock/mutex
+ *
+ *       Ret:   ROK   OK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdInitLockNew(SLockInfo *lockId,uint8_t lockType)
 {
 
 #ifdef SS_REC_LOCK_SUPPORT
-       pthread_mutexattr_t attr;
+   pthread_mutexattr_t attr;
 #endif /* SS_REC_LOCK_SUPPORT */
    Txt prntBuf[PRNTSZE];
    S16    retVal = ROK;
 
-   TRC1(ssdInitLockNew);
 
    switch(lockType)
    {
 #ifdef SS_RDWR_LOCK_SUPPORT
       case SRDWRLOCK :
-      {
-         if((retVal = pthread_rwlock_init((&(lockId->l.rdWrLockId)), NULLP)) != ROK)
-         {
-            sprintf(prntBuf, "\n\n ssdInitLockNew(): Initialization of read write lock failed,Error# retVal %d\n", retVal);
-            SDisplay(0, prntBuf);
-            RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_init((&(lockId->l.rdWrLockId)), NULLP)) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdInitLockNew(): Initialization of read write lock failed,Error# retVal %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_RDWR_LOCK_SUPPORT */
 #ifdef SS_REC_LOCK_SUPPORT
-       case SMUTEXRECUR:
-               {
-                 retVal = pthread_mutexattr_init(&attr);
-
-                 if(retVal != 0)
-                 {
-                        sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr init failed,Error# %d \n",retVal);
-                        SPrint(prntBuf);
-                        RETVALUE(RFAILED);
-                 }
+      case SMUTEXRECUR:
+        {
+           retVal = pthread_mutexattr_init(&attr);
+
+           if(retVal != 0)
+           {
+              sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr init failed,Error# %d \n",retVal);
+              SPrint(prntBuf);
+              return RFAILED;
+           }
 #ifdef SS_LINUX
-                 retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
-#else
-                 retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#endif
-                 if(retVal != 0)
-                 {
-                        sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr settype failed,Error# %d \n",retVal);
-                        pthread_mutexattr_destroy(&attr);
-                        SPrint(prntBuf);
-                        RETVALUE(RFAILED);
-                 }
-                 retVal = pthread_mutex_init((pthread_mutex_t *)&(lockId->l.recurLock), &attr);
-                 if(retVal != 0)
-                 {
-                        sprintf(prntBuf,"\n ssdInitLockNew(): mutex init failed,Error# %d \n",retVal);
-                        pthread_mutexattr_destroy(&attr);
-                        SPrint(prntBuf);
-                        RETVALUE(RFAILED);
-                 }
-                 break;
-               }
+           retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+#else
+           retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+#endif
+           if(retVal != 0)
+           {
+              sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr settype failed,Error# %d \n",retVal);
+              pthread_mutexattr_destroy(&attr);
+              SPrint(prntBuf);
+              return RFAILED;
+           }
+           retVal = pthread_mutex_init((pthread_mutex_t *)&(lockId->l.recurLock), &attr);
+           if(retVal != 0)
+           {
+              sprintf(prntBuf,"\n ssdInitLockNew(): mutex init failed,Error# %d \n",retVal);
+              pthread_mutexattr_destroy(&attr);
+              SPrint(prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_REC_LOCK_SUPPORT */
       default :
-      {
-         sprintf(prntBuf, "\n\n ssdInitLockNew(): Invalid lock type %d\n", lockType);
-         SDisplay(0, prntBuf);
-         RETVALUE(RFAILED);
-      }
+        {
+           sprintf(prntBuf, "\n\n ssdInitLockNew(): Invalid lock type %d\n", lockType);
+           SDisplay(0, prntBuf);
+           return RFAILED;
+        }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 /*
-*
-*       Fun:   ssdLockNew
-*
-*       Desc:  This function is used to aquire the read write lock
-*
-*       Ret:   ROK   OK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdLockNew
-(
-SLockInfo *lockId,
-U8         lockType
-)
-#else
-PUBLIC S16 ssdLockNew(lockId, lockType)
-SLockInfo *lockId;
-U8         lockType;
-#endif
+ *
+ *       Fun:   ssdLockNew
+ *
+ *       Desc:  This function is used to aquire the read write lock
+ *
+ *       Ret:   ROK   OK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdLockNew(SLockInfo *lockId,uint8_t lockType)
 {
 
    Txt prntBuf[PRNTSZE];
    S16    retVal = ROK;
 
-   TRC1(ssdLockNew);
 
    switch(lockType)
    {
 #ifdef SS_RDWR_LOCK_SUPPORT
       case SRDLOCK :
-      {
-         if((retVal = pthread_rwlock_rdlock(&(lockId->l.rdWrLockId))) != ROK)
-         {
-           sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
-           SDisplay(0, prntBuf);
-           RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_rdlock(&(lockId->l.rdWrLockId))) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
       case SWRLOCK :
-      {
-         if((retVal = pthread_rwlock_wrlock(&(lockId->l.rdWrLockId))) != ROK)
-         {
-           sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the write lock,Error# %d\n", retVal);
-           SDisplay(0, prntBuf);
-           RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_wrlock(&(lockId->l.rdWrLockId))) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the write lock,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
       case STRYRDLOCK :
-      {
-         if((retVal = pthread_rwlock_tryrdlock(&(lockId->l.rdWrLockId))) != ROK)
-         {
-           sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
-           SDisplay(0, prntBuf);
-           RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_tryrdlock(&(lockId->l.rdWrLockId))) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
       case STRYWRLOCK:
-      {
-         if((retVal = pthread_rwlock_trywrlock(&(lockId->l.rdWrLockId))) != ROK)
-         {
-           sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
-           SDisplay(0, prntBuf);
-           RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_trywrlock(&(lockId->l.rdWrLockId))) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_RDWR_LOCK_SUPPORT */
 #ifdef SS_REC_LOCK_SUPPORT
-               case SMUTEXRECUR:
-               {
-                  if((retVal = pthread_mutex_lock(&(lockId->l.recurLock)) != ROK))
-                       {
-                               sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
-                       SDisplay(0, prntBuf);
-                       RETVALUE(RFAILED);
-                  }
-                 break;
-               }
+      case SMUTEXRECUR:
+        {
+           if((retVal = pthread_mutex_lock(&(lockId->l.recurLock)) != ROK))
+           {
+              sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_REC_LOCK_SUPPORT */
       default :
-      {
-         sprintf(prntBuf, "\n\n ssdLockNew(): Invalid lock type %d\n", lockType);
-         SDisplay(0, prntBuf);
-         RETVALUE(RFAILED);
-      }
+        {
+           sprintf(prntBuf, "\n\n ssdLockNew(): Invalid lock type %d\n", lockType);
+           SDisplay(0, prntBuf);
+           return RFAILED;
+        }
    }
 
-   RETVALUE(ROK);
+   return ROK;
 }
 
 
 /*
-*
-*       Fun:   ssdUnlockNew
-*
-*       Desc:  This function is used to Unlock the read write lock
-*
-*       Ret:   ROK   OK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdUnlockNew
-(
-SLockInfo *lockId,
-U8        lockType
-)
-#else
-PUBLIC S16 ssdUnlockNew(lockId, lockType)
-SLockInfo *lockId;
-U8        lockType;
-#endif
+ *
+ *       Fun:   ssdUnlockNew
+ *
+ *       Desc:  This function is used to Unlock the read write lock
+ *
+ *       Ret:   ROK   OK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdUnlockNew(SLockInfo *lockId,uint8_t lockType)
 {
 
    Txt prntBuf[PRNTSZE];
    S16    retVal = ROK;
 
-   TRC1(ssdUnlockNew);
 
    switch(lockType)
    {
 #ifdef SS_RDWR_LOCK_SUPPORT
       case SRDWRLOCK :
-      {
-         if((retVal = pthread_rwlock_unlock(&(lockId->l.rdWrLockId))) != ROK)
-         {
-            sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to unlock the lock,Error# %d\n", retVal);
-            SDisplay(0, prntBuf);
-            RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_unlock(&(lockId->l.rdWrLockId))) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to unlock the lock,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_RDWR_LOCK_SUPPORT */
 #ifdef SS_REC_LOCK_SUPPORT
-          case SMUTEXRECUR:
-               {
-                  if((retVal = pthread_mutex_unlock(&(lockId->l.recurLock)) != ROK))
-                       {
-                               sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
-                       SDisplay(0, prntBuf);
-                       RETVALUE(RFAILED);
-                  }
-                 break;
-               }
+      case SMUTEXRECUR:
+        {
+           if((retVal = pthread_mutex_unlock(&(lockId->l.recurLock)) != ROK))
+           {
+              sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_REC_LOCK_SUPPORT */
       default :
-      {
-         sprintf(prntBuf, "\n\n ssdUnlockNew(): Invalid lock type %d\n", lockType);
-         SDisplay(0, prntBuf);
-         RETVALUE(RFAILED);
-      }
+        {
+           sprintf(prntBuf, "\n\n ssdUnlockNew(): Invalid lock type %d\n", lockType);
+           SDisplay(0, prntBuf);
+           return RFAILED;
+        }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /*
-*
-*       Fun:   ssdDestroyLockNew
-*
-*       Desc:  This function is used to destroy the read write lock
-*
-*       Ret:   ROK   OK
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdDestroyLockNew
-(
-SLockInfo *lockId,
-U8        lockType
-)
-#else
-PUBLIC S16 ssdDestroyLockNew(lockId, lockType)
-SLockInfo *lockId;
-U8        lockType;
-#endif
+ *
+ *       Fun:   ssdDestroyLockNew
+ *
+ *       Desc:  This function is used to destroy the read write lock
+ *
+ *       Ret:   ROK   OK
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdDestroyLockNew(SLockInfo *lockId,uint8_t lockType)
 {
    Txt prntBuf[PRNTSZE];
    S16    retVal = ROK;
 
-   TRC1(ssdDestroyLockNew);
 
    switch(lockType)
    {
 #ifdef SS_RDWR_LOCK_SUPPORT
       case SRDWRLOCK :
-      {
-         if((retVal = pthread_rwlock_destroy(&(lockId->l.rdWrLockId))) != ROK)
-         {
-            sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the lock,Error# %d\n", retVal);
-            SDisplay(0, prntBuf);
-            RETVALUE(RFAILED);
-         }
-         break;
-      }
+        {
+           if((retVal = pthread_rwlock_destroy(&(lockId->l.rdWrLockId))) != ROK)
+           {
+              sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the lock,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_RDWR_LOCK_SUPPORT */
 #ifdef SS_REC_LOCK_SUPPORT
-          case SMUTEXRECUR:
-               {
-                  if((retVal = pthread_mutex_destroy(&(lockId->l.recurLock)) != ROK))
-                       {
-            sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the mutex,Error# %d\n", retVal);
-                       SDisplay(0, prntBuf);
-                       RETVALUE(RFAILED);
-                  }
-                 break;
-               }
+      case SMUTEXRECUR:
+        {
+           if((retVal = pthread_mutex_destroy(&(lockId->l.recurLock)) != ROK))
+           {
+              sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the mutex,Error# %d\n", retVal);
+              SDisplay(0, prntBuf);
+              return RFAILED;
+           }
+           break;
+        }
 #endif /* SS_REC_LOCK_SUPPORT */
       default :
-      {
-         sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Invalid lock type %d\n", lockType);
-         SDisplay(0, prntBuf);
-         RETVALUE(RFAILED);
-      }
+        {
+           sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Invalid lock type %d\n", lockType);
+           SDisplay(0, prntBuf);
+           return RFAILED;
+        }
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 #endif /* SS_LOCK_SUPPORT */
 
@@ -8451,37 +7943,29 @@ U8        lockType;
  *       File:
  *
  **/
-#ifdef ANSI
-PUBLIC S16 ssInitRcvWork
-(
- void
- )
-#else
-PUBLIC S16 ssInitRcvWork()
-#endif
+S16 ssInitRcvWork(void)
 {
-  pthread_attr_t attr;
-  pthread_t      thread;
+   pthread_attr_t attr;
+   pthread_t      thread;
 
-  TRC1(ssInitRcvWork);
 
-  /* set the required attributes */
-  pthread_attr_init(&attr);
-  pthread_attr_setstacksize(&attr, (size_t)MT_ISTASK_STACK);
-  pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+   /* set the required attributes */
+   pthread_attr_init(&attr);
+   pthread_attr_setstacksize(&attr, (size_t)MT_ISTASK_STACK);
+   pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+   pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 
-  /* Create a new thread to receive the work queue messages */
-  if ((pthread_create(&thread, &attr, workRcvTsk, NULLP)) != 0)
-  {
-        pthread_attr_destroy(&attr);
+   /* Create a new thread to receive the work queue messages */
+   if ((pthread_create(&thread, &attr, workRcvTsk, NULLP)) != 0)
+   {
+      pthread_attr_destroy(&attr);
 
-        RETVALUE(RFAILED);
-  }
+      return RFAILED;
+   }
 
-  pthread_attr_destroy(&attr);
+   pthread_attr_destroy(&attr);
 
-  RETVALUE(ROK);
+   return ROK;
 
 }/* ssInitRcvWork */
 
@@ -8504,103 +7988,94 @@ PUBLIC S16 ssInitRcvWork()
  *
  **/
 
-#ifdef ANSI
-PRIVATE void *workRcvTsk
-(
- Ptr ptr
- )
-#else
-PRIVATE void *workRcvTsk (ptr)
-  Ptr ptr;
-#endif
+static void *workRcvTsk(Ptr ptr)
 {
 
-  cvmx_wqe_t *workPtr;
-  Buffer     *mBuf, *rcvdBuf;
-  SsMsgInfo  *minfoPtr;
-  S16         ret;
-  struct timespec ts;
-  Pst         pst;
-
-  TRC1(workRcvTsk);
+   cvmx_wqe_t *workPtr;
+   Buffer     *mBuf, *rcvdBuf;
+   SsMsgInfo  *minfoPtr;
+   S16         ret;
+   struct timespec ts;
+   Pst         pst;
 
 
-  for (;;)
-  {
-        /* get the work if its avilable */
-        workPtr = cvmx_pow_work_request_sync(CVMX_POW_NO_WAIT);
 
-        if ( workPtr == NULLP )
-        {
-               /* If there is no work then sleep for 10 usec */
-               ts.tv_sec = 0;
-               ts.tv_nsec = 500000;
+   for (;;)
+   {
+      /* get the work if its avilable */
+      workPtr = cvmx_pow_work_request_sync(CVMX_POW_NO_WAIT);
 
-               nanosleep(&ts, NULLP);
-               continue;
-        }
+      if ( workPtr == NULLP )
+      {
+        /* If there is no work then sleep for 10 usec */
+        ts.tv_sec = 0;
+        ts.tv_nsec = 500000;
 
-        switch(workPtr->tag)
-        {
-               /* Switch over according to the tag value */
-               case SS_CVMX_MBUF_TAG:
-
-                 rcvdBuf = (Buffer*)workPtr->packet_ptr.ptr;
-
-                 /* Convert the physical address to Pointers */
-                 ret = SConvPhyPtr(&rcvdBuf);
-                 if (ret != ROK)
-                 {
-           /* mt011.301: Cavium 32 bit changes */
-                        cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
-                        continue;
-                 }
-
-                 /* Copy the buffer to this region */
-                 ret = SCpyFpaMsg(rcvdBuf, SS_DFLT_REGION, SS_DFLT_POOL, &mBuf);
-                 if( ret != ROK )
-                 {
-           /* mt011.301: Cavium 32 bit changes */
-                        cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
-                        continue;
-                 }
-
-        /* mt011.301: Cavium 32 bit changes */
-                 cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
-
-                 minfoPtr = (SsMsgInfo*)mBuf->b_rptr;
-
-                 /* Get the post strucutre and Post the message */
-                 if ( minfoPtr != NULLP)
-                 {
-                        SMemCpy( &pst, &minfoPtr->pst, sizeof(Pst));
-
-                        (Void)SPstTsk(&pst, mBuf);
-                 }
-                 /* Free the buffer allocated if it cannot be sent */
-                 else
-                 {
-                        SPutMsg(mBuf);
-                 }
-                 break;
+        nanosleep(&ts, NULLP);
+        continue;
+      }
 
-               default:
-                 {
-                        /* Invalid tag value, drop the work */
-           /* mt011.301: Cavium 32 bit changes */
-                        cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
-                        continue;
-                 }
-                 break;
-        }
+      switch(workPtr->tag)
+      {
+        /* Switch over according to the tag value */
+        case SS_CVMX_MBUF_TAG:
+
+           rcvdBuf = (Buffer*)workPtr->packet_ptr.ptr;
+
+           /* Convert the physical address to Pointers */
+           ret = SConvPhyPtr(&rcvdBuf);
+           if (ret != ROK)
+           {
+              /* mt011.301: Cavium 32 bit changes */
+              cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+              continue;
+           }
+
+           /* Copy the buffer to this region */
+           ret = SCpyFpaMsg(rcvdBuf, SS_DFLT_REGION, SS_DFLT_POOL, &mBuf);
+           if( ret != ROK )
+           {
+              /* mt011.301: Cavium 32 bit changes */
+              cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+              continue;
+           }
+
+           /* mt011.301: Cavium 32 bit changes */
+           cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+
+           minfoPtr = (SsMsgInfo*)mBuf->b_rptr;
+
+           /* Get the post strucutre and Post the message */
+           if ( minfoPtr != NULLP)
+           {
+              SMemCpy( &pst, &minfoPtr->pst, sizeof(Pst));
+
+              (Void)SPstTsk(&pst, mBuf);
+           }
+           /* Free the buffer allocated if it cannot be sent */
+           else
+           {
+              SPutMsg(mBuf);
+           }
+           break;
+
+        default:
+           {
+              /* Invalid tag value, drop the work */
+              /* mt011.301: Cavium 32 bit changes */
+              cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+              continue;
+           }
+           break;
+      }
 
-  }
+   }
 } /* workRcvTsk */
 
 #endif /* SS_SEUM_CAVIUM */
 
 #ifdef TENB_RTLIN_CHANGES
-PUBLIC S16 SInitLock(SLockId *l, U8 t)
+S16 SInitLock(SLockId *l, uint8_t t)
 {
    S16 r = 0;
    pthread_mutexattr_t prior;
@@ -8629,30 +8104,24 @@ PUBLIC S16 SInitLock(SLockId *l, U8 t)
  *
  */
 
-PUBLIC Void ssRegMainThread(Void)
+Void ssRegMainThread(Void)
 {
 
-#if 0
-#else
    if(SS_INVALID_THREAD_REG_MAP != SS_GET_THREAD_MEM_REGION())
-#endif
    {
-      printf("not able to get different Id for main thread\n");
+      printf("\nnot able to get different Id for main thread\n");
       exit(1);
    }
    /* Here the default region is added as we dont have any region associated with
     * Main thread. The thread should not perform any allocation except 
     * the initial configuratin 
     */
-#if 0
-#else
 #ifdef XEON_SPECIFIC_CHANGES
    SS_GET_THREAD_MEM_REGION() = mtMemoCfg.numRegions;
 #else   
    SS_GET_THREAD_MEM_REGION() = 
 #endif      
-#endif
-                                                                  DFLT_REGION;
+      DFLT_REGION;
 }
 
 /*
@@ -8679,59 +8148,52 @@ PUBLIC Void ssRegMainThread(Void)
  *       File: mt_ss.c
  *
  */
-PUBLIC S32 ssCheckAndAddMemoryRegionMap
+   S32 ssCheckAndAddMemoryRegionMap
 (
-pthread_t    threadId,    /* Thread Id of system task */
-Region       region       /* Region associated with thread */
-)
+ pthread_t    threadId,    /* Thread Id of system task */
+ Region       region       /* Region associated with thread */
+ )
 {
-   PRIVATE U32       createdThreads;
-   PRIVATE pthread_t createdThreadIds[SS_MAX_THREAD_CREATE_RETRY];
-   U32               indx;
+   static uint32_t       createdThreads;
+   static pthread_t createdThreadIds[SS_MAX_THREAD_CREATE_RETRY];
+   uint32_t               indx;
 
-   TRC1(ssCheckAndAddMemoryRegionMap);
 
    /* Here  0xFF is considered as invalid region and if the mapping table
     * contains 0xFF, that mapping entry is free
     */
-#if 0
-#else
    if(SS_INVALID_THREAD_REG_MAP != 
-            osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
-#endif
+        osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
    {
       /* Klock work fix ccpu00148484 */
       if(!(createdThreads < SS_MAX_THREAD_CREATE_RETRY))
       {
-         printf("failed in index = %ld\n", ((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP));
-         printf("Not able to get the different thread ID, exiting\n");
-         exit(1);
+        printf("\nfailed in index = %ld\n", ((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP));
+        printf("\nNot able to get the different thread ID, exiting\n");
+        exit(1);
       }
       createdThreadIds[createdThreads++] = threadId;
-      RETVALUE(FALSE);
+      return (FALSE);
    }
    /* If we found free mapping table entry, place the region and send pthread_cancel
     * for all the thread Ids which are created before this 
     */
-#if 0
-#else
    osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)] = region;
 #ifdef XEON_SPECIFIC_CHANGES
-   printf("ThreadId %ld, Thread Idx %d, Region %d\n", threadId,
-          ((threadId >> SS_MEM_THREAD_ID_SHIFT) % 
-          SS_MAX_THREAD_REGION_MAP), region);
+   printf("\nThreadId %ld, Thread Idx %d, Region %d\n", threadId,
+        ((threadId >> SS_MEM_THREAD_ID_SHIFT) % 
+         SS_MAX_THREAD_REGION_MAP), region);
 #endif   
-#endif
    for(indx = 0; indx < createdThreads; indx++)
    {
 #ifdef XEON_SPECIFIC_CHANGES
-      printf("Sending pthred Cancel to thread Id %d \n",createdThreadIds[indx]);
+      printf("\nSending pthred Cancel to thread Id %d \n",createdThreadIds[indx]);
 #endif      
       pthread_cancel(createdThreadIds[indx]);
    }
    createdThreads = 0;
 
-   RETVALUE(TRUE);
+   return (TRUE);
 
 } /* ssCheckAndAddMemoryRegionMap */
 
@@ -8759,13 +8221,12 @@ Region       region       /* Region associated with thread */
  *       File: mt_ss.c
  *
  */
-PUBLIC S32 ssCheckAndDelMemoryRegionMap
+   S32 ssCheckAndDelMemoryRegionMap
 (
-pthread_t    threadId    /* Thread Id of system task */
-)
+ pthread_t    threadId    /* Thread Id of system task */
+ )
 {
 
-   TRC1(ssCheckAndDelMemoryRegionMap);
 
    /* Raghu To-Do Check with team, is it necessary to acquire lock
     * as del and add may go parallel */
@@ -8773,21 +8234,21 @@ pthread_t    threadId    /* Thread Id of system task */
     * contains 0xFF, that mapping entry is free
     */
    if(SS_INVALID_THREAD_REG_MAP ==
-            osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
+        osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
    {
 #ifndef ALIGN_64BIT
-      printf("Invalid Thread ID (%ld)\n", (U32)threadId);
+      printf("\nInvalid Thread ID (%ld)\n", (uint32_t)threadId);
 #else
-      printf("Invalid Thread ID (%d)\n", (U32)threadId);
+      printf("\nInvalid Thread ID (%d)\n", (uint32_t)threadId);
 #endif
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
    /* If we found free mapping table entry, place the region and send pthread_cancel
     * for all the thread Ids which are created before this 
     */
    osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)] = SS_INVALID_THREAD_REG_MAP;
 
-   RETVALUE(ROK);
+   return ROK;
 
 } /* ssCheckAndAddMemoryRegionMap */
 
@@ -8795,64 +8256,52 @@ pthread_t    threadId    /* Thread Id of system task */
 #endif
 #ifdef SS_TSKLOG_ENABLE
 /*
-*
-*       Fun:   SStartTask
-*
-*       Desc:  This function will return current time through input parameter.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - failed, general (optional)
-*
-*
-*       File:  pt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SStartTask
+ *
+ *       Fun:   SStartTask
+ *
+ *       Desc:  This function will return current time through input parameter.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - failed, general (optional)
+ *
+ *
+ *       File:  pt_ss.c
+ *
+ */
+   S16 SStartTask
 (
-VOLATILE U32      *startTime,
-U32       taskId
-)
-#else
-PUBLIC S16 SStartTask(startTime, taskId)
-VOLATILE U32      *startTime;
-U32       taskId;
-#endif
+ volatile uint32_t      *startTime,
+ uint32_t       taskId
+ )
 {
 #ifdef MSPD_MLOG_NEW
    *startTime = GetTIMETICK();
 #endif
-   RETVALUE(ROK);
+   return ROK;
 }
 \f
 /*
-*
-*       Fun:   SStopTask
-*
-*       Desc:  This function will return current time through input parameter.
-*              and take the difference of start time provided as input parameter
-*              and current time.
-*
-*       Ret:   ROK      - ok
-*              RFAILED  - failed, general (optional)
-*
-*
-*       File:  pt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 SStopTask
+ *
+ *       Fun:   SStopTask
+ *
+ *       Desc:  This function will return current time through input parameter.
+ *              and take the difference of start time provided as input parameter
+ *              and current time.
+ *
+ *       Ret:   ROK      - ok
+ *              RFAILED  - failed, general (optional)
+ *
+ *
+ *       File:  pt_ss.c
+ *
+ */
+   S16 SStopTask
 (
-VOLATILE U32       startTime,
-U32       taskId
-)
-#else
-PUBLIC S16 SStopTask(startTime, taskId)
-VOLATILE U32       startTime;
-U32       taskId;
-#endif
+ volatile uint32_t       startTime,
+ uint32_t       taskId
+ )
 {
-   /*U32      stopTime;*/
+   /*uint32_t      stopTime;*/
    switch(taskId)
    {
       case PID_MAC_HARQ_IND:
@@ -8877,93 +8326,75 @@ U32       taskId;
       case PID_RECPREQ_PROC:
 #ifdef CA_PHY
 #ifndef LTE_TDD               
-         MLogTask(0, taskId, RESOURCE_LARM, startTime, GetTIMETICK());
+        MLogTask(0, taskId, RESOURCE_LARM, startTime, GetTIMETICK());
 #else
-         MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
+        MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
 #endif
 #else
-         MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
+        MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
 #endif
-         break;
+        break;
    }
-   RETVALUE(ROK);
+   return ROK;
 }
 #else
-#ifdef ANSI
-PUBLIC S16 SStartTask
+   S16 SStartTask
 (
-VOLATILE U32      * startTime,
-U32       taskId
-)
-#else
-PUBLIC S16 SStartTask(startTime, taskId)
-VOLATILE U32      * startTime;
-U32       taskId;
-#endif
+ volatile uint32_t * startTime,
+ uint32_t taskId
+ )
 {
    *startTime = 0;
-   RETVALUE(ROK);
+   return ROK;
 }
 
-#ifdef ANSI
-PUBLIC S16 SStopTask
+   S16 SStopTask
 (
-VOLATILE U32       startTime,
-U32       taskId
-)
-#else
-PUBLIC S16 SStopTask(startTime, taskId)
-VOLATILE U32       startTime;
-U32       taskId;
-#endif
+ volatile uint32_t startTime,
+ uint32_t taskId
+ )
 {
-   RETVALUE(ROK);
+   return ROK;
 }
 
 #endif /*#ifdef SS_TSKLOG_ENABLE */
 #ifdef TENB_T2K3K_SPECIFIC_CHANGES
 /** @details
-* This primitive is used to calculate the CPU Utilization per Core
-* for Intel T2200
-*
-* @param [in]   Void
-*
-* @return  Void - function is always success
-*/
-#ifdef ANSI
-PUBLIC Void UpdateSocCpuInfo
+ * This primitive is used to calculate the CPU Utilization per Core
+ * for Intel T2200
+ *
+ * @param [in]   Void
+ *
+ * @return  Void - function is always success
+ */
+   Void UpdateSocCpuInfo
 (
-CmCpuStatsInfo *cpuInfo, 
-U8    idx
-)
-#else
-PUBLIC Void UpdateSocCpuInfo(*cpuInfo, idx)
-CmCpuStatsInfo *cpuInfo;
-U8       idx;
-#endif
+ CmCpuStatsInfo *cpuInfo, 
+ uint8_t    idx
+ )
 {
    FILE       *mipsFd;
-   S8          mipsStr[MIPS_STRING_LEN];
+   S8         mipsStr[MIPS_STRING_LEN];
    S8         *strPart;
-   U32         l2FreeCpu;
-   U32         l2CpuUsed;
-   U32         l3FreeCpu;
-   U32         l3CpuUsed;
+   uint32_t   l2FreeCpu;
+   uint32_t   l2CpuUsed;
+   uint32_t   l3FreeCpu;
+   uint32_t   l3CpuUsed;
 
    /* Open the file which holds the MIPS available value */
    mipsFd = fopen(MIPS_FILE, "r");
 
    if(mipsFd == NULLP)
    {
-      RETVOID;
+      return;
    }
 
    /* Get the free mips available value from the file */
    if(NULLP  == fgets(mipsStr, 24, mipsFd))
    {
-      printf("fgets to get the free mips available failed\n");
+      printf("\nfgets to get the free mips available failed\n");
       fclose(mipsFd);
-      RETVOID;
+      return;
    }
 
    strtok(mipsStr, " ");
@@ -8974,11 +8405,11 @@ U8       idx;
    {  
       if(strPart != NULLP)
       {
-         l2FreeCpu = atoi(strPart);   
-         l2CpuUsed = 100 - l2FreeCpu;
-         cpuInfo->cpuUtil[0].totCpuUtil += l2CpuUsed;
-         cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l2CpuUsed);;
-         cpuInfo->cpuUtil[0].numSamples++;
+        l2FreeCpu = atoi(strPart);   
+        l2CpuUsed = 100 - l2FreeCpu;
+        cpuInfo->cpuUtil[0].totCpuUtil += l2CpuUsed;
+        cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l2CpuUsed);
+        cpuInfo->cpuUtil[0].numSamples++;
       }
    }
    if(idx == CM_L3_CPU_UTIL)
@@ -8986,11 +8417,11 @@ U8       idx;
       strPart = strtok(NULLP, " ");
       if(strPart != NULLP)
       {
-         l3FreeCpu = atoi(strPart);   
-         l3CpuUsed = 100 - l3FreeCpu;
-         cpuInfo->cpuUtil[0].totCpuUtil += l3CpuUsed;
-         cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l3CpuUsed);;
-         cpuInfo->cpuUtil[0].numSamples++;
+        l3FreeCpu = atoi(strPart);   
+        l3CpuUsed = 100 - l3FreeCpu;
+        cpuInfo->cpuUtil[0].totCpuUtil += l3CpuUsed;
+        cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l3CpuUsed);
+        cpuInfo->cpuUtil[0].numSamples++;
       }
    }
    if(idx == CM_L2_CPU_UTIL)
@@ -9003,37 +8434,31 @@ U8       idx;
    }
    fclose(mipsFd);
 
-   RETVOID;
+   return;
 }
 #endif /* TENB_T2K3K_SPECIFIC_CHANGES */
 #ifdef SS_MULTICORE_SUPPORT
 /*
-*
-*       Fun:   Add Timer thread into system task table
-*
-*       Desc:  This function is used to add the system task
-*              associated with Timer thread.
-*
-*       Ret:   None
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
---*/
-#ifdef ANSI
-PRIVATE SsSTskEntry* ssdReAddTmrSTsk(
-U8 idx
-)
-#else
-PRIVATE SsSTskEntry* ssdReAddTmrSTsk(idx)
-U8 idx;
-#endif
+ *
+ *       Fun:   Add Timer thread into system task table
+ *
+ *       Desc:  This function is used to add the system task
+ *              associated with Timer thread.
+ *
+ *       Ret:   None
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ --*/
+static SsSTskEntry* ssdReAddTmrSTsk(
+      uint8_t idx
+      )
 {
    SsSTskEntry *sTsk;
    S16 ret;
 
-   TRC1(ssdReAddTmrSTsk);
    sTsk = NULLP;
    /* lock the system task table */
    ret = SLock(&osCp.sTskTblLock);
@@ -9042,10 +8467,10 @@ U8 idx;
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT039, (ErrVal) ret,
-                     "Could not lock system task table");
+           "Could not lock system task table");
 #endif
 
-      RETVALUE(sTsk);
+      return (sTsk);
    }
 
    /* initialize the system task entry with the information we have */
@@ -9068,18 +8493,18 @@ U8 idx;
       if ( SUnlock(&osCp.sTskTblLock) != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(NULLP);
+        MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
+              "Could not give the Semaphore");
+        return (NULLP);
 #endif
       }
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT043, (ErrVal) ret,
-                  "Could not initialize demand queue");
+           "Could not initialize demand queue");
 #endif
 
-      RETVALUE(NULLP);
+      return (NULLP);
    }
 
    /* initialize the system task entry lock */
@@ -9090,18 +8515,18 @@ U8 idx;
       if ( SUnlock(&osCp.sTskTblLock) != ROK)
       {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(NULLP);
+        MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
+              "Could not give the Semaphore");
+        return (NULLP);
 #endif
       }
 
 #if (ERRCLASS & ERRCLS_DEBUG)
       MTLOGERROR(ERRCLS_DEBUG, EMT045, (ErrVal) ret,
-                  "Could not initialize system task entry lock");
+           "Could not initialize system task entry lock");
 #endif
 
-      RETVALUE(NULLP);
+      return (NULLP);
    }
 
 
@@ -9112,77 +8537,69 @@ U8 idx;
 
    /* unlock the system task table */
 
-      if ( SUnlock(&osCp.sTskTblLock) != ROK)
-      {
+   if ( SUnlock(&osCp.sTskTblLock) != ROK)
+   {
 #if (ERRCLASS & ERRCLS_DEBUG)
-           MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
-                       "Could not give the Semaphore");
-           RETVALUE(NULLP);
+      MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
+           "Could not give the Semaphore");
+      return (NULLP);
 #endif
-      }
+   }
 
-   RETVALUE(sTsk);
+   return (sTsk);
 }
 #endif /* SS_MULTICORE_SUPPORT */
 
 \f
 /*
-*
-*       Fun:   Initialize timer table
-*
-*       Desc:  This function initializes MTSS-specific information
-*              in the timer table.
-*
-*       Ret:   ROK      - ok
-*
-*       Notes:
-*
-*       File:  mt_ss.c
-*
-*/
-#ifdef ANSI
-PUBLIC S16 ssdReInitTmr
-(
-void
-)
-#else
-PUBLIC S16 ssdReInitTmr()
-#endif
+ *
+ *       Fun:   Initialize timer table
+ *
+ *       Desc:  This function initializes MTSS-specific information
+ *              in the timer table.
+ *
+ *       Ret:   ROK      - ok
+ *
+ *       Notes:
+ *
+ *       File:  mt_ss.c
+ *
+ */
+S16 ssdReInitTmr(void)
 {
    pthread_attr_t attr;
    struct sched_param param_sched;
 #ifndef XEON_SPECIFIC_CHANGES
-   U8 ret = ROK;
+   uint8_t ret = ROK;
 #endif
 #ifdef SS_MULTICORE_SUPPORT
    SsSTskEntry     *sTsk;
 #endif /* SS_MULTICORE_SUPPORT */
 #ifdef SS_THR_REG_MAP
-   U32 threadCreated = FALSE;
+   uint32_t threadCreated = FALSE;
 #endif /* SS_THR_REG_MAP */
 
-   TRC0(ssdReInitTmr);
 
 #ifndef XEON_SPECIFIC_CHANGES
    ret = ssCheckAndDelMemoryRegionMap(osCp.dep.tmrHdlrTID);
    if(ret != ROK)
    {
 #if (ERRCLASS & ERRCLS_DEBUG)
-       MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
-                       "Could not give the Semaphore");
+      MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
+           "Could not give the Semaphore");
 #endif
-       RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif   
 
    osCp.dep.tmrTqCp.tmrLen = SS_MAX_TMRS;
-  /* mt010.21: addition */
+   /* mt010.21: addition */
 
 #ifdef SS_MULTICORE_SUPPORT
    sTsk = ssdReAddTmrSTsk(0);
    if(!sTsk)
    {
-      RETVALUE(RFAILED);
+      return RFAILED;
    }
 #endif /* SS_MULTICORE_SUPPORT */
    /* create the timer handler thread */
@@ -9209,15 +8626,15 @@ PUBLIC S16 ssdReInitTmr()
 #endif
       if ((pthread_create(&osCp.dep.tmrHdlrTID, &attr, mtTmrHdlr, NULLP)) != 0)
       {
-         /* mt020.201 - Addition for destroying thread attribute object attr */
-         pthread_attr_destroy(&attr);
+        /* mt020.201 - Addition for destroying thread attribute object attr */
+        pthread_attr_destroy(&attr);
 
-         RETVALUE(RFAILED);
+        return RFAILED;
       }
 
 #ifdef SS_THR_REG_MAP
       threadCreated = ssCheckAndAddMemoryRegionMap(osCp.dep.tmrHdlrTID, 
-                                                   sTsk->region);
+           sTsk->region);
    }
 #endif /* SS_THR_REG_MAP */
 #ifdef SS_MEM_WL_DEBUG
@@ -9227,9 +8644,9 @@ PUBLIC S16 ssdReInitTmr()
    /* mt020.201 - Addition for destroying thread attribute object attr */
    pthread_attr_destroy(&attr);
    sem_post(&osCp.dep.ssStarted);
-   RETVALUE(ROK);
+   return ROK;
 }
 
 /**********************************************************************
-         End of file
-**********************************************************************/
+  End of file
+ **********************************************************************/