From 6c8409c083b277ef7aec71b214c28c86dced4a33 Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Mon, 21 Nov 2016 12:31:18 -0500 Subject: arc: support interrupt/FIRQ stacks with CONFIG_INIT_STACKS Use the main stack during very early boot so that we can call memset on the interrupt and FIRQ stacks. Iniitalize the them before one of them is used for the rest of the pre-kernel initialization. Change-Id: Ib57856a66273dda9382e08fa91da5a54847b77c2 Signed-off-by: Benjamin Walsh --- arch/arc/core/reset.S | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arc/core/reset.S b/arch/arc/core/reset.S index c6c432cc2..03e947185 100644 --- a/arch/arc/core/reset.S +++ b/arch/arc/core/reset.S @@ -30,6 +30,7 @@ GDATA(_interrupt_stack) GDATA(_firq_stack) +GDATA(_main_stack) /* use one of the available interrupt stacks during init */ @@ -72,6 +73,26 @@ SECTION_FUNC(TEXT,__start) /* lock interrupts: will get unlocked when switch to main task */ clri +#ifdef CONFIG_INIT_STACKS + /* + * use the main stack to call memset on the interrupt stack and the + * FIRQ stack when CONFIG_INIT_STACKS is enabled before switching to + * one of them for the rest of the early boot + */ + mov sp, _main_stack + add sp, sp, CONFIG_MAIN_STACK_SIZE + + mov_s r0, _interrupt_stack + mov_s r1, 0xaa + mov_s r2, CONFIG_ISR_STACK_SIZE + jl memset + + mov_s r0, _firq_stack + mov_s r1, 0xaa + mov_s r2, CONFIG_FIRQ_STACK_SIZE + jl memset +#endif + mov sp, INIT_STACK add sp, sp, INIT_STACK_SIZE -- cgit v1.2.3