X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fmt%2Fmt_ss.c;h=d909e4b504d2e5ec0d30a253fda6bb1f437b86f1;hb=ba78fa13b01e0729fe0a6a7a18cbf1d52cdcda1c;hp=8cdf6476c438d1e027de61189b558ba7941e9bc0;hpb=0a26c487f1b6bbb5217e47b15fa8273b2e749283;p=o-du%2Fl2.git diff --git a/src/mt/mt_ss.c b/src/mt/mt_ss.c index 8cdf6476c..d909e4b50 100644 --- a/src/mt/mt_ss.c +++ b/src/mt/mt_ss.c @@ -102,6 +102,12 @@ #include #endif /* SS_WATCHDOG */ +#ifdef SS_USE_WLS_MEM +#include +#include +#include +#endif + /* header/extern include files (.x) */ #include "gen.x" /* general layer */ @@ -153,24 +159,20 @@ #include "sys/syscall.h" #endif -#if defined(RGL_SPECIFIC_CHANGES) || defined(INTEL_WLS) +#if defined(RGL_SPECIFIC_CHANGES) || defined(INTEL_WLS) || defined(SS_USE_WLS_MEM) #include #include #endif -#ifdef INTEL_WLS -EXTERN void LwrMacRecvPhyMsg(); -#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 @@ -203,12 +205,12 @@ Void cmPrcTmr ARGS((CmTqCp* tqCp, CmTqType* tq, PFV func)); void dump_external(void); #ifdef ANSI -PRIVATE Void mtDelSigals +static Void mtDelSigals ( Void ) #else -PRIVATE Void mtDelSignals() +static Void mtDelSignals() #endif { struct sigaction sa; @@ -223,7 +225,7 @@ 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) { @@ -324,18 +326,18 @@ void *pthreadCreateHdlr(void* arg); 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 /* forward references */ @@ -346,56 +348,56 @@ Void *mtTskHdlrT2kL2 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) */ #ifdef SSI_DEBUG_LEVEL1 -PRIVATE S16 SPrintRegMemStats ARGS((Region region)); +static S16 SPrintRegMemStats ARGS((Region region)); #endif /* SSI_DEBUG_LEVEL1 */ #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 @@ -409,8 +411,8 @@ 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 @@ -434,6 +436,7 @@ SsRegCfg cfgRegInfo[SS_MAX_REGS] = { 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 } } } @@ -460,6 +463,7 @@ SsRegCfg cfgRegInfo[SS_MAX_REGS] = { 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 } } }, @@ -470,6 +474,7 @@ SsRegCfg cfgRegInfo[SS_MAX_REGS] = { 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 } } }, @@ -480,6 +485,7 @@ SsRegCfg cfgRegInfo[SS_MAX_REGS] = { 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 } } }, @@ -490,9 +496,21 @@ SsRegCfg cfgRegInfo[SS_MAX_REGS] = { 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 } } - } + } #endif /* SS_LOCKLESS_MEMORY */ }; /* mt003.301 Modifications - File Based task registration made @@ -512,7 +530,8 @@ MtDynMemCfg mtDynMemoCfg = {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_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} } }, { @@ -523,7 +542,8 @@ MtDynMemCfg mtDynMemoCfg = {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_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} } }, { @@ -534,7 +554,8 @@ MtDynMemCfg mtDynMemoCfg = {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_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} } }, { @@ -545,7 +566,8 @@ MtDynMemCfg mtDynMemoCfg = {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_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD} } }, { @@ -556,7 +578,20 @@ MtDynMemCfg mtDynMemoCfg = {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_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} } } #if ((defined (SPLIT_RLC_DL_TASK)) && (!defined (L2_L3_SPLIT))) @@ -586,7 +621,8 @@ 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}, @@ -620,7 +656,8 @@ MtMemCfg mtMemoCfg = {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_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 */ @@ -659,7 +696,8 @@ MtMemCfg mtMemoCfg = {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_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 */ } }, { @@ -670,7 +708,8 @@ MtMemCfg mtMemoCfg = {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_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 */ } }, { @@ -681,7 +720,8 @@ MtMemCfg mtMemoCfg = {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_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 */ } }, { @@ -692,10 +732,22 @@ MtMemCfg mtMemoCfg = {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_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 */ } } - #endif /* SS_LOCKLESS_MEMORY */ STATIC_MEM_CFG } @@ -712,27 +764,34 @@ 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 /* 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) @@ -746,21 +805,33 @@ unsigned int mtGetNtlHdl() } #endif /* NTL_LIB */ - -void * mtGetWlsHdl() +void mtGetWlsHdl(void **hdlr) { - return (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() { + uint8_t i; void *hdl; - #define WLS_DEVICE_NAME "/dev/wls" + #define WLS_DEVICE_NAME "wls0" + + char *my_argv[] = {"gnodeb", "-c3", "--proc-type=auto", "--file-prefix", WLS_DEVICE_NAME, "--iova-mode=pa"}; + printf("Calling 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("Cannot init EAL\n"); + #ifdef XEON_SPECIFIC_CHANGES #ifdef XEON_MULTIPLE_CELL_CHANGES @@ -769,7 +840,7 @@ PRIVATE int SOpenWlsIntf() hdl = WLS_Open(WLS_DEVICE_NAME, 1); #endif #else - hdl = WLS_Open(WLS_DEVICE_NAME, WLS_MASTER_CLIENT, (512 *1024 * 1024)); + hdl = WLS_Open(WLS_DEVICE_NAME, WLS_MASTER_CLIENT, WLS_MEM_SIZE); #endif osCp.wls.intf = hdl; @@ -815,7 +886,6 @@ int argc; /* argument count */ char **argv; /* argument vector */ #endif { - TRC0(main); #ifdef XEON_MULTIPLE_CELL_CHANGES /* Read the WLS parameters from the file and copy into global control block */ @@ -826,7 +896,7 @@ char **argv; /* argument vector */ } /* end of if statement */ #endif -#ifdef INTEL_WLS +#if defined (INTEL_WLS) || defined (SS_USE_WLS_MEM) if(!SOpenWlsIntf()) return (0); #endif /* INTEL_WLS */ @@ -876,7 +946,6 @@ int argc; /* argument count */ char **argv; /* argument vector */ #endif { - TRC0(ssMain); msArgc = argc; @@ -922,7 +991,6 @@ S16 ssdInitGen() struct sigaction sa; #endif - TRC0(ssdInitGen); /*mt014.301 : 4GMX release related changes*/ #ifdef SS_4GMX_UCORE @@ -1076,13 +1144,12 @@ void Void ssdDeinitGen() #endif { - TRC0(ssdDeinitGen); sem_destroy(&osCp.dep.ssStarted); - RETVOID; + return; } #ifdef SS_LOCKLESS_MEMORY #ifdef USE_MALLOC @@ -1104,13 +1171,13 @@ Void ssdDeinitGen() #ifdef ANSI S16 ssPutDynMemBlkSet ( -U8 bktIdx, /* Index to bucket list */ +uint8_t bktIdx, /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem /* Memory set element which is needs to be added to global region */ ) #else S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem) -U8 bktIdx; /* Index to bucket list */ +uint8_t bktIdx; /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be added to global region */ #endif @@ -1118,7 +1185,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be CmMmGlobRegCb *globReg; CmMmGlobalBktCb *bktCb; Data *blkPtr; - U8 blkCnt; + uint8_t blkCnt; globReg = osCp.globRegCb; @@ -1162,13 +1229,13 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is needs to be #ifdef ANSI S16 ssGetDynMemBlkSet ( -U8 bktIdx, /* Index to bucket list */ +uint8_t bktIdx, /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem /* Memory set element which is updated with new set values */ ) #else S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem) -U8 bktIdx; /* Index to bucket list */ +uint8_t bktIdx; /* Index to bucket list */ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated with new set values */ #endif @@ -1178,7 +1245,7 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated CmMmGlobalBktCb *bktCb; Data **basePtr; Data *blkPtr; - U8 blkCnt; + uint8_t blkCnt; globReg = osCp.globRegCb; @@ -1224,17 +1291,17 @@ CmMmBlkSetElement *dynMemSetElem; /* Memory set element which is updated #ifdef ANSI S16 ssPutDynMemBlkSet ( -U8 bktIdx, /* Index to bucket list */ +uint8_t 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 */ +uint32_t doNotBlockForLock /* Boolean whether to block for lock or not */ ) #else S16 ssPutDynMemBlkSet(bktIdx, dynMemSetElem) -U8 bktIdx; /* Index to bucket list */ +uint8_t 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 */ +uint32_t doNotBlockForLock; /* Boolean whether to block for lock or not */ #endif { CmMmGlobRegCb *globReg; @@ -1243,7 +1310,6 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock CmMmBlkSetElement *globMemNode; S16 lockRet = 0; - TRC1(ssPutDynMemBlkSet); globReg = osCp.globRegCb; @@ -1312,17 +1378,17 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock #ifdef ANSI S16 ssGetDynMemBlkSet ( -U8 bktIdx, /* Index to bucket list */ +uint8_t 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 */ +uint32_t doNotBlockForLock /* Boolean whether to block for lock or not */ ) #else S16 ssGetDynMemBlkSet(bktIdx, dynMemSetElem) -U8 bktIdx; /* Index to bucket list */ +uint8_t 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 */ +uint32_t doNotBlockForLock; /* Boolean whether to block for lock or not */ #endif { CmMmGlobRegCb *globReg; @@ -1331,7 +1397,6 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock CmMmBlkSetElement *globMemNode; S16 lockRet = 0; - TRC1(ssGetDynMemBlkSet); globReg = osCp.globRegCb; @@ -1380,22 +1445,21 @@ U32 doNotBlockForLock; /* Boolean whether to block for lock #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 -U32 isMemThreshReached( +uint32_t isMemThreshReached( Region reg ) #else -U32 isMemThreshReached(reg) +uint32_t isMemThreshReached(reg) Region reg; #endif { CmMmGlobRegCb *globReg; CmMmGlobalBktCb *bktCb; - U8 bktIdx= reg; - TRC3(isMemThreshReached) + uint8_t bktIdx= reg; globReg = osCp.globRegCb; @@ -1480,25 +1544,70 @@ Region region; #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("Global 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); +#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 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; + 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]; @@ -1512,7 +1621,7 @@ S16 SPartitionWlsMemory() 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 */ } @@ -1546,12 +1655,12 @@ Void SChkAddrValid(int type, int region, PTR ptr) } #endif /* SS_MEM_WL_DEBUG */ -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++) @@ -1562,7 +1671,7 @@ 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.regStartAddr[i] = (uint64_t)mtRegMemSz[i].startAddr; regMemLeakInfo.numActvRegions++; } #endif /* T2K_MEM_LEAK_DBG */ @@ -1572,8 +1681,8 @@ S16 SPartitionStaticMemory(U8 *startAddr) S16 SAllocateWlsMem() { - U32 reqdMemSz; - U32 i, j; + uint32_t reqdMemSz; + uint32_t i, j; MtRegCfg *region; reqdMemSz = 0; @@ -1606,10 +1715,10 @@ S16 SAllocateWlsMem() 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); @@ -1667,9 +1776,9 @@ S16 ssdInitMem() #endif { /* mt018.201 - added local variable */ - U8 i; - U16 j; - U8 k; + uint8_t i; + uint16_t j; + uint8_t k; MtRegCfg *region; Txt errMsg[256] = {'\0'}; #ifdef SS_LOCKLESS_MEMORY @@ -1681,7 +1790,6 @@ S16 ssdInitMem() #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 @@ -1719,13 +1827,22 @@ S16 ssdInitMem() 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("Starting 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) { @@ -1761,6 +1878,7 @@ S16 ssdInitMem() #endif 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; @@ -1778,7 +1896,7 @@ S16 ssdInitMem() #endif /* SS_LOCKLESS_MEMORY */ #ifdef T2K_MEM_LEAK_DBG - U8 reg; + uint8_t reg; /* Initailize mem leak tool memorys for debguing */ regMemLeakInfo.numActvRegions=0; for(reg=0; reg selector = SS_LOOSE_COUPLING; @@ -2671,7 +2778,6 @@ S16 ssdWatchDgActvTmr() #endif #endif /* SS_MULTIPLE_PROCS */ { - TRC3(ssWatchDgActvTmr); cmPrcTmr(&osCp.wdCp.watchDgTqCp, osCp.wdCp.watchDgTs, (PFV)ssdWatchDgTmrEvt); @@ -2698,7 +2804,6 @@ S16 event; /* timer number */ Bool restartTmr; int i; - TRC2(ssWatchDgTmrEvt); switch(event) { @@ -2744,13 +2849,13 @@ Void ssdStartWatchDgTmr ( void *cb, S16 event, -U16 wait +uint16_t wait ) #else Void ssdStartWatchDgTmr(cb, event, wait) void *cb; S16 event; -U16 wait; +uint16_t wait; #endif { CmTmrArg arg; @@ -2761,7 +2866,6 @@ U16 wait; #endif - TRC2(ssStartWatchDgTmr) /* mt003.301 Modifications */ #ifdef DEBUGP SGetDateTime(&dt); @@ -2792,7 +2896,7 @@ U16 wait; arg.max = 1; cmPlcCbTq(&arg); - RETVOID; + return; } #ifdef ANSI @@ -2814,7 +2918,6 @@ S16 event; int i; #endif - TRC2(ssStopWatchDgTmr) /* mt003.301 Modifications */ #ifdef DEBUGP SGetDateTime(&dt); @@ -2843,19 +2946,19 @@ S16 event; arg.max = 1; cmRmvCbTq(&arg); - RETVOID; + return; } #ifdef ANSI S16 ssdSndHrtBtMsg ( Bool restart, -U32 type +uint32_t type ) #else S16 ssdSndHrtBtMsg(restart, type) Bool restart; -U32 type; +uint32_t type; #endif { S16 ret = ROK; @@ -2868,7 +2971,6 @@ U32 type; int n; int err; - TRC2(ssdSndHrtBtReq) #ifdef DEBUGP SGetDateTime(&dt); @@ -2942,12 +3044,12 @@ U32 type; * */ #ifdef ANSI -PRIVATE Void mtGetOpts +static Void mtGetOpts ( void ) #else -PRIVATE Void mtGetOpts() +static Void mtGetOpts() #endif { S32 argc; @@ -2957,7 +3059,7 @@ PRIVATE Void mtGetOpts() #ifndef NOFILESYS FILE *memOpt; /* memory options file pointer */ Txt pBuf[128]; - U8 i; + uint8_t i; /* mt007.301 : Fix related to file based mem config on 64 bit machine */ PTR numReg; PTR numBkts; @@ -2982,7 +3084,6 @@ PRIVATE Void mtGetOpts() Cntr idx=0; #endif - TRC0(mtGetOpts); msOptInd = 1; @@ -3285,7 +3386,7 @@ PRIVATE Void mtGetOpts() msOptInd = 1; - RETVOID; + return; } #endif @@ -3347,7 +3448,6 @@ char *opts; /* options */ S8 *cp; #endif - TRC1(SGetOpt); /* mt020.201 - Addition for no command line */ #ifdef NOCMDLINE @@ -3453,7 +3553,6 @@ Void ssdStart() S16 i; - TRC0(ssdStart); /* mt025.201 - Modification for adding lock to timer handler */ @@ -3463,7 +3562,7 @@ Void ssdStart() } - RETVOID; + return; } @@ -3500,10 +3599,6 @@ SsTTskEntry *tTsk; /* pointer to TAPA task entry */ SsMsgInfo *mInfo; S16 ret; - - TRC0(ssdAttachTTsk); - - if (tTsk->tskType == SS_TSK_PERMANENT) { /* Send a permanent tick message to this task, to start @@ -3584,8 +3679,6 @@ S16 ssdDetachTTsk(tTsk) SsTTskEntry *tTsk; /* pointer to TAPA task entry */ #endif { - TRC0(ssdDetachTTsk); - return ROK; } @@ -3620,10 +3713,9 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ /* struct sched_param param_sched;*/ #ifdef SS_THR_REG_MAP - U32 threadCreated = FALSE; + uint32_t threadCreated = FALSE; #endif - TRC0(ssdCreateSTsk); #ifdef SS_SINGLE_THREADED @@ -3728,7 +3820,7 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ /*mt013.301 :Added SS_AFFINITY_SUPPORT */ #if defined(SS_MULTICORE_SUPPORT) ||defined(SS_AFFINITY_SUPPORT) { - static U32 stLwpId = 3; + static uint32_t stLwpId = 3; sTsk->dep.lwpId = ++stLwpId; } #endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */ @@ -3758,7 +3850,7 @@ void* arg; { int retVal = 0; #ifdef SS_THR_REG_MAP - U32 threadCreated = FALSE; + uint32_t threadCreated = FALSE; #endif SPThreadCreateArg* threadArg = (SPThreadCreateArg*)malloc(sizeof(SPThreadCreateArg)); @@ -3770,7 +3862,6 @@ void* arg; threadArg->argument = arg; threadArg->start_routine = start_routine; - TRC0(SCreatePThread); printf("Creating thread here %s %d\n", __FILE__, __LINE__); { @@ -3816,20 +3907,19 @@ void* arg; */ #ifdef ANSI -PRIVATE S16 ssdSetPthreadAttr +static S16 ssdSetPthreadAttr ( S32 tskPrior, pthread_attr_t *attr ) #else -PRIVATE S16 ssdSetPthreadAttr(sTsk, attr) +static S16 ssdSetPthreadAttr(sTsk, attr) S32 tskPrior, pthread_attr_t *attr #endif { struct sched_param param; - TRC0 (ssdSetPthreadAttr) SMemSet(¶m, 0, sizeof(param)); @@ -3898,29 +3988,28 @@ pthread_attr_t *attr S16 ssdGetAffinity ( SSTskId *tskId, /* filled in with system task ID */ -U32 *coreId /* the core/processor id to which the affinity is set */ +uint32_t *coreId /* the core/processor id to which the affinity is set */ ) #else S16 ssdGetAffinity(tskId, coreId) SSTskId *tskId; /* filled in with system task ID */ -U32 *coreId; /* the core/processor id to which the affinity is set */ +uint32_t *coreId; /* the core/processor id to which the affinity is set */ #endif { - 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++) { @@ -4015,16 +4104,16 @@ U32 *coreId; /* the core/processor id to which the affinity i S16 ssdSetAffinity ( SSTskId *tskId, /* filled in with system task ID */ -U32 coreId /* the core/processor id to which the affinity has to be set */ +uint32_t coreId /* the core/processor id to which the affinity has to be set */ ) #else 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 */ +uint32_t coreId; /* the core/processor id to which the affinity has to be set */ #endif { - U32 tskInd = 0; + uint32_t tskInd = 0; #ifdef SS_LINUX pthread_t tId = 0; @@ -4032,11 +4121,10 @@ 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++) @@ -4138,7 +4226,6 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ SsMsgInfo *mInfo; - TRC0(ssdDestroySTsk); /* we send a message to this system task to tell it to die */ @@ -4196,7 +4283,6 @@ S16 SThreadYield() #endif { - TRC0(SThreadYield); /* mt024.201 - seperated Linux and other UNIX implementations */ @@ -4251,7 +4337,6 @@ SsTmrEntry *tmr; /* pointer to timer entry */ CmTmrArg arg; - TRC0(ssdRegTmr); /* initialize common timers */ @@ -4301,7 +4386,6 @@ SsTmrEntry *tmr; /* pointer to timer entry */ CmTmrArg arg; - TRC0(ssdDeregTmr); /* stop the timer */ @@ -4351,7 +4435,6 @@ Reason reason; /* reset reason */ Txt errBuf[256]; - TRC0(ssdError); /* get calling task ID */ @@ -4360,7 +4443,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); @@ -4432,7 +4515,6 @@ Txt *errDesc; /* description of error */ Txt errBuf[512]; - TRC0(ssdLogError); /* get calling task ID */ @@ -4512,7 +4594,7 @@ Txt *errDesc; /* description of error */ #endif - RETVOID; + return; } #ifdef ENB_RELAY @@ -4541,7 +4623,6 @@ S16 ssdRegDrvrTsk(drvrTsk) SsDrvrTskEntry *drvrTsk; /* driver task entry */ #endif { - TRC0(ssdRegDrvrTsk); return ROK; @@ -4571,7 +4652,6 @@ S16 ssdDeregDrvrTsk(drvrTsk) SsDrvrTskEntry *drvrTsk; /* driver task entry */ #endif { - TRC0(ssdDeregDrvrTsk); return ROK; @@ -4621,7 +4701,6 @@ SsIdx idx; S16 n; S16 ret; - TRC0(ssdProcTTskTerm); ent = tTsk->ent; @@ -4738,9 +4817,9 @@ SsIdx idx; //#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); +Void ysMtTskHdlr(Void); +Void ysMtPollPhyMsg(uint8_t region); +Void ysMtRcvPhyMsg(Void); #ifdef ANSI Void *mtTskHdlrT2kL2 ( @@ -4775,8 +4854,8 @@ Ptr tskPtr; /* pointer to task entry */ return (NULLP); } #else -EXTERN Void ysMtTskHdlr(Void); -EXTERN Void YsPhyRecvMsg(); +Void ysMtTskHdlr(Void); +Void YsPhyRecvMsg(); #ifdef ANSI Void *mtTskHdlrT2kL2 ( @@ -4903,11 +4982,6 @@ Ptr tskPtr; /* pointer to task entry */ #endif while (1) { -#ifndef ODU_TEST_STUB -#ifdef INTEL_WLS - LwrMacRecvPhyMsg(); -#endif -#endif /* Wait for a message from the demand queue */ #ifdef SS_CDMNDQ_SUPPORT ret = ssCDmndQWait(&sTsk->dQ); @@ -4976,7 +5050,7 @@ SsSTskEntry *sTsk PFS16 tmrActvFn = NULLP; #else PAIFTMRS16 tmrActvFn; - U16 procIdIdx; + uint16_t procIdIdx; #endif /* SS_MULTIPLE_PROCS */ /* mt003.301 Modifications */ #ifdef SS_THREAD_PROFILE @@ -5125,7 +5199,7 @@ SsSTskEntry *sTsk /* copy the Pst structure into a local duplicate */ for (i = 0; i < (S16) sizeof(Pst); i++) - *(((U8 *)(&nPst)) + i) = *(((U8 *)&mInfo->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 @@ -5137,7 +5211,7 @@ SsSTskEntry *sTsk { #ifndef RGL_SPECIFIC_CHANGES #ifdef SS_TSKLOG_ENABLE - U32 t = MacGetTick(); + uint32_t t = MacGetTick(); #endif #endif /* mt003.301 Modifications */ @@ -5153,8 +5227,8 @@ SsSTskEntry *sTsk #endif #if SS_THREAD_PROFILE SGetEpcTime(&et2); - tTsk->curEvtTime = (U32)(et2 - et1); - tTsk->totTime += (U64)tTsk->curEvtTime; + tTsk->curEvtTime = (uint32_t)(et2 - et1); + tTsk->totTime += (uint64_t)tTsk->curEvtTime; #endif /* SS_THREAD_PROFILE */ } else @@ -5391,13 +5465,13 @@ Void mtTmrHdlrPublic() */ /*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) +static Void *mtTmrHdlr(parm) void *parm; /* unused */ #endif { @@ -5406,14 +5480,14 @@ void *parm; /* unused */ * 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*/ @@ -5576,15 +5650,14 @@ S16 evnt; /* event */ #endif /* 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 */ @@ -5594,7 +5667,7 @@ 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 */ @@ -5605,7 +5678,7 @@ S16 evnt; /* event */ */ if (tEnt->used == FALSE) { - RETVOID; + return; } @@ -5627,7 +5700,7 @@ S16 evnt; /* event */ MTLOGERROR(ERRCLS_DEBUG, EMT017, ERRZERO, "Could not get message"); #endif - RETVOID; + return; } mInfo = (SsMsgInfo *)mBuf->b_rptr; @@ -5668,7 +5741,7 @@ S16 evnt; /* event */ MTLOGERROR(ERRCLS_DEBUG, EMT018, ret, "Could not lock TAPA task table"); #endif - RETVOID; + return; } #endif @@ -5687,7 +5760,7 @@ S16 evnt; /* event */ SS_RELEASE_SEMA(&osCp.tTskTblSem); #endif SPutMsg(mBuf); - RETVOID; + return; } @@ -5699,7 +5772,7 @@ 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 */ @@ -5716,7 +5789,7 @@ S16 evnt; /* event */ "Could not write to demand queue"); #endif - RETVOID; + return; } #ifdef SS_LOCKLESS_MEMORY mInfo->pst.region = tTsk->sTsk->region; @@ -5735,7 +5808,7 @@ S16 evnt; /* event */ "Could not write to demand queue"); #endif - RETVOID; + return; } /* Fix for ccpu00130657 */ #ifdef TENB_T2K3K_SPECIFIC_CHANGES @@ -5771,7 +5844,7 @@ S16 evnt; /* event */ MLogTask(131313, RESOURCE_LARM, t, GetTIMETICK()); #endif #endif - RETVOID; + return; } @@ -5791,13 +5864,13 @@ S16 evnt; /* event */ * */ #ifdef ANSI -PRIVATE Void *mtConHdlr +static Void *mtConHdlr ( Ptr parm /* unused */ ) #else /* mt009.21: addition */ -PRIVATE Void *mtConHdlr(parm) +static Void *mtConHdlr(parm) Ptr parm; /* unused */ #endif { @@ -5860,13 +5933,13 @@ Ptr parm; /* unused */ */ #ifdef ANSI /* mt009.21: addition */ -PRIVATE Void *mtIsTskHdlr +static Void *mtIsTskHdlr ( Ptr tskPtr /* pointer to task entry */ ) #else /* mt009.21: addition */ -PRIVATE Void *mtIsTskHdlr(tskPtr) +static Void *mtIsTskHdlr(tskPtr) Ptr tskPtr; /* pointer to task entry */ #endif { @@ -5875,10 +5948,6 @@ Ptr tskPtr; /* pointer to task entry */ #endif MtIsFlag isFlag; - - TRC0(mtIsTskHdlr); - - for (; ;) { if (read(osCp.dep.isFildes[0], &isFlag, sizeof(isFlag)) != sizeof(isFlag)) @@ -5978,8 +6047,6 @@ int arg; #endif { - TRC0(mtIntSigHndlr); - osCp.dep.sigEvnt=TRUE; #ifdef MSPD @@ -5988,7 +6055,7 @@ int arg; #endif #endif - RETVOID; + return; } /*mt010.301 Fix for core when run with -o option and when killed with SIGINT*/ @@ -6018,8 +6085,6 @@ Void mtExitClnup() S8 buf[128]; - TRC0(mtExitClnup); - SGetSysTime(&ticks); #ifdef ALIGN_64BIT sprintf(buf, "\n\nmtss(posix) ends\nticks: %u\n", ticks); @@ -6081,7 +6146,6 @@ S16 chan; /* channel */ Txt *buf; /* buffer */ #endif { - TRC1(SDisplay); /* mt020.201 - Fixed typo */ #if (ERRCLASS & ERRCLS_INT_PAR) @@ -6149,7 +6213,6 @@ void S16 SFini() #endif { - 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 @@ -6195,8 +6258,6 @@ S16 SSetDateTime(dt) REG1 DateTime *dt; /* date and time */ #endif { - TRC1(SSetDateTime); - UNUSED(dt); @@ -6242,8 +6303,6 @@ REG1 DateTime *dt; /* date and time */ struct tm tme; - TRC1(SGetDateTime); - #if (ERRCLASS & ERRCLS_INT_PAR) if (dt == NULLP) @@ -6266,12 +6325,12 @@ REG1 DateTime *dt; /* date and time */ #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 @@ -6313,16 +6372,15 @@ EpcTime *et; /* date and time */ #endif { /* mt003.301 Modifications */ -PRIVATE U64 now; - U64 to_sec = 1000000; - U64 to_nsec = 1000; +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) @@ -6379,7 +6437,6 @@ S16 SGetSysTime(sysTime) Ticks *sysTime; /* system time */ #endif { - TRC1(SGetSysTime); #if (ERRCLASS & ERRCLS_INT_PAR) @@ -6420,15 +6477,15 @@ Ticks *sysTime; /* system time */ #ifdef ANSI S16 SGetRefTime ( -U32 refTime, /* reference time */ -U32 *sec, -U32 *usec +uint32_t refTime, /* reference time */ +uint32_t *sec, +uint32_t *usec ) #else S16 SGetRefTime(refTime, sec, usec) -U32 refTime; /* reference time */ -U32 *sec; -U32 *usec; +uint32_t refTime; /* reference time */ +uint32_t *sec; +uint32_t *usec; #endif { @@ -6438,7 +6495,6 @@ U32 *usec; struct timeval ptime; #endif - TRC1(SGetSysTime); #ifndef SS_LINUX clock_gettime(CLOCK_REALTIME, &ptime); @@ -6453,7 +6509,7 @@ U32 *usec; 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"); return RFAILED; @@ -6497,7 +6553,6 @@ S16 SRandom(value) Random *value; /* random number */ #endif { - TRC1(SRandom); #if (ERRCLASS & ERRCLS_INT_PAR) @@ -6539,7 +6594,6 @@ void S16 SExitTsk() #endif { - TRC1(SExitTsk); return ROK; @@ -6568,7 +6622,6 @@ void S16 SExitInt() #endif { - TRC1(SExitInt); return ROK; @@ -6601,7 +6654,6 @@ void S16 SHoldInt() #endif { - TRC1(SHoldInt); return ROK; @@ -6630,7 +6682,6 @@ void S16 SRelInt() #endif { - TRC1(SRelInt); return ROK; @@ -6652,15 +6703,14 @@ S16 SRelInt() * */ #ifdef ANSI -INLINE S16 SEnbInt +inline S16 SEnbInt ( void ) #else -INLINE S16 SEnbInt() +inline S16 SEnbInt() #endif { - TRC1(SEnbInt); return ROK; @@ -6682,15 +6732,14 @@ INLINE S16 SEnbInt() * */ #ifdef ANSI -INLINE S16 SDisInt +inline S16 SDisInt ( void ) #else -INLINE S16 SDisInt() +inline S16 SDisInt() #endif { - TRC1(SDisInt); return ROK; @@ -6723,7 +6772,6 @@ VectNmb vectNmb; /* vector number */ PIF *vectFnct; /* vector function */ #endif { - TRC1(SGetVect); UNUSED(vectNmb); @@ -6760,7 +6808,6 @@ VectNmb vectNmb; /* vector number */ PIF vectFnct; /* vector function */ #endif { - TRC1(SPutVect); UNUSED(vectNmb); @@ -6806,7 +6853,6 @@ Inst *inst; /* instance */ SsSTskEntry *sTsk; - TRC1(SGetEntInst); #if (ERRCLASS & ERRCLS_INT_PAR) @@ -6881,7 +6927,6 @@ Inst inst; /* instance */ SsSTskEntry *sTsk; - TRC1(SSetEntInst); #if (ERRCLASS & ERRCLS_INT_PAR) @@ -6943,21 +6988,20 @@ Inst inst; /* instance */ * */ #ifdef ANSI -INLINE S16 SSetIntPend +inline S16 SSetIntPend ( -U16 id, /* driver task identifier */ +uint16_t id, /* driver task identifier */ Bool flag /* flag */ ) #else -INLINE S16 SSetIntPend(id, flag) -U16 id; /* driver task identifier */ +inline S16 SSetIntPend(id, flag) +uint16_t id; /* driver task identifier */ Bool flag; /* flag */ #endif { MtIsFlag isFlag; - TRC1(SSetIntPend); #if (ERRCLASS & ERRCLS_INT_PAR) @@ -7007,11 +7051,10 @@ Void S16 SGlobMemInfoShow() #endif { - U16 idx; + uint16_t idx; Txt prntBuf[100]; CmMmGlobRegCb *globReg; - TRC1(SGlobMemInfoShow); globReg = osCp.globRegCb; @@ -7104,18 +7147,17 @@ Bool IsMemoryThresholdHit(Region reg, Pool pool) S16 SRegInfoShow ( Region region, -U32 *availmem +uint32_t *availmem ) #else S16 SRegInfoShow(region, availmem) Region region; -U32 *availmem; +uint32_t *availmem; #endif { - U16 idx; + uint16_t idx; Txt prntBuf[100]; - TRC1(SRegInfoShow); #if (ERRCLASS & ERRCLS_INT_PAR) if (region > (SS_MAX_REGS-1) ) @@ -7206,23 +7248,23 @@ U32 *availmem; #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 +uint8_t maxBkt ) #else -PRIVATE Void SInitMemThreshold(region, maxBkt) +static Void SInitMemThreshold(region, maxBkt) Region region; -U8 maxBkt; +uint8_t maxBkt; #endif { - 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; @@ -7236,17 +7278,17 @@ U8 maxBkt; S16 SRegReachedMemThreshold ( Region region, -U8 maxBkt +uint8_t maxBkt ) #else S16 SRegReachedMemThreshold(region, maxBkt) Region region; -U8 maxBkt; +uint8_t maxBkt; #endif { - 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; @@ -7301,9 +7343,8 @@ Region region; SsMemDbgInfo *dbgInfo; #endif { - U32 idx; + uint32_t idx; - TRC1(SGetRegInfo); #if (ERRCLASS & ERRCLS_INT_PAR) if (region >= mtMemoCfg.numRegions ) @@ -7350,13 +7391,13 @@ SsMemDbgInfo *dbgInfo; #ifdef ANSI S16 SGetRegPoolInfo ( -U8 *numRegion, -U8 *numPool +uint8_t *numRegion, +uint8_t *numPool ) #else S16 SGetRegPoolInfo(numRegion, numPool) -U8 *numRegion; -U8 *numPool; +uint8_t *numRegion; +uint8_t *numPool; #endif { /* Send number of Region available */ @@ -7394,20 +7435,19 @@ U8 *numPool; S16 SPrintRegMemStatusInfo ( Region region, -U8 typeFlag +uint8_t typeFlag ) #else S16 SPrintRegMemStatusInfo(region, typeFlag) Region region; -U8 typeFlag; +uint8_t typeFlag; #endif { 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 ) @@ -7506,21 +7546,20 @@ U8 typeFlag; * */ #ifdef ANSI -PRIVATE S16 SPrintRegMemStats +static S16 SPrintRegMemStats ( Region region ) #else -PRIVATE S16 SPrintRegMemStats(region) +static S16 SPrintRegMemStats(region) Region region; #endif { CmMmHashListCp *hashListCp; Txt prntBuf[150]; - U32 idx; - U32 cntEnt; + uint32_t idx; + uint32_t cntEnt; - TRC1(SPrintRegMemStats); hashListCp = &mtCMMRegCb[region]->hashListCp; @@ -7628,7 +7667,6 @@ S16 errCode; { Txt prntBuf[150]; - TRC1(SRegMemErrHdlr); if (errCode == RDBLFREE) { @@ -7641,7 +7679,7 @@ S16 errCode; SDisplay(0, prntBuf); } - RETVOID; + return; } /* @@ -7677,11 +7715,10 @@ 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 ) @@ -7916,7 +7953,6 @@ S8 *ts; S8 time_string[40]; S32 microseconds; - TRC1(SGetTimeStamp); #ifndef SS_LINUX clock_gettime(CLOCK_REALTIME, &ptime); @@ -7967,15 +8003,14 @@ S8 *ts; * --*/ #ifdef ANSI -U32 SGetSystemTsk +uint32_t SGetSystemTsk ( Void ) #else -U32 SGetSystemTsk() +uint32_t SGetSystemTsk() #endif { - TRC1(SGetSystemTskS); return (pthread_self()); @@ -7997,15 +8032,14 @@ U32 SGetSystemTsk() * --*/ #ifdef ANSI -PRIVATE SsSTskEntry* ssdAddTmrSTsk(Void) +static SsSTskEntry* ssdAddTmrSTsk(Void) #else -PRIVATE SsSTskEntry* ssdAddTmrSTsk() +static SsSTskEntry* ssdAddTmrSTsk() #endif { SsSTskEntry *sTsk; S16 ret; - TRC1(ssdAddTmrSTsk); sTsk = NULLP; /* lock the system task table */ ret = SLock(&osCp.sTskTblLock); @@ -8131,12 +8165,12 @@ PRIVATE SsSTskEntry* ssdAddTmrSTsk() S16 ssdInitLockNew ( SLockInfo *lockId, -U8 lockType +uint8_t lockType ) #else S16 ssdInitLockNew(lockId, lockType) SLockInfo *lockId; -U8 lockType; +uint8_t lockType; #endif { @@ -8146,7 +8180,6 @@ U8 lockType; Txt prntBuf[PRNTSZE]; S16 retVal = ROK; - TRC1(ssdInitLockNew); switch(lockType) { @@ -8222,19 +8255,18 @@ U8 lockType; S16 ssdLockNew ( SLockInfo *lockId, -U8 lockType +uint8_t lockType ) #else S16 ssdLockNew(lockId, lockType) SLockInfo *lockId; -U8 lockType; +uint8_t lockType; #endif { Txt prntBuf[PRNTSZE]; S16 retVal = ROK; - TRC1(ssdLockNew); switch(lockType) { @@ -8321,19 +8353,18 @@ U8 lockType; S16 ssdUnlockNew ( SLockInfo *lockId, -U8 lockType +uint8_t lockType ) #else S16 ssdUnlockNew(lockId, lockType) SLockInfo *lockId; -U8 lockType; +uint8_t lockType; #endif { Txt prntBuf[PRNTSZE]; S16 retVal = ROK; - TRC1(ssdUnlockNew); switch(lockType) { @@ -8388,18 +8419,17 @@ U8 lockType; S16 ssdDestroyLockNew ( SLockInfo *lockId, -U8 lockType +uint8_t lockType ) #else S16 ssdDestroyLockNew(lockId, lockType) SLockInfo *lockId; -U8 lockType; +uint8_t lockType; #endif { Txt prntBuf[PRNTSZE]; S16 retVal = ROK; - TRC1(ssdDestroyLockNew); switch(lockType) { @@ -8470,7 +8500,6 @@ S16 ssInitRcvWork() pthread_attr_t attr; pthread_t thread; - TRC1(ssInitRcvWork); /* set the required attributes */ pthread_attr_init(&attr); @@ -8512,12 +8541,12 @@ S16 ssInitRcvWork() **/ #ifdef ANSI -PRIVATE void *workRcvTsk +static void *workRcvTsk ( Ptr ptr ) #else -PRIVATE void *workRcvTsk (ptr) +static void *workRcvTsk (ptr) Ptr ptr; #endif { @@ -8529,7 +8558,6 @@ PRIVATE void *workRcvTsk (ptr) struct timespec ts; Pst pst; - TRC1(workRcvTsk); for (;;) @@ -8607,7 +8635,7 @@ PRIVATE void *workRcvTsk (ptr) #endif /* SS_SEUM_CAVIUM */ #ifdef TENB_RTLIN_CHANGES -S16 SInitLock(SLockId *l, U8 t) +S16 SInitLock(SLockId *l, uint8_t t) { S16 r = 0; pthread_mutexattr_t prior; @@ -8686,11 +8714,10 @@ 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 @@ -8760,7 +8787,6 @@ 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 */ @@ -8771,9 +8797,9 @@ pthread_t threadId /* Thread Id of system task */ 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("Invalid Thread ID (%ld)\n", (uint32_t)threadId); #else - printf("Invalid Thread ID (%d)\n", (U32)threadId); + printf("Invalid Thread ID (%d)\n", (uint32_t)threadId); #endif return RFAILED; } @@ -8805,13 +8831,13 @@ pthread_t threadId /* Thread Id of system task */ #ifdef ANSI S16 SStartTask ( -VOLATILE U32 *startTime, -U32 taskId +volatile uint32_t *startTime, +uint32_t taskId ) #else S16 SStartTask(startTime, taskId) -VOLATILE U32 *startTime; -U32 taskId; +volatile uint32_t *startTime; +uint32_t taskId; #endif { #ifdef MSPD_MLOG_NEW @@ -8838,16 +8864,16 @@ U32 taskId; #ifdef ANSI S16 SStopTask ( -VOLATILE U32 startTime, -U32 taskId +volatile uint32_t startTime, +uint32_t taskId ) #else S16 SStopTask(startTime, taskId) -VOLATILE U32 startTime; -U32 taskId; +volatile uint32_t startTime; +uint32_t taskId; #endif { - /*U32 stopTime;*/ + /*uint32_t stopTime;*/ switch(taskId) { case PID_MAC_HARQ_IND: @@ -8887,13 +8913,13 @@ U32 taskId; #ifdef ANSI S16 SStartTask ( -VOLATILE U32 * startTime, -U32 taskId +volatile uint32_t * startTime, +uint32_t taskId ) #else S16 SStartTask(startTime, taskId) -VOLATILE U32 * startTime; -U32 taskId; +volatile uint32_t * startTime; +uint32_t taskId; #endif { *startTime = 0; @@ -8903,13 +8929,13 @@ U32 taskId; #ifdef ANSI S16 SStopTask ( -VOLATILE U32 startTime, -U32 taskId +volatile uint32_t startTime, +uint32_t taskId ) #else S16 SStopTask(startTime, taskId) -VOLATILE U32 startTime; -U32 taskId; +volatile uint32_t startTime; +uint32_t taskId; #endif { return ROK; @@ -8929,28 +8955,28 @@ U32 taskId; Void UpdateSocCpuInfo ( CmCpuStatsInfo *cpuInfo, -U8 idx +uint8_t idx ) #else Void UpdateSocCpuInfo(*cpuInfo, idx) CmCpuStatsInfo *cpuInfo; -U8 idx; +uint8_t idx; #endif { 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 */ @@ -8958,7 +8984,7 @@ U8 idx; { printf("fgets to get the free mips available failed\n"); fclose(mipsFd); - RETVOID; + return; } strtok(mipsStr, " "); @@ -8972,7 +8998,7 @@ U8 idx; 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].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l2CpuUsed); cpuInfo->cpuUtil[0].numSamples++; } } @@ -8984,7 +9010,7 @@ U8 idx; 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].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l3CpuUsed); cpuInfo->cpuUtil[0].numSamples++; } } @@ -8998,7 +9024,7 @@ U8 idx; } fclose(mipsFd); - RETVOID; + return; } #endif /* TENB_T2K3K_SPECIFIC_CHANGES */ #ifdef SS_MULTICORE_SUPPORT @@ -9017,18 +9043,17 @@ U8 idx; * --*/ #ifdef ANSI -PRIVATE SsSTskEntry* ssdReAddTmrSTsk( -U8 idx +static SsSTskEntry* ssdReAddTmrSTsk( +uint8_t idx ) #else -PRIVATE SsSTskEntry* ssdReAddTmrSTsk(idx) -U8 idx; +static SsSTskEntry* ssdReAddTmrSTsk(idx) +uint8_t idx; #endif { SsSTskEntry *sTsk; S16 ret; - TRC1(ssdReAddTmrSTsk); sTsk = NULLP; /* lock the system task table */ ret = SLock(&osCp.sTskTblLock); @@ -9147,16 +9172,15 @@ S16 ssdReInitTmr() 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);