}
static void signal_segv(int signum, siginfo_t * info, void *ptr)
{
- static const char *si_codes[3] = { "", "SEGV_MAPERR", "SEGV_ACCERR" };
- int sz;
- int i;
- ucontext_t *ucontext = (ucontext_t *) ptr;
+ static const char *si_codes[3] = { "", "SEGV_MAPERR", "SEGV_ACCERR" };
+ int sz;
+ int i;
+ ucontext_t *ucontext = (ucontext_t *) ptr;
#ifdef XEON_SPECIFIC_CHANGES
#else
- int *p32 = (int *) 0x2fff0000;
+ int *p32 = (int *) 0x2fff0000;
#endif
- void *buffer[100];
- char **strings;
+ void *buffer[100];
+ char **strings;
- printf("segv ooops @ %p\n", info->si_addr);
- my_buffer2[0] = 1;
+ printf("\nsegv ooops @ %p\n", info->si_addr);
+ my_buffer2[0] = 1;
- printf("Segmentation Fault!\n");
- printf("info.si_signo = %d\n", signum);
- printf("info.si_errno = %d\n", info->si_errno);
- printf("info.si_code = %d (%s)\n", info->si_code, si_codes[info->si_code]);
- printf("info.si_addr = %p\n", info->si_addr);
+ printf("\nSegmentation Fault!\n");
+ printf("\ninfo.si_signo = %d\n", signum);
+ printf("\ninfo.si_errno = %d\n", info->si_errno);
+ printf("\ninfo.si_code = %d (%s)\n", info->si_code, si_codes[info->si_code]);
+ printf("\ninfo.si_addr = %p\n", info->si_addr);
- memcpy(&my_uc_mcontext, &ucontext->uc_mcontext, sizeof(struct sigcontext));
+ memcpy(&my_uc_mcontext, &ucontext->uc_mcontext, sizeof(struct sigcontext));
- i = 0;
+ i = 0;
#ifndef RGL_SPECIFIC_CHANGES
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r0);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r1);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r2);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r3);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r4);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r5);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r6);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r7);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r8);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r9);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r10);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_fp);
- printf("reg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_ip);
- printf("reg[sp] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_sp);
- printf("reg[lr] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_lr);
- printf("reg[pc] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_pc);
- printf("reg[cpsr] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_cpsr);
-#endif
-
- printf("Stack trace (non-dedicated):\n");
-
- sz = backtrace(buffer, 50);
- strings = backtrace_symbols(buffer, sz);
- for (i = 0; i < sz; ++i)
- printf("%s\n", strings[i]);
-
- printf("End of stack trace.");
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r0);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r1);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r2);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r3);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r4);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r5);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r6);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r7);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r8);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r9);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_r10);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_fp);
+ printf("\nreg[%02d] = 0x" REGFORMAT, i++, (unsigned int)ucontext->uc_mcontext.arm_ip);
+ printf("\nreg[sp] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_sp);
+ printf("\nreg[lr] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_lr);
+ printf("\nreg[pc] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_pc);
+ printf("\nreg[cpsr] = 0x" REGFORMAT, (unsigned int)ucontext->uc_mcontext.arm_cpsr);
+#endif
+
+ printf("\nStack trace (non-dedicated):\n");
+
+ sz = backtrace(buffer, 50);
+ strings = backtrace_symbols(buffer, sz);
+ for (i = 0; i < sz; ++i)
+ printf("%s\n", strings[i]);
+
+ printf("\nEnd of stack trace\n");
#ifdef XEON_SPECIFIC_CHANGES
#else
- p32[0] = 1;
-#endif
-
- /* Lets first print our debug information */
- printf("Before dumping our Debug info\n");
- mtStopHndlr();
- printf("After dumping our Debug info\n");
-
- /* Disable the signal and make the enodeb to dump. This will make
- * eNB to generate the core with dumping the ccpu log
- */
- {
- char *abc = NULL;
- mtDelSigals();
- *abc = 100;
- }
- /* End printing debug information */
- exit(1);
- /*while (1);*/
+ p32[0] = 1;
+#endif
+
+ /* Lets first print our debug information */
+ printf("\nBefore dumping our Debug info\n");
+ mtStopHndlr();
+ printf("\nAfter dumping our Debug info\n");
+
+ /* Disable the signal and make the enodeb to dump. This will make
+ * eNB to generate the core with dumping the ccpu log
+ */
+ {
+ char *abc = NULL;
+ mtDelSigals();
+ *abc = 100;
+ }
+ /* End printing debug information */
+ exit(1);
+ /*while (1);*/
}
#endif
/*** TBD: IMPORTANT ***
pthread_t tmpRegTidMap[20];
uint8_t stopBtInfo;
- S16 SGlobMemInfoShow(void);
+S16 SGlobMemInfoShow(void);
#endif /* SS_LOCKLESS_MEMORY */
#ifdef L2_L3_SPLIT
/* mt003.301 Modifications - Moved to ss_gen.x */
#ifdef TENB_T2K3K_SPECIFIC_CHANGES
Void *mtTskHdlrT2kL2 ARGS((Void*));
- void mtSigSegvHndlr ARGS((void));
- void mtSigUsr2Hndlr ARGS((void));
+void mtSigSegvHndlr ARGS((void));
+void mtSigUsr2Hndlr ARGS((void));
#endif
static S16 ssdSetPthreadAttr ARGS ((S32 tskPrior, pthread_attr_t *attr));
#endif
/* mt033.201 - addition of local function to print the statistics such as
-* (size vs. numAttempts) and (allocations vs. deallocations)
-*/
+ * (size vs. numAttempts) and (allocations vs. deallocations)
+ */
#ifdef SSI_DEBUG_LEVEL1
static S16 SPrintRegMemStats ARGS((Region region));
#endif /* SSI_DEBUG_LEVEL1 */
#ifdef SS_THR_REG_MAP
S32 ssCheckAndAddMemoryRegionMap ARGS((pthread_t threadId,
- Region region));
+ Region region));
S32 ssCheckAndDelMemoryRegionMap ARGS((pthread_t threadId));
#endif /* SS_THR_REG_MAP */
\f
{
SS_DFLT_REGION, SS_MAX_POOLS_PER_REG - 1,
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
{ SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
+ { SS_POOL_STATIC, 0 }
}
}
#ifdef INTEL_WLS
,
- {
- SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_STATIC, 0 }
+ SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
}
- }
#endif /* INTEL_WLS */
#ifdef SS_LOCKLESS_MEMORY
,
- {
- SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
- }
- },
- {
- SS_DFLT_REGION + 2, SS_MAX_POOLS_PER_REG - 1,
+ SS_DFLT_REGION + 1, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
+ },
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
- }
- },
- {
- SS_DFLT_REGION + 3, SS_MAX_POOLS_PER_REG - 1,
+ SS_DFLT_REGION + 2, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
+ },
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
- }
- },
- {
- SS_DFLT_REGION + 4, SS_MAX_POOLS_PER_REG - 1,
+ SS_DFLT_REGION + 3, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
+ },
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
- }
- },
- {
- SS_DFLT_REGION + 5, SS_MAX_POOLS_PER_REG - 1,
+ SS_DFLT_REGION + 4, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
+ },
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
- }
- },
- {
- SS_DFLT_REGION + 6, SS_MAX_POOLS_PER_REG - 1,
+ SS_DFLT_REGION + 5, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
+ },
{
- { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
- { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
- { SS_POOL_STATIC, 0 }
+ SS_DFLT_REGION + 6, SS_MAX_POOLS_PER_REG - 1,
+ {
+ { SS_POOL_DYNAMIC, MT_POOL_0_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_1_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_2_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_3_DSIZE },
+ { SS_POOL_DYNAMIC, MT_POOL_4_DSIZE },
+ { SS_POOL_STATIC, 0 }
+ }
}
- }
#endif /* SS_LOCKLESS_MEMORY */
};
#ifdef SS_LOCKLESS_MEMORY
MtDynMemCfg mtDynMemoCfg =
{
- SS_MAX_REGS, /* number of regions */
- {
- {
- SS_DFLT_REGION, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- },
- {
- SS_DFLT_REGION + 1, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- },
- {
- SS_DFLT_REGION + 2, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- },
+ SS_MAX_REGS, /* number of regions */
+ {
+ {
+ SS_DFLT_REGION, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ },
+ {
+ SS_DFLT_REGION + 1, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ },
+ {
+ SS_DFLT_REGION + 2, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ },
{
- SS_DFLT_REGION + 3, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- },
+ SS_DFLT_REGION + 3, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ },
+ {
+ SS_DFLT_REGION + 4, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ },
+ {
+ SS_DFLT_REGION + 5, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ },
{
- SS_DFLT_REGION + 4, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- },
- {
- SS_DFLT_REGION + 5, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- },
- {
- SS_DFLT_REGION + 6, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- }
+ SS_DFLT_REGION + 6, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ }
#if ((defined (SPLIT_RLC_DL_TASK)) && (!defined (L2_L3_SPLIT)))
- ,
- {
- SS_DFLT_REGION + 7, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- {
- /* block size, no. of blocks, Upper threshold, lower threshold */
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
- {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
- }
- }
-#endif
- }
+ ,
+ {
+ SS_DFLT_REGION + 7, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ {
+ /* block size, no. of blocks, Upper threshold, lower threshold */
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD},
+ {SS_BLK_RELEASE_THRESHOLD, SS_BLK_ACQUIRE_THRESHOLD}
+ }
+ }
+#endif
+ }
};
{MT_BKT_4_DSIZE, MT_BKT_4_NUMBLKS, SS_DFLT_MEM_BLK_SET_SIZE}
#else
{1024, 12800 /* MT_BKT_0_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE},
- {1664, 12800 /* MT_BKT_1_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE},
- {4096, 3840 /* MT_BKT_2_NUMBLKS*/, SS_DFLT_MEM_BLK_SET_SIZE},
- {MT_BKT_3_DSIZE, 12800 /* MT_BKT_3_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE}
+ {1664, 12800 /* MT_BKT_1_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE},
+ {4096, 3840 /* MT_BKT_2_NUMBLKS*/, SS_DFLT_MEM_BLK_SET_SIZE},
+ {MT_BKT_3_DSIZE, 12800 /* MT_BKT_3_NUMBLKS */, SS_DFLT_MEM_BLK_SET_SIZE}
#endif
}
};
MtMemCfg mtMemoCfg =
{
#ifdef RY_ENBS5SHM
- SS_MAX_REGS - 1, /* number of regions */
+ SS_MAX_REGS - 1, /* number of regions */
#else
#ifndef XEON_SPECIFIC_CHANGES
- SS_MAX_REGS, /* number of regions */
+ SS_MAX_REGS, /* number of regions */
#else
- 2,
+ 2,
#endif
#endif
- {
- {
- SS_DFLT_REGION, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- MT_HEAP_SIZE, /* heap size */
+ {
{
+ SS_DFLT_REGION, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ MT_HEAP_SIZE, /* heap size */
+ {
#ifndef XEON_SPECIFIC_CHANGES
- {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}
+ {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS}
#else
- {256, 491520}, /* 60 pages of 2M*/
- {512, 12288}, /* 3 pages of 2M */
- {2048, 99328}, /* 97 Pages of 2M */
- {8192, 75008}, /* 293 Pages of 2M */
- {16384, 4096} /* 32 pages of 2M */
+ {256, 491520}, /* 60 pages of 2M*/
+ {512, 12288}, /* 3 pages of 2M */
+ {2048, 99328}, /* 97 Pages of 2M */
+ {8192, 75008}, /* 293 Pages of 2M */
+ {16384, 4096} /* 32 pages of 2M */
#endif
- }
- },
+ }
+ },
#ifdef INTEL_WLS
#ifndef SS_LOCKLESS_MEMORY
- {
- SS_DFLT_REGION + 1, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- /*MT_HEAP_SIZE 7194304 */ 10485760, /* heap size */
{
- //{MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- //{MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- //{MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- //{MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS} /* block size, no. of blocks */
- {128, 500000},
- {256, 500000},
- {2048, 200000},
- {4096, 40960},
- {18432, 10240}
- }
- },
+ SS_DFLT_REGION + 1, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ /*MT_HEAP_SIZE 7194304 */ 10485760, /* heap size */
+ {
+ //{MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ //{MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ //{MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ //{MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS} /* block size, no. of blocks */
+ {128, 500000},
+ {256, 500000},
+ {2048, 200000},
+ {4096, 40960},
+ {18432, 10240}
+ }
+ },
#endif /* SS_LOCKLESS_MEMORY */
#endif /* INTEL_WLS */
#ifdef SS_LOCKLESS_MEMORY
- {
- SS_DFLT_REGION + 1, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- MT_HEAP_SIZE, /* heap size */
{
- {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
- }
- },
- {
- SS_DFLT_REGION + 2, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- MT_HEAP_SIZE, /* heap size */
+ SS_DFLT_REGION + 1, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ MT_HEAP_SIZE, /* heap size */
+ {
+ {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
+ }
+ },
{
- {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
- }
- },
- {
- SS_DFLT_REGION + 3, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- MT_HEAP_SIZE, /* heap size */
+ SS_DFLT_REGION + 2, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ MT_HEAP_SIZE, /* heap size */
+ {
+ {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
+ }
+ },
+ {
+ SS_DFLT_REGION + 3, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ MT_HEAP_SIZE, /* heap size */
+ {
+ {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
+ }
+ },
+ {
+ SS_DFLT_REGION + 4, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ MT_HEAP_SIZE, /* heap size */
+ {
+ {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
+ }
+ },
+ {
+ SS_DFLT_REGION + 5, /* region id */
+ MT_MAX_BKTS, /* number of buckets */
+ MT_HEAP_SIZE, /* heap size */
+ {
+ {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
+ {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
+ }
+ },
{
- {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {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 */
+ }
}
- },
- {
- SS_DFLT_REGION + 4, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- MT_HEAP_SIZE, /* heap size */
- {
- {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
- }
- },
- {
- SS_DFLT_REGION + 5, /* region id */
- MT_MAX_BKTS, /* number of buckets */
- MT_HEAP_SIZE, /* heap size */
- {
- {MT_BKT_0_DSIZE, MT_BKT_0_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_1_DSIZE, MT_BKT_1_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_2_DSIZE, MT_BKT_2_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_3_DSIZE, MT_BKT_3_STATIC_NUMBLKS}, /* block size, no. of blocks */
- {MT_BKT_4_DSIZE, MT_BKT_4_STATIC_NUMBLKS} /* block size, no. of blocks */
- }
- },
- {
- 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
- }
+ STATIC_MEM_CFG
+ }
};
/* mt003.301 Modifications - File Based task registration made
* common for both MULTICORE and NON-MULTICORE
#ifdef NTL_LIB
void mtSetNtlHdl(unsigned int hdl)
{
- osCp.ntl.hdl = hdl;
+ osCp.ntl.hdl = hdl;
}
unsigned int mtGetNtlHdl()
{
- return(osCp.ntl.hdl);
+ return(osCp.ntl.hdl);
}
#endif /* NTL_LIB */
{
uint8_t i;
void *hdl;
- #define WLS_DEVICE_NAME "wls0"
-
+#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: ");
+ printf("\nCalling rte_eal_init: ");
for (i = 0; i < RTE_DIM(my_argv); i++)
{
- printf("%s ", 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");
+ rte_panic("\nCannot init EAL\n");
#ifdef XEON_SPECIFIC_CHANGES
if(!osCp.wls.intf)
{
- printf("Could not open WLS Interface \n");
- return (0);
+ printf("\nCould not open WLS Interface \n");
+ return (0);
}
return (1);
#ifndef API_MAIN
\f
/*
-*
-* Fun: main
-*
-* Desc: This function is the entry point for the final binary. It
-* calls SInit() in the common code. It can be replaced by a
-* user function if required (SInit() must still be called).
-*
-* Ret: none on success
-* exit on failure
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-int main
+ *
+ * Fun: main
+ *
+ * Desc: This function is the entry point for the final binary. It
+ * calls SInit() in the common code. It can be replaced by a
+ * user function if required (SInit() must still be called).
+ *
+ * Ret: none on success
+ * exit on failure
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ int main
(
-int argc, /* argument count */
-char **argv /* argument vector */
-)
+ int argc, /* argument count */
+ char **argv /* argument vector */
+ )
{
#ifdef XEON_MULTIPLE_CELL_CHANGES
#if defined (INTEL_WLS) || defined (SS_USE_WLS_MEM)
if(!SOpenWlsIntf())
- return (0);
+ return (0);
#endif /* INTEL_WLS */
msArgc = argc;
msArgv = argv;
/* mt003.301 Modifications */
if( ROK != SInit())
- {
- printf("\n SInit failed, SSI could not start \n");
- /* pthread_exit(NULLP);*/ /* Commented to Come out of Main thread*/
+ {
+ printf("\n SInit failed, SSI could not start \n");
+ /* pthread_exit(NULLP);*/ /* Commented to Come out of Main thread*/
- return (0);
- }
+ return (0);
+ }
/*mt010.301 cleanup part exposed to user*/
SFini();
return (0);
#else
\f
/*
-*
-* Fun: ssMain
-*
-* Desc: This function is the entry point for the final binary. It
-* calls SInit() in the common code. It can be replaced by a
-* user function if required (SInit() must still be called).
-*
-* Ret: none on success
-* exit on failure
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-int ssMain
+ *
+ * Fun: ssMain
+ *
+ * Desc: This function is the entry point for the final binary. It
+ * calls SInit() in the common code. It can be replaced by a
+ * user function if required (SInit() must still be called).
+ *
+ * Ret: none on success
+ * exit on failure
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ int ssMain
(
-int argc, /* argument count */
-char **argv /* argument vector */
-)
+ int argc, /* argument count */
+ char **argv /* argument vector */
+ )
{
#endif
/*
-* initialization functions
-*/
+ * initialization functions
+ */
/*
-*
-* Fun: Initialize OS control point
-*
-* Desc: This function initializes MTSS-specific information
-* in the OS control point.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize OS control point
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the OS control point.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitGen(void)
{
struct sigaction act;
#endif
- /*mt014.301 : 4GMX release related changes*/
+ /*mt014.301 : 4GMX release related changes*/
#ifdef SS_4GMX_UCORE
uarmInit();
#endif
-/* mt005.301 : Cavium changes */
+ /* mt005.301 : Cavium changes */
#ifdef SS_SEUM_CAVIUM
- /* set group mask for the core */
- cvmx_pow_set_group_mask(cvmx_get_core_num(), SS_CVMX_GRP_MASK);
+ /* set group mask for the core */
+ cvmx_pow_set_group_mask(cvmx_get_core_num(), SS_CVMX_GRP_MASK);
#endif /* SS_SEUM_CAVIUM */
osCp.dep.sysTicks = 0;
#ifndef NOCMDLINE
/* parse command line */
mtGetOpts();
- /* mt003.301 Additions */
- if(fileBasedMemCfg == TRUE && memConfigured == FALSE)
- {
- printf("\n File Based Memory configuration failed \n");
- return RFAILED;
- }
+ /* mt003.301 Additions */
+ if(fileBasedMemCfg == TRUE && memConfigured == FALSE)
+ {
+ printf("\n File Based Memory configuration failed \n");
+ return RFAILED;
+ }
#endif
#ifndef RGL_SPECIFIC_CHANGES /* ANOOP :: This ssdInitMemInfo() was present in 2.1 */
/*Initialize SIGSEGV Signal */
#ifdef TENB_T2K3K_SPECIFIC_CHANGES
#if 1
- memset(&sa, 0, sizeof(struct sigaction));
- sigemptyset(&sa.sa_mask);
- sa.sa_sigaction = signal_segv;
- sa.sa_flags = SA_SIGINFO;
+ memset(&sa, 0, sizeof(struct sigaction));
+ sigemptyset(&sa.sa_mask);
+ sa.sa_sigaction = signal_segv;
+ sa.sa_flags = SA_SIGINFO;
#ifndef XEON_SPECIFIC_CHANGES
- sigaction(SIGSEGV, &sa, NULL);
+ sigaction(SIGSEGV, &sa, NULL);
- memset(&sa, 0, sizeof(struct sigaction));
- sigemptyset(&sa.sa_mask);
- sa.sa_sigaction = signal_segv;
- sa.sa_flags = SA_SIGINFO;
+ memset(&sa, 0, sizeof(struct sigaction));
+ sigemptyset(&sa.sa_mask);
+ sa.sa_sigaction = signal_segv;
+ sa.sa_flags = SA_SIGINFO;
- sigaction(SIGILL, &sa, NULL);
+ sigaction(SIGILL, &sa, NULL);
#else
- if(sigaction(SIGILL, &sa, NULL) != 0)
- {
- printf("Failed to process sigaction for the SIGILL\n");
- return RFAILED;
- }
- if(sigaction(SIGSEGV, &sa, NULL) != 0)
- {
- printf("Failed to process sigaction for the SIGSEGV\n");
- return RFAILED;
- }
- if(sigaction(SIGABRT, &sa, NULL) != 0)
- {
- printf("Failed to process sigaction for the SIGABRT\n");
- return RFAILED;
- }
- if(sigaction(SIGTERM, &sa, NULL) != 0)
- {
- printf("Failed to process sigaction for the SIGTERM\n");
- return RFAILED;
- }
- if(sigaction(SIGHUP, &sa, NULL) != 0)
- {
- printf("Failed to process sigaction for the SIGHUP\n");
- return RFAILED;
- }
+ if(sigaction(SIGILL, &sa, NULL) != 0)
+ {
+ printf("\nFailed to process sigaction for the SIGILL\n");
+ return RFAILED;
+ }
+ if(sigaction(SIGSEGV, &sa, NULL) != 0)
+ {
+ printf("\nFailed to process sigaction for the SIGSEGV\n");
+ return RFAILED;
+ }
+ if(sigaction(SIGABRT, &sa, NULL) != 0)
+ {
+ printf("\nFailed to process sigaction for the SIGABRT\n");
+ return RFAILED;
+ }
+ if(sigaction(SIGTERM, &sa, NULL) != 0)
+ {
+ printf("\nFailed to process sigaction for the SIGTERM\n");
+ return RFAILED;
+ }
+ if(sigaction(SIGHUP, &sa, NULL) != 0)
+ {
+ printf("\nFailed to process sigaction for the SIGHUP\n");
+ return RFAILED;
+ }
#endif
#else
signal (SIGSEGV, mtSigSegvHndlr);
\f
/*
-*
-* Fun: De-initialize OS control point
-*
-* Desc: This function reverses the initialization in ssdInitGen().
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: De-initialize OS control point
+ *
+ * Desc: This function reverses the initialization in ssdInitGen().
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void ssdDeinitGen(void)
{
#ifdef SS_LOCKLESS_MEMORY
#ifdef USE_MALLOC
/*
-*
-* Fun: ssPutDynMemBlkSet
-*
-* Desc: Returns the set of dynamic Blocks into the global region
-*
-*
-* Ret: ROK - successful,
-* RFAILED - unsuccessful.
-*
-* Notes:
-*
-* File: cm_mem.c
-*
-*/
+ *
+ * Fun: ssPutDynMemBlkSet
+ *
+ * Desc: Returns the set of dynamic Blocks into the global region
+ *
+ *
+ * Ret: ROK - successful,
+ * RFAILED - unsuccessful.
+ *
+ * Notes:
+ *
+ * File: cm_mem.c
+ *
+ */
S16 ssPutDynMemBlkSet
(
-uint8_t bktIdx, /* Index to bucket list */
-CmMmBlkSetElement *dynMemSetElem /* Memory set element which is needs to be
- added to global region */
-)
+ uint8_t bktIdx, /* Index to bucket list */
+ CmMmBlkSetElement *dynMemSetElem /* Memory set element which is needs to be
+ added to global region */
+ )
{
CmMmGlobRegCb *globReg;
CmMmGlobalBktCb *bktCb;
}
/*
-*
-* Fun: ssGetDynMemBlkSet
-*
-* Desc: Gets the set of dynamic memory blocks from the global region
-*
-*
-* Ret: ROK - successful,
-* RFAILED - unsuccessful.
-*
-* Notes:
-*
-* File: cm_mem.c
-*
-*/
+ *
+ * Fun: ssGetDynMemBlkSet
+ *
+ * Desc: Gets the set of dynamic memory blocks from the global region
+ *
+ *
+ * Ret: ROK - successful,
+ * RFAILED - unsuccessful.
+ *
+ * Notes:
+ *
+ * File: cm_mem.c
+ *
+ */
S16 ssGetDynMemBlkSet
(
-uint8_t bktIdx, /* Index to bucket list */
-CmMmBlkSetElement *dynMemSetElem /* Memory set element which is updated
- with new set values */
-)
+ uint8_t bktIdx, /* Index to bucket list */
+ CmMmBlkSetElement *dynMemSetElem /* Memory set element which is updated
+ with new set values */
+ )
{
CmMmGlobRegCb *globReg;
#else
/*
-*
-* Fun: ssPutDynMemBlkSet
-*
-* Desc: Returns the set of dynamic Blocks into the global region
-*
-*
-* Ret: ROK - successful,
-* RFAILED - unsuccessful.
-*
-* Notes:
-*
-* File: cm_mem.c
-*
-*/
+ *
+ * Fun: ssPutDynMemBlkSet
+ *
+ * Desc: Returns the set of dynamic Blocks into the global region
+ *
+ *
+ * Ret: ROK - successful,
+ * RFAILED - unsuccessful.
+ *
+ * Notes:
+ *
+ * File: cm_mem.c
+ *
+ */
S16 ssPutDynMemBlkSet
(
-uint8_t bktIdx, /* Index to bucket list */
-CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is needs to be
- added to global region */
-uint32_t doNotBlockForLock /* Boolean whether to block for lock or not */
-)
+ uint8_t bktIdx, /* Index to bucket list */
+ CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is needs to be
+ added to global region */
+ uint32_t doNotBlockForLock /* Boolean whether to block for lock or not */
+ )
{
CmMmGlobRegCb *globReg;
CmMmGlobalBktCb *bktCb;
lstNode = cmLListFirst(&(bktCb->listFreeBktSet));
if(lstNode == NULLP)
{
- SUnlock(&(bktCb->bucketLock));
- return RFAILED;
+ SUnlock(&(bktCb->bucketLock));
+ return RFAILED;
}
cmLListDelFrm(&(bktCb->listFreeBktSet), lstNode);
}
/*
-*
-* Fun: ssGetDynMemBlkSet
-*
-* Desc: Gets the set of dynamic memory blocks from the global region
-*
-*
-* Ret: ROK - successful,
-* RFAILED - unsuccessful.
-*
-* Notes: The parameter doNotBlockForLock specifies whether to block for lock
-* or not
-*
-* File: cm_mem.c
-*
-*/
+ *
+ * Fun: ssGetDynMemBlkSet
+ *
+ * Desc: Gets the set of dynamic memory blocks from the global region
+ *
+ *
+ * Ret: ROK - successful,
+ * RFAILED - unsuccessful.
+ *
+ * Notes: The parameter doNotBlockForLock specifies whether to block for lock
+ * or not
+ *
+ * File: cm_mem.c
+ *
+ */
S16 ssGetDynMemBlkSet
(
-uint8_t bktIdx, /* Index to bucket list */
-CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is updated
- with new set values */
-uint32_t doNotBlockForLock /* Boolean whether to block for lock or not */
-)
+ uint8_t bktIdx, /* Index to bucket list */
+ CmMmBlkSetElement *dynMemSetElem, /* Memory set element which is updated
+ with new set values */
+ uint32_t doNotBlockForLock /* Boolean whether to block for lock or not */
+ )
{
CmMmGlobRegCb *globReg;
CmMmGlobalBktCb *bktCb;
if(lstNode == NULLP)
{
- SUnlock(&(bktCb->bucketLock));
- return RFAILED;
+ SUnlock(&(bktCb->bucketLock));
+ return RFAILED;
}
/* Delete the node from the valid linked list and copy the values of the
if(gDynMemAlrm[bktIdx])
{
- // printf ("under memory bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
- SLock(&(bktCb->bucketLock));
- if(bktCb->listValidBktSet.count > 25)
- {
- gDynMemAlrm[bktIdx] = FALSE;
- // printf ("recoverd bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
- }
- SUnlock(&(bktCb->bucketLock));
- return RFAILED;
+ // printf ("\nunder memory bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
+ SLock(&(bktCb->bucketLock));
+ if(bktCb->listValidBktSet.count > 25)
+ {
+ gDynMemAlrm[bktIdx] = FALSE;
+ // printf ("\nrecoverd bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
+ }
+ SUnlock(&(bktCb->bucketLock));
+ return RFAILED;
}
else
{
- if(memoryCheckCounter++ >= NUM_CALLS_TO_CHECK_MEM_DYN_AGAIN)
- {
- // printf ("CHECK bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
- SLock(&(bktCb->bucketLock));
- if(bktCb->listValidBktSet.count < 15 )
- gDynMemAlrm[bktIdx] = TRUE;
- memoryCheckCounter = 0;
- SUnlock(&(bktCb->bucketLock));
- }
+ if(memoryCheckCounter++ >= NUM_CALLS_TO_CHECK_MEM_DYN_AGAIN)
+ {
+ // printf ("\nCHECK bktCb->listValidBktSet.count %d bktIdx %d\n",bktCb->listValidBktSet.count ,bktIdx);
+ SLock(&(bktCb->bucketLock));
+ if(bktCb->listValidBktSet.count < 15 )
+ gDynMemAlrm[bktIdx] = TRUE;
+ memoryCheckCounter = 0;
+ SUnlock(&(bktCb->bucketLock));
+ }
}
return ROK;
}
#ifdef SS_USE_ICC_MEMORY
/*
-*
-* Fun: Initialize region/pool tables
-*
-* Desc: This function initializes MTSS-specific information
-* in the region/pool tables and configures the common
-* memory manager for use.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize region/pool tables
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the region/pool tables and configures the common
+ * memory manager for use.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void * ssGetIccHdl(Region region)
{
CmMmDynRegCb *dynRegCb;
{
return (NULLP);
}
-
+
dynRegCb = (CmMmDynRegCb *)osCp.dynRegionTbl[region].regCb;
return (dynRegCb->iccHdl);
bktMemStrtAddr += mtDynMemSz[i].reqdSz;
}
- printf("Global Memory Info: \n");
+ printf("\nGlobal Memory Info: \n");
for (i = 0 ; i < mtGlobMemoCfg.numBkts ; i++)
{
printf("mtDynMemSz[%d]: [0x%016lx]\n", i, (unsigned long int)mtDynMemSz[i].startAddr);
}
osCp.wls.allocAddr = WLS_Alloc(osCp.wls.intf,
#ifdef INTEL_L1_V19_10
- WLS_MEMORY_SIZE);
+ WLS_MEMORY_SIZE);
#else
(reqdMemSz + (4 * 1024 * 1024)));
#endif
long int pageSize[1], hugePageSize;
#endif
uint32_t numHugePg;
- #define DIV_ROUND_OFFSET(X,Y) ( X/Y + ((X%Y)?1:0) )
+#define DIV_ROUND_OFFSET(X,Y) ( X/Y + ((X%Y)?1:0) )
uint8_t *regMemStrtAddr = (uint8_t *)osCp.wls.allocAddr;
if(type == 0) //Global
{
if(ptr < mtRegMemSz[0].startAddr || ptr >=
- (mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr + mtGlobMemoCfg.heapSize))
+ (mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr + mtGlobMemoCfg.heapSize))
{
- printf("****INVALID PTR in Global Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
- *tryPtr = 0;
+ printf("\n****INVALID PTR in Global Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
+ *tryPtr = 0;
}
}
else
{
if(ptr > mtRegMemSz[0].startAddr && ptr <= mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr )
{
- printf("****INVALID PTR in Static Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
- *tryPtr = 0;
+ printf("\n****INVALID PTR in Static Region: ptr:%p start:%p end:%p***\n", ptr, mtRegMemSz[0].startAddr, mtRegMemSz[mtGlobMemoCfg.numBkts].startAddr);
+ *tryPtr = 0;
}
}
regMemStrtAddr += reqdSz;
#ifdef T2K_MEM_LEAK_DBG
{ /* Since region 1 onwards are used for non wls */
- regMemLeakInfo.regStartAddr[i] = (uint64_t)mtRegMemSz[i].startAddr;
- regMemLeakInfo.numActvRegions++;
+ regMemLeakInfo.regStartAddr[i] = (uint64_t)mtRegMemSz[i].startAddr;
+ regMemLeakInfo.numActvRegions++;
}
#endif /* T2K_MEM_LEAK_DBG */
}
for (j = 0; j < region->numBkts; j++)
{
- reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
- mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+ reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+ mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
}
}
osCp.wls.allocAddr = WLS_Alloc(osCp.wls.intf, (512 *1024 * 1024));
for (j = 0; j < region->numBkts; j++)
{
- reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
- mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+ reqdMemSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
+ mtRegMemSz[i].reqdSz += region->bkt[j].blkSize * region->bkt[j].numBlks;
}
}
\f
\f
/*
-*
-* Fun: Initialize region/pool tables
-*
-* Desc: This function initializes MTSS-specific information
-* in the region/pool tables and configures the common
-* memory manager for use.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize region/pool tables
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the region/pool tables and configures the common
+ * memory manager for use.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitMem(void)
{
/* mt018.201 - added local variable */
Size memSize =0;
#endif
#endif /* SS_LOCKLESS_MEMORY */
-
+
/* 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
dynRegCb = (CmMmDynRegCb *)calloc(1, sizeof(CmMmDynRegCb));
if(dynRegCb == NULLP)
{
- return RFAILED;
+ return RFAILED;
}
for(k = 0; k < mtDynMemoCfg.region[i].numBkts; k++)
{
- dynRegCb->bktSize[k] = mtGlobMemoCfg.bkt[k].blkSize;
+ dynRegCb->bktSize[k] = mtGlobMemoCfg.bkt[k].blkSize;
}
dynRegCb->region = i;
cmMmDynRegInit(dynRegCb);
- printf("iccHdl = %lx\n", (PTR)dynRegCb->iccHdl);
+ printf("\niccHdl = %lx\n", (PTR)dynRegCb->iccHdl);
sleep(1);
}
- /* ysIccHdl = dynRegCb->iccHdl; */
+ /* ysIccHdl = dynRegCb->iccHdl; */
#else
/* Initialize the global region first */
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);
+ printf("\nStarting Address of Bkt Entry [%d]: [0x%016lx], memSize[%d]\n", i, (unsigned long int)globReg->bktTbl[i].startAddr, memSize);
#else
#ifndef INTEL_WLS
globReg->bktTbl[i].startAddr = (Data *)calloc(memSize, sizeof(Data));
#endif
if(globReg->bktTbl[i].startAddr == NULLP)
{
- return RFAILED;
+ return RFAILED;
}
globReg->bktTbl[i].poolId = i;
globReg->bktTbl[i].size = mtGlobMemoCfg.bkt[i].blkSize;
dynRegCb = (CmMmDynRegCb *)calloc(1, sizeof(CmMmDynRegCb));
if(dynRegCb == NULLP)
{
- return RFAILED;
+ return RFAILED;
}
for(k = 0; k < mtDynMemoCfg.region[i].numBkts; k++)
{
- if((mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold <
- mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold) ||
- (mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold == 0) ||
- (mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold == 0))
- {
+ if((mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold <
+ mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold) ||
+ (mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold == 0) ||
+ (mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold == 0))
+ {
#ifdef XEON_SPECIFIC_CHANGES
- free(dynRegCb);
+ free(dynRegCb);
#endif
- return RFAILED;
- }
- dynRegCb->bktTbl[k].poolId = k;
- dynRegCb->bktTbl[k].size = mtGlobMemoCfg.bkt[k].blkSize;
- dynRegCb->bktTbl[k].blkSetRelThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold;
- dynRegCb->bktTbl[k].blkSetAcquireThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold;
- dynRegCb->bktTbl[k].bucketSetSize = mtGlobMemoCfg.bkt[k].bucketSetSize;
- if(dynRegCb->bktMaxBlkSize < dynRegCb->bktTbl[k].size)
- {
- dynRegCb->bktMaxBlkSize = dynRegCb->bktTbl[k].size;
- }
+ return RFAILED;
+ }
+ dynRegCb->bktTbl[k].poolId = k;
+ dynRegCb->bktTbl[k].size = mtGlobMemoCfg.bkt[k].blkSize;
+ dynRegCb->bktTbl[k].blkSetRelThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetRelThreshold;
+ dynRegCb->bktTbl[k].blkSetAcquireThreshold = mtDynMemoCfg.region[i].bkt[k].blkSetAcquireThreshold;
+ dynRegCb->bktTbl[k].bucketSetSize = mtGlobMemoCfg.bkt[k].bucketSetSize;
+ if(dynRegCb->bktMaxBlkSize < dynRegCb->bktTbl[k].size)
+ {
+ dynRegCb->bktMaxBlkSize = dynRegCb->bktTbl[k].size;
+ }
}
dynRegCb->region = i;
dynRegCb->numBkts = mtDynMemoCfg.region[i].numBkts;
#endif /* SS_LOCKLESS_MEMORY */
#ifdef T2K_MEM_LEAK_DBG
- uint8_t reg =0;
- /* Initailize mem leak tool memorys for debguing */
- regMemLeakInfo.numActvRegions=0;
- for(reg=0; reg <SS_MAX_REGS; reg++)
- {
- regMemLeakInfo.gMemLeakInfo[reg] = malloc(sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
- memset(regMemLeakInfo.gMemLeakInfo[reg],0x0,
- sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
- regMemLeakInfo.regStartAddr[reg] = 0;
-
-
- regMemLeakInfo.regStartAddr[reg] = 0;
- if (pthread_mutex_init(&(regMemLeakInfo.memLock[reg]), NULL) != 0)
- {
- printf("\n mutex init failed\n");
- return RFAILED;
- }
- }
+ uint8_t reg =0;
+ /* Initailize mem leak tool memorys for debguing */
+ regMemLeakInfo.numActvRegions=0;
+ for(reg=0; reg <SS_MAX_REGS; reg++)
+ {
+ regMemLeakInfo.gMemLeakInfo[reg] = malloc(sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
+ memset(regMemLeakInfo.gMemLeakInfo[reg],0x0,
+ sizeof(T2kMeamLeakInfo)*T2K_MEM_LEAK_INFO_TABLE_SIZE);
+ regMemLeakInfo.regStartAddr[reg] = 0;
+
+
+ regMemLeakInfo.regStartAddr[reg] = 0;
+ if (pthread_mutex_init(&(regMemLeakInfo.memLock[reg]), NULL) != 0)
+ {
+ printf("\n mutex init failed\n");
+ return RFAILED;
+ }
+ }
#endif
#ifdef INTEL_WLS
/* Now allocate WLS memory */
if (mtCMMRegCb[i] == NULLP)
{
sprintf(errMsg,"\n ssdInitMem(): Could not allocated memory \
- for the Region:%d control block\n",i);
+ for the Region:%d control block\n",i);
SPrint(errMsg);
- for (k = 0; k < i; k++)
- {
- cmMmRegDeInit(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]->vAddr);
- free(mtCMMRegCb[k]);
+ for (k = 0; k < i; k++)
+ {
+ cmMmRegDeInit(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]->vAddr);
+ free(mtCMMRegCb[k]);
free(mtCMMRegCfg[k]);
- }
- return RFAILED;
+ }
+ return RFAILED;
}
mtCMMRegCfg[i] = (CmMmRegCfg *)calloc(1, sizeof(CmMmRegCfg));
mtCMMRegCfg[i]->size = region->heapsize;
for (j = 0; j < region->numBkts; j++)
{
-/* mt033.201 - addition for including the header size while computing the total size */
+ /* mt033.201 - addition for including the header size while computing the total size */
#ifdef SSI_DEBUG_LEVEL1
- mtCMMRegCfg[i]->size += (region->bkt[j].blkSize + sizeof(CmMmBlkHdr)) *\
- (region->bkt[j].numBlks);
+ mtCMMRegCfg[i]->size += (region->bkt[j].blkSize + sizeof(CmMmBlkHdr)) *\
+ (region->bkt[j].numBlks);
#else
- mtCMMRegCfg[i]->size += region->bkt[j].blkSize * region->bkt[j].numBlks;
+ mtCMMRegCfg[i]->size += region->bkt[j].blkSize * region->bkt[j].numBlks;
#endif /* SSI_DEBUG_LEVEL1 */
}
#ifdef INTEL_WLS
mtCMMRegCfg[i]->vAddr = (Data *)mtRegMemSz[i].startAddr;
#else
mtCMMRegCfg[i]->vAddr = (Data *)calloc(mtCMMRegCfg[i]->size,
- sizeof(Data));
+ sizeof(Data));
#endif
#ifdef XEON_SPECIFIC_CHANGES
CM_LOG_DEBUG(CM_LOG_ID_MT, "Static Region-->Bkt[%d] Addr:[%p] RegionId=[%d] Size=[%d] \n",
- i, mtCMMRegCfg[i]->vAddr, region->regionId, mtCMMRegCfg[i]->size);
+ i, mtCMMRegCfg[i]->vAddr, region->regionId, mtCMMRegCfg[i]->size);
#endif
#ifdef TENB_RTLIN_CHANGES
mlock(mtCMMRegCfg[i]->vAddr, mtCMMRegCfg[i]->size*sizeof(Data));
if (mtCMMRegCfg[i]->vAddr == NULLP)
{
- sprintf(errMsg,"\n ssdInitMem(): Could not allocate memory \
- for the Region:%d \n",i);
- SPrint(errMsg);
- for (k = 0; k < i; k++)
- {
- cmMmRegDeInit(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]->vAddr);
- free(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]);
- }
- free(mtCMMRegCb[i]);
- free(mtCMMRegCfg[i]);
- return RFAILED;
+ sprintf(errMsg,"\n ssdInitMem(): Could not allocate memory \
+ for the Region:%d \n",i);
+ SPrint(errMsg);
+ for (k = 0; k < i; k++)
+ {
+ cmMmRegDeInit(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]->vAddr);
+ free(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]);
+ }
+ free(mtCMMRegCb[i]);
+ free(mtCMMRegCfg[i]);
+ return RFAILED;
}
for (j = 0; j < region->numBkts; j++)
{
- mtCMMRegCfg[i]->bktCfg[j].size = region->bkt[j].blkSize;
- mtCMMRegCfg[i]->bktCfg[j].numBlks = region->bkt[j].numBlks;
+ mtCMMRegCfg[i]->bktCfg[j].size = region->bkt[j].blkSize;
+ mtCMMRegCfg[i]->bktCfg[j].numBlks = region->bkt[j].numBlks;
}
/* initialize the CMM */
#ifdef SS_LOCKLESS_MEMORY
if (cmMmStatRegInit(region->regionId, mtCMMRegCb[i], mtCMMRegCfg[i]) != ROK)
#else
- if (cmMmRegInit(region->regionId, mtCMMRegCb[i], mtCMMRegCfg[i]) != ROK)
+ if (cmMmRegInit(region->regionId, mtCMMRegCb[i], mtCMMRegCfg[i]) != ROK)
#endif /* SS_LOCKLESS_MEMORY */
- {
- for (k = 0; k < i; k++)
- {
- cmMmRegDeInit(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]->vAddr);
- free(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]);
- }
- free(mtCMMRegCfg[i]->vAddr);
- free(mtCMMRegCb[i]);
- free(mtCMMRegCfg[i]);
- return RFAILED;
- }
+ {
+ for (k = 0; k < i; k++)
+ {
+ cmMmRegDeInit(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]->vAddr);
+ free(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]);
+ }
+ free(mtCMMRegCfg[i]->vAddr);
+ free(mtCMMRegCb[i]);
+ free(mtCMMRegCfg[i]);
+ return RFAILED;
+ }
/* initialize the STREAMS module */
/* mt019.201: STREAMS module will only apply to DFLT_REGION */
if (region->regionId == 0)
{
- if (ssStrmCfg(region->regionId, region->regionId) != ROK)
- {
- for (k = 0; k < i; k++)
- {
- cmMmRegDeInit(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]->vAddr);
- free(mtCMMRegCb[k]);
- free(mtCMMRegCfg[k]);
- }
- cmMmRegDeInit(mtCMMRegCb[i]);
- free(mtCMMRegCfg[i]->vAddr);
- free(mtCMMRegCb[i]);
- free(mtCMMRegCfg[i]);
- return RFAILED;
- }
+ if (ssStrmCfg(region->regionId, region->regionId) != ROK)
+ {
+ for (k = 0; k < i; k++)
+ {
+ cmMmRegDeInit(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]->vAddr);
+ free(mtCMMRegCb[k]);
+ free(mtCMMRegCfg[k]);
+ }
+ cmMmRegDeInit(mtCMMRegCb[i]);
+ free(mtCMMRegCfg[i]->vAddr);
+ free(mtCMMRegCb[i]);
+ free(mtCMMRegCfg[i]);
+ return RFAILED;
+ }
}
}
-/* mt001.301 : Additions */
+ /* mt001.301 : Additions */
#ifdef SS_MEM_LEAK_STS
cmInitMemLeakMdl();
#endif /* SS_MEM_LEAK_STS */
\f
/*
-*
-* Fun: De-initialize region/pool tables
-*
-* Desc: This function reverses the initialization in ssdInitMem().
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-Void ssdDeinitMem(void)
-{
- /* mt018.201 - added local variables */
- uint8_t i;
-
- /* mt008.301 Additions */
-#ifdef SS_MEM_LEAK_STS
- cmDeinitMemLeakMdl();
-#endif /* SS_MEM_LEAK_STS */
+ *
+ * Fun: De-initialize region/pool tables
+ *
+ * Desc: This function reverses the initialization in ssdInitMem().
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+Void ssdDeinitMem(void)
+{
+ /* mt018.201 - added local variables */
+ uint8_t i;
+
+ /* mt008.301 Additions */
+#ifdef SS_MEM_LEAK_STS
+ cmDeinitMemLeakMdl();
+#endif /* SS_MEM_LEAK_STS */
for (i = 0; i < mtMemoCfg.numRegions; i++)
{
\f
/*
-*
-* Fun: Initialize task table
-*
-* Desc: This function initializes MTSS-specific information
-* in the task table.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize task table
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the task table.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitTsk(void)
{
-/* mt001.301 : Additions */
-/*mt013.301 :Added SS_AFFINITY_SUPPORT */
+ /* mt001.301 : Additions */
+ /*mt013.301 :Added SS_AFFINITY_SUPPORT */
#if defined(SS_MULTICORE_SUPPORT) ||defined(SS_AFFINITY_SUPPORT)
uint32_t tskInd = 0;
#endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */
-/*mt013.301 :Added SS_AFFINITY_SUPPORT */
+ /*mt013.301 :Added SS_AFFINITY_SUPPORT */
#if defined(SS_MULTICORE_SUPPORT) || defined(SS_AFFINITY_SUPPORT)
/* initialize system task information */
for (tskInd = 0; tskInd < SS_MAX_STSKS; tskInd++)
\f
/*
-*
-* Fun: Deinitialize task table
-*
-* Desc: This function reverses the initialization perfomed in
-* ssdInitTsk().
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Deinitialize task table
+ *
+ * Desc: This function reverses the initialization perfomed in
+ * ssdInitTsk().
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void ssdDeinitTsk(void)
{
\f
#ifdef SS_DRVR_SUPPORT
/*
-*
-* Fun: Initialize driver task table
-*
-* Desc: This function initializes MTSS-specific information
-* in the driver task table.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize driver task table
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the driver task table.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitDrvr(void)
{
S16 i;
}
#endif
- /*mt014.301 : 4GMX release related changes*/
+ /*mt014.301 : 4GMX release related changes*/
#ifdef SS_4GMX_UCORE
uarmDrvrInit();
#endif
\f
/*
-*
-* Fun: Deinitialize driver information
-*
-* Desc: This function reverses the initialization performed in
-* ssdInitDrvr().
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Deinitialize driver information
+ *
+ * Desc: This function reverses the initialization performed in
+ * ssdInitDrvr().
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void ssdDeinitDrvr(void)
{
- /* mt008.301: Terminate the Driver Task on exit */
- while(pthread_cancel(osCp.dep.isTskHdlrTID));
+ /* mt008.301: Terminate the Driver Task on exit */
+ while(pthread_cancel(osCp.dep.isTskHdlrTID));
#ifdef L2_L3_SPLIT
- TL_Close(AppContext.hUAII);
- if (clusterMode == RADIO_CLUSTER_MODE)
- {
+ TL_Close(AppContext.hUAII);
+ if (clusterMode == RADIO_CLUSTER_MODE)
+ {
TL_Close(AppContext.hUAII_second);
- }
+ }
#endif
return;
\f
/*
-*
-* Fun: Initialize timer table
-*
-* Desc: This function initializes MTSS-specific information
-* in the timer table.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize timer table
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the timer table.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitTmr(void)
{
pthread_attr_t attr;
struct sched_param param_sched;
- /* mt010.21: addition */
+ /* mt010.21: addition */
S32 i;
#ifdef SS_MULTICORE_SUPPORT
SsSTskEntry *sTsk;
osCp.dep.tmrTqCp.tmrLen = SS_MAX_TMRS;
- /* mt010.21: addition */
+ /* mt010.21: addition */
osCp.dep.tmrTqCp.nxtEnt = 0;
for (i=0; i< SS_MAX_TMRS; i++)
{
#endif
if ((pthread_create(&osCp.dep.tmrHdlrTID, &attr, mtTmrHdlr, NULLP)) != 0)
{
- /* mt020.201 - Addition for destroying thread attribute object attr */
- pthread_attr_destroy(&attr);
+ /* mt020.201 - Addition for destroying thread attribute object attr */
+ pthread_attr_destroy(&attr);
- return RFAILED;
+ return RFAILED;
}
#ifdef SS_THR_REG_MAP
threadCreated = ssCheckAndAddMemoryRegionMap(osCp.dep.tmrHdlrTID,
- sTsk->region);
+ sTsk->region);
}
#endif /* SS_THR_REG_MAP */
#ifdef SS_MEM_WL_DEBUG
\f
/*
-*
-* Fun: Deinitialize timer table
-*
-* Desc: This function reverses the initialization performed in
-* ssdInitTmr().
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Deinitialize timer table
+ *
+ * Desc: This function reverses the initialization performed in
+ * ssdInitTmr().
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void ssdDeinitTmr(void)
{
#ifdef SS_MULTICORE_SUPPORT
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT008, (ErrVal) ret,
- "Could not lock system task table");
+ "Could not lock system task table");
#endif
return;
}
SUnlock(&osCp.sTskTblLock);
#endif /* SS_MULTICORE_SUPPORT */
- /* mt008.301: Terminate the timer thread on exit */
- while(pthread_cancel(osCp.dep.tmrHdlrTID));
- return;
+ /* mt008.301: Terminate the timer thread on exit */
+ while(pthread_cancel(osCp.dep.tmrHdlrTID));
+ return;
}
\f
/*
-*
-* Fun: ssdInitLog
-*
-* Desc: Pre-tst() initialization.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdInitLog
+ *
+ * Desc: Pre-tst() initialization.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitLog(void)
{
-/* mt027.201 - Modification to fix warnings with no STDIN and STDOUT */
+ /* mt027.201 - Modification to fix warnings with no STDIN and STDOUT */
#ifdef CONAVL
#ifndef CONRD
S32 flags;
#endif /* CONRD */
#endif /* CONAVL */
-/* mt008.301: ssdInitFinal changed to ssdInitLog */
+ /* mt008.301: ssdInitFinal changed to ssdInitLog */
#ifdef CONAVL
osCp.dep.conInFp = (FILE *) stdin;
osCp.dep.conOutFp = (FILE *) stdout;
-/* added compile time flag CONRD: mt017.21 */
+ /* added compile time flag CONRD: mt017.21 */
#ifndef CONRD
#ifndef CONSTDIO
fd = fileno(osCp.dep.conInFp);
if ((tcgetattr(fd, &tio)) != 0)
{
- printf("Error: disable canonical input processing\n");
+ printf("\nError: disable canonical input processing\n");
return RFAILED;
}
tio.c_cc[VTIME] = 0;
if ((tcsetattr(fd, TCSANOW, &tio)) != 0)
{
- printf("Error: while tcsetattr() processing\n");
+ printf("\nError: while tcsetattr() processing\n");
return RFAILED;
}
flags &= ~O_NONBLOCK;
if (fcntl(fd, F_SETFL, flags) == -1)
{
- printf("Error: while fcntl processing\n");
+ printf("\nError: while fcntl processing\n");
return RFAILED;
}
/* mt020.201 - Addition for destroying thread attribute object attr */
pthread_attr_destroy(&attr);
- printf("Error: Logging Thread creation failed \n");
+ printf("\nError: Logging Thread creation failed \n");
return RFAILED;
}
\f
/*
-*
-* Fun: ssdDeinitLog
-*
-* Desc: This function reverses the initialization performed in
-* ssdInitLog().
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdDeinitLog
+ *
+ * Desc: This function reverses the initialization performed in
+ * ssdInitLog().
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
/* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */
Void ssdDeinitLog(void)
{
-/* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */
+ /* mt008.301: ssdDeinitFinal changed to ssdDeinitLog */
#ifdef CONAVL
#ifndef CONRD
- /* mt008.301: Terminate the console reader on exit */
- while(pthread_cancel(osCp.dep.conHdlrTID));
+ /* mt008.301: Terminate the console reader on exit */
+ while(pthread_cancel(osCp.dep.conHdlrTID));
#endif /* CONRD */
#endif /* CONVAL */
#endif /* SS_WATCHDOG_IPV6 */
if(bind(osCp.wdCp.globWd.sock, (struct sockaddr *)&tmpaddr, sizeof(struct sockaddr)) != 0
-)
+ )
{
sprintf(prntBuf,"ssdInitWatchDog: bind failed errno [%d]\n", errno);
SPrint(prntBuf);
}
#ifdef SS_MULTIPLE_PROCS
-S16 ssdWatchDgActvTmr
+ S16 ssdWatchDgActvTmr
(
-ProcId proc,
-Ent ent,
-Inst inst
-)
+ ProcId proc,
+ Ent ent,
+ Inst inst
+ )
#else
S16 ssdWatchDgActvTmr(Void)
#endif /* SS_MULTIPLE_PROCS */
return ROK;
}
-Void ssdWatchDgTmrEvt
+ Void ssdWatchDgTmrEvt
(
-PTR cb, /* control block */
-S16 event /* timer number */
-)
+ PTR cb, /* control block */
+ S16 event /* timer number */
+ )
{
-/* mt003.301 Fixed warings */
+ /* mt003.301 Fixed warings */
#ifdef DEBUGP
DateTime dt;
#endif /* DEBUGP */
{
case SS_TMR_HRTBT:
#ifdef DEBUGP
- SPrint("Timer Heartbeat Request Expired");
- SGetDateTime(&dt);
- sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
- SPrint(prntBuf);
-#endif
- restartTmr=TRUE;
-
- SLock(&osCp.wdCp.wdLock);
- for(i=0; i < osCp.wdCp.globWd.numNodes; i++)
- {
- if(osCp.wdCp.globWd.wdsta[i].status == 0)
- {
- sprintf(prntBuf, "Node [ %s ] Down. Calling user callback\n", inet_ntoa(osCp.wdCp.globWd.wdsta[i].addr));
- SPrint(prntBuf);
- if(osCp.wdCp.globWd.callback != 0)
- {
- osCp.wdCp.globWd.callback(osCp.wdCp.globWd.data);
- }
- }
- }
- SUnlock(&osCp.wdCp.wdLock);
-
- if(!osCp.wdCp.globWd.watchdogStop)
- {
- ssdStartWatchDgTmr(NULLP, SS_TMR_HRTBT, osCp.wdCp.globWd.timeout);
- ssdSndHrtBtMsg(restartTmr, SS_WD_HB_REQ);
- }
- break;
+ SPrint("Timer Heartbeat Request Expired");
+ SGetDateTime(&dt);
+ sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
+ SPrint(prntBuf);
+#endif
+ restartTmr=TRUE;
+
+ SLock(&osCp.wdCp.wdLock);
+ for(i=0; i < osCp.wdCp.globWd.numNodes; i++)
+ {
+ if(osCp.wdCp.globWd.wdsta[i].status == 0)
+ {
+ sprintf(prntBuf, "Node [ %s ] Down. Calling user callback\n", inet_ntoa(osCp.wdCp.globWd.wdsta[i].addr));
+ SPrint(prntBuf);
+ if(osCp.wdCp.globWd.callback != 0)
+ {
+ osCp.wdCp.globWd.callback(osCp.wdCp.globWd.data);
+ }
+ }
+ }
+ SUnlock(&osCp.wdCp.wdLock);
+
+ if(!osCp.wdCp.globWd.watchdogStop)
+ {
+ ssdStartWatchDgTmr(NULLP, SS_TMR_HRTBT, osCp.wdCp.globWd.timeout);
+ ssdSndHrtBtMsg(restartTmr, SS_WD_HB_REQ);
+ }
+ break;
default:
- break;
+ break;
}
}
-Void ssdStartWatchDgTmr
+ Void ssdStartWatchDgTmr
(
-void *cb,
-S16 event,
-uint16_t wait
-)
+ void *cb,
+ S16 event,
+ uint16_t wait
+ )
{
CmTmrArg arg;
int i;
#endif
- /* mt003.301 Modifications */
+ /* mt003.301 Modifications */
#ifdef DEBUGP
SGetDateTime(&dt);
sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
return;
}
-Void ssdStopWatchDgTmr
+ Void ssdStopWatchDgTmr
(
-void *cb,
-S16 event
-)
+ void *cb,
+ S16 event
+ )
{
CmTmrArg arg;
#ifdef DEBUGP
int i;
#endif
- /* mt003.301 Modifications */
+ /* mt003.301 Modifications */
#ifdef DEBUGP
SGetDateTime(&dt);
sprintf(prntBuf," Time: %02d:%02d:%02d\n",dt.hour,dt.min, dt.sec);
return;
}
-S16 ssdSndHrtBtMsg
+ S16 ssdSndHrtBtMsg
(
-Bool restart,
-uint32_t type
-)
+ Bool restart,
+ uint32_t type
+ )
{
S16 ret = ROK;
#ifdef DEBUGP
{
if(osCp.wdCp.globWd.wdsta[n].addr.s_addr == 0)
{
- continue;
+ continue;
}
/* Identify the destination node */
if(err == -1)
{
#ifdef DEBUGP
- sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] failed status[%d]\n",
- inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, errno);
- SPrint(prntBuf);
+ sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] failed status[%d]\n",
+ inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, errno);
+ SPrint(prntBuf);
#endif /* DEBUGP */
}
else
{
#ifdef DEBUGP
- sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] sent[%d]\n", inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, err);
- SPrint(prntBuf);
+ sprintf(prntBuf,"ssdSndHrtBtMsg: HB to node [%s:%d] sent[%d]\n", inet_ntoa(tmpaddr.sin_addr), tmpaddr.sin_port, err);
+ SPrint(prntBuf);
#endif /* DEBUGP */
}
}
/* mt022.201 - Modification to fix problem when NOCMDLINE is defined */
#ifndef NOCMDLINE
/*
-*
-* Fun: mtGetOpts
-*
-* Desc: This function gets command line options.
-*
-* Ret:
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: mtGetOpts
+ *
+ * Desc: This function gets command line options.
+ *
+ * Ret:
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
static Void mtGetOpts(void)
{
S32 argc;
FILE *memOpt; /* memory options file pointer */
Txt pBuf[128];
uint8_t i;
-/* mt007.301 : Fix related to file based mem config on 64 bit machine */
+ /* mt007.301 : Fix related to file based mem config on 64 bit machine */
PTR numReg;
PTR numBkts;
PTR bktSz = NULLP;
switch (ret)
{
#ifndef NOFILESYS
-/* mt001.301 : Additions */
+ /* mt001.301 : Additions */
#ifdef SS_MEM_LEAK_STS
- case 'm':
- cmMemOpenMemLkFile(msOptArg);
- break;
-#endif
- case 'o':
- osCp.dep.fileOutFp = fopen(msOptArg, "w");
- break;
- case 'f':
- fileBasedMemCfg = TRUE;
- memOpt = fopen(msOptArg, "r");
-
- /* if file does not exist or could not be opened then use the
- * default memory configuration as defined in mt_ss.h
- */
- if (memOpt == (FILE *) NULLP)
- {
- sprintf(pBuf, "\nMTSS: Memory configuration file: %s could not\
- be opened, using default mem configuration\n", msOptArg);
- SPrint(pBuf);
- break;
- }
- i = 0;
- while (fgets((Txt *)line, 256, memOpt) != NULLP)
- {
- if(line[0] == '#' || line[0] < '0' || line[0] > '9') /* Comment line or non numeric character, so skip it and read next line */
- continue;
- if(error == TRUE)
- break;
- switch (i)
- {
- case 0: /*** INPUT: Number of regions ***/
- sscanf(line, "%ld", (long *) &numReg);
- mtMemoCfg.numRegions = numReg;
- if(mtMemoCfg.numRegions > SS_MAX_REGS)
- {
- printf("\n No. of regions are > SS_MAX_REGS:%d \n",SS_MAX_REGS);
- error = TRUE;
- break;
- }
- i++;
- break;
- case 1: /*** INPUT: Number of buckets and number of Pools ***/
- sscanf(line, "%ld %ld", (long *) &numBkts, (long *) &numPools);
- if(numBkts > MT_MAX_BKTS)
- {
- printf("\n No. of buckets are > MT_MAX_BKTS :%d \n",MT_MAX_BKTS);
- error = TRUE;
- break;
- }
- if(numPools > SS_MAX_POOLS_PER_REG)
- {
- printf("\n No. of pools are > SS_MAX_POOLS_PER_REG:%d \n",SS_MAX_POOLS_PER_REG);
- error = TRUE;
- break;
- }
- /*
- * Delay updation from local variable to global
- * structure of number of regions and heap data to
- * counter error conditions present above.
- */
- for(idx = 0; idx < cfgNumRegs; idx++)
- {
- mtMemoCfg.region[idx].numBkts = numBkts;
- cfgRegInfo[idx].region = idx;
- cfgRegInfo[idx].numPools = numPools;
- /*
- * Initialize the pool info as static type with size zero
- */
- for(poolIdx = 0; poolIdx < numPools; poolIdx++)
- {
- cfgRegInfo[idx].pools[poolIdx].type = SS_POOL_STATIC;
- cfgRegInfo[idx].pools[poolIdx].size = 0;
- }
- }
- i++;
- break;
- case 2: /*** INPUT: Bucket Id and size of the bucket ***/
- if(bktUpdtCnt < numBkts) /* more set of bucket can be added */
- {
- sscanf(line, "%ld %ld",(long *)&bktIdx, (long *) &bktSz);
- }
- if(bktIdx >= numBkts)
- {
- printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
- error = TRUE;
- break;
-
- }
- mtBktInfo[bktIdx].blkSize = bktSz;
- bktUpdtCnt++;
- if(bktUpdtCnt == numBkts)
- {
- i++; /*done reading bkt info, start reading individual region info*/
- bktUpdtCnt = 0;
- }
- break;
- case 3: /*** INPUT: Region Id (ranges from 0 to numRegions-1) **/
- sscanf(line,"%ld",(long *) ®Id);
- if(regId >= mtMemoCfg.numRegions)
- {
- printf("\n Invalid Region Id, may be >= the No. of regions:%d\n",mtMemoCfg.numRegions);
+ case 'm':
+ cmMemOpenMemLkFile(msOptArg);
+ break;
+#endif
+ case 'o':
+ osCp.dep.fileOutFp = fopen(msOptArg, "w");
+ break;
+ case 'f':
+ fileBasedMemCfg = TRUE;
+ memOpt = fopen(msOptArg, "r");
+
+ /* if file does not exist or could not be opened then use the
+ * default memory configuration as defined in mt_ss.h
+ */
+ if (memOpt == (FILE *) NULLP)
+ {
+ sprintf(pBuf, "\nMTSS: Memory configuration file: %s could not\
+ be opened, using default mem configuration\n", msOptArg);
+ SPrint(pBuf);
+ break;
+ }
+ i = 0;
+ while (fgets((Txt *)line, 256, memOpt) != NULLP)
+ {
+ if(line[0] == '#' || line[0] < '0' || line[0] > '9') /* Comment line or non numeric character, so skip it and read next line */
+ continue;
+ if(error == TRUE)
+ break;
+ switch (i)
+ {
+ case 0: /*** INPUT: Number of regions ***/
+ sscanf(line, "%ld", (long *) &numReg);
+ mtMemoCfg.numRegions = numReg;
+ if(mtMemoCfg.numRegions > SS_MAX_REGS)
+ {
+ printf("\n No. of regions are > SS_MAX_REGS:%d \n",SS_MAX_REGS);
+ error = TRUE;
+ break;
+ }
+ i++;
+ break;
+ case 1: /*** INPUT: Number of buckets and number of Pools ***/
+ sscanf(line, "%ld %ld", (long *) &numBkts, (long *) &numPools);
+ if(numBkts > MT_MAX_BKTS)
+ {
+ printf("\n No. of buckets are > MT_MAX_BKTS :%d \n",MT_MAX_BKTS);
+ error = TRUE;
+ break;
+ }
+ if(numPools > SS_MAX_POOLS_PER_REG)
+ {
+ printf("\n No. of pools are > SS_MAX_POOLS_PER_REG:%d \n",SS_MAX_POOLS_PER_REG);
+ error = TRUE;
+ break;
+ }
+ /*
+ * Delay updation from local variable to global
+ * structure of number of regions and heap data to
+ * counter error conditions present above.
+ */
+ for(idx = 0; idx < cfgNumRegs; idx++)
+ {
+ mtMemoCfg.region[idx].numBkts = numBkts;
+ cfgRegInfo[idx].region = idx;
+ cfgRegInfo[idx].numPools = numPools;
+ /*
+ * Initialize the pool info as static type with size zero
+ */
+ for(poolIdx = 0; poolIdx < numPools; poolIdx++)
+ {
+ cfgRegInfo[idx].pools[poolIdx].type = SS_POOL_STATIC;
+ cfgRegInfo[idx].pools[poolIdx].size = 0;
+ }
+ }
+ i++;
+ break;
+ case 2: /*** INPUT: Bucket Id and size of the bucket ***/
+ if(bktUpdtCnt < numBkts) /* more set of bucket can be added */
+ {
+ sscanf(line, "%ld %ld",(long *)&bktIdx, (long *) &bktSz);
+ }
+ if(bktIdx >= numBkts)
+ {
+ printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
+ error = TRUE;
+ break;
+
+ }
+ mtBktInfo[bktIdx].blkSize = bktSz;
+ bktUpdtCnt++;
+ if(bktUpdtCnt == numBkts)
+ {
+ i++; /*done reading bkt info, start reading individual region info*/
+ bktUpdtCnt = 0;
+ }
+ break;
+ case 3: /*** INPUT: Region Id (ranges from 0 to numRegions-1) **/
+ sscanf(line,"%ld",(long *) ®Id);
+ if(regId >= mtMemoCfg.numRegions)
+ {
+ printf("\n Invalid Region Id, may be >= the No. of regions:%d\n",mtMemoCfg.numRegions);
#ifndef XEON_SPECIFIC_CHANGES
- error = TRUE;
+ error = TRUE;
#endif
- break;
- }
- mtMemoCfg.region[regId].regionId = regId;
- i++;
- break;
- case 4: /*** INPUT: BktId (ranges from 0 to numBkts-1), No. of blks ***/
- if(bktUpdtCnt < numBkts)
- {
- sscanf(line, "%ld %ld",(long *)&bktIdx, (long *)&bktNum);
- if(bktIdx >= numBkts)
- {
- printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
- error = TRUE;
- break;
-
- }
- if(bktIdx < MT_MAX_BKTS)
- {
- mtMemoCfg.region[regId].bkt[bktIdx].blkSize = mtBktInfo[bktIdx].blkSize;
- mtMemoCfg.region[regId].bkt[bktIdx].numBlks = bktNum;
- cfgRegInfo[regId].pools[bktIdx].type = SS_POOL_DYNAMIC;
- cfgRegInfo[regId].pools[bktIdx].size = mtBktInfo[bktIdx].blkSize - (sizeof(SsMblk)+sizeof(SsDblk));
- }
- bktUpdtCnt++;
- if(bktUpdtCnt == numBkts)
- {
- i++;
- bktUpdtCnt = 0;
- }
- }
- break;
- case 5: /* INPUT: Heapsize ***/
- sscanf(line, "%ld", (long *) &heapSz);
- mtMemoCfg.region[regId].heapsize = heapSz;
- regUpdtCnt++;
- if(regUpdtCnt != mtMemoCfg.numRegions)
- {
- i = 3;
- }
- else
- {
- i++;
- }
- break;
+ break;
+ }
+ mtMemoCfg.region[regId].regionId = regId;
+ i++;
+ break;
+ case 4: /*** INPUT: BktId (ranges from 0 to numBkts-1), No. of blks ***/
+ if(bktUpdtCnt < numBkts)
+ {
+ sscanf(line, "%ld %ld",(long *)&bktIdx, (long *)&bktNum);
+ if(bktIdx >= numBkts)
+ {
+ printf("\n Invalid Bucket Id, may be >= the No. of buckets:%ld\n",numBkts);
+ error = TRUE;
+ break;
+
+ }
+ if(bktIdx < MT_MAX_BKTS)
+ {
+ mtMemoCfg.region[regId].bkt[bktIdx].blkSize = mtBktInfo[bktIdx].blkSize;
+ mtMemoCfg.region[regId].bkt[bktIdx].numBlks = bktNum;
+ cfgRegInfo[regId].pools[bktIdx].type = SS_POOL_DYNAMIC;
+ cfgRegInfo[regId].pools[bktIdx].size = mtBktInfo[bktIdx].blkSize - (sizeof(SsMblk)+sizeof(SsDblk));
+ }
+ bktUpdtCnt++;
+ if(bktUpdtCnt == numBkts)
+ {
+ i++;
+ bktUpdtCnt = 0;
+ }
+ }
+ break;
+ case 5: /* INPUT: Heapsize ***/
+ sscanf(line, "%ld", (long *) &heapSz);
+ mtMemoCfg.region[regId].heapsize = heapSz;
+ regUpdtCnt++;
+ if(regUpdtCnt != mtMemoCfg.numRegions)
+ {
+ i = 3;
+ }
+ else
+ {
+ i++;
+ }
+ break;
#ifdef SS_LOCKLESS_MEMORY
- case 6:
- sscanf(line, "%ld", (long *) &numBkts);
- mtGlobMemoCfg.numBkts = numBkts;
+ case 6:
+ sscanf(line, "%ld", (long *) &numBkts);
+ mtGlobMemoCfg.numBkts = numBkts;
#ifndef XEON_SPECIFIC_CHANGES
- mtDynMemoCfg.numRegions = mtMemoCfg.numRegions;
+ mtDynMemoCfg.numRegions = mtMemoCfg.numRegions;
#endif
#ifdef XEON_SPECIFIC_CHANGES
- CM_LOG_DEBUG(CM_LOG_ID_MT, "numRegions = %d numBkts = %d\n",
- mtDynMemoCfg.numRegions, mtGlobMemoCfg.numBkts);
- for(idx = 0; idx < mtDynMemoCfg.numRegions; idx++)
+ CM_LOG_DEBUG(CM_LOG_ID_MT, "numRegions = %d numBkts = %d\n",
+ mtDynMemoCfg.numRegions, mtGlobMemoCfg.numBkts);
+ for(idx = 0; idx < mtDynMemoCfg.numRegions; idx++)
#else
- for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
+ for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
#endif
- {
- mtDynMemoCfg.region[idx].regionId = idx;
- mtDynMemoCfg.region[idx].numBkts = numBkts;
- }
-
- bktUpdtCnt = 0;
- i++;
- break;
-
- case 7:
- if(bktUpdtCnt < numBkts)
- {
- sscanf(line, "%ld %ld %ld %ld %ld %ld", (long *) &bktIdx,
- (long *) &bktSz, (long *) &bktNum,
- (long *) &bktSetSize, (long *) &bktRelThr,
- (long *) &bktAqurThr);
- /* Klock work fix ccpu00148484 */
- if(bktIdx < SS_MAX_POOLS_PER_REG)
- {
- mtGlobMemoCfg.bkt[bktIdx].blkSize = bktSz;
- mtGlobMemoCfg.bkt[bktIdx].numBlks = bktNum;
- mtGlobMemoCfg.bkt[bktIdx].bucketSetSize = bktSetSize;
+ {
+ mtDynMemoCfg.region[idx].regionId = idx;
+ mtDynMemoCfg.region[idx].numBkts = numBkts;
+ }
+
+ bktUpdtCnt = 0;
+ i++;
+ break;
+
+ case 7:
+ if(bktUpdtCnt < numBkts)
+ {
+ sscanf(line, "%ld %ld %ld %ld %ld %ld", (long *) &bktIdx,
+ (long *) &bktSz, (long *) &bktNum,
+ (long *) &bktSetSize, (long *) &bktRelThr,
+ (long *) &bktAqurThr);
+ /* Klock work fix ccpu00148484 */
+ if(bktIdx < SS_MAX_POOLS_PER_REG)
+ {
+ mtGlobMemoCfg.bkt[bktIdx].blkSize = bktSz;
+ mtGlobMemoCfg.bkt[bktIdx].numBlks = bktNum;
+ mtGlobMemoCfg.bkt[bktIdx].bucketSetSize = bktSetSize;
#ifdef XEON_SPECIFIC_CHANGES
- CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSize %d numBlks %d bucketSetSize %d\n",
- bktUpdtCnt, mtGlobMemoCfg.bkt[bktIdx].blkSize,
- mtGlobMemoCfg.bkt[bktIdx].numBlks, mtGlobMemoCfg.bkt[bktIdx].bucketSetSize);
+ CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSize %d numBlks %d bucketSetSize %d\n",
+ bktUpdtCnt, mtGlobMemoCfg.bkt[bktIdx].blkSize,
+ mtGlobMemoCfg.bkt[bktIdx].numBlks, mtGlobMemoCfg.bkt[bktIdx].bucketSetSize);
- if(bktIdx >= SS_MAX_POOLS_PER_REG)
- {
- printf("\nNo. of Buckets/pools are > SS_MAX_POOLS_PER_REG:%d\n",SS_MAX_POOLS_PER_REG);
- error = TRUE;
- break;
- }
+ if(bktIdx >= SS_MAX_POOLS_PER_REG)
+ {
+ printf("\nNo. of Buckets/pools are > SS_MAX_POOLS_PER_REG:%d\n",SS_MAX_POOLS_PER_REG);
+ error = TRUE;
+ break;
+ }
#endif
- for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
- {
- mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold = bktRelThr;
- mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold = bktAqurThr;
+ for(idx = 0; idx < mtMemoCfg.numRegions; idx++)
+ {
+ mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold = bktRelThr;
+ mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold = bktAqurThr;
#ifdef XEON_SPECIFIC_CHANGES
- CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSetRelThreshold %d blkSetAcquireThreshold %d\n",
- bktUpdtCnt, mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold,
- mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold);
+ CM_LOG_DEBUG(CM_LOG_ID_MT, "Pool [%d] blkSetRelThreshold %d blkSetAcquireThreshold %d\n",
+ bktUpdtCnt, mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetRelThreshold,
+ mtDynMemoCfg.region[idx].bkt[bktIdx].blkSetAcquireThreshold);
#endif
- }
- }
- bktUpdtCnt++;
- }
+ }
+ }
+ bktUpdtCnt++;
+ }
#ifdef XEON_SPECIFIC_CHANGES
- if(bktUpdtCnt == numBkts)
- {
- i=8;
- }
- break;
-
- case 8: /* INPUT: Global Heapsize ***/
- sscanf(line, "%ld", (long *) &heapSz);
- mtGlobMemoCfg.heapSize = heapSz;
- CM_LOG_DEBUG(CM_LOG_ID_MT, "Global Heap size = %d\n", mtGlobMemoCfg.heapSize);
+ if(bktUpdtCnt == numBkts)
+ {
+ i=8;
+ }
+ break;
+
+ case 8: /* INPUT: Global Heapsize ***/
+ sscanf(line, "%ld", (long *) &heapSz);
+ mtGlobMemoCfg.heapSize = heapSz;
+ CM_LOG_DEBUG(CM_LOG_ID_MT, "Global Heap size = %d\n", mtGlobMemoCfg.heapSize);
#endif
- break;
+ break;
#endif
- }
- }
- if(error == TRUE)
- {
- memConfigured = FALSE;
- }
- else
- {
- memConfigured = TRUE;
- }
- fclose (memOpt);
- break;
+ }
+ }
+ if(error == TRUE)
+ {
+ memConfigured = FALSE;
+ }
+ else
+ {
+ memConfigured = TRUE;
+ }
+ fclose (memOpt);
+ break;
#endif
- case 's':
-/* mt028.201: modification: multiple procs support related changes */
+ case 's':
+ /* mt028.201: modification: multiple procs support related changes */
#ifndef SS_MULTIPLE_PROCS
#ifdef ENB_RELAY
- osCp.procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
+ osCp.procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
#else
- osCp.procId = (ProcId) strtol(msOptArg, NULLP, 0);
+ osCp.procId = (ProcId) strtol(msOptArg, NULLP, 0);
#endif
#else /* SS_MULTIPLE_PROCS */
- {
- ProcId procId;
+ {
+ ProcId procId;
#ifdef ENB_RELAY
- procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
+ procId = PID_STK((ProcId) strtol(msOptArg, NULLP, 0));
#else
- procId = (ProcId) strtol(msOptArg, NULLP, 0);
+ procId = (ProcId) strtol(msOptArg, NULLP, 0);
#endif
- SAddProcIdLst(1, &procId);
- }
+ SAddProcIdLst(1, &procId);
+ }
#endif /* SS_MULTIPLE_PROCS */
- break;
+ break;
- case 'c':
- osCp.configFilePath = msOptArg;
- break;
+ case 'c':
+ osCp.configFilePath = msOptArg;
+ break;
- case '?':
- /* fall through */
+ case '?':
+ /* fall through */
- default:
- break;
+ default:
+ break;
}
}
\f
/*
-*
-* Fun: SGetOpt
-*
-* Desc: Get options from command line
-*
-* Ret: option - success
-* '?' - fail
-* EOF - end of options
-*
-* Notes: Handles command lines like the following
-*
-* if opts = "abc:d"
-* then command line should look like this...
-* -a foo -b foo1 -c -d foo
-*
-* code usage:
-*
-* while ((ret = SGetOpt(msArgc, msArgv, "ls")) != EOF )
-* {
-* switch(ret)
-* {
-* case 'l':
-* nloops = atoi(msArgv[msOptInd]);
-* break;
-* case 's':
-* state1 = atoi(msArgv[msOptInd]);
-* case '?':
-* default:
-* break;
-* }
-* }
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetOpt
+ *
+ * Fun: SGetOpt
+ *
+ * Desc: Get options from command line
+ *
+ * Ret: option - success
+ * '?' - fail
+ * EOF - end of options
+ *
+ * Notes: Handles command lines like the following
+ *
+ * if opts = "abc:d"
+ * then command line should look like this...
+ * -a foo -b foo1 -c -d foo
+ *
+ * code usage:
+ *
+ * while ((ret = SGetOpt(msArgc, msArgv, "ls")) != EOF )
+ * {
+ * switch(ret)
+ * {
+ * case 'l':
+ * nloops = atoi(msArgv[msOptInd]);
+ * break;
+ * case 's':
+ * state1 = atoi(msArgv[msOptInd]);
+ * case '?':
+ * default:
+ * break;
+ * }
+ * }
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetOpt
(
-int argc, /* argument count */
-char **argv, /* argument value */
-char *opts /* options */
-)
+ int argc, /* argument count */
+ char **argv, /* argument value */
+ char *opts /* options */
+ )
{
/* mt020.201 - Removed for no command line */
#ifndef NOCMDLINE
sp = 1;
if (sp == 1)
{
- /*mt013.301 : Changes as per coding standards*/
+ /*mt013.301 : Changes as per coding standards*/
if (msOptInd >= (S16) argc || argv[msOptInd][0] == '\0')
{
- return (EOF);
+ return (EOF);
}
else
{
- if (!strcmp(argv[msOptInd], "--"))
- {
- msOptInd++;
- return (EOF);
- }
- else if (argv[msOptInd][0] != '-')
- {
- msOptInd++;
- return ('?');
- }
+ if (!strcmp(argv[msOptInd], "--"))
+ {
+ msOptInd++;
+ return (EOF);
+ }
+ else if (argv[msOptInd][0] != '-')
+ {
+ msOptInd++;
+ return ('?');
+ }
}
}
{
if (argv[msOptInd][++sp] == '\0')
{
- msOptInd++;
- sp = 1;
+ msOptInd++;
+ sp = 1;
}
return ('?');
if (argv[msOptInd][sp+1] != '\0') msOptArg = &argv[msOptInd++][sp+1];
else
{
- if (++msOptInd >= (S16) argc)
- {
- sp = 1;
- return ('?');
- }
- else msOptArg = argv[msOptInd++];
-
- sp = 1;
+ if (++msOptInd >= (S16) argc)
+ {
+ sp = 1;
+ return ('?');
+ }
+ else msOptArg = argv[msOptInd++];
+
+ sp = 1;
}
}
else
{
if (argv[msOptInd][++sp] == '\0')
{
- sp = 1;
- msOptInd++;
+ sp = 1;
+ msOptInd++;
}
msOptArg = NULLP;
\f
/*
-*
-* Fun: ssdStart
-*
-* Desc: This function starts system services execution; the
-* permanent tasks are started and the system enters a
-* ready state.
-*
-* Ret: Void
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdStart
+ *
+ * Desc: This function starts system services execution; the
+ * permanent tasks are started and the system enters a
+ * ready state.
+ *
+ * Ret: Void
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void ssdStart(void)
{
S16 i;
\f
/*
-* indirect interface functions to system services service user
-*/
+ * indirect interface functions to system services service user
+ */
\f
/*
-*
-* Fun: ssdAttachTTsk
-*
-* Desc: This function sends the initial tick message to a TAPA
-* task if the task is a permanent task.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdAttachTTsk
+ *
+ * Fun: ssdAttachTTsk
+ *
+ * Desc: This function sends the initial tick message to a TAPA
+ * task if the task is a permanent task.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdAttachTTsk
(
-SsTTskEntry *tTsk /* pointer to TAPA task entry */
-)
+ SsTTskEntry *tTsk /* pointer to TAPA task entry */
+ )
{
Buffer *mBuf;
SsMsgInfo *mInfo;
if (ret != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT001, ret, "SGetMsg() failed");
+ MTLOGERROR(ERRCLS_DEBUG, EMT001, ret, "SGetMsg() failed");
#endif
- return RFAILED;
+ return RFAILED;
}
mInfo = (SsMsgInfo *)mBuf->b_rptr;
mInfo->eventInfo.event = SS_EVNT_PERMTICK;
/* set up post structure */
-/* mt028.201: modification: multiple procs support related changes */
+ /* mt028.201: modification: multiple procs support related changes */
#ifndef SS_MULTIPLE_PROCS
mInfo->pst.dstProcId = SFndProcId();
mInfo->pst.srcProcId = SFndProcId();
mInfo->pst.srcInst = tTsk->inst;
ret = ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
- (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR3);
+ (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR3);
if (ret != ROK)
{
- SPutMsg(mBuf);
+ SPutMsg(mBuf);
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT002, ret,
- "Could not write to demand queue");
+ MTLOGERROR(ERRCLS_DEBUG, EMT002, ret,
+ "Could not write to demand queue");
#endif
- return RFAILED;
+ return RFAILED;
}
}
\f
/*
-*
-* Fun: ssdDetachTTsk
-*
-* Desc: Does nothing.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdDetachTTsk
+ *
+ * Fun: ssdDetachTTsk
+ *
+ * Desc: Does nothing.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdDetachTTsk
(
-SsTTskEntry *tTsk /* pointer to TAPA task entry */
-)
+ SsTTskEntry *tTsk /* pointer to TAPA task entry */
+ )
{
return ROK;
\f
/*
-*
-* Fun: ssdCreateSTsk
-*
-* Desc: This function creates a system task. A thread is started
-* on the system task handler function defined later.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdCreateSTsk
+ *
+ * Fun: ssdCreateSTsk
+ *
+ * Desc: This function creates a system task. A thread is started
+ * on the system task handler function defined later.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdCreateSTsk
(
-SsSTskEntry *sTsk /* pointer to system task entry */
-)
+ SsSTskEntry *sTsk /* pointer to system task entry */
+ )
{
S16 ret;
pthread_attr_t attr;
#ifdef SS_SINGLE_THREADED
-/* mt001.301 : Additions */
+ /* mt001.301 : Additions */
#ifndef SS_WATCHDOG
#ifdef SS_MULTICORE_SUPPORT
if (osCp.numSTsks > 1)
#else
- if (osCp.numSTsks > 0)
+ if (osCp.numSTsks > 0)
#endif /* SS_MULTICORE_SUPPORT */
#else
#ifdef SS_MULTICORE_SUPPORT
- if (osCp.numSTsks > 3)
+ if (osCp.numSTsks > 3)
#else
- if (osCp.numSTsks > 2)
+ if (osCp.numSTsks > 2)
#endif /* SS_MULTICORE_SUPPORT */
#endif /* SS_WATCHDOG */
- {
- return ROK;
- }
+ {
+ return ROK;
+ }
#endif
pthread_attr_init(&attr);
ssdSetPthreadAttr(sTsk->tskPrior, &attr);
- printf("Creating thread here %s %d\n", __FILE__, __LINE__);
+ printf("\nCreating thread here %s %d\n", __FILE__, __LINE__);
#ifdef TENB_T2K3K_SPECIFIC_CHANGES
if (sTsk->tskPrior == 0)
{
- printf("Creating RT thread #######################\n");
+ printf("\nCreating RT thread #######################\n");
#ifdef SS_THR_REG_MAP
/* When the thread is created, we check for the memory mapping table if
* threadId can be placed in thread memory map table. If it is not able to place
while(threadCreated == FALSE)
{
#endif
- 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);
+ ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk);
+ if (ret != 0)
+ {
+ DU_LOG("\nDU APP : Failed to create thread. Cause[%d]",ret);
+ pthread_attr_destroy(&attr);
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
+ MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
#endif
- return RFAILED;
- }
+ return RFAILED;
+ }
#ifdef SS_THR_REG_MAP
- threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId,
- sTsk->region);
+ threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId,
+ sTsk->region);
}
#endif
}
while(threadCreated == FALSE)
{
#endif
- ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk);
- if (ret != 0)
- {
+ ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk);
+ if (ret != 0)
+ {
- /* mt020.201 - Addition for destroying thread attribute object attr */
- pthread_attr_destroy(&attr);
+ /* mt020.201 - Addition for destroying thread attribute object attr */
+ pthread_attr_destroy(&attr);
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
+ MTLOGERROR(ERRCLS_DEBUG, EMT004, ERRZERO, "Could not create thread");
#endif
- return RFAILED;
- }
+ return RFAILED;
+ }
#ifdef SS_THR_REG_MAP
- threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId,
- sTsk->region);
+ threadCreated = ssCheckAndAddMemoryRegionMap(sTsk->dep.tId,
+ sTsk->region);
}
#endif
}
-/*mt013.301 :Added SS_AFFINITY_SUPPORT */
+ /*mt013.301 :Added SS_AFFINITY_SUPPORT */
#if defined(SS_MULTICORE_SUPPORT) ||defined(SS_AFFINITY_SUPPORT)
{
- static uint32_t stLwpId = 3;
- sTsk->dep.lwpId = ++stLwpId;
+ static uint32_t stLwpId = 3;
+ sTsk->dep.lwpId = ++stLwpId;
}
#endif /* SS_MULTICORE_SUPPORT || SS_AFFINITY_SUPPORT */
}
-int SCreatePThread
+ int SCreatePThread
(
-pthread_t* tid,
-pthread_attr_t* attr,
-void *(*start_routine) (void *),
-void* arg
-)
+ pthread_t* tid,
+ pthread_attr_t* attr,
+ void *(*start_routine) (void *),
+ void* arg
+ )
{
int retVal = 0;
#ifdef SS_THR_REG_MAP
}
threadArg->argument = arg;
threadArg->start_routine = start_routine;
-
- printf("Creating thread here %s %d\n", __FILE__, __LINE__);
+
+ printf("\nCreating thread here %s %d\n", __FILE__, __LINE__);
{
#ifdef SS_THR_REG_MAP
/* When the thread is created, we check for the memory mapping table if
while(threadCreated == FALSE)
{
#endif
- /*pthreadCreateHdlr */
- if (((retVal = pthread_create(tid, attr, pthreadCreateHdlr, threadArg))) != 0)
- {
+ /*pthreadCreateHdlr */
+ if (((retVal = pthread_create(tid, attr, pthreadCreateHdlr, threadArg))) != 0)
+ {
- return (retVal);
- }
+ return (retVal);
+ }
#ifdef SS_THR_REG_MAP
- threadCreated = ssCheckAndAddMemoryRegionMap(*tid, SS_MAX_REGS - 1);
+ threadCreated = ssCheckAndAddMemoryRegionMap(*tid, SS_MAX_REGS - 1);
}
#endif
}
/*
-*
-* Fun: Set Pthread Attributes
-*
-* Desc: This function is used to set various explicit
-* pthread attributes like, priority scheduling,etc
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-
-static S16 ssdSetPthreadAttr
+ *
+ * Fun: Set Pthread Attributes
+ *
+ * Desc: This function is used to set various explicit
+ * pthread attributes like, priority scheduling,etc
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+
+ static S16 ssdSetPthreadAttr
(
-S32 tskPrior,
-pthread_attr_t *attr
-)
+ S32 tskPrior,
+ pthread_attr_t *attr
+ )
{
struct sched_param param;
/* TODO:: This can be avoided by reducing the priority
* of iccserv thread in l1_master.sh*/
#ifdef L2_L3_SPLIT
- if (clusterMode == RADIO_CLUSTER_MODE)
- {
- if(tskPrior == PRIOR1)
- {/* DL RLC */
- param.sched_priority = 91;
- }
- }
+ if (clusterMode == RADIO_CLUSTER_MODE)
+ {
+ if(tskPrior == PRIOR1)
+ {/* DL RLC */
+ param.sched_priority = 91;
+ }
+ }
#endif
#endif
- printf("Set priority %u\n", param.sched_priority);
+ printf("\nSet priority %u\n", param.sched_priority);
/* Set Scheduler to explicit, without this non of the below
pthread attr works */
#if defined(SS_MULTICORE_SUPPORT) ||defined(SS_AFFINITY_SUPPORT)
/*
-*
-* Fun: Get the current core/cpu affinity for a thread/lwp
-*
-* Desc: This function is used to get the current processor/core
-* affinity for a a system task (thread/lwp). It sets the
-* affinity based on the mode supplied by the caller.
-*
-* Ret: ROK - ok
-* RFAILED - failed, general (optional)
-*
-* Notes:
-*
-* File: ss_task.c
-*
-*/
-S16 ssdGetAffinity
+ *
+ * Fun: Get the current core/cpu affinity for a thread/lwp
+ *
+ * Desc: This function is used to get the current processor/core
+ * affinity for a a system task (thread/lwp). It sets the
+ * affinity based on the mode supplied by the caller.
+ *
+ * Ret: ROK - ok
+ * RFAILED - failed, general (optional)
+ *
+ * Notes:
+ *
+ * File: ss_task.c
+ *
+ */
+ S16 ssdGetAffinity
(
-SSTskId *tskId, /* filled in with system task ID */
-uint32_t *coreId /* the core/processor id to which the affinity is set */
-)
+ SSTskId *tskId, /* filled in with system task ID */
+ uint32_t *coreId /* the core/processor id to which the affinity is set */
+ )
{
uint32_t tskInd;
{
if (osCp.sTskTbl[tskInd].tskId == *tskId)
{
- tId = osCp.sTskTbl[tskInd].dep.tId;
- break;
+ tId = osCp.sTskTbl[tskInd].dep.tId;
+ break;
} /* end if */
} /* end for */
/* if tskId is not found in the tskTbl */
if (tskInd == SS_MAX_STSKS)
{
- MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
- return RFAILED;
+ MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
+ return RFAILED;
}
CPU_ZERO( &cpuSet);
/* set thread affinity for linux */
- if (pthread_getaffinity_np(tId, sizeof(cpuSet), &cpuSet) < 0)
- {
+ if (pthread_getaffinity_np(tId, sizeof(cpuSet), &cpuSet) < 0)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT037, ERRZERO, "Could not get thread affinity\n");
+ MTLOGERROR(ERRCLS_DEBUG, EMT037, ERRZERO, "Could not get thread affinity\n");
#endif
- return RFAILED;
- } /* end if pthread_setaffinity fails */
+ return RFAILED;
+ } /* end if pthread_setaffinity fails */
for (cpuInd = 0; cpuInd <CPU_SETSIZE; cpuInd++)
{
- if (CPU_ISSET (cpuInd, & cpuSet))
- {
- *coreId = cpuInd;
- break;
- } /* end if */
+ if (CPU_ISSET (cpuInd, & cpuSet))
+ {
+ *coreId = cpuInd;
+ break;
+ } /* end if */
} /* end for */
#else
{
if (osCp.sTskTbl[tskInd].tskId == *tskId)
{
- lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
- break;
+ lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
+ break;
} /* end if */
} /* end for */
/* if tskId is not found in the tskTbl */
if (tskInd == SS_MAX_STSKS)
{
- MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
- return RFAILED;
+ MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
+ return RFAILED;
}
/* set thread affinity for Solaris */
/*
-*
-* Fun: Set the core/cpu affinity for a thread/lwp
-*
-* Desc: This function is used to set processor/core affinity for a
-* a system task (thread/lwp). It sets the affinity based on the
-* mode supplied by the caller.
-*
-* Ret: ROK - ok
-* RFAILED - failed, general (optional)
-*
-* Notes:
-*
-* File: ss_task.c
-*
-*/
-S16 ssdSetAffinity
+ *
+ * Fun: Set the core/cpu affinity for a thread/lwp
+ *
+ * Desc: This function is used to set processor/core affinity for a
+ * a system task (thread/lwp). It sets the affinity based on the
+ * mode supplied by the caller.
+ *
+ * Ret: ROK - ok
+ * RFAILED - failed, general (optional)
+ *
+ * Notes:
+ *
+ * File: ss_task.c
+ *
+ */
+ S16 ssdSetAffinity
(
-SSTskId *tskId, /* filled in with system task ID */
-uint32_t coreId /* the core/processor id to which the affinity has to be set */
-)
+ SSTskId *tskId, /* filled in with system task ID */
+ uint32_t coreId /* the core/processor id to which the affinity has to be set */
+ )
{
uint32_t tskInd = 0;
#ifdef SS_LINUX
for (tskInd = 0; tskInd < SS_MAX_STSKS; tskInd++)
{
- /* Here tskId can not be used as index as the task may be terminated if
- there is a TERM even for that tsk, thus breaking the task Id numbering
- sequence */
+ /* Here tskId can not be used as index as the task may be terminated if
+ there is a TERM even for that tsk, thus breaking the task Id numbering
+ sequence */
if (osCp.sTskTbl[tskInd].tskId == *tskId)
{
- tId = osCp.sTskTbl[tskInd].dep.tId;
- break;
+ tId = osCp.sTskTbl[tskInd].dep.tId;
+ break;
} /* end if */
} /* end for */
/* if tskId is not found in the tskTbl */
if (tskInd == SS_MAX_STSKS)
{
- MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
- return RFAILED;
+ MTLOGERROR(ERRCLS_DEBUG, EMT036, ERRZERO, "Invalid system task Id\n");
+ return RFAILED;
}
/* initialize the cpu mask */
/* comment: modify to use tskId as lwpId to avoid the loop and the new lwpId variable in dep */
if (osCp.sTskTbl[tskInd].tskId == *tskId)
{
- lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
- break;
+ lwpId = osCp.sTskTbl[tskInd].dep.lwpId;
+ break;
} /* end if */
} /* end for */
\f
/*
-*
-* Fun: ssdDestroySTsk
-*
-* Desc: This function destroys a system task. A terminate
-* event message is sent to the thread function.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdDestroySTsk
+ *
+ * Fun: ssdDestroySTsk
+ *
+ * Desc: This function destroys a system task. A terminate
+ * event message is sent to the thread function.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdDestroySTsk
(
-SsSTskEntry *sTsk /* pointer to system task entry */
-)
+ SsSTskEntry *sTsk /* pointer to system task entry */
+ )
{
Buffer *mBuf;
SsMsgInfo *mInfo;
#if (ERRCLASS & ERRCLASS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT006, ERRZERO,
- "Could not write to demand queue");
+ "Could not write to demand queue");
#endif
return RFAILED;
}
/* mt023.201 - Added SThreadYield function to yield CPU
-*
-* Fun: SThreadYield
-*
-* Desc: This function defers thread execution to any other ready
-* thread.
-*
-* Ret: ROK - ok
-* RFAILED - failure
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 SThreadYield(void)
-{
-
-
-/* mt024.201 - seperated Linux and other UNIX implementations
- */
-#ifdef SS_LINUX
- {
- struct timeval tw;
+ *
+ * Fun: SThreadYield
+ *
+ * Desc: This function defers thread execution to any other ready
+ * thread.
+ *
+ * Ret: ROK - ok
+ * RFAILED - failure
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+S16 SThreadYield(void)
+{
+
+
+ /* mt024.201 - seperated Linux and other UNIX implementations
+ */
+#ifdef SS_LINUX
+ {
+ struct timeval tw;
/* Set sleep value to 0 to yield CPU */
tw.tv_sec=0;
\f
/*
-*
-* Fun: Register timer
-*
-* Desc: This function is used to register a timer
-* function for the service user. System services
-* will invoke the timer activation function
-* passed to it at the specified intervals.
-*
-* Ret: ROK - ok
-*
-* Notes: Timing is handled by the common timers. The
-* ticks are handled by a thread that uses
-* nanosleep() and thus timing precision will not
-* be very accurate.
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdRegTmr
+ *
+ * Fun: Register timer
+ *
+ * Desc: This function is used to register a timer
+ * function for the service user. System services
+ * will invoke the timer activation function
+ * passed to it at the specified intervals.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Timing is handled by the common timers. The
+ * ticks are handled by a thread that uses
+ * nanosleep() and thus timing precision will not
+ * be very accurate.
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdRegTmr
(
-SsTmrEntry *tmr /* pointer to timer entry */
-)
+ SsTmrEntry *tmr /* pointer to timer entry */
+ )
{
CmTmrArg arg;
\f
/*
-*
-* Fun: Deregister timer
-*
-* Desc: This function is used to deregister a timer function.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdDeregTmr
+ *
+ * Fun: Deregister timer
+ *
+ * Desc: This function is used to deregister a timer function.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdDeregTmr
(
-SsTmrEntry *tmr /* pointer to timer entry */
-)
+ SsTmrEntry *tmr /* pointer to timer entry */
+ )
{
CmTmrArg arg;
\f
/*
-*
-* Fun: Critical error
-*
-* Desc: This function is called when a critical error occurs.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdError
+ *
+ * Fun: Critical error
+ *
+ * Desc: This function is called when a critical error occurs.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdError
(
-Seq seq, /* sequence number */
-Reason reason /* reset reason */
-)
+ Seq seq, /* sequence number */
+ Reason reason /* reset reason */
+ )
{
S16 i;
pthread_t tId;
/* set up the message to display */
sprintf(errBuf, "\n\nFATAL ERROR - taskid = %x, errno = %d,"
- "reason = %d\n\n", (uint8_t)tId, seq, reason);
+ "reason = %d\n\n", (uint8_t)tId, seq, reason);
SPrint(errBuf);
for (i = 0; i < SS_MAX_STSKS; i++)
{
if (osCp.sTskTbl[i].used
- && !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
+ && !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
{
- pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
+ pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
}
}
\f
/*
-*
-* Fun: Log error
-*
-* Desc: This function is called to log an error.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-Void ssdLogError
+ *
+ * Fun: Log error
+ *
+ * Desc: This function is called to log an error.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ Void ssdLogError
(
-Ent ent, /* Calling layer's entity id */
-Inst inst, /* Calling layer's instance id */
-ProcId procId, /* Calling layer's processor id */
-Txt *file, /* file name where error occured */
-S32 line, /* line in file where error occured */
-ErrCls errCls, /* error class */
-ErrCode errCode, /* layer unique error code */
-ErrVal errVal, /* error value */
-Txt *errDesc /* description of error */
-)
+ Ent ent, /* Calling layer's entity id */
+ Inst inst, /* Calling layer's instance id */
+ ProcId procId, /* Calling layer's processor id */
+ Txt *file, /* file name where error occured */
+ S32 line, /* line in file where error occured */
+ ErrCls errCls, /* error class */
+ ErrCode errCode, /* layer unique error code */
+ ErrVal errVal, /* error value */
+ Txt *errDesc /* description of error */
+ )
{
#ifndef DEBUGNOEXIT
S16 i;
switch(errCls)
{
case ERRCLS_ADD_RES:
- errClsMsg = "ERRCLS_ADD_RES";
- break;
+ errClsMsg = "ERRCLS_ADD_RES";
+ break;
case ERRCLS_INT_PAR:
- errClsMsg = "ERRCLS_INT_PAR";
- break;
+ errClsMsg = "ERRCLS_INT_PAR";
+ break;
case ERRCLS_DEBUG:
- errClsMsg = "ERRCLS_DEBUG";
- break;
+ errClsMsg = "ERRCLS_DEBUG";
+ break;
-/* mt028.201 : Addition - ERRCLS_FTHA changes */
+ /* mt028.201 : Addition - ERRCLS_FTHA changes */
case ERRCLS_FTHA:
- errClsMsg = "ERRCLS_FTHA";
- break;
+ errClsMsg = "ERRCLS_FTHA";
+ break;
default:
- errClsMsg = "INVALID ERROR CLASS!";
- break;
+ errClsMsg = "INVALID ERROR CLASS!";
+ break;
}
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(errBuf,
- "\nmtss(posix): sw error: ent: %03d inst: %03d proc id: %03d \n"
- "file: %s line: %03d errcode: %05d errcls: %s\n"
- "errval: %05d errdesc: %s\n",
- ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
+ "\nmtss(posix): sw error: ent: %03d inst: %03d proc id: %03d \n"
+ "file: %s line: %03d errcode: %05d errcls: %s\n"
+ "errval: %05d errdesc: %s\n",
+ ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
#else
sprintf(errBuf,
- "\nmtss(posix): sw error: ent: %03d inst: %03d proc id: %03d \n"
- "file: %s line: %03ld errcode: %05ld errcls: %s\n"
- "errval: %05ld errdesc: %s\n",
- ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
+ "\nmtss(posix): sw error: ent: %03d inst: %03d proc id: %03d \n"
+ "file: %s line: %03ld errcode: %05ld errcls: %s\n"
+ "errval: %05ld errdesc: %s\n",
+ ent, inst, procId, file, line, errCode, errClsMsg, errVal, errDesc);
#endif
SDisplay(0, errBuf);
-/* mt001.301 : Additions */
+ /* mt001.301 : Additions */
#ifdef SS_LOGGER_SUPPORT
SWrtLogBuf(errBuf);
#endif /* SS_LOGGER_SUPPORT */
/* debug errors halt the system */
if (errCls == ERRCLS_DEBUG)
{
-/* mt001.301 : Additions */
+ /* mt001.301 : Additions */
#ifdef SS_LOGGER_SUPPORT
- SCleanUp();
+ SCleanUp();
#endif /* SS_LOGGER_SUPPORT */
/* delete all system tasks */
for (i = 0; i < SS_MAX_STSKS; i++)
{
- if (osCp.sTskTbl[i].used
- && !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
- {
- pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
- }
+ if (osCp.sTskTbl[i].used
+ && !pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
+ {
+ pthread_kill(osCp.sTskTbl[i].dep.tId, SIGKILL);
+ }
}
#ifdef ENB_RELAY
\f
/*
-*
-* Fun: Register driver task
-*
-* Desc: This function is called to register the handlers for a
-* driver task.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdRegDrvrTsk
+ *
+ * Fun: Register driver task
+ *
+ * Desc: This function is called to register the handlers for a
+ * driver task.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdRegDrvrTsk
(
-SsDrvrTskEntry *drvrTsk /* driver task entry */
-)
+ SsDrvrTskEntry *drvrTsk /* driver task entry */
+ )
{
}
/* mt001.30 : Additions */
/*
-*
-* Fun: Deregister driver task
-*
-* Desc: This function is called to deregister the handlers for a
-* driver task.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 ssdDeregDrvrTsk
+ *
+ * Fun: Deregister driver task
+ *
+ * Desc: This function is called to deregister the handlers for a
+ * driver task.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 ssdDeregDrvrTsk
(
-SsDrvrTskEntry *drvrTsk /* driver task entry */
-)
+ SsDrvrTskEntry *drvrTsk /* driver task entry */
+ )
{
* mt003.301 Additions - SDeRegTTsk fix
*/
#ifdef SS_MULTIPLE_PROCS
-S16 ssdProcTTskTerm
+ S16 ssdProcTTskTerm
(
-ProcId procIdx,
-SsTTskEntry *tTsk,
-SsIdx idx
-)
+ ProcId procIdx,
+ SsTTskEntry *tTsk,
+ SsIdx idx
+ )
#else /*SS_MULTIPLE_PROCS*/
-S16 ssdProcTTskTerm
+ S16 ssdProcTTskTerm
(
-SsTTskEntry *tTsk,
-SsIdx idx
-)
+ SsTTskEntry *tTsk,
+ SsIdx idx
+ )
#endif /*SS_MULTIPLE_PROCS*/
{
#ifdef SS_MULTIPLE_PROCS
Inst inst;
SsSTskEntry *sTsk;
S16 n;
- S16 ret;
+ S16 ret;
ent = tTsk->ent;
inst = tTsk->inst;
- /* We check the sTsk element; if it is not NULLP, the
- * task is attached. So we have to detach it before
- * deregistering the task.
- */
+ /* We check the sTsk element; if it is not NULLP, the
+ * task is attached. So we have to detach it before
+ * deregistering the task.
+ */
ret = SLock(&osCp.sTskTblLock);
if (ret != ROK)
{
- MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not lock system task table");
- return RFAILED;
+ MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not lock system task table");
+ return RFAILED;
}
- SS_ACQUIRE_ALL_SEMA(&osCp.tTskTblSem, ret);
+ SS_ACQUIRE_ALL_SEMA(&osCp.tTskTblSem, ret);
if (ret != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
if ( SUnlock(&osCp.sTskTblLock) != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table");
- return RFAILED;
+ MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table");
+ return RFAILED;
#endif
}
{
#ifndef USE_MEMCAL
(Void)(*(tTsk->initTsk))(proc, ent, inst,
- DFLT_REGION,
- NRM_TERM,
- &(osCp.tTskTbl[idx].xxCb));
+ DFLT_REGION,
+ NRM_TERM,
+ &(osCp.tTskTbl[idx].xxCb));
#else
(Void)(*(tTsk->initTsk))(proc, ent, inst,
- SS_STATIC_REGION,
- NRM_TERM,
- &(osCp.tTskTbl[idx].xxCb));
+ SS_STATIC_REGION,
+ NRM_TERM,
+ &(osCp.tTskTbl[idx].xxCb));
#endif /* USE_MEMCAL */
}
#endif /* SS_MULTIPLE_PROCS */
for (n = 0; n < SS_MAX_TTSKS; n++)
{
- if (sTsk->tTsks[n] == idx)
- {
- sTsk->tTsks[n] = SS_INVALID_IDX;
- sTsk->numTTsks--;
- break;
- }
+ if (sTsk->tTsks[n] == idx)
+ {
+ sTsk->tTsks[n] = SS_INVALID_IDX;
+ sTsk->numTTsks--;
+ break;
+ }
}
- /* call the implementation to detach the task */
- ssdDetachTTsk(tTsk);
- /* 100178 */
- sTsk->dep.ent = ENTNC;
- sTsk->dep.inst = INSTNC;
+ /* call the implementation to detach the task */
+ ssdDetachTTsk(tTsk);
+ /* 100178 */
+ sTsk->dep.ent = ENTNC;
+ sTsk->dep.inst = INSTNC;
}
- /* Now we empty the entry for this task and update the table
- * information
- */
+ /* Now we empty the entry for this task and update the table
+ * information
+ */
#ifdef SS_MULTIPLE_PROCS
- osCp.tTskIds[procIdx][ent][inst] = SS_TSKNC;
+ osCp.tTskIds[procIdx][ent][inst] = SS_TSKNC;
#else /* SS_MULTIPLE_PROCS */
- osCp.tTskIds[ent][inst] = SS_TSKNC;
+ osCp.tTskIds[ent][inst] = SS_TSKNC;
#endif /* SS_MULTIPLE_PROCS */
- tTsk->used = FALSE;
+ tTsk->used = FALSE;
#ifdef SS_MULTIPLE_PROCS
- tTsk->proc = PROCNC;
+ tTsk->proc = PROCNC;
#endif /* SS_MULTIPLE_PROCS */
- tTsk->ent = ENTNC;
- tTsk->inst = INSTNC;
- tTsk->tskType = TTUND;
- tTsk->initTsk = NULLP;
- tTsk->actvTsk = NULLP;
- tTsk->sTsk = NULLP;
+ tTsk->ent = ENTNC;
+ tTsk->inst = INSTNC;
+ tTsk->tskType = TTUND;
+ tTsk->initTsk = NULLP;
+ tTsk->actvTsk = NULLP;
+ tTsk->sTsk = NULLP;
- tTsk->nxt = osCp.nxtTTskEntry;
- osCp.nxtTTskEntry = idx;
- osCp.numTTsks--;
+ tTsk->nxt = osCp.nxtTTskEntry;
+ osCp.nxtTTskEntry = idx;
+ osCp.numTTsks--;
#ifdef SS_MULTIPLE_PROCS
- /* mark the control block for this task as invalid */
- osCp.tTskTbl[idx].xxCb = NULLP;
+ /* mark the control block for this task as invalid */
+ osCp.tTskTbl[idx].xxCb = NULLP;
#endif
SS_RELEASE_ALL_SEMA(&osCp.tTskTblSem);
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMTXXX, ERRZERO, "Could not Unlock system task table");
#endif
- return RFAILED;
+ return RFAILED;
}
- return ROK;
+ return ROK;
}
//#ifndef SPLIT_RLC_DL_TASK
Void ysMtTskHdlr(Void);
Void ysMtPollPhyMsg(uint8_t region);
Void ysMtRcvPhyMsg(Void);
-Void *mtTskHdlrT2kL2
+ Void *mtTskHdlrT2kL2
(
-Ptr tskPtr /* pointer to task entry */
-)
+ Ptr tskPtr /* pointer to task entry */
+ )
{
S16 ret;
/* wait for SS to come up */
/* It is required to block on this semaphore before starting actual processing of
- the thread becasue the creator of this thread might want to cance it without
- doing any processing. When this semaphore is released, means the creator gives
- the go ahead for actual processing and we should never come back to this point */
+ the thread becasue the creator of this thread might want to cance it without
+ doing any processing. When this semaphore is released, means the creator gives
+ the go ahead for actual processing and we should never come back to this point */
while ((ret = sem_wait(&osCp.dep.ssStarted) != ROK) && (errno == EINTR))
continue;
while(1)
{
ysMtPollPhyMsg(0); /* blocks, waiting for messages for L2
- * (processes L1 msgs) */
- }
+ * (processes L1 msgs) */
+ }
- return (NULLP);
+ return (NULLP);
}
#else
Void ysMtTskHdlr(Void);
Void YsPhyRecvMsg();
-Void *mtTskHdlrT2kL2
+ Void *mtTskHdlrT2kL2
(
-Ptr tskPtr /* pointer to task entry */
-)
+ Ptr tskPtr /* pointer to task entry */
+ )
{
S16 ret;
SsSTskEntry *sTsk;
/* wait for SS to come up */
/* It is required to block on this semaphore before starting actual processing of
- the thread becasue the creator of this thread might want to cance it without
- doing any processing. When this semaphore is released, means the creator gives
- the go ahead for actual processing and we should never come back to this point */
+ the thread becasue the creator of this thread might want to cance it without
+ doing any processing. When this semaphore is released, means the creator gives
+ the go ahead for actual processing and we should never come back to this point */
while ((ret = sem_wait(&osCp.dep.ssStarted) != ROK) && (errno == EINTR))
continue;
YsPhyRecvMsg();
#else
ysMtTskHdlr(); /* blocks, waiting for messages for L2
- * (processes L1 msgs) */
+ * (processes L1 msgs) */
#endif
/* get a message from the demand queue */
/* RT Processing */
ret = mtTskHdlMsg(sTsk);
if (ret != ROK)
{
- /* exit the for loop here */
- break;
+ /* exit the for loop here */
+ break;
}
#if defined(SPLIT_RLC_DL_TASK) && defined(RLC_MAC_STA_RSP_RBUF)
- rgBatchProc();
+ rgBatchProc();
#endif
}
}
\f
/*
-*
-* Fun: Task handler
-*
-* Desc: This is the system task handler function. It blocks on
-* the system task's demand queue. On receiving a message,
-* it identifies the target TAPA task, verifies that the
-* TAPA task belongs to this system task and if so, calls
-* the activation function of that TAPA task with the
-* received message. The task activation function or the
-* timer activation function may be called.
-*
-* Ret: (thread function)
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-Void *mtTskHdlr
+ *
+ * Fun: Task handler
+ *
+ * Desc: This is the system task handler function. It blocks on
+ * the system task's demand queue. On receiving a message,
+ * it identifies the target TAPA task, verifies that the
+ * TAPA task belongs to this system task and if so, calls
+ * the activation function of that TAPA task with the
+ * received message. The task activation function or the
+ * timer activation function may be called.
+ *
+ * Ret: (thread function)
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ Void *mtTskHdlr
(
-Ptr tskPtr /* pointer to task entry */
-)
+ Ptr tskPtr /* pointer to task entry */
+ )
{
S16 ret = ROK;
SsSTskEntry *sTsk;
ret = ssDmndQWait(&sTsk->dQ);
#endif
if (ret != ROK)
- continue;
+ continue;
ret = mtTskHdlMsg(sTsk);
if (ret != ROK)
{
- break;
+ break;
}
}
\f
/*
-*
-* Fun: Task handler
-*
-* Desc: This is the system task handler function. It blocks on
-* the system task's demand queue. On receiving a message,
-* it identifies the target TAPA task, verifies that the
-* TAPA task belongs to this system task and if so, calls
-* the activation function of that TAPA task with the
-* received message. The task activation function or the
-* timer activation function may be called.
-*
-* Ret: (thread function)
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 mtTskHdlMsg
+ *
+ * Fun: Task handler
+ *
+ * Desc: This is the system task handler function. It blocks on
+ * the system task's demand queue. On receiving a message,
+ * it identifies the target TAPA task, verifies that the
+ * TAPA task belongs to this system task and if so, calls
+ * the activation function of that TAPA task with the
+ * received message. The task activation function or the
+ * timer activation function may be called.
+ *
+ * Ret: (thread function)
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 mtTskHdlMsg
(
-SsSTskEntry *sTsk
-)
+ SsSTskEntry *sTsk
+ )
{
S16 i =0;
S16 ret =0;
#endif
SsMsgInfo *mInfo=NULLP;
Pst nPst;
-/* mt028.201: modification: multiple procs support related changes */
+ /* mt028.201: modification: multiple procs support related changes */
#ifndef SS_MULTIPLE_PROCS
#ifdef SS_MT_TMR
PAIFTMRS16 tmrActvFnMt = NULLP;
PAIFTMRS16 tmrActvFn =NULLP;
uint16_t procIdIdx =0;
#endif /* SS_MULTIPLE_PROCS */
- /* mt003.301 Modifications */
+ /* mt003.301 Modifications */
#ifdef SS_THREAD_PROFILE
- EpcTime et1,et2;
+ EpcTime et1,et2;
#endif /* SS_THREAD_PROFILE */
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT007, (ErrVal) ret,
- "Could not lock system task entry");
+ "Could not lock system task entry");
#endif
SPutMsg(mBuf);
return ROK;
}
-/* mt034.201 */
+ /* mt034.201 */
#ifdef SS_PERF
do
{
#ifdef SS_MEM_WL_DEBUG
mtTskBuffer1 = mBuf2;
if(mBuf2)
- mtTskBuffer2 = mBuf2->b_next;
+ mtTskBuffer2 = mBuf2->b_next;
if(mInfo == 0x5050505)
{
- stopBtInfo = TRUE;
- SGlobMemInfoShow();
- cmAnalyseBtInfo((PTR) mBuf,4);
- SGlobMemInfoShow();
- printf("\n In trouble .... \n");
+ stopBtInfo = TRUE;
+ SGlobMemInfoShow();
+ cmAnalyseBtInfo((PTR) mBuf,4);
+ SGlobMemInfoShow();
+ printf("\n In trouble .... \n");
}
else if (mInfo == 0x2020202)
{
- stopBtInfo = TRUE;
- cmAnalyseBtInfo((PTR) mBuf,1);
- printf("\n In trouble .... \n");
+ stopBtInfo = TRUE;
+ cmAnalyseBtInfo((PTR) mBuf,1);
+ printf("\n In trouble .... \n");
}
#endif /* SS_MEM_WL_DEBUG */
switch (mInfo->eventInfo.event)
{
- /* this is a termination event, we die */
- case SS_EVNT_TERM:
- /* release the message */
- SPutMsg(mBuf);
+ /* this is a termination event, we die */
+ case SS_EVNT_TERM:
+ /* release the message */
+ SPutMsg(mBuf);
- /* Unlock the system task entry and lock the system
- * task table to clean our entry up.
- */
- SUnlock(&sTsk->lock);
+ /* Unlock the system task entry and lock the system
+ * task table to clean our entry up.
+ */
+ SUnlock(&sTsk->lock);
- ret = SLock(&osCp.sTskTblLock);
- if (ret != ROK)
- {
+ ret = SLock(&osCp.sTskTblLock);
+ if (ret != ROK)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT008, (ErrVal) ret,
- "Could not lock system task table");
-#endif
- /* what to do here? */
- return ROK;
- }
-
- /* clean up the system task entry */
- sTsk->used = FALSE;
- sTsk->tskPrior = 0;
- /* mt003.301 Modifications - SDeRegTTsk */
- /* sTsk->numTTsks = 0; */
- SDestroyLock(&sTsk->lock);
- ssDestroyDmndQ(&sTsk->dQ);
-
- /* lock for current executing TAPA task ID */
-
- /* make this entry available in the system task table */
- sTsk->nxt = osCp.nxtSTskEntry;
- for (i = 0; i < SS_MAX_STSKS; i++)
- {
- if (sTsk == &osCp.sTskTbl[i])
- {
- osCp.nxtSTskEntry = i;
- break;
- }
- }
-
- osCp.numSTsks--;
-
- /* unlock the system task table */
- SUnlock(&osCp.sTskTblLock);
-
- return RFAILED;
-
-
- /* this is a data message or a permanent task keep-alive message */
- case SS_EVNT_DATA:
- case SS_EVNT_PERMTICK:
- /* message to a task. find the destination task */
-/* mt028.201: modification: multiple procs support related changes */
+ MTLOGERROR(ERRCLS_DEBUG, EMT008, (ErrVal) ret,
+ "Could not lock system task table");
+#endif
+ /* what to do here? */
+ return ROK;
+ }
+
+ /* clean up the system task entry */
+ sTsk->used = FALSE;
+ sTsk->tskPrior = 0;
+ /* mt003.301 Modifications - SDeRegTTsk */
+ /* sTsk->numTTsks = 0; */
+ SDestroyLock(&sTsk->lock);
+ ssDestroyDmndQ(&sTsk->dQ);
+
+ /* lock for current executing TAPA task ID */
+
+ /* make this entry available in the system task table */
+ sTsk->nxt = osCp.nxtSTskEntry;
+ for (i = 0; i < SS_MAX_STSKS; i++)
+ {
+ if (sTsk == &osCp.sTskTbl[i])
+ {
+ osCp.nxtSTskEntry = i;
+ break;
+ }
+ }
+
+ osCp.numSTsks--;
+
+ /* unlock the system task table */
+ SUnlock(&osCp.sTskTblLock);
+
+ return RFAILED;
+
+
+ /* this is a data message or a permanent task keep-alive message */
+ case SS_EVNT_DATA:
+ case SS_EVNT_PERMTICK:
+ /* message to a task. find the destination task */
+ /* mt028.201: modification: multiple procs support related changes */
#ifdef SS_MULTIPLE_PROCS
- procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
+ procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
- if (procIdIdx == SS_INV_PROCID_IDX)
- {
- SPutMsg(mBuf);
- break;
- }
+ if (procIdIdx == SS_INV_PROCID_IDX)
+ {
+ SPutMsg(mBuf);
+ break;
+ }
- idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
+ idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
#else /* SS_MULTIPLE_PROCS */
- idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
+ idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
#endif /* SS_MULTIPLE_PROCS */
- /* verify that it hasn't been deregistered */
- if (idx == SS_TSKNC)
- {
- SPutMsg(mBuf);
- break;
- }
-
- /* verify that this system task is still running it */
- tTsk = &osCp.tTskTbl[idx];
- if (tTsk->sTsk != sTsk)
- {
- SPutMsg(mBuf);
- break;
- }
-
- /* set the current executing TAPA task ID */
- sTsk->dep.ent = mInfo->pst.dstEnt;
- sTsk->dep.inst = mInfo->pst.dstInst;
-
- /* copy the Pst structure into a local duplicate */
- for (i = 0; i < (S16) sizeof(Pst); i++)
- *(((uint8_t *)(&nPst)) + i) = *(((uint8_t *)&mInfo->pst) + i);
-
- /* Give the message to the task activation function. If
- * its a normal data message, we pass it, if this is a
- * keep-alive message for a permanent task then we pass
- * NULLP in place of the message to the task activation
- * function.
- */
- if (mInfo->eventInfo.event == SS_EVNT_DATA)
- {
+ /* verify that it hasn't been deregistered */
+ if (idx == SS_TSKNC)
+ {
+ SPutMsg(mBuf);
+ break;
+ }
+
+ /* verify that this system task is still running it */
+ tTsk = &osCp.tTskTbl[idx];
+ if (tTsk->sTsk != sTsk)
+ {
+ SPutMsg(mBuf);
+ break;
+ }
+
+ /* set the current executing TAPA task ID */
+ sTsk->dep.ent = mInfo->pst.dstEnt;
+ sTsk->dep.inst = mInfo->pst.dstInst;
+
+ /* copy the Pst structure into a local duplicate */
+ for (i = 0; i < (S16) sizeof(Pst); i++)
+ *(((uint8_t *)(&nPst)) + i) = *(((uint8_t *)&mInfo->pst) + i);
+
+ /* Give the message to the task activation function. If
+ * its a normal data message, we pass it, if this is a
+ * keep-alive message for a permanent task then we pass
+ * NULLP in place of the message to the task activation
+ * function.
+ */
+ if (mInfo->eventInfo.event == SS_EVNT_DATA)
+ {
#ifndef RGL_SPECIFIC_CHANGES
#ifdef SS_TSKLOG_ENABLE
- uint32_t t = MacGetTick();
+ uint32_t t = MacGetTick();
#endif
#endif
- /* mt003.301 Modifications */
+ /* mt003.301 Modifications */
#if SS_THREAD_PROFILE
- tTsk->curEvent = nPst.event;
- SGetEpcTime(&et1);
+ tTsk->curEvent = nPst.event;
+ SGetEpcTime(&et1);
#endif /* SS_THREAD_PROFILE */
- tTsk->actvTsk(&nPst, mBuf);
+ tTsk->actvTsk(&nPst, mBuf);
#ifndef RGL_SPECIFIC_CHANGES
#ifdef SS_TSKLOG_ENABLE
- SStopTask(t,PID_SSI_TSK);
+ SStopTask(t,PID_SSI_TSK);
#endif
#endif
#if SS_THREAD_PROFILE
- SGetEpcTime(&et2);
- tTsk->curEvtTime = (uint32_t)(et2 - et1);
- tTsk->totTime += (uint64_t)tTsk->curEvtTime;
+ SGetEpcTime(&et2);
+ tTsk->curEvtTime = (uint32_t)(et2 - et1);
+ tTsk->totTime += (uint64_t)tTsk->curEvtTime;
#endif /* SS_THREAD_PROFILE */
- }
- else
- {
+ }
+ else
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- /* this message should only come to a permanent task */
- if (tTsk->tskType != SS_TSK_PERMANENT)
- {
- MTLOGERROR(ERRCLS_DEBUG, EMT009, ERRZERO, "Logic failure");
- break;
- }
-#endif
- tTsk->actvTsk(&nPst, NULLP);
-
- /* We need to re-send this message back to ourselves so
- * the permanent task continues to run.
- */
- /* Check if this task got deregistered or detached
- * by the activation function; if so, there's nothing
- * more to do here, otherwise go ahead.
- */
- ret = ROK;
- if (tTsk->used == TRUE && tTsk->sTsk != NULLP)
- {
- ret = ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
- ((tTsk->tskPrior) * SS_MAX_MSG_PRI) +
- mInfo->pst.prior);
- }
-
- /* failure here is a real problem */
- if (ret != ROK)
- {
+ /* this message should only come to a permanent task */
+ if (tTsk->tskType != SS_TSK_PERMANENT)
+ {
+ MTLOGERROR(ERRCLS_DEBUG, EMT009, ERRZERO, "Logic failure");
+ break;
+ }
+#endif
+ tTsk->actvTsk(&nPst, NULLP);
+
+ /* We need to re-send this message back to ourselves so
+ * the permanent task continues to run.
+ */
+ /* Check if this task got deregistered or detached
+ * by the activation function; if so, there's nothing
+ * more to do here, otherwise go ahead.
+ */
+ ret = ROK;
+ if (tTsk->used == TRUE && tTsk->sTsk != NULLP)
+ {
+ ret = ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
+ ((tTsk->tskPrior) * SS_MAX_MSG_PRI) +
+ mInfo->pst.prior);
+ }
+
+ /* failure here is a real problem */
+ if (ret != ROK)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT010, ERRZERO,
- "Could not write to demand queue");
+ MTLOGERROR(ERRCLS_DEBUG, EMT010, ERRZERO,
+ "Could not write to demand queue");
#endif
- SPutMsg(mBuf);
- }
- }
+ SPutMsg(mBuf);
+ }
+ }
- /* unset the current executing TAPA task ID */
- sTsk->dep.ent = ENTNC;
- sTsk->dep.inst = INSTNC;
- break;
+ /* unset the current executing TAPA task ID */
+ sTsk->dep.ent = ENTNC;
+ sTsk->dep.inst = INSTNC;
+ break;
- case SS_EVNT_TIMER:
- /* timer event. find the timer entry */
- idx = mInfo->eventInfo.u.tmr.tmrIdx;
+ case SS_EVNT_TIMER:
+ /* timer event. find the timer entry */
+ idx = mInfo->eventInfo.u.tmr.tmrIdx;
- /* lock the timer table, coz we're going to peek in it */
- ret = SLock(&osCp.tmrTblLock);
- if (ret != ROK)
- {
+ /* lock the timer table, coz we're going to peek in it */
+ ret = SLock(&osCp.tmrTblLock);
+ if (ret != ROK)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT011, (ErrVal) ret,
- "Could not lock timer table");
-#endif
- SPutMsg(mBuf);
- break;
- }
-
- /* Verify that this timer entry is still around and that it
- * belongs to our task.
- */
- if (osCp.tmrTbl[idx].used == FALSE
-/* mt028.201: modification: multiple procs support related changes */
+ MTLOGERROR(ERRCLS_DEBUG, EMT011, (ErrVal) ret,
+ "Could not lock timer table");
+#endif
+ SPutMsg(mBuf);
+ break;
+ }
+
+ /* Verify that this timer entry is still around and that it
+ * belongs to our task.
+ */
+ if (osCp.tmrTbl[idx].used == FALSE
+ /* mt028.201: modification: multiple procs support related changes */
#ifdef SS_MULTIPLE_PROCS
- || osCp.tmrTbl[idx].ownerProc != mInfo->pst.dstProcId
+ || osCp.tmrTbl[idx].ownerProc != mInfo->pst.dstProcId
#endif /* SS_MULTIPLE_PROCS */
- || osCp.tmrTbl[idx].ownerEnt != mInfo->pst.dstEnt
- || osCp.tmrTbl[idx].ownerInst != mInfo->pst.dstInst)
- {
- SUnlock(&osCp.tmrTblLock);
- SPutMsg(mBuf);
- break;
- }
-
- /* mt005.21: addition */
- /* set the current executing TAPA task ID */
- sTsk->dep.ent = mInfo->pst.dstEnt;
- sTsk->dep.inst = mInfo->pst.dstInst;
+ || osCp.tmrTbl[idx].ownerEnt != mInfo->pst.dstEnt
+ || osCp.tmrTbl[idx].ownerInst != mInfo->pst.dstInst)
+ {
+ SUnlock(&osCp.tmrTblLock);
+ SPutMsg(mBuf);
+ break;
+ }
+
+ /* mt005.21: addition */
+ /* set the current executing TAPA task ID */
+ sTsk->dep.ent = mInfo->pst.dstEnt;
+ sTsk->dep.inst = mInfo->pst.dstInst;
#ifndef SS_MULTIPLE_PROCS
#ifdef SS_MT_TMR
- /*mt006.301 Adding Initializing the tmrActvFnMt*/
- tmrActvFnMt = NULLP;
- if (osCp.tmrTbl[idx].ssTmrActvFn.mtFlag == TRUE)
- {
- tmrActvFnMt = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFnMt;
- }
- else
+ /*mt006.301 Adding Initializing the tmrActvFnMt*/
+ tmrActvFnMt = NULLP;
+ if (osCp.tmrTbl[idx].ssTmrActvFn.mtFlag == TRUE)
+ {
+ tmrActvFnMt = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFnMt;
+ }
+ else
#endif
#endif
- {
- tmrActvFn = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFn;
- }
+ {
+ tmrActvFn = osCp.tmrTbl[idx].ssTmrActvFn.actvFnc.tmrActvFn;
+ }
- /* unlock the timer table */
- SUnlock(&osCp.tmrTblLock);
+ /* unlock the timer table */
+ SUnlock(&osCp.tmrTblLock);
- /* activate the timer function */
-/* mt028.201: modification: multiple procs support related changes */
+ /* activate the timer function */
+ /* mt028.201: modification: multiple procs support related changes */
#ifndef SS_MULTIPLE_PROCS
#ifdef SS_MT_TMR
- if (tmrActvFnMt)
- {
- tmrActvFnMt(osCp.tmrTbl[idx].ownerEnt,
- osCp.tmrTbl[idx].ownerInst);
- }
- else
-#endif
- {
- tmrActvFn();
- }
+ if (tmrActvFnMt)
+ {
+ tmrActvFnMt(osCp.tmrTbl[idx].ownerEnt,
+ osCp.tmrTbl[idx].ownerInst);
+ }
+ else
+#endif
+ {
+ tmrActvFn();
+ }
#else
- tmrActvFn(osCp.tmrTbl[idx].ownerProc, osCp.tmrTbl[idx].ownerEnt,
- osCp.tmrTbl[idx].ownerInst);
+ tmrActvFn(osCp.tmrTbl[idx].ownerProc, osCp.tmrTbl[idx].ownerEnt,
+ osCp.tmrTbl[idx].ownerInst);
#endif /* SS_MULTIPLE_PROCS */
- /*mt005.21: addition */
- /* unset the current executing TAPA task ID */
- sTsk->dep.ent = ENTNC;
- sTsk->dep.inst = INSTNC;
+ /*mt005.21: addition */
+ /* unset the current executing TAPA task ID */
+ sTsk->dep.ent = ENTNC;
+ sTsk->dep.inst = INSTNC;
- /* return the message buffer */
- SPutMsg(mBuf);
- break;
- /*
- * mt003.301 - SDeRegTTsk fix
- */
- case SS_EVNT_TTSK_TERM:
+ /* return the message buffer */
+ SPutMsg(mBuf);
+ break;
+ /*
+ * mt003.301 - SDeRegTTsk fix
+ */
+ case SS_EVNT_TTSK_TERM:
#ifdef SS_MULTIPLE_PROCS
- procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
+ procIdIdx = SGetProcIdIdx(mInfo->pst.dstProcId);
- if (procIdIdx == SS_INV_PROCID_IDX)
- {
- SPutMsg(mBuf);
- break;
- }
+ if (procIdIdx == SS_INV_PROCID_IDX)
+ {
+ SPutMsg(mBuf);
+ break;
+ }
- idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
+ idx = osCp.tTskIds[procIdIdx][mInfo->pst.dstEnt][mInfo->pst.dstInst];
#else /* SS_MULTIPLE_PROCS */
- idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
+ idx = osCp.tTskIds[mInfo->pst.dstEnt][mInfo->pst.dstInst];
#endif /* SS_MULTIPLE_PROCS */
- /* verify that it hasn't been deregistered */
- if (idx == SS_TSKNC)
- {
- SPutMsg(mBuf);
- break;
- }
-
- /* verify that this system task is still running it */
- tTsk = &osCp.tTskTbl[idx];
- if (tTsk->sTsk != sTsk)
- {
- SPutMsg(mBuf);
- break;
- }
+ /* verify that it hasn't been deregistered */
+ if (idx == SS_TSKNC)
+ {
+ SPutMsg(mBuf);
+ break;
+ }
+
+ /* verify that this system task is still running it */
+ tTsk = &osCp.tTskTbl[idx];
+ if (tTsk->sTsk != sTsk)
+ {
+ SPutMsg(mBuf);
+ break;
+ }
#ifdef SS_MULTIPLE_PROCS
- ssdProcTTskTerm(procIdIdx, tTsk, idx);
+ ssdProcTTskTerm(procIdIdx, tTsk, idx);
#else
- ssdProcTTskTerm(tTsk, idx);
+ ssdProcTTskTerm(tTsk, idx);
#endif
- SPutMsg(mBuf);
- break;
+ SPutMsg(mBuf);
+ break;
- default:
+ default:
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT012, (ErrVal) ret,
- "Illegal event");
+ MTLOGERROR(ERRCLS_DEBUG, EMT012, (ErrVal) ret,
+ "Illegal event");
#endif
- break;
+ break;
}
#ifdef SS_PERF
- mBuf = mBuf2;
+ mBuf = mBuf2;
} while (mBuf != NULLP);
#endif
Bool g_usettitmr;
/*
-* Fun: mtTmrHdlrPublic
-*/
+ * Fun: mtTmrHdlrPublic
+ */
Void mtTmrHdlrPublic()
{
if (SLock(&osCp.tmrTblLock) != ROK)
\f
/*
-*
-* Fun: mtTmrHdlr
-*
-* Desc: The timer handler thread function. Counts time
-* and invokes the common timer function on each
-* tick.
-*
-* Ret: (thread function)
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: mtTmrHdlr
+ *
+ * Desc: The timer handler thread function. Counts time
+ * and invokes the common timer function on each
+ * tick.
+ *
+ * Ret: (thread function)
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
/*mt041.201 Modified SSI tick handling in mtTmrHdlr() */
-static Void *mtTmrHdlr
+ static Void *mtTmrHdlr
(
-void *parm /* unused */
-)
+ void *parm /* unused */
+ )
{
-/*mt004.301-addede new region*/
-/* mt010.301 Removed SS_FAP portion and
- * enabled oroginal code in function mtTmrHdlr */
+ /*mt004.301-addede new region*/
+ /* mt010.301 Removed SS_FAP portion and
+ * enabled oroginal code in function mtTmrHdlr */
struct timespec ts;
uint32_t time_int;
if (gettimeofday(&tv1, NULL) == -1)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT014, (ErrVal) errno,
- "Error in clock_gettime");
+ MTLOGERROR(ERRCLS_DEBUG, EMT014, (ErrVal) errno,
+ "Error in clock_gettime");
#endif
}
for (; ;)
{
#if 1
- if (g_usettitmr)
- {
+ if (g_usettitmr)
+ {
#ifndef STUB_TTI_HANDLING_5GTF
- printf("Returning from mtTmrHdlr()\n");
- return NULL;
+ printf("\nReturning from mtTmrHdlr()\n");
+ return NULL;
#endif
- }
+ }
#endif
- /* mt039.201 changes for nanosleep */
+ /* mt039.201 changes for nanosleep */
/* sleep for MT_TICK_CNT milli seconds */
ts.tv_nsec = (MT_TICK_CNT - err_in_usec) * 1000;
while ((ret = nanosleep (&ts, &tsN) != ROK) && (errno == EINTR))
{
- ts.tv_nsec = tsN.tv_nsec;
- tsN.tv_nsec = 0;
- continue;
+ ts.tv_nsec = tsN.tv_nsec;
+ tsN.tv_nsec = 0;
+ continue;
}
if (gettimeofday(&tv2,NULL) == -1)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT015, (ErrVal) errno,
- "Error in clock_gettime");
+ MTLOGERROR(ERRCLS_DEBUG, EMT015, (ErrVal) errno,
+ "Error in clock_gettime");
#endif
}
- /*mt013.301 : changed check while calculating timer to fix
- * diffrence between MTSS time and real unix time
- */
- if ((tv2.tv_sec == tv1.tv_sec)&&(tv2.tv_usec > tv1.tv_usec))
- {
- time_int = (tv2.tv_usec - tv1.tv_usec);
- }
- else if (tv2.tv_sec > tv1.tv_sec)
- {
- time_int = ((tv2.tv_sec - tv1.tv_sec)*1000000) + (tv2.tv_usec - tv1.tv_usec);
- }
- else /* ts2 < ts1, this will not happen in normal scenario */
- {
- /* to make sure cnt = 1 */
- err_in_usec = 0;
- time_int = MT_TICK_CNT;
- }
-
- oldTicks = osCp.dep.sysTicks;
- osCp.dep.sysTicks += (time_int/(MT_TICK_CNT - err_in_usec));
- err_in_usec = (time_int % (MT_TICK_CNT - err_in_usec));
- newTicks = osCp.dep.sysTicks;
- tv1.tv_usec = tv2.tv_usec;
- tv1.tv_sec = tv2.tv_sec;
-
- cnt = newTicks - oldTicks;
-
- while(err_in_usec >= MT_TICK_CNT)
- {
- cnt++;
- err_in_usec -= MT_TICK_CNT;
- }
- if( cnt >= MT_MAX_TICK_CNT_VAL)
- cnt = MT_MIN_TICK_CNT_VAL;
- /* call the common timer tick handler */
- for (i = 0; i < cnt; i++)
- {
- /* mt008.301: cmPrcTmr is guarded with a lock */
- /* lock the timer table */
- if (SLock(&osCp.tmrTblLock) != ROK)
- {
+ /*mt013.301 : changed check while calculating timer to fix
+ * diffrence between MTSS time and real unix time
+ */
+ if ((tv2.tv_sec == tv1.tv_sec)&&(tv2.tv_usec > tv1.tv_usec))
+ {
+ time_int = (tv2.tv_usec - tv1.tv_usec);
+ }
+ else if (tv2.tv_sec > tv1.tv_sec)
+ {
+ time_int = ((tv2.tv_sec - tv1.tv_sec)*1000000) + (tv2.tv_usec - tv1.tv_usec);
+ }
+ else /* ts2 < ts1, this will not happen in normal scenario */
+ {
+ /* to make sure cnt = 1 */
+ err_in_usec = 0;
+ time_int = MT_TICK_CNT;
+ }
+
+ oldTicks = osCp.dep.sysTicks;
+ osCp.dep.sysTicks += (time_int/(MT_TICK_CNT - err_in_usec));
+ err_in_usec = (time_int % (MT_TICK_CNT - err_in_usec));
+ newTicks = osCp.dep.sysTicks;
+ tv1.tv_usec = tv2.tv_usec;
+ tv1.tv_sec = tv2.tv_sec;
+
+ cnt = newTicks - oldTicks;
+
+ while(err_in_usec >= MT_TICK_CNT)
+ {
+ cnt++;
+ err_in_usec -= MT_TICK_CNT;
+ }
+ if( cnt >= MT_MAX_TICK_CNT_VAL)
+ cnt = MT_MIN_TICK_CNT_VAL;
+ /* call the common timer tick handler */
+ for (i = 0; i < cnt; i++)
+ {
+ /* mt008.301: cmPrcTmr is guarded with a lock */
+ /* lock the timer table */
+ if (SLock(&osCp.tmrTblLock) != ROK)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT016, ERRZERO, "Could not lock timer table");
+ MTLOGERROR(ERRCLS_DEBUG, EMT016, ERRZERO, "Could not lock timer table");
#endif
- continue;
- }
- cmPrcTmr(&osCp.dep.tmrTqCp, osCp.dep.tmrTq, mtTimeout);
- /* unlock the timer table */
- SUnlock(&osCp.tmrTblLock);
- }
+ continue;
+ }
+ cmPrcTmr(&osCp.dep.tmrTqCp, osCp.dep.tmrTq, mtTimeout);
+ /* unlock the timer table */
+ SUnlock(&osCp.tmrTblLock);
+ }
}
/* mt009.21: addition */
\f
/*
-*
-* Fun: mtTimeout
-*
-* Desc: Process timer event. Called from the common timer
-* code when a timeout occurs.
-*
-* Ret: Void
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-Void mtTimeout
+ *
+ * Fun: mtTimeout
+ *
+ * Desc: Process timer event. Called from the common timer
+ * code when a timeout occurs.
+ *
+ * Ret: Void
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ Void mtTimeout
(
-PTR tCb, /* control block */
-S16 evnt /* event */
-)
+ PTR tCb, /* control block */
+ S16 evnt /* event */
+ )
{
Buffer *mBuf;
SsMsgInfo *mInfo;
#ifndef TENB_RTLIN_CHANGES
S16 ret;
#endif
-/* mt028.201: modification: multiple procs support related changes */
+ /* mt028.201: modification: multiple procs support related changes */
#ifdef SS_MULTIPLE_PROCS
uint16_t procIdIdx;
#endif /* SS_MULTIPLE_PROCS */
return;
}
-/* mt008.301 Deletion: tmrTbl Lock is moved to mtTmrHdlr */
+ /* mt008.301 Deletion: tmrTbl Lock is moved to mtTmrHdlr */
/* Hmmmm, the timer might have been deleted while we've been
if (SGetMsg(SS_DFLT_REGION, SS_DFLT_POOL, &mBuf) != ROK)
#else
#ifdef RGL_SPECIFIC_CHANGES
- if (SGetMsg((SS_DFLT_REGION), SS_DFLT_POOL, &mBuf) != ROK)
+ if (SGetMsg((SS_DFLT_REGION), SS_DFLT_POOL, &mBuf) != ROK)
#else
- if (SGetMsg((osCp.sTskTbl[0].region), SS_DFLT_POOL, &mBuf) != ROK)
+ if (SGetMsg((osCp.sTskTbl[0].region), SS_DFLT_POOL, &mBuf) != ROK)
#endif
#endif
- {
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT017, ERRZERO, "Could not get message");
+ MTLOGERROR(ERRCLS_DEBUG, EMT017, ERRZERO, "Could not get message");
#endif
- return;
- }
+ return;
+ }
mInfo = (SsMsgInfo *)mBuf->b_rptr;
mInfo->eventInfo.event = SS_EVNT_TIMER;
mInfo->pst.dstInst = tEnt->ownerInst;
mInfo->pst.srcEnt = tEnt->ownerEnt;
mInfo->pst.srcInst = tEnt->ownerInst;
-/* mt028.201: modification: multiple procs support related changes */
+ /* mt028.201: modification: multiple procs support related changes */
#ifndef SS_MULTIPLE_PROCS
mInfo->pst.dstProcId = SFndProcId();
mInfo->pst.srcProcId = SFndProcId();
/* find the owner TAPA task */
-/* mt028.201: modification: multiple procs support related changes */
+ /* mt028.201: modification: multiple procs support related changes */
#ifdef SS_MULTIPLE_PROCS
procIdIdx = SGetProcIdIdx(tEnt->ownerProc);
idx = osCp.tTskIds[procIdIdx][tEnt->ownerEnt][tEnt->ownerInst];
}
/* Klock work fix ccpu00148484 */
/* write the timer message to the queue of the destination task */
- /* mt008.301 : check sTsk before putting into it's DQ */
+ /* mt008.301 : check sTsk before putting into it's DQ */
if (tTsk->sTsk == NULLP)
{
#ifndef TENB_RTLIN_CHANGES
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT019, ERRZERO,
- "Could not write to demand queue");
+ "Could not write to demand queue");
#endif
return;
mInfo->region = tTsk->sTsk->region;
#endif /* SS_LOCKLESS_MEMORY */
if (ssDmndQPutLast(&tTsk->sTsk->dQ, mBuf,
- (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR0) != ROK)
+ (tTsk->tskPrior * SS_MAX_MSG_PRI) + PRIOR0) != ROK)
{
#ifndef TENB_RTLIN_CHANGES
SS_RELEASE_SEMA(&osCp.tTskTblSem);
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT019, ERRZERO,
- "Could not write to demand queue");
+ "Could not write to demand queue");
#endif
return;
}
-/* Fix for ccpu00130657 */
+ /* Fix for ccpu00130657 */
#ifdef TENB_T2K3K_SPECIFIC_CHANGES
if (tTsk->sTsk->tskPrior == PRIOR0)
{
#ifdef INTEL_WLS
- WLS_WakeUp(mtGetWlsHdl());
+ WLS_WakeUp(mtGetWlsHdl());
#else
tlPost(NULLP);
#endif
\f
#ifdef CONAVL
/*
-*
-* Fun: mtConHdlr
-*
-* Desc: This thread reads the console and hands over any
-* data read to a user function.
-*
-* Ret: (thread function)
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-static Void *mtConHdlr
+ *
+ * Fun: mtConHdlr
+ *
+ * Desc: This thread reads the console and hands over any
+ * data read to a user function.
+ *
+ * Ret: (thread function)
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ static Void *mtConHdlr
(
-Ptr parm /* unused */
-)
+ Ptr parm /* unused */
+ )
{
int fd;
Data data;
{
if ((read(fd, &data, 1)) != 1)
{
- continue;
+ continue;
}
#ifndef L2_L3_SPLIT
#ifdef SS_DRVR_SUPPORT
/*
-*
-* Fun: Interrupt service task handler
-*
-* Desc: This is the interrupt service task handler. It blocks
-* on a pipe from which it reads an isFlag structure. The
-* structure indicates which interrupt service task is to
-* be executed. The thread identifies the task, calls the
-* isTsk function and sends itself a message to repeat
-* this operation until it receives a message to cease.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
- /* mt009.21: addition */
-static Void *mtIsTskHdlr
+ *
+ * Fun: Interrupt service task handler
+ *
+ * Desc: This is the interrupt service task handler. It blocks
+ * on a pipe from which it reads an isFlag structure. The
+ * structure indicates which interrupt service task is to
+ * be executed. The thread identifies the task, calls the
+ * isTsk function and sends itself a message to repeat
+ * this operation until it receives a message to cease.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+/* mt009.21: addition */
+ static Void *mtIsTskHdlr
(
-Ptr tskPtr /* pointer to task entry */
-)
+ Ptr tskPtr /* pointer to task entry */
+ )
{
#if (ERRCLASS & ERRCLS_DEBUG)
int ret;
{
if (read(osCp.dep.isFildes[0], &isFlag, sizeof(isFlag)) != sizeof(isFlag))
{
- continue;
+ continue;
}
switch (isFlag.action)
{
- case MT_IS_SET:
- osCp.drvrTskTbl[isFlag.id].dep.flag = TRUE;
+ case MT_IS_SET:
+ osCp.drvrTskTbl[isFlag.id].dep.flag = TRUE;
- /* call the interrupt service task activation function */
- osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
+ /* call the interrupt service task activation function */
+ osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
- /* send self a message to keep doing this */
- isFlag.action = MT_IS_RESET;
+ /* send self a message to keep doing this */
+ isFlag.action = MT_IS_RESET;
#if (ERRCLASS & ERRCLS_DEBUG)
- ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
- if (ret != sizeof(isFlag))
- {
- MTLOGERROR(ERRCLS_DEBUG, EMT020, ERRZERO,
- "write() to pipe failed");
- }
+ ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+ if (ret != sizeof(isFlag))
+ {
+ MTLOGERROR(ERRCLS_DEBUG, EMT020, ERRZERO,
+ "write() to pipe failed");
+ }
#else
- write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+ write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
#endif
- break;
+ break;
- case MT_IS_UNSET:
- osCp.drvrTskTbl[isFlag.id].dep.flag = FALSE;
- break;
+ case MT_IS_UNSET:
+ osCp.drvrTskTbl[isFlag.id].dep.flag = FALSE;
+ break;
- case MT_IS_RESET:
- if (osCp.drvrTskTbl[isFlag.id].dep.flag)
- {
- /* call the interrupt service task activation function */
- osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
+ case MT_IS_RESET:
+ if (osCp.drvrTskTbl[isFlag.id].dep.flag)
+ {
+ /* call the interrupt service task activation function */
+ osCp.drvrTskTbl[isFlag.id].isTsk(isFlag.id);
#if (ERRCLASS & ERRCLS_DEBUG)
- /* send self a message to do this again */
- ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
-
- if (ret != sizeof(isFlag))
- {
- MTLOGERROR(ERRCLS_DEBUG, EMT021, ERRZERO,
- "write() to pipe failed");
- }
+ /* send self a message to do this again */
+ ret = write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+
+ if (ret != sizeof(isFlag))
+ {
+ MTLOGERROR(ERRCLS_DEBUG, EMT021, ERRZERO,
+ "write() to pipe failed");
+ }
#else
- write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
+ write(osCp.dep.isFildes[1], &isFlag, sizeof(isFlag));
#endif
- }
- break;
+ }
+ break;
- default:
- /* where did THIS come from?? */
- break;
+ default:
+ /* where did THIS come from?? */
+ break;
}
}
- /* mt009.21: addition */
- return ( (Void *) NULLP);
+ /* mt009.21: addition */
+ return ( (Void *) NULLP);
/* not reached */
}
/*mt010.301 Fix for core when run with -o option and when killed with SIGINT*/
\f
/*
-*
-* Fun: mtIntSigHndlr
-*
-* Desc: Exit function, shuts down.
-*
-* Ret: Void
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: mtIntSigHndlr
+ *
+ * Desc: Exit function, shuts down.
+ *
+ * Ret: Void
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void mtIntSigHndlr(int arg)
{
/*mt010.301 Fix for core when run with -o option and when killed with SIGINT*/
/*
-*
-* Fun: mtExitClnup
-*
-* Desc: function, shuts down.
-*
-* Ret: Void
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: mtExitClnup
+ *
+ * Desc: function, shuts down.
+ *
+ * Ret: Void
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
Void mtExitClnup(void)
{
Ticks ticks;
}
/*
-*
-* Fun: SDisplay
-*
-* Desc: This function displays a string to a given output
-* channel.
-*
-* Ret: ROK - ok
-*
-* Notes: Buffer should be null terminated.
-*
-* channel 0 is reserved for backwards compatibility
-* with SPrint
-*
-* File: mt_ss.c
-*
-*/
-S16 SDisplay
+ *
+ * Fun: SDisplay
+ *
+ * Desc: This function displays a string to a given output
+ * channel.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Buffer should be null terminated.
+ *
+ * channel 0 is reserved for backwards compatibility
+ * with SPrint
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SDisplay
(
-S16 chan, /* channel */
-Txt *buf /* buffer */
-)
+ S16 chan, /* channel */
+ Txt *buf /* buffer */
+ )
{
-/* mt020.201 - Fixed typo */
+ /* mt020.201 - Fixed typo */
#if (ERRCLASS & ERRCLS_INT_PAR)
if (buf == NULLP)
{
#endif
#endif
- /* mt012.301 :FIX for LOG RELATED ISSUE */
+ /* mt012.301 :FIX for LOG RELATED ISSUE */
#ifdef CONAVL
if(chan==1)
{
- printf("%s",buf);
+ printf("%s",buf);
}
else
{
- if (osCp.dep.conOutFp) fwrite(buf, strlen(buf), 1, osCp.dep.conOutFp);
+ if (osCp.dep.conOutFp) fwrite(buf, strlen(buf), 1, osCp.dep.conOutFp);
}
#endif
/*mt010.301 */
/*
-*
-* Fun: SFini
-*
-* Desc: function, shuts down.
-*
-* Ret: Void
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: SFini
+ *
+ * Desc: function, shuts down.
+ *
+ * Ret: Void
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 SFini(void)
{
pause();
if(osCp.dep.sigEvnt==TRUE)
{
- mtExitClnup();
+ mtExitClnup();
}
}
}
\f
/*
-*
-* Fun: Set date and time
-*
-* Desc: This function is used to set the calendar
-* date and time.
-*
-* Ret: ROK - ok
-*
-* Notes: Unimplemented
-*
-* File: mt_ss.c
-*
-*/
-S16 SSetDateTime
+ *
+ * Fun: Set date and time
+ *
+ * Desc: This function is used to set the calendar
+ * date and time.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Unimplemented
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SSetDateTime
(
-REG1 DateTime *dt /* date and time */
-)
+ REG1 DateTime *dt /* date and time */
+ )
{
UNUSED(dt);
\f
/*
-*
-* Fun: Get date and time
-*
-* Desc: This function is used to determine the calendar
-* date and time. This information may be used for
-* some management functions.
-*
-* Ret: ROK - ok
-* RFAILED - error
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetDateTime
+ *
+ * Fun: Get date and time
+ *
+ * Desc: This function is used to determine the calendar
+ * date and time. This information may be used for
+ * some management functions.
+ *
+ * Ret: ROK - ok
+ * RFAILED - error
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetDateTime
(
-REG1 DateTime *dt /* date and time */
-)
+ REG1 DateTime *dt /* date and time */
+ )
{
/*-- mt035.201 : SSI enhancements for micro second in datetime struct --*/
/* time_t tt; --*/
#endif
-/*-- mt035.201 --*/
+ /*-- mt035.201 --*/
/*--
- time(&tt);
- localtime_r(&tt, &tme);
- --*/
+ time(&tt);
+ localtime_r(&tt, &tme);
+ --*/
#ifndef SS_LINUX
- clock_gettime(CLOCK_REALTIME, &ptime);
+ clock_gettime(CLOCK_REALTIME, &ptime);
#else
- gettimeofday(&ptime, NULL);
+ gettimeofday(&ptime, NULL);
#endif
localtime_r(&ptime.tv_sec, &tme);
}
/*
-* Get time from epoch in milliseconds
-*
-* Fun: Get time from epoch in milliseconds
-*
-* Desc: This function is used to get the time from epoch in milli seconds.
-* This information may be used for calculating a layer's activation function
-* execution time used for thread profiling.
-*
-* Ret: ROK - ok
-* RFAILED - error
-*
-* Notes:
-*
-* File: mt_ss.c
-*/
+ * Get time from epoch in milliseconds
+ *
+ * Fun: Get time from epoch in milliseconds
+ *
+ * Desc: This function is used to get the time from epoch in milli seconds.
+ * This information may be used for calculating a layer's activation function
+ * execution time used for thread profiling.
+ *
+ * Ret: ROK - ok
+ * RFAILED - error
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ */
/* mt003.301 Modifications */
-S16 SGetEpcTime
+ S16 SGetEpcTime
(
-EpcTime *et /* date and time */
-)
+ EpcTime *et /* date and time */
+ )
{
-/* mt003.301 Modifications */
-static uint64_t now;
- uint64_t to_sec = 1000000;
- uint64_t to_nsec = 1000;
+ /* mt003.301 Modifications */
+ static uint64_t now;
+ uint64_t to_sec = 1000000;
+ uint64_t to_nsec = 1000;
#ifndef SS_LINUX
struct timespec ptime;
#else
#ifndef SS_LINUX
- clock_gettime(CLOCK_REALTIME, &ptime);
+ clock_gettime(CLOCK_REALTIME, &ptime);
#else
- gettimeofday(&ptime, NULL);
+ gettimeofday(&ptime, NULL);
#endif /* SS_LINUX */
- now = (ptime.tv_sec * to_sec);
+ now = (ptime.tv_sec * to_sec);
#ifndef SS_LINUX
now += (ptime.tv_nsec / to_nsec);
#else /* SS_LINUX */
- now += (ptime.tv_usec);
+ now += (ptime.tv_usec);
#endif /* SS_LINUX */
- now = (now / to_nsec);
+ now = (now / to_nsec);
*et = now;
\f
/*
-*
-* Fun: Get system time
-*
-* Desc: This function is used to determine the system time.
-*
-* Ret: ROK - ok
-*
-* Notes: osCp.dep.sysTicks is updated by the timer thread.
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetSysTime
+ *
+ * Fun: Get system time
+ *
+ * Desc: This function is used to determine the system time.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: osCp.dep.sysTicks is updated by the timer thread.
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetSysTime
(
-Ticks *sysTime /* system time */
-)
+ Ticks *sysTime /* system time */
+ )
{
/* mt021.201 - Addition of SGetRefTime function */
/*
-*
-* Fun: Get referenced time
-*
-* Desc: This function is used to determine the time in seconds
-* and microseconds from a reference time. The reference
-* time is expressed in seconds from UTC EPOC, January 1,
-* 1970.
-*
-* Ret: ROK - ok
-* RFAILED - fail
-*
-* Notes: Macros are defined for reference times:
-* SS_REFTIME_01_01_1970
-* SS_REFTIME_01_01_2002
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetRefTime
+ *
+ * Fun: Get referenced time
+ *
+ * Desc: This function is used to determine the time in seconds
+ * and microseconds from a reference time. The reference
+ * time is expressed in seconds from UTC EPOC, January 1,
+ * 1970.
+ *
+ * Ret: ROK - ok
+ * RFAILED - fail
+ *
+ * Notes: Macros are defined for reference times:
+ * SS_REFTIME_01_01_1970
+ * SS_REFTIME_01_01_2002
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetRefTime
(
-uint32_t refTime, /* reference time */
-uint32_t *sec,
-uint32_t *usec
-)
+ uint32_t refTime, /* reference time */
+ uint32_t *sec,
+ uint32_t *usec
+ )
{
#ifndef SS_LINUX
#ifndef SS_LINUX
- clock_gettime(CLOCK_REALTIME, &ptime);
+ clock_gettime(CLOCK_REALTIME, &ptime);
#else
- gettimeofday(&ptime, NULL);
+ gettimeofday(&ptime, NULL);
#endif
#if (ERRCLASS & ERRCLS_INT_PAR)
*usec = ptime.tv_usec;
#endif
- return ROK;
+ return ROK;
}
\f
/*
-*
-* Fun: Get Random Number
-*
-* Desc: Invoked by layer when a pseudorandom number is required.
-*
-* Ret: ROK - ok
-*
-* Notes: Suggested approach uses shuffled Linear Congruential
-* Operators as described in Byte magazine October
-* 1984; "Generating and Testing Pseudorandom Numbers"
-*
-* File: mt_ss.c
-*
-*/
-S16 SRandom
+ *
+ * Fun: Get Random Number
+ *
+ * Desc: Invoked by layer when a pseudorandom number is required.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Suggested approach uses shuffled Linear Congruential
+ * Operators as described in Byte magazine October
+ * 1984; "Generating and Testing Pseudorandom Numbers"
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SRandom
(
-Random *value /* random number */
-)
+ Random *value /* random number */
+ )
{
#if (ERRCLASS & ERRCLS_INT_PAR)
if (value == NULLP)
{
- /* mt011.21: addition */
+ /* mt011.21: addition */
MTLOGERROR(ERRCLS_INT_PAR, EMT028, (ErrVal)0 , "Null pointer");
return RFAILED;
}
\f
/*
-*
-* Fun: Exit Task
-*
-* Desc: This function exits from a task.
-*
-* Ret: ROK - ok
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Exit Task
+ *
+ * Desc: This function exits from a task.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
S16 SExitTsk(void)
{
\f
/*
-*
-* Fun: Exit Interrupt
-*
-* Desc: This function exits from an interrupt.
-*
-* Ret: ROK - ok
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Exit Interrupt
+ *
+ * Desc: This function exits from an interrupt.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
S16 SExitInt(void)
{
\f
/*
-*
-* Fun: Hold Interrupt
-*
-* Desc: This function prohibits interrupts from being enabled until
-* release interrupt. This function should be called when
-* interrupts are disabled and prior to any call to system
-* services either by entry to an interrupt service routine or
-* by explicit call to disable interrupt.
-*
-* Ret: ROK - ok
-*
-* Notes: Currently does nothing
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Hold Interrupt
+ *
+ * Desc: This function prohibits interrupts from being enabled until
+ * release interrupt. This function should be called when
+ * interrupts are disabled and prior to any call to system
+ * services either by entry to an interrupt service routine or
+ * by explicit call to disable interrupt.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Currently does nothing
+ *
+ * File: mt_ss.c
+ *
+ */
S16 SHoldInt(void)
{
\f
/*
-*
-* Fun: Release Interrupt
-*
-* Desc: This function allows interrupts to be enabled.
-*
-* Ret: ROK - ok
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Release Interrupt
+ *
+ * Desc: This function allows interrupts to be enabled.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
S16 SRelInt(void)
{
\f
/*
-*
-* Fun: SEnbInt
-*
-* Desc: Enable interrupts
-*
-* Ret: ROK on success
-* RFAILED on error
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: SEnbInt
+ *
+ * Desc: Enable interrupts
+ *
+ * Ret: ROK on success
+ * RFAILED on error
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
inline S16 SEnbInt(void)
{
\f
/*
-*
-* Fun: SDisInt
-*
-* Desc: Disable interrupts
-*
-* Ret: ROK on success
-* RFAILED on error
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: SDisInt
+ *
+ * Desc: Disable interrupts
+ *
+ * Ret: ROK on success
+ * RFAILED on error
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
inline S16 SDisInt(void)
{
\f
/*
-*
-* Fun: Get Vector
-*
-* Desc: This function gets the function address stored at the
-* specified interrupt vector.
-*
-* Ret: ROK - ok
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetVect
+ *
+ * Fun: Get Vector
+ *
+ * Desc: This function gets the function address stored at the
+ * specified interrupt vector.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetVect
(
-VectNmb vectNmb, /* vector number */
-PIF *vectFnct /* vector function */
-)
+ VectNmb vectNmb, /* vector number */
+ PIF *vectFnct /* vector function */
+ )
{
\f
/*
-*
-* Fun: Put Vector
-*
-* Desc: This function installs the specified function at the
-* specified interrupt vector.
-*
-* Ret: ROK - ok
-*
-* Notes: Currently does nothing.
-*
-* File: mt_ss.c
-*
-*/
-S16 SPutVect
+ *
+ * Fun: Put Vector
+ *
+ * Desc: This function installs the specified function at the
+ * specified interrupt vector.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes: Currently does nothing.
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SPutVect
(
-VectNmb vectNmb, /* vector number */
-PIF vectFnct /* vector function */
-)
+ VectNmb vectNmb, /* vector number */
+ PIF vectFnct /* vector function */
+ )
{
#ifndef SS_MULTIPLE_PROCS
\f
/*
-*
-* Fun: SGetEntInst
-*
-* Desc: This function gets the current entity and instance.
-*
-* Ret: ROK - ok
-* RFAILED - failed, general (optional)
-*
-* Notes: This function may be called by the OS or Layer 1
-* hardware drivers.
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetEntInst
+ *
+ * Fun: SGetEntInst
+ *
+ * Desc: This function gets the current entity and instance.
+ *
+ * Ret: ROK - ok
+ * RFAILED - failed, general (optional)
+ *
+ * Notes: This function may be called by the OS or Layer 1
+ * hardware drivers.
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetEntInst
(
-Ent *ent, /* entity */
-Inst *inst /* instance */
-)
+ Ent *ent, /* entity */
+ Inst *inst /* instance */
+ )
{
S16 i;
S16 ret;
{
if (pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
{
- sTsk = &osCp.sTskTbl[i];
- break;
+ sTsk = &osCp.sTskTbl[i];
+ break;
}
}
if (sTsk != NULLP)
{
- *ent = sTsk->dep.ent;
- *inst = sTsk->dep.inst;
+ *ent = sTsk->dep.ent;
+ *inst = sTsk->dep.inst;
}
SUnlock(&osCp.sTskTblLock);
\f
/*
-*
-* Fun: SSetEntInst
-*
-* Desc: This function sets the current entity and instance.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 SSetEntInst
+ *
+ * Fun: SSetEntInst
+ *
+ * Desc: This function sets the current entity and instance.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SSetEntInst
(
-Ent ent, /* entity */
-Inst inst /* instance */
-)
+ Ent ent, /* entity */
+ Inst inst /* instance */
+ )
{
S16 i;
S16 ret;
{
if (pthread_equal(osCp.sTskTbl[i].dep.tId, tId))
{
- sTsk = &osCp.sTskTbl[i];
- break;
+ sTsk = &osCp.sTskTbl[i];
+ break;
}
}
if (sTsk != NULLP)
{
- sTsk->dep.ent = ent;
- sTsk->dep.inst = inst;
+ sTsk->dep.ent = ent;
+ sTsk->dep.inst = inst;
}
SUnlock(&osCp.sTskTblLock);
#ifdef SS_DRVR_SUPPORT
\f
/*
-*
-* Fun: SSetIntPend
-*
-* Desc: Set interrupt pending flag
-*
-* Ret: ROK on success
-* RFAILED on error
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-inline S16 SSetIntPend
+ *
+ * Fun: SSetIntPend
+ *
+ * Desc: Set interrupt pending flag
+ *
+ * Ret: ROK on success
+ * RFAILED on error
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ inline S16 SSetIntPend
(
-uint16_t id, /* driver task identifier */
-Bool flag /* flag */
-)
+ uint16_t id, /* driver task identifier */
+ Bool flag /* flag */
+ )
{
MtIsFlag isFlag;
#ifdef SS_LOCKLESS_MEMORY
/*
-*
-* Fun: SGlobMemInfoShow
-*
-* Desc: This function displays the memory usage information
-* for the destined region. It will show the usage of
-* each configured bucket and the heap for the specified region.
-*
-* Ret: ROK OK
-* RFAILED Region not registered
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: SGlobMemInfoShow
+ *
+ * Desc: This function displays the memory usage information
+ * for the destined region. It will show the usage of
+ * each configured bucket and the heap for the specified region.
+ *
+ * Ret: ROK OK
+ * RFAILED Region not registered
+ *
+ * File: mt_ss.c
+ *
+ */
S16 SGlobMemInfoShow(Void)
{
uint16_t idx;
Txt prntBuf[100];
CmMmGlobRegCb *globReg;
-
+
globReg = osCp.globRegCb;
SDisplay(0, prntBuf);
sprintf(prntBuf, "====================================================\n");
SDisplay(0, prntBuf);
-
+
for (idx = 0; idx < globReg->numBkts; idx++)
{
#ifdef XEON_SPECIFIC_CHANGES
sprintf(prntBuf, "%2u %12lu %12lu %8lu %9lu\n",
- idx, globReg->bktTbl[idx].size, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
+ idx, globReg->bktTbl[idx].size, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
#else
#ifndef ALIGN_64BIT
sprintf(prntBuf, "%2u %12lu %8lu %9lu\n",
- idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
+ idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
#else
sprintf(prntBuf, "%2u %12u %8u %9u\n",
- idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
+ idx, globReg->bktTbl[idx].bucketSetSize, globReg->bktTbl[idx].listValidBktSet.count, globReg->bktTbl[idx].listFreeBktSet.count);
#endif
#endif
SDisplay(0, prntBuf);
#endif /* SS_LOCKLESS_MEMORY */
/*
-Bool IsMemoryThresholdHit(Region reg, Pool pool)
-{
- if((mtCMMRegCb[reg]->bktTbl[pool].numAlloc * 100 )/mtCMMRegCb[reg]->bktTbl[pool].numBlks > 70)
- {
- MSPD_DBG("Threshold reached reg(%d) pool(%d) numAllc(%d) numBlks(%d)\n",
- reg,
- pool,
- mtCMMRegCb[reg]->bktTbl[pool].numAlloc,
- mtCMMRegCb[reg]->bktTbl[pool].numBlks);
- return (TRUE);
- }
- return (FALSE);
-}
-*/
+ Bool IsMemoryThresholdHit(Region reg, Pool pool)
+ {
+ if((mtCMMRegCb[reg]->bktTbl[pool].numAlloc * 100 )/mtCMMRegCb[reg]->bktTbl[pool].numBlks > 70)
+ {
+ MSPD_DBG("Threshold reached reg(%d) pool(%d) numAllc(%d) numBlks(%d)\n",
+ reg,
+ pool,
+ mtCMMRegCb[reg]->bktTbl[pool].numAlloc,
+ mtCMMRegCb[reg]->bktTbl[pool].numBlks);
+ return (TRUE);
+ }
+ return (FALSE);
+ }
+ */
/* mt022.201 - Addition of SRegInfoShow function */
/*
-*
-* Fun: SRegInfoShow
-*
-* Desc: This function displays the memory usage information
-* for the destined region. It will show the usage of
-* each configured bucket and the heap for the specified region.
-*
-* Ret: ROK OK
-* RFAILED Region not registered
-*
-* Notes: A Sample Output from the function
-* Bucket Memory: region 1
-* ====================================================
-* Bucket Number of Blks configured Size Allocated
-* ====================================================
-* 0 1 16 1
-* 1 1 32 0
-* 2 1 80 0
-* 3 1 256 0
-* 4 1 320 0
-*
-* ---------------
-* Heap Memory: region 1
-* Heap Size: 0
-* Heap Allocated: 0
-* Heap Segmented blocks: 0
-*
-*
-* File: mt_ss.c
-*
-*/
-S16 SRegInfoShow
+ *
+ * Fun: SRegInfoShow
+ *
+ * Desc: This function displays the memory usage information
+ * for the destined region. It will show the usage of
+ * each configured bucket and the heap for the specified region.
+ *
+ * Ret: ROK OK
+ * RFAILED Region not registered
+ *
+ * Notes: A Sample Output from the function
+ * Bucket Memory: region 1
+ * ====================================================
+ * Bucket Number of Blks configured Size Allocated
+ * ====================================================
+ * 0 1 16 1
+ * 1 1 32 0
+ * 2 1 80 0
+ * 3 1 256 0
+ * 4 1 320 0
+ *
+ * ---------------
+ * Heap Memory: region 1
+ * Heap Size: 0
+ * Heap Allocated: 0
+ * Heap Segmented blocks: 0
+ *
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SRegInfoShow
(
-Region region,
-uint32_t *availmem
-)
+ Region region,
+ uint32_t *availmem
+ )
{
uint16_t idx;
Txt prntBuf[100];
#ifdef TENB_T2K3K_SPECIFIC_CHANGES
#ifdef ALIGN_64BIT
sprintf((char *)prntBuf, "%2u %8u %5u %8u %8u\n",
- idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
- mtCMMRegCb[region]->bktTbl[idx].size,
- mtCMMRegCb[region]->bktTbl[idx].numAlloc,
- mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
+ idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+ mtCMMRegCb[region]->bktTbl[idx].size,
+ mtCMMRegCb[region]->bktTbl[idx].numAlloc,
+ mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
#else
sprintf((char *)prntBuf, "%2u %8lu %5lu %8lu %8lu\n",
- idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
- mtCMMRegCb[region]->bktTbl[idx].size,
- mtCMMRegCb[region]->bktTbl[idx].numAlloc,
- mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
+ idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+ mtCMMRegCb[region]->bktTbl[idx].size,
+ mtCMMRegCb[region]->bktTbl[idx].numAlloc,
+ mtCMMRegCb[region]->bktTbl[idx].maxAlloc);
#endif
#else
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "%2u %8u %5u %8u\n",
- idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
- mtCMMRegCb[region]->bktTbl[idx].size,
- mtCMMRegCb[region]->bktTbl[idx].numAlloc);
+ idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+ mtCMMRegCb[region]->bktTbl[idx].size,
+ mtCMMRegCb[region]->bktTbl[idx].numAlloc);
#else
sprintf(prntBuf, "%2u %8lu %5lu %8lu\n",
- idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
- mtCMMRegCb[region]->bktTbl[idx].size,
- mtCMMRegCb[region]->bktTbl[idx].numAlloc);
+ idx, mtCMMRegCb[region]->bktTbl[idx].numBlks,
+ mtCMMRegCb[region]->bktTbl[idx].size,
+ mtCMMRegCb[region]->bktTbl[idx].numAlloc);
#endif
#endif /* not TENB_RTLIN_CHANGES */
SDisplay(0, prntBuf);
*availmem = *availmem + (mtCMMRegCb[region]->bktTbl[idx].size * \
- (mtCMMRegCb[region]->bktTbl[idx].numBlks - \
- mtCMMRegCb[region]->bktTbl[idx].numAlloc));
+ (mtCMMRegCb[region]->bktTbl[idx].numBlks - \
+ mtCMMRegCb[region]->bktTbl[idx].numAlloc));
}
sprintf(prntBuf, "\n---------------\n");
SDisplay(0, prntBuf);
sprintf(prntBuf, "Heap Memory: region %d\n", region);
SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "Heap Size: %u\n", mtCMMRegCb[region]->heapSize);
#else
sprintf(prntBuf, "Heap Size: %lu\n", mtCMMRegCb[region]->heapSize);
#endif
SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "Heap Allocated: %u\n",
- (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
+ (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
#else
sprintf(prntBuf, "Heap Allocated: %lu\n",
- (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
+ (mtCMMRegCb[region]->heapSize - mtCMMRegCb[region]->heapCb.avlSize));
#endif
SDisplay(0, prntBuf);
*availmem = *availmem + mtCMMRegCb[region]->heapCb.avlSize;
#if (ERRCLASS & ERRCLS_DEBUG)
sprintf(prntBuf, "Heap Segmented blocks: %d\n",
- mtCMMRegCb[region]->heapCb.numFragBlk);
+ mtCMMRegCb[region]->heapCb.numFragBlk);
SDisplay(0, prntBuf);
#endif
uint32_t SMemMidThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
uint32_t SMemLowThreshold[SSI_MAX_REG_THRESHOLD][SSI_MAX_BKT_THRESHOLD] = {{0}};
-static Void SInitMemThreshold
+ static Void SInitMemThreshold
(
-Region region,
-uint8_t maxBkt
-)
+ Region region,
+ uint8_t maxBkt
+ )
{
uint8_t idx = 0;
for (idx = 0; (idx < maxBkt && idx < mtCMMRegCb[region]->numBkts); idx++)
SMemMaxThreshold[region][idx] = (mtCMMRegCb[region]->bktTbl[idx].numBlks*95)/100;
SMemMidThreshold[region][idx] = (mtCMMRegCb[region]->bktTbl[idx].numBlks*85)/100;
SMemLowThreshold[region][idx] = (mtCMMRegCb[region]->bktTbl[idx].numBlks*80)/100;
- printf("REGION:%d, BKT:%d max:%d mid:%d low:%d\n", region, idx, SMemMaxThreshold[region][idx], SMemMidThreshold[region][idx], SMemLowThreshold[region][idx]);
+ printf("\nREGION:%d, BKT:%d max:%d mid:%d low:%d\n", region, idx, SMemMaxThreshold[region][idx], SMemMidThreshold[region][idx], SMemLowThreshold[region][idx]);
}
}
-S16 SRegReachedMemThreshold
+ S16 SRegReachedMemThreshold
(
-Region region,
-uint8_t maxBkt
-)
+ Region region,
+ uint8_t maxBkt
+ )
{
uint8_t idx = 0;
uint8_t memStatus = 3;
{
if(mtCMMRegCb[region]->bktTbl[idx].numAlloc >= SMemMaxThreshold[region][idx])
{
- memStatus = 0;
- break;
+ memStatus = 0;
+ break;
}
else if((mtCMMRegCb[region]->bktTbl[idx].numAlloc >= SMemMidThreshold[region][idx]) && (memStatus >1))
{
- memStatus = 1;
+ memStatus = 1;
}
else if((mtCMMRegCb[region]->bktTbl[idx].numAlloc >= SMemLowThreshold[region][idx]) && (memStatus >2))
{
- memStatus = 2;
+ memStatus = 2;
}
}
return (memStatus);
#endif
/* mt033.201 - addition of API to return the memory statistical data */
/*
-*
-* Fun: SGetRegInfo
-*
-* Desc: This function returns the memory usage information
-* for the destined region. It will return the usage of
-* each configured bucket and the heap for the specified region.
-*
-* Ret: ROK OK
-* RFAILED Region not registered
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 SGetRegInfo
+ *
+ * Fun: SGetRegInfo
+ *
+ * Desc: This function returns the memory usage information
+ * for the destined region. It will return the usage of
+ * each configured bucket and the heap for the specified region.
+ *
+ * Ret: ROK OK
+ * RFAILED Region not registered
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SGetRegInfo
(
-Region region,
-SsMemDbgInfo *dbgInfo
-)
+ Region region,
+ SsMemDbgInfo *dbgInfo
+ )
{
uint32_t idx;
dbgInfo->bktDbgTbl[idx].numAlloc = mtCMMRegCb[region]->bktTbl[idx].numAlloc;
dbgInfo->availmem += (mtCMMRegCb[region]->bktTbl[idx].size * \
- (mtCMMRegCb[region]->bktTbl[idx].numBlks - \
- mtCMMRegCb[region]->bktTbl[idx].numAlloc));
+ (mtCMMRegCb[region]->bktTbl[idx].numBlks - \
+ mtCMMRegCb[region]->bktTbl[idx].numAlloc));
}
dbgInfo->region = region;
dbgInfo->heapSize = mtCMMRegCb[region]->heapSize;
dbgInfo->heapAlloc = (mtCMMRegCb[region]->heapSize - \
- mtCMMRegCb[region]->heapCb.avlSize);
+ mtCMMRegCb[region]->heapCb.avlSize);
dbgInfo->availmem += mtCMMRegCb[region]->heapCb.avlSize;
return ROK;
}
-S16 SGetRegPoolInfo
+ S16 SGetRegPoolInfo
(
-uint8_t *numRegion,
-uint8_t *numPool
-)
+ uint8_t *numRegion,
+ uint8_t *numPool
+ )
{
/* Send number of Region available */
*numRegion = mtMemoCfg.numRegions;
* for the destined region. It will show the total memory
* used for static and dynamic memory if typeFlag is
* SS_MEM_BKT_ALLOC_PROFILE. It will show the number of
-* memory block allocated for a particular size if typeFlag
-* is SS_MEM_BLK_SIZE_PROFILE from the hash list by
-* calling SRegPrintMemStats.
-*
-* Ret: ROK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 SPrintRegMemStatusInfo
+ * memory block allocated for a particular size if typeFlag
+ * is SS_MEM_BLK_SIZE_PROFILE from the hash list by
+ * calling SRegPrintMemStats.
+ *
+ * Ret: ROK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SPrintRegMemStatusInfo
(
-Region region,
-uint8_t typeFlag
-)
+ Region region,
+ uint8_t typeFlag
+ )
{
Txt prntBuf[150];
uint32_t idx;
SDisplay(0, prntBuf);
for (idx = 0; idx < mtCMMRegCb[region]->numBkts; idx++)
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, "%2u %8u %8u\n", idx,
- mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
- mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
+ sprintf(prntBuf, "%2u %8u %8u\n", idx,
+ mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
+ mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
#else
- sprintf(prntBuf, "%2lu %8lu %8lu\n", idx,
- mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
- mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
-#endif
- SDisplay(0, prntBuf);
- /* update the total count */
- statMemSize += mtCMMRegCb[region]->bktTbl[idx].staticMemUsed;
- dynMemSize += mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed;
+ sprintf(prntBuf, "%2lu %8lu %8lu\n", idx,
+ mtCMMRegCb[region]->bktTbl[idx].staticMemUsed,
+ mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed);
+#endif
+ SDisplay(0, prntBuf);
+ /* update the total count */
+ statMemSize += mtCMMRegCb[region]->bktTbl[idx].staticMemUsed;
+ dynMemSize += mtCMMRegCb[region]->bktTbl[idx].dynamicMemUsed;
}
/* from buckets */
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "Total Static Memory allocated from buckets: %u\n", statMemSize);
SDisplay(0, prntBuf);
/* from heap */
sprintf(prntBuf, "\n\nAllocated Memory profile from Heap of region: %d \n", region);
SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "STATIC MEMORY: %u DYNAMIC MEMORY:%u \n",
- mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
+ mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
#else
sprintf(prntBuf, "STATIC MEMORY: %lu DYNAMIC MEMORY:%lu \n",
- mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
+ mtCMMRegCb[region]->heapCb.staticHeapMemUsed, mtCMMRegCb[region]->heapCb.dynamicHeapMemUsed);
#endif
SDisplay(0, prntBuf);
}
}
/*
-*
-* Fun: SPrintRegMemStats
-*
-* Desc: This function displays the memory usage information for
-* the destined region. It will show the number of memory
-* block allocated for a particular size from the hash list.
-*
-* Ret: ROK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: SPrintRegMemStats
+ *
+ * Desc: This function displays the memory usage information for
+ * the destined region. It will show the number of memory
+ * block allocated for a particular size from the hash list.
+ *
+ * Ret: ROK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
static S16 SPrintRegMemStats(Region region)
{
CmMmHashListCp *hashListCp;
sprintf(prntBuf, "\n\nSize Vs. NumAttempts and Alloc/Dealloc profile of region %d\n", region);
SDisplay(0, prntBuf);
sprintf(prntBuf, "Maximum Entries: %u Current Entries: %u\n",
- hashListCp->numOfbins, hashListCp->numOfEntries);
+ hashListCp->numOfbins, hashListCp->numOfEntries);
SDisplay(0, prntBuf);
sprintf(prntBuf, "===================================\n");
SDisplay(0, prntBuf);
SDisplay(0, prntBuf);
for (idx = 0, cntEnt=0; (cntEnt < hashListCp->numOfEntries) &&
- (idx < CMM_STAT_HASH_TBL_LEN); idx++)
+ (idx < CMM_STAT_HASH_TBL_LEN); idx++)
{
if (hashListCp->hashList[idx].numAttempts)
{
- cntEnt++;
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ cntEnt++;
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, "%8u %8u\n", hashListCp->hashList[idx].size,
- hashListCp->hashList[idx].numAttempts);
+ sprintf(prntBuf, "%8u %8u\n", hashListCp->hashList[idx].size,
+ hashListCp->hashList[idx].numAttempts);
#else
- sprintf(prntBuf, "%8lu %8lu\n", hashListCp->hashList[idx].size,
- hashListCp->hashList[idx].numAttempts);
+ sprintf(prntBuf, "%8lu %8lu\n", hashListCp->hashList[idx].size,
+ hashListCp->hashList[idx].numAttempts);
#endif
- SDisplay(0, prntBuf);
+ SDisplay(0, prntBuf);
}
}
/* Print the statistics of total number of alloc/de-alloc attempts in each bucket of this region */
for (idx = 0; idx < mtCMMRegCb[region]->numBkts; idx++)
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "%4u %8u %8u\n", idx,
- mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
- mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
+ mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
+ mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
#else
sprintf(prntBuf, "%4lu %8lu %8lu\n", idx,
- mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
- mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
+ mtCMMRegCb[region]->bktTbl[idx].numAllocAttempts,
+ mtCMMRegCb[region]->bktTbl[idx].numDeallocAttempts);
#endif
SDisplay(0, prntBuf);
}
sprintf(prntBuf, "\nAllocation/De-allocation profile in Heap\n");
SDisplay(0, prntBuf);
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "Num of Alloc Attempts: %u Num of De-alloc Attempts: %u\n",
- mtCMMRegCb[region]->heapCb.numAllocAttempts,
- mtCMMRegCb[region]->heapCb.numDeallocAttempts);
+ mtCMMRegCb[region]->heapCb.numAllocAttempts,
+ mtCMMRegCb[region]->heapCb.numDeallocAttempts);
#else
sprintf(prntBuf, "Num of Alloc Attempts: %lu Num of De-alloc Attempts: %lu\n",
- mtCMMRegCb[region]->heapCb.numAllocAttempts,
- mtCMMRegCb[region]->heapCb.numDeallocAttempts);
+ mtCMMRegCb[region]->heapCb.numAllocAttempts,
+ mtCMMRegCb[region]->heapCb.numDeallocAttempts);
#endif
SDisplay(0, prntBuf);
sprintf(prntBuf, "\n");
}
/*
-*
-* Fun: SRegMemErrHdlr
-*
-* Desc: This function handles the errors returned from the memory
-* related functions. Customers are suggested to modify this
-* API according to their specific requirement.
-*
-* Ret: ROK OK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-Void SRegMemErrHdlr
+ *
+ * Fun: SRegMemErrHdlr
+ *
+ * Desc: This function handles the errors returned from the memory
+ * related functions. Customers are suggested to modify this
+ * API according to their specific requirement.
+ *
+ * Ret: ROK OK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ Void SRegMemErrHdlr
(
-Region region,
-Data *ptr,
-S16 errCode
-)
+ Region region,
+ Data *ptr,
+ S16 errCode
+ )
{
Txt prntBuf[150];
}
/*
-*
-* Fun: SPrintRegMemProfile
-*
-* Desc: This function displays the memory profile information
-* for the destined region. This function prints for:
-* 1) each memory bucket-Block address, size, size for which it is allocated, free/allocated, static/dynamic
-* 2) heap - memory block address, size, requested size, free/allocated, static/dynamic
-*
-* Ret: ROK OK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
-S16 SPrintRegMemProfile
+ *
+ * Fun: SPrintRegMemProfile
+ *
+ * Desc: This function displays the memory profile information
+ * for the destined region. This function prints for:
+ * 1) each memory bucket-Block address, size, size for which it is allocated, free/allocated, static/dynamic
+ * 2) heap - memory block address, size, requested size, free/allocated, static/dynamic
+ *
+ * Ret: ROK OK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
+ S16 SPrintRegMemProfile
(
-Region region
-)
+ Region region
+ )
{
CmMmHeapCb *heapCb;
CmMmRegCb *regCb;
for (idx = 0; idx < regCb->numBkts; idx++)
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "\nBucket number:%4u of Size:%u Num of Blocks: %u\n",
- idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
+ idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
#else
sprintf(prntBuf, "\nBucket number:%4lu of Size:%lu Num of Blocks: %lu\n",
- idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
+ idx, regCb->bktTbl[idx].size, regCb->bktTbl[idx].numBlks);
#endif
SDisplay(0, prntBuf);
offsetToNxtBlk = regCb->bktTbl[idx].size + sizeof(CmMmBlkHdr);
for (blkCnt=0, curBktBlk = (CmMmBlkHdr *)(regCb->bktTbl[idx].bktStartPtr);
- ((curBktBlk) && (blkCnt < regCb->bktTbl[idx].numBlks));
- curBktBlk = (CmMmBlkHdr *)((Data *)curBktBlk + offsetToNxtBlk), blkCnt++)
+ ((curBktBlk) && (blkCnt < regCb->bktTbl[idx].numBlks));
+ curBktBlk = (CmMmBlkHdr *)((Data *)curBktBlk + offsetToNxtBlk), blkCnt++)
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, "%6u %8p", blkCnt, (void *)curBktBlk);
+ sprintf(prntBuf, "%6u %8p", blkCnt, (void *)curBktBlk);
#else
- sprintf(prntBuf, "%6lu %8p", blkCnt, (void *)curBktBlk);
+ sprintf(prntBuf, "%6lu %8p", blkCnt, (void *)curBktBlk);
#endif
- SDisplay(0, prntBuf);
- /* check if it is a sane block, elxe jump to next block */
- if (cmMmRegIsBlkSane(curBktBlk) != ROK)
- {
- sprintf(prntBuf, " Trampled \n");
- SDisplay(0, prntBuf);
+ SDisplay(0, prntBuf);
+ /* check if it is a sane block, elxe jump to next block */
+ if (cmMmRegIsBlkSane(curBktBlk) != ROK)
+ {
+ sprintf(prntBuf, " Trampled \n");
+ SDisplay(0, prntBuf);
- continue;
- }
+ continue;
+ }
- if (CMM_IS_STATIC(curBktBlk->memFlags))
- {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ if (CMM_IS_STATIC(curBktBlk->memFlags))
+ {
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, " Allocated Static %8u\n", curBktBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Static %8u\n", curBktBlk->requestedSize);
#else
- sprintf(prntBuf, " Allocated Static %8lu\n", curBktBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Static %8lu\n", curBktBlk->requestedSize);
#endif
- SDisplay(0, prntBuf);
- }
- else if (CMM_IS_DYNAMIC(curBktBlk->memFlags))
- {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ SDisplay(0, prntBuf);
+ }
+ else if (CMM_IS_DYNAMIC(curBktBlk->memFlags))
+ {
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, " Allocated Dynamic %8u\n", curBktBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Dynamic %8u\n", curBktBlk->requestedSize);
#else
- sprintf(prntBuf, " Allocated Dynamic %8lu\n", curBktBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Dynamic %8lu\n", curBktBlk->requestedSize);
#endif
- SDisplay(0, prntBuf);
- }
- else if (CMM_IS_FREE(curBktBlk->memFlags))
- {
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ SDisplay(0, prntBuf);
+ }
+ else if (CMM_IS_FREE(curBktBlk->memFlags))
+ {
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, " Free %8u\n", curBktBlk->requestedSize);
+ sprintf(prntBuf, " Free %8u\n", curBktBlk->requestedSize);
#else
- sprintf(prntBuf, " Free %8lu\n", curBktBlk->requestedSize);
-#endif
- SDisplay(0, prntBuf);
- }
- else
- {
- sprintf(prntBuf, " Trampled \n");
- SDisplay(0, prntBuf);
- }
+ sprintf(prntBuf, " Free %8lu\n", curBktBlk->requestedSize);
+#endif
+ SDisplay(0, prntBuf);
+ }
+ else
+ {
+ sprintf(prntBuf, " Trampled \n");
+ SDisplay(0, prntBuf);
+ }
}
}
/* traverse the entire heap to output the heap profile */
hdrSize = sizeof(CmHEntry);
for (blkCnt=0, curHBlk = (CmHEntry *)heapCb->vStart;
- ((curHBlk) && (curHBlk < (CmHEntry *)heapCb->vEnd)); blkCnt++)
+ ((curHBlk) && (curHBlk < (CmHEntry *)heapCb->vEnd)); blkCnt++)
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, "%6u %8p", blkCnt, (void *)curHBlk);
#else
/* check if it is a sane block, elxe jump to next block */
if (cmMmRegIsBlkSane((CmMmBlkHdr *)curHBlk) != ROK)
{
- sprintf(prntBuf, " Trampled \n");
- SDisplay(0, prntBuf);
-
- sprintf(prntBuf, "Trampled block encountered: Stopping heap profile\n");
- SDisplay(0, prntBuf);
-
- /*
- * To go to next block in the heap we do not have any offset value
- * other than curHBlk->size. As the block is already trampled
- * we cannot rely on this size. So it is better to stop here unless there
- * exists any other mechanism(?) to know the offset to next block.
- */
- return ROK;
+ sprintf(prntBuf, " Trampled \n");
+ SDisplay(0, prntBuf);
+
+ sprintf(prntBuf, "Trampled block encountered: Stopping heap profile\n");
+ SDisplay(0, prntBuf);
+
+ /*
+ * To go to next block in the heap we do not have any offset value
+ * other than curHBlk->size. As the block is already trampled
+ * we cannot rely on this size. So it is better to stop here unless there
+ * exists any other mechanism(?) to know the offset to next block.
+ */
+ return ROK;
}
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(prntBuf, " %8u", curHBlk->size);
#else
if (CMM_IS_STATIC(curHBlk->memFlags))
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, " Allocated Static %8u\n", curHBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Static %8u\n", curHBlk->requestedSize);
#else
- sprintf(prntBuf, " Allocated Static %8lu\n", curHBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Static %8lu\n", curHBlk->requestedSize);
#endif
- SDisplay(0, prntBuf);
+ SDisplay(0, prntBuf);
}
else if (CMM_IS_DYNAMIC(curHBlk->memFlags))
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, " Allocated Dynamic %8u\n", curHBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Dynamic %8u\n", curHBlk->requestedSize);
#else
- sprintf(prntBuf, " Allocated Dynamic %8lu\n", curHBlk->requestedSize);
+ sprintf(prntBuf, " Allocated Dynamic %8lu\n", curHBlk->requestedSize);
#endif
- SDisplay(0, prntBuf);
+ SDisplay(0, prntBuf);
}
else if (CMM_IS_FREE(curHBlk->memFlags))
{
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
- sprintf(prntBuf, " Free %8u\n", curHBlk->requestedSize);
+ sprintf(prntBuf, " Free %8u\n", curHBlk->requestedSize);
#else
- sprintf(prntBuf, " Free %8lu\n", curHBlk->requestedSize);
+ sprintf(prntBuf, " Free %8lu\n", curHBlk->requestedSize);
#endif
- SDisplay(0, prntBuf);
+ SDisplay(0, prntBuf);
}
else
{
- sprintf(prntBuf, " Trampled \n");
- SDisplay(0, prntBuf);
+ sprintf(prntBuf, " Trampled \n");
+ SDisplay(0, prntBuf);
}
/* goto next block in the heap */
curHBlk = (CmHEntry *)((Data *)curHBlk + hdrSize + curHBlk->size);
/*-- mt035.201 : Added new API for timestamp --*/
/*--
-*
-* Fun: Get TimeStamp
-*
-* Desc: This function is used to Get TimeStamp in micro seconds
-*
-* Ret: ROK - ok
-* RFAILED - error
-*
-* Notes:
-*
-* File: mt_ss.c
-*
---*/
-S16 SGetTimeStamp
+ *
+ * Fun: Get TimeStamp
+ *
+ * Desc: This function is used to Get TimeStamp in micro seconds
+ *
+ * Ret: ROK - ok
+ * RFAILED - error
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ --*/
+ S16 SGetTimeStamp
(
-S8 *ts
-)
+ S8 *ts
+ )
{
#ifndef SS_LINUX
#ifndef SS_LINUX
- clock_gettime(CLOCK_REALTIME, &ptime);
+ clock_gettime(CLOCK_REALTIME, &ptime);
#else
- gettimeofday(&ptime, NULL);
+ gettimeofday(&ptime, NULL);
#endif
/* Obtain the time of day, and convert it to a tm struct. --*/
/* Klock work fix ccpu00148484 */
if(ptm != NULLP)
{
- /* Format the date and time, down to a single second. --*/
- strftime (time_string, sizeof (time_string), "%a %b %d %Y %H:%M:%S", ptm);
+ /* Format the date and time, down to a single second. --*/
+ strftime (time_string, sizeof (time_string), "%a %b %d %Y %H:%M:%S", ptm);
}
/* Compute microseconds. --*/
/* Print the formatted time, in seconds, followed by a decimal point
and the microseconds. --*/
-/*mt009.301 Fixed 64BIT compilation warnings*/
+ /*mt009.301 Fixed 64BIT compilation warnings*/
#ifdef ALIGN_64BIT
sprintf(ts, "%s.%03d", time_string, microseconds);
#else
}
/*-- mt037.201 : Added new API for SGetSystemTsk --*/
/*
-*
-* Fun: Get SGetSystemTsk
-*
-* Desc: This function is used to Get sytem task id
-*
-* Ret: task id
-*
-* Notes:
-*
-* File: mt_ss.c
-*
---*/
+ *
+ * Fun: Get SGetSystemTsk
+ *
+ * Desc: This function is used to Get sytem task id
+ *
+ * Ret: task id
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ --*/
uint32_t SGetSystemTsk(Void)
{
#ifdef SS_MULTICORE_SUPPORT
/*
-*
-* Fun: Add Timer thread into system task table
-*
-* Desc: This function is used to add the system task
-* associated with Timer thread.
-*
-* Ret: None
-*
-* Notes:
-*
-* File: mt_ss.c
-*
---*/
+ *
+ * Fun: Add Timer thread into system task table
+ *
+ * Desc: This function is used to add the system task
+ * associated with Timer thread.
+ *
+ * Ret: None
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ --*/
static SsSTskEntry* ssdAddTmrSTsk(Void)
{
SsSTskEntry *sTsk;
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT039, (ErrVal) ret,
- "Could not lock system task table");
+ "Could not lock system task table");
#endif
return (sTsk);
if ( SUnlock(&osCp.sTskTblLock) != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT040, ERRZERO,
- "Could not give the Semaphore");
- return (sTsk);
+ MTLOGERROR(ERRCLS_DEBUG, EMT040, ERRZERO,
+ "Could not give the Semaphore");
+ return (sTsk);
#endif
}
if ( SUnlock(&osCp.sTskTblLock) != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
- "Could not give the Semaphore");
- return (NULLP);
+ MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
+ "Could not give the Semaphore");
+ return (NULLP);
#endif
}
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT043, (ErrVal) ret,
- "Could not initialize demand queue");
+ "Could not initialize demand queue");
#endif
return (NULLP);
if ( SUnlock(&osCp.sTskTblLock) != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
- "Could not give the Semaphore");
- return (NULLP);
+ MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
+ "Could not give the Semaphore");
+ return (NULLP);
#endif
}
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT045, (ErrVal) ret,
- "Could not initialize system task entry lock");
+ "Could not initialize system task entry lock");
#endif
return (NULLP);
/* unlock the system task table */
- if ( SUnlock(&osCp.sTskTblLock) != ROK)
- {
+ if ( SUnlock(&osCp.sTskTblLock) != ROK)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
- "Could not give the Semaphore");
- return (NULLP);
+ MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
+ "Could not give the Semaphore");
+ return (NULLP);
#endif
- }
+ }
return (sTsk);
}
/* mt003.301 Readwrite lock and recursive mutex additions */
#ifdef SS_LOCK_SUPPORT
/*
-*
-* Fun: ssdInitLockNew
-*
-* Desc: This function is used to initialise lock/mutex
-*
-* Ret: ROK OK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdInitLockNew
+ *
+ * Desc: This function is used to initialise lock/mutex
+ *
+ * Ret: ROK OK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdInitLockNew(SLockInfo *lockId,uint8_t lockType)
{
#ifdef SS_REC_LOCK_SUPPORT
- pthread_mutexattr_t attr;
+ pthread_mutexattr_t attr;
#endif /* SS_REC_LOCK_SUPPORT */
Txt prntBuf[PRNTSZE];
S16 retVal = ROK;
{
#ifdef SS_RDWR_LOCK_SUPPORT
case SRDWRLOCK :
- {
- if((retVal = pthread_rwlock_init((&(lockId->l.rdWrLockId)), NULLP)) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdInitLockNew(): Initialization of read write lock failed,Error# retVal %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_init((&(lockId->l.rdWrLockId)), NULLP)) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdInitLockNew(): Initialization of read write lock failed,Error# retVal %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_RDWR_LOCK_SUPPORT */
#ifdef SS_REC_LOCK_SUPPORT
- case SMUTEXRECUR:
- {
- retVal = pthread_mutexattr_init(&attr);
-
- if(retVal != 0)
- {
- sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr init failed,Error# %d \n",retVal);
- SPrint(prntBuf);
- return RFAILED;
- }
+ case SMUTEXRECUR:
+ {
+ retVal = pthread_mutexattr_init(&attr);
+
+ if(retVal != 0)
+ {
+ sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr init failed,Error# %d \n",retVal);
+ SPrint(prntBuf);
+ return RFAILED;
+ }
#ifdef SS_LINUX
- retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
+ retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);
#else
- retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
-#endif
- if(retVal != 0)
- {
- sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr settype failed,Error# %d \n",retVal);
- pthread_mutexattr_destroy(&attr);
- SPrint(prntBuf);
- return RFAILED;
- }
- retVal = pthread_mutex_init((pthread_mutex_t *)&(lockId->l.recurLock), &attr);
- if(retVal != 0)
- {
- sprintf(prntBuf,"\n ssdInitLockNew(): mutex init failed,Error# %d \n",retVal);
- pthread_mutexattr_destroy(&attr);
- SPrint(prntBuf);
- return RFAILED;
- }
- break;
- }
+ retVal = pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+#endif
+ if(retVal != 0)
+ {
+ sprintf(prntBuf,"\n ssdInitLockNew(): mutexattr settype failed,Error# %d \n",retVal);
+ pthread_mutexattr_destroy(&attr);
+ SPrint(prntBuf);
+ return RFAILED;
+ }
+ retVal = pthread_mutex_init((pthread_mutex_t *)&(lockId->l.recurLock), &attr);
+ if(retVal != 0)
+ {
+ sprintf(prntBuf,"\n ssdInitLockNew(): mutex init failed,Error# %d \n",retVal);
+ pthread_mutexattr_destroy(&attr);
+ SPrint(prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_REC_LOCK_SUPPORT */
default :
- {
- sprintf(prntBuf, "\n\n ssdInitLockNew(): Invalid lock type %d\n", lockType);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
+ {
+ sprintf(prntBuf, "\n\n ssdInitLockNew(): Invalid lock type %d\n", lockType);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
}
return ROK;
}
/*
-*
-* Fun: ssdLockNew
-*
-* Desc: This function is used to aquire the read write lock
-*
-* Ret: ROK OK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdLockNew
+ *
+ * Desc: This function is used to aquire the read write lock
+ *
+ * Ret: ROK OK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdLockNew(SLockInfo *lockId,uint8_t lockType)
{
{
#ifdef SS_RDWR_LOCK_SUPPORT
case SRDLOCK :
- {
- if((retVal = pthread_rwlock_rdlock(&(lockId->l.rdWrLockId))) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_rdlock(&(lockId->l.rdWrLockId))) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
case SWRLOCK :
- {
- if((retVal = pthread_rwlock_wrlock(&(lockId->l.rdWrLockId))) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the write lock,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_wrlock(&(lockId->l.rdWrLockId))) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the write lock,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
case STRYRDLOCK :
- {
- if((retVal = pthread_rwlock_tryrdlock(&(lockId->l.rdWrLockId))) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_tryrdlock(&(lockId->l.rdWrLockId))) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
case STRYWRLOCK:
- {
- if((retVal = pthread_rwlock_trywrlock(&(lockId->l.rdWrLockId))) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_trywrlock(&(lockId->l.rdWrLockId))) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the read lock,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_RDWR_LOCK_SUPPORT */
#ifdef SS_REC_LOCK_SUPPORT
- case SMUTEXRECUR:
- {
- if((retVal = pthread_mutex_lock(&(lockId->l.recurLock)) != ROK))
- {
- sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ case SMUTEXRECUR:
+ {
+ if((retVal = pthread_mutex_lock(&(lockId->l.recurLock)) != ROK))
+ {
+ sprintf(prntBuf, "\n\n ssdLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_REC_LOCK_SUPPORT */
default :
- {
- sprintf(prntBuf, "\n\n ssdLockNew(): Invalid lock type %d\n", lockType);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
+ {
+ sprintf(prntBuf, "\n\n ssdLockNew(): Invalid lock type %d\n", lockType);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
}
return ROK;
/*
-*
-* Fun: ssdUnlockNew
-*
-* Desc: This function is used to Unlock the read write lock
-*
-* Ret: ROK OK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdUnlockNew
+ *
+ * Desc: This function is used to Unlock the read write lock
+ *
+ * Ret: ROK OK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdUnlockNew(SLockInfo *lockId,uint8_t lockType)
{
{
#ifdef SS_RDWR_LOCK_SUPPORT
case SRDWRLOCK :
- {
- if((retVal = pthread_rwlock_unlock(&(lockId->l.rdWrLockId))) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to unlock the lock,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_unlock(&(lockId->l.rdWrLockId))) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to unlock the lock,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_RDWR_LOCK_SUPPORT */
#ifdef SS_REC_LOCK_SUPPORT
- case SMUTEXRECUR:
- {
- if((retVal = pthread_mutex_unlock(&(lockId->l.recurLock)) != ROK))
- {
- sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ case SMUTEXRECUR:
+ {
+ if((retVal = pthread_mutex_unlock(&(lockId->l.recurLock)) != ROK))
+ {
+ sprintf(prntBuf, "\n\n ssdUnLockNew(): Failed to aquire the recursive mutex,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_REC_LOCK_SUPPORT */
default :
- {
- sprintf(prntBuf, "\n\n ssdUnlockNew(): Invalid lock type %d\n", lockType);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
+ {
+ sprintf(prntBuf, "\n\n ssdUnlockNew(): Invalid lock type %d\n", lockType);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
}
return ROK;
}
/*
-*
-* Fun: ssdDestroyLockNew
-*
-* Desc: This function is used to destroy the read write lock
-*
-* Ret: ROK OK
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: ssdDestroyLockNew
+ *
+ * Desc: This function is used to destroy the read write lock
+ *
+ * Ret: ROK OK
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdDestroyLockNew(SLockInfo *lockId,uint8_t lockType)
{
Txt prntBuf[PRNTSZE];
{
#ifdef SS_RDWR_LOCK_SUPPORT
case SRDWRLOCK :
- {
- if((retVal = pthread_rwlock_destroy(&(lockId->l.rdWrLockId))) != ROK)
- {
- sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the lock,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ {
+ if((retVal = pthread_rwlock_destroy(&(lockId->l.rdWrLockId))) != ROK)
+ {
+ sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the lock,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_RDWR_LOCK_SUPPORT */
#ifdef SS_REC_LOCK_SUPPORT
- case SMUTEXRECUR:
- {
- if((retVal = pthread_mutex_destroy(&(lockId->l.recurLock)) != ROK))
- {
- sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the mutex,Error# %d\n", retVal);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
- break;
- }
+ case SMUTEXRECUR:
+ {
+ if((retVal = pthread_mutex_destroy(&(lockId->l.recurLock)) != ROK))
+ {
+ sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Failed to destroy the mutex,Error# %d\n", retVal);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
+ break;
+ }
#endif /* SS_REC_LOCK_SUPPORT */
default :
- {
- sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Invalid lock type %d\n", lockType);
- SDisplay(0, prntBuf);
- return RFAILED;
- }
+ {
+ sprintf(prntBuf, "\n\n ssdDestroyLockNew(): Invalid lock type %d\n", lockType);
+ SDisplay(0, prntBuf);
+ return RFAILED;
+ }
}
return ROK;
}
**/
S16 ssInitRcvWork(void)
{
- pthread_attr_t attr;
- pthread_t thread;
+ pthread_attr_t attr;
+ pthread_t thread;
- /* set the required attributes */
- pthread_attr_init(&attr);
- pthread_attr_setstacksize(&attr, (size_t)MT_ISTASK_STACK);
- pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ /* set the required attributes */
+ pthread_attr_init(&attr);
+ pthread_attr_setstacksize(&attr, (size_t)MT_ISTASK_STACK);
+ pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
- /* Create a new thread to receive the work queue messages */
- if ((pthread_create(&thread, &attr, workRcvTsk, NULLP)) != 0)
- {
- pthread_attr_destroy(&attr);
+ /* Create a new thread to receive the work queue messages */
+ if ((pthread_create(&thread, &attr, workRcvTsk, NULLP)) != 0)
+ {
+ pthread_attr_destroy(&attr);
- return RFAILED;
- }
+ return RFAILED;
+ }
- pthread_attr_destroy(&attr);
+ pthread_attr_destroy(&attr);
- return ROK;
+ return ROK;
}/* ssInitRcvWork */
static void *workRcvTsk(Ptr ptr)
{
- cvmx_wqe_t *workPtr;
- Buffer *mBuf, *rcvdBuf;
- SsMsgInfo *minfoPtr;
- S16 ret;
- struct timespec ts;
- Pst pst;
-
+ cvmx_wqe_t *workPtr;
+ Buffer *mBuf, *rcvdBuf;
+ SsMsgInfo *minfoPtr;
+ S16 ret;
+ struct timespec ts;
+ Pst pst;
- for (;;)
- {
- /* get the work if its avilable */
- workPtr = cvmx_pow_work_request_sync(CVMX_POW_NO_WAIT);
- if ( workPtr == NULLP )
- {
- /* If there is no work then sleep for 10 usec */
- ts.tv_sec = 0;
- ts.tv_nsec = 500000;
+ for (;;)
+ {
+ /* get the work if its avilable */
+ workPtr = cvmx_pow_work_request_sync(CVMX_POW_NO_WAIT);
- nanosleep(&ts, NULLP);
- continue;
- }
+ if ( workPtr == NULLP )
+ {
+ /* If there is no work then sleep for 10 usec */
+ ts.tv_sec = 0;
+ ts.tv_nsec = 500000;
- switch(workPtr->tag)
- {
- /* Switch over according to the tag value */
- case SS_CVMX_MBUF_TAG:
-
- rcvdBuf = (Buffer*)workPtr->packet_ptr.ptr;
-
- /* Convert the physical address to Pointers */
- ret = SConvPhyPtr(&rcvdBuf);
- if (ret != ROK)
- {
- /* mt011.301: Cavium 32 bit changes */
- cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
- continue;
- }
-
- /* Copy the buffer to this region */
- ret = SCpyFpaMsg(rcvdBuf, SS_DFLT_REGION, SS_DFLT_POOL, &mBuf);
- if( ret != ROK )
- {
- /* mt011.301: Cavium 32 bit changes */
- cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
- continue;
- }
-
- /* mt011.301: Cavium 32 bit changes */
- cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
-
- minfoPtr = (SsMsgInfo*)mBuf->b_rptr;
-
- /* Get the post strucutre and Post the message */
- if ( minfoPtr != NULLP)
- {
- SMemCpy( &pst, &minfoPtr->pst, sizeof(Pst));
-
- (Void)SPstTsk(&pst, mBuf);
- }
- /* Free the buffer allocated if it cannot be sent */
- else
- {
- SPutMsg(mBuf);
- }
- break;
+ nanosleep(&ts, NULLP);
+ continue;
+ }
- default:
- {
- /* Invalid tag value, drop the work */
- /* mt011.301: Cavium 32 bit changes */
- cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
- continue;
- }
- break;
- }
+ switch(workPtr->tag)
+ {
+ /* Switch over according to the tag value */
+ case SS_CVMX_MBUF_TAG:
+
+ rcvdBuf = (Buffer*)workPtr->packet_ptr.ptr;
+
+ /* Convert the physical address to Pointers */
+ ret = SConvPhyPtr(&rcvdBuf);
+ if (ret != ROK)
+ {
+ /* mt011.301: Cavium 32 bit changes */
+ cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+ continue;
+ }
+
+ /* Copy the buffer to this region */
+ ret = SCpyFpaMsg(rcvdBuf, SS_DFLT_REGION, SS_DFLT_POOL, &mBuf);
+ if( ret != ROK )
+ {
+ /* mt011.301: Cavium 32 bit changes */
+ cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+ continue;
+ }
+
+ /* mt011.301: Cavium 32 bit changes */
+ cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+
+ minfoPtr = (SsMsgInfo*)mBuf->b_rptr;
+
+ /* Get the post strucutre and Post the message */
+ if ( minfoPtr != NULLP)
+ {
+ SMemCpy( &pst, &minfoPtr->pst, sizeof(Pst));
+
+ (Void)SPstTsk(&pst, mBuf);
+ }
+ /* Free the buffer allocated if it cannot be sent */
+ else
+ {
+ SPutMsg(mBuf);
+ }
+ break;
+
+ default:
+ {
+ /* Invalid tag value, drop the work */
+ /* mt011.301: Cavium 32 bit changes */
+ cvmx_fpa_free(workPtr, SS_CVMX_WQE_POOL, 0);
+ continue;
+ }
+ break;
+ }
- }
+ }
} /* workRcvTsk */
#endif /* SS_SEUM_CAVIUM */
if(SS_INVALID_THREAD_REG_MAP != SS_GET_THREAD_MEM_REGION())
{
- printf("not able to get different Id for main thread\n");
+ printf("\nnot able to get different Id for main thread\n");
exit(1);
}
/* Here the default region is added as we dont have any region associated with
#else
SS_GET_THREAD_MEM_REGION() =
#endif
- DFLT_REGION;
+ DFLT_REGION;
}
/*
* File: mt_ss.c
*
*/
-S32 ssCheckAndAddMemoryRegionMap
+ S32 ssCheckAndAddMemoryRegionMap
(
-pthread_t threadId, /* Thread Id of system task */
-Region region /* Region associated with thread */
-)
+ pthread_t threadId, /* Thread Id of system task */
+ Region region /* Region associated with thread */
+ )
{
static uint32_t createdThreads;
static pthread_t createdThreadIds[SS_MAX_THREAD_CREATE_RETRY];
* contains 0xFF, that mapping entry is free
*/
if(SS_INVALID_THREAD_REG_MAP !=
- osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
+ osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
{
/* Klock work fix ccpu00148484 */
if(!(createdThreads < SS_MAX_THREAD_CREATE_RETRY))
{
- printf("failed in index = %ld\n", ((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP));
- printf("Not able to get the different thread ID, exiting\n");
- exit(1);
+ printf("\nfailed in index = %ld\n", ((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP));
+ printf("\nNot able to get the different thread ID, exiting\n");
+ exit(1);
}
createdThreadIds[createdThreads++] = threadId;
return (FALSE);
*/
osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)] = region;
#ifdef XEON_SPECIFIC_CHANGES
- printf("ThreadId %ld, Thread Idx %d, Region %d\n", threadId,
- ((threadId >> SS_MEM_THREAD_ID_SHIFT) %
- SS_MAX_THREAD_REGION_MAP), region);
+ printf("\nThreadId %ld, Thread Idx %d, Region %d\n", threadId,
+ ((threadId >> SS_MEM_THREAD_ID_SHIFT) %
+ SS_MAX_THREAD_REGION_MAP), region);
#endif
for(indx = 0; indx < createdThreads; indx++)
{
#ifdef XEON_SPECIFIC_CHANGES
- printf("Sending pthred Cancel to thread Id %d \n",createdThreadIds[indx]);
+ printf("\nSending pthred Cancel to thread Id %d \n",createdThreadIds[indx]);
#endif
pthread_cancel(createdThreadIds[indx]);
}
* File: mt_ss.c
*
*/
-S32 ssCheckAndDelMemoryRegionMap
+ S32 ssCheckAndDelMemoryRegionMap
(
-pthread_t threadId /* Thread Id of system task */
-)
+ pthread_t threadId /* Thread Id of system task */
+ )
{
* contains 0xFF, that mapping entry is free
*/
if(SS_INVALID_THREAD_REG_MAP ==
- osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
+ osCp.threadMemoryRegionMap[((threadId >> SS_MEM_THREAD_ID_SHIFT) % SS_MAX_THREAD_REGION_MAP)])
{
#ifndef ALIGN_64BIT
- printf("Invalid Thread ID (%ld)\n", (uint32_t)threadId);
+ printf("\nInvalid Thread ID (%ld)\n", (uint32_t)threadId);
#else
- printf("Invalid Thread ID (%d)\n", (uint32_t)threadId);
+ printf("\nInvalid Thread ID (%d)\n", (uint32_t)threadId);
#endif
return RFAILED;
}
#endif
#ifdef SS_TSKLOG_ENABLE
/*
-*
-* Fun: SStartTask
-*
-* Desc: This function will return current time through input parameter.
-*
-* Ret: ROK - ok
-* RFAILED - failed, general (optional)
-*
-*
-* File: pt_ss.c
-*
-*/
-S16 SStartTask
+ *
+ * Fun: SStartTask
+ *
+ * Desc: This function will return current time through input parameter.
+ *
+ * Ret: ROK - ok
+ * RFAILED - failed, general (optional)
+ *
+ *
+ * File: pt_ss.c
+ *
+ */
+ S16 SStartTask
(
-volatile uint32_t *startTime,
-uint32_t taskId
-)
+ volatile uint32_t *startTime,
+ uint32_t taskId
+ )
{
#ifdef MSPD_MLOG_NEW
*startTime = GetTIMETICK();
}
\f
/*
-*
-* Fun: SStopTask
-*
-* Desc: This function will return current time through input parameter.
-* and take the difference of start time provided as input parameter
-* and current time.
-*
-* Ret: ROK - ok
-* RFAILED - failed, general (optional)
-*
-*
-* File: pt_ss.c
-*
-*/
-S16 SStopTask
+ *
+ * Fun: SStopTask
+ *
+ * Desc: This function will return current time through input parameter.
+ * and take the difference of start time provided as input parameter
+ * and current time.
+ *
+ * Ret: ROK - ok
+ * RFAILED - failed, general (optional)
+ *
+ *
+ * File: pt_ss.c
+ *
+ */
+ S16 SStopTask
(
-volatile uint32_t startTime,
-uint32_t taskId
-)
+ volatile uint32_t startTime,
+ uint32_t taskId
+ )
{
/*uint32_t stopTime;*/
switch(taskId)
case PID_RECPREQ_PROC:
#ifdef CA_PHY
#ifndef LTE_TDD
- MLogTask(0, taskId, RESOURCE_LARM, startTime, GetTIMETICK());
+ MLogTask(0, taskId, RESOURCE_LARM, startTime, GetTIMETICK());
#else
- MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
+ MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
#endif
#else
- MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
+ MLogTask(taskId, RESOURCE_LARM, startTime, GetTIMETICK());
#endif
- break;
+ break;
}
return ROK;
}
#else
-S16 SStartTask
+ S16 SStartTask
(
-volatile uint32_t * startTime,
-uint32_t taskId
-)
+ volatile uint32_t * startTime,
+ uint32_t taskId
+ )
{
*startTime = 0;
return ROK;
}
-S16 SStopTask
+ S16 SStopTask
(
-volatile uint32_t startTime,
-uint32_t taskId
-)
+ volatile uint32_t startTime,
+ uint32_t taskId
+ )
{
return ROK;
}
#endif /*#ifdef SS_TSKLOG_ENABLE */
#ifdef TENB_T2K3K_SPECIFIC_CHANGES
/** @details
-* This primitive is used to calculate the CPU Utilization per Core
-* for Intel T2200
-*
-* @param [in] Void
-*
-* @return Void - function is always success
-*/
-Void UpdateSocCpuInfo
+ * This primitive is used to calculate the CPU Utilization per Core
+ * for Intel T2200
+ *
+ * @param [in] Void
+ *
+ * @return Void - function is always success
+ */
+ Void UpdateSocCpuInfo
(
-CmCpuStatsInfo *cpuInfo,
-uint8_t idx
-)
+ CmCpuStatsInfo *cpuInfo,
+ uint8_t idx
+ )
{
FILE *mipsFd;
S8 mipsStr[MIPS_STRING_LEN];
/* Get the free mips available value from the file */
if(NULLP == fgets(mipsStr, 24, mipsFd))
{
- printf("fgets to get the free mips available failed\n");
+ printf("\nfgets to get the free mips available failed\n");
fclose(mipsFd);
return;
}
{
if(strPart != NULLP)
{
- l2FreeCpu = atoi(strPart);
- l2CpuUsed = 100 - l2FreeCpu;
- cpuInfo->cpuUtil[0].totCpuUtil += l2CpuUsed;
- cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l2CpuUsed);
- cpuInfo->cpuUtil[0].numSamples++;
+ l2FreeCpu = atoi(strPart);
+ l2CpuUsed = 100 - l2FreeCpu;
+ cpuInfo->cpuUtil[0].totCpuUtil += l2CpuUsed;
+ cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l2CpuUsed);
+ cpuInfo->cpuUtil[0].numSamples++;
}
}
if(idx == CM_L3_CPU_UTIL)
strPart = strtok(NULLP, " ");
if(strPart != NULLP)
{
- l3FreeCpu = atoi(strPart);
- l3CpuUsed = 100 - l3FreeCpu;
- cpuInfo->cpuUtil[0].totCpuUtil += l3CpuUsed;
- cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l3CpuUsed);
- cpuInfo->cpuUtil[0].numSamples++;
+ l3FreeCpu = atoi(strPart);
+ l3CpuUsed = 100 - l3FreeCpu;
+ cpuInfo->cpuUtil[0].totCpuUtil += l3CpuUsed;
+ cpuInfo->cpuUtil[0].maxCpuUtil = GET_CPU_MAX((cpuInfo->cpuUtil[0].maxCpuUtil), l3CpuUsed);
+ cpuInfo->cpuUtil[0].numSamples++;
}
}
if(idx == CM_L2_CPU_UTIL)
#endif /* TENB_T2K3K_SPECIFIC_CHANGES */
#ifdef SS_MULTICORE_SUPPORT
/*
-*
-* Fun: Add Timer thread into system task table
-*
-* Desc: This function is used to add the system task
-* associated with Timer thread.
-*
-* Ret: None
-*
-* Notes:
-*
-* File: mt_ss.c
-*
---*/
+ *
+ * Fun: Add Timer thread into system task table
+ *
+ * Desc: This function is used to add the system task
+ * associated with Timer thread.
+ *
+ * Ret: None
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ --*/
static SsSTskEntry* ssdReAddTmrSTsk(
-uint8_t idx
-)
+ uint8_t idx
+ )
{
SsSTskEntry *sTsk;
S16 ret;
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT039, (ErrVal) ret,
- "Could not lock system task table");
+ "Could not lock system task table");
#endif
return (sTsk);
if ( SUnlock(&osCp.sTskTblLock) != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
- "Could not give the Semaphore");
- return (NULLP);
+ MTLOGERROR(ERRCLS_DEBUG, EMT042, ERRZERO,
+ "Could not give the Semaphore");
+ return (NULLP);
#endif
}
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT043, (ErrVal) ret,
- "Could not initialize demand queue");
+ "Could not initialize demand queue");
#endif
return (NULLP);
if ( SUnlock(&osCp.sTskTblLock) != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
- "Could not give the Semaphore");
- return (NULLP);
+ MTLOGERROR(ERRCLS_DEBUG, EMT044, ERRZERO,
+ "Could not give the Semaphore");
+ return (NULLP);
#endif
}
#if (ERRCLASS & ERRCLS_DEBUG)
MTLOGERROR(ERRCLS_DEBUG, EMT045, (ErrVal) ret,
- "Could not initialize system task entry lock");
+ "Could not initialize system task entry lock");
#endif
return (NULLP);
/* unlock the system task table */
- if ( SUnlock(&osCp.sTskTblLock) != ROK)
- {
+ if ( SUnlock(&osCp.sTskTblLock) != ROK)
+ {
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
- "Could not give the Semaphore");
- return (NULLP);
+ MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
+ "Could not give the Semaphore");
+ return (NULLP);
#endif
- }
+ }
return (sTsk);
}
\f
/*
-*
-* Fun: Initialize timer table
-*
-* Desc: This function initializes MTSS-specific information
-* in the timer table.
-*
-* Ret: ROK - ok
-*
-* Notes:
-*
-* File: mt_ss.c
-*
-*/
+ *
+ * Fun: Initialize timer table
+ *
+ * Desc: This function initializes MTSS-specific information
+ * in the timer table.
+ *
+ * Ret: ROK - ok
+ *
+ * Notes:
+ *
+ * File: mt_ss.c
+ *
+ */
S16 ssdReInitTmr(void)
{
pthread_attr_t attr;
if(ret != ROK)
{
#if (ERRCLASS & ERRCLS_DEBUG)
- MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
- "Could not give the Semaphore");
+ MTLOGERROR(ERRCLS_DEBUG, EMT046, ERRZERO,
+ "Could not give the Semaphore");
#endif
- return RFAILED;
+ return RFAILED;
}
#endif
osCp.dep.tmrTqCp.tmrLen = SS_MAX_TMRS;
- /* mt010.21: addition */
+ /* mt010.21: addition */
#ifdef SS_MULTICORE_SUPPORT
sTsk = ssdReAddTmrSTsk(0);
#endif
if ((pthread_create(&osCp.dep.tmrHdlrTID, &attr, mtTmrHdlr, NULLP)) != 0)
{
- /* mt020.201 - Addition for destroying thread attribute object attr */
- pthread_attr_destroy(&attr);
+ /* mt020.201 - Addition for destroying thread attribute object attr */
+ pthread_attr_destroy(&attr);
- return RFAILED;
+ return RFAILED;
}
#ifdef SS_THR_REG_MAP
threadCreated = ssCheckAndAddMemoryRegionMap(osCp.dep.tmrHdlrTID,
- sTsk->region);
+ sTsk->region);
}
#endif /* SS_THR_REG_MAP */
#ifdef SS_MEM_WL_DEBUG
}
/**********************************************************************
- End of file
-**********************************************************************/
+ End of file
+ **********************************************************************/