First Official Release of ARMV8M Support. This release removes Pre-Release from all the ARMv8M files licensees.

This commit is contained in:
Gaurav Aggarwal 2019-02-19 02:30:32 +00:00
parent 58ba10eee8
commit ce576f3683
91 changed files with 19547 additions and 352 deletions

View file

@ -153,13 +153,6 @@ static void prvSetupMPU( void ) PRIVILEGED_FUNCTION;
*/
static uint32_t prvGetMPURegionSizeSetting( uint32_t ulActualSizeInBytes ) PRIVILEGED_FUNCTION;
/*
* Checks to see if being called from the context of an unprivileged task, and
* if so raises the privilege level and returns false - otherwise does nothing
* other than return true.
*/
extern BaseType_t xPortRaisePrivilege( void );
/*
* Setup the timer to generate the tick interrupts. The implementation in this
* file is weak to allow application writers to change the timer used to
@ -192,6 +185,18 @@ void vPortSVCHandler_C( uint32_t *pulParam );
*/
extern void vPortRestoreContextOfFirstTask( void ) PRIVILEGED_FUNCTION;
/**
* @brief Calls the port specific code to raise the privilege.
*
* @return pdFALSE if privilege was raised, pdTRUE otherwise.
*/
extern BaseType_t xPortRaisePrivilege( void );
/**
* @brief If xRunningPrivileged is not pdTRUE, calls the port specific
* code to reset the privilege, otherwise does nothing.
*/
extern void vPortResetPrivilege( BaseType_t xRunningPrivileged );
/*-----------------------------------------------------------*/
/* Each task maintains its own interrupt status in the critical nesting
@ -564,18 +569,6 @@ uint32_t ulRegionSize, ulReturnValue = 4;
}
/*-----------------------------------------------------------*/
void vPortResetPrivilege( BaseType_t xRunningPrivileged )
{
if( xRunningPrivileged != pdTRUE )
{
__asm volatile ( " mrs r0, control \n" \
" orr r0, r0, #1 \n" \
" msr control, r0 \n" \
:::"r0", "memory" );
}
}
/*-----------------------------------------------------------*/
void vPortStoreTaskMPUSettings( xMPU_SETTINGS *xMPUSettings, const struct xMEMORY_REGION * const xRegions, StackType_t *pxBottomOfStack, uint32_t ulStackDepth )
{
extern uint32_t __SRAM_segment_start__[];

View file

@ -39,7 +39,8 @@
PUBLIC vPortStartFirstTask
PUBLIC vPortEnableVFP
PUBLIC vPortRestoreContextOfFirstTask
PUBLIC xPortRaisePrivilege
PUBLIC xIsPrivileged
PUBLIC vResetPrivilege
/*-----------------------------------------------------------*/
@ -114,7 +115,7 @@ vPortSVCHandler:
/*-----------------------------------------------------------*/
vPortStartFirstTask
vPortStartFirstTask:
/* Use the NVIC offset register to locate the stack. */
ldr r0, =0xE000ED08
ldr r0, [r0]
@ -136,7 +137,7 @@ vPortStartFirstTask
/*-----------------------------------------------------------*/
vPortRestoreContextOfFirstTask
vPortRestoreContextOfFirstTask:
/* Use the NVIC offset register to locate the stack. */
ldr r0, =0xE000ED08
ldr r0, [r0]
@ -167,7 +168,7 @@ vPortRestoreContextOfFirstTask
/*-----------------------------------------------------------*/
vPortEnableVFP
vPortEnableVFP:
/* The FPU enable bits are in the CPACR. */
ldr.w r0, =0xE000ED88
ldr r1, [r0]
@ -179,19 +180,20 @@ vPortEnableVFP
/*-----------------------------------------------------------*/
xPortRaisePrivilege
mrs r0, control
/* Is the task running privileged? */
tst r0, #1
itte ne
/* CONTROL[0]!=0, return false. */
movne r0, #0
/* Switch to privileged. */
svcne 2 /* 2 == portSVC_RAISE_PRIVILEGE */
/* CONTROL[0]==0, return true. */
moveq r0, #1
bx lr
xIsPrivileged:
mrs r0, control /* r0 = CONTROL. */
tst r0, #1 /* Perform r0 & 1 (bitwise AND) and update the conditions flag. */
ite ne
movne r0, #0 /* CONTROL[0]!=0. Return false to indicate that the processor is not privileged. */
moveq r0, #1 /* CONTROL[0]==0. Return true to indicate that the processor is privileged. */
bx lr /* Return. */
/*-----------------------------------------------------------*/
vResetPrivilege:
mrs r0, control /* r0 = CONTROL. */
orr r0, r0, #1 /* r0 = r0 | 1. */
msr control, r0 /* CONTROL = r0. */
bx lr /* Return to the caller. */
/*-----------------------------------------------------------*/
END

View file

@ -190,11 +190,28 @@ not necessary for to use this port. They are defined so the common demo files
/* portNOP() is not required by this port. */
#define portNOP()
/*-----------------------------------------------------------*/
extern BaseType_t xIsPrivileged( void );
extern void vResetPrivilege( void );
/* Set the privilege level to user mode if xRunningPrivileged is false. */
void vPortResetPrivilege( BaseType_t xRunningPrivileged );
/**
* @brief Checks whether or not the processor is privileged.
*
* @return 1 if the processor is already privileged, 0 otherwise.
*/
#define portIS_PRIVILEGED() xIsPrivileged()
/**
* @brief Raise an SVC request to raise privilege.
*/
#define portRAISE_PRIVILEGE() __asm volatile ( "svc %0 \n" :: "i" ( portSVC_RAISE_PRIVILEGE ) : "memory" );
/**
* @brief Lowers the privilege level by setting the bit 0 of the CONTROL
* register.
*/
#define portRESET_PRIVILEGE() vResetPrivilege()
/*-----------------------------------------------------------*/
/* Suppress warnings that are generated by the IAR tools, but cannot be fixed in