Fixed C++ build warning for vayu libs
authorPrasad Konnur <prasadkonnur@ti.com>
Mon, 1 Jul 2013 13:54:41 +0000 (19:24 +0530)
committerPrasad Konnur <prasadkonnur@ti.com>
Tue, 2 Jul 2013 08:55:21 +0000 (14:25 +0530)
Signed-off-by: Prasad Konnur <prasadkonnur@ti.com>
packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tda2xx_arm_int_reg.c
packages/ti/sdo/edma3/drv/sample/src/platforms/sample_tda2xx_cfg.c
packages/ti/sdo/edma3/drv/sample/src/sample_arm_cs.c
packages/ti/sdo/edma3/drv/sample/src/sample_arm_init.c
packages/ti/sdo/edma3/rm/sample/src/platforms/sample_tda2xx_arm_int_reg.c
packages/ti/sdo/edma3/rm/sample/src/platforms/sample_tda2xx_cfg.c
packages/ti/sdo/edma3/rm/sample/src/sample_arm_cs.c
packages/ti/sdo/edma3/rm/sample/src/sample_arm_init.c

index dbecdcf4dd6dde46c1cbf671eb14aa6fa3b137b7..1fcf3c487874ee935462679ca2826c8df7dc92dc 100644 (file)
   */\r
 void (*ptrEdma3TcIsrHandler[EDMA3_MAX_TC])(uint32_t arg) =\r
                                                 {\r
-                                                &lisrEdma3TC0ErrHandler0,\r
-                                                &lisrEdma3TC1ErrHandler0,\r
-                                                &lisrEdma3TC2ErrHandler0,\r
-                                                &lisrEdma3TC3ErrHandler0,\r
-                                                &lisrEdma3TC4ErrHandler0,\r
-                                                &lisrEdma3TC5ErrHandler0,\r
-                                                &lisrEdma3TC6ErrHandler0,\r
-                                                &lisrEdma3TC7ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC0ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC1ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC2ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC3ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC4ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC5ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC6ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC7ErrHandler0,\r
                                                 };\r
 \r
 extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];\r
@@ -152,7 +152,7 @@ void registerEdma3Interrupts (unsigned int edma3Id)
        //hwiParams.priority = hwIntXferComp[edma3Id];\r
     \r
     hwiCCXferCompInt = Hwi_create( ccXferCompInt[edma3Id][dsp_num],\r
-                                       (&lisrEdma3ComplHandler0),\r
+                                       ((Hwi_FuncPtr)&lisrEdma3ComplHandler0),\r
                                        (const Hwi_Params *) (&hwiParams),\r
                                        &eb);\r
     if (TRUE == Error_check(&eb))\r
@@ -168,7 +168,7 @@ void registerEdma3Interrupts (unsigned int edma3Id)
        //hwiParams.priority = hwIntCcErr[edma3Id];\r
        \r
        hwiCCErrInt = Hwi_create( ccErrorInt[edma3Id],\r
-                (&lisrEdma3CCErrHandler0),\r
+                ((Hwi_FuncPtr)&lisrEdma3CCErrHandler0),\r
                 (const Hwi_Params *) (&hwiParams),\r
                 &eb);\r
 \r
index 6026d9d5a62c40dc6624c11dce9bfe186a35c93f..7e497a050757e8a3a746058e5505fc4c6a6222ed 100644 (file)
@@ -61,7 +61,8 @@ int myCoreNum;
 \r
 unsigned short determineProcId()\r
 {\r
-unsigned short regionNo;\r
+unsigned short regionNo = numEdma3Instances;\r
+myCoreNum = numDsps;\r
 #ifdef BUILD_TDA2XX_MPU\r
 \r
     asm ("    push    {r0-r2} \n\t"\r
index 1e0e97b94632c72032cc8b453977299eb5cca150..2d2870885eca74b009bc165f4ee13946d8e6cf49 100644 (file)
@@ -383,7 +383,7 @@ EDMA3_DRV_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int32_t mSecTimeout)
         }
     else
         {
-        semPendResult = Semaphore_pend(hSem, mSecTimeout);
+        semPendResult = Semaphore_pend((Semaphore_Handle)hSem, mSecTimeout);
         if (semPendResult == FALSE)
             {
             semTakeResult = EDMA3_DRV_E_SEMAPHORE;
@@ -412,7 +412,7 @@ EDMA3_DRV_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)
         }
     else
         {
-               Semaphore_post(hSem);
+               Semaphore_post((Semaphore_Handle)hSem);
         }
 
     return semGiveResult;
index 1cd22c29ef17696d905b80113a742cede38c9e54..017b37f31681f7a8ac3245aa74fba74119b7fa66 100644 (file)
@@ -155,7 +155,7 @@ EDMA3_DRV_Handle edma3init (unsigned int edma3Id, EDMA3_DRV_Result *errorCode)
                initCfg.gblerrData = NULL;
 
                /* Open the Driver Instance */
-               hEdma = EDMA3_DRV_open (edma3Id, (void *) &initCfg, &edma3Result);
+               hEdma = EDMA3_DRV_open (edma3Id, (const EDMA3_DRV_InitConfig *) &initCfg, &edma3Result);
                }
 
 #if (defined (CHIP_TI814X)||defined (CHIP_C6A811X))
index 09dae796874d3cdcf7c96f30fac68bed9ac34477..ba08e1080dbc7350410f71703fe687c610b52f63 100644 (file)
   */\r
 void (*ptrEdma3TcIsrHandler[EDMA3_MAX_TC])(uint32_t arg) =\r
                                                 {\r
-                                                &lisrEdma3TC0ErrHandler0,\r
-                                                &lisrEdma3TC1ErrHandler0,\r
-                                                &lisrEdma3TC2ErrHandler0,\r
-                                                &lisrEdma3TC3ErrHandler0,\r
-                                                &lisrEdma3TC4ErrHandler0,\r
-                                                &lisrEdma3TC5ErrHandler0,\r
-                                                &lisrEdma3TC6ErrHandler0,\r
-                                                &lisrEdma3TC7ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC0ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC1ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC2ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC3ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC4ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC5ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC6ErrHandler0,\r
+                                                (void (*)(uint32_t))&lisrEdma3TC7ErrHandler0,\r
                                                 };\r
 \r
 extern unsigned int ccXferCompInt[][EDMA3_MAX_REGIONS];\r
@@ -153,7 +153,7 @@ void registerEdma3Interrupts (unsigned int edma3Id)
        hwiParams.priority = hwIntXferComp[edma3Id];\r
     \r
     hwiCCXferCompInt = Hwi_create( ccXferCompInt[edma3Id][gpp_num],\r
-                                       (&lisrEdma3ComplHandler0),\r
+                                       ((Hwi_FuncPtr)&lisrEdma3ComplHandler0),\r
                                        (const Hwi_Params *) (&hwiParams),\r
                                        &eb);\r
     if (TRUE == Error_check(&eb))\r
@@ -169,7 +169,7 @@ void registerEdma3Interrupts (unsigned int edma3Id)
        hwiParams.priority = hwIntCcErr[edma3Id];\r
        \r
        hwiCCErrInt = Hwi_create( ccErrorInt[edma3Id],\r
-                (&lisrEdma3CCErrHandler0),\r
+                ((Hwi_FuncPtr)&lisrEdma3CCErrHandler0),\r
                 (const Hwi_Params *) (&hwiParams),\r
                 &eb);\r
 \r
index 189c5f3f98569c9c28745414a837b456bbc773b4..015a851ff7fd89b2359f95bb68f4ea0ad298e116 100644 (file)
@@ -49,19 +49,49 @@ const unsigned int numEdma3Instances = NUM_EDMA3_INSTANCES;
 const unsigned int numDsps = NUM_DSPS;\r
 \r
 /* Determine the processor id by reading DNUM register. */\r
+/* Statically allocate the region numbers with cores. */\r
+int myCoreNum;\r
+#define PID0_ADDRESS 0xE00FFFE0\r
+#define CORE_ID_C0 0x0\r
+#define CORE_ID_C1 0x1\r
 unsigned short determineProcId()\r
 {\r
+unsigned short regionNo = numEdma3Instances;\r
+myCoreNum = numDsps;\r
 #ifdef BUILD_TDA2XX_MPU\r
-       return 0;\r
+\r
+    asm ("    push    {r0-r2} \n\t"\r
+            "    MRC p15, 0, r0, c0, c0, 5\n\t"\r
+                "    LDR      r1, =myCoreNum\n\t"\r
+                "    STR      r0, [r1]\n\t"\r
+                "    pop    {r0-r2}\n\t");\r
+       if((myCoreNum & 0x03) == 1)\r
+               regionNo = 1;\r
+       else\r
+               regionNo = 0;\r
+#elif defined(BUILD_TDA2XX_IPU)\r
+myCoreNum = (*(unsigned int *)(PID0_ADDRESS));\r
+if(Core_getIpuId() == 1){\r
+       if(myCoreNum == CORE_ID_C0)\r
+               regionNo = 4;\r
+       else if (myCoreNum == CORE_ID_C1)\r
+               regionNo = 5;\r
+}\r
+if(Core_getIpuId() == 2){\r
+       if(myCoreNum == CORE_ID_C0)\r
+               regionNo = 6;\r
+       else if (myCoreNum == CORE_ID_C1)\r
+               regionNo = 7;\r
+}\r
 #elif defined BUILD_TDA2XX_DSP\r
-       return 1;\r
-#elif defined BUILD_TDA2XX_IPU0\r
-       return 2;\r
-#elif defined BUILD_TDA2XX_IPU1\r
-       return 3;\r
-#else\r
-       return 4;\r
+extern __cregister volatile unsigned int DNUM;\r
+       myCoreNum = DNUM;\r
+       if(myCoreNum == 0)\r
+               regionNo = 2;\r
+       else\r
+               regionNo = 3;\r
 #endif\r
+       return regionNo;\r
 }\r
 \r
 signed char*  getGlobalAddr(signed char* addr)\r
index 1fb92a6d79196decb6cef2cfb5439599609ea5ac..be5d2b753fefa6a535a7fac02c6a50fe5df977f6 100644 (file)
@@ -269,7 +269,7 @@ EDMA3_RM_Result edma3OsSemDelete(EDMA3_OS_Sem_Handle hSem)
         }
     else
         {
-               Semaphore_delete(hSem);
+               Semaphore_delete((Semaphore_Handle *)&hSem);
         }
 
     return semDeleteResult;
@@ -298,7 +298,7 @@ EDMA3_RM_Result edma3OsSemTake(EDMA3_OS_Sem_Handle hSem, int32_t mSecTimeout)
         }
     else
         {
-        semPendResult = Semaphore_pend(hSem, mSecTimeout);
+        semPendResult = Semaphore_pend((Semaphore_Handle)hSem, mSecTimeout);
         if (semPendResult == FALSE)
             {
             semTakeResult = EDMA3_RM_E_SEMAPHORE;
@@ -327,7 +327,7 @@ EDMA3_RM_Result edma3OsSemGive(EDMA3_OS_Sem_Handle hSem)
         }
     else
         {
-               Semaphore_post(hSem);
+               Semaphore_post((Semaphore_Handle)hSem);
         }
 
     return semGiveResult;
index 7ba5151e1fbc1996e86a968b76342e7e8bed1794..e7eba7f799fc8083f4d81da066d8b5b36a852ed5 100644 (file)
@@ -84,6 +84,10 @@ extern EDMA3_RM_GblConfigParams sampleEdma3GblCfgParams[];
 /* External Instance Specific Configuration Structure */
 extern EDMA3_RM_InstanceInitConfig sampleInstInitConfig[][EDMA3_MAX_REGIONS];
 
+#if (defined (CHIP_TI814X)||defined (CHIP_C6A811X))
+extern EDMA3_DRV_Result sampleInitXbarEvt(EDMA3_DRV_Handle hEdma, unsigned int edma3Id);
+#endif
+
 /**
  * \brief   EDMA3 Initialization
  *