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