[PDK-12327] osal: arch: c66: bypass osalArch_TimestampInit for freertos master REL.CORESDK.08.06.00.12 REL.CORESDK.08.06.00.13
authorDon Dominic <a0486429@ti.com>
Wed, 1 Feb 2023 14:20:07 +0000 (19:50 +0530)
committerRishabh Garg <rishabh@ti.com>
Wed, 1 Feb 2023 17:35:24 +0000 (11:35 -0600)
- With usage of TSC counter in freertos portable layer for runtime
  calculation, bypass osalArch_TimestampInit for freertos
  to avoid re-initialization of TSC counter.
- FreeRTOS initialize TSC counter as part of schedular start

- Also remove bypassing CycleprofilerP_init for FreeRTOS, since this is
  now internally handled in corresponding osalArch implementations

Signed-off-by: Don Dominic <a0486429@ti.com>
packages/ti/osal/arch/core/c6x/Arch_util.c
packages/ti/osal/src/nonos/CycleprofilerP_nonos.c

index 91741035ed5babf5eb20be12f6bc4005825c54f9..5bb55329487d8582f53cbc7571afeb9664ccb129 100644 (file)
@@ -369,12 +369,16 @@ int32_t  osalArch_TimeStampGetFreqKHz(void)
 /* Initialize the time stamp module */
 void    osalArch_TimestampInit(void)
 {
+    /* FreeRTOS C66x port already initialized TSC counter as part of 
+     * schedular start for runtime measurement */
+#if !defined(FREERTOS)
     if (gTimestampFirstTime == (bool)true)
     {
         /* Initialize TSCL to 0, for count */
         CSL_tscEnable();
         gTimestampFirstTime = (bool)false;
     }
+#endif
 
     return;
 }
index a1ab8befd24dcca9178e4268f20006d5ed6268eb..9609b96212880e5aee1c1ac17119c851a09831f0 100644 (file)
@@ -60,10 +60,8 @@ uint32_t CycleprofilerP_getTimeStamp(void)
 
 void CycleprofilerP_init(void)
 {
-    #if !defined(FREERTOS)
     /* Make sure init is done, if not done already */
     osalArch_TimestampInit();
-    #endif
 }
 uint32_t CycleprofilerP_getTimeStamp(void) 
 {