1 /*
2  * FreeRTOS Kernel V11.1.0
3  * Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * SPDX-License-Identifier: MIT
6  *
7  * Permission is hereby granted, free of charge, to any person obtaining a copy of
8  * this software and associated documentation files (the "Software"), to deal in
9  * the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11  * the Software, and to permit persons to whom the Software is furnished to do so,
12  * subject to the following conditions:
13  *
14  * The above copyright notice and this permission notice shall be included in all
15  * copies or substantial portions of the Software.
16  *
17  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23  *
24  * https://www.FreeRTOS.org
25  * https://github.com/FreeRTOS
26  *
27  */
28 
29 /* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
30  * all the API functions to use the MPU wrappers.  That should only be done when
31  * task.h is included from an application file. */
32 #define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
33 
34 /* Scheduler includes. */
35 #include "FreeRTOS.h"
36 #include "task.h"
37 #include "queue.h"
38 #include "timers.h"
39 #include "event_groups.h"
40 #include "stream_buffer.h"
41 #include "mpu_prototypes.h"
42 #include "mpu_syscall_numbers.h"
43 
44 #undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
45 /*-----------------------------------------------------------*/
46 
47 #if ( ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) )
48 
49     #if ( INCLUDE_xTaskDelayUntil == 1 )
50 
51         BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
52                                         const TickType_t xTimeIncrement ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
53 
MPU_xTaskDelayUntil(TickType_t * const pxPreviousWakeTime,const TickType_t xTimeIncrement)54         BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
55                                         const TickType_t xTimeIncrement ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
56         {
57             __asm volatile
58             (
59                 " .syntax unified                                       \n"
60                 " .extern MPU_xTaskDelayUntilImpl                       \n"
61                 "                                                       \n"
62                 " push {r0}                                             \n"
63                 " mrs r0, control                                       \n"
64                 " tst r0, #1                                            \n"
65                 " pop {r0}                                              \n"
66                 " bne MPU_xTaskDelayUntil_Unpriv                        \n"
67                 " MPU_xTaskDelayUntil_Priv:                             \n"
68                 "     b MPU_xTaskDelayUntilImpl                         \n"
69                 " MPU_xTaskDelayUntil_Unpriv:                           \n"
70                 "     svc %0                                            \n"
71                 "                                                       \n"
72                 : : "i" ( SYSTEM_CALL_xTaskDelayUntil ) : "memory"
73             );
74         }
75 
76     #endif /* if ( INCLUDE_xTaskDelayUntil == 1 ) */
77 /*-----------------------------------------------------------*/
78 
79     #if ( INCLUDE_xTaskAbortDelay == 1 )
80 
81         BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
82 
MPU_xTaskAbortDelay(TaskHandle_t xTask)83         BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
84         {
85             __asm volatile
86             (
87                 " .syntax unified                                       \n"
88                 " .extern MPU_xTaskAbortDelayImpl                       \n"
89                 "                                                       \n"
90                 " push {r0}                                             \n"
91                 " mrs r0, control                                       \n"
92                 " tst r0, #1                                            \n"
93                 " pop {r0}                                              \n"
94                 " bne MPU_xTaskAbortDelay_Unpriv                        \n"
95                 " MPU_xTaskAbortDelay_Priv:                             \n"
96                 "     b MPU_xTaskAbortDelayImpl                         \n"
97                 " MPU_xTaskAbortDelay_Unpriv:                           \n"
98                 "     svc %0                                            \n"
99                 "                                                       \n"
100                 : : "i" ( SYSTEM_CALL_xTaskAbortDelay ) : "memory"
101             );
102         }
103 
104     #endif /* if ( INCLUDE_xTaskAbortDelay == 1 ) */
105 /*-----------------------------------------------------------*/
106 
107     #if ( INCLUDE_vTaskDelay == 1 )
108 
109         void MPU_vTaskDelay( const TickType_t xTicksToDelay ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
110 
MPU_vTaskDelay(const TickType_t xTicksToDelay)111         void MPU_vTaskDelay( const TickType_t xTicksToDelay ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
112         {
113             __asm volatile
114             (
115                 " .syntax unified                                       \n"
116                 " .extern MPU_vTaskDelayImpl                            \n"
117                 "                                                       \n"
118                 " push {r0}                                             \n"
119                 " mrs r0, control                                       \n"
120                 " tst r0, #1                                            \n"
121                 " pop {r0}                                              \n"
122                 " bne MPU_vTaskDelay_Unpriv                             \n"
123                 " MPU_vTaskDelay_Priv:                                  \n"
124                 "     b MPU_vTaskDelayImpl                              \n"
125                 " MPU_vTaskDelay_Unpriv:                                \n"
126                 "     svc %0                                            \n"
127                 "                                                       \n"
128                 : : "i" ( SYSTEM_CALL_vTaskDelay ) : "memory"
129             );
130         }
131 
132     #endif /* if ( INCLUDE_vTaskDelay == 1 ) */
133 /*-----------------------------------------------------------*/
134 
135     #if ( INCLUDE_uxTaskPriorityGet == 1 )
136 
137         UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
138 
MPU_uxTaskPriorityGet(const TaskHandle_t xTask)139         UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
140         {
141             __asm volatile
142             (
143                 " .syntax unified                                       \n"
144                 " .extern MPU_uxTaskPriorityGetImpl                     \n"
145                 "                                                       \n"
146                 " push {r0}                                             \n"
147                 " mrs r0, control                                       \n"
148                 " tst r0, #1                                            \n"
149                 " pop {r0}                                              \n"
150                 " bne MPU_uxTaskPriorityGet_Unpriv                      \n"
151                 " MPU_uxTaskPriorityGet_Priv:                           \n"
152                 "     b MPU_uxTaskPriorityGetImpl                       \n"
153                 " MPU_uxTaskPriorityGet_Unpriv:                         \n"
154                 "     svc %0                                            \n"
155                 "                                                       \n"
156                 : : "i" ( SYSTEM_CALL_uxTaskPriorityGet ) : "memory"
157             );
158         }
159 
160     #endif /* if ( INCLUDE_uxTaskPriorityGet == 1 ) */
161 /*-----------------------------------------------------------*/
162 
163     #if ( INCLUDE_eTaskGetState == 1 )
164 
165         eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
166 
MPU_eTaskGetState(TaskHandle_t xTask)167         eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
168         {
169             __asm volatile
170             (
171                 " .syntax unified                                       \n"
172                 " .extern MPU_eTaskGetStateImpl                         \n"
173                 "                                                       \n"
174                 " push {r0}                                             \n"
175                 " mrs r0, control                                       \n"
176                 " tst r0, #1                                            \n"
177                 " pop {r0}                                              \n"
178                 " bne MPU_eTaskGetState_Unpriv                          \n"
179                 " MPU_eTaskGetState_Priv:                               \n"
180                 "     b MPU_eTaskGetStateImpl                           \n"
181                 " MPU_eTaskGetState_Unpriv:                             \n"
182                 "     svc %0                                            \n"
183                 "                                                       \n"
184                 : : "i" ( SYSTEM_CALL_eTaskGetState ) : "memory"
185             );
186         }
187 
188     #endif /* if ( INCLUDE_eTaskGetState == 1 ) */
189 /*-----------------------------------------------------------*/
190 
191     #if ( configUSE_TRACE_FACILITY == 1 )
192 
193         void MPU_vTaskGetInfo( TaskHandle_t xTask,
194                                TaskStatus_t * pxTaskStatus,
195                                BaseType_t xGetFreeStackSpace,
196                                eTaskState eState ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
197 
MPU_vTaskGetInfo(TaskHandle_t xTask,TaskStatus_t * pxTaskStatus,BaseType_t xGetFreeStackSpace,eTaskState eState)198         void MPU_vTaskGetInfo( TaskHandle_t xTask,
199                                TaskStatus_t * pxTaskStatus,
200                                BaseType_t xGetFreeStackSpace,
201                                eTaskState eState ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
202         {
203             __asm volatile
204             (
205                 " .syntax unified                                       \n"
206                 " .extern MPU_vTaskGetInfoImpl                          \n"
207                 "                                                       \n"
208                 " push {r0}                                             \n"
209                 " mrs r0, control                                       \n"
210                 " tst r0, #1                                            \n"
211                 " pop {r0}                                              \n"
212                 " bne MPU_vTaskGetInfo_Unpriv                           \n"
213                 " MPU_vTaskGetInfo_Priv:                                \n"
214                 "     b MPU_vTaskGetInfoImpl                            \n"
215                 " MPU_vTaskGetInfo_Unpriv:                              \n"
216                 "     svc %0                                            \n"
217                 "                                                       \n"
218                 : : "i" ( SYSTEM_CALL_vTaskGetInfo ) : "memory"
219             );
220         }
221 
222     #endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
223 /*-----------------------------------------------------------*/
224 
225     #if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
226 
227         TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
228 
MPU_xTaskGetIdleTaskHandle(void)229         TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
230         {
231             __asm volatile
232             (
233                 " .syntax unified                                       \n"
234                 " .extern MPU_xTaskGetIdleTaskHandleImpl                \n"
235                 "                                                       \n"
236                 " push {r0}                                             \n"
237                 " mrs r0, control                                       \n"
238                 " tst r0, #1                                            \n"
239                 " pop {r0}                                              \n"
240                 " bne MPU_xTaskGetIdleTaskHandle_Unpriv                 \n"
241                 " MPU_xTaskGetIdleTaskHandle_Priv:                      \n"
242                 "     b MPU_xTaskGetIdleTaskHandleImpl                  \n"
243                 " MPU_xTaskGetIdleTaskHandle_Unpriv:                    \n"
244                 "     svc %0                                            \n"
245                 "                                                       \n"
246                 : : "i" ( SYSTEM_CALL_xTaskGetIdleTaskHandle ) : "memory"
247             );
248         }
249 
250     #endif /* if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) */
251 /*-----------------------------------------------------------*/
252 
253     #if ( INCLUDE_vTaskSuspend == 1 )
254 
255         void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
256 
MPU_vTaskSuspend(TaskHandle_t xTaskToSuspend)257         void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
258         {
259             __asm volatile
260             (
261                 " .syntax unified                                       \n"
262                 " .extern MPU_vTaskSuspendImpl                          \n"
263                 "                                                       \n"
264                 " push {r0}                                             \n"
265                 " mrs r0, control                                       \n"
266                 " tst r0, #1                                            \n"
267                 " pop {r0}                                              \n"
268                 " bne MPU_vTaskSuspend_Unpriv                           \n"
269                 " MPU_vTaskSuspend_Priv:                                \n"
270                 "     b MPU_vTaskSuspendImpl                            \n"
271                 " MPU_vTaskSuspend_Unpriv:                              \n"
272                 "     svc %0                                            \n"
273                 "                                                       \n"
274                 : : "i" ( SYSTEM_CALL_vTaskSuspend ) : "memory"
275             );
276         }
277 
278     #endif /* if ( INCLUDE_vTaskSuspend == 1 ) */
279 /*-----------------------------------------------------------*/
280 
281     #if ( INCLUDE_vTaskSuspend == 1 )
282 
283         void MPU_vTaskResume( TaskHandle_t xTaskToResume ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
284 
MPU_vTaskResume(TaskHandle_t xTaskToResume)285         void MPU_vTaskResume( TaskHandle_t xTaskToResume ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
286         {
287             __asm volatile
288             (
289                 " .syntax unified                                       \n"
290                 " .extern MPU_vTaskResumeImpl                           \n"
291                 "                                                       \n"
292                 " push {r0}                                             \n"
293                 " mrs r0, control                                       \n"
294                 " tst r0, #1                                            \n"
295                 " pop {r0}                                              \n"
296                 " bne MPU_vTaskResume_Unpriv                            \n"
297                 " MPU_vTaskResume_Priv:                                 \n"
298                 "     b MPU_vTaskResumeImpl                             \n"
299                 " MPU_vTaskResume_Unpriv:                               \n"
300                 "     svc %0                                            \n"
301                 "                                                       \n"
302                 : : "i" ( SYSTEM_CALL_vTaskResume ) : "memory"
303             );
304         }
305 
306     #endif /* if ( INCLUDE_vTaskSuspend == 1 ) */
307 /*-----------------------------------------------------------*/
308 
309     TickType_t MPU_xTaskGetTickCount( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
310 
MPU_xTaskGetTickCount(void)311     TickType_t MPU_xTaskGetTickCount( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
312     {
313         __asm volatile
314         (
315             " .syntax unified                                       \n"
316             " .extern MPU_xTaskGetTickCountImpl                     \n"
317             "                                                       \n"
318             " push {r0}                                             \n"
319             " mrs r0, control                                       \n"
320             " tst r0, #1                                            \n"
321             " pop {r0}                                              \n"
322             " bne MPU_xTaskGetTickCount_Unpriv                      \n"
323             " MPU_xTaskGetTickCount_Priv:                           \n"
324             "     b MPU_xTaskGetTickCountImpl                       \n"
325             " MPU_xTaskGetTickCount_Unpriv:                         \n"
326             "     svc %0                                            \n"
327             "                                                       \n"
328             : : "i" ( SYSTEM_CALL_xTaskGetTickCount ) : "memory"
329         );
330     }
331 /*-----------------------------------------------------------*/
332 
333     UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
334 
MPU_uxTaskGetNumberOfTasks(void)335     UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
336     {
337         __asm volatile
338         (
339             " .syntax unified                                       \n"
340             " .extern MPU_uxTaskGetNumberOfTasksImpl                \n"
341             "                                                       \n"
342             " push {r0}                                             \n"
343             " mrs r0, control                                       \n"
344             " tst r0, #1                                            \n"
345             " pop {r0}                                              \n"
346             " bne MPU_uxTaskGetNumberOfTasks_Unpriv                 \n"
347             " MPU_uxTaskGetNumberOfTasks_Priv:                      \n"
348             "     b MPU_uxTaskGetNumberOfTasksImpl                  \n"
349             " MPU_uxTaskGetNumberOfTasks_Unpriv:                    \n"
350             "     svc %0                                            \n"
351             "                                                       \n"
352             : : "i" ( SYSTEM_CALL_uxTaskGetNumberOfTasks ) : "memory"
353         );
354     }
355 /*-----------------------------------------------------------*/
356 
357     #if ( configGENERATE_RUN_TIME_STATS == 1 )
358 
359         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
360 
MPU_ulTaskGetRunTimeCounter(const TaskHandle_t xTask)361         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
362         {
363             __asm volatile
364             (
365                 " .syntax unified                                       \n"
366                 " .extern MPU_ulTaskGetRunTimeCounterImpl               \n"
367                 "                                                       \n"
368                 " push {r0}                                             \n"
369                 " mrs r0, control                                       \n"
370                 " tst r0, #1                                            \n"
371                 " pop {r0}                                              \n"
372                 " bne MPU_ulTaskGetRunTimeCounter_Unpriv                \n"
373                 " MPU_ulTaskGetRunTimeCounter_Priv:                     \n"
374                 "     b MPU_ulTaskGetRunTimeCounterImpl                 \n"
375                 " MPU_ulTaskGetRunTimeCounter_Unpriv:                   \n"
376                 "     svc %0                                            \n"
377                 "                                                       \n"
378                 : : "i" ( SYSTEM_CALL_ulTaskGetRunTimeCounter ) : "memory"
379             );
380         }
381 
382     #endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) */
383 /*-----------------------------------------------------------*/
384 
385     #if ( configGENERATE_RUN_TIME_STATS == 1 )
386 
387         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
388 
MPU_ulTaskGetRunTimePercent(const TaskHandle_t xTask)389         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
390         {
391             __asm volatile
392             (
393                 " .syntax unified                                       \n"
394                 " .extern MPU_ulTaskGetRunTimePercentImpl               \n"
395                 "                                                       \n"
396                 " push {r0}                                             \n"
397                 " mrs r0, control                                       \n"
398                 " tst r0, #1                                            \n"
399                 " pop {r0}                                              \n"
400                 " bne MPU_ulTaskGetRunTimePercent_Unpriv                \n"
401                 " MPU_ulTaskGetRunTimePercent_Priv:                     \n"
402                 "     b MPU_ulTaskGetRunTimePercentImpl                 \n"
403                 " MPU_ulTaskGetRunTimePercent_Unpriv:                   \n"
404                 "     svc %0                                            \n"
405                 "                                                       \n"
406                 : : "i" ( SYSTEM_CALL_ulTaskGetRunTimePercent ) : "memory"
407             );
408         }
409 
410     #endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) */
411 /*-----------------------------------------------------------*/
412 
413     #if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
414 
415         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
416 
MPU_ulTaskGetIdleRunTimePercent(void)417         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
418         {
419             __asm volatile
420             (
421                 " .syntax unified                                       \n"
422                 " .extern MPU_ulTaskGetIdleRunTimePercentImpl           \n"
423                 "                                                       \n"
424                 " push {r0}                                             \n"
425                 " mrs r0, control                                       \n"
426                 " tst r0, #1                                            \n"
427                 " pop {r0}                                              \n"
428                 " bne MPU_ulTaskGetIdleRunTimePercent_Unpriv            \n"
429                 " MPU_ulTaskGetIdleRunTimePercent_Priv:                 \n"
430                 "     b MPU_ulTaskGetIdleRunTimePercentImpl             \n"
431                 " MPU_ulTaskGetIdleRunTimePercent_Unpriv:               \n"
432                 "     svc %0                                            \n"
433                 "                                                       \n"
434                 : : "i" ( SYSTEM_CALL_ulTaskGetIdleRunTimePercent ) : "memory"
435             );
436         }
437 
438     #endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
439 /*-----------------------------------------------------------*/
440 
441     #if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
442 
443         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
444 
MPU_ulTaskGetIdleRunTimeCounter(void)445         configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
446         {
447             __asm volatile
448             (
449                 " .syntax unified                                       \n"
450                 " .extern MPU_ulTaskGetIdleRunTimeCounterImpl           \n"
451                 "                                                       \n"
452                 " push {r0}                                             \n"
453                 " mrs r0, control                                       \n"
454                 " tst r0, #1                                            \n"
455                 " pop {r0}                                              \n"
456                 " bne MPU_ulTaskGetIdleRunTimeCounter_Unpriv            \n"
457                 " MPU_ulTaskGetIdleRunTimeCounter_Priv:                 \n"
458                 "     b MPU_ulTaskGetIdleRunTimeCounterImpl             \n"
459                 " MPU_ulTaskGetIdleRunTimeCounter_Unpriv:               \n"
460                 "     svc %0                                            \n"
461                 "                                                       \n"
462                 : : "i" ( SYSTEM_CALL_ulTaskGetIdleRunTimeCounter ) : "memory"
463             );
464         }
465 
466     #endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
467 /*-----------------------------------------------------------*/
468 
469     #if ( configUSE_APPLICATION_TASK_TAG == 1 )
470 
471         void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
472                                              TaskHookFunction_t pxHookFunction ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
473 
MPU_vTaskSetApplicationTaskTag(TaskHandle_t xTask,TaskHookFunction_t pxHookFunction)474         void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
475                                              TaskHookFunction_t pxHookFunction ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
476         {
477             __asm volatile
478             (
479                 " .syntax unified                                       \n"
480                 " .extern MPU_vTaskSetApplicationTaskTagImpl            \n"
481                 "                                                       \n"
482                 " push {r0}                                             \n"
483                 " mrs r0, control                                       \n"
484                 " tst r0, #1                                            \n"
485                 " pop {r0}                                              \n"
486                 " bne MPU_vTaskSetApplicationTaskTag_Unpriv             \n"
487                 " MPU_vTaskSetApplicationTaskTag_Priv:                  \n"
488                 "     b MPU_vTaskSetApplicationTaskTagImpl              \n"
489                 " MPU_vTaskSetApplicationTaskTag_Unpriv:                \n"
490                 "     svc %0                                            \n"
491                 "                                                       \n"
492                 : : "i" ( SYSTEM_CALL_vTaskSetApplicationTaskTag ) : "memory"
493             );
494         }
495 
496     #endif /* if ( configUSE_APPLICATION_TASK_TAG == 1 ) */
497 /*-----------------------------------------------------------*/
498 
499     #if ( configUSE_APPLICATION_TASK_TAG == 1 )
500 
501         TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
502 
MPU_xTaskGetApplicationTaskTag(TaskHandle_t xTask)503         TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
504         {
505             __asm volatile
506             (
507                 " .syntax unified                                       \n"
508                 " .extern MPU_xTaskGetApplicationTaskTagImpl            \n"
509                 "                                                       \n"
510                 " push {r0}                                             \n"
511                 " mrs r0, control                                       \n"
512                 " tst r0, #1                                            \n"
513                 " pop {r0}                                              \n"
514                 " bne MPU_xTaskGetApplicationTaskTag_Unpriv             \n"
515                 " MPU_xTaskGetApplicationTaskTag_Priv:                  \n"
516                 "     b MPU_xTaskGetApplicationTaskTagImpl              \n"
517                 " MPU_xTaskGetApplicationTaskTag_Unpriv:                \n"
518                 "     svc %0                                            \n"
519                 "                                                       \n"
520                 : : "i" ( SYSTEM_CALL_xTaskGetApplicationTaskTag ) : "memory"
521             );
522         }
523 
524     #endif /* if ( configUSE_APPLICATION_TASK_TAG == 1 ) */
525 /*-----------------------------------------------------------*/
526 
527     #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
528 
529         void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
530                                                     BaseType_t xIndex,
531                                                     void * pvValue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
532 
MPU_vTaskSetThreadLocalStoragePointer(TaskHandle_t xTaskToSet,BaseType_t xIndex,void * pvValue)533         void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
534                                                     BaseType_t xIndex,
535                                                     void * pvValue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
536         {
537             __asm volatile
538             (
539                 " .syntax unified                                       \n"
540                 " .extern MPU_vTaskSetThreadLocalStoragePointerImpl     \n"
541                 "                                                       \n"
542                 " push {r0}                                             \n"
543                 " mrs r0, control                                       \n"
544                 " tst r0, #1                                            \n"
545                 " pop {r0}                                              \n"
546                 " bne MPU_vTaskSetThreadLocalStoragePointer_Unpriv      \n"
547                 " MPU_vTaskSetThreadLocalStoragePointer_Priv:           \n"
548                 "     b MPU_vTaskSetThreadLocalStoragePointerImpl       \n"
549                 " MPU_vTaskSetThreadLocalStoragePointer_Unpriv:         \n"
550                 "     svc %0                                            \n"
551                 "                                                       \n"
552                 : : "i" ( SYSTEM_CALL_vTaskSetThreadLocalStoragePointer ) : "memory"
553             );
554         }
555 
556     #endif /* if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 ) */
557 /*-----------------------------------------------------------*/
558 
559     #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
560 
561         void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
562                                                        BaseType_t xIndex ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
563 
MPU_pvTaskGetThreadLocalStoragePointer(TaskHandle_t xTaskToQuery,BaseType_t xIndex)564         void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
565                                                        BaseType_t xIndex ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
566         {
567             __asm volatile
568             (
569                 " .syntax unified                                       \n"
570                 " .extern MPU_pvTaskGetThreadLocalStoragePointerImpl    \n"
571                 "                                                       \n"
572                 " push {r0}                                             \n"
573                 " mrs r0, control                                       \n"
574                 " tst r0, #1                                            \n"
575                 " pop {r0}                                              \n"
576                 " bne MPU_pvTaskGetThreadLocalStoragePointer_Unpriv     \n"
577                 " MPU_pvTaskGetThreadLocalStoragePointer_Priv:          \n"
578                 "     b MPU_pvTaskGetThreadLocalStoragePointerImpl      \n"
579                 " MPU_pvTaskGetThreadLocalStoragePointer_Unpriv:        \n"
580                 "     svc %0                                            \n"
581                 "                                                       \n"
582                 : : "i" ( SYSTEM_CALL_pvTaskGetThreadLocalStoragePointer ) : "memory"
583             );
584         }
585 
586     #endif /* if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 ) */
587 /*-----------------------------------------------------------*/
588 
589     #if ( configUSE_TRACE_FACILITY == 1 )
590 
591         UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
592                                               const UBaseType_t uxArraySize,
593                                               configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
594 
MPU_uxTaskGetSystemState(TaskStatus_t * const pxTaskStatusArray,const UBaseType_t uxArraySize,configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime)595         UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
596                                               const UBaseType_t uxArraySize,
597                                               configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
598         {
599             __asm volatile
600             (
601                 " .syntax unified                                       \n"
602                 " .extern MPU_uxTaskGetSystemStateImpl                  \n"
603                 "                                                       \n"
604                 " push {r0}                                             \n"
605                 " mrs r0, control                                       \n"
606                 " tst r0, #1                                            \n"
607                 " pop {r0}                                              \n"
608                 " bne MPU_uxTaskGetSystemState_Unpriv                   \n"
609                 " MPU_uxTaskGetSystemState_Priv:                        \n"
610                 "     b MPU_uxTaskGetSystemStateImpl                    \n"
611                 " MPU_uxTaskGetSystemState_Unpriv:                      \n"
612                 "     svc %0                                            \n"
613                 "                                                       \n"
614                 : : "i" ( SYSTEM_CALL_uxTaskGetSystemState ) : "memory"
615             );
616         }
617 
618     #endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
619 /*-----------------------------------------------------------*/
620 
621     #if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
622 
623         UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
624 
MPU_uxTaskGetStackHighWaterMark(TaskHandle_t xTask)625         UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
626         {
627             __asm volatile
628             (
629                 " .syntax unified                                       \n"
630                 " .extern MPU_uxTaskGetStackHighWaterMarkImpl           \n"
631                 "                                                       \n"
632                 " push {r0}                                             \n"
633                 " mrs r0, control                                       \n"
634                 " tst r0, #1                                            \n"
635                 " pop {r0}                                              \n"
636                 " bne MPU_uxTaskGetStackHighWaterMark_Unpriv            \n"
637                 " MPU_uxTaskGetStackHighWaterMark_Priv:                 \n"
638                 "     b MPU_uxTaskGetStackHighWaterMarkImpl             \n"
639                 " MPU_uxTaskGetStackHighWaterMark_Unpriv:               \n"
640                 "     svc %0                                            \n"
641                 "                                                       \n"
642                 : : "i" ( SYSTEM_CALL_uxTaskGetStackHighWaterMark ) : "memory"
643             );
644         }
645 
646     #endif /* if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) */
647 /*-----------------------------------------------------------*/
648 
649     #if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 )
650 
651         configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
652 
MPU_uxTaskGetStackHighWaterMark2(TaskHandle_t xTask)653         configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
654         {
655             __asm volatile
656             (
657                 " .syntax unified                                       \n"
658                 " .extern MPU_uxTaskGetStackHighWaterMark2Impl          \n"
659                 "                                                       \n"
660                 " push {r0}                                             \n"
661                 " mrs r0, control                                       \n"
662                 " tst r0, #1                                            \n"
663                 " pop {r0}                                              \n"
664                 " bne MPU_uxTaskGetStackHighWaterMark2_Unpriv           \n"
665                 " MPU_uxTaskGetStackHighWaterMark2_Priv:                \n"
666                 "     b MPU_uxTaskGetStackHighWaterMark2Impl            \n"
667                 " MPU_uxTaskGetStackHighWaterMark2_Unpriv:              \n"
668                 "     svc %0                                            \n"
669                 "                                                       \n"
670                 : : "i" ( SYSTEM_CALL_uxTaskGetStackHighWaterMark2 ) : "memory"
671             );
672         }
673 
674     #endif /* if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) */
675 /*-----------------------------------------------------------*/
676 
677     #if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
678 
679         TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
680 
MPU_xTaskGetCurrentTaskHandle(void)681         TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
682         {
683             __asm volatile
684             (
685                 " .syntax unified                                       \n"
686                 " .extern MPU_xTaskGetCurrentTaskHandleImpl             \n"
687                 "                                                       \n"
688                 " push {r0}                                             \n"
689                 " mrs r0, control                                       \n"
690                 " tst r0, #1                                            \n"
691                 " pop {r0}                                              \n"
692                 " bne MPU_xTaskGetCurrentTaskHandle_Unpriv              \n"
693                 " MPU_xTaskGetCurrentTaskHandle_Priv:                   \n"
694                 "     b MPU_xTaskGetCurrentTaskHandleImpl               \n"
695                 " MPU_xTaskGetCurrentTaskHandle_Unpriv:                 \n"
696                 "     svc %0                                            \n"
697                 "                                                       \n"
698                 : : "i" ( SYSTEM_CALL_xTaskGetCurrentTaskHandle ) : "memory"
699             );
700         }
701 
702     #endif /* if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
703 /*-----------------------------------------------------------*/
704 
705     #if ( INCLUDE_xTaskGetSchedulerState == 1 )
706 
707         BaseType_t MPU_xTaskGetSchedulerState( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
708 
MPU_xTaskGetSchedulerState(void)709         BaseType_t MPU_xTaskGetSchedulerState( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
710         {
711             __asm volatile
712             (
713                 " .syntax unified                                       \n"
714                 " .extern MPU_xTaskGetSchedulerStateImpl                \n"
715                 "                                                       \n"
716                 " push {r0}                                             \n"
717                 " mrs r0, control                                       \n"
718                 " tst r0, #1                                            \n"
719                 " pop {r0}                                              \n"
720                 " bne MPU_xTaskGetSchedulerState_Unpriv                 \n"
721                 " MPU_xTaskGetSchedulerState_Priv:                      \n"
722                 "     b MPU_xTaskGetSchedulerStateImpl                  \n"
723                 " MPU_xTaskGetSchedulerState_Unpriv:                    \n"
724                 "     svc %0                                            \n"
725                 "                                                       \n"
726                 : : "i" ( SYSTEM_CALL_xTaskGetSchedulerState ) : "memory"
727             );
728         }
729 
730     #endif /* if ( INCLUDE_xTaskGetSchedulerState == 1 ) */
731 /*-----------------------------------------------------------*/
732 
733     void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
734 
MPU_vTaskSetTimeOutState(TimeOut_t * const pxTimeOut)735     void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
736     {
737         __asm volatile
738         (
739             " .syntax unified                                       \n"
740             " .extern MPU_vTaskSetTimeOutStateImpl                  \n"
741             "                                                       \n"
742             " push {r0}                                             \n"
743             " mrs r0, control                                       \n"
744             " tst r0, #1                                            \n"
745             " pop {r0}                                              \n"
746             " bne MPU_vTaskSetTimeOutState_Unpriv                   \n"
747             " MPU_vTaskSetTimeOutState_Priv:                        \n"
748             "     b MPU_vTaskSetTimeOutStateImpl                    \n"
749             " MPU_vTaskSetTimeOutState_Unpriv:                      \n"
750             "     svc %0                                            \n"
751             "                                                       \n"
752             : : "i" ( SYSTEM_CALL_vTaskSetTimeOutState ) : "memory"
753         );
754     }
755 /*-----------------------------------------------------------*/
756 
757     BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
758                                          TickType_t * const pxTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
759 
MPU_xTaskCheckForTimeOut(TimeOut_t * const pxTimeOut,TickType_t * const pxTicksToWait)760     BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
761                                          TickType_t * const pxTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
762     {
763         __asm volatile
764         (
765             " .syntax unified                                       \n"
766             " .extern MPU_xTaskCheckForTimeOutImpl                  \n"
767             "                                                       \n"
768             " push {r0}                                             \n"
769             " mrs r0, control                                       \n"
770             " tst r0, #1                                            \n"
771             " pop {r0}                                              \n"
772             " bne MPU_xTaskCheckForTimeOut_Unpriv                   \n"
773             " MPU_xTaskCheckForTimeOut_Priv:                        \n"
774             "     b MPU_xTaskCheckForTimeOutImpl                    \n"
775             " MPU_xTaskCheckForTimeOut_Unpriv:                      \n"
776             "     svc %0                                            \n"
777             "                                                       \n"
778             : : "i" ( SYSTEM_CALL_xTaskCheckForTimeOut ) : "memory"
779         );
780     }
781 /*-----------------------------------------------------------*/
782 
783     #if ( configUSE_TASK_NOTIFICATIONS == 1 )
784 
785         BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
786 
MPU_xTaskGenericNotifyEntry(const xTaskGenericNotifyParams_t * pxParams)787         BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
788         {
789             __asm volatile
790             (
791                 " .syntax unified                                       \n"
792                 " .extern MPU_xTaskGenericNotifyImpl                    \n"
793                 "                                                       \n"
794                 " push {r0}                                             \n"
795                 " mrs r0, control                                       \n"
796                 " tst r0, #1                                            \n"
797                 " pop {r0}                                              \n"
798                 " bne MPU_xTaskGenericNotify_Unpriv                     \n"
799                 " MPU_xTaskGenericNotify_Priv:                          \n"
800                 "     b MPU_xTaskGenericNotifyImpl                      \n"
801                 " MPU_xTaskGenericNotify_Unpriv:                        \n"
802                 "     svc %0                                            \n"
803                 "                                                       \n"
804                 : : "i" ( SYSTEM_CALL_xTaskGenericNotify ) : "memory"
805             );
806         }
807 
808     #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
809 /*-----------------------------------------------------------*/
810 
811     #if ( configUSE_TASK_NOTIFICATIONS == 1 )
812 
813         BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
814 
MPU_xTaskGenericNotifyWaitEntry(const xTaskGenericNotifyWaitParams_t * pxParams)815         BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
816         {
817             __asm volatile
818             (
819                 " .syntax unified                                       \n"
820                 " .extern MPU_xTaskGenericNotifyWaitImpl                \n"
821                 "                                                       \n"
822                 " push {r0}                                             \n"
823                 " mrs r0, control                                       \n"
824                 " tst r0, #1                                            \n"
825                 " pop {r0}                                              \n"
826                 " bne MPU_xTaskGenericNotifyWait_Unpriv                 \n"
827                 " MPU_xTaskGenericNotifyWait_Priv:                      \n"
828                 "     b MPU_xTaskGenericNotifyWaitImpl                  \n"
829                 " MPU_xTaskGenericNotifyWait_Unpriv:                    \n"
830                 "     svc %0                                            \n"
831                 "                                                       \n"
832                 : : "i" ( SYSTEM_CALL_xTaskGenericNotifyWait ) : "memory"
833             );
834         }
835 
836     #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
837 /*-----------------------------------------------------------*/
838 
839     #if ( configUSE_TASK_NOTIFICATIONS == 1 )
840 
841         uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
842                                               BaseType_t xClearCountOnExit,
843                                               TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
844 
MPU_ulTaskGenericNotifyTake(UBaseType_t uxIndexToWaitOn,BaseType_t xClearCountOnExit,TickType_t xTicksToWait)845         uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
846                                               BaseType_t xClearCountOnExit,
847                                               TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
848         {
849             __asm volatile
850             (
851                 " .syntax unified                                       \n"
852                 " .extern MPU_ulTaskGenericNotifyTakeImpl               \n"
853                 "                                                       \n"
854                 " push {r0}                                             \n"
855                 " mrs r0, control                                       \n"
856                 " tst r0, #1                                            \n"
857                 " pop {r0}                                              \n"
858                 " bne MPU_ulTaskGenericNotifyTake_Unpriv                \n"
859                 " MPU_ulTaskGenericNotifyTake_Priv:                     \n"
860                 "     b MPU_ulTaskGenericNotifyTakeImpl                 \n"
861                 " MPU_ulTaskGenericNotifyTake_Unpriv:                   \n"
862                 "     svc %0                                            \n"
863                 "                                                       \n"
864                 : : "i" ( SYSTEM_CALL_ulTaskGenericNotifyTake ) : "memory"
865             );
866         }
867 
868     #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
869 /*-----------------------------------------------------------*/
870 
871     #if ( configUSE_TASK_NOTIFICATIONS == 1 )
872 
873         BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
874                                                      UBaseType_t uxIndexToClear ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
875 
MPU_xTaskGenericNotifyStateClear(TaskHandle_t xTask,UBaseType_t uxIndexToClear)876         BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
877                                                      UBaseType_t uxIndexToClear ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
878         {
879             __asm volatile
880             (
881                 " .syntax unified                                       \n"
882                 " .extern MPU_xTaskGenericNotifyStateClearImpl          \n"
883                 "                                                       \n"
884                 " push {r0}                                             \n"
885                 " mrs r0, control                                       \n"
886                 " tst r0, #1                                            \n"
887                 " pop {r0}                                              \n"
888                 " bne MPU_xTaskGenericNotifyStateClear_Unpriv           \n"
889                 " MPU_xTaskGenericNotifyStateClear_Priv:                \n"
890                 "     b MPU_xTaskGenericNotifyStateClearImpl            \n"
891                 " MPU_xTaskGenericNotifyStateClear_Unpriv:              \n"
892                 "     svc %0                                            \n"
893                 "                                                       \n"
894                 : : "i" ( SYSTEM_CALL_xTaskGenericNotifyStateClear ) : "memory"
895             );
896         }
897 
898     #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
899 /*-----------------------------------------------------------*/
900 
901     #if ( configUSE_TASK_NOTIFICATIONS == 1 )
902 
903         uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
904                                                     UBaseType_t uxIndexToClear,
905                                                     uint32_t ulBitsToClear ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
906 
MPU_ulTaskGenericNotifyValueClear(TaskHandle_t xTask,UBaseType_t uxIndexToClear,uint32_t ulBitsToClear)907         uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
908                                                     UBaseType_t uxIndexToClear,
909                                                     uint32_t ulBitsToClear ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
910         {
911             __asm volatile
912             (
913                 " .syntax unified                                       \n"
914                 " .extern MPU_ulTaskGenericNotifyValueClearImpl         \n"
915                 "                                                       \n"
916                 " push {r0}                                             \n"
917                 " mrs r0, control                                       \n"
918                 " tst r0, #1                                            \n"
919                 " pop {r0}                                              \n"
920                 " bne MPU_ulTaskGenericNotifyValueClear_Unpriv          \n"
921                 " MPU_ulTaskGenericNotifyValueClear_Priv:               \n"
922                 "     b MPU_ulTaskGenericNotifyValueClearImpl           \n"
923                 " MPU_ulTaskGenericNotifyValueClear_Unpriv:             \n"
924                 "     svc %0                                            \n"
925                 "                                                       \n"
926                 : : "i" ( SYSTEM_CALL_ulTaskGenericNotifyValueClear ) : "memory"
927             );
928         }
929 
930     #endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
931 /*-----------------------------------------------------------*/
932 
933     BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
934                                       const void * const pvItemToQueue,
935                                       TickType_t xTicksToWait,
936                                       const BaseType_t xCopyPosition ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
937 
MPU_xQueueGenericSend(QueueHandle_t xQueue,const void * const pvItemToQueue,TickType_t xTicksToWait,const BaseType_t xCopyPosition)938     BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
939                                       const void * const pvItemToQueue,
940                                       TickType_t xTicksToWait,
941                                       const BaseType_t xCopyPosition ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
942     {
943         __asm volatile
944         (
945             " .syntax unified                                       \n"
946             " .extern MPU_xQueueGenericSendImpl                     \n"
947             "                                                       \n"
948             " push {r0}                                             \n"
949             " mrs r0, control                                       \n"
950             " tst r0, #1                                            \n"
951             " pop {r0}                                              \n"
952             " bne MPU_xQueueGenericSend_Unpriv                      \n"
953             " MPU_xQueueGenericSend_Priv:                           \n"
954             "     b MPU_xQueueGenericSendImpl                       \n"
955             " MPU_xQueueGenericSend_Unpriv:                         \n"
956             "     svc %0                                            \n"
957             "                                                       \n"
958             : : "i" ( SYSTEM_CALL_xQueueGenericSend ) : "memory"
959         );
960     }
961 /*-----------------------------------------------------------*/
962 
963     UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
964 
MPU_uxQueueMessagesWaiting(const QueueHandle_t xQueue)965     UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
966     {
967         __asm volatile
968         (
969             " .syntax unified                                       \n"
970             " .extern MPU_uxQueueMessagesWaitingImpl                \n"
971             "                                                       \n"
972             " push {r0}                                             \n"
973             " mrs r0, control                                       \n"
974             " tst r0, #1                                            \n"
975             " pop {r0}                                              \n"
976             " bne MPU_uxQueueMessagesWaiting_Unpriv                 \n"
977             " MPU_uxQueueMessagesWaiting_Priv:                      \n"
978             "     b MPU_uxQueueMessagesWaitingImpl                  \n"
979             " MPU_uxQueueMessagesWaiting_Unpriv:                    \n"
980             "     svc %0                                            \n"
981             "                                                       \n"
982             : : "i" ( SYSTEM_CALL_uxQueueMessagesWaiting ) : "memory"
983         );
984     }
985 /*-----------------------------------------------------------*/
986 
987     UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
988 
MPU_uxQueueSpacesAvailable(const QueueHandle_t xQueue)989     UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
990     {
991         __asm volatile
992         (
993             " .syntax unified                                       \n"
994             " .extern MPU_uxQueueSpacesAvailableImpl                \n"
995             "                                                       \n"
996             " push {r0}                                             \n"
997             " mrs r0, control                                       \n"
998             " tst r0, #1                                            \n"
999             " pop {r0}                                              \n"
1000             " bne MPU_uxQueueSpacesAvailable_Unpriv                 \n"
1001             " MPU_uxQueueSpacesAvailable_Priv:                      \n"
1002             "     b MPU_uxQueueSpacesAvailableImpl                  \n"
1003             " MPU_uxQueueSpacesAvailable_Unpriv:                    \n"
1004             "     svc %0                                            \n"
1005             "                                                       \n"
1006             : : "i" ( SYSTEM_CALL_uxQueueSpacesAvailable ) : "memory"
1007         );
1008     }
1009 /*-----------------------------------------------------------*/
1010 
1011     BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
1012                                   void * const pvBuffer,
1013                                   TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1014 
MPU_xQueueReceive(QueueHandle_t xQueue,void * const pvBuffer,TickType_t xTicksToWait)1015     BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
1016                                   void * const pvBuffer,
1017                                   TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1018     {
1019         __asm volatile
1020         (
1021             " .syntax unified                                       \n"
1022             " .extern MPU_xQueueReceiveImpl                         \n"
1023             "                                                       \n"
1024             " push {r0}                                             \n"
1025             " mrs r0, control                                       \n"
1026             " tst r0, #1                                            \n"
1027             " pop {r0}                                              \n"
1028             " bne MPU_xQueueReceive_Unpriv                          \n"
1029             " MPU_xQueueReceive_Priv:                               \n"
1030             "     b MPU_xQueueReceiveImpl                           \n"
1031             " MPU_xQueueReceive_Unpriv:                             \n"
1032             "     svc %0                                            \n"
1033             "                                                       \n"
1034             : : "i" ( SYSTEM_CALL_xQueueReceive ) : "memory"
1035         );
1036     }
1037 /*-----------------------------------------------------------*/
1038 
1039     BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
1040                                void * const pvBuffer,
1041                                TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1042 
MPU_xQueuePeek(QueueHandle_t xQueue,void * const pvBuffer,TickType_t xTicksToWait)1043     BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
1044                                void * const pvBuffer,
1045                                TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1046     {
1047         __asm volatile
1048         (
1049             " .syntax unified                                       \n"
1050             " .extern MPU_xQueuePeekImpl                            \n"
1051             "                                                       \n"
1052             " push {r0}                                             \n"
1053             " mrs r0, control                                       \n"
1054             " tst r0, #1                                            \n"
1055             " pop {r0}                                              \n"
1056             " bne MPU_xQueuePeek_Unpriv                             \n"
1057             " MPU_xQueuePeek_Priv:                                  \n"
1058             "     b MPU_xQueuePeekImpl                              \n"
1059             " MPU_xQueuePeek_Unpriv:                                \n"
1060             "     svc %0                                            \n"
1061             "                                                       \n"
1062             : : "i" ( SYSTEM_CALL_xQueuePeek ) : "memory"
1063         );
1064     }
1065 /*-----------------------------------------------------------*/
1066 
1067     BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
1068                                         TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1069 
MPU_xQueueSemaphoreTake(QueueHandle_t xQueue,TickType_t xTicksToWait)1070     BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
1071                                         TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1072     {
1073         __asm volatile
1074         (
1075             " .syntax unified                                       \n"
1076             " .extern MPU_xQueueSemaphoreTakeImpl                   \n"
1077             "                                                       \n"
1078             " push {r0}                                             \n"
1079             " mrs r0, control                                       \n"
1080             " tst r0, #1                                            \n"
1081             " pop {r0}                                              \n"
1082             " bne MPU_xQueueSemaphoreTake_Unpriv                    \n"
1083             " MPU_xQueueSemaphoreTake_Priv:                         \n"
1084             "     b MPU_xQueueSemaphoreTakeImpl                     \n"
1085             " MPU_xQueueSemaphoreTake_Unpriv:                       \n"
1086             "     svc %0                                            \n"
1087             "                                                       \n"
1088             : : "i" ( SYSTEM_CALL_xQueueSemaphoreTake ) : "memory"
1089         );
1090     }
1091 /*-----------------------------------------------------------*/
1092 
1093     #if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
1094 
1095         TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1096 
MPU_xQueueGetMutexHolder(QueueHandle_t xSemaphore)1097         TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1098         {
1099             __asm volatile
1100             (
1101                 " .syntax unified                                       \n"
1102                 " .extern MPU_xQueueGetMutexHolderImpl                  \n"
1103                 "                                                       \n"
1104                 " push {r0}                                             \n"
1105                 " mrs r0, control                                       \n"
1106                 " tst r0, #1                                            \n"
1107                 " pop {r0}                                              \n"
1108                 " bne MPU_xQueueGetMutexHolder_Unpriv                   \n"
1109                 " MPU_xQueueGetMutexHolder_Priv:                        \n"
1110                 "     b MPU_xQueueGetMutexHolderImpl                    \n"
1111                 " MPU_xQueueGetMutexHolder_Unpriv:                      \n"
1112                 "     svc %0                                            \n"
1113                 "                                                       \n"
1114                 : : "i" ( SYSTEM_CALL_xQueueGetMutexHolder ) : "memory"
1115             );
1116         }
1117 
1118     #endif /* if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) ) */
1119 /*-----------------------------------------------------------*/
1120 
1121     #if ( configUSE_RECURSIVE_MUTEXES == 1 )
1122 
1123         BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
1124                                                  TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1125 
MPU_xQueueTakeMutexRecursive(QueueHandle_t xMutex,TickType_t xTicksToWait)1126         BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
1127                                                  TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1128         {
1129             __asm volatile
1130             (
1131                 " .syntax unified                                       \n"
1132                 " .extern MPU_xQueueTakeMutexRecursiveImpl              \n"
1133                 "                                                       \n"
1134                 " push {r0}                                             \n"
1135                 " mrs r0, control                                       \n"
1136                 " tst r0, #1                                            \n"
1137                 " pop {r0}                                              \n"
1138                 " bne MPU_xQueueTakeMutexRecursive_Unpriv               \n"
1139                 " MPU_xQueueTakeMutexRecursive_Priv:                    \n"
1140                 "     b MPU_xQueueTakeMutexRecursiveImpl                \n"
1141                 " MPU_xQueueTakeMutexRecursive_Unpriv:                  \n"
1142                 "     svc %0                                            \n"
1143                 "                                                       \n"
1144                 : : "i" ( SYSTEM_CALL_xQueueTakeMutexRecursive ) : "memory"
1145             );
1146         }
1147 
1148     #endif /* if ( configUSE_RECURSIVE_MUTEXES == 1 ) */
1149 /*-----------------------------------------------------------*/
1150 
1151     #if ( configUSE_RECURSIVE_MUTEXES == 1 )
1152 
1153         BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1154 
MPU_xQueueGiveMutexRecursive(QueueHandle_t pxMutex)1155         BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1156         {
1157             __asm volatile
1158             (
1159                 " .syntax unified                                       \n"
1160                 " .extern MPU_xQueueGiveMutexRecursiveImpl              \n"
1161                 "                                                       \n"
1162                 " push {r0}                                             \n"
1163                 " mrs r0, control                                       \n"
1164                 " tst r0, #1                                            \n"
1165                 " pop {r0}                                              \n"
1166                 " bne MPU_xQueueGiveMutexRecursive_Unpriv               \n"
1167                 " MPU_xQueueGiveMutexRecursive_Priv:                    \n"
1168                 "     b MPU_xQueueGiveMutexRecursiveImpl                \n"
1169                 " MPU_xQueueGiveMutexRecursive_Unpriv:                  \n"
1170                 "     svc %0                                            \n"
1171                 "                                                       \n"
1172                 : : "i" ( SYSTEM_CALL_xQueueGiveMutexRecursive ) : "memory"
1173             );
1174         }
1175 
1176     #endif /* if ( configUSE_RECURSIVE_MUTEXES == 1 ) */
1177 /*-----------------------------------------------------------*/
1178 
1179     #if ( configUSE_QUEUE_SETS == 1 )
1180 
1181         QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
1182                                                         const TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1183 
MPU_xQueueSelectFromSet(QueueSetHandle_t xQueueSet,const TickType_t xTicksToWait)1184         QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
1185                                                         const TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1186         {
1187             __asm volatile
1188             (
1189                 " .syntax unified                                       \n"
1190                 " .extern MPU_xQueueSelectFromSetImpl                   \n"
1191                 "                                                       \n"
1192                 " push {r0}                                             \n"
1193                 " mrs r0, control                                       \n"
1194                 " tst r0, #1                                            \n"
1195                 " pop {r0}                                              \n"
1196                 " bne MPU_xQueueSelectFromSet_Unpriv                    \n"
1197                 " MPU_xQueueSelectFromSet_Priv:                         \n"
1198                 "     b MPU_xQueueSelectFromSetImpl                     \n"
1199                 " MPU_xQueueSelectFromSet_Unpriv:                       \n"
1200                 "     svc %0                                            \n"
1201                 "                                                       \n"
1202                 : : "i" ( SYSTEM_CALL_xQueueSelectFromSet ) : "memory"
1203             );
1204         }
1205 
1206     #endif /* if ( configUSE_QUEUE_SETS == 1 ) */
1207 /*-----------------------------------------------------------*/
1208 
1209     #if ( configUSE_QUEUE_SETS == 1 )
1210 
1211         BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
1212                                        QueueSetHandle_t xQueueSet ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1213 
MPU_xQueueAddToSet(QueueSetMemberHandle_t xQueueOrSemaphore,QueueSetHandle_t xQueueSet)1214         BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
1215                                        QueueSetHandle_t xQueueSet ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1216         {
1217             __asm volatile
1218             (
1219                 " .syntax unified                                       \n"
1220                 " .extern MPU_xQueueAddToSetImpl                        \n"
1221                 "                                                       \n"
1222                 " push {r0}                                             \n"
1223                 " mrs r0, control                                       \n"
1224                 " tst r0, #1                                            \n"
1225                 " pop {r0}                                              \n"
1226                 " bne MPU_xQueueAddToSet_Unpriv                         \n"
1227                 " MPU_xQueueAddToSet_Priv:                              \n"
1228                 "     b MPU_xQueueAddToSetImpl                          \n"
1229                 " MPU_xQueueAddToSet_Unpriv:                            \n"
1230                 "     svc %0                                            \n"
1231                 "                                                       \n"
1232                 : : "i" ( SYSTEM_CALL_xQueueAddToSet ) : "memory"
1233             );
1234         }
1235 
1236     #endif /* if ( configUSE_QUEUE_SETS == 1 ) */
1237 /*-----------------------------------------------------------*/
1238 
1239     #if ( configQUEUE_REGISTRY_SIZE > 0 )
1240 
1241         void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
1242                                       const char * pcName ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1243 
MPU_vQueueAddToRegistry(QueueHandle_t xQueue,const char * pcName)1244         void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
1245                                       const char * pcName ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1246         {
1247             __asm volatile
1248             (
1249                 " .syntax unified                                       \n"
1250                 " .extern MPU_vQueueAddToRegistryImpl                   \n"
1251                 "                                                       \n"
1252                 " push {r0}                                             \n"
1253                 " mrs r0, control                                       \n"
1254                 " tst r0, #1                                            \n"
1255                 " pop {r0}                                              \n"
1256                 " bne MPU_vQueueAddToRegistry_Unpriv                    \n"
1257                 " MPU_vQueueAddToRegistry_Priv:                         \n"
1258                 "     b MPU_vQueueAddToRegistryImpl                     \n"
1259                 " MPU_vQueueAddToRegistry_Unpriv:                       \n"
1260                 "     svc %0                                            \n"
1261                 "                                                       \n"
1262                 : : "i" ( SYSTEM_CALL_vQueueAddToRegistry ) : "memory"
1263             );
1264         }
1265 
1266     #endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
1267 /*-----------------------------------------------------------*/
1268 
1269     #if ( configQUEUE_REGISTRY_SIZE > 0 )
1270 
1271         void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1272 
MPU_vQueueUnregisterQueue(QueueHandle_t xQueue)1273         void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1274         {
1275             __asm volatile
1276             (
1277                 " .syntax unified                                       \n"
1278                 " .extern MPU_vQueueUnregisterQueueImpl                 \n"
1279                 "                                                       \n"
1280                 " push {r0}                                             \n"
1281                 " mrs r0, control                                       \n"
1282                 " tst r0, #1                                            \n"
1283                 " pop {r0}                                              \n"
1284                 " bne MPU_vQueueUnregisterQueue_Unpriv                  \n"
1285                 " MPU_vQueueUnregisterQueue_Priv:                       \n"
1286                 "     b MPU_vQueueUnregisterQueueImpl                   \n"
1287                 " MPU_vQueueUnregisterQueue_Unpriv:                     \n"
1288                 "     svc %0                                            \n"
1289                 "                                                       \n"
1290                 : : "i" ( SYSTEM_CALL_vQueueUnregisterQueue ) : "memory"
1291             );
1292         }
1293 
1294     #endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
1295 /*-----------------------------------------------------------*/
1296 
1297     #if ( configQUEUE_REGISTRY_SIZE > 0 )
1298 
1299         const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1300 
MPU_pcQueueGetName(QueueHandle_t xQueue)1301         const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1302         {
1303             __asm volatile
1304             (
1305                 " .syntax unified                                       \n"
1306                 " .extern MPU_pcQueueGetNameImpl                        \n"
1307                 "                                                       \n"
1308                 " push {r0}                                             \n"
1309                 " mrs r0, control                                       \n"
1310                 " tst r0, #1                                            \n"
1311                 " pop {r0}                                              \n"
1312                 " bne MPU_pcQueueGetName_Unpriv                         \n"
1313                 " MPU_pcQueueGetName_Priv:                              \n"
1314                 "     b MPU_pcQueueGetNameImpl                          \n"
1315                 " MPU_pcQueueGetName_Unpriv:                            \n"
1316                 "     svc %0                                            \n"
1317                 "                                                       \n"
1318                 : : "i" ( SYSTEM_CALL_pcQueueGetName ) : "memory"
1319             );
1320         }
1321 
1322     #endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
1323 /*-----------------------------------------------------------*/
1324 
1325     #if ( configUSE_TIMERS == 1 )
1326 
1327         void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1328 
MPU_pvTimerGetTimerID(const TimerHandle_t xTimer)1329         void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1330         {
1331             __asm volatile
1332             (
1333                 " .syntax unified                                       \n"
1334                 " .extern MPU_pvTimerGetTimerIDImpl                     \n"
1335                 "                                                       \n"
1336                 " push {r0}                                             \n"
1337                 " mrs r0, control                                       \n"
1338                 " tst r0, #1                                            \n"
1339                 " pop {r0}                                              \n"
1340                 " bne MPU_pvTimerGetTimerID_Unpriv                      \n"
1341                 " MPU_pvTimerGetTimerID_Priv:                           \n"
1342                 "     b MPU_pvTimerGetTimerIDImpl                       \n"
1343                 " MPU_pvTimerGetTimerID_Unpriv:                         \n"
1344                 "     svc %0                                            \n"
1345                 "                                                       \n"
1346                 : : "i" ( SYSTEM_CALL_pvTimerGetTimerID ) : "memory"
1347             );
1348         }
1349 
1350     #endif /* if ( configUSE_TIMERS == 1 ) */
1351 /*-----------------------------------------------------------*/
1352 
1353     #if ( configUSE_TIMERS == 1 )
1354 
1355         void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
1356                                    void * pvNewID ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1357 
MPU_vTimerSetTimerID(TimerHandle_t xTimer,void * pvNewID)1358         void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
1359                                    void * pvNewID ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1360         {
1361             __asm volatile
1362             (
1363                 " .syntax unified                                       \n"
1364                 " .extern MPU_vTimerSetTimerIDImpl                      \n"
1365                 "                                                       \n"
1366                 " push {r0}                                             \n"
1367                 " mrs r0, control                                       \n"
1368                 " tst r0, #1                                            \n"
1369                 " pop {r0}                                              \n"
1370                 " bne MPU_vTimerSetTimerID_Unpriv                       \n"
1371                 " MPU_vTimerSetTimerID_Priv:                            \n"
1372                 "     b MPU_vTimerSetTimerIDImpl                        \n"
1373                 " MPU_vTimerSetTimerID_Unpriv:                          \n"
1374                 "     svc %0                                            \n"
1375                 "                                                       \n"
1376                 : : "i" ( SYSTEM_CALL_vTimerSetTimerID ) : "memory"
1377             );
1378         }
1379 
1380     #endif /* if ( configUSE_TIMERS == 1 ) */
1381 /*-----------------------------------------------------------*/
1382 
1383     #if ( configUSE_TIMERS == 1 )
1384 
1385         BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1386 
MPU_xTimerIsTimerActive(TimerHandle_t xTimer)1387         BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1388         {
1389             __asm volatile
1390             (
1391                 " .syntax unified                                       \n"
1392                 " .extern MPU_xTimerIsTimerActiveImpl                   \n"
1393                 "                                                       \n"
1394                 " push {r0}                                             \n"
1395                 " mrs r0, control                                       \n"
1396                 " tst r0, #1                                            \n"
1397                 " pop {r0}                                              \n"
1398                 " bne MPU_xTimerIsTimerActive_Unpriv                    \n"
1399                 " MPU_xTimerIsTimerActive_Priv:                         \n"
1400                 "     b MPU_xTimerIsTimerActiveImpl                     \n"
1401                 " MPU_xTimerIsTimerActive_Unpriv:                       \n"
1402                 "     svc %0                                            \n"
1403                 "                                                       \n"
1404                 : : "i" ( SYSTEM_CALL_xTimerIsTimerActive ) : "memory"
1405             );
1406         }
1407 
1408     #endif /* if ( configUSE_TIMERS == 1 ) */
1409 /*-----------------------------------------------------------*/
1410 
1411     #if ( configUSE_TIMERS == 1 )
1412 
1413         TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1414 
MPU_xTimerGetTimerDaemonTaskHandle(void)1415         TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1416         {
1417             __asm volatile
1418             (
1419                 " .syntax unified                                       \n"
1420                 " .extern MPU_xTimerGetTimerDaemonTaskHandleImpl        \n"
1421                 "                                                       \n"
1422                 " push {r0}                                             \n"
1423                 " mrs r0, control                                       \n"
1424                 " tst r0, #1                                            \n"
1425                 " pop {r0}                                              \n"
1426                 " bne MPU_xTimerGetTimerDaemonTaskHandle_Unpriv         \n"
1427                 " MPU_xTimerGetTimerDaemonTaskHandle_Priv:              \n"
1428                 "     b MPU_xTimerGetTimerDaemonTaskHandleImpl          \n"
1429                 " MPU_xTimerGetTimerDaemonTaskHandle_Unpriv:            \n"
1430                 "     svc %0                                            \n"
1431                 "                                                       \n"
1432                 : : "i" ( SYSTEM_CALL_xTimerGetTimerDaemonTaskHandle ) : "memory"
1433             );
1434         }
1435 
1436     #endif /* if ( configUSE_TIMERS == 1 ) */
1437 /*-----------------------------------------------------------*/
1438 
1439     #if ( configUSE_TIMERS == 1 )
1440 
1441         BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1442 
MPU_xTimerGenericCommandFromTaskEntry(const xTimerGenericCommandFromTaskParams_t * pxParams)1443         BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1444         {
1445             __asm volatile
1446             (
1447                 " .syntax unified                                       \n"
1448                 " .extern MPU_xTimerGenericCommandFromTaskImpl          \n"
1449                 "                                                       \n"
1450                 " push {r0}                                             \n"
1451                 " mrs r0, control                                       \n"
1452                 " tst r0, #1                                            \n"
1453                 " pop {r0}                                              \n"
1454                 " bne MPU_xTimerGenericCommandFromTask_Unpriv           \n"
1455                 " MPU_xTimerGenericCommandFromTask_Priv:                \n"
1456                 "     b MPU_xTimerGenericCommandFromTaskImpl            \n"
1457                 " MPU_xTimerGenericCommandFromTask_Unpriv:              \n"
1458                 "     svc %0                                            \n"
1459                 "                                                       \n"
1460                 : : "i" ( SYSTEM_CALL_xTimerGenericCommandFromTask ) : "memory"
1461             );
1462         }
1463 
1464     #endif /* if ( configUSE_TIMERS == 1 ) */
1465 /*-----------------------------------------------------------*/
1466 
1467     #if ( configUSE_TIMERS == 1 )
1468 
1469         const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1470 
MPU_pcTimerGetName(TimerHandle_t xTimer)1471         const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1472         {
1473             __asm volatile
1474             (
1475                 " .syntax unified                                       \n"
1476                 " .extern MPU_pcTimerGetNameImpl                        \n"
1477                 "                                                       \n"
1478                 " push {r0}                                             \n"
1479                 " mrs r0, control                                       \n"
1480                 " tst r0, #1                                            \n"
1481                 " pop {r0}                                              \n"
1482                 " bne MPU_pcTimerGetName_Unpriv                         \n"
1483                 " MPU_pcTimerGetName_Priv:                              \n"
1484                 "     b MPU_pcTimerGetNameImpl                          \n"
1485                 " MPU_pcTimerGetName_Unpriv:                            \n"
1486                 "     svc %0                                            \n"
1487                 "                                                       \n"
1488                 : : "i" ( SYSTEM_CALL_pcTimerGetName ) : "memory"
1489             );
1490         }
1491 
1492     #endif /* if ( configUSE_TIMERS == 1 ) */
1493 /*-----------------------------------------------------------*/
1494 
1495     #if ( configUSE_TIMERS == 1 )
1496 
1497         void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
1498                                       const BaseType_t uxAutoReload ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1499 
MPU_vTimerSetReloadMode(TimerHandle_t xTimer,const BaseType_t uxAutoReload)1500         void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
1501                                       const BaseType_t uxAutoReload ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1502         {
1503             __asm volatile
1504             (
1505                 " .syntax unified                                       \n"
1506                 " .extern MPU_vTimerSetReloadModeImpl                   \n"
1507                 "                                                       \n"
1508                 " push {r0}                                             \n"
1509                 " mrs r0, control                                       \n"
1510                 " tst r0, #1                                            \n"
1511                 " pop {r0}                                              \n"
1512                 " bne MPU_vTimerSetReloadMode_Unpriv                    \n"
1513                 " MPU_vTimerSetReloadMode_Priv:                         \n"
1514                 "     b MPU_vTimerSetReloadModeImpl                     \n"
1515                 " MPU_vTimerSetReloadMode_Unpriv:                       \n"
1516                 "     svc %0                                            \n"
1517                 "                                                       \n"
1518                 : : "i" ( SYSTEM_CALL_vTimerSetReloadMode ) : "memory"
1519             );
1520         }
1521 
1522     #endif /* if ( configUSE_TIMERS == 1 ) */
1523 /*-----------------------------------------------------------*/
1524 
1525     #if ( configUSE_TIMERS == 1 )
1526 
1527         BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1528 
MPU_xTimerGetReloadMode(TimerHandle_t xTimer)1529         BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1530         {
1531             __asm volatile
1532             (
1533                 " .syntax unified                                       \n"
1534                 " .extern MPU_xTimerGetReloadModeImpl                   \n"
1535                 "                                                       \n"
1536                 " push {r0}                                             \n"
1537                 " mrs r0, control                                       \n"
1538                 " tst r0, #1                                            \n"
1539                 " pop {r0}                                              \n"
1540                 " bne MPU_xTimerGetReloadMode_Unpriv                    \n"
1541                 " MPU_xTimerGetReloadMode_Priv:                         \n"
1542                 "     b MPU_xTimerGetReloadModeImpl                     \n"
1543                 " MPU_xTimerGetReloadMode_Unpriv:                       \n"
1544                 "     svc %0                                            \n"
1545                 "                                                       \n"
1546                 : : "i" ( SYSTEM_CALL_xTimerGetReloadMode ) : "memory"
1547             );
1548         }
1549 
1550     #endif /* if ( configUSE_TIMERS == 1 ) */
1551 /*-----------------------------------------------------------*/
1552 
1553     #if ( configUSE_TIMERS == 1 )
1554 
1555         UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1556 
MPU_uxTimerGetReloadMode(TimerHandle_t xTimer)1557         UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1558         {
1559             __asm volatile
1560             (
1561                 " .syntax unified                                       \n"
1562                 " .extern MPU_uxTimerGetReloadModeImpl                  \n"
1563                 "                                                       \n"
1564                 " push {r0}                                             \n"
1565                 " mrs r0, control                                       \n"
1566                 " tst r0, #1                                            \n"
1567                 " pop {r0}                                              \n"
1568                 " bne MPU_uxTimerGetReloadMode_Unpriv                   \n"
1569                 " MPU_uxTimerGetReloadMode_Priv:                        \n"
1570                 "     b MPU_uxTimerGetReloadModeImpl                    \n"
1571                 " MPU_uxTimerGetReloadMode_Unpriv:                      \n"
1572                 "     svc %0                                            \n"
1573                 "                                                       \n"
1574                 : : "i" ( SYSTEM_CALL_uxTimerGetReloadMode ) : "memory"
1575             );
1576         }
1577 
1578     #endif /* if ( configUSE_TIMERS == 1 ) */
1579 /*-----------------------------------------------------------*/
1580 
1581     #if ( configUSE_TIMERS == 1 )
1582 
1583         TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1584 
MPU_xTimerGetPeriod(TimerHandle_t xTimer)1585         TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1586         {
1587             __asm volatile
1588             (
1589                 " .syntax unified                                       \n"
1590                 " .extern MPU_xTimerGetPeriodImpl                       \n"
1591                 "                                                       \n"
1592                 " push {r0}                                             \n"
1593                 " mrs r0, control                                       \n"
1594                 " tst r0, #1                                            \n"
1595                 " pop {r0}                                              \n"
1596                 " bne MPU_xTimerGetPeriod_Unpriv                        \n"
1597                 " MPU_xTimerGetPeriod_Priv:                             \n"
1598                 "     b MPU_xTimerGetPeriodImpl                         \n"
1599                 " MPU_xTimerGetPeriod_Unpriv:                           \n"
1600                 "     svc %0                                            \n"
1601                 "                                                       \n"
1602                 : : "i" ( SYSTEM_CALL_xTimerGetPeriod ) : "memory"
1603             );
1604         }
1605 
1606     #endif /* if ( configUSE_TIMERS == 1 ) */
1607 /*-----------------------------------------------------------*/
1608 
1609     #if ( configUSE_TIMERS == 1 )
1610 
1611         TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1612 
MPU_xTimerGetExpiryTime(TimerHandle_t xTimer)1613         TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1614         {
1615             __asm volatile
1616             (
1617                 " .syntax unified                                       \n"
1618                 " .extern MPU_xTimerGetExpiryTimeImpl                   \n"
1619                 "                                                       \n"
1620                 " push {r0}                                             \n"
1621                 " mrs r0, control                                       \n"
1622                 " tst r0, #1                                            \n"
1623                 " pop {r0}                                              \n"
1624                 " bne MPU_xTimerGetExpiryTime_Unpriv                    \n"
1625                 " MPU_xTimerGetExpiryTime_Priv:                         \n"
1626                 "     b MPU_xTimerGetExpiryTimeImpl                     \n"
1627                 " MPU_xTimerGetExpiryTime_Unpriv:                       \n"
1628                 "     svc %0                                            \n"
1629                 "                                                       \n"
1630                 : : "i" ( SYSTEM_CALL_xTimerGetExpiryTime ) : "memory"
1631             );
1632         }
1633 
1634     #endif /* if ( configUSE_TIMERS == 1 ) */
1635 /*-----------------------------------------------------------*/
1636 
1637     #if ( configUSE_EVENT_GROUPS == 1 )
1638 
1639         EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1640 
MPU_xEventGroupWaitBitsEntry(const xEventGroupWaitBitsParams_t * pxParams)1641         EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1642         {
1643             __asm volatile
1644             (
1645                 " .syntax unified                                       \n"
1646                 " .extern MPU_xEventGroupWaitBitsImpl                   \n"
1647                 "                                                       \n"
1648                 " push {r0}                                             \n"
1649                 " mrs r0, control                                       \n"
1650                 " tst r0, #1                                            \n"
1651                 " pop {r0}                                              \n"
1652                 " bne MPU_xEventGroupWaitBits_Unpriv                    \n"
1653                 " MPU_xEventGroupWaitBits_Priv:                         \n"
1654                 "     b MPU_xEventGroupWaitBitsImpl                     \n"
1655                 " MPU_xEventGroupWaitBits_Unpriv:                       \n"
1656                 "     svc %0                                            \n"
1657                 "                                                       \n"
1658                 : : "i" ( SYSTEM_CALL_xEventGroupWaitBits ) : "memory"
1659             );
1660         }
1661 
1662     #endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
1663 /*-----------------------------------------------------------*/
1664 
1665     #if ( configUSE_EVENT_GROUPS == 1 )
1666 
1667         EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
1668                                               const EventBits_t uxBitsToClear ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1669 
MPU_xEventGroupClearBits(EventGroupHandle_t xEventGroup,const EventBits_t uxBitsToClear)1670         EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
1671                                               const EventBits_t uxBitsToClear ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1672         {
1673             __asm volatile
1674             (
1675                 " .syntax unified                                       \n"
1676                 " .extern MPU_xEventGroupClearBitsImpl                  \n"
1677                 "                                                       \n"
1678                 " push {r0}                                             \n"
1679                 " mrs r0, control                                       \n"
1680                 " tst r0, #1                                            \n"
1681                 " pop {r0}                                              \n"
1682                 " bne MPU_xEventGroupClearBits_Unpriv                   \n"
1683                 " MPU_xEventGroupClearBits_Priv:                        \n"
1684                 "     b MPU_xEventGroupClearBitsImpl                    \n"
1685                 " MPU_xEventGroupClearBits_Unpriv:                      \n"
1686                 "     svc %0                                            \n"
1687                 "                                                       \n"
1688                 : : "i" ( SYSTEM_CALL_xEventGroupClearBits ) : "memory"
1689             );
1690         }
1691 
1692     #endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
1693 /*-----------------------------------------------------------*/
1694 
1695     #if ( configUSE_EVENT_GROUPS == 1 )
1696 
1697         EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
1698                                             const EventBits_t uxBitsToSet ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1699 
MPU_xEventGroupSetBits(EventGroupHandle_t xEventGroup,const EventBits_t uxBitsToSet)1700         EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
1701                                             const EventBits_t uxBitsToSet ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1702         {
1703             __asm volatile
1704             (
1705                 " .syntax unified                                       \n"
1706                 " .extern MPU_xEventGroupSetBitsImpl                    \n"
1707                 "                                                       \n"
1708                 " push {r0}                                             \n"
1709                 " mrs r0, control                                       \n"
1710                 " tst r0, #1                                            \n"
1711                 " pop {r0}                                              \n"
1712                 " bne MPU_xEventGroupSetBits_Unpriv                     \n"
1713                 " MPU_xEventGroupSetBits_Priv:                          \n"
1714                 "     b MPU_xEventGroupSetBitsImpl                      \n"
1715                 " MPU_xEventGroupSetBits_Unpriv:                        \n"
1716                 "     svc %0                                            \n"
1717                 "                                                       \n"
1718                 : : "i" ( SYSTEM_CALL_xEventGroupSetBits ) : "memory"
1719             );
1720         }
1721 
1722     #endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
1723 /*-----------------------------------------------------------*/
1724 
1725     #if ( configUSE_EVENT_GROUPS == 1 )
1726 
1727         EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
1728                                          const EventBits_t uxBitsToSet,
1729                                          const EventBits_t uxBitsToWaitFor,
1730                                          TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1731 
MPU_xEventGroupSync(EventGroupHandle_t xEventGroup,const EventBits_t uxBitsToSet,const EventBits_t uxBitsToWaitFor,TickType_t xTicksToWait)1732         EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
1733                                          const EventBits_t uxBitsToSet,
1734                                          const EventBits_t uxBitsToWaitFor,
1735                                          TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1736         {
1737             __asm volatile
1738             (
1739                 " .syntax unified                                       \n"
1740                 " .extern MPU_xEventGroupSyncImpl                       \n"
1741                 "                                                       \n"
1742                 " push {r0}                                             \n"
1743                 " mrs r0, control                                       \n"
1744                 " tst r0, #1                                            \n"
1745                 " pop {r0}                                              \n"
1746                 " bne MPU_xEventGroupSync_Unpriv                        \n"
1747                 " MPU_xEventGroupSync_Priv:                             \n"
1748                 "     b MPU_xEventGroupSyncImpl                         \n"
1749                 " MPU_xEventGroupSync_Unpriv:                           \n"
1750                 "     svc %0                                            \n"
1751                 "                                                       \n"
1752                 : : "i" ( SYSTEM_CALL_xEventGroupSync ) : "memory"
1753             );
1754         }
1755 
1756     #endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
1757 /*-----------------------------------------------------------*/
1758 
1759     #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) )
1760 
1761         UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1762 
MPU_uxEventGroupGetNumber(void * xEventGroup)1763         UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1764         {
1765             __asm volatile
1766             (
1767                 " .syntax unified                                       \n"
1768                 " .extern MPU_uxEventGroupGetNumberImpl                 \n"
1769                 "                                                       \n"
1770                 " push {r0}                                             \n"
1771                 " mrs r0, control                                       \n"
1772                 " tst r0, #1                                            \n"
1773                 " pop {r0}                                              \n"
1774                 " bne MPU_uxEventGroupGetNumber_Unpriv                  \n"
1775                 " MPU_uxEventGroupGetNumber_Priv:                       \n"
1776                 "     b MPU_uxEventGroupGetNumberImpl                   \n"
1777                 " MPU_uxEventGroupGetNumber_Unpriv:                     \n"
1778                 "     svc %0                                            \n"
1779                 "                                                       \n"
1780                 : : "i" ( SYSTEM_CALL_uxEventGroupGetNumber ) : "memory"
1781             );
1782         }
1783 
1784     #endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) ) */
1785 /*-----------------------------------------------------------*/
1786 
1787     #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) )
1788 
1789         void MPU_vEventGroupSetNumber( void * xEventGroup,
1790                                        UBaseType_t uxEventGroupNumber ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1791 
MPU_vEventGroupSetNumber(void * xEventGroup,UBaseType_t uxEventGroupNumber)1792         void MPU_vEventGroupSetNumber( void * xEventGroup,
1793                                        UBaseType_t uxEventGroupNumber ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1794         {
1795             __asm volatile
1796             (
1797                 " .syntax unified                                       \n"
1798                 " .extern MPU_vEventGroupSetNumberImpl                  \n"
1799                 "                                                       \n"
1800                 " push {r0}                                             \n"
1801                 " mrs r0, control                                       \n"
1802                 " tst r0, #1                                            \n"
1803                 " pop {r0}                                              \n"
1804                 " bne MPU_vEventGroupSetNumber_Unpriv                   \n"
1805                 " MPU_vEventGroupSetNumber_Priv:                        \n"
1806                 "     b MPU_vEventGroupSetNumberImpl                    \n"
1807                 " MPU_vEventGroupSetNumber_Unpriv:                      \n"
1808                 "     svc %0                                            \n"
1809                 "                                                       \n"
1810                 : : "i" ( SYSTEM_CALL_vEventGroupSetNumber ) : "memory"
1811             );
1812         }
1813 
1814     #endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) ) */
1815 /*-----------------------------------------------------------*/
1816 
1817     #if ( configUSE_STREAM_BUFFERS == 1 )
1818 
1819         size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
1820                                       const void * pvTxData,
1821                                       size_t xDataLengthBytes,
1822                                       TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1823 
MPU_xStreamBufferSend(StreamBufferHandle_t xStreamBuffer,const void * pvTxData,size_t xDataLengthBytes,TickType_t xTicksToWait)1824         size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
1825                                       const void * pvTxData,
1826                                       size_t xDataLengthBytes,
1827                                       TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1828         {
1829             __asm volatile
1830             (
1831                 " .syntax unified                                       \n"
1832                 " .extern MPU_xStreamBufferSendImpl                     \n"
1833                 "                                                       \n"
1834                 " push {r0}                                             \n"
1835                 " mrs r0, control                                       \n"
1836                 " tst r0, #1                                            \n"
1837                 " pop {r0}                                              \n"
1838                 " bne MPU_xStreamBufferSend_Unpriv                      \n"
1839                 " MPU_xStreamBufferSend_Priv:                           \n"
1840                 "     b MPU_xStreamBufferSendImpl                       \n"
1841                 " MPU_xStreamBufferSend_Unpriv:                         \n"
1842                 "     svc %0                                            \n"
1843                 "                                                       \n"
1844                 : : "i" ( SYSTEM_CALL_xStreamBufferSend ) : "memory"
1845             );
1846         }
1847 
1848     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
1849 /*-----------------------------------------------------------*/
1850 
1851     #if ( configUSE_STREAM_BUFFERS == 1 )
1852 
1853         size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
1854                                          void * pvRxData,
1855                                          size_t xBufferLengthBytes,
1856                                          TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1857 
MPU_xStreamBufferReceive(StreamBufferHandle_t xStreamBuffer,void * pvRxData,size_t xBufferLengthBytes,TickType_t xTicksToWait)1858         size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
1859                                          void * pvRxData,
1860                                          size_t xBufferLengthBytes,
1861                                          TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1862         {
1863             __asm volatile
1864             (
1865                 " .syntax unified                                       \n"
1866                 " .extern MPU_xStreamBufferReceiveImpl                  \n"
1867                 "                                                       \n"
1868                 " push {r0}                                             \n"
1869                 " mrs r0, control                                       \n"
1870                 " tst r0, #1                                            \n"
1871                 " pop {r0}                                              \n"
1872                 " bne MPU_xStreamBufferReceive_Unpriv                   \n"
1873                 " MPU_xStreamBufferReceive_Priv:                        \n"
1874                 "     b MPU_xStreamBufferReceiveImpl                    \n"
1875                 " MPU_xStreamBufferReceive_Unpriv:                      \n"
1876                 "     svc %0                                            \n"
1877                 "                                                       \n"
1878                 : : "i" ( SYSTEM_CALL_xStreamBufferReceive ) : "memory"
1879             );
1880         }
1881 
1882     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
1883 /*-----------------------------------------------------------*/
1884 
1885     #if ( configUSE_STREAM_BUFFERS == 1 )
1886 
1887         BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1888 
MPU_xStreamBufferIsFull(StreamBufferHandle_t xStreamBuffer)1889         BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1890         {
1891             __asm volatile
1892             (
1893                 " .syntax unified                                       \n"
1894                 " .extern MPU_xStreamBufferIsFullImpl                   \n"
1895                 "                                                       \n"
1896                 " push {r0}                                             \n"
1897                 " mrs r0, control                                       \n"
1898                 " tst r0, #1                                            \n"
1899                 " pop {r0}                                              \n"
1900                 " bne MPU_xStreamBufferIsFull_Unpriv                    \n"
1901                 " MPU_xStreamBufferIsFull_Priv:                         \n"
1902                 "     b MPU_xStreamBufferIsFullImpl                     \n"
1903                 " MPU_xStreamBufferIsFull_Unpriv:                       \n"
1904                 "     svc %0                                            \n"
1905                 "                                                       \n"
1906                 : : "i" ( SYSTEM_CALL_xStreamBufferIsFull ) : "memory"
1907             );
1908         }
1909 
1910     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
1911 /*-----------------------------------------------------------*/
1912 
1913     #if ( configUSE_STREAM_BUFFERS == 1 )
1914 
1915         BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1916 
MPU_xStreamBufferIsEmpty(StreamBufferHandle_t xStreamBuffer)1917         BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1918         {
1919             __asm volatile
1920             (
1921                 " .syntax unified                                       \n"
1922                 " .extern MPU_xStreamBufferIsEmptyImpl                  \n"
1923                 "                                                       \n"
1924                 " push {r0}                                             \n"
1925                 " mrs r0, control                                       \n"
1926                 " tst r0, #1                                            \n"
1927                 " pop {r0}                                              \n"
1928                 " bne MPU_xStreamBufferIsEmpty_Unpriv                   \n"
1929                 " MPU_xStreamBufferIsEmpty_Priv:                        \n"
1930                 "     b MPU_xStreamBufferIsEmptyImpl                    \n"
1931                 " MPU_xStreamBufferIsEmpty_Unpriv:                      \n"
1932                 "     svc %0                                            \n"
1933                 "                                                       \n"
1934                 : : "i" ( SYSTEM_CALL_xStreamBufferIsEmpty ) : "memory"
1935             );
1936         }
1937 
1938     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
1939 /*-----------------------------------------------------------*/
1940 
1941     #if ( configUSE_STREAM_BUFFERS == 1 )
1942 
1943         size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1944 
MPU_xStreamBufferSpacesAvailable(StreamBufferHandle_t xStreamBuffer)1945         size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1946         {
1947             __asm volatile
1948             (
1949                 " .syntax unified                                       \n"
1950                 " .extern MPU_xStreamBufferSpacesAvailableImpl          \n"
1951                 "                                                       \n"
1952                 " push {r0}                                             \n"
1953                 " mrs r0, control                                       \n"
1954                 " tst r0, #1                                            \n"
1955                 " pop {r0}                                              \n"
1956                 " bne MPU_xStreamBufferSpacesAvailable_Unpriv           \n"
1957                 " MPU_xStreamBufferSpacesAvailable_Priv:                \n"
1958                 "     b MPU_xStreamBufferSpacesAvailableImpl            \n"
1959                 " MPU_xStreamBufferSpacesAvailable_Unpriv:              \n"
1960                 "     svc %0                                            \n"
1961                 "                                                       \n"
1962                 : : "i" ( SYSTEM_CALL_xStreamBufferSpacesAvailable ) : "memory"
1963             );
1964         }
1965 
1966     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
1967 /*-----------------------------------------------------------*/
1968 
1969     #if ( configUSE_STREAM_BUFFERS == 1 )
1970 
1971         size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
1972 
MPU_xStreamBufferBytesAvailable(StreamBufferHandle_t xStreamBuffer)1973         size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
1974         {
1975             __asm volatile
1976             (
1977                 " .syntax unified                                       \n"
1978                 " .extern MPU_xStreamBufferBytesAvailableImpl           \n"
1979                 "                                                       \n"
1980                 " push {r0}                                             \n"
1981                 " mrs r0, control                                       \n"
1982                 " tst r0, #1                                            \n"
1983                 " pop {r0}                                              \n"
1984                 " bne MPU_xStreamBufferBytesAvailable_Unpriv            \n"
1985                 " MPU_xStreamBufferBytesAvailable_Priv:                 \n"
1986                 "     b MPU_xStreamBufferBytesAvailableImpl             \n"
1987                 " MPU_xStreamBufferBytesAvailable_Unpriv:               \n"
1988                 "     svc %0                                            \n"
1989                 "                                                       \n"
1990                 : : "i" ( SYSTEM_CALL_xStreamBufferBytesAvailable ) : "memory"
1991             );
1992         }
1993 
1994     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
1995 /*-----------------------------------------------------------*/
1996 
1997     #if ( configUSE_STREAM_BUFFERS == 1 )
1998 
1999         BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
2000                                                      size_t xTriggerLevel ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
2001 
MPU_xStreamBufferSetTriggerLevel(StreamBufferHandle_t xStreamBuffer,size_t xTriggerLevel)2002         BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
2003                                                      size_t xTriggerLevel ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
2004         {
2005             __asm volatile
2006             (
2007                 " .syntax unified                                       \n"
2008                 " .extern MPU_xStreamBufferSetTriggerLevelImpl          \n"
2009                 "                                                       \n"
2010                 " push {r0}                                             \n"
2011                 " mrs r0, control                                       \n"
2012                 " tst r0, #1                                            \n"
2013                 " pop {r0}                                              \n"
2014                 " bne MPU_xStreamBufferSetTriggerLevel_Unpriv           \n"
2015                 " MPU_xStreamBufferSetTriggerLevel_Priv:                \n"
2016                 "     b MPU_xStreamBufferSetTriggerLevelImpl            \n"
2017                 " MPU_xStreamBufferSetTriggerLevel_Unpriv:              \n"
2018                 "     svc %0                                            \n"
2019                 "                                                       \n"
2020                 : : "i" ( SYSTEM_CALL_xStreamBufferSetTriggerLevel ) : "memory"
2021             );
2022         }
2023 
2024     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
2025 /*-----------------------------------------------------------*/
2026 
2027     #if ( configUSE_STREAM_BUFFERS == 1 )
2028 
2029         size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
2030 
MPU_xStreamBufferNextMessageLengthBytes(StreamBufferHandle_t xStreamBuffer)2031         size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
2032         {
2033             __asm volatile
2034             (
2035                 " .syntax unified                                       \n"
2036                 " .extern MPU_xStreamBufferNextMessageLengthBytesImpl   \n"
2037                 "                                                       \n"
2038                 " push {r0}                                             \n"
2039                 " mrs r0, control                                       \n"
2040                 " tst r0, #1                                            \n"
2041                 " pop {r0}                                              \n"
2042                 " bne MPU_xStreamBufferNextMessageLengthBytes_Unpriv    \n"
2043                 " MPU_xStreamBufferNextMessageLengthBytes_Priv:         \n"
2044                 "     b MPU_xStreamBufferNextMessageLengthBytesImpl     \n"
2045                 " MPU_xStreamBufferNextMessageLengthBytes_Unpriv:       \n"
2046                 "     svc %0                                            \n"
2047                 "                                                       \n"
2048                 : : "i" ( SYSTEM_CALL_xStreamBufferNextMessageLengthBytes ) : "memory"
2049             );
2050         }
2051 
2052     #endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
2053 /*-----------------------------------------------------------*/
2054 
2055 #endif /* ( configENABLE_MPU == 1 ) && ( configUSE_MPU_WRAPPERS_V1 == 0 ) */
2056