From 4ac44e2a3d9a22942a8c43a736dceff669073e27 Mon Sep 17 00:00:00 2001 From: Paul Bartell Date: Fri, 25 Nov 2022 12:24:09 -0800 Subject: [PATCH] Address review comments from @ChristosZosi --- portable/GCC/ARM_CR5/port.c | 9 +++++++++ portable/GCC/ARM_CR5/portmacro.h | 3 ++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/portable/GCC/ARM_CR5/port.c b/portable/GCC/ARM_CR5/port.c index ec019196c19..d5595f2aa35 100644 --- a/portable/GCC/ARM_CR5/port.c +++ b/portable/GCC/ARM_CR5/port.c @@ -74,6 +74,15 @@ #error configMAX_API_CALL_INTERRUPT_PRIORITY must be greater than ( configUNIQUE_INTERRUPT_PRIORITIES / 2 ) #endif +/* + * __ARM_FP is defined by the c preprocessor when FPU support is enabled, + * ususally with the -mfpu= argument and mfloat-abi=. + * + * Note: Some implementations of the c standard library may use FPU registers + * for generic memory operations (memcpy, etc). + * When setting configUSE_TASK_FPU_SUPPORT == 1, care must be taken to + * ensure that the FPU registers are not used without an FPU context. + */ #if configUSE_TASK_FPU_SUPPORT == 0 #ifdef __ARM_FP #error __ARM_FP is defined, so configUSE_TASK_FPU_SUPPORT must be set to either to 1 or 2. diff --git a/portable/GCC/ARM_CR5/portmacro.h b/portable/GCC/ARM_CR5/portmacro.h index f5744e57c57..ff7337d1502 100644 --- a/portable/GCC/ARM_CR5/portmacro.h +++ b/portable/GCC/ARM_CR5/portmacro.h @@ -132,6 +132,7 @@ void FreeRTOS_Tick_Handler( void ); */ #if ( configUSE_TASK_FPU_SUPPORT == 1 ) void vPortTaskUsesFPU( void ); + #define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU() #elif ( configUSE_TASK_FPU_SUPPORT == 2 ) /* @@ -139,8 +140,8 @@ void FreeRTOS_Tick_Handler( void ); * prevent it being called accidentally. */ #define vPortTaskUsesFPU() + #define portTASK_USES_FLOATING_POINT() #endif /* configUSE_TASK_FPU_SUPPORT */ -#define portTASK_USES_FLOATING_POINT() vPortTaskUsesFPU() #define portLOWEST_INTERRUPT_PRIORITY ( ( ( uint32_t ) configUNIQUE_INTERRUPT_PRIORITIES ) - 1UL ) #define portLOWEST_USABLE_INTERRUPT_PRIORITY ( portLOWEST_INTERRUPT_PRIORITY - 1UL )