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