]> git.sur5r.net Git - freertos/blob - FreeRTOS/Source/include/mpu_prototypes.h
Improve coverage of the MPU API in the new MPU demo, fixing typos in the MPU port...
[freertos] / FreeRTOS / Source / include / mpu_prototypes.h
1 /*\r
2     FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.\r
3     All rights reserved\r
4 \r
5     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
6 \r
7     This file is part of the FreeRTOS distribution.\r
8 \r
9     FreeRTOS is free software; you can redistribute it and/or modify it under\r
10     the terms of the GNU General Public License (version 2) as published by the\r
11     Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.\r
12 \r
13     ***************************************************************************\r
14     >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
15     >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
16     >>!   obliged to provide the source code for proprietary components     !<<\r
17     >>!   outside of the FreeRTOS kernel.                                   !<<\r
18     ***************************************************************************\r
19 \r
20     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
21     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
22     FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
23     link: http://www.freertos.org/a00114.html\r
24 \r
25     ***************************************************************************\r
26      *                                                                       *\r
27      *    FreeRTOS provides completely free yet professionally developed,    *\r
28      *    robust, strictly quality controlled, supported, and cross          *\r
29      *    platform software that is more than just the market leader, it     *\r
30      *    is the industry's de facto standard.                               *\r
31      *                                                                       *\r
32      *    Help yourself get started quickly while simultaneously helping     *\r
33      *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
34      *    tutorial book, reference manual, or both:                          *\r
35      *    http://www.FreeRTOS.org/Documentation                              *\r
36      *                                                                       *\r
37     ***************************************************************************\r
38 \r
39     http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
40     the FAQ page "My application does not run, what could be wrong?".  Have you\r
41     defined configASSERT()?\r
42 \r
43     http://www.FreeRTOS.org/support - In return for receiving this top quality\r
44     embedded software for free we request you assist our global community by\r
45     participating in the support forum.\r
46 \r
47     http://www.FreeRTOS.org/training - Investing in training allows your team to\r
48     be as productive as possible as early as possible.  Now you can receive\r
49     FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
50     Ltd, and the world's leading authority on the world's leading RTOS.\r
51 \r
52     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
53     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
54     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
55 \r
56     http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
57     Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
58 \r
59     http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
60     Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
61     licenses offer ticketed support, indemnification and commercial middleware.\r
62 \r
63     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
64     engineered and independently SIL3 certified version for use in safety and\r
65     mission critical applications that require provable dependability.\r
66 \r
67     1 tab == 4 spaces!\r
68 */\r
69 \r
70 /*\r
71  * When the MPU is used the standard (non MPU) API functions are mapped to\r
72  * equivalents that start "MPU_", the prototypes for which are defined in this\r
73  * header files.  This will cause the application code to call the MPU_ version\r
74  * which wraps the non-MPU version with privilege promoting then demoting code,\r
75  * so the kernel code always runs will full privileges.\r
76  */\r
77 \r
78 \r
79 #ifndef MPU_PROTOTYPES_H\r
80 #define MPU_PROTOTYPES_H\r
81 \r
82 /* MPU versions of tasks.h API function. */\r
83 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
84 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
85 BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask );\r
86 void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );\r
87 void MPU_vTaskDelete( TaskHandle_t xTaskToDelete );\r
88 void MPU_vTaskDelay( const TickType_t xTicksToDelay );\r
89 void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement );\r
90 BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask );\r
91 UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t xTask );\r
92 eTaskState MPU_eTaskGetState( TaskHandle_t xTask );\r
93 void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );\r
94 void MPU_vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );\r
95 void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend );\r
96 void MPU_vTaskResume( TaskHandle_t xTaskToResume );\r
97 void MPU_vTaskStartScheduler( void );\r
98 void MPU_vTaskSuspendAll( void );\r
99 BaseType_t MPU_xTaskResumeAll( void );\r
100 TickType_t MPU_xTaskGetTickCount( void );\r
101 UBaseType_t MPU_uxTaskGetNumberOfTasks( void );\r
102 char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery );\r
103 TaskHandle_t MPU_xTaskGetHandle( const char *pcNameToQuery );\r
104 UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask );\r
105 void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );\r
106 TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );\r
107 void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue );\r
108 void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex );\r
109 BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );\r
110 TaskHandle_t MPU_xTaskGetIdleTaskHandle( void );\r
111 UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime );\r
112 void MPU_vTaskList( char * pcWriteBuffer );\r
113 void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer );\r
114 BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue );\r
115 BaseType_t MPU_xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );\r
116 uint32_t MPU_ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );\r
117 BaseType_t MPU_xTaskNotifyStateClear( TaskHandle_t xTask );\r
118 BaseType_t MPU_xTaskIncrementTick( void );\r
119 TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void );\r
120 void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut );\r
121 BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait );\r
122 void MPU_vTaskMissedYield( void );\r
123 BaseType_t MPU_xTaskGetSchedulerState( void );\r
124 \r
125 /* MPU versions of queue.h API function. */\r
126 BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition );\r
127 BaseType_t MPU_xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeek );\r
128 UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue );\r
129 UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue );\r
130 void MPU_vQueueDelete( QueueHandle_t xQueue );\r
131 QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType );\r
132 QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue );\r
133 QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount );\r
134 QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue );\r
135 void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore );\r
136 BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait );\r
137 BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex );\r
138 void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName );\r
139 void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue );\r
140 const char * MPU_pcQueueGetName( QueueHandle_t xQueue );\r
141 QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType );\r
142 QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType );\r
143 QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength );\r
144 BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );\r
145 BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );\r
146 QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait );\r
147 BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue );\r
148 void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber );\r
149 UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue );\r
150 uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue );\r
151 \r
152 /* MPU versions of timers.h API function. */\r
153 TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction );\r
154 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
155 void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer );\r
156 void MPU_vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );\r
157 BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer );\r
158 TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void );\r
159 BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );\r
160 const char * MPU_pcTimerGetName( TimerHandle_t xTimer );\r
161 TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer );\r
162 TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer );\r
163 BaseType_t MPU_xTimerCreateTimerTask( void );\r
164 BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait );\r
165 \r
166 /* MPU versions of event_group.h API function. */\r
167 EventGroupHandle_t MPU_xEventGroupCreate( void );\r
168 EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer );\r
169 EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait );\r
170 EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );\r
171 EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );\r
172 EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait );\r
173 void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup );\r
174 UBaseType_t MPU_uxEventGroupGetNumber( void* xEventGroup );\r
175 \r
176 #endif /* MPU_PROTOTYPES_H */\r
177 \r