From 3c4bf1a2bf0b19e1b460d92b3511a07fe9eff95f Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Thu, 22 Oct 2020 15:46:31 +0900 Subject: [PATCH] arch: armv6-m: Refactor interrupt stack related code Summary: - Apply the same logic for armv7-m - NOTE: stack pointer alignment is 4-byte Impact: - Affects armv6-m with interrupt stack enabled Testing: - Built with freedom-kl25z:nsh (CONFIG_ARCH_INTERRUPTSTACK=2048) - Not tested but should work Signed-off-by: Masayuki Ishikawa --- arch/arm/src/armv6-m/arm_assert.c | 2 +- arch/arm/src/armv6-m/arm_exception.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/src/armv6-m/arm_assert.c b/arch/arm/src/armv6-m/arm_assert.c index 382a039a39..11c97ba1e7 100644 --- a/arch/arm/src/armv6-m/arm_assert.c +++ b/arch/arm/src/armv6-m/arm_assert.c @@ -247,7 +247,7 @@ static void up_dumpstate(void) * stack? */ - if (sp <= istackbase && sp > istackbase - istacksize) + if (sp < istackbase && sp > istackbase - istacksize) { /* Yes.. dump the interrupt stack */ diff --git a/arch/arm/src/armv6-m/arm_exception.S b/arch/arm/src/armv6-m/arm_exception.S index c70c57a2eb..ecc6c04df2 100644 --- a/arch/arm/src/armv6-m/arm_exception.S +++ b/arch/arm/src/armv6-m/arm_exception.S @@ -270,7 +270,7 @@ exception_common: .bss .global g_intstackalloc .global g_intstackbase - .align 4 + .balign 4 g_intstackalloc: .skip (CONFIG_ARCH_INTERRUPTSTACK & ~3) g_intstackbase: