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