summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHao Zhang2019-02-12 11:37:10 -0600
committerHao Zhang2019-02-12 11:37:10 -0600
commit446907fbb18f48d6d5d7869b698ea226e72639a1 (patch)
tree956c3f0193eb62f861db940b749158c154f0dd50
parentb3e68a3b00ee2a56c015f16b8ccc706a29d77ef0 (diff)
downloadosal-446907fbb18f48d6d5d7869b698ea226e72639a1.tar.gz
osal-446907fbb18f48d6d5d7869b698ea226e72639a1.tar.xz
osal-446907fbb18f48d6d5d7869b698ea226e72639a1.zip
osal: PRSDK-5352: fix bug in SwiP_delete() API
The parameter passed in SwiP_delete() should be a pointer of the handle, since Swi_delete() use a pointer of the handle Signed-off-by: Hao Zhang <hzhang@ti.com>
-rw-r--r--SwiP.h4
-rw-r--r--src/nonos/SwiP_nonos.c2
-rw-r--r--src/tirtos/SwiP_tirtos.c10
-rw-r--r--test/src/main_osal_test.c2
4 files changed, 9 insertions, 9 deletions
diff --git a/SwiP.h b/SwiP.h
index 46ce146..027a1ff 100644
--- a/SwiP.h
+++ b/SwiP.h
@@ -99,11 +99,11 @@ extern SwiP_Handle SwiP_create(SwiP_Fxn swiFxn, SwiP_Params *params);
99/*! 99/*!
100 * @brief Function to delete an interrupt on CortexM devices 100 * @brief Function to delete an interrupt on CortexM devices
101 * 101 *
102 * @param handle returned from the SwiP_create call 102 * @param pointer of the handle returned from the SwiP_create call
103 * 103 *
104 * @return A SwiP_Handle on success or a NULL 104 * @return A SwiP_Handle on success or a NULL
105 */ 105 */
106extern SwiP_Status SwiP_delete(SwiP_Handle handle); 106extern SwiP_Status SwiP_delete(SwiP_Handle *pHandle);
107 107
108/*! 108/*!
109 * @brief Initialize params structure to default values. 109 * @brief Initialize params structure to default values.
diff --git a/src/nonos/SwiP_nonos.c b/src/nonos/SwiP_nonos.c
index 45a99f7..3a9b815 100644
--- a/src/nonos/SwiP_nonos.c
+++ b/src/nonos/SwiP_nonos.c
@@ -50,7 +50,7 @@ SwiP_Handle SwiP_create(SwiP_Fxn swiFxn, SwiP_Params *params)
50/* 50/*
51 * ======== SwiP_delete ======== 51 * ======== SwiP_delete ========
52 */ 52 */
53SwiP_Status SwiP_delete(SwiP_Handle handle) 53SwiP_Status SwiP_delete(SwiP_Handle *pHandle)
54{ 54{
55 return (SwiP_OK); 55 return (SwiP_OK);
56} 56}
diff --git a/src/tirtos/SwiP_tirtos.c b/src/tirtos/SwiP_tirtos.c
index b9a794e..762bf42 100644
--- a/src/tirtos/SwiP_tirtos.c
+++ b/src/tirtos/SwiP_tirtos.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2018, Texas Instruments Incorporated 2 * Copyright (c) 2018 - 2019, Texas Instruments Incorporated
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
@@ -66,13 +66,13 @@ SwiP_Handle SwiP_create(SwiP_Fxn swiFxn, SwiP_Params *params)
66/* 66/*
67 * ======== SwiP_delete ======== 67 * ======== SwiP_delete ========
68 */ 68 */
69SwiP_Status SwiP_delete(SwiP_Handle handle) 69SwiP_Status SwiP_delete(SwiP_Handle *pHandle)
70{ 70{
71 SwiP_Status status; 71 SwiP_Status status;
72 72
73 if (handle != NULL) 73 if (pHandle != NULL)
74 { 74 {
75 Swi_destruct((void *)handle); 75 Swi_delete((Swi_Handle *)pHandle);
76 status = SwiP_OK; 76 status = SwiP_OK;
77 } 77 }
78 else 78 else
@@ -102,7 +102,7 @@ SwiP_Status SwiP_post(SwiP_Handle handle)
102 102
103 if (handle != NULL) 103 if (handle != NULL)
104 { 104 {
105 Swi_post((void *)handle); 105 Swi_post((Swi_Handle)handle);
106 status = SwiP_OK; 106 status = SwiP_OK;
107 } 107 }
108 else 108 else
diff --git a/test/src/main_osal_test.c b/test/src/main_osal_test.c
index 2d0d0bd..f681b58 100644
--- a/test/src/main_osal_test.c
+++ b/test/src/main_osal_test.c
@@ -1131,7 +1131,7 @@ bool OSAL_swi_test()
1131 1131
1132 if (retVal == true) 1132 if (retVal == true)
1133 { 1133 {
1134 status = SwiP_delete(handle); 1134 status = SwiP_delete(&handle);
1135 if (status != SwiP_OK) 1135 if (status != SwiP_OK)
1136 { 1136 {
1137 OSAL_log("Failed to delete software interrupt \n"); 1137 OSAL_log("Failed to delete software interrupt \n");