summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravind Batni2019-01-04 15:05:56 -0600
committerAravind Batni2019-01-16 15:34:46 -0600
commit99c5a4d2be3bf139742512714c80756b803fba85 (patch)
treed65f393d0fa5a5f89cf7dbec7ed838217168863e
parent804b447e3054cc55b04ccc0032e6ba9f3d3830f5 (diff)
downloadosal-99c5a4d2be3bf139742512714c80756b803fba85.tar.gz
osal-99c5a4d2be3bf139742512714c80756b803fba85.tar.xz
osal-99c5a4d2be3bf139742512714c80756b803fba85.zip
PRSDK-5126: add Error Block in TaskP OSAL implementationREL.PDK.J7.00.05.00.10
Signed-off-by: Aravind Batni <aravindbr@ti.com>
-rw-r--r--TaskP.h2
-rw-r--r--src/tirtos/TaskP_tirtos.c9
-rw-r--r--test/src/main_osal_test.c10
3 files changed, 16 insertions, 5 deletions
diff --git a/TaskP.h b/TaskP.h
index f54aac9..604985b 100644
--- a/TaskP.h
+++ b/TaskP.h
@@ -48,6 +48,7 @@ extern "C" {
48#include <stdint.h> 48#include <stdint.h>
49#include <stdbool.h> 49#include <stdbool.h>
50#include <stddef.h> 50#include <stddef.h>
51#include <xdc/runtime/Error.h>
51 52
52/*! 53/*!
53 * @brief Status codes for TaskP APIs 54 * @brief Status codes for TaskP APIs
@@ -82,6 +83,7 @@ typedef void *TaskP_Handle;
82typedef struct TaskP_Params_s 83typedef struct TaskP_Params_s
83{ 84{
84 uint8_t *name; /*!< Name of the task instance. */ 85 uint8_t *name; /*!< Name of the task instance. */
86 Error_Block *pErrBlk; /*!< Pointer to the error block for task Create */
85 int8_t priority; /*!< The priority of the task */ 87 int8_t priority; /*!< The priority of the task */
86 uint32_t stacksize; /*!< The stack size of the task */ 88 uint32_t stacksize; /*!< The stack size of the task */
87 void *arg0; /*!< arg0 */ 89 void *arg0; /*!< arg0 */
diff --git a/src/tirtos/TaskP_tirtos.c b/src/tirtos/TaskP_tirtos.c
index 69a9812..bb84f97 100644
--- a/src/tirtos/TaskP_tirtos.c
+++ b/src/tirtos/TaskP_tirtos.c
@@ -44,6 +44,7 @@ TaskP_Handle TaskP_create(void *taskfxn, TaskP_Params *params)
44{ 44{
45 Task_Handle taskHandle; 45 Task_Handle taskHandle;
46 Task_Params taskParams; 46 Task_Params taskParams;
47 Error_Block *pErrBlk = params->pErrBlk;
47 48
48 Task_Params_init(&taskParams); 49 Task_Params_init(&taskParams);
49 50
@@ -60,7 +61,12 @@ TaskP_Handle TaskP_create(void *taskfxn, TaskP_Params *params)
60 } 61 }
61 } 62 }
62 63
63 taskHandle = Task_create((Task_FuncPtr)taskfxn, &taskParams, NULL); 64 if (pErrBlk != (Error_Block *) NULL)
65 {
66 Error_init(pErrBlk);
67 }
68
69 taskHandle = Task_create((Task_FuncPtr)taskfxn, &taskParams, pErrBlk);
64 70
65 return ((TaskP_Handle)taskHandle); 71 return ((TaskP_Handle)taskHandle);
66} 72}
@@ -87,6 +93,7 @@ void TaskP_Params_init(TaskP_Params *params)
87 params->arg1 = (void *)(taskParams.arg1); 93 params->arg1 = (void *)(taskParams.arg1);
88 params->name = (uint8_t *)(taskParams.instance->name); 94 params->name = (uint8_t *)(taskParams.instance->name);
89 params->stack = NULL; 95 params->stack = NULL;
96 params->pErrBlk = (Error_Block *) NULL;
90} 97}
91 98
92void TaskP_sleep(uint32_t timeout) 99void TaskP_sleep(uint32_t timeout)
diff --git a/test/src/main_osal_test.c b/test/src/main_osal_test.c
index a762bd0..fd29969 100644
--- a/test/src/main_osal_test.c
+++ b/test/src/main_osal_test.c
@@ -51,7 +51,7 @@
51 51
52/* BIOS Header files */ 52/* BIOS Header files */
53#include <ti/sysbios/BIOS.h> 53#include <ti/sysbios/BIOS.h>
54#include <ti/sysbios/knl/Task.h> 54#include <ti/osal/TaskP.h>
55#endif 55#endif
56 56
57#include <stdio.h> 57#include <stdio.h>
@@ -1323,10 +1323,12 @@ int main(void)
1323 * no test application specific task is created in teh RTSC cfg file 1323 * no test application specific task is created in teh RTSC cfg file
1324 */ 1324 */
1325#if defined (SOC_AM65XX) || defined (SOC_J7) 1325#if defined (SOC_AM65XX) || defined (SOC_J7)
1326 Task_Params taskParams; 1326 TaskP_Params taskParams;
1327 Task_Params_init(&taskParams); 1327 Error_Block eb;
1328 TaskP_Params_init(&taskParams);
1329 taskParams.pErrBlk = &eb;
1328 System_printf("Creating Task \n"); 1330 System_printf("Creating Task \n");
1329 Task_create(osal_test, &taskParams, NULL); 1331 TaskP_create(osal_test, &taskParams);
1330#endif 1332#endif
1331 /* Start BIOS */ 1333 /* Start BIOS */
1332 BIOS_start(); 1334 BIOS_start();