From 81bef6cccfd903034eab74077584b1b7bdfdfe59 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 26 Jan 2019 07:21:18 -0600 Subject: [PATCH] arch/Kconfig and arm/src/armv7-m/Kconfig: ARCH_HIPRI_INTERRUPT shouldn't select ARMV7M_USEBASEPRI. First because that is a violation of the layered nature of the Kconfig architecture, but also because then Kconfig will generated errors when high priority interrupts are used with other architectures. --- arch/Kconfig | 1 - arch/arm/src/armv7-m/Kconfig | 9 ++++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/arch/Kconfig b/arch/Kconfig index bd49cb6cf9..efa78f5a16 100644 --- a/arch/Kconfig +++ b/arch/Kconfig @@ -796,7 +796,6 @@ config ARCH_HIPRI_INTERRUPT bool "High priority interrupts" default n depends on ARCH_HAVE_HIPRI_INTERRUPT && ARCH_HAVE_IRQPRIO - select ARMV7M_USEBASEPRI select ARCH_IRQPRIO ---help--- NOTE: This description is currently unique to the Cortex-M family diff --git a/arch/arm/src/armv7-m/Kconfig b/arch/arm/src/armv7-m/Kconfig index a533b8d232..703c59bf3c 100644 --- a/arch/arm/src/armv7-m/Kconfig +++ b/arch/arm/src/armv7-m/Kconfig @@ -49,7 +49,7 @@ config ARMV7M_LAZYFPU config ARMV7M_USEBASEPRI bool "Use BASEPRI Register" - default n + default y if ARCH_HIPRI_INTERRUPT depends on ARCH_CORTEXM3 || ARCH_CORTEXM4 || ARCH_CORTEXM7 ---help--- Use the BASEPRI register to enable and disable interrupts. By @@ -60,6 +60,13 @@ config ARMV7M_USEBASEPRI register, these hardfaults, will be avoided. For more details see http://www.nuttx.org/doku.php?id=wiki:nxinternal:svcall + WARNING: If CONFIG_ARCH_HIPRI_INTERRUPT is selected, then you + MUST select CONFIG_ARMV7M_USEBASEPRI. The Kconfig dependencies + here will permit to select an invalid configuration because it + cannot enforce that requirement. If you create this invalild + configuration, you will encounter some problems that may be + very difficult to debug. + config ARMV7M_BASEPRI_WAR bool "Cortex-M7 r0p1 Errata 837070 Workaround" default n