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