mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Update the MPU port so it supports all the public functions found in V9.0.0rc2.
This commit is contained in:
parent
da6c95edae
commit
ac67c39be9
14 changed files with 1044 additions and 369 deletions
176
FreeRTOS/Source/include/mpu_prototypes.h
Normal file
176
FreeRTOS/Source/include/mpu_prototypes.h
Normal file
|
@ -0,0 +1,176 @@
|
|||
/*
|
||||
FreeRTOS V9.0.0rc2 - Copyright (C) 2016 Real Time Engineers Ltd.
|
||||
All rights reserved
|
||||
|
||||
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
|
||||
|
||||
***************************************************************************
|
||||
>>! NOTE: The modification to the GPL is included to allow you to !<<
|
||||
>>! distribute a combined work that includes FreeRTOS without being !<<
|
||||
>>! obliged to provide the source code for proprietary components !<<
|
||||
>>! outside of the FreeRTOS kernel. !<<
|
||||
***************************************************************************
|
||||
|
||||
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
FOR A PARTICULAR PURPOSE. Full license text is available on the following
|
||||
link: http://www.freertos.org/a00114.html
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS provides completely free yet professionally developed, *
|
||||
* robust, strictly quality controlled, supported, and cross *
|
||||
* platform software that is more than just the market leader, it *
|
||||
* is the industry's de facto standard. *
|
||||
* *
|
||||
* Help yourself get started quickly while simultaneously helping *
|
||||
* to support the FreeRTOS project by purchasing a FreeRTOS *
|
||||
* tutorial book, reference manual, or both: *
|
||||
* http://www.FreeRTOS.org/Documentation *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading
|
||||
the FAQ page "My application does not run, what could be wrong?". Have you
|
||||
defined configASSERT()?
|
||||
|
||||
http://www.FreeRTOS.org/support - In return for receiving this top quality
|
||||
embedded software for free we request you assist our global community by
|
||||
participating in the support forum.
|
||||
|
||||
http://www.FreeRTOS.org/training - Investing in training allows your team to
|
||||
be as productive as possible as early as possible. Now you can receive
|
||||
FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
|
||||
Ltd, and the world's leading authority on the world's leading RTOS.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool, a DOS
|
||||
compatible FAT file system, and our tiny thread aware UDP/IP stack.
|
||||
|
||||
http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
|
||||
Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
|
||||
|
||||
http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
|
||||
Integrity Systems ltd. to sell under the OpenRTOS brand. Low cost OpenRTOS
|
||||
licenses offer ticketed support, indemnification and commercial middleware.
|
||||
|
||||
http://www.SafeRTOS.com - High Integrity Systems also provide a safety
|
||||
engineered and independently SIL3 certified version for use in safety and
|
||||
mission critical applications that require provable dependability.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
*/
|
||||
|
||||
/*
|
||||
* When the MPU is used the standard (non MPU) API functions are mapped to
|
||||
* equivalents that start "MPU_", the prototypes for which are defined in this
|
||||
* header files. This will cause the application code to call the MPU_ version
|
||||
* which wraps the non-MPU version with privilege promoting then demoting code,
|
||||
* so the kernel code always runs will full privileges.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef MPU_PROTOTYPES_H
|
||||
#define MPU_PROTOTYPES_H
|
||||
|
||||
/* MPU versions of tasks.h API function. */
|
||||
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 );
|
||||
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 );
|
||||
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask );
|
||||
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const pxRegions );
|
||||
void MPU_vTaskDelete( TaskHandle_t xTaskToDelete );
|
||||
void MPU_vTaskDelay( const TickType_t xTicksToDelay );
|
||||
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement );
|
||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask );
|
||||
UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t xTask );
|
||||
eTaskState MPU_eTaskGetState( TaskHandle_t xTask );
|
||||
void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState );
|
||||
void MPU_vTaskPrioritySet( TaskHandle_t xTask, UBaseType_t uxNewPriority );
|
||||
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend );
|
||||
void MPU_vTaskResume( TaskHandle_t xTaskToResume );
|
||||
void MPU_vTaskStartScheduler( void );
|
||||
void MPU_vTaskSuspendAll( void );
|
||||
BaseType_t MPU_xTaskResumeAll( void );
|
||||
TickType_t MPU_xTaskGetTickCount( void );
|
||||
UBaseType_t MPU_uxTaskGetNumberOfTasks( void );
|
||||
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery );
|
||||
TaskHandle_t MPU_xTaskGetHandle( const char *pcNameToQuery );
|
||||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
|
||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );
|
||||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );
|
||||
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue );
|
||||
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex );
|
||||
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
|
||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void );
|
||||
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray, const UBaseType_t uxArraySize, uint32_t * const pulTotalRunTime );
|
||||
void MPU_vTaskList( char * pcWriteBuffer );
|
||||
void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer );
|
||||
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue );
|
||||
BaseType_t MPU_xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait );
|
||||
uint32_t MPU_ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait );
|
||||
BaseType_t MPU_xTaskIncrementTick( void );
|
||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void );
|
||||
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut );
|
||||
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait );
|
||||
void MPU_vTaskMissedYield( void );
|
||||
BaseType_t MPU_xTaskGetSchedulerState( void );
|
||||
|
||||
/* MPU versions of queue.h API function. */
|
||||
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, const BaseType_t xCopyPosition );
|
||||
BaseType_t MPU_xQueueGenericReceive( QueueHandle_t xQueue, void * const pvBuffer, TickType_t xTicksToWait, const BaseType_t xJustPeek );
|
||||
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue );
|
||||
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue );
|
||||
void MPU_vQueueDelete( QueueHandle_t xQueue );
|
||||
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType );
|
||||
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue );
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphore( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount );
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue );
|
||||
void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore );
|
||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xTicksToWait );
|
||||
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex );
|
||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName );
|
||||
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue );
|
||||
const char * MPU_pcQueueGetName( QueueHandle_t xQueue );
|
||||
QueueHandle_t MPU_xQueueGenericCreate( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, const uint8_t ucQueueType );
|
||||
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType );
|
||||
QueueSetHandle_t MPU_xQueueCreateSet( const UBaseType_t uxEventQueueLength );
|
||||
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
|
||||
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
|
||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, const TickType_t xTicksToWait );
|
||||
BaseType_t MPU_xQueueGenericReset( QueueHandle_t xQueue, BaseType_t xNewQueue );
|
||||
void MPU_vQueueSetQueueNumber( QueueHandle_t xQueue, UBaseType_t uxQueueNumber );
|
||||
UBaseType_t MPU_uxQueueGetQueueNumber( QueueHandle_t xQueue );
|
||||
uint8_t MPU_ucQueueGetQueueType( QueueHandle_t xQueue );
|
||||
|
||||
/* MPU versions of timers.h API function. */
|
||||
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction );
|
||||
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 );
|
||||
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer );
|
||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID );
|
||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer );
|
||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void );
|
||||
BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );
|
||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer );
|
||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer );
|
||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer );
|
||||
BaseType_t MPU_xTimerCreateTimerTask( void );
|
||||
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait );
|
||||
|
||||
/* MPU versions of event_group.h API function. */
|
||||
EventGroupHandle_t MPU_xEventGroupCreate( void );
|
||||
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer );
|
||||
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait );
|
||||
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear );
|
||||
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet );
|
||||
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait );
|
||||
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup );
|
||||
UBaseType_t MPU_uxEventGroupGetNumber( void* xEventGroup );
|
||||
|
||||
#endif /* MPU_PROTOTYPES_H */
|
||||
|
|
@ -79,80 +79,102 @@ only for ports that are using the MPU. */
|
|||
those files. */
|
||||
#ifndef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
|
||||
#define xTaskCreate MPU_xTaskCreate
|
||||
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
|
||||
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
|
||||
#define vTaskDelete MPU_vTaskDelete
|
||||
#define vTaskDelayUntil MPU_vTaskDelayUntil
|
||||
#define vTaskDelay MPU_vTaskDelay
|
||||
#define uxTaskPriorityGet MPU_uxTaskPriorityGet
|
||||
#define vTaskPrioritySet MPU_vTaskPrioritySet
|
||||
#define eTaskGetState MPU_eTaskGetState
|
||||
#define vTaskSuspend MPU_vTaskSuspend
|
||||
#define vTaskResume MPU_vTaskResume
|
||||
#define vTaskSuspendAll MPU_vTaskSuspendAll
|
||||
#define xTaskResumeAll MPU_xTaskResumeAll
|
||||
#define xTaskGetTickCount MPU_xTaskGetTickCount
|
||||
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
|
||||
#define vTaskList MPU_vTaskList
|
||||
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
|
||||
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
|
||||
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
|
||||
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
|
||||
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
|
||||
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
|
||||
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
|
||||
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
|
||||
#define uxTaskGetSystemState MPU_uxTaskGetSystemState
|
||||
#define xTaskGenericNotify MPU_xTaskGenericNotify
|
||||
#define xTaskNotifyWait MPU_xTaskNotifyWait
|
||||
#define ulTaskNotifyTake MPU_ulTaskNotifyTake
|
||||
/*
|
||||
* Map standard (non MPU) API functions to equivalents that start
|
||||
* "MPU_". This will cause the application code to call the MPU_
|
||||
* version, which wraps the non-MPU version with privilege promoting
|
||||
* then demoting code, so the kernel code always runs will full
|
||||
* privileges.
|
||||
*/
|
||||
|
||||
#define xQueueGenericCreate MPU_xQueueGenericCreate
|
||||
#define xQueueCreateMutex MPU_xQueueCreateMutex
|
||||
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
|
||||
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
|
||||
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
|
||||
#define xQueueGenericSend MPU_xQueueGenericSend
|
||||
#define xQueueGenericReceive MPU_xQueueGenericReceive
|
||||
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
|
||||
#define vQueueDelete MPU_vQueueDelete
|
||||
#define xQueueGenericReset MPU_xQueueGenericReset
|
||||
#define xQueueCreateSet MPU_xQueueCreateSet
|
||||
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
|
||||
#define xQueueAddToSet MPU_xQueueAddToSet
|
||||
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
|
||||
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
|
||||
/* Map standard tasks.h API functions to the MPU equivalents. */
|
||||
#define xTaskCreate MPU_xTaskCreate
|
||||
#define xTaskCreateStatic MPU_xTaskCreateStatic
|
||||
#define xTaskCreateRestricted MPU_xTaskCreateRestricted
|
||||
#define vTaskAllocateMPURegions MPU_vTaskAllocateMPURegions
|
||||
#define vTaskDelete MPU_vTaskDelete
|
||||
#define vTaskDelay MPU_vTaskDelay
|
||||
#define vTaskDelayUntil MPU_vTaskDelayUntil
|
||||
#define xTaskAbortDelay MPU_xTaskAbortDelay
|
||||
#define uxTaskPriorityGet MPU_uxTaskPriorityGet
|
||||
#define eTaskGetState MPU_eTaskGetState
|
||||
#define vTaskGetInfo MPU_vTaskGetInfo
|
||||
#define vTaskPrioritySet MPU_vTaskPrioritySet
|
||||
#define vTaskSuspend MPU_vTaskSuspend
|
||||
#define vTaskResume MPU_vTaskResume
|
||||
#define vTaskSuspendAll MPU_vTaskSuspendAll
|
||||
#define xTaskResumeAll MPU_xTaskResumeAll
|
||||
#define xTaskGetTickCount MPU_xTaskGetTickCount
|
||||
#define uxTaskGetNumberOfTasks MPU_uxTaskGetNumberOfTasks
|
||||
#define pcTaskGetName MPU_pcTaskGetName
|
||||
#define xTaskGetHandle MPU_xTaskGetHandle
|
||||
#define uxTaskGetStackHighWaterMark MPU_uxTaskGetStackHighWaterMark
|
||||
#define vTaskSetApplicationTaskTag MPU_vTaskSetApplicationTaskTag
|
||||
#define xTaskGetApplicationTaskTag MPU_xTaskGetApplicationTaskTag
|
||||
#define vTaskSetThreadLocalStoragePointer MPU_vTaskSetThreadLocalStoragePointer
|
||||
#define pvTaskGetThreadLocalStoragePointer MPU_pvTaskGetThreadLocalStoragePointer
|
||||
#define xTaskCallApplicationTaskHook MPU_xTaskCallApplicationTaskHook
|
||||
#define xTaskGetIdleTaskHandle MPU_xTaskGetIdleTaskHandle
|
||||
#define uxTaskGetSystemState MPU_uxTaskGetSystemState
|
||||
#define vTaskList MPU_vTaskList
|
||||
#define vTaskGetRunTimeStats MPU_vTaskGetRunTimeStats
|
||||
#define xTaskGenericNotify MPU_xTaskGenericNotify
|
||||
#define xTaskNotifyWait MPU_xTaskNotifyWait
|
||||
#define ulTaskNotifyTake MPU_ulTaskNotifyTake
|
||||
|
||||
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
#define pvPortMalloc MPU_pvPortMalloc
|
||||
#define vPortFree MPU_vPortFree
|
||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
#define xTaskGetCurrentTaskHandle MPU_xTaskGetCurrentTaskHandle
|
||||
#define vTaskSetTimeOutState MPU_vTaskSetTimeOutState
|
||||
#define xTaskCheckForTimeOut MPU_xTaskCheckForTimeOut
|
||||
#define xTaskGetSchedulerState MPU_xTaskGetSchedulerState
|
||||
|
||||
#define xPortGetFreeHeapSize MPU_xPortGetFreeHeapSize
|
||||
#define vPortInitialiseBlocks MPU_vPortInitialiseBlocks
|
||||
#define xPortGetMinimumEverFreeHeapSize MPU_xPortGetMinimumEverFreeHeapSize
|
||||
/* Map standard queue.h API functions to the MPU equivalents. */
|
||||
#define xQueueGenericSend MPU_xQueueGenericSend
|
||||
#define xQueueGenericReceive MPU_xQueueGenericReceive
|
||||
#define uxQueueMessagesWaiting MPU_uxQueueMessagesWaiting
|
||||
#define uxQueueSpacesAvailable MPU_uxQueueSpacesAvailable
|
||||
#define vQueueDelete MPU_vQueueDelete
|
||||
#define xQueueCreateMutex MPU_xQueueCreateMutex
|
||||
#define xQueueCreateMutexStatic MPU_xQueueCreateMutexStatic
|
||||
#define xQueueCreateCountingSemaphore MPU_xQueueCreateCountingSemaphore
|
||||
#define xQueueCreateCountingSemaphoreStatic MPU_xQueueCreateCountingSemaphoreStatic
|
||||
#define xQueueGetMutexHolder MPU_xQueueGetMutexHolder
|
||||
#define xQueueTakeMutexRecursive MPU_xQueueTakeMutexRecursive
|
||||
#define xQueueGiveMutexRecursive MPU_xQueueGiveMutexRecursive
|
||||
#define xQueueGenericCreate MPU_xQueueGenericCreate
|
||||
#define xQueueGenericCreateStatic MPU_xQueueGenericCreateStatic
|
||||
#define xQueueCreateSet MPU_xQueueCreateSet
|
||||
#define xQueueAddToSet MPU_xQueueAddToSet
|
||||
#define xQueueRemoveFromSet MPU_xQueueRemoveFromSet
|
||||
#define xQueueSelectFromSet MPU_xQueueSelectFromSet
|
||||
#define xQueueGenericReset MPU_xQueueGenericReset
|
||||
|
||||
#if configQUEUE_REGISTRY_SIZE > 0
|
||||
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
|
||||
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
|
||||
#if( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
#define vQueueAddToRegistry MPU_vQueueAddToRegistry
|
||||
#define vQueueUnregisterQueue MPU_vQueueUnregisterQueue
|
||||
#define pcQueueGetName MPU_pcQueueGetName
|
||||
#endif
|
||||
|
||||
#define xTimerCreate MPU_xTimerCreate
|
||||
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
|
||||
#define vTimerSetTimerID MPU_vTimerSetTimerID
|
||||
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
|
||||
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
|
||||
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
|
||||
#define pcTimerGetName MPU_pcTimerGetName
|
||||
#define xTimerGenericCommand MPU_xTimerGenericCommand
|
||||
/* Map standard timer.h API functions to the MPU equivalents. */
|
||||
#define xTimerCreate MPU_xTimerCreate
|
||||
#define xTimerCreateStatic MPU_xTimerCreateStatic
|
||||
#define pvTimerGetTimerID MPU_pvTimerGetTimerID
|
||||
#define vTimerSetTimerID MPU_vTimerSetTimerID
|
||||
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
|
||||
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
|
||||
#define xTimerPendFunctionCall MPU_xTimerPendFunctionCall
|
||||
#define pcTimerGetName MPU_pcTimerGetName
|
||||
#define xTimerGetPeriod MPU_xTimerGetPeriod
|
||||
#define xTimerGetExpiryTime MPU_xTimerGetExpiryTime
|
||||
#define xTimerGenericCommand MPU_xTimerGenericCommand
|
||||
|
||||
#define xEventGroupCreate MPU_xEventGroupCreate
|
||||
#define xEventGroupWaitBits MPU_xEventGroupWaitBits
|
||||
#define xEventGroupClearBits MPU_xEventGroupClearBits
|
||||
#define xEventGroupSetBits MPU_xEventGroupSetBits
|
||||
#define xEventGroupSync MPU_xEventGroupSync
|
||||
#define vEventGroupDelete MPU_vEventGroupDelete
|
||||
/* Map standard event_group.h API functions to the MPU equivalents. */
|
||||
#define xEventGroupCreate MPU_xEventGroupCreate
|
||||
#define xEventGroupCreateStatic MPU_xEventGroupCreateStatic
|
||||
#define xEventGroupWaitBits MPU_xEventGroupWaitBits
|
||||
#define xEventGroupClearBits MPU_xEventGroupClearBits
|
||||
#define xEventGroupSetBits MPU_xEventGroupSetBits
|
||||
#define xEventGroupSync MPU_xEventGroupSync
|
||||
#define vEventGroupDelete MPU_vEventGroupDelete
|
||||
|
||||
/* Remove the privileged function macro. */
|
||||
#define PRIVILEGED_FUNCTION
|
||||
|
|
|
@ -258,7 +258,7 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
|
|||
*
|
||||
* // Starting the scheduler will start the timers running as they have already
|
||||
* // been set into the active state.
|
||||
* xTaskStartScheduler();
|
||||
* vTaskStartScheduler();
|
||||
*
|
||||
* // Should not reach here.
|
||||
* for( ;; );
|
||||
|
@ -388,7 +388,7 @@ typedef void (*PendedFunction_t)( void *, uint32_t );
|
|||
*
|
||||
* // Starting the scheduler will start the timers running as they have already
|
||||
* // been set into the active state.
|
||||
* xTaskStartScheduler();
|
||||
* vTaskStartScheduler();
|
||||
*
|
||||
* // Should not reach here.
|
||||
* for( ;; );
|
||||
|
@ -819,7 +819,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
|
|||
*
|
||||
* // Starting the scheduler will start the timer running as it has already
|
||||
* // been set into the active state.
|
||||
* xTaskStartScheduler();
|
||||
* vTaskStartScheduler();
|
||||
*
|
||||
* // Should not reach here.
|
||||
* for( ;; );
|
||||
|
|
|
@ -80,6 +80,9 @@ task.h is included from an application file. */
|
|||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
#include "timers.h"
|
||||
#include "event_groups.h"
|
||||
#include "mpu_prototypes.h"
|
||||
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
|
||||
|
@ -175,56 +178,6 @@ static void prvRestoreContextOfFirstTask( void ) __attribute__(( naked )) PRIVIL
|
|||
*/
|
||||
static void prvSVCHandler( uint32_t *pulRegisters ) __attribute__(( noinline )) PRIVILEGED_FUNCTION;
|
||||
|
||||
/*
|
||||
* Prototypes for all the MPU wrappers.
|
||||
*/
|
||||
BaseType_t MPU_xTaskCreateRestricted( const TaskParameters_t * const pxTaskDefinition, TaskHandle_t *pxCreatedTask );
|
||||
BaseType_t MPU_xTaskCreate( TaskFunction_t pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask );
|
||||
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const xRegions );
|
||||
void MPU_vTaskDelete( TaskHandle_t pxTaskToDelete );
|
||||
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, TickType_t xTimeIncrement );
|
||||
void MPU_vTaskDelay( TickType_t xTicksToDelay );
|
||||
UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t pxTask );
|
||||
void MPU_vTaskPrioritySet( TaskHandle_t pxTask, UBaseType_t uxNewPriority );
|
||||
eTaskState MPU_eTaskGetState( TaskHandle_t pxTask );
|
||||
void MPU_vTaskSuspend( TaskHandle_t pxTaskToSuspend );
|
||||
void MPU_vTaskResume( TaskHandle_t pxTaskToResume );
|
||||
void MPU_vTaskSuspendAll( void );
|
||||
BaseType_t MPU_xTaskResumeAll( void );
|
||||
TickType_t MPU_xTaskGetTickCount( void );
|
||||
UBaseType_t MPU_uxTaskGetNumberOfTasks( void );
|
||||
void MPU_vTaskList( char *pcWriteBuffer );
|
||||
void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer );
|
||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxTagValue );
|
||||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );
|
||||
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );
|
||||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
|
||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void );
|
||||
BaseType_t MPU_xTaskGetSchedulerState( void );
|
||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void );
|
||||
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t *pxTaskStatusArray, UBaseType_t uxArraySize, uint32_t *pulTotalRunTime );
|
||||
QueueHandle_t MPU_xQueueGenericCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t ucQueueType );
|
||||
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue, const void * const pvItemToQueue, TickType_t xTicksToWait, BaseType_t xCopyPosition );
|
||||
BaseType_t MPU_xQueueGenericReset( QueueHandle_t pxQueue, BaseType_t xNewQueue );
|
||||
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t pxQueue );
|
||||
BaseType_t MPU_xQueueGenericReceive( QueueHandle_t pxQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking );
|
||||
QueueHandle_t MPU_xQueueCreateMutex( void );
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphore( UBaseType_t uxCountValue, UBaseType_t uxInitialCount );
|
||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime );
|
||||
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t xMutex );
|
||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, char *pcName );
|
||||
void MPU_vQueueDelete( QueueHandle_t xQueue );
|
||||
void *MPU_pvPortMalloc( size_t xSize );
|
||||
void MPU_vPortFree( void *pv );
|
||||
void MPU_vPortInitialiseBlocks( void );
|
||||
size_t MPU_xPortGetFreeHeapSize( void );
|
||||
QueueSetHandle_t MPU_xQueueCreateSet( UBaseType_t uxEventQueueLength );
|
||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet, TickType_t xBlockTimeTicks );
|
||||
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
|
||||
BaseType_t MPU_xQueueRemoveFromSet( QueueSetMemberHandle_t xQueueOrSemaphore, QueueSetHandle_t xQueueSet );
|
||||
BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t xQueue, void * const pvBuffer );
|
||||
void* MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
@ -491,7 +444,7 @@ extern uint32_t __privileged_data_end__[];
|
|||
if( *portMPU_TYPE == portEXPECTED_MPU_TYPE_VALUE )
|
||||
{
|
||||
/* First setup the entire flash for unprivileged read only access. */
|
||||
*portMPU_REGION_BASE_ADDRESS = ( ( uint32_t ) __FLASH_segment_start__ ) | /* Base address. */
|
||||
*portMPU_REGION_BASE_ADDRESS = ( ( uint32_t ) __FLASH_segment_start__ ) | /* Base address. */
|
||||
( portMPU_REGION_VALID ) |
|
||||
( portUNPRIVILEGED_FLASH_REGION );
|
||||
|
||||
|
@ -503,7 +456,7 @@ extern uint32_t __privileged_data_end__[];
|
|||
/* Setup the first 16K for privileged only access (even though less
|
||||
than 10K is actually being used). This is where the kernel code is
|
||||
placed. */
|
||||
*portMPU_REGION_BASE_ADDRESS = ( ( uint32_t ) __FLASH_segment_start__ ) | /* Base address. */
|
||||
*portMPU_REGION_BASE_ADDRESS = ( ( uint32_t ) __FLASH_segment_start__ ) | /* Base address. */
|
||||
( portMPU_REGION_VALID ) |
|
||||
( portPRIVILEGED_FLASH_REGION );
|
||||
|
||||
|
@ -596,7 +549,7 @@ uint32_t ul;
|
|||
if( xRegions == NULL )
|
||||
{
|
||||
/* No MPU regions are specified so allow access to all RAM. */
|
||||
xMPUSettings->xRegion[ 0 ].ulRegionBaseAddress =
|
||||
xMPUSettings->xRegion[ 0 ].ulRegionBaseAddress =
|
||||
( ( uint32_t ) __SRAM_segment_start__ ) | /* Base address. */
|
||||
( portMPU_REGION_VALID ) |
|
||||
( portSTACK_REGION );
|
||||
|
@ -691,15 +644,30 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xTaskCreate( TaskFunction_t pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
BaseType_t MPU_xTaskCreate( TaskFunction_t pvTaskCode, const char * const pcName, uint16_t usStackDepth, void *pvParameters, UBaseType_t uxPriority, TaskHandle_t *pxCreatedTask )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
xReturn = xTaskCreate( pvTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif /* configSUPPORT_DYNAMIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
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 )
|
||||
{
|
||||
TaskHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskCreateStatic( pxTaskCode, pcName, ulStackDepth, pvParameters, uxPriority, puxStackBuffer, pxTaskBuffer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif /* configSUPPORT_STATIC_ALLOCATION */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void MPU_vTaskAllocateMPURegions( TaskHandle_t xTask, const MemoryRegion_t * const xRegions )
|
||||
|
@ -714,10 +682,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_vTaskDelete == 1 )
|
||||
void MPU_vTaskDelete( TaskHandle_t pxTaskToDelete )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskDelete( pxTaskToDelete );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -725,10 +693,23 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_vTaskDelayUntil == 1 )
|
||||
void MPU_vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, TickType_t xTimeIncrement )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_xTaskAbortDelay == 1 )
|
||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskAbortDelay( xTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -736,10 +717,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_vTaskDelay == 1 )
|
||||
void MPU_vTaskDelay( TickType_t xTicksToDelay )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskDelay( xTicksToDelay );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -748,10 +729,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
UBaseType_t MPU_uxTaskPriorityGet( TaskHandle_t pxTask )
|
||||
{
|
||||
UBaseType_t uxReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
uxReturn = uxTaskPriorityGet( pxTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return uxReturn;
|
||||
}
|
||||
#endif
|
||||
|
@ -760,10 +741,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_vTaskPrioritySet == 1 )
|
||||
void MPU_vTaskPrioritySet( TaskHandle_t pxTask, UBaseType_t uxNewPriority )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskPrioritySet( pxTask, uxNewPriority );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -771,24 +752,35 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_eTaskGetState == 1 )
|
||||
eTaskState MPU_eTaskGetState( TaskHandle_t pxTask )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
eTaskState eReturn;
|
||||
|
||||
eReturn = eTaskGetState( pxTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return eReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TRACE_FACILITY == 1 )
|
||||
void MPU_vTaskGetInfo( TaskHandle_t xTask, TaskStatus_t *pxTaskStatus, BaseType_t xGetFreeStackSpace, eTaskState eState )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskGetInfo( xTask, pxTaskStatus, xGetFreeStackSpace, eState );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
|
||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void )
|
||||
{
|
||||
TaskHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGetIdleTaskHandle();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return eReturn;
|
||||
}
|
||||
#endif
|
||||
|
@ -797,10 +789,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||
void MPU_vTaskSuspend( TaskHandle_t pxTaskToSuspend )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskSuspend( pxTaskToSuspend );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -808,10 +800,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||
void MPU_vTaskResume( TaskHandle_t pxTaskToResume )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskResume( pxTaskToResume );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -821,7 +813,7 @@ void MPU_vTaskSuspendAll( void )
|
|||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskSuspendAll();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -831,8 +823,8 @@ BaseType_t xReturn;
|
|||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskResumeAll();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -842,7 +834,7 @@ TickType_t xReturn;
|
|||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGetTickCount();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -853,11 +845,35 @@ UBaseType_t uxReturn;
|
|||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
uxReturn = uxTaskGetNumberOfTasks();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
char * MPU_pcTaskGetName( TaskHandle_t xTaskToQuery )
|
||||
{
|
||||
char *pcReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
pcReturn = pcTaskGetName( xTaskToQuery );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return pcReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_xTaskGetHandle == 1 )
|
||||
TaskHandle_t MPU_xTaskGetHandle( const char *pcNameToQuery )
|
||||
{
|
||||
TaskHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGetHandle( pcNameToQuery );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return pcReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
void MPU_vTaskList( char *pcWriteBuffer )
|
||||
{
|
||||
|
@ -872,10 +888,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
void MPU_vTaskGetRunTimeStats( char *pcWriteBuffer )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskGetRunTimeStats( pcWriteBuffer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -883,10 +899,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxTagValue )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskSetApplicationTaskTag( xTask, pxTagValue );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
@ -895,23 +911,47 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask )
|
||||
{
|
||||
TaskHookFunction_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGetApplicationTaskTag( xTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
|
||||
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTaskSetThreadLocalStoragePointer( xTaskToSet, xIndex, pvValue );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
|
||||
void *MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex )
|
||||
{
|
||||
void *pvReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
pvReturn = pvTaskGetThreadLocalStoragePointer( xTaskToQuery, xIndex );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return pvReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskCallApplicationTaskHook( xTask, pvParameter );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
|
@ -934,10 +974,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask )
|
||||
{
|
||||
UBaseType_t uxReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
uxReturn = uxTaskGetStackHighWaterMark( xTask );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return uxReturn;
|
||||
}
|
||||
#endif
|
||||
|
@ -947,10 +987,10 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void )
|
||||
{
|
||||
TaskHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGetCurrentTaskHandle();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
|
@ -960,26 +1000,100 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
BaseType_t MPU_xTaskGetSchedulerState( void )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGetSchedulerState();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
QueueHandle_t MPU_xQueueGenericCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t ucQueueType )
|
||||
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType );
|
||||
vTaskSetTimeOutState( pxTimeOut );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut, TickType_t * const pxTicksToWait )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskCheckForTimeOut( pxTimeOut, pxTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
BaseType_t MPU_xTaskGenericNotify( TaskHandle_t xTaskToNotify, uint32_t ulValue, eNotifyAction eAction, uint32_t *pulPreviousNotificationValue )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskGenericNotify( xTaskToNotify, ulValue, eAction, pulPreviousNotificationValue );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
BaseType_t MPU_xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, uint32_t *pulNotificationValue, TickType_t xTicksToWait )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTaskNotifyWait( ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
uint32_t MPU_ulTaskNotifyTake( BaseType_t xClearCountOnExit, TickType_t xTicksToWait )
|
||||
{
|
||||
uint32_t ulReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
ulReturn = ulTaskNotifyTake( xClearCountOnExit, xTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return ulReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
QueueHandle_t MPU_xQueueGenericCreate( UBaseType_t uxQueueLength, UBaseType_t uxItemSize, uint8_t ucQueueType )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueGenericCreate( uxQueueLength, uxItemSize, ucQueueType );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
QueueHandle_t MPU_xQueueGenericCreateStatic( const UBaseType_t uxQueueLength, const UBaseType_t uxItemSize, uint8_t *pucQueueStorage, StaticQueue_t *pxStaticQueue, const uint8_t ucQueueType )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueGenericCreateStatic( uxQueueLength, uxItemSize, pucQueueStorage, pxStaticQueue, ucQueueType );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xQueueGenericReset( QueueHandle_t pxQueue, BaseType_t xNewQueue )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
|
@ -1013,6 +1127,17 @@ UBaseType_t uxReturn;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
UBaseType_t uxReturn;
|
||||
|
||||
uxReturn = uxQueueSpacesAvailable( xQueue );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return uxReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xQueueGenericReceive( QueueHandle_t pxQueue, void * const pvBuffer, TickType_t xTicksToWait, BaseType_t xJustPeeking )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
@ -1046,23 +1171,36 @@ void * xReturn;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
QueueHandle_t MPU_xQueueCreateMutex( void )
|
||||
#if( ( configUSE_MUTEXES == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
QueueHandle_t MPU_xQueueCreateMutex( const uint8_t ucQueueType )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueCreateMutex( queueQUEUE_TYPE_MUTEX );
|
||||
xReturn = xQueueCreateMutex( ucQueueType );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if configUSE_COUNTING_SEMAPHORES == 1
|
||||
#if( ( configUSE_MUTEXES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
|
||||
QueueHandle_t MPU_xQueueCreateMutexStatic( const uint8_t ucQueueType, StaticQueue_t *pxStaticQueue )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueCreateMutexStatic( ucQueueType, pxStaticQueue );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) )
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphore( UBaseType_t uxCountValue, UBaseType_t uxInitialCount )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueCreateCountingSemaphore( uxCountValue, uxInitialCount );
|
||||
|
@ -1072,6 +1210,20 @@ void * xReturn;
|
|||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( ( configUSE_COUNTING_SEMAPHORES == 1 ) && ( configSUPPORT_STATIC_ALLOCATION == 1 ) )
|
||||
|
||||
QueueHandle_t MPU_xQueueCreateCountingSemaphoreStatic( const UBaseType_t uxMaxCount, const UBaseType_t uxInitialCount, StaticQueue_t *pxStaticQueue )
|
||||
{
|
||||
QueueHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xQueueCreateCountingSemaphoreStatic( uxMaxCount, uxInitialCount, pxStaticQueue );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_MUTEXES == 1 )
|
||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex, TickType_t xBlockTime )
|
||||
{
|
||||
|
@ -1151,7 +1303,7 @@ void * xReturn;
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if configQUEUE_REGISTRY_SIZE > 0
|
||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, char *pcName )
|
||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
|
@ -1162,6 +1314,32 @@ void * xReturn;
|
|||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if configQUEUE_REGISTRY_SIZE > 0
|
||||
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vQueueUnregisterQueue( xQueue );
|
||||
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if configQUEUE_REGISTRY_SIZE > 0
|
||||
const char *MPU_pcQueueGetName( QueueHandle_t xQueue )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
const char *pcReturn;
|
||||
|
||||
pcReturn = pcQueueGetName( xQueue );
|
||||
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
return pcReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void MPU_vQueueDelete( QueueHandle_t xQueue )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
@ -1224,6 +1402,247 @@ BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
|||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( ( configSUPPORT_DYNAMIC_ALLOCATION == 1 ) && ( configUSE_TIMERS == 1 ) )
|
||||
TimerHandle_t MPU_xTimerCreate( const char * const pcTimerName, const TickType_t xTimerPeriodInTicks, const UBaseType_t uxAutoReload, void * const pvTimerID, TimerCallbackFunction_t pxCallbackFunction )
|
||||
{
|
||||
TimerHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerCreate( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( ( configSUPPORT_STATIC_ALLOCATION == 1 ) && ( configUSE_TIMERS == 1 ) )
|
||||
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 )
|
||||
{
|
||||
TimerHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerCreateStatic( pcTimerName, xTimerPeriodInTicks, uxAutoReload, pvTimerID, pxCallbackFunction, pxTimerBuffer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
void *MPU_pvTimerGetTimerID( const TimerHandle_t xTimer )
|
||||
{
|
||||
void * pvReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
pvReturn = pvTimerGetTimerID( xTimer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return pvReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer, void *pvNewID )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vTimerSetTimerID( xTimer, pvNewID );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerIsTimerActive( xTimer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void )
|
||||
{
|
||||
TaskHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerGetTimerDaemonTaskHandle();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 1 ) )
|
||||
BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerPendFunctionCall( xFunctionToPend, pvParameter1, ulParameter2, xTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer )
|
||||
{
|
||||
const char * pcReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
pcReturn = pcTimerGetName( xTimer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return pcReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer )
|
||||
{
|
||||
TickType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerGetPeriod( xTimer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer )
|
||||
{
|
||||
TickType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerGetExpiryTime( xTimer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configUSE_TIMERS == 1 )
|
||||
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait )
|
||||
{
|
||||
BaseType_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xTimerGenericCommand( xTimer, xCommandID, xOptionalValue, pxHigherPriorityTaskWoken, xTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configSUPPORT_DYNAMIC_ALLOCATION == 1 )
|
||||
EventGroupHandle_t MPU_xEventGroupCreate( void )
|
||||
{
|
||||
EventGroupHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xEventGroupCreate();
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if( configSUPPORT_STATIC_ALLOCATION == 1 )
|
||||
EventGroupHandle_t MPU_xEventGroupCreateStatic( StaticEventGroup_t *pxEventGroupBuffer )
|
||||
{
|
||||
EventGroupHandle_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xEventGroupCreateStatic( pxEventGroupBuffer );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
#endif
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToWaitFor, const BaseType_t xClearOnExit, const BaseType_t xWaitForAllBits, TickType_t xTicksToWait )
|
||||
{
|
||||
EventBits_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xEventGroupWaitBits( xEventGroup, uxBitsToWaitFor, xClearOnExit, xWaitForAllBits, xTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToClear )
|
||||
{
|
||||
EventBits_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xEventGroupClearBits( xEventGroup, uxBitsToClear );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet )
|
||||
{
|
||||
EventBits_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xEventGroupSetBits( xEventGroup, uxBitsToSet );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup, const EventBits_t uxBitsToSet, const EventBits_t uxBitsToWaitFor, TickType_t xTicksToWait )
|
||||
{
|
||||
EventBits_t xReturn;
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
xReturn = xEventGroupSync( xEventGroup, uxBitsToSet, uxBitsToWaitFor, xTicksToWait );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
|
||||
return xReturn;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void MPU_vEventGroupDelete( EventGroupHandle_t xEventGroup )
|
||||
{
|
||||
BaseType_t xRunningPrivileged = prvRaisePrivilege();
|
||||
|
||||
vEventGroupDelete( xEventGroup );
|
||||
portRESET_PRIVILEGE( xRunningPrivileged );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* Functions that the application writer wants to execute in privileged mode
|
||||
can be defined in application_defined_privileged_functions.h. The functions
|
||||
|
|
|
@ -394,7 +394,7 @@ uint32_t ulAPSR, ulCycles = 8; /* 8 bits per byte. */
|
|||
}
|
||||
}
|
||||
|
||||
/* Will only get here if xTaskStartScheduler() was called with the CPU in
|
||||
/* Will only get here if vTaskStartScheduler() was called with the CPU in
|
||||
a non-privileged mode or the binary point register was not set to its lowest
|
||||
possible value. prvTaskExitError() is referenced to prevent a compiler
|
||||
warning about it being defined but not referenced in the case that the user
|
||||
|
|
|
@ -268,7 +268,7 @@ uint32_t ulAPSR;
|
|||
vPortRestoreTaskContext();
|
||||
}
|
||||
|
||||
/* Will only get here if xTaskStartScheduler() was called with the CPU in
|
||||
/* Will only get here if vTaskStartScheduler() was called with the CPU in
|
||||
a non-privileged mode or the binary point register was not set to its lowest
|
||||
possible value. prvTaskExitError() is referenced to prevent a compiler
|
||||
warning about it being defined but not referenced in the case that the user
|
||||
|
|
|
@ -254,7 +254,7 @@ uint32_t ulAPSR;
|
|||
vPortRestoreTaskContext();
|
||||
}
|
||||
|
||||
/* Will only get here if xTaskStartScheduler() was called with the CPU in
|
||||
/* Will only get here if vTaskStartScheduler() was called with the CPU in
|
||||
a non-privileged mode or the binary point register was not set to its lowest
|
||||
possible value. */
|
||||
return 0;
|
||||
|
|
|
@ -314,7 +314,7 @@ uint32_t ulAPSR;
|
|||
}
|
||||
}
|
||||
|
||||
/* Will only get here if xTaskStartScheduler() was called with the CPU in
|
||||
/* Will only get here if vTaskStartScheduler() was called with the CPU in
|
||||
a non-privileged mode or the binary point register was not set to its lowest
|
||||
possible value. */
|
||||
return 0;
|
||||
|
|
|
@ -265,7 +265,7 @@ uint32_t ulAPSR;
|
|||
vPortRestoreTaskContext();
|
||||
}
|
||||
|
||||
/* Will only get here if xTaskStartScheduler() was called with the CPU in
|
||||
/* Will only get here if vTaskStartScheduler() was called with the CPU in
|
||||
a non-privileged mode or the binary point register was not set to its lowest
|
||||
possible value. prvTaskExitError() is referenced to prevent a compiler
|
||||
warning about it being defined but not referenced in the case that the user
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
#include "FreeRTOSConfig.h"
|
||||
#include "ISR_Support.h"
|
||||
|
||||
|
||||
.extern pxCurrentTCB
|
||||
.extern vTaskSwitchContext
|
||||
.extern vPortIncrementTick
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue