summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahesh Radhakrishnan2019-09-28 08:07:00 -0500
committerAnkur2019-09-28 11:39:46 -0500
commit3019f39046a9b3bfda41a31034a8a8a0a6c1662f (patch)
treecbfbf576728cb71afddcbf4096ac1fa924f93ec5
parent424cd7b4e6f9e2d327517f7bbe27c51df92d5607 (diff)
downloadosal-3019f39046a9b3bfda41a31034a8a8a0a6c1662f.tar.gz
osal-3019f39046a9b3bfda41a31034a8a8a0a6c1662f.tar.xz
osal-3019f39046a9b3bfda41a31034a8a8a0a6c1662f.zip
MISRAC Fixes
-rwxr-xr-xEventCombinerP.h2
-rw-r--r--HwiP.h10
-rw-r--r--Queue.h12
-rwxr-xr-xRegisterIntr.h2
-rw-r--r--SemaphoreP.h36
-rw-r--r--TimerP.h28
-rwxr-xr-xsoc/j721e/TimerP_default.c2
-rw-r--r--src/nonos/Utils_nonos.c3
8 files changed, 50 insertions, 45 deletions
diff --git a/EventCombinerP.h b/EventCombinerP.h
index 195419b..7133b95 100755
--- a/EventCombinerP.h
+++ b/EventCombinerP.h
@@ -49,7 +49,7 @@ extern "C" {
49#include <stdbool.h> 49#include <stdbool.h>
50#include <stddef.h> 50#include <stddef.h>
51#include <ti/osal/HwiP.h> 51#include <ti/osal/HwiP.h>
52typedef void (*EventCombinerP_FuncPtr)(uint32_t); 52typedef void (*EventCombinerP_FuncPtr)(uint32_t arg);
53 53
54/*! 54/*!
55 * @brief Function to disable an event inside event combiner 55 * @brief Function to disable an event inside event combiner
diff --git a/HwiP.h b/HwiP.h
index fd5d773..5f038db 100644
--- a/HwiP.h
+++ b/HwiP.h
@@ -155,14 +155,14 @@ extern void HwiP_clearInterrupt(int32_t interruptNum);
155 * 155 *
156 * @param hwiFxn entry function of the hardware interrupt 156 * @param hwiFxn entry function of the hardware interrupt
157 * 157 *
158 * @param params Pointer to the instance configuration parameters. NULL 158 * @param hwipParams Pointer to the instance configuration parameters. NULL
159 * denotes to use the default parameters. The HwiP default 159 * denotes to use the default parameters. The HwiP default
160 * parameters are noted in ::HwiP_Params_init. 160 * parameters are noted in ::HwiP_Params_init.
161 * 161 *
162 * @return 162 * @return
163 */ 163 */
164extern HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn, 164extern HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn,
165 const HwiP_Params *params); 165 const HwiP_Params *hwipParams);
166 166
167/*! 167/*!
168 * @brief Function to delete an interrupt on CortexM devices 168 * @brief Function to delete an interrupt on CortexM devices
@@ -171,7 +171,7 @@ extern HwiP_Handle HwiP_create(int32_t interruptNum, HwiP_Fxn hwiFxn,
171 * 171 *
172 * @return A HwiP_Handle on success or a NULL 172 * @return A HwiP_Handle on success or a NULL
173 */ 173 */
174extern HwiP_Status HwiP_delete(HwiP_Handle handle); 174extern HwiP_Status HwiP_delete(HwiP_Handle hwiPhandle);
175 175
176/*! 176/*!
177 * @brief Function to disable interrupts to enter a critical region 177 * @brief Function to disable interrupts to enter a critical region
@@ -212,9 +212,9 @@ extern void HwiP_enableInterrupt(int32_t interruptNum);
212 * - arg: 0 212 * - arg: 0
213 * - priority: ~0 213 * - priority: ~0
214 * 214 *
215 * @param params Pointer to the instance configuration parameters. 215 * @param hwipParams Pointer to the instance configuration parameters.
216 */ 216 */
217extern void HwiP_Params_init(HwiP_Params *params); 217extern void HwiP_Params_init(HwiP_Params *hwipParams);
218 218
219/*! 219/*!
220 * @brief Function to restore interrupts to exit a critical region 220 * @brief Function to restore interrupts to exit a critical region
diff --git a/Queue.h b/Queue.h
index e0642d6..0d1015d 100644
--- a/Queue.h
+++ b/Queue.h
@@ -70,10 +70,10 @@ typedef void *Osal_Queue_Handle;
70 * 70 *
71 * @param structPtr Pointer to the structure containing the queue element 71 * @param structPtr Pointer to the structure containing the queue element
72 * 72 *
73 * @param params queue parameters 73 * @param queueParams queue parameters
74 * 74 *
75 */ 75 */
76void Osal_Queue_construct(void * structPtr, const void * params); 76void Osal_Queue_construct(void * structPtr, const void * queueParams);
77/*! 77/*!
78 * @brief Function to return the queue handle from the structure 78 * @brief Function to return the queue handle from the structure
79 * 79 *
@@ -86,18 +86,18 @@ Osal_Queue_Handle Osal_Queue_handle(void *structPtr);
86/*! 86/*!
87 * @brief Function to empty the queue 87 * @brief Function to empty the queue
88 * 88 *
89 * @param handle The queue handle 89 * @param queueHandle The queue handle
90 * 90 *
91 */ 91 */
92bool Osal_Queue_empty(Osal_Queue_Handle handle); 92bool Osal_Queue_empty(Osal_Queue_Handle queueHandle);
93 93
94/*! 94/*!
95 * @brief Function to return the element at the front of the queue 95 * @brief Function to return the element at the front of the queue
96 * 96 *
97 * @param handle The queue handle 97 * @param queueHandle The queue handle
98 * 98 *
99 */ 99 */
100void * Osal_Queue_get(Osal_Queue_Handle handle); 100void * Osal_Queue_get(Osal_Queue_Handle queueHandle);
101 101
102/*! 102/*!
103 * @brief Function to put the element to the queue 103 * @brief Function to put the element to the queue
diff --git a/RegisterIntr.h b/RegisterIntr.h
index 60ad69b..5b4988d 100755
--- a/RegisterIntr.h
+++ b/RegisterIntr.h
@@ -120,7 +120,7 @@ OsalInterruptRetCode_e Osal_RegisterInterrupt(OsalRegisterIntrParams_t *interrup
120 * @brief Function to register interrupt with parameters provided 120 * @brief Function to register interrupt with parameters provided
121 * 121 *
122 */ 122 */
123OsalInterruptRetCode_e Osal_DeleteInterrupt(HwiP_Handle handle,int32_t corepacEventNum); 123OsalInterruptRetCode_e Osal_DeleteInterrupt(HwiP_Handle hwiPhandle,int32_t corepacEventNum);
124/*! 124/*!
125 * @brief Function to delete interrupt corresponding to an event number 125 * @brief Function to delete interrupt corresponding to an event number
126 * 126 *
diff --git a/SemaphoreP.h b/SemaphoreP.h
index 0e9fd7e..8a33ab6 100644
--- a/SemaphoreP.h
+++ b/SemaphoreP.h
@@ -137,25 +137,25 @@ typedef struct SemaphoreP_Params_s {
137 * @param count Initial count of the semaphore. For binary semaphores, 137 * @param count Initial count of the semaphore. For binary semaphores,
138 * only values of 0 or 1 are valid. 138 * only values of 0 or 1 are valid.
139 * 139 *
140 * @param params Pointer to the instance configuration parameters. NULL 140 * @param semParams Pointer to the instance configuration parameters. NULL
141 * denotes to use the default parameters (SemaphoreP default 141 * denotes to use the default parameters (SemaphoreP default
142 * parameters as noted in ::SemaphoreP_Params_init. 142 * parameters as noted in ::SemaphoreP_Params_init.
143 * 143 *
144 * @return A SemaphoreP_Handle on success or a NULL on an error 144 * @return A SemaphoreP_Handle on success or a NULL on an error
145 */ 145 */
146extern SemaphoreP_Handle SemaphoreP_create(uint32_t count, 146extern SemaphoreP_Handle SemaphoreP_create(uint32_t count,
147 const SemaphoreP_Params *params); 147 const SemaphoreP_Params *semParams);
148 148
149/*! 149/*!
150 * @brief Function to delete a semaphore. 150 * @brief Function to delete a semaphore.
151 * 151 *
152 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 152 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
153 * 153 *
154 * @return Status of the functions 154 * @return Status of the functions
155 * - SemaphoreP_OK: Deleted the semaphore instance 155 * - SemaphoreP_OK: Deleted the semaphore instance
156 * - SemaphoreP_FAILED: Failed to delete the semaphore instance 156 * - SemaphoreP_FAILED: Failed to delete the semaphore instance
157 */ 157 */
158extern SemaphoreP_Status SemaphoreP_delete(SemaphoreP_Handle handle); 158extern SemaphoreP_Status SemaphoreP_delete(SemaphoreP_Handle semPhandle);
159 159
160/*! 160/*!
161 * @brief Initialize params structure to default values. 161 * @brief Initialize params structure to default values.
@@ -164,14 +164,14 @@ extern SemaphoreP_Status SemaphoreP_delete(SemaphoreP_Handle handle);
164 * - mode: SemaphoreP_Mode_COUNTING 164 * - mode: SemaphoreP_Mode_COUNTING
165 * - name: NULL 165 * - name: NULL
166 * 166 *
167 * @param params Pointer to the instance configuration parameters. 167 * @param semParams Pointer to the instance configuration parameters.
168 */ 168 */
169extern void SemaphoreP_Params_init(SemaphoreP_Params *params); 169extern void SemaphoreP_Params_init(SemaphoreP_Params *semParams);
170 170
171/*! 171/*!
172 * @brief Function to pend (wait) on a semaphore. 172 * @brief Function to pend (wait) on a semaphore.
173 * 173 *
174 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 174 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
175 * 175 *
176 * @param timeout Timeout (in milliseconds) to wait for the semaphore to 176 * @param timeout Timeout (in milliseconds) to wait for the semaphore to
177 * be posted (signalled). 177 * be posted (signalled).
@@ -181,58 +181,58 @@ extern void SemaphoreP_Params_init(SemaphoreP_Params *params);
181 * - SemaphoreP_TIMEOUT: Timed out. Semaphore was not obtained. 181 * - SemaphoreP_TIMEOUT: Timed out. Semaphore was not obtained.
182 * - SemaphoreP_FAILED: Non-time out failure. 182 * - SemaphoreP_FAILED: Non-time out failure.
183 */ 183 */
184extern SemaphoreP_Status SemaphoreP_pend(SemaphoreP_Handle handle, 184extern SemaphoreP_Status SemaphoreP_pend(SemaphoreP_Handle semPhandle,
185 uint32_t timeout); 185 uint32_t timeout);
186 186
187/*! 187/*!
188 * @brief Function to post (signal) a semaphore. 188 * @brief Function to post (signal) a semaphore.
189 * 189 *
190 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 190 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
191 * 191 *
192 * @return Status of the functions 192 * @return Status of the functions
193 * - SemaphoreP_OK: Released the semaphore 193 * - SemaphoreP_OK: Released the semaphore
194 * - SemaphoreP_FAILED: Failed to post the semaphore 194 * - SemaphoreP_FAILED: Failed to post the semaphore
195 */ 195 */
196extern SemaphoreP_Status SemaphoreP_post(SemaphoreP_Handle handle); 196extern SemaphoreP_Status SemaphoreP_post(SemaphoreP_Handle semPhandle);
197 197
198/*! 198/*!
199 * @brief Function to post (signal) a semaphore from an ClockP function. 199 * @brief Function to post (signal) a semaphore from an ClockP function.
200 * 200 *
201 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 201 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
202 * 202 *
203 * @return Status of the functions 203 * @return Status of the functions
204 * - SemaphoreP_OK: Released the semaphore 204 * - SemaphoreP_OK: Released the semaphore
205 * - SemaphoreP_FAILED: Failed to post the semaphore 205 * - SemaphoreP_FAILED: Failed to post the semaphore
206 */ 206 */
207extern SemaphoreP_Status SemaphoreP_postFromClock(SemaphoreP_Handle handle); 207extern SemaphoreP_Status SemaphoreP_postFromClock(SemaphoreP_Handle semPhandle);
208 208
209/*! 209/*!
210 * @brief Function to post (signal) a semaphore from an ISR. 210 * @brief Function to post (signal) a semaphore from an ISR.
211 * 211 *
212 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 212 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
213 * 213 *
214 * @return Status of the functions 214 * @return Status of the functions
215 * - SemaphoreP_OK: Released the semaphore 215 * - SemaphoreP_OK: Released the semaphore
216 * - SemaphoreP_FAILED: Failed to post the semaphore 216 * - SemaphoreP_FAILED: Failed to post the semaphore
217 */ 217 */
218extern SemaphoreP_Status SemaphoreP_postFromISR(SemaphoreP_Handle handle); 218extern SemaphoreP_Status SemaphoreP_postFromISR(SemaphoreP_Handle semPhandle);
219/*! 219/*!
220 * @brief Function to return the count of a semaphore. 220 * @brief Function to return the count of a semaphore.
221 * 221 *
222 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 222 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
223 * 223 *
224 * @return The count of the semaphore 224 * @return The count of the semaphore
225 */ 225 */
226 226
227extern int32_t SemaphoreP_getCount(SemaphoreP_Handle handle); 227extern int32_t SemaphoreP_getCount(SemaphoreP_Handle semPhandle);
228 228
229/*! 229/*!
230 * @brief Function to clear a semaphore for resuse. 230 * @brief Function to clear a semaphore for resuse.
231 * 231 *
232 * @param handle A SemaphoreP_Handle returned from ::SemaphoreP_create 232 * @param semPhandle A SemaphoreP_Handle returned from ::SemaphoreP_create
233 */ 233 */
234 234
235extern SemaphoreP_Status SemaphoreP_reset(SemaphoreP_Handle handle); 235extern SemaphoreP_Status SemaphoreP_reset(SemaphoreP_Handle semPhandle);
236#ifdef __cplusplus 236#ifdef __cplusplus
237} 237}
238#endif 238#endif
diff --git a/TimerP.h b/TimerP.h
index 3a435d5..e5a14d6 100644
--- a/TimerP.h
+++ b/TimerP.h
@@ -192,7 +192,7 @@ typedef struct TimerP_Params_s {
192 * 192 *
193 * @param tickFxn Function that runs upon timer expiry 193 * @param tickFxn Function that runs upon timer expiry
194 * 194 *
195 * @param params Pointer to the instance configuration parameters. NULL 195 * @param timerParams Pointer to the instance configuration parameters. NULL
196 * denotes to use the default parameters. The TimerP default 196 * denotes to use the default parameters. The TimerP default
197 * parameters are noted in ::TimerP_Params_init. 197 * parameters are noted in ::TimerP_Params_init.
198 * 198 *
@@ -201,18 +201,18 @@ typedef struct TimerP_Params_s {
201 */ 201 */
202extern TimerP_Handle TimerP_create(int32_t id, 202extern TimerP_Handle TimerP_create(int32_t id,
203 TimerP_Fxn tickFxn, 203 TimerP_Fxn tickFxn,
204 const TimerP_Params *params); 204 const TimerP_Params *timerParams);
205 205
206/*! 206/*!
207 * @brief Function to delete a timer. 207 * @brief Function to delete a timer.
208 * 208 *
209 * @param handle A TimerP_Handle returned from ::TimerP_create 209 * @param timerHandle A TimerP_Handle returned from ::TimerP_create
210 * 210 *
211 * @return Status of the function. 211 * @return Status of the function.
212 * - TimerP_OK: Deleted the timer instance 212 * - TimerP_OK: Deleted the timer instance
213 * - TimerP_FAILURE: Timed out waiting to delete the timer object. 213 * - TimerP_FAILURE: Timed out waiting to delete the timer object.
214 */ 214 */
215extern TimerP_Status TimerP_delete(TimerP_Handle handle); 215extern TimerP_Status TimerP_delete(TimerP_Handle timerHandle);
216 216
217/*! 217/*!
218 * @brief Function to set timer period specified in micro seconds 218 * @brief Function to set timer period specified in micro seconds
@@ -224,7 +224,7 @@ extern TimerP_Status TimerP_delete(TimerP_Handle handle);
224 * TimerP_setPeriodMicroSecs() invokes TimerP_stop() prior to setting 224 * TimerP_setPeriodMicroSecs() invokes TimerP_stop() prior to setting
225 * the period and leaves the timer in the stopped state. 225 * the period and leaves the timer in the stopped state.
226 * 226 *
227 * @param handle A TimerP_Handle returned from ::TimerP_create 227 * @param timerHandle A TimerP_Handle returned from ::TimerP_create
228 * 228 *
229 * @param microsecs time in micro seconds 229 * @param microsecs time in micro seconds
230 * 230 *
@@ -232,7 +232,7 @@ extern TimerP_Status TimerP_delete(TimerP_Handle handle);
232 * - TimerP_OK: Deleted the timer instance 232 * - TimerP_OK: Deleted the timer instance
233 * - TimerP_FAILURE: Timed out waiting to delete the timer object. 233 * - TimerP_FAILURE: Timed out waiting to delete the timer object.
234 */ 234 */
235extern TimerP_Status TimerP_setPeriodMicroSecs(TimerP_Handle handle, uint32_t microsecs); 235extern TimerP_Status TimerP_setPeriodMicroSecs(TimerP_Handle timerHandle, uint32_t microsecs);
236 236
237/*! 237/*!
238 * @brief Initialize params structure to default values. 238 * @brief Initialize params structure to default values.
@@ -241,42 +241,42 @@ extern TimerP_Status TimerP_setPeriodMicroSecs(TimerP_Handle handle, uint32_t mi
241 * - name: NULL 241 * - name: NULL
242 * - arg: 0 242 * - arg: 0
243 * 243 *
244 * @param params Pointer to the instance configuration parameters. 244 * @param timerParams Pointer to the instance configuration parameters.
245 */ 245 */
246extern void TimerP_Params_init(TimerP_Params *params); 246extern void TimerP_Params_init(TimerP_Params *timerParams);
247 247
248/*! 248/*!
249 * @brief Function to start a timer. 249 * @brief Function to start a timer.
250 * 250 *
251 * @param handle A TimerP_Handle returned from ::TimerP_create 251 * @param timerHandle A TimerP_Handle returned from ::TimerP_create
252 * 252 *
253 * @return Status of the functions 253 * @return Status of the functions
254 * - TimerP_OK: Scheduled the timer function successfully 254 * - TimerP_OK: Scheduled the timer function successfully
255 * - TimerP_FAILURE: The API failed. 255 * - TimerP_FAILURE: The API failed.
256 */ 256 */
257extern TimerP_Status TimerP_start(TimerP_Handle handle); 257extern TimerP_Status TimerP_start(TimerP_Handle timerHandle);
258 258
259/*! 259/*!
260 * @brief Function to stop a timer. 260 * @brief Function to stop a timer.
261 * 261 *
262 * @param handle A TimerP_Handle returned from ::TimerP_create 262 * @param timerHandle A TimerP_Handle returned from ::TimerP_create
263 * 263 *
264 * @return Status of the functions 264 * @return Status of the functions
265 * - TimerP_OK: Scheduled the timer function successfully 265 * - TimerP_OK: Scheduled the timer function successfully
266 * - TimerP_FAILURE: The API failed. 266 * - TimerP_FAILURE: The API failed.
267 */ 267 */
268extern TimerP_Status TimerP_stop(TimerP_Handle handle); 268extern TimerP_Status TimerP_stop(TimerP_Handle timerHandle);
269 269
270/*! 270/*!
271 * @brief Function to clear the interrupt of the timer. 271 * @brief Function to clear the interrupt of the timer.
272 * 272 *
273 * @param handle A TimerP_Handle returned from ::TimerP_create 273 * @param timerHandle A TimerP_Handle returned from ::TimerP_create
274 * 274 *
275 * @return Status of the function 275 * @return Status of the function
276 * - TimerP_OK: Clear the interrupt of the timer function successfully. 276 * - TimerP_OK: Clear the interrupt of the timer function successfully.
277 * 277 *
278 */ 278 */
279extern TimerP_Status TimerP_ClearInterrupt(TimerP_Handle handle); 279extern TimerP_Status TimerP_ClearInterrupt(TimerP_Handle timerHandle);
280 280
281/* 281/*
282 * @brief Function to return current time in units of micro-secs 282 * @brief Function to return current time in units of micro-secs
diff --git a/soc/j721e/TimerP_default.c b/soc/j721e/TimerP_default.c
index 658af30..d37455d 100755
--- a/soc/j721e/TimerP_default.c
+++ b/soc/j721e/TimerP_default.c
@@ -439,6 +439,7 @@ TimerP_dmTimerDefault gDmTimerPInfoTbl[TimerP_numTimerDevices] = {
439/* Returns the default frquency lower 32 bits */ 439/* Returns the default frquency lower 32 bits */
440int32_t TimerP_getDefaultFreqLo(uint32_t timerId) 440int32_t TimerP_getDefaultFreqLo(uint32_t timerId)
441{ 441{
442 (void)timerId;
442 /* return the same default frequency for all timer Ids */ 443 /* return the same default frequency for all timer Ids */
443 return(TIMERP_TIMER_FREQ_LO); 444 return(TIMERP_TIMER_FREQ_LO);
444} 445}
@@ -446,6 +447,7 @@ int32_t TimerP_getDefaultFreqLo(uint32_t timerId)
446/* Returns the default frquency higher 32 bits */ 447/* Returns the default frquency higher 32 bits */
447int32_t TimerP_getDefaultFreqHi(uint32_t timerId) 448int32_t TimerP_getDefaultFreqHi(uint32_t timerId)
448{ 449{
450 (void)timerId;
449 /* return the same default frequency for all timer Ids */ 451 /* return the same default frequency for all timer Ids */
450 return(TIMERP_TIMER_FREQ_HI); 452 return(TIMERP_TIMER_FREQ_HI);
451} 453}
diff --git a/src/nonos/Utils_nonos.c b/src/nonos/Utils_nonos.c
index 379b4f0..afaea5f 100644
--- a/src/nonos/Utils_nonos.c
+++ b/src/nonos/Utils_nonos.c
@@ -103,6 +103,9 @@ Osal_HwAttrs gOsal_HwAttrs = {
103 */ 103 */
104void Osal_DebugP_assert(int32_t expression, const char *file, int32_t line) 104void Osal_DebugP_assert(int32_t expression, const char *file, int32_t line)
105{ 105{
106 (void)file;
107 (void)line;
108
106 if (expression != 0) { 109 if (expression != 0) {
107 while (Osal_DebugP_Assert_Val == (bool)true) {} 110 while (Osal_DebugP_Assert_Val == (bool)true) {}
108 } 111 }