Using the Shadow Region instead of DSP instance in OSProtect entry/exit
authorSundaram Raju <a0393949@psplinux052.india.ti.com>
Mon, 7 Dec 2009 11:19:02 +0000 (16:49 +0530)
committerSundaram Raju <a0393949@psplinux052.india.ti.com>
Mon, 7 Dec 2009 11:19:02 +0000 (16:49 +0530)
- Added a new Variable region_id in the sample_init.c
- Used region_id instead of dsp_num in the OSProtect entry/exit functions

packages/ti/sdo/edma3/drv/sample/src/sample_cs.c
packages/ti/sdo/edma3/drv/sample/src/sample_init.c
packages/ti/sdo/edma3/rm/sample/src/sample_cs.c
packages/ti/sdo/edma3/rm/sample/src/sample_init.c

index e451b7124ee366aa4c26722b6d11ad8acdc8a30f..2336c0c25bfb63237eb03336b50854bcd9adeb76 100755 (executable)
@@ -52,10 +52,10 @@ extern unsigned int ccErrorInt[];
 extern unsigned int tcErrorInt[][EDMA3_MAX_TC];
 
 /**
- * DSP instance number on which the executable is running. Its value is
- * determined by reading the processor specific register DNUM.
+ * Shadow Region on which the executable is running. Its value is
+ * populated with the DSP Instance Number here in this case.
  */
-extern unsigned int dsp_num;
+extern unsigned int region_id;
 
 /**
  * \brief   EDMA3 OS Protect Entry
@@ -101,7 +101,7 @@ void edma3OsProtectEntry (unsigned int edma3InstanceId,
 
             /* Disable EDMA3 transfer completion interrupt only */
             case EDMA3_OS_PROTECT_INTERRUPT_XFER_COMPLETION :
-                EventCombiner_disableEvent(ccXferCompInt[edma3InstanceId][dsp_num]);
+                EventCombiner_disableEvent(ccXferCompInt[edma3InstanceId][region_id]);
                 break;
 
             /* Disable EDMA3 CC error interrupt only */
@@ -173,7 +173,7 @@ void edma3OsProtectExit (unsigned int edma3InstanceId,
 
         /* Enable EDMA3 transfer completion interrupt only */
         case EDMA3_OS_PROTECT_INTERRUPT_XFER_COMPLETION :
-            EventCombiner_enableEvent(ccXferCompInt[edma3InstanceId][dsp_num]);
+            EventCombiner_enableEvent(ccXferCompInt[edma3InstanceId][region_id]);
             break;
 
         /* Enable EDMA3 CC error interrupt only */
index 61cc0df98c7f8268f45c50811ff092be5d65308a..99807d10d8d33bab1bbcc7c3b736546869e6fcf8 100755 (executable)
@@ -70,6 +70,12 @@ extern unsigned short isGblConfigRequired(unsigned int dspNum);
  */
 unsigned int dsp_num;
 
+/**
+ * Shadow Region on which the executable is runnig. Its value is populated
+ * with the DSP Instance Number here in this case.
+ */
+unsigned int region_id;
+
 /* Number of EDMA3 controllers present in the system */
 extern const unsigned int numEdma3Instances;
 
@@ -133,6 +139,8 @@ EDMA3_DRV_Handle edma3init (unsigned int edma3Id, EDMA3_DRV_Result *errorCode)
                initCfg.isMaster = TRUE;
                /* Choose shadow region according to the DSP# */
                initCfg.regionId = (EDMA3_RM_RegionId)dsp_num;
+               /*Saving the regionId for using it in the sample_cs.c file */
+               region_id = (EDMA3_RM_RegionId)dsp_num;
                /* Driver instance specific config NULL */
                initCfg.drvInstInitConfig = instanceConfig;
 
index d9eb756b36a37bf9c67c52a0cee3b72d86351205..73d7b7efb646a7a15480263ab6c2a24acde72416 100755 (executable)
@@ -51,10 +51,10 @@ extern unsigned int ccErrorInt[];
 extern unsigned int tcErrorInt[][EDMA3_MAX_TC];\r
 \r
 /**\r
- * DSP instance number on which the executable is running. Its value is\r
- * determined by reading the processor specific register DNUM.\r
+ * Shadow Region on which the executable is running. Its value is\r
+ * populated with the DSP Instance Number here in this case.\r
  */\r
-extern unsigned int dsp_num;\r
+extern unsigned int region_id;\r
 \r
 /**\r
  * \brief   EDMA3 OS Protect Entry\r
@@ -100,7 +100,7 @@ void edma3OsProtectEntry (unsigned int edma3InstanceId,
 \r
             /* Disable EDMA3 transfer completion interrupt only */\r
             case EDMA3_OS_PROTECT_INTERRUPT_XFER_COMPLETION :\r
-                EventCombiner_disableEvent(ccXferCompInt[edma3InstanceId][dsp_num]);\r
+                EventCombiner_disableEvent(ccXferCompInt[edma3InstanceId][region_id]);\r
                 break;\r
 \r
             /* Disable EDMA3 CC error interrupt only */\r
@@ -172,7 +172,7 @@ void edma3OsProtectExit (unsigned int edma3InstanceId,
 \r
         /* Enable EDMA3 transfer completion interrupt only */\r
         case EDMA3_OS_PROTECT_INTERRUPT_XFER_COMPLETION :\r
-            EventCombiner_enableEvent(ccXferCompInt[edma3InstanceId][dsp_num]);\r
+            EventCombiner_enableEvent(ccXferCompInt[edma3InstanceId][region_id]);\r
             break;\r
 \r
         /* Enable EDMA3 CC error interrupt only */\r
index 6b1d95f7535bf4f01efed1a526f1ed3ee810cb48..7b04571d883f5b6b371fec03b196381f22d93db8 100755 (executable)
@@ -70,6 +70,12 @@ extern unsigned short isGblConfigRequired(unsigned int dspNum);
  */\r
 unsigned int dsp_num;\r
 \r
+/**\r
+ * Shadow Region on which the executable is runnig. Its value is populated\r
+ * with the dsp_num here in this case.\r
+ */\r
+unsigned int region_id;\r
+\r
 /* Number of EDMA3 controllers present in the system */\r
 extern const unsigned int numEdma3Instances;\r
 \r
@@ -134,6 +140,8 @@ EDMA3_RM_Handle edma3init (unsigned int edma3Id, EDMA3_RM_Result *errorCode)
                initParam.isMaster = TRUE;\r
                /* Choose shadow region according to the DSP# */\r
                initParam.regionId = (EDMA3_RM_RegionId)dsp_num;\r
+               /*Saving the regionId for using it in the sample_cs.c file */\r
+               region_id = (EDMA3_RM_RegionId)dsp_num;\r
                /* Driver instance specific config NULL */\r
                initParam.rmInstInitConfig = instanceConfig;\r
 \r