mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-01-21 17:20:32 -05:00
arm-cortex-r82: Add MPU support
This commit introduces support for the Memory Protection Unit (MPU) to the ARM Cortex-R82 port. The MPU enhances system security by allowing the definition of memory regions with specific access permissions. The following changes have been made: - Added MPU configuration functions in `port.c` to set up memory regions and their attributes. - Updated `portASM.S` to include assembly routines for MPU and context switching with MPU support. - Created `mpu_wrappers_v2_asm.c` to provide assembly wrappers for MPU operations. - Updated `portmacro.h` to include MPU-related macros and definitions. - Modified `task.h` to include MPU-related task attributes. - Updated `CMakeLists.txt` to include the new MPU source file. - Enhanced the `README.md` with instructions on MPU configuration. Signed-off-by: Ahmed Ismail <Ahmed.Ismail@arm.com>
This commit is contained in:
parent
7d6890e650
commit
3cca1ec00e
8 changed files with 2984 additions and 396 deletions
14
.github/.cSpellWords.txt
vendored
14
.github/.cSpellWords.txt
vendored
|
|
@ -69,6 +69,7 @@ CANTX
|
|||
capitalisation
|
||||
cbmc
|
||||
CBMC
|
||||
cbnz
|
||||
cbor
|
||||
CBOR
|
||||
CCIE
|
||||
|
|
@ -107,6 +108,8 @@ CLKS
|
|||
CLKSOURCE
|
||||
CLKSTA
|
||||
CLRB
|
||||
clrex
|
||||
CLREX
|
||||
CLRF
|
||||
clrm
|
||||
CLRPSW
|
||||
|
|
@ -378,6 +381,7 @@ IFSR
|
|||
imajeff
|
||||
INACK
|
||||
INDF
|
||||
initialisations
|
||||
inpw
|
||||
INTE
|
||||
INTFRCH
|
||||
|
|
@ -651,6 +655,8 @@ PPUDR
|
|||
PPUER
|
||||
PPUSR
|
||||
ppux
|
||||
Prbar
|
||||
PRBAR
|
||||
PRCR
|
||||
PREA
|
||||
PREB
|
||||
|
|
@ -658,11 +664,15 @@ PRIA
|
|||
Prioritised
|
||||
PRIS
|
||||
PRIVDEFENA
|
||||
Prlar
|
||||
PRLAR
|
||||
PROCDLY
|
||||
PRODH
|
||||
PRODL
|
||||
PROGE
|
||||
Prokic
|
||||
Prselr
|
||||
PRSELR
|
||||
prtmacro
|
||||
psha
|
||||
psplim
|
||||
|
|
@ -705,6 +715,7 @@ REENT
|
|||
REGA
|
||||
RELD
|
||||
Renesas
|
||||
restoreallgpregisters
|
||||
reta
|
||||
reti
|
||||
RETP
|
||||
|
|
@ -772,6 +783,8 @@ SCBR
|
|||
SCDR
|
||||
SCER
|
||||
SCSR
|
||||
Sctlr
|
||||
SCTLR
|
||||
SDCC
|
||||
SECU
|
||||
SENDA
|
||||
|
|
@ -929,6 +942,7 @@ UNSUB
|
|||
UNSUBACK
|
||||
unsubscriptions
|
||||
unsuspended
|
||||
unupdated
|
||||
UPAC
|
||||
URAD
|
||||
URAT
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@
|
|||
#if defined( portARMV8M_MINOR_VERSION ) && ( portARMV8M_MINOR_VERSION >= 1 )
|
||||
#define tskMPU_REGION_PRIVILEGED_EXECUTE_NEVER ( 1U << 5U )
|
||||
#endif /* portARMV8M_MINOR_VERSION >= 1 */
|
||||
#define tskMPU_REGION_NON_SHAREABLE ( 1U << 6U )
|
||||
#define tskMPU_REGION_OUTER_SHAREABLE ( 1U << 7U )
|
||||
#define tskMPU_REGION_INNER_SHAREABLE ( 1U << 8U )
|
||||
|
||||
/* MPU region permissions stored in MPU settings to
|
||||
* authorize access requests. */
|
||||
|
|
|
|||
|
|
@ -243,7 +243,8 @@ add_library(freertos_kernel_port OBJECT
|
|||
# ARMv8-R ports for GCC
|
||||
$<$<STREQUAL:${FREERTOS_PORT},GCC_ARM_CR82>:
|
||||
GCC/ARM_CR82/port.c
|
||||
GCC/ARM_CR82/portASM.S>
|
||||
GCC/ARM_CR82/portASM.S
|
||||
GCC/ARM_CR82/mpu_wrappers_v2_asm.c>
|
||||
|
||||
# ARMv4T ARM7TDMI ports for GCC
|
||||
$<$<STREQUAL:${FREERTOS_PORT},GCC_ARM7_AT91FR40008>:
|
||||
|
|
@ -822,6 +823,7 @@ if( FREERTOS_PORT MATCHES "GCC_ARM_CM(3|4)_MPU" OR
|
|||
FREERTOS_PORT MATCHES "GCC_ARM_CM(23|33|52|55|85)_NTZ_NONSECURE" OR
|
||||
FREERTOS_PORT MATCHES "GCC_ARM_CM(23|33|52|55|85)_NONSECURE" OR
|
||||
FREERTOS_PORT MATCHES "GCC_ARM_CM(33|52|55|85)_TFM" OR
|
||||
FREERTOS_PORT MATCHES "GCC_ARM_CR82" OR
|
||||
FREERTOS_PORT MATCHES "IAR_ARM_CM(23|33|52|55|85)_NTZ_NONSECURE" OR
|
||||
FREERTOS_PORT MATCHES "IAR_ARM_CM(23|33|52|55|85)_NONSECURE" OR
|
||||
FREERTOS_PORT MATCHES "IAR_ARM_CM(33|52|55|85)_TFM"
|
||||
|
|
|
|||
|
|
@ -18,6 +18,12 @@ The port is supported and tested on the following toolchains:
|
|||
- The port does not perform cache maintenance for shared buffers.
|
||||
- If your hardware or model doesn't support full cache coherency, you must handle cache clean/invalidate operations, memory attributes, and any additional barriers in your BSP/application (especially around shared-memory regions).
|
||||
|
||||
# MPU Support
|
||||
|
||||
- This port supports the FreeRTOS MPU on both single-core and SMP (multi-core) configurations. Enable via `configENABLE_MPU = 1`; the port programs MPU regions per task on each active core.
|
||||
|
||||
- Minimum MPU granularity and alignment: 64 bytes. Ensure any user‑defined region base and size are 64‑byte aligned.
|
||||
|
||||
# SMP Multicore Bring-up
|
||||
|
||||
For SMP systems using this port, the application only needs to start the scheduler on the primary core and issue an SVC from each secondary core once they are online. The kernel coordinates the rest and ensures all cores are properly managed.
|
||||
|
|
@ -39,4 +45,4 @@ Secondary core flow (to be done in each core’s reset handler):
|
|||
2. Wait for the primary core's signal that shared initialization is complete (i.e., `ucPrimaryCoreInitDoneFlag` set to 1).
|
||||
3. Update `VBAR_EL1` from the boot vector table to the FreeRTOS vector table.
|
||||
4. Initialize the GIC redistributor and enable SGIs so interrupts from the primary core are receivable; signal the primary that this secondary is online and ready by setting the its flag in the `ucSecondaryCoresReadyFlags` array.
|
||||
5. Issue an SVC with immediate value `106` to enter `FreeRTOS_SWI_Handler`, which will call `vPortRestoreContext()` based on the SVC number to start scheduling on this core.
|
||||
5. Issue an SVC with immediate value `106` (i.e., `portSVC_START_FIRST_TASK`) to enter `FreeRTOS_SWI_Handler`, which will call `vPortRestoreContext()` based on the SVC number to start scheduling on this core.
|
||||
|
|
|
|||
944
portable/GCC/ARM_CR82/mpu_wrappers_v2_asm.c
Normal file
944
portable/GCC/ARM_CR82/mpu_wrappers_v2_asm.c
Normal file
|
|
@ -0,0 +1,944 @@
|
|||
/*
|
||||
* FreeRTOS Kernel <DEVELOPMENT BRANCH>
|
||||
* Copyright (C) 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
||||
* Copyright 2025 Arm Limited and/or its affiliates
|
||||
* <open-source-office@arm.com>
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
* this software and associated documentation files (the "Software"), to deal in
|
||||
* the Software without restriction, including without limitation the rights to
|
||||
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
||||
* the Software, and to permit persons to whom the Software is furnished to do so,
|
||||
* subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in all
|
||||
* copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
* https://www.FreeRTOS.org
|
||||
* https://github.com/FreeRTOS
|
||||
*
|
||||
*/
|
||||
|
||||
/* Defining MPU_WRAPPERS_INCLUDED_FROM_API_FILE prevents task.h from redefining
|
||||
* all the API functions to use the MPU wrappers. That should only be done when
|
||||
* task.h is included from an application file. */
|
||||
#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
|
||||
/* Scheduler includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
#include "queue.h"
|
||||
#include "timers.h"
|
||||
#include "event_groups.h"
|
||||
#include "stream_buffer.h"
|
||||
#include "mpu_prototypes.h"
|
||||
#include "mpu_syscall_numbers.h"
|
||||
#include "portmacro.h"
|
||||
|
||||
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE
|
||||
|
||||
#if ( configENABLE_MPU == 1 )
|
||||
|
||||
/*
|
||||
* Common single-SVC dispatch: wrappers do only one SVC.
|
||||
* The SVC handler decides whether to tail-call the implementation directly
|
||||
* (privileged) or set up full system-call state (unprivileged).
|
||||
*/
|
||||
#define FREERTOS_MPU_SVC_DISPATCH( xSystemCallNumber ) \
|
||||
__asm volatile ( \
|
||||
"svc %0 \n" \
|
||||
: \
|
||||
: "i" ( xSystemCallNumber ) \
|
||||
: "memory" \
|
||||
);
|
||||
|
||||
#if ( INCLUDE_xTaskDelayUntil == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||
const TickType_t xTimeIncrement ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,
|
||||
const TickType_t xTimeIncrement ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskDelayUntil );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskDelayUntil == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_xTaskAbortDelay == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskAbortDelay( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskAbortDelay );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskAbortDelay == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_vTaskDelay == 1 )
|
||||
|
||||
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskDelay( const TickType_t xTicksToDelay ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskDelay );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_vTaskDelay == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_uxTaskPriorityGet == 1 )
|
||||
|
||||
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxTaskPriorityGet( const TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxTaskPriorityGet );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_uxTaskPriorityGet == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_eTaskGetState == 1 )
|
||||
|
||||
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
eTaskState MPU_eTaskGetState( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_eTaskGetState );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_eTaskGetState == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
void MPU_vTaskGetInfo( TaskHandle_t xTask,
|
||||
TaskStatus_t * pxTaskStatus,
|
||||
BaseType_t xGetFreeStackSpace,
|
||||
eTaskState eState ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskGetInfo( TaskHandle_t xTask,
|
||||
TaskStatus_t * pxTaskStatus,
|
||||
BaseType_t xGetFreeStackSpace,
|
||||
eTaskState eState ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskGetInfo );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_xTaskGetIdleTaskHandle == 1 )
|
||||
|
||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TaskHandle_t MPU_xTaskGetIdleTaskHandle( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGetIdleTaskHandle );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_vTaskSuspend == 1 )
|
||||
|
||||
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskSuspend( TaskHandle_t xTaskToSuspend ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskSuspend );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskResume( TaskHandle_t xTaskToResume ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskResume );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_vTaskSuspend == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
TickType_t MPU_xTaskGetTickCount( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TickType_t MPU_xTaskGetTickCount( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGetTickCount );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxTaskGetNumberOfTasks( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxTaskGetNumberOfTasks );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimeCounter( const TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_ulTaskGetRunTimeCounter );
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configGENERATE_RUN_TIME_STATS == 1 )
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetRunTimePercent( const TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_ulTaskGetRunTimePercent );
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) )
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimePercent( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_ulTaskGetIdleRunTimePercent );
|
||||
}
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
configRUN_TIME_COUNTER_TYPE MPU_ulTaskGetIdleRunTimeCounter( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_ulTaskGetIdleRunTimeCounter );
|
||||
}
|
||||
|
||||
#endif /* if ( ( configGENERATE_RUN_TIME_STATS == 1 ) && ( INCLUDE_xTaskGetIdleTaskHandle == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
|
||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
|
||||
TaskHookFunction_t pxHookFunction ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask,
|
||||
TaskHookFunction_t pxHookFunction ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskSetApplicationTaskTag );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_APPLICATION_TASK_TAG == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_APPLICATION_TASK_TAG == 1 )
|
||||
|
||||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGetApplicationTaskTag );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_APPLICATION_TASK_TAG == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
|
||||
|
||||
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
|
||||
BaseType_t xIndex,
|
||||
void * pvValue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet,
|
||||
BaseType_t xIndex,
|
||||
void * pvValue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskSetThreadLocalStoragePointer );
|
||||
}
|
||||
|
||||
#endif /* if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )
|
||||
|
||||
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
|
||||
BaseType_t xIndex ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery,
|
||||
BaseType_t xIndex ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_pvTaskGetThreadLocalStoragePointer );
|
||||
}
|
||||
|
||||
#endif /* if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TRACE_FACILITY == 1 )
|
||||
|
||||
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
||||
const UBaseType_t uxArraySize,
|
||||
configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxTaskGetSystemState( TaskStatus_t * const pxTaskStatusArray,
|
||||
const UBaseType_t uxArraySize,
|
||||
configRUN_TIME_COUNTER_TYPE * const pulTotalRunTime ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxTaskGetSystemState );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TRACE_FACILITY == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 )
|
||||
|
||||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxTaskGetStackHighWaterMark );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_uxTaskGetStackHighWaterMark == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 )
|
||||
|
||||
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxTaskGetStackHighWaterMark2 );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_uxTaskGetStackHighWaterMark2 == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) )
|
||||
|
||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TaskHandle_t MPU_xTaskGetCurrentTaskHandle( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGetCurrentTaskHandle );
|
||||
}
|
||||
|
||||
#endif /* if ( ( INCLUDE_xTaskGetCurrentTaskHandle == 1 ) || ( configUSE_MUTEXES == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( INCLUDE_xTaskGetSchedulerState == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskGetSchedulerState( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskGetSchedulerState( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGetSchedulerState );
|
||||
}
|
||||
|
||||
#endif /* if ( INCLUDE_xTaskGetSchedulerState == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTaskSetTimeOutState( TimeOut_t * const pxTimeOut ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTaskSetTimeOutState );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||
TickType_t * const pxTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||
TickType_t * const pxTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskCheckForTimeOut );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyEntry( const xTaskGenericNotifyParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGenericNotify );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyWaitEntry( const xTaskGenericNotifyWaitParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGenericNotifyWait );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
||||
BaseType_t xClearCountOnExit,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
uint32_t MPU_ulTaskGenericNotifyTake( UBaseType_t uxIndexToWaitOn,
|
||||
BaseType_t xClearCountOnExit,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_ulTaskGenericNotifyTake );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
||||
UBaseType_t uxIndexToClear ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTaskGenericNotifyStateClear( TaskHandle_t xTask,
|
||||
UBaseType_t uxIndexToClear ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTaskGenericNotifyStateClear );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TASK_NOTIFICATIONS == 1 )
|
||||
|
||||
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
||||
UBaseType_t uxIndexToClear,
|
||||
uint32_t ulBitsToClear ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
uint32_t MPU_ulTaskGenericNotifyValueClear( TaskHandle_t xTask,
|
||||
UBaseType_t uxIndexToClear,
|
||||
uint32_t ulBitsToClear ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_ulTaskGenericNotifyValueClear );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TASK_NOTIFICATIONS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
|
||||
const void * const pvItemToQueue,
|
||||
TickType_t xTicksToWait,
|
||||
const BaseType_t xCopyPosition ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueueGenericSend( QueueHandle_t xQueue,
|
||||
const void * const pvItemToQueue,
|
||||
TickType_t xTicksToWait,
|
||||
const BaseType_t xCopyPosition ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueGenericSend );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxQueueMessagesWaiting( const QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxQueueMessagesWaiting );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxQueueSpacesAvailable( const QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxQueueSpacesAvailable );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
|
||||
void * const pvBuffer,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueueReceive( QueueHandle_t xQueue,
|
||||
void * const pvBuffer,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueReceive );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
|
||||
void * const pvBuffer,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueuePeek( QueueHandle_t xQueue,
|
||||
void * const pvBuffer,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueuePeek );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueSemaphoreTake );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) )
|
||||
|
||||
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueGetMutexHolder );
|
||||
}
|
||||
|
||||
#endif /* if ( ( configUSE_MUTEXES == 1 ) && ( INCLUDE_xSemaphoreGetMutexHolder == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_RECURSIVE_MUTEXES == 1 )
|
||||
|
||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueueTakeMutexRecursive( QueueHandle_t xMutex,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueTakeMutexRecursive );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_RECURSIVE_MUTEXES == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_RECURSIVE_MUTEXES == 1 )
|
||||
|
||||
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueGiveMutexRecursive );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_RECURSIVE_MUTEXES == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
||||
const TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
QueueSetMemberHandle_t MPU_xQueueSelectFromSet( QueueSetHandle_t xQueueSet,
|
||||
const TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueSelectFromSet );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_QUEUE_SETS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_QUEUE_SETS == 1 )
|
||||
|
||||
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xQueueAddToSet( QueueSetMemberHandle_t xQueueOrSemaphore,
|
||||
QueueSetHandle_t xQueueSet ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xQueueAddToSet );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_QUEUE_SETS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
|
||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
|
||||
const char * pcName ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vQueueAddToRegistry( QueueHandle_t xQueue,
|
||||
const char * pcName ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vQueueAddToRegistry );
|
||||
}
|
||||
|
||||
#endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
|
||||
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vQueueUnregisterQueue( QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vQueueUnregisterQueue );
|
||||
}
|
||||
|
||||
#endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configQUEUE_REGISTRY_SIZE > 0 )
|
||||
|
||||
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
const char * MPU_pcQueueGetName( QueueHandle_t xQueue ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_pcQueueGetName );
|
||||
}
|
||||
|
||||
#endif /* if ( configQUEUE_REGISTRY_SIZE > 0 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void * MPU_pvTimerGetTimerID( const TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_pvTimerGetTimerID );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
|
||||
void * pvNewID ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
|
||||
void * pvNewID ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTimerSetTimerID );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTimerIsTimerActive );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTimerGetTimerDaemonTaskHandle );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTimerGenericCommandFromTaskEntry( const xTimerGenericCommandFromTaskParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTimerGenericCommandFromTask );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_pcTimerGetName );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||
const BaseType_t xAutoReload ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
|
||||
const BaseType_t xAutoReload ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vTimerSetReloadMode );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xTimerGetReloadMode( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTimerGetReloadMode );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxTimerGetReloadMode( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxTimerGetReloadMode );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTimerGetPeriod );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_TIMERS == 1 )
|
||||
|
||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xTimerGetExpiryTime );
|
||||
}
|
||||
|
||||
#endif /* if ( configUSE_TIMERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_EVENT_GROUPS == 1 )
|
||||
|
||||
EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
EventBits_t MPU_xEventGroupWaitBitsEntry( const xEventGroupWaitBitsParams_t * pxParams ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xEventGroupWaitBits );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_EVENT_GROUPS == 1 )
|
||||
|
||||
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToClear ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
EventBits_t MPU_xEventGroupClearBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToClear ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xEventGroupClearBits );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_EVENT_GROUPS == 1 )
|
||||
|
||||
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
EventBits_t MPU_xEventGroupSetBits( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xEventGroupSetBits );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_EVENT_GROUPS == 1 )
|
||||
|
||||
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet,
|
||||
const EventBits_t uxBitsToWaitFor,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
EventBits_t MPU_xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||
const EventBits_t uxBitsToSet,
|
||||
const EventBits_t uxBitsToWaitFor,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xEventGroupSync );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_EVENT_GROUPS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) )
|
||||
|
||||
UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
UBaseType_t MPU_uxEventGroupGetNumber( void * xEventGroup ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_uxEventGroupGetNumber );
|
||||
}
|
||||
|
||||
#endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) )
|
||||
|
||||
void MPU_vEventGroupSetNumber( void * xEventGroup,
|
||||
UBaseType_t uxEventGroupNumber ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
void MPU_vEventGroupSetNumber( void * xEventGroup,
|
||||
UBaseType_t uxEventGroupNumber ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_vEventGroupSetNumber );
|
||||
}
|
||||
|
||||
#endif /* #if ( ( configUSE_EVENT_GROUPS == 1 ) && ( configUSE_TRACE_FACILITY == 1 ) ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
const void * pvTxData,
|
||||
size_t xDataLengthBytes,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer,
|
||||
const void * pvTxData,
|
||||
size_t xDataLengthBytes,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferSend );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
void * pvRxData,
|
||||
size_t xBufferLengthBytes,
|
||||
TickType_t xTicksToWait ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer,
|
||||
void * pvRxData,
|
||||
size_t xBufferLengthBytes,
|
||||
TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferReceive );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferIsFull );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferIsEmpty );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
size_t MPU_xStreamBufferSpacesAvailable( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferSpacesAvailable );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
size_t MPU_xStreamBufferBytesAvailable( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferBytesAvailable );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||
size_t xTriggerLevel ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
BaseType_t MPU_xStreamBufferSetTriggerLevel( StreamBufferHandle_t xStreamBuffer,
|
||||
size_t xTriggerLevel ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferSetTriggerLevel );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#if ( configUSE_STREAM_BUFFERS == 1 )
|
||||
|
||||
size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) __attribute__( ( naked ) ) FREERTOS_SYSTEM_CALL;
|
||||
|
||||
size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
|
||||
{
|
||||
FREERTOS_MPU_SVC_DISPATCH( SYSTEM_CALL_xStreamBufferNextMessageLengthBytes );
|
||||
}
|
||||
|
||||
#endif /* #if ( configUSE_STREAM_BUFFERS == 1 ) */
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
#endif /* ( configENABLE_MPU == 1 ) */
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -109,6 +109,8 @@
|
|||
/**
|
||||
* @brief SVC numbers.
|
||||
*/
|
||||
|
||||
#define portSVC_SYSTEM_CALL_EXIT 104
|
||||
#define portSVC_YIELD 105
|
||||
#define portSVC_START_FIRST_TASK 106
|
||||
#define portSVC_DISABLE_INTERRUPTS 107
|
||||
|
|
@ -117,6 +119,11 @@
|
|||
#define portSVC_MASK_ALL_INTERRUPTS 110
|
||||
#define portSVC_UNMASK_ALL_INTERRUPTS 111
|
||||
#define portSVC_UNMASK_INTERRUPTS 112
|
||||
#define portSVC_CHECK_PRIVILEGE 113
|
||||
#define portSVC_SAVE_TASK_CONTEXT 114
|
||||
#define portSVC_RESTORE_CONTEXT 115
|
||||
#define portSVC_DELETE_CURRENT_TASK 116
|
||||
#define portSVC_INTERRUPT_CORE 117
|
||||
|
||||
#define portYIELD_FROM_ISR( x ) portEND_SWITCHING_ISR( x )
|
||||
#define portYIELD() __asm volatile ( "SVC %0" : : "i" ( portSVC_YIELD ) : "memory" )
|
||||
|
|
@ -246,6 +253,7 @@
|
|||
|
||||
#define portINTERRUPT_PRIORITY_REGISTER_OFFSET ( 0x400U )
|
||||
#define portYIELD_CORE_INT_ID ( 0x0U )
|
||||
#define portMAX_API_PRIORITY_MASK ( configMAX_API_CALL_INTERRUPT_PRIORITY << portPRIORITY_SHIFT )
|
||||
|
||||
#if ( configNUMBER_OF_CORES > 1 )
|
||||
|
||||
|
|
@ -261,14 +269,16 @@
|
|||
extern void vPortRecursiveLock( BaseType_t xCoreID,
|
||||
ePortRTOSLock eLockNum,
|
||||
BaseType_t uxAcquire );
|
||||
extern BaseType_t xPortGetCoreID( void );
|
||||
extern uint8_t ucPortGetCoreID( void );
|
||||
extern uint8_t ucPortGetCoreIDFromIsr( void );
|
||||
#endif /* if !defined(__ASSEMBLER__) */
|
||||
|
||||
#define portSET_INTERRUPT_MASK() uxPortSetInterruptMask()
|
||||
#define portCLEAR_INTERRUPT_MASK( x ) vPortClearInterruptMask( x )
|
||||
|
||||
#define portMAX_CORE_COUNT configNUMBER_OF_CORES
|
||||
#define portGET_CORE_ID() xPortGetCoreID()
|
||||
#define portGET_CORE_ID() ucPortGetCoreID()
|
||||
#define portGET_CORE_ID_FROM_ISR() ucPortGetCoreIDFromIsr()
|
||||
|
||||
/* Use SGI 0 as the yield core interrupt. */
|
||||
#define portYIELD_CORE( xCoreID ) vInterruptCore( portYIELD_CORE_INT_ID, ( uint32_t ) xCoreID )
|
||||
|
|
@ -288,6 +298,242 @@
|
|||
|
||||
#define portMEMORY_BARRIER() __asm volatile ( "" ::: "memory" )
|
||||
|
||||
/**
|
||||
* @brief MPU specific constants.
|
||||
*/
|
||||
#if ( configENABLE_MPU == 1 )
|
||||
|
||||
#if !defined(__ASSEMBLER__)
|
||||
extern BaseType_t xPortIsTaskPrivileged( void );
|
||||
#endif /* if !defined(__ASSEMBLER__) */
|
||||
|
||||
/* Device memory attributes used in MAIR_EL1 registers.
|
||||
*
|
||||
* 8-bit values encoded as follows:
|
||||
* Bit[7:4] - 0000 - Device Memory
|
||||
* Bit[3:2] - 00 --> Device-nGnRnE
|
||||
* 01 --> Device-nGnRE
|
||||
* 10 --> Device-nGRE
|
||||
* 11 --> Device-GRE
|
||||
* Bit[1:0] - 00.
|
||||
*/
|
||||
#define portMPU_DEVICE_MEMORY_nGnRnE ( 0x00 )
|
||||
#define portMPU_DEVICE_MEMORY_nGnRE ( 0x04 )
|
||||
#define portMPU_DEVICE_MEMORY_nGRE ( 0x08 )
|
||||
#define portMPU_DEVICE_MEMORY_GRE ( 0x0C )
|
||||
|
||||
/* MPU settings that can be overridden in FreeRTOSConfig.h. */
|
||||
#ifndef configTOTAL_MPU_REGIONS
|
||||
#define configTOTAL_MPU_REGIONS ( 16UL )
|
||||
#endif
|
||||
|
||||
#define portPRIVILEGED_FLASH_REGION ( 0ULL )
|
||||
#define portUNPRIVILEGED_FLASH_REGION ( 1ULL )
|
||||
#define portUNPRIVILEGED_SYSCALLS_REGION ( 2ULL )
|
||||
#define portPRIVILEGED_RAM_REGION ( 3ULL )
|
||||
#define portSTACK_REGION ( 0ULL )
|
||||
#define portFIRST_CONFIGURABLE_REGION ( 5ULL )
|
||||
#define portLAST_CONFIGURABLE_REGION ( configTOTAL_MPU_REGIONS - 1UL )
|
||||
#define portNUM_CONFIGURABLE_REGIONS ( ( portLAST_CONFIGURABLE_REGION - portFIRST_CONFIGURABLE_REGION ) + 1 )
|
||||
#define portTOTAL_NUM_REGIONS ( portNUM_CONFIGURABLE_REGIONS + 1 ) /* Plus one to make space for the stack region. */
|
||||
|
||||
#if ( configENABLE_ACCESS_CONTROL_LIST == 1 )
|
||||
#define portACL_ENTRY_SIZE_BITS ( 32UL )
|
||||
#endif /* configENABLE_ACCESS_CONTROL_LIST == 1 */
|
||||
|
||||
#if !defined(__ASSEMBLER__)
|
||||
/**
|
||||
* @brief Settings to define an MPU region.
|
||||
*/
|
||||
typedef struct MPURegionSettings
|
||||
{
|
||||
uint64_t ullPrbarEl1; /**< PRBAR_EL1 for the region. */
|
||||
uint64_t ullPrlarEl1; /**< PRLAR_EL1 for the region. */
|
||||
} MPURegionSettings_t;
|
||||
|
||||
#ifndef configSYSTEM_CALL_STACK_SIZE
|
||||
#define configSYSTEM_CALL_STACK_SIZE 128 /* must be defined to the desired size of the system call stack in words for using MPU wrappers v2. */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief System call info.
|
||||
*/
|
||||
typedef struct SYSTEM_CALL_INFO
|
||||
{
|
||||
/* Used to save both the user-mode stack pointer (SP_EL0) and link register (X30)
|
||||
* at system call entry so they can be restored or referenced safely even if the task
|
||||
* switches out while executing the system call.
|
||||
*/
|
||||
uint64_t ullLinkRegisterAtSystemCallEntry;
|
||||
uint64_t ullUserSPAtSystemCallEntry;
|
||||
} xSYSTEM_CALL_INFO;
|
||||
#endif /* if !defined(__ASSEMBLER__) */
|
||||
|
||||
/**
|
||||
* @brief Task context as stored in the TCB.
|
||||
*/
|
||||
#if ( configENABLE_FPU == 1 )
|
||||
/*
|
||||
* +-----------+------------+--------------------------------+-------------+------------------+
|
||||
* | Q0-Q31 | FPSR, FPCR | CRITICAL_NESTING, FPU_CONTEXT | X0-X30, XZR | INIT_PSTATE, PC |
|
||||
* +-----------+------------+--------------------------------+-------------+------------------+
|
||||
*
|
||||
* <-----------><-----------><-------------------------------><------------><----------------->
|
||||
* 64 2 2 32 2
|
||||
*/
|
||||
#define MAX_CONTEXT_SIZE 102
|
||||
|
||||
#else /* #if ( configENABLE_FPU == 1 ) */
|
||||
/*
|
||||
* +--------------------------------+-------------+------------------+
|
||||
* | CRITICAL_NESTING, FPU_CONTEXT | X0-X30, XZR | INIT_PSTATE, PC |
|
||||
* +--------------------------------+-------------+------------------+
|
||||
* <-------------------------------><------------><------------------>
|
||||
* 2 32 2
|
||||
*/
|
||||
#define MAX_CONTEXT_SIZE 36
|
||||
#endif /* #if ( configENABLE_FPU == 1 ) */
|
||||
|
||||
#if !defined(__ASSEMBLER__)
|
||||
typedef struct MPU_SETTINGS
|
||||
{
|
||||
uint64_t ullTaskUnprivilegedSP; /* Task's unprivileged user stack pointer. */
|
||||
uint64_t ullMairEl1; /* MAIR_EL1 for the task containing attributes. */
|
||||
MPURegionSettings_t xRegionsSettings[ portTOTAL_NUM_REGIONS ]; /* Settings for tasks' regions. */
|
||||
uint64_t ullContext[ MAX_CONTEXT_SIZE + configSYSTEM_CALL_STACK_SIZE ]; /* Task's saved context. */
|
||||
uint64_t ullTaskFlags;
|
||||
|
||||
xSYSTEM_CALL_INFO xSystemCallInfo;
|
||||
|
||||
#if ( configENABLE_ACCESS_CONTROL_LIST == 1 )
|
||||
uint32_t ulAccessControlList[ ( configPROTECTED_KERNEL_OBJECT_POOL_SIZE / portACL_ENTRY_SIZE_BITS ) + 1 ];
|
||||
#endif /* configENABLE_ACCESS_CONTROL_LIST */
|
||||
} xMPU_SETTINGS;
|
||||
#endif /* if !defined(__ASSEMBLER__) */
|
||||
|
||||
#define portUSING_MPU_WRAPPERS ( 1 )
|
||||
#define portPRIVILEGE_BIT ( 0x80000000UL )
|
||||
|
||||
/* Normal memory attributes used in MAIR_EL1 registers. */
|
||||
#define portMPU_NORMAL_MEMORY_NON_CACHEABLE ( 0x44 ) /* Non-cacheable. */
|
||||
#define portMPU_NORMAL_MEMORY_BUFFERABLE_CACHEABLE ( 0xFF ) /* Non-Transient, Write-back, Read-Allocate and Write-Allocate. */
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR0_POS ( 0UL )
|
||||
#define portMPU_MAIR_EL1_ATTR0_MASK ( 0x00000000000000ffULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR1_POS ( 8UL )
|
||||
#define portMPU_MAIR_EL1_ATTR1_MASK ( 0x000000000000ff00ULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR2_POS ( 16UL )
|
||||
#define portMPU_MAIR_EL1_ATTR2_MASK ( 0x0000000000ff0000ULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR3_POS ( 24UL )
|
||||
#define portMPU_MAIR_EL1_ATTR3_MASK ( 0x00000000ff000000ULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR4_POS ( 32UL )
|
||||
#define portMPU_MAIR_EL1_ATTR4_MASK ( 0x000000ff00000000ULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR5_POS ( 40UL )
|
||||
#define portMPU_MAIR_EL1_ATTR5_MASK ( 0x0000ff0000000000ULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR6_POS ( 48UL )
|
||||
#define portMPU_MAIR_EL1_ATTR6_MASK ( 0x00ff000000000000ULL )
|
||||
|
||||
#define portMPU_MAIR_EL1_ATTR7_POS ( 56UL )
|
||||
#define portMPU_MAIR_EL1_ATTR7_MASK ( 0xff00000000000000ULL )
|
||||
|
||||
#define portMPU_PRBAR_EL1_ADDRESS_MASK ( 0x0000FFFFFFFFFFC0ULL )
|
||||
#define portMPU_PRLAR_EL1_ADDRESS_MASK ( 0x0000FFFFFFFFFFC0ULL )
|
||||
#define portMPU_PRBAR_EL1_ACCESS_PERMISSIONS_MASK ( 3ULL<< 2ULL )
|
||||
|
||||
#define portMPU_REGION_NON_SHAREABLE ( 0ULL << 4ULL )
|
||||
#define portMPU_REGION_OUTER_SHAREABLE ( 2ULL << 4ULL )
|
||||
#define portMPU_REGION_INNER_SHAREABLE ( 3ULL << 4ULL )
|
||||
|
||||
#define portMPU_REGION_PRIVILEGED_READ_WRITE ( 0ULL << 2ULL )
|
||||
#define portMPU_REGION_READ_WRITE ( 1ULL << 2ULL )
|
||||
#define portMPU_REGION_PRIVILEGED_READ_ONLY ( 2ULL << 2ULL )
|
||||
#define portMPU_REGION_READ_ONLY ( 3ULL << 2ULL )
|
||||
|
||||
#define portMPU_REGION_EXECUTE_NEVER ( 1ULL << 1ULL )
|
||||
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX0 ( 0ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX1 ( 1ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX2 ( 2ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX3 ( 3ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX4 ( 4ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX5 ( 5ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX6 ( 6ULL << 1ULL )
|
||||
#define portMPU_PRLAR_EL1_ATTR_INDEX7 ( 7ULL << 1ULL )
|
||||
|
||||
#define portMPU_PRLAR_EL1_REGION_ENABLE ( 1ULL )
|
||||
|
||||
#define portMPU_ENABLE_BIT ( 1ULL << 0ULL )
|
||||
#define portMPU_PRIV_BACKGROUND_ENABLE_BIT ( 1ULL << 17ULL )
|
||||
|
||||
/* Max value that fits in a uint64_t type. */
|
||||
#define portUINT64_MAX ( ~( ( uint64_t ) 0 ) )
|
||||
#define portADD_UINT64_WILL_OVERFLOW( a, b ) ( ( a ) > ( portUINT64_MAX - ( b ) ) )
|
||||
|
||||
/* Extract first address of the MPU region as encoded in the
|
||||
* PRBAR_EL1 register value. */
|
||||
#define portEXTRACT_FIRST_ADDRESS_FROM_PRBAR_EL1( prbar_el1 ) \
|
||||
( ( prbar_el1 ) & portMPU_PRBAR_EL1_ADDRESS_MASK )
|
||||
|
||||
/* Extract last address of the MPU region as encoded in the
|
||||
* PRLAR_EL1 register value. */
|
||||
#define portEXTRACT_LAST_ADDRESS_FROM_PRLAR_EL1( prlar_el1 ) \
|
||||
( ( ( prlar_el1 ) & portMPU_PRLAR_EL1_ADDRESS_MASK ) | ~portMPU_PRLAR_EL1_ADDRESS_MASK )
|
||||
|
||||
/* Does addr lies within [start, end] address range? */
|
||||
#define portIS_ADDRESS_WITHIN_RANGE( addr, start, end ) \
|
||||
( ( ( addr ) >= ( start ) ) && ( ( addr ) <= ( end ) ) )
|
||||
|
||||
/* Is the access request satisfied by the available permissions? */
|
||||
#define portIS_AUTHORIZED( accessRequest, permissions ) \
|
||||
( ( ( permissions ) & ( accessRequest ) ) == accessRequest )
|
||||
|
||||
/**
|
||||
* @brief Offsets in the task's stack (context).
|
||||
*/
|
||||
#if ( configUSE_TASK_FPU_SUPPORT == portTASK_HAVE_FPU_CONTEXT_BY_DEFAULT )
|
||||
#define portOFFSET_TO_PC ( 68 )
|
||||
#define portOFFSET_TO_LR ( 70 )
|
||||
#define portOFFSET_TO_X0 ( 100 )
|
||||
#define portOFFSET_TO_X1 ( 101 )
|
||||
#define portOFFSET_TO_X2 ( 98 )
|
||||
#define portOFFSET_TO_X3 ( 99 )
|
||||
#else
|
||||
#define portOFFSET_TO_PC ( 2 )
|
||||
#define portOFFSET_TO_LR ( 4 )
|
||||
#define portOFFSET_TO_X0 ( 34 )
|
||||
#define portOFFSET_TO_X1 ( 35 )
|
||||
#define portOFFSET_TO_X2 ( 32 )
|
||||
#define portOFFSET_TO_X3 ( 33 )
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Flag used to mark that a Task is privileged.
|
||||
*
|
||||
* @ingroup Port Privilege
|
||||
*/
|
||||
#define portTASK_IS_PRIVILEGED_FLAG ( 1UL << 1UL )
|
||||
|
||||
/**
|
||||
* @brief Checks whether or not the calling task is privileged.
|
||||
*
|
||||
* @return pdTRUE if the calling task is privileged, pdFALSE otherwise.
|
||||
*/
|
||||
#define portIS_TASK_PRIVILEGED() xPortIsTaskPrivileged()
|
||||
|
||||
#else
|
||||
|
||||
#define portPRIVILEGE_BIT ( 0x0UL )
|
||||
|
||||
#endif /* #if ( configENABLE_MPU == 1 ) */
|
||||
|
||||
#define portPSTATE_I_BIT ( 0x7 )
|
||||
|
||||
/* *INDENT-OFF* */
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue