83
83
/*-----------------------------------------------------------*/
84
84
85
85
/*
86
- * Starts the first task executing. This function is necessarily written in
86
+ * Starts the first task executing. These functions are necessarily written in
87
87
* assembly code so is implemented in portASM.s.
88
88
*/
89
89
extern void vPortRestoreTaskContext ( void );
90
+ extern void vPortInitialiseFPSCR ( void );
91
+ extern uint32_t ulReadValueAPSR ( void );
90
92
91
93
/*
92
94
* Used to catch tasks that attempt to return from their implementing function.
@@ -218,7 +220,7 @@ BaseType_t xPortStartScheduler( void )
218
220
219
221
/* Only continue if the CPU is not in User mode. The CPU must be in a
220
222
* Privileged mode for the scheduler to start. */
221
- __asm volatile ( "MRS %0, APSR" : "=r" ( ulAPSR ):: "memory" );
223
+ ulAPSR = ulReadValueAPSR ( );
222
224
223
225
ulAPSR &= portAPSR_MODE_BITS_MASK ;
224
226
configASSERT ( ulAPSR != portAPSR_USER_MODE );
@@ -312,14 +314,11 @@ void FreeRTOS_Tick_Handler( void )
312
314
313
315
void vPortTaskUsesFPU ( void )
314
316
{
315
- //uint32_t ulInitialFPSCR = 0;
316
-
317
317
/* A task is registering the fact that it needs an FPU context. Set the
318
318
* FPU flag (which is saved as part of the task context). */
319
319
ulPortTaskHasFPUContext = pdTRUE ;
320
320
321
321
/* Initialise the floating point status register. */
322
322
vPortInitialiseFPSCR ();
323
- /*__asm volatile ( "FMXR FPSCR, %0" ::"r" ( ulInitialFPSCR ) : "memory" );*/
324
323
}
325
324
/*-----------------------------------------------------------*/
0 commit comments