diff --git a/arch/arm/Makefile b/arch/arm/Makefile index d45498e114..b0964e659c 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 85ee2fe8f2..9f40a24c2a 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