From 79606bccf025d13dbb30da843e78ff44054d9c97 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Wed, 29 Jun 2016 14:42:09 -0500 Subject: [PATCH] arm: Add support for both floating point ABIs Add a Kconfig option to select between the Hard and Soft Float ABIs. We also default to the Hard Float ABI as this is what older SDK versions supported. JIRA: ZEP-555 Change-Id: I2180c98cd7556ab49f5ca9b46b31add2c11bd07b Signed-off-by: Kumar Gala --- arch/arm/Makefile | 5 +++++ arch/arm/core/Kconfig | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index d45498e1140..b0964e659ce 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile @@ -16,8 +16,13 @@ cflags-cortex-m4 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m4) \ $(call cc-option,-mthumb -march=armv7e-m) ifeq ($(CONFIG_FLOAT), y) +ifeq ($(CONFIG_FP_SOFTABI), y) cflags-cortex-m4 += $(call cc-option,-mfloat-abi=softfp -mfpu=fpv4-sp-d16) endif +ifeq ($(CONFIG_FP_HARDABI), y) +cflags-cortex-m4 += $(call cc-option,-mfloat-abi=hard -mfpu=fpv4-sp-d16) +endif +endif cflags-cortex-m7 = $(call cc-option,-mabi=aapcs -mthumb -mcpu=cortex-m7) \ $(call cc-option,-mthumb -march=armv7e-m) diff --git a/arch/arm/core/Kconfig b/arch/arm/core/Kconfig index 85ee2fe8f24..9f40a24c2a7 100644 --- a/arch/arm/core/Kconfig +++ b/arch/arm/core/Kconfig @@ -62,6 +62,28 @@ config FP_SHARING This option allows multiple tasks and fibers to use the floating point registers. +choice + prompt "Floating point ABI" + default FP_HARDABI + depends on FLOAT + +config FP_HARDABI + bool "Floating point Hard ABI" + depends on FLOAT + help + This option selects the Floating point ABI in which hardware floating + point instructions are generated and uses FPU-specific calling + conventions + +config FP_SOFTABI + bool "Floating point Soft ABI" + depends on FLOAT + help + This option selects the Floating point ABI in which hardware floating + point instructions are generated but soft-float calling conventions. + +endchoice + endmenu if CPU_CORTEX_M