arch: armv8-m: Refactor interrupt stack related code

Summary:
- Apply the same logic for armv7-m
- NOTE: stack pointer alignment is 8-byte

Impact:
- Affects armv8-m with interrupt stack enabled

Testing:
- Not tested but should work

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
Masayuki Ishikawa 2020-10-22 15:20:39 +09:00 committed by David Sidrane
parent d553515758
commit 0b73eec5cd
3 changed files with 5 additions and 5 deletions

View File

@ -244,7 +244,7 @@ static void up_dumpstate(void)
* stack?
*/
if (sp <= istackbase && sp > istackbase - istacksize)
if (sp < istackbase && sp > istackbase - istacksize)
{
/* Yes.. dump the interrupt stack */

View File

@ -67,7 +67,7 @@
* no privileged task has run.
*/
# if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 4
# if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 8
# error Interrupt stack must be used with high priority interrupts in kernel mode
# endif
@ -355,7 +355,7 @@ exception_common:
.bss
.global g_intstackalloc
.global g_intstackbase
.align 8
.balign 8
g_intstackalloc:
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase:

View File

@ -50,7 +50,7 @@
* nested interrupt, the interrupt stack if no privileged task has run.
*/
# if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 4
# if defined(CONFIG_BUILD_PROTECTED) && CONFIG_ARCH_INTERRUPTSTACK < 8
# error Interrupt stack must be used with high priority interrupts in kernel mode
# endif
@ -373,7 +373,7 @@ exception_common:
.bss
.global g_intstackalloc
.global g_intstackbase
.align 8
.balign 8
g_intstackalloc:
.skip ((CONFIG_ARCH_INTERRUPTSTACK + 4) & ~7)
g_intstackbase: