X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmt%2Fmt_ss.c;h=8cdf6476c438d1e027de61189b558ba7941e9bc0;hb=2193e4cf01012809495be026097e8d7eacb9f0ac;hp=427c89dc12e1a4eece1cc2819a11622f6a5c49e5;hpb=deeae2741b8520edcd37ecb20a40f1de821ceadf;p=o-du%2Fl2.git diff --git a/src/mt/mt_ss.c b/src/mt/mt_ss.c index 427c89dc1..8cdf6476c 100644 --- a/src/mt/mt_ss.c +++ b/src/mt/mt_ss.c @@ -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 #include @@ -62,11 +59,7 @@ /* 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" @@ -326,11 +318,11 @@ 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; @@ -349,9 +341,9 @@ EXTERN unsigned int tlPost(void *handle); /* 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)); @@ -407,9 +399,9 @@ PRIVATE Void *workRcvTsk ARGS((void *)); #endif /* SS_SEUM_CAVIUM */ #ifdef SS_THR_REG_MAP -PUBLIC S32 ssCheckAndAddMemoryRegionMap ARGS((pthread_t threadId, +S32 ssCheckAndAddMemoryRegionMap ARGS((pthread_t threadId, Region region)); -PUBLIC S32 ssCheckAndDelMemoryRegionMap ARGS((pthread_t threadId)); +S32 ssCheckAndDelMemoryRegionMap ARGS((pthread_t threadId)); #endif /* SS_THR_REG_MAP */ /* type declarations */ @@ -427,13 +419,13 @@ typedef struct mtIsFlag /* 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, @@ -508,7 +500,7 @@ PUBLIC SsRegCfg cfgRegInfo[SS_MAX_REGS] = */ #ifdef SS_LOCKLESS_MEMORY -PUBLIC MtDynMemCfg mtDynMemoCfg = +MtDynMemCfg mtDynMemoCfg = { SS_MAX_REGS, /* number of regions */ { @@ -585,7 +577,7 @@ PUBLIC MtDynMemCfg mtDynMemoCfg = }; -PUBLIC MtGlobMemCfg mtGlobMemoCfg = +MtGlobMemCfg mtGlobMemoCfg = { MT_MAX_BKTS, /* number of buckets */ { @@ -607,7 +599,7 @@ 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 */ @@ -713,11 +705,11 @@ PUBLIC MtMemCfg mtMemoCfg = * 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 @@ -757,7 +749,7 @@ unsigned int mtGetNtlHdl() void * mtGetWlsHdl() { - RETVALUE(osCp.wls.intf); + return (osCp.wls.intf); } #ifdef XEON_MULTIPLE_CELL_CHANGES @@ -785,10 +777,10 @@ PRIVATE int SOpenWlsIntf() if(!osCp.wls.intf) { printf("Could not open WLS Interface \n"); - RETVALUE(0); + return (0); } - RETVALUE(1); + return (1); } #endif @@ -812,13 +804,13 @@ PRIVATE int SOpenWlsIntf() * */ #ifdef ANSI -PUBLIC int main +int main ( int argc, /* argument count */ char **argv /* argument vector */ ) #else -PUBLIC int main(argc, argv) +int main(argc, argv) int argc; /* argument count */ char **argv; /* argument vector */ #endif @@ -830,13 +822,13 @@ char **argv; /* argument vector */ 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(!SOpenWlsIntf()) - RETVALUE(0); + return (0); #endif /* INTEL_WLS */ msArgc = argc; @@ -847,11 +839,11 @@ char **argv; /* argument vector */ 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 @@ -873,13 +865,13 @@ char **argv; /* argument vector */ * */ #ifdef ANSI -PUBLIC int ssMain +int ssMain ( int argc, /* argument count */ char **argv /* argument vector */ ) #else -PUBLIC int ssMain(argc, argv) +int ssMain(argc, argv) int argc; /* argument count */ char **argv; /* argument vector */ #endif @@ -893,7 +885,7 @@ char **argv; /* argument vector */ SInit(); - RETVALUE(0); + return (0); } #endif @@ -916,12 +908,12 @@ char **argv; /* argument vector */ * */ #ifdef ANSI -PUBLIC S16 ssdInitGen +S16 ssdInitGen ( void ) #else -PUBLIC S16 ssdInitGen() +S16 ssdInitGen() #endif { struct sigaction act; @@ -952,7 +944,7 @@ PUBLIC S16 ssdInitGen() if(fileBasedMemCfg == TRUE && memConfigured == FALSE) { printf("\n File Based Memory configuration failed \n"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -968,7 +960,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 */ @@ -1012,27 +1004,27 @@ PUBLIC S16 ssdInitGen() if(sigaction(SIGILL, &sa, NULL) != 0) { printf("Failed to process sigaction for the SIGILL\n"); - RETVALUE(RFAILED); + return RFAILED; } if(sigaction(SIGSEGV, &sa, NULL) != 0) { printf("Failed to process sigaction for the SIGSEGV\n"); - RETVALUE(RFAILED); + return RFAILED; } if(sigaction(SIGABRT, &sa, NULL) != 0) { printf("Failed to process sigaction for the SIGABRT\n"); - RETVALUE(RFAILED); + return RFAILED; } if(sigaction(SIGTERM, &sa, NULL) != 0) { printf("Failed to process sigaction for the SIGTERM\n"); - RETVALUE(RFAILED); + return RFAILED; } if(sigaction(SIGHUP, &sa, NULL) != 0) { printf("Failed to process sigaction for the SIGHUP\n"); - RETVALUE(RFAILED); + return RFAILED; } #endif #else @@ -1051,14 +1043,14 @@ 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; } @@ -1076,12 +1068,12 @@ PUBLIC S16 ssdInitGen() * */ #ifdef ANSI -PUBLIC Void ssdDeinitGen +Void ssdDeinitGen ( void ) #else -PUBLIC Void ssdDeinitGen() +Void ssdDeinitGen() #endif { TRC0(ssdDeinitGen); @@ -1110,14 +1102,14 @@ PUBLIC Void ssdDeinitGen() * */ #ifdef ANSI -PUBLIC S16 ssPutDynMemBlkSet +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) +S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem) U8 bktIdx; /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be added to global region */ @@ -1133,7 +1125,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be #if (ERRCLASS & ERRCLS_INT_PAR) if(bktIdx >= globReg->numBkts) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -1149,7 +1141,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be dynMemSetElem->nextBktPtr = NULLP; dynMemSetElem->numFreeBlks = 0; - RETVALUE(ROK); + return ROK; } /* @@ -1168,14 +1160,14 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be * */ #ifdef ANSI -PUBLIC S16 ssGetDynMemBlkSet +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) +S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem) U8 bktIdx; /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated with new set values */ @@ -1193,7 +1185,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated #if (ERRCLASS & ERRCLS_INT_PAR) if(bktIdx >= globReg->numBkts) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -1209,7 +1201,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated dynMemSetElem->numFreeBlks = bktCb->bucketSetSize; - RETVALUE(ROK); + return ROK; } /* ssGetDynMemBlkSet */ @@ -1230,7 +1222,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated * */ #ifdef ANSI -PUBLIC S16 ssPutDynMemBlkSet +S16 ssPutDynMemBlkSet ( U8 bktIdx, /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is needs to be @@ -1238,7 +1230,7 @@ CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is needs U32 doNotBlockForLock /* Boolean whether to block for lock or not */ ) #else -PUBLIC S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem) +S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem) U8 bktIdx; /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be added to global region */ @@ -1258,7 +1250,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock #if (ERRCLASS & ERRCLS_INT_PAR) if(bktIdx >= globReg->numBkts) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -1280,7 +1272,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock if(lstNode == NULLP) { SUnlock(&(bktCb->bucketLock)); - RETVALUE(RFAILED); + return RFAILED; } cmLListDelFrm(&(bktCb->listFreeBktSet), lstNode); @@ -1298,7 +1290,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock SUnlock(&(bktCb->bucketLock)); } - RETVALUE(ROK); + return ROK; } /* @@ -1318,7 +1310,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock * */ #ifdef ANSI -PUBLIC S16 ssGetDynMemBlkSet +S16 ssGetDynMemBlkSet ( U8 bktIdx, /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is updated @@ -1326,7 +1318,7 @@ CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is updat U32 doNotBlockForLock /* Boolean whether to block for lock or not */ ) #else -PUBLIC S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem) +S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem) U8 bktIdx; /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated with new set values */ @@ -1346,7 +1338,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock #if (ERRCLASS & ERRCLS_INT_PAR) if(bktIdx >= globReg->numBkts) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -1367,7 +1359,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock if(lstNode == NULLP) { SUnlock(&(bktCb->bucketLock)); - RETVALUE(RFAILED); + return RFAILED; } /* Delete the node from the valid linked list and copy the values of the @@ -1383,7 +1375,7 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock SUnlock(&(bktCb->bucketLock)); } - RETVALUE(ROK); + return ROK; } /* ssGetDynMemBlkSet */ @@ -1392,11 +1384,11 @@ U32 gDynMemAlrm[4]; PRIVATE U32 memoryCheckCounter; #ifdef ANSI -PUBLIC U32 isMemThreshReached( +U32 isMemThreshReached( Region reg ) #else -PUBLIC U32 isMemThreshReached(reg) +U32 isMemThreshReached(reg) Region reg; #endif { @@ -1410,7 +1402,7 @@ Region reg; #if (ERRCLASS & ERRCLS_INT_PAR) if(bktIdx >= globReg->numBkts) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* ERRCLASS & ERRCLS_INT_PAR */ @@ -1426,7 +1418,7 @@ Region reg; // printf ("recoverd bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx); } SUnlock(&(bktCb->bucketLock)); - RETVALUE(RFAILED); + return RFAILED; } else { @@ -1441,7 +1433,7 @@ Region reg; SUnlock(&(bktCb->bucketLock)); } } - RETVALUE(ROK); + return ROK; } #endif /* USE_MALLOC */ @@ -1464,12 +1456,12 @@ Region reg; * */ #ifdef ANSI -PUBLIC Void * ssGetIccHdl +Void * ssGetIccHdl ( Region region ) #else -PUBLIC Void * ssGetIccHdl() +Void * ssGetIccHdl() Region region; #endif { @@ -1478,12 +1470,12 @@ Region region; /* Klock work fix ccpu00148484 */ if(!(region < SS_MAX_REGS)) { - RETVALUE(NULLP); + return (NULLP); } dynRegCb = (CmMmDynRegCb *)osCp.dynRegionTbl[region].regCb; - RETVALUE(dynRegCb->iccHdl); + return (dynRegCb->iccHdl); } #endif /* SS_USE_ICC_MEMORY */ @@ -1493,7 +1485,7 @@ extern RegionMemLeakInfo regMemLeakInfo; #ifdef INTEL_WLS -PUBLIC S16 SPartitionWlsMemory() +S16 SPartitionWlsMemory() { U32 i; #ifndef ALIGN_64BIT @@ -1526,11 +1518,11 @@ PUBLIC S16 SPartitionWlsMemory() } //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 @@ -1554,7 +1546,7 @@ PUBLIC Void SChkAddrValid(int type, int region, PTR ptr) } #endif /* SS_MEM_WL_DEBUG */ -PUBLIC S16 SPartitionStaticMemory(U8 *startAddr) +S16 SPartitionStaticMemory(U8 *startAddr) { int i; U32 reqdSz; @@ -1575,9 +1567,9 @@ PUBLIC S16 SPartitionStaticMemory(U8 *startAddr) } #endif /* T2K_MEM_LEAK_DBG */ } - RETVALUE(ROK); + return ROK; } -PUBLIC S16 SAllocateWlsMem() +S16 SAllocateWlsMem() { U32 reqdMemSz; @@ -1609,9 +1601,9 @@ 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; @@ -1644,7 +1636,7 @@ 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 */ @@ -1666,12 +1658,12 @@ PUBLIC S16 SAllocateStaticMem() * */ #ifdef ANSI -PUBLIC S16 ssdInitMem +S16 ssdInitMem ( void ) #else -PUBLIC S16 ssdInitMem() +S16 ssdInitMem() #endif { /* mt018.201 - added local variable */ @@ -1703,7 +1695,7 @@ 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++) { @@ -1722,7 +1714,7 @@ PUBLIC S16 ssdInitMem() if(osCp.globRegCb == NULLP) { - RETVALUE(RFAILED); + return RFAILED; } globReg = (CmMmGlobRegCb *)osCp.globRegCb; @@ -1737,7 +1729,7 @@ PUBLIC S16 ssdInitMem() #endif if(globReg->bktTbl[i].startAddr == NULLP) { - RETVALUE(RFAILED); + return RFAILED; } globReg->bktTbl[i].poolId = i; globReg->bktTbl[i].size = mtGlobMemoCfg.bkt[i].blkSize; @@ -1755,7 +1747,7 @@ 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++) { @@ -1767,7 +1759,7 @@ PUBLIC S16 ssdInitMem() #ifdef XEON_SPECIFIC_CHANGES free(dynRegCb); #endif - RETVALUE(RFAILED); + return RFAILED; } dynRegCb->bktTbl[k].size = mtGlobMemoCfg.bkt[k].blkSize; dynRegCb->bktTbl[k].blkSetRelThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold; @@ -1801,7 +1793,7 @@ PUBLIC S16 ssdInitMem() if (pthread_mutex_init(&(regMemLeakInfo.memLock[reg]), NULL) != 0) { printf("\n mutex init failed\n"); - RETVALUE(RFAILED); + return RFAILED; } } #endif @@ -1830,7 +1822,7 @@ PUBLIC S16 ssdInitMem() free(mtCMMRegCb[k]); free(mtCMMRegCfg[k]); } - RETVALUE(RFAILED); + return RFAILED; } mtCMMRegCfg[i] = (CmMmRegCfg *)calloc(1, sizeof(CmMmRegCfg)); @@ -1847,7 +1839,7 @@ PUBLIC S16 ssdInitMem() free(mtCMMRegCfg[k]); } free(mtCMMRegCb[i]); - RETVALUE(RFAILED); + return RFAILED; } @@ -1892,7 +1884,7 @@ PUBLIC S16 ssdInitMem() } free(mtCMMRegCb[i]); free(mtCMMRegCfg[i]); - RETVALUE(RFAILED); + return RFAILED; } @@ -1925,7 +1917,7 @@ PUBLIC S16 ssdInitMem() free(mtCMMRegCfg[i]->vAddr); free(mtCMMRegCb[i]); free(mtCMMRegCfg[i]); - RETVALUE(RFAILED); + return RFAILED; } @@ -1946,7 +1938,7 @@ PUBLIC S16 ssdInitMem() free(mtCMMRegCfg[i]->vAddr); free(mtCMMRegCb[i]); free(mtCMMRegCfg[i]); - RETVALUE(RFAILED); + return RFAILED; } } } @@ -1956,7 +1948,7 @@ PUBLIC S16 ssdInitMem() #endif /* SS_MEM_LEAK_STS */ - RETVALUE(ROK); + return ROK; } @@ -1974,12 +1966,12 @@ PUBLIC S16 ssdInitMem() * */ #ifdef ANSI -PUBLIC Void ssdDeinitMem +Void ssdDeinitMem ( void ) #else -PUBLIC Void ssdDeinitMem() +Void ssdDeinitMem() #endif { /* mt018.201 - added local variables */ @@ -2018,12 +2010,12 @@ PUBLIC Void ssdDeinitMem() * */ #ifdef ANSI -PUBLIC S16 ssdInitTsk +S16 ssdInitTsk ( void ) #else -PUBLIC S16 ssdInitTsk() +S16 ssdInitTsk() #endif { /* mt001.301 : Additions */ @@ -2043,7 +2035,7 @@ PUBLIC S16 ssdInitTsk() osCp.sTskTbl[tskInd].dep.lwpId = 0; } #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */ - RETVALUE(ROK); + return ROK; } @@ -2062,12 +2054,12 @@ PUBLIC S16 ssdInitTsk() * */ #ifdef ANSI -PUBLIC Void ssdDeinitTsk +Void ssdDeinitTsk ( void ) #else -PUBLIC Void ssdDeinitTsk() +Void ssdDeinitTsk() #endif { TRC0(ssdDeinitTsk); @@ -2092,12 +2084,12 @@ PUBLIC Void ssdDeinitTsk() * */ #ifdef ANSI -PUBLIC S16 ssdInitDrvr +S16 ssdInitDrvr ( void ) #else -PUBLIC S16 ssdInitDrvr() +S16 ssdInitDrvr() #endif { S16 i; @@ -2120,7 +2112,7 @@ PUBLIC S16 ssdInitDrvr() */ if (pipe(osCp.dep.isFildes) != 0) { - RETVALUE(RFAILED); + return RFAILED; } #ifndef L2_L3_SPLIT @@ -2135,7 +2127,7 @@ PUBLIC S16 ssdInitDrvr() /* mt020.201 - Addition for destroying thread attribute object attr */ pthread_attr_destroy(&attr); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -2152,7 +2144,7 @@ PUBLIC S16 ssdInitDrvr() pthread_attr_destroy(&attr); #endif - RETVALUE(ROK); + return ROK; } @@ -2171,12 +2163,12 @@ PUBLIC S16 ssdInitDrvr() * */ #ifdef ANSI -PUBLIC Void ssdDeinitDrvr +Void ssdDeinitDrvr ( void ) #else -PUBLIC Void ssdDeinitDrvr() +Void ssdDeinitDrvr() #endif { TRC0(ssdDeinitDrvr); @@ -2211,12 +2203,12 @@ PUBLIC Void ssdDeinitDrvr() * */ #ifdef ANSI -PUBLIC S16 ssdInitTmr +S16 ssdInitTmr ( void ) #else -PUBLIC S16 ssdInitTmr() +S16 ssdInitTmr() #endif { pthread_attr_t attr; @@ -2245,7 +2237,7 @@ PUBLIC S16 ssdInitTmr() sTsk = ssdAddTmrSTsk(); if(!sTsk) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* SS_MULTICORE_SUPPORT */ /* create the timer handler thread */ @@ -2274,7 +2266,7 @@ PUBLIC S16 ssdInitTmr() /* mt020.201 - Addition for destroying thread attribute object attr */ pthread_attr_destroy(&attr); - RETVALUE(RFAILED); + return RFAILED; } #ifdef SS_THR_REG_MAP @@ -2290,7 +2282,7 @@ PUBLIC S16 ssdInitTmr() pthread_attr_destroy(&attr); - RETVALUE(ROK); + return ROK; } @@ -2309,12 +2301,12 @@ PUBLIC S16 ssdInitTmr() * */ #ifdef ANSI -PUBLIC Void ssdDeinitTmr +Void ssdDeinitTmr ( void ) #else -PUBLIC Void ssdDeinitTmr() +Void ssdDeinitTmr() #endif { #ifdef SS_MULTICORE_SUPPORT @@ -2375,12 +2367,12 @@ PUBLIC Void ssdDeinitTmr() * */ #ifdef ANSI -PUBLIC S16 ssdInitLog +S16 ssdInitLog ( void ) #else -PUBLIC S16 ssdInitLog() +S16 ssdInitLog() #endif { /* mt027.201 - Modification to fix warnings with no STDIN and STDOUT */ @@ -2412,7 +2404,7 @@ PUBLIC S16 ssdInitLog() if ((tcgetattr(fd, &tio)) != 0) { printf("Error: disable canonical input processing\n"); - RETVALUE(RFAILED); + return RFAILED; } tio.c_lflag &= ~ICANON; @@ -2421,7 +2413,7 @@ PUBLIC S16 ssdInitLog() if ((tcsetattr(fd, TCSANOW, &tio)) != 0) { printf("Error: while tcsetattr() processing\n"); - RETVALUE(RFAILED); + return RFAILED; } #endif /* CONSTDIO */ @@ -2434,7 +2426,7 @@ PUBLIC S16 ssdInitLog() if (fcntl(fd, F_SETFL, flags) == -1) { printf("Error: while fcntl processing\n"); - RETVALUE(RFAILED); + return RFAILED; } @@ -2452,7 +2444,7 @@ PUBLIC S16 ssdInitLog() pthread_attr_destroy(&attr); printf("Error: Logging Thread creation failed \n"); - RETVALUE(RFAILED); + return RFAILED; } /* mt020.201 - Addition for destroying thread attribute object attr */ @@ -2462,7 +2454,7 @@ PUBLIC S16 ssdInitLog() #endif /* CONAVL */ - RETVALUE(ROK); + return ROK; } @@ -2482,12 +2474,12 @@ PUBLIC S16 ssdInitLog() */ /* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */ #ifdef ANSI -PUBLIC Void ssdDeinitLog +Void ssdDeinitLog ( void ) #else -PUBLIC Void ssdDeinitLog() +Void ssdDeinitLog() #endif { /* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */ @@ -2506,12 +2498,12 @@ PUBLIC Void ssdDeinitLog() #ifdef ANSI -PUBLIC S16 ssdInitWatchDog +S16 ssdInitWatchDog ( U16 port ) #else -PUBLIC S16 ssdInitWatchDog(port) +S16 ssdInitWatchDog(port) U16 port; #endif { @@ -2528,7 +2520,7 @@ U16 port; ProcId procId = SS_WD_WDPROC; if (SAddProcIdLst(1, &procId) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* SS_MULTIPLE_PROCS */ @@ -2613,7 +2605,7 @@ U16 port; if (SGetMsg(SS_DFLT_REGION, SS_DFLT_POOL, &mBuf) != ROK) { - RETVALUE(RFAILED); + return RFAILED; } #ifndef SS_MULTIPLE_PROCS pst.srcProcId = SFndProcId(); @@ -2626,16 +2618,16 @@ U16 port; ssdInitWatchDgPst(&pst); SPstTsk(&pst, mBuf); - RETVALUE(ROK); + return ROK; } #ifdef ANSI -PUBLIC S16 ssdInitWatchDgPst +S16 ssdInitWatchDgPst ( Pst *pst ) #else -PUBLIC S16 ssdInitWatchDgPst(pst) +S16 ssdInitWatchDgPst(pst) Pst *pst; #endif { @@ -2654,28 +2646,28 @@ Pst *pst; pst->srcEnt = ENTDW; /* source entity */ pst->srcInst = 0; - RETVALUE(ROK); + return ROK; } #ifdef SS_MULTIPLE_PROCS #ifdef ANSI -PUBLIC S16 ssdWatchDgActvTmr +S16 ssdWatchDgActvTmr ( ProcId proc, Ent ent, Inst inst ) #else -PUBLIC S16 ssdWatchDgActvTmr(proc, ent, inst) +S16 ssdWatchDgActvTmr(proc, ent, inst) #endif #else #ifdef ANSI -PUBLIC S16 ssdWatchDgActvTmr +S16 ssdWatchDgActvTmr ( Void ) #else -PUBLIC S16 ssdWatchDgActvTmr() +S16 ssdWatchDgActvTmr() #endif #endif /* SS_MULTIPLE_PROCS */ { @@ -2683,17 +2675,17 @@ PUBLIC S16 ssdWatchDgActvTmr() 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) +Void ssdWatchDgTmrEvt(cb, event) PTR cb; /* control block */ S16 event; /* timer number */ #endif @@ -2748,14 +2740,14 @@ S16 event; /* timer number */ } #ifdef ANSI -PUBLIC Void ssdStartWatchDgTmr +Void ssdStartWatchDgTmr ( void *cb, S16 event, U16 wait ) #else -PUBLIC Void ssdStartWatchDgTmr(cb, event, wait) +Void ssdStartWatchDgTmr(cb, event, wait) void *cb; S16 event; U16 wait; @@ -2804,13 +2796,13 @@ U16 wait; } #ifdef ANSI -PUBLIC Void ssdStopWatchDgTmr +Void ssdStopWatchDgTmr ( void *cb, S16 event ) #else -PUBLIC Void ssdStopWatchDgTmr(cb, event) +Void ssdStopWatchDgTmr(cb, event) void *cb; S16 event; #endif @@ -2855,13 +2847,13 @@ S16 event; } #ifdef ANSI -PUBLIC S16 ssdSndHrtBtMsg +S16 ssdSndHrtBtMsg ( Bool restart, U32 type ) #else -PUBLIC S16 ssdSndHrtBtMsg(restart, type) +S16 ssdSndHrtBtMsg(restart, type) Bool restart; U32 type; #endif @@ -2927,7 +2919,7 @@ U32 type; } SUnlock(&osCp.wdCp.wdLock); - RETVALUE(ret); + return (ret); } #endif /* SS_WATCHDOG */ @@ -3335,14 +3327,14 @@ PRIVATE Void mtGetOpts() * */ #ifdef ANSI -PUBLIC S16 SGetOpt +S16 SGetOpt ( int argc, /* argument count */ char **argv, /* argument value */ char *opts /* options */ ) #else -PUBLIC S16 SGetOpt(argc, argv, opts) +S16 SGetOpt(argc, argv, opts) int argc; /* argument count */ char **argv; /* argument value */ char *opts; /* options */ @@ -3363,7 +3355,7 @@ char *opts; /* options */ UNUSED(argv); UNUSED(opts); - RETVALUE(EOF); + return (EOF); #else sp = 1; @@ -3372,19 +3364,19 @@ char *opts; /* options */ /*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); + return (EOF); } else if (argv[msOptInd][0] != '-') { msOptInd++; - RETVALUE('?'); + return ('?'); } } } @@ -3398,7 +3390,7 @@ char *opts; /* options */ sp = 1; } - RETVALUE('?'); + return ('?'); } if (*++cp == ':') @@ -3409,7 +3401,7 @@ char *opts; /* options */ if (++msOptInd >= (S16) argc) { sp = 1; - RETVALUE('?'); + return ('?'); } else msOptArg = argv[msOptInd++]; @@ -3428,7 +3420,7 @@ char *opts; /* options */ } - RETVALUE(c); + return (c); #endif /* NOCMDLINE */ } @@ -3450,12 +3442,12 @@ char *opts; /* options */ * */ #ifdef ANSI -PUBLIC Void ssdStart +Void ssdStart ( void ) #else -PUBLIC Void ssdStart() +Void ssdStart() #endif { S16 i; @@ -3495,12 +3487,12 @@ PUBLIC Void ssdStart() * */ #ifdef ANSI -PUBLIC S16 ssdAttachTTsk +S16 ssdAttachTTsk ( SsTTskEntry *tTsk /* pointer to TAPA task entry */ ) #else -PUBLIC S16 ssdAttachTTsk(tTsk) +S16 ssdAttachTTsk(tTsk) SsTTskEntry *tTsk; /* pointer to TAPA task entry */ #endif { @@ -3523,7 +3515,7 @@ SsTTskEntry *tTsk; /* pointer to TAPA task entry */ #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT001, ret, "SGetMsg() failed"); #endif - RETVALUE(RFAILED); + return RFAILED; } mInfo = (SsMsgInfo *)mBuf->b_rptr; @@ -3560,12 +3552,12 @@ SsTTskEntry *tTsk; /* pointer to TAPA task entry */ MTLOGERROR(ERRCLS_DEBUG, EMT002, ret, "Could not write to demand queue"); #endif - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } @@ -3583,19 +3575,19 @@ SsTTskEntry *tTsk; /* pointer to TAPA task entry */ * */ #ifdef ANSI -PUBLIC S16 ssdDetachTTsk +S16 ssdDetachTTsk ( SsTTskEntry *tTsk /* pointer to TAPA task entry */ ) #else -PUBLIC S16 ssdDetachTTsk(tTsk) +S16 ssdDetachTTsk(tTsk) SsTTskEntry *tTsk; /* pointer to TAPA task entry */ #endif { TRC0(ssdDetachTTsk); - RETVALUE(ROK); + return ROK; } @@ -3614,15 +3606,16 @@ SsTTskEntry *tTsk; /* pointer to TAPA task entry */ * */ #ifdef ANSI -PUBLIC S16 ssdCreateSTsk +S16 ssdCreateSTsk ( SsSTskEntry *sTsk /* pointer to system task entry */ ) #else -PUBLIC S16 ssdCreateSTsk(sTsk) +S16 ssdCreateSTsk(sTsk) SsSTskEntry *sTsk; /* pointer to system task entry */ #endif { + S16 ret; pthread_attr_t attr; /* struct sched_param param_sched;*/ @@ -3649,7 +3642,7 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ #endif /* SS_MULTICORE_SUPPORT */ #endif /* SS_WATCHDOG */ { - RETVALUE(ROK); + return ROK; } #endif @@ -3680,16 +3673,17 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ while(threadCreated == FALSE) { #endif - if ((pthread_create(&sTsk->dep.tId, &attr, mtTskHdlrT2kL2, (Ptr)sTsk)) != 0) + 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"); #endif - RETVALUE(RFAILED); + return RFAILED; } #ifdef SS_THR_REG_MAP threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId, @@ -3710,7 +3704,8 @@ 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 */ @@ -3720,7 +3715,7 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread"); #endif - RETVALUE(RFAILED); + return RFAILED; } #ifdef SS_THR_REG_MAP threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId, @@ -3741,12 +3736,12 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ /* 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, @@ -3754,7 +3749,7 @@ void *(*start_routine) (void *), void* arg ) #else -PUBLIC int SCreatePThread(tid, attr, start_routine, arg) +int SCreatePThread(tid, attr, start_routine, arg) pthread_t* tid; pthread_attr_t* attr; void *(*start_routine) (void *); @@ -3770,7 +3765,7 @@ void* arg; /* Klock work fix ccpu00148484 */ if(threadArg == NULLP) { - RETVALUE(RFAILED); + return RFAILED; } threadArg->argument = arg; threadArg->start_routine = start_routine; @@ -3793,7 +3788,7 @@ void* arg; 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); @@ -3801,7 +3796,7 @@ void* arg; #endif } - RETVALUE(retVal); + return (retVal); } @@ -3875,7 +3870,7 @@ pthread_attr_t *attr #endif pthread_attr_setschedparam(attr, ¶m); - RETVALUE (ROK); + return (ROK); } /* ssdSetPthreadAttr */ @@ -3900,13 +3895,13 @@ pthread_attr_t *attr * */ #ifdef ANSI -PUBLIC S16 ssdGetAffinity +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) +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 @@ -3940,7 +3935,7 @@ U32 *coreId; /* the core/processor id to which the affinity i if (tskInd == SS_MAX_STSKS) { MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n"); - RETVALUE(RFAILED); + return RFAILED; } @@ -3953,7 +3948,7 @@ 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 pthread_setaffinity fails */ for (cpuInd = 0; cpuInd b_rptr; @@ -4169,11 +4164,11 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ "Could not write to demand queue"); #endif - RETVALUE(RFAILED); + return RFAILED; } - RETVALUE(ROK); + return ROK; } /* mt023.201 - Added SThreadYield function to yield CPU @@ -4192,12 +4187,12 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ * */ #ifdef ANSI -PUBLIC S16 SThreadYield +S16 SThreadYield ( void ) #else -PUBLIC S16 SThreadYield() +S16 SThreadYield() #endif { @@ -4213,11 +4208,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 */ @@ -4244,12 +4239,12 @@ PUBLIC S16 SThreadYield() * */ #ifdef ANSI -PUBLIC S16 ssdRegTmr +S16 ssdRegTmr ( SsTmrEntry *tmr /* pointer to timer entry */ ) #else -PUBLIC S16 ssdRegTmr(tmr) +S16 ssdRegTmr(tmr) SsTmrEntry *tmr; /* pointer to timer entry */ #endif { @@ -4276,7 +4271,7 @@ SsTmrEntry *tmr; /* pointer to timer entry */ cmPlcCbTq(&arg); - RETVALUE(ROK); + return ROK; } @@ -4294,12 +4289,12 @@ SsTmrEntry *tmr; /* pointer to timer entry */ * */ #ifdef ANSI -PUBLIC S16 ssdDeregTmr +S16 ssdDeregTmr ( SsTmrEntry *tmr /* pointer to timer entry */ ) #else -PUBLIC S16 ssdDeregTmr(tmr) +S16 ssdDeregTmr(tmr) SsTmrEntry *tmr; /* pointer to timer entry */ #endif { @@ -4322,7 +4317,7 @@ SsTmrEntry *tmr; /* pointer to timer entry */ cmRmvCbTq(&arg); - RETVALUE(ROK); + return ROK; } @@ -4340,13 +4335,13 @@ SsTmrEntry *tmr; /* pointer to timer entry */ * */ #ifdef ANSI -PUBLIC S16 ssdError +S16 ssdError ( Seq seq, /* sequence number */ Reason reason /* reset reason */ ) #else -PUBLIC S16 ssdError(seq, reason) +S16 ssdError(seq, reason) Seq seq; /* sequence number */ Reason reason; /* reset reason */ #endif @@ -4385,7 +4380,7 @@ Reason reason; /* reset reason */ /* won't reach here */ - RETVALUE(ROK); + return ROK; } @@ -4403,7 +4398,7 @@ Reason reason; /* reset reason */ * */ #ifdef ANSI -PUBLIC Void ssdLogError +Void ssdLogError ( Ent ent, /* Calling layer's entity id */ Inst inst, /* Calling layer's instance id */ @@ -4416,7 +4411,7 @@ ErrVal errVal, /* error value */ Txt *errDesc /* description of error */ ) #else -PUBLIC Void ssdLogError(ent, inst, procId, file, line, +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 */ @@ -4537,19 +4532,19 @@ Txt *errDesc; /* description of error */ * */ #ifdef ANSI -PUBLIC S16 ssdRegDrvrTsk +S16 ssdRegDrvrTsk ( SsDrvrTskEntry *drvrTsk /* driver task entry */ ) #else -PUBLIC S16 ssdRegDrvrTsk(drvrTsk) +S16 ssdRegDrvrTsk(drvrTsk) SsDrvrTskEntry *drvrTsk; /* driver task entry */ #endif { TRC0(ssdRegDrvrTsk); - RETVALUE(ROK); + return ROK; } /* mt001.30 : Additions */ /* @@ -4567,19 +4562,19 @@ SsDrvrTskEntry *drvrTsk; /* driver task entry */ * */ #ifdef ANSI -PUBLIC S16 ssdDeregDrvrTsk +S16 ssdDeregDrvrTsk ( SsDrvrTskEntry *drvrTsk /* driver task entry */ ) #else -PUBLIC S16 ssdDeregDrvrTsk(drvrTsk) +S16 ssdDeregDrvrTsk(drvrTsk) SsDrvrTskEntry *drvrTsk; /* driver task entry */ #endif { TRC0(ssdDeregDrvrTsk); - RETVALUE(ROK); + return ROK; } #endif @@ -4591,27 +4586,27 @@ SsDrvrTskEntry *drvrTsk; /* driver task entry */ */ #ifdef SS_MULTIPLE_PROCS #ifdef ANSI -PUBLIC S16 ssdProcTTskTerm +S16 ssdProcTTskTerm ( ProcId procIdx, SsTTskEntry *tTsk, SsIdx idx ) #else -PUBLIC S16 ssdProcTTskTerm(procIdx, tTsk, idx) +S16 ssdProcTTskTerm(procIdx, tTsk, idx) ProcId procIdx; SsTTskEntry *tTsk; SsIdx idx; #endif #else /*SS_MULTIPLE_PROCS*/ #ifdef ANSI -PUBLIC S16 ssdProcTTskTerm +S16 ssdProcTTskTerm ( SsTTskEntry *tTsk, SsIdx idx ) #else -PUBLIC S16 ssdProcTTskTerm(tTsk, idx) +S16 ssdProcTTskTerm(tTsk, idx) SsTTskEntry *tTsk; SsIdx idx; #endif @@ -4639,7 +4634,7 @@ SsIdx idx; if (ret != ROK) { MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not lock system task table"); - RETVALUE(RFAILED); + return RFAILED; } SS_ACQUIRE_ALL_SEMA(&osCp.tTskTblSem, ret); if (ret != ROK) @@ -4651,11 +4646,11 @@ SsIdx idx; { #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table"); - RETVALUE(RFAILED); + return RFAILED; #endif } - RETVALUE(RFAILED); + return RFAILED; } #ifdef SS_MULTIPLE_PROCS @@ -4735,9 +4730,9 @@ 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 @@ -4747,12 +4742,12 @@ EXTERN Void ysMtTskHdlr(Void); EXTERN Void ysMtPollPhyMsg(U8 region); EXTERN Void ysMtRcvPhyMsg(Void); #ifdef ANSI -PUBLIC Void *mtTskHdlrT2kL2 +Void *mtTskHdlrT2kL2 ( Ptr tskPtr /* pointer to task entry */ ) #else -PUBLIC Void *mtTskHdlrT2kL2(tskPtr) +Void *mtTskHdlrT2kL2(tskPtr) Ptr tskPtr; /* pointer to task entry */ #endif { @@ -4777,18 +4772,18 @@ Ptr tskPtr; /* pointer to task entry */ * (processes L1 msgs) */ } - RETVALUE(NULLP); + return (NULLP); } #else EXTERN Void ysMtTskHdlr(Void); EXTERN Void YsPhyRecvMsg(); #ifdef ANSI -PUBLIC Void *mtTskHdlrT2kL2 +Void *mtTskHdlrT2kL2 ( Ptr tskPtr /* pointer to task entry */ ) #else -PUBLIC Void *mtTskHdlrT2kL2(tskPtr) +Void *mtTskHdlrT2kL2(tskPtr) Ptr tskPtr; /* pointer to task entry */ #endif { @@ -4837,18 +4832,18 @@ Ptr tskPtr; /* pointer to task entry */ #endif } - RETVALUE(NULLP); + return (NULLP); } #endif /* TENB_T2K3K_SPECIFIC_CHANGES */ #endif #ifdef ANSI -PUBLIC void *pthreadCreateHdlr +void *pthreadCreateHdlr ( void * arg ) #else -PUBLIC void *pthreadCreateHdlr(pthreadCreateArg) +void *pthreadCreateHdlr(pthreadCreateArg) void *arg; #endif { @@ -4859,7 +4854,7 @@ void *arg; continue; pthreadCreateArg->start_routine(pthreadCreateArg->argument); - RETVALUE(ROK); + return ROK; } /* @@ -4882,12 +4877,12 @@ void *arg; * */ #ifdef ANSI -PUBLIC Void *mtTskHdlr +Void *mtTskHdlr ( Ptr tskPtr /* pointer to task entry */ ) #else -PUBLIC Void *mtTskHdlr(tskPtr) +Void *mtTskHdlr(tskPtr) Ptr tskPtr; /* pointer to task entry */ #endif { @@ -4929,7 +4924,7 @@ Ptr tskPtr; /* pointer to task entry */ } } - RETVALUE(NULLP); + return (NULLP); } @@ -4953,12 +4948,12 @@ Ptr tskPtr; /* pointer to task entry */ * */ #ifdef ANSI -PUBLIC S16 mtTskHdlMsg +S16 mtTskHdlMsg ( SsSTskEntry *sTsk ) #else -PUBLIC S16 mtTskHdlMsg(sTsk) +S16 mtTskHdlMsg(sTsk) SsSTskEntry *sTsk #endif { @@ -4993,7 +4988,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 */ @@ -5006,7 +5001,7 @@ SsSTskEntry *sTsk "Could not lock system task entry"); #endif SPutMsg(mBuf); - RETVALUE(ROK); + return ROK; } /* mt034.201 */ @@ -5058,7 +5053,7 @@ SsSTskEntry *sTsk "Could not lock system task table"); #endif /* what to do here? */ - RETVALUE(ROK); + return ROK; } /* clean up the system task entry */ @@ -5087,7 +5082,7 @@ SsSTskEntry *sTsk /* unlock the system task table */ SUnlock(&osCp.sTskTblLock); - RETVALUE(RFAILED); + return RFAILED; /* this is a data message or a permanent task keep-alive message */ @@ -5351,7 +5346,7 @@ SsSTskEntry *sTsk SThreadYield(); #endif - RETVALUE(ROK); + return ROK; } Bool g_usettitmr; @@ -5359,11 +5354,11 @@ Bool g_usettitmr; * Fun: mtTmrHdlrPublic */ #ifdef ANSI -PUBLIC Void mtTmrHdlrPublic +Void mtTmrHdlrPublic ( ) #else -PUBLIC Void mtTmrHdlrPublic() +Void mtTmrHdlrPublic() #endif { if (SLock(&osCp.tmrTblLock) != ROK) @@ -5539,7 +5534,7 @@ void *parm; /* unused */ } /* mt009.21: addition */ - RETVALUE( (Void *) NULLP); + return ( (Void *) NULLP); /* will not reach here */ } @@ -5559,13 +5554,13 @@ void *parm; /* unused */ * */ #ifdef ANSI -PUBLIC Void mtTimeout +Void mtTimeout ( PTR tCb, /* control block */ S16 evnt /* event */ ) #else -PUBLIC Void mtTimeout(tCb, evnt) +Void mtTimeout(tCb, evnt) PTR tCb; /* control block */ S16 evnt; /* event */ #endif @@ -5820,7 +5815,7 @@ Ptr parm; /* unused */ if (osCp.dep.conInFp == NULLP) { /* die */ - RETVALUE(NULLP); + return (NULLP); } fd = fileno(osCp.dep.conInFp); @@ -5950,7 +5945,7 @@ Ptr tskPtr; /* pointer to task entry */ } } /* mt009.21: addition */ - RETVALUE( (Void *) NULLP); + return ( (Void *) NULLP); /* not reached */ } @@ -5973,12 +5968,12 @@ Ptr tskPtr; /* pointer to task entry */ * */ #ifdef ANSI -PUBLIC Void mtIntSigHndlr +Void mtIntSigHndlr ( int arg ) #else -PUBLIC Void mtIntSigHndlr(arg) +Void mtIntSigHndlr(arg) int arg; #endif { @@ -6011,12 +6006,12 @@ int arg; * */ #ifdef ANSI -PUBLIC Void mtExitClnup +Void mtExitClnup ( void ) #else -PUBLIC Void mtExitClnup() +Void mtExitClnup() #endif { Ticks ticks; @@ -6075,13 +6070,13 @@ Ticks SGetTtiCount(Void) * */ #ifdef ANSI -PUBLIC S16 SDisplay +S16 SDisplay ( S16 chan, /* channel */ Txt *buf /* buffer */ ) #else -PUBLIC S16 SDisplay(chan, buf) +S16 SDisplay(chan, buf) S16 chan; /* channel */ Txt *buf; /* buffer */ #endif @@ -6093,14 +6088,14 @@ Txt *buf; /* buffer */ 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 @@ -6128,7 +6123,7 @@ Txt *buf; /* buffer */ #endif #endif - RETVALUE(ROK); + return ROK; } /*mt010.301 */ @@ -6146,12 +6141,12 @@ Txt *buf; /* buffer */ * */ #ifdef ANSI -PUBLIC S16 SFini +S16 SFini ( void ) #else -PUBLIC S16 SFini() +S16 SFini() #endif { TRC1(SFini); @@ -6173,7 +6168,7 @@ PUBLIC S16 SFini() #endif pthread_exit(NULLP); - RETVALUE(0); + return (0); } /* @@ -6191,12 +6186,12 @@ PUBLIC S16 SFini() * */ #ifdef ANSI -PUBLIC S16 SSetDateTime +S16 SSetDateTime ( REG1 DateTime *dt /* date and time */ ) #else -PUBLIC S16 SSetDateTime(dt) +S16 SSetDateTime(dt) REG1 DateTime *dt; /* date and time */ #endif { @@ -6206,7 +6201,7 @@ REG1 DateTime *dt; /* date and time */ UNUSED(dt); - RETVALUE(ROK); + return ROK; } @@ -6227,12 +6222,12 @@ REG1 DateTime *dt; /* date and time */ * */ #ifdef ANSI -PUBLIC S16 SGetDateTime +S16 SGetDateTime ( REG1 DateTime *dt /* date and time */ ) #else -PUBLIC S16 SGetDateTime(dt) +S16 SGetDateTime(dt) REG1 DateTime *dt; /* date and time */ #endif { @@ -6254,7 +6249,7 @@ REG1 DateTime *dt; /* date and time */ if (dt == NULLP) { MTLOGERROR(ERRCLS_INT_PAR, EMT023, ERRZERO, "Null pointer"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6287,7 +6282,7 @@ REG1 DateTime *dt; /* date and time */ #endif #endif /*-- SS_DATETIME_USEC --*/ - RETVALUE(ROK); + return ROK; } /* @@ -6308,12 +6303,12 @@ REG1 DateTime *dt; /* date and time */ */ /* mt003.301 Modifications */ #ifdef ANSI -PUBLIC S16 SGetEpcTime +S16 SGetEpcTime ( EpcTime *et /* date and time */ ) #else -PUBLIC S16 SGetEpcTime(et) +S16 SGetEpcTime(et) EpcTime *et; /* date and time */ #endif { @@ -6333,7 +6328,7 @@ PRIVATE U64 now; #if (ERRCLASS & ERRCLS_INT_PAR) if (et == NULLP) { - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6356,7 +6351,7 @@ PRIVATE U64 now; *et = now; - RETVALUE(ROK); + return ROK; } @@ -6375,12 +6370,12 @@ PRIVATE U64 now; * */ #ifdef ANSI -PUBLIC S16 SGetSysTime +S16 SGetSysTime ( Ticks *sysTime /* system time */ ) #else -PUBLIC S16 SGetSysTime(sysTime) +S16 SGetSysTime(sysTime) Ticks *sysTime; /* system time */ #endif { @@ -6391,7 +6386,7 @@ Ticks *sysTime; /* system time */ if (sysTime == NULLP) { MTLOGERROR(ERRCLS_INT_PAR, EMT024, ERRZERO, "Null pointer"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6399,7 +6394,7 @@ Ticks *sysTime; /* system time */ *sysTime = osCp.dep.sysTicks; - RETVALUE(ROK); + return ROK; } /* mt021.201 - Addition of SGetRefTime function */ @@ -6423,14 +6418,14 @@ Ticks *sysTime; /* system time */ * */ #ifdef ANSI -PUBLIC S16 SGetRefTime +S16 SGetRefTime ( U32 refTime, /* reference time */ U32 *sec, U32 *usec ) #else -PUBLIC S16 SGetRefTime(refTime, sec, usec) +S16 SGetRefTime(refTime, sec, usec) U32 refTime; /* reference time */ U32 *sec; U32 *usec; @@ -6455,13 +6450,13 @@ U32 *usec; 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)) { MTLOGERROR(ERRCLS_INT_PAR, EMT026, ERRZERO, "Reference time exceeds present time"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6472,7 +6467,7 @@ U32 *usec; *usec = ptime.tv_usec; #endif - RETVALUE(ROK); + return ROK; } @@ -6493,12 +6488,12 @@ U32 *usec; * */ #ifdef ANSI -PUBLIC S16 SRandom +S16 SRandom ( Random *value /* random number */ ) #else -PUBLIC S16 SRandom(value) +S16 SRandom(value) Random *value; /* random number */ #endif { @@ -6510,7 +6505,7 @@ Random *value; /* random number */ { /* mt011.21: addition */ MTLOGERROR(ERRCLS_INT_PAR, EMT028, (ErrVal)0 , "Null pointer"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6518,7 +6513,7 @@ Random *value; /* random number */ *value = (Random) rand_r(&osCp.dep.randSeed); - RETVALUE(ROK); + return ROK; } @@ -6536,18 +6531,18 @@ Random *value; /* random number */ * */ #ifdef ANSI -PUBLIC S16 SExitTsk +S16 SExitTsk ( void ) #else -PUBLIC S16 SExitTsk() +S16 SExitTsk() #endif { TRC1(SExitTsk); - RETVALUE(ROK); + return ROK; } @@ -6565,18 +6560,18 @@ PUBLIC S16 SExitTsk() * */ #ifdef ANSI -PUBLIC S16 SExitInt +S16 SExitInt ( void ) #else -PUBLIC S16 SExitInt() +S16 SExitInt() #endif { TRC1(SExitInt); - RETVALUE(ROK); + return ROK; } @@ -6598,18 +6593,18 @@ PUBLIC S16 SExitInt() * */ #ifdef ANSI -PUBLIC S16 SHoldInt +S16 SHoldInt ( void ) #else -PUBLIC S16 SHoldInt() +S16 SHoldInt() #endif { TRC1(SHoldInt); - RETVALUE(ROK); + return ROK; } @@ -6627,18 +6622,18 @@ PUBLIC S16 SHoldInt() * */ #ifdef ANSI -PUBLIC S16 SRelInt +S16 SRelInt ( void ) #else -PUBLIC S16 SRelInt() +S16 SRelInt() #endif { TRC1(SRelInt); - RETVALUE(ROK); + return ROK; } @@ -6657,18 +6652,18 @@ PUBLIC S16 SRelInt() * */ #ifdef ANSI -PUBLIC INLINE S16 SEnbInt +INLINE S16 SEnbInt ( void ) #else -PUBLIC INLINE S16 SEnbInt() +INLINE S16 SEnbInt() #endif { TRC1(SEnbInt); - RETVALUE(ROK); + return ROK; } @@ -6687,18 +6682,18 @@ PUBLIC INLINE S16 SEnbInt() * */ #ifdef ANSI -PUBLIC INLINE S16 SDisInt +INLINE S16 SDisInt ( void ) #else -PUBLIC INLINE S16 SDisInt() +INLINE S16 SDisInt() #endif { TRC1(SDisInt); - RETVALUE(ROK); + return ROK; } @@ -6717,13 +6712,13 @@ PUBLIC INLINE S16 SDisInt() * */ #ifdef ANSI -PUBLIC S16 SGetVect +S16 SGetVect ( VectNmb vectNmb, /* vector number */ PIF *vectFnct /* vector function */ ) #else -PUBLIC S16 SGetVect(vectNmb, vectFnct) +S16 SGetVect(vectNmb, vectFnct) VectNmb vectNmb; /* vector number */ PIF *vectFnct; /* vector function */ #endif @@ -6735,7 +6730,7 @@ PIF *vectFnct; /* vector function */ UNUSED(vectFnct); - RETVALUE(ROK); + return ROK; } @@ -6754,13 +6749,13 @@ PIF *vectFnct; /* vector function */ * */ #ifdef ANSI -PUBLIC S16 SPutVect +S16 SPutVect ( VectNmb vectNmb, /* vector number */ PIF vectFnct /* vector function */ ) #else -PUBLIC S16 SPutVect(vectNmb, vectFnct) +S16 SPutVect(vectNmb, vectFnct) VectNmb vectNmb; /* vector number */ PIF vectFnct; /* vector function */ #endif @@ -6772,7 +6767,7 @@ PIF vectFnct; /* vector function */ UNUSED(vectFnct); - RETVALUE(ROK); + return ROK; } /* mt028.201: modification: multiple procs support related changes */ @@ -6794,13 +6789,13 @@ PIF vectFnct; /* vector function */ * */ #ifdef ANSI -PUBLIC S16 SGetEntInst +S16 SGetEntInst ( Ent *ent, /* entity */ Inst *inst /* instance */ ) #else -PUBLIC S16 SGetEntInst(ent, inst) +S16 SGetEntInst(ent, inst) Ent *ent; /* entity */ Inst *inst; /* instance */ #endif @@ -6819,7 +6814,7 @@ Inst *inst; /* instance */ if (ent == NULLP || inst == NULLP) { MTLOGERROR(ERRCLS_INT_PAR, EMT029, ERRZERO, "Null pointer"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6833,7 +6828,7 @@ Inst *inst; /* instance */ ret = SLock(&osCp.sTskTblLock); if (ret != ROK) { - RETVALUE(RFAILED); + return RFAILED; } for (i = 0; i < SS_MAX_STSKS; i++) { @@ -6851,7 +6846,7 @@ Inst *inst; /* instance */ SUnlock(&osCp.sTskTblLock); - RETVALUE(ret == ROK ? ROK : RFAILED); + return (ret == ROK ? ROK : RFAILED); } @@ -6869,13 +6864,13 @@ Inst *inst; /* instance */ * */ #ifdef ANSI -PUBLIC S16 SSetEntInst +S16 SSetEntInst ( Ent ent, /* entity */ Inst inst /* instance */ ) #else -PUBLIC S16 SSetEntInst(ent, inst) +S16 SSetEntInst(ent, inst) Ent ent; /* entity */ Inst inst; /* instance */ #endif @@ -6894,7 +6889,7 @@ Inst inst; /* instance */ if (ent >= ENTNC || inst >= INSTNC) { MTLOGERROR(ERRCLS_INT_PAR, EMT030, ERRZERO, "Invalid entity/instance"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6908,7 +6903,7 @@ Inst inst; /* instance */ ret = SLock(&osCp.sTskTblLock); if (ret != ROK) { - RETVALUE(RFAILED); + return RFAILED; } for (i = 0; i < SS_MAX_STSKS; i++) { @@ -6926,7 +6921,7 @@ Inst inst; /* instance */ SUnlock(&osCp.sTskTblLock); - RETVALUE(ret == ROK ? ROK : RFAILED); + return (ret == ROK ? ROK : RFAILED); } #endif /* SS_MULTIPLE_PROCS */ @@ -6948,13 +6943,13 @@ Inst inst; /* instance */ * */ #ifdef ANSI -PUBLIC INLINE S16 SSetIntPend +INLINE S16 SSetIntPend ( U16 id, /* driver task identifier */ Bool flag /* flag */ ) #else -PUBLIC INLINE S16 SSetIntPend(id, flag) +INLINE S16 SSetIntPend(id, flag) U16 id; /* driver task identifier */ Bool flag; /* flag */ #endif @@ -6969,7 +6964,7 @@ Bool flag; /* flag */ if (id >= SS_MAX_DRVRTSKS || osCp.drvrTskTbl[id].used == FALSE) { MTLOGERROR(ERRCLS_INT_PAR, EMT031, id, "Invalid instance"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -6979,11 +6974,11 @@ 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 */ @@ -7004,12 +6999,12 @@ Bool flag; /* flag */ * */ #ifdef ANSI -PUBLIC S16 SGlobMemInfoShow +S16 SGlobMemInfoShow ( Void ) #else -PUBLIC S16 SGlobMemInfoShow() +S16 SGlobMemInfoShow() #endif { U16 idx; @@ -7051,7 +7046,7 @@ PUBLIC S16 SGlobMemInfoShow() sprintf(prntBuf, "--------------------------------------------------------------\n"); SDisplay(0, prntBuf); - RETVALUE(ROK); + return ROK; } #endif /* SS_LOCKLESS_MEMORY */ @@ -7066,9 +7061,9 @@ Bool IsMemoryThresholdHit(Region reg, Pool pool) pool, mtCMMRegCb[reg]->bktTbl[pool].numAlloc, mtCMMRegCb[reg]->bktTbl[pool].numBlks); - RETVALUE(TRUE); + return (TRUE); } - RETVALUE(FALSE); + return (FALSE); } */ @@ -7106,13 +7101,13 @@ Bool IsMemoryThresholdHit(Region reg, Pool pool) * */ #ifdef ANSI -PUBLIC S16 SRegInfoShow +S16 SRegInfoShow ( Region region, U32 *availmem ) #else -PUBLIC S16 SRegInfoShow(region, availmem) +S16 SRegInfoShow(region, availmem) Region region; U32 *availmem; #endif @@ -7126,7 +7121,7 @@ U32 *availmem; if (region > (SS_MAX_REGS-1) ) { MTLOGERROR(ERRCLS_INT_PAR, EMT032, ERRZERO, "Invalid Region"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -7206,7 +7201,7 @@ U32 *availmem; SDisplay(0, prntBuf); #endif - RETVALUE(ROK); + return ROK; } #ifdef XEON_SPECIFIC_CHANGES #define SSI_MAX_BKT_THRESHOLD 6 @@ -7238,13 +7233,13 @@ U8 maxBkt; } #ifdef ANSI -PUBLIC S16 SRegReachedMemThreshold +S16 SRegReachedMemThreshold ( Region region, U8 maxBkt ) #else -PUBLIC S16 SRegReachedMemThreshold(region, maxBkt) +S16 SRegReachedMemThreshold(region, maxBkt) Region region; U8 maxBkt; #endif @@ -7274,7 +7269,7 @@ U8 maxBkt; memStatus = 2; } } - RETVALUE(memStatus); + return (memStatus); } #endif /* mt033.201 - addition of API to return the memory statistical data */ @@ -7295,13 +7290,13 @@ U8 maxBkt; * */ #ifdef ANSI -PUBLIC S16 SGetRegInfo +S16 SGetRegInfo ( Region region, SsMemDbgInfo *dbgInfo ) #else -PUBLIC S16 SGetRegInfo(region, dbgInfo) +S16 SGetRegInfo(region, dbgInfo) Region region; SsMemDbgInfo *dbgInfo; #endif @@ -7314,7 +7309,7 @@ SsMemDbgInfo *dbgInfo; if (region >= mtMemoCfg.numRegions ) { MTLOGERROR(ERRCLS_INT_PAR, EMT033, ERRZERO, "Invalid Region"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -7349,17 +7344,17 @@ 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) +S16 SGetRegPoolInfo(numRegion, numPool) U8 *numRegion; U8 *numPool; #endif @@ -7369,7 +7364,7 @@ U8 *numPool; /* Send number of Pools available */ *numPool = cfgRegInfo[0].numPools; - RETVALUE(ROK); + return ROK; } /* mt033.201 - addition of APIs to print the memory statistical data @@ -7396,13 +7391,13 @@ U8 *numPool; * */ #ifdef ANSI -PUBLIC S16 SPrintRegMemStatusInfo +S16 SPrintRegMemStatusInfo ( Region region, U8 typeFlag ) #else -PUBLIC S16 SPrintRegMemStatusInfo(region, typeFlag) +S16 SPrintRegMemStatusInfo(region, typeFlag) Region region; U8 typeFlag; #endif @@ -7418,7 +7413,7 @@ U8 typeFlag; if (region >= mtMemoCfg.numRegions ) { MTLOGERROR(ERRCLS_INT_PAR, EMT034, ERRZERO, "Invalid Region"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -7483,7 +7478,7 @@ U8 typeFlag; else if (typeFlag == SS_MEM_BLK_SIZE_PROFILE) { /* Bucket Memory allocation Statistics */ - RETVALUE(SPrintRegMemStats(region)); + return (SPrintRegMemStats(region)); } else { @@ -7492,7 +7487,7 @@ U8 typeFlag; SDisplay(0, prntBuf); } - RETVALUE(ROK); + return ROK; } /* @@ -7599,7 +7594,7 @@ Region region; sprintf(prntBuf, "\n"); SDisplay(0, prntBuf); - RETVALUE(ROK); + return ROK; } /* @@ -7618,14 +7613,14 @@ Region region; * */ #ifdef ANSI -PUBLIC Void SRegMemErrHdlr +Void SRegMemErrHdlr ( Region region, Data *ptr, S16 errCode ) #else -PUBLIC Void SRegMemErrHdlr(region, ptr, errCode) +Void SRegMemErrHdlr(region, ptr, errCode) Region region; Data *ptr; S16 errCode; @@ -7666,12 +7661,12 @@ S16 errCode; * */ #ifdef ANSI -PUBLIC S16 SPrintRegMemProfile +S16 SPrintRegMemProfile ( Region region ) #else -PUBLIC S16 SPrintRegMemProfile(region) +S16 SPrintRegMemProfile(region) Region region; #endif { @@ -7692,7 +7687,7 @@ Region region; if (region >= mtMemoCfg.numRegions ) { MTLOGERROR(ERRCLS_INT_PAR, EMT035, ERRZERO, "Invalid Region"); - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -7830,7 +7825,7 @@ Region region; * 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); + return ROK; } /*mt009.301 Fixed 64BIT compilation warnings*/ @@ -7881,7 +7876,7 @@ Region region; } - RETVALUE(ROK); + return ROK; } #endif /* SSI_DEBUG_LEVEL1 */ @@ -7901,12 +7896,12 @@ Region region; * --*/ #ifdef ANSI -PUBLIC S16 SGetTimeStamp +S16 SGetTimeStamp ( S8 *ts ) #else -PUBLIC S16 SGetTimeStamp(ts) +S16 SGetTimeStamp(ts) S8 *ts; #endif { @@ -7954,7 +7949,7 @@ S8 *ts; sprintf(ts, "%s.%03ld", time_string, microseconds); #endif - RETVALUE(ROK); + return ROK; } /*-- mt037.201 : Added new API for SGetSystemTsk --*/ @@ -7972,17 +7967,17 @@ S8 *ts; * --*/ #ifdef ANSI -PUBLIC U32 SGetSystemTsk +U32 SGetSystemTsk ( Void ) #else -PUBLIC U32 SGetSystemTsk() +U32 SGetSystemTsk() #endif { TRC1(SGetSystemTskS); - RETVALUE(pthread_self()); + return (pthread_self()); } /* end of SGetSystemTsk */ @@ -8022,7 +8017,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() "Could not lock system task table"); #endif - RETVALUE(sTsk); + return (sTsk); } /* check count of system tasks */ @@ -8034,7 +8029,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT040, ERRZERO, "Could not give the Semaphore"); - RETVALUE(sTsk); + return (sTsk); #endif } @@ -8042,7 +8037,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() MTLOGERROR(ERRCLS_ADD_RES, EMT041, ERRZERO, "Too many system tasks"); #endif - RETVALUE(sTsk); + return (sTsk); } @@ -8061,7 +8056,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO, "Could not give the Semaphore"); - RETVALUE(NULLP); + return (NULLP); #endif } @@ -8070,7 +8065,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() "Could not initialize demand queue"); #endif - RETVALUE(NULLP); + return (NULLP); } /* initialize the system task entry lock */ @@ -8083,7 +8078,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO, "Could not give the Semaphore"); - RETVALUE(NULLP); + return (NULLP); #endif } @@ -8092,7 +8087,7 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() "Could not initialize system task entry lock"); #endif - RETVALUE(NULLP); + return (NULLP); } @@ -8110,11 +8105,11 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO, "Could not give the Semaphore"); - RETVALUE(NULLP); + return (NULLP); #endif } - RETVALUE(sTsk); + return (sTsk); } #endif /* SS_MULTICORE_SUPPORT */ /* mt003.301 Readwrite lock and recursive mutex additions */ @@ -8133,13 +8128,13 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() * */ #ifdef ANSI -PUBLIC S16 ssdInitLockNew +S16 ssdInitLockNew ( SLockInfo *lockId, U8 lockType ) #else -PUBLIC S16 ssdInitLockNew(lockId, lockType) +S16 ssdInitLockNew(lockId, lockType) SLockInfo *lockId; U8 lockType; #endif @@ -8162,7 +8157,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdInitLockNew(): Initialization of read write lock failed,Error# retVal %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8176,7 +8171,7 @@ U8 lockType; { sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr init failed,Error# %d \n",retVal); SPrint(prntBuf); - RETVALUE(RFAILED); + return RFAILED; } #ifdef SS_LINUX retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP); @@ -8188,7 +8183,7 @@ U8 lockType; sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr settype failed,Error# %d \n",retVal); pthread_mutexattr_destroy(&attr); SPrint(prntBuf); - RETVALUE(RFAILED); + return RFAILED; } retVal = pthread_mutex_init((pthread_mutex_t *)&(lockId->l.recurLock), &attr); if(retVal != 0) @@ -8196,7 +8191,7 @@ U8 lockType; sprintf(prntBuf,"\n ssdInitLockNew(): mutex init failed,Error# %d \n",retVal); pthread_mutexattr_destroy(&attr); SPrint(prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8205,10 +8200,10 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdInitLockNew(): Invalid lock type %d\n", lockType); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } /* * @@ -8224,13 +8219,13 @@ U8 lockType; * */ #ifdef ANSI -PUBLIC S16 ssdLockNew +S16 ssdLockNew ( SLockInfo *lockId, U8 lockType ) #else -PUBLIC S16 ssdLockNew(lockId, lockType) +S16 ssdLockNew(lockId, lockType) SLockInfo *lockId; U8 lockType; #endif @@ -8250,7 +8245,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8260,7 +8255,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the write lock,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8270,7 +8265,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8280,7 +8275,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8292,7 +8287,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8301,11 +8296,11 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdLockNew(): Invalid lock type %d\n", lockType); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } @@ -8323,13 +8318,13 @@ U8 lockType; * */ #ifdef ANSI -PUBLIC S16 ssdUnlockNew +S16 ssdUnlockNew ( SLockInfo *lockId, U8 lockType ) #else -PUBLIC S16 ssdUnlockNew(lockId, lockType) +S16 ssdUnlockNew(lockId, lockType) SLockInfo *lockId; U8 lockType; #endif @@ -8349,7 +8344,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to unlock the lock,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8361,7 +8356,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8370,10 +8365,10 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdUnlockNew(): Invalid lock type %d\n", lockType); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } /* @@ -8390,13 +8385,13 @@ U8 lockType; * */ #ifdef ANSI -PUBLIC S16 ssdDestroyLockNew +S16 ssdDestroyLockNew ( SLockInfo *lockId, U8 lockType ) #else -PUBLIC S16 ssdDestroyLockNew(lockId, lockType) +S16 ssdDestroyLockNew(lockId, lockType) SLockInfo *lockId; U8 lockType; #endif @@ -8415,7 +8410,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the lock,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8427,7 +8422,7 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the mutex,Error# %d\n", retVal); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } break; } @@ -8436,10 +8431,10 @@ U8 lockType; { sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Invalid lock type %d\n", lockType); SDisplay(0, prntBuf); - RETVALUE(RFAILED); + return RFAILED; } } - RETVALUE(ROK); + return ROK; } #endif /* SS_LOCK_SUPPORT */ @@ -8464,12 +8459,12 @@ U8 lockType; * **/ #ifdef ANSI -PUBLIC S16 ssInitRcvWork +S16 ssInitRcvWork ( void ) #else -PUBLIC S16 ssInitRcvWork() +S16 ssInitRcvWork() #endif { pthread_attr_t attr; @@ -8488,12 +8483,12 @@ PUBLIC S16 ssInitRcvWork() { pthread_attr_destroy(&attr); - RETVALUE(RFAILED); + return RFAILED; } pthread_attr_destroy(&attr); - RETVALUE(ROK); + return ROK; }/* ssInitRcvWork */ @@ -8612,7 +8607,7 @@ PRIVATE void *workRcvTsk (ptr) #endif /* SS_SEUM_CAVIUM */ #ifdef TENB_RTLIN_CHANGES -PUBLIC S16 SInitLock(SLockId *l, U8 t) +S16 SInitLock(SLockId *l, U8 t) { S16 r = 0; pthread_mutexattr_t prior; @@ -8641,7 +8636,7 @@ PUBLIC S16 SInitLock(SLockId *l, U8 t) * */ -PUBLIC Void ssRegMainThread(Void) +Void ssRegMainThread(Void) { if(SS_INVALID_THREAD_REG_MAP != SS_GET_THREAD_MEM_REGION()) @@ -8685,7 +8680,7 @@ 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 */ @@ -8711,7 +8706,7 @@ Region region /* Region associated with thread */ 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 @@ -8731,7 +8726,7 @@ Region region /* Region associated with thread */ } createdThreads = 0; - RETVALUE(TRUE); + return (TRUE); } /* ssCheckAndAddMemoryRegionMap */ @@ -8759,7 +8754,7 @@ Region region /* Region associated with thread */ * File: mt_ss.c * */ -PUBLIC S32 ssCheckAndDelMemoryRegionMap +S32 ssCheckAndDelMemoryRegionMap ( pthread_t threadId /* Thread Id of system task */ ) @@ -8780,14 +8775,14 @@ pthread_t threadId /* Thread Id of system task */ #else printf("Invalid Thread ID (%d)\n", (U32)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 */ @@ -8808,13 +8803,13 @@ pthread_t threadId /* Thread Id of system task */ * */ #ifdef ANSI -PUBLIC S16 SStartTask +S16 SStartTask ( VOLATILE U32 *startTime, U32 taskId ) #else -PUBLIC S16 SStartTask(startTime, taskId) +S16 SStartTask(startTime, taskId) VOLATILE U32 *startTime; U32 taskId; #endif @@ -8822,7 +8817,7 @@ U32 taskId; #ifdef MSPD_MLOG_NEW *startTime = GetTIMETICK(); #endif - RETVALUE(ROK); + return ROK; } /* @@ -8841,13 +8836,13 @@ U32 taskId; * */ #ifdef ANSI -PUBLIC S16 SStopTask +S16 SStopTask ( VOLATILE U32 startTime, U32 taskId ) #else -PUBLIC S16 SStopTask(startTime, taskId) +S16 SStopTask(startTime, taskId) VOLATILE U32 startTime; U32 taskId; #endif @@ -8886,38 +8881,38 @@ U32 taskId; #endif break; } - RETVALUE(ROK); + return ROK; } #else #ifdef ANSI -PUBLIC S16 SStartTask +S16 SStartTask ( VOLATILE U32 * startTime, U32 taskId ) #else -PUBLIC S16 SStartTask(startTime, taskId) +S16 SStartTask(startTime, taskId) VOLATILE U32 * startTime; U32 taskId; #endif { *startTime = 0; - RETVALUE(ROK); + return ROK; } #ifdef ANSI -PUBLIC S16 SStopTask +S16 SStopTask ( VOLATILE U32 startTime, U32 taskId ) #else -PUBLIC S16 SStopTask(startTime, taskId) +S16 SStopTask(startTime, taskId) VOLATILE U32 startTime; U32 taskId; #endif { - RETVALUE(ROK); + return ROK; } #endif /*#ifdef SS_TSKLOG_ENABLE */ @@ -8931,13 +8926,13 @@ U32 taskId; * @return Void - function is always success */ #ifdef ANSI -PUBLIC Void UpdateSocCpuInfo +Void UpdateSocCpuInfo ( CmCpuStatsInfo *cpuInfo, U8 idx ) #else -PUBLIC Void UpdateSocCpuInfo(*cpuInfo, idx) +Void UpdateSocCpuInfo(*cpuInfo, idx) CmCpuStatsInfo *cpuInfo; U8 idx; #endif @@ -9045,7 +9040,7 @@ U8 idx; "Could not lock system task table"); #endif - RETVALUE(sTsk); + return (sTsk); } /* initialize the system task entry with the information we have */ @@ -9070,7 +9065,7 @@ U8 idx; #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO, "Could not give the Semaphore"); - RETVALUE(NULLP); + return (NULLP); #endif } @@ -9079,7 +9074,7 @@ U8 idx; "Could not initialize demand queue"); #endif - RETVALUE(NULLP); + return (NULLP); } /* initialize the system task entry lock */ @@ -9092,7 +9087,7 @@ U8 idx; #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO, "Could not give the Semaphore"); - RETVALUE(NULLP); + return (NULLP); #endif } @@ -9101,7 +9096,7 @@ U8 idx; "Could not initialize system task entry lock"); #endif - RETVALUE(NULLP); + return (NULLP); } @@ -9117,11 +9112,11 @@ U8 idx; #if (ERRCLASS & ERRCLS_DEBUG) MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO, "Could not give the Semaphore"); - RETVALUE(NULLP); + return (NULLP); #endif } - RETVALUE(sTsk); + return (sTsk); } #endif /* SS_MULTICORE_SUPPORT */ @@ -9141,12 +9136,12 @@ U8 idx; * */ #ifdef ANSI -PUBLIC S16 ssdReInitTmr +S16 ssdReInitTmr ( void ) #else -PUBLIC S16 ssdReInitTmr() +S16 ssdReInitTmr() #endif { pthread_attr_t attr; @@ -9171,7 +9166,7 @@ PUBLIC S16 ssdReInitTmr() MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO, "Could not give the Semaphore"); #endif - RETVALUE(RFAILED); + return RFAILED; } #endif @@ -9182,7 +9177,7 @@ PUBLIC S16 ssdReInitTmr() sTsk = ssdReAddTmrSTsk(0); if(!sTsk) { - RETVALUE(RFAILED); + return RFAILED; } #endif /* SS_MULTICORE_SUPPORT */ /* create the timer handler thread */ @@ -9212,7 +9207,7 @@ PUBLIC S16 ssdReInitTmr() /* mt020.201 - Addition for destroying thread attribute object attr */ pthread_attr_destroy(&attr); - RETVALUE(RFAILED); + return RFAILED; } #ifdef SS_THR_REG_MAP @@ -9227,7 +9222,7 @@ 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; } /**********************************************************************