Skip to content

Commit d37b605

Browse files
committed
First update of vPortTaskUsesFPU API
1 parent 0452603 commit d37b605

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

portable/GCC/ARM_CRx_No_GIC/port.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,14 @@ void FreeRTOS_Tick_Handler( void )
312312

313313
void vPortTaskUsesFPU( void )
314314
{
315-
uint32_t ulInitialFPSCR = 0;
315+
//uint32_t ulInitialFPSCR = 0;
316316

317317
/* A task is registering the fact that it needs an FPU context. Set the
318318
* FPU flag (which is saved as part of the task context). */
319319
ulPortTaskHasFPUContext = pdTRUE;
320320

321321
/* Initialise the floating point status register. */
322-
__asm volatile ( "FMXR FPSCR, %0" ::"r" ( ulInitialFPSCR ) : "memory" );
322+
vSetupFPU();
323+
/*__asm volatile ( "FMXR FPSCR, %0" ::"r" ( ulInitialFPSCR ) : "memory" );*/
323324
}
324-
/*-----------------------------------------------------------*/
325+
/*-----------------------------------------------------------*/

portable/GCC/ARM_CRx_No_GIC/portASM.S

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,15 @@ vPortRestoreTaskContext:
149149
/* Switch to system mode. */
150150
CPS #SYS_MODE
151151
portRESTORE_CONTEXT
152+
153+
.align 4
154+
.type vSetupFPU, %function
155+
vSetupFPU:
156+
PUSH { R0 }
157+
MOV R0, #0x0
158+
FMXR FPSCR, R0
159+
POP { R0 }
160+
BX LR
152161

153162
.align 4
154163
.type FreeRTOS_IRQ_Handler, %function

0 commit comments

Comments
 (0)