mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Add ulReadValueAPSR API
This commit is contained in:
parent
886d1fd4ff
commit
d6fff2a530
|
@ -83,10 +83,12 @@
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* Starts the first task executing. This function is necessarily written in
|
||||
* Starts the first task executing. These functions are necessarily written in
|
||||
* assembly code so is implemented in portASM.s.
|
||||
*/
|
||||
extern void vPortRestoreTaskContext( void );
|
||||
extern void vPortInitialiseFPSCR( void );
|
||||
extern uint32_t ulReadValueAPSR( void );
|
||||
|
||||
/*
|
||||
* Used to catch tasks that attempt to return from their implementing function.
|
||||
|
@ -218,7 +220,7 @@ BaseType_t xPortStartScheduler( void )
|
|||
|
||||
/* Only continue if the CPU is not in User mode. The CPU must be in a
|
||||
* Privileged mode for the scheduler to start. */
|
||||
__asm volatile ( "MRS %0, APSR" : "=r" ( ulAPSR )::"memory" );
|
||||
ulAPSR = ulReadValueAPSR();
|
||||
|
||||
ulAPSR &= portAPSR_MODE_BITS_MASK;
|
||||
configASSERT( ulAPSR != portAPSR_USER_MODE );
|
||||
|
@ -312,14 +314,11 @@ void FreeRTOS_Tick_Handler( void )
|
|||
|
||||
void vPortTaskUsesFPU( void )
|
||||
{
|
||||
//uint32_t ulInitialFPSCR = 0;
|
||||
|
||||
/* A task is registering the fact that it needs an FPU context. Set the
|
||||
* FPU flag (which is saved as part of the task context). */
|
||||
ulPortTaskHasFPUContext = pdTRUE;
|
||||
|
||||
/* Initialise the floating point status register. */
|
||||
vPortInitialiseFPSCR();
|
||||
/*__asm volatile ( "FMXR FPSCR, %0" ::"r" ( ulInitialFPSCR ) : "memory" );*/
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
|
@ -48,6 +48,7 @@
|
|||
.global FreeRTOS_SVC_Handler
|
||||
.global vPortRestoreTaskContext
|
||||
.global vPortInitialiseFPSCR
|
||||
.global ulReadValueAPSR
|
||||
|
||||
|
||||
.macro portSAVE_CONTEXT
|
||||
|
@ -162,6 +163,15 @@ vPortInitialiseFPSCR:
|
|||
FMXR FPSCR, R0
|
||||
BX LR
|
||||
|
||||
/******************************************************************************
|
||||
* ulReadValueAPSR is used to read the value of APSR context.
|
||||
*****************************************************************************/
|
||||
.align 4
|
||||
.type ulReadValueAPSR, %function
|
||||
ulReadValueAPSR:
|
||||
MRS R0, APSR
|
||||
BX LR
|
||||
|
||||
.align 4
|
||||
.type FreeRTOS_IRQ_Handler, %function
|
||||
FreeRTOS_IRQ_Handler:
|
||||
|
|
Loading…
Reference in a new issue