cantata
mpu_prototypes.h
1 /*
2  * FreeRTOS Kernel V10.0.1
3  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  *
22  * http://www.FreeRTOS.org
23  * http://aws.amazon.com/freertos
24  *
25  * 1 tab == 4 spaces!
26  */
27 
28 /*
29  * When the MPU is used the standard (non MPU) API functions are mapped to
30  * equivalents that start "MPU_", the prototypes for which are defined in this
31  * header files. This will cause the application code to call the MPU_ version
32  * which wraps the non-MPU version with privilege promoting then demoting code,
33  * so the kernel code always runs will full privileges.
34  */
35 
36 
37 #ifndef MPU_PROTOTYPES_H
38 #define MPU_PROTOTYPES_H
39 
40 /* MPU versions of tasks.h API functions. */
41 BaseType_t MPU_xTaskCreate( TaskFunction_t pxTaskCode, const char * const pcName, const uint16_t usStackDepth, void * const pvParameters, UBaseType_t uxPriority, TaskHandle_t * const pxCreatedTask );
42 TaskHandle_t MPU_xTaskCreateStatic( TaskFunction_t pxTaskCode, const char * const pcName, const uint32_t ulStackDepth, void * const pvParameters, UBaseType_t uxPriority, StackType_t * const puxStackBuffer, StaticTask_t * const pxTaskBuffer );
43 BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask );
44 BaseType_t MPU_xTaskCreateRestrictedStatic( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask );
45 void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );
46 void MPU_vTaskDelete( TaskHandle_t xTaskToDelete );
47 void MPU_vTaskDelay( const TickType_t xTicksToDelay );
48 void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement );
49 BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask );
50 UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t xTask );
51 eTaskState MPU_eTaskGetState( TaskHandle_t xTask );
52 void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );
53 void MPU_vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );
54 void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend );
55 void MPU_vTaskResume( TaskHandle_t xTaskToResume );
56 void MPU_vTaskStartScheduler( void );
57 void MPU_vTaskSuspendAll( void );
58 BaseType_t MPU_xTaskResumeAll( void );
59 TickType_t MPU_xTaskGetTickCount( void );
60 UBaseType_t MPU_uxTaskGetNumberOfTasks( void );
61 char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery );
62 TaskHandle_t MPU_xTaskGetHandle( const char *pcNameToQuery );
63 UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
64 void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );
65 TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );
66 void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue );
67 void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex );
68 BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
69 TaskHandle_t MPU_xTaskGetIdleTaskHandle( void );
70 UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime );
71 void MPU_vTaskList( char * pcWriteBuffer );
72 void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer );
73 BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue );
74 BaseType_t MPU_xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
75 uint32_t MPU_ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
76 BaseType_t MPU_xTaskNotifyStateClear( TaskHandle_t xTask );
77 BaseType_t MPU_xTaskIncrementTick( void );
78 TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void );
79 void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut );
80 BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait );
81 void MPU_vTaskMissedYield( void );
82 BaseType_t MPU_xTaskGetSchedulerState( void );
83 
84 /* MPU versions of queue.h API functions. */
85 BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition );
86 BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait );
87 BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait );
88 BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue, TickType_t xTicksToWait );
89 UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue );
90 UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue );
91 void MPU_vQueueDelete( QueueHandle_t xQueue );
92 QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType );
93 QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue );
94 QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount );
95 QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue );
96 void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore );
97 BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait );
98 BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex );
99 void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName );
100 void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue );
101 const char * MPU_pcQueueGetName( QueueHandle_t xQueue );
102 QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType );
103 QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType );
104 QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength );
105 BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
106 BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
107 QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait );
108 BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue );
109 void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber );
110 UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue );
111 uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue );
112 
113 /* MPU versions of timers.h API functions. */
114 TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction );
115 TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction, StaticTimer_t *pxTimerBuffer );
116 void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer );
117 void MPU_vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );
118 BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer );
119 TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void );
120 BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );
121 const char * MPU_pcTimerGetName( TimerHandle_t xTimer );
122 TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer );
123 TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer );
124 BaseType_t MPU_xTimerCreateTimerTask( void );
125 BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait );
126 
127 /* MPU versions of event_group.h API functions. */
128 EventGroupHandle_t MPU_xEventGroupCreate( void );
129 EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer );
130 EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait );
131 EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
132 EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
133 EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait );
134 void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup );
135 UBaseType_t MPU_uxEventGroupGetNumber( void* xEventGroup );
136 
137 /* MPU versions of message/stream_buffer.h API functions. */
138 size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait );
139 size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken );
140 size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait );
141 size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken );
142 void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer );
143 BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer );
144 BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer );
145 BaseType_t MPU_xStreamBufferReset( StreamBufferHandle_t xStreamBuffer );
146 size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer );
147 size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer );
148 BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer, size_t xTriggerLevel );
149 StreamBufferHandle_t MPU_xStreamBufferGenericCreate( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer );
150 StreamBufferHandle_t MPU_xStreamBufferGenericCreateStatic( size_t xBufferSizeBytes, size_t xTriggerLevelBytes, BaseType_t xIsMessageBuffer, uint8_t * const pucStreamBufferStorageArea, StaticStreamBuffer_t * const pxStaticStreamBuffer );
151 
152 
153 
154 #endif /* MPU_PROTOTYPES_H */
155 
Definition: task.h:128
Definition: task.h:93
Definition: FreeRTOS.h:984
Definition: task.h:102
Definition: task.h:112
Definition: FreeRTOS.h:1150
Definition: FreeRTOS.h:1090
Definition: FreeRTOS.h:1046
Definition: FreeRTOS.h:1119