summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Walsh <benjamin.walsh@windriver.com>2016-11-21 12:31:18 -0500
committerAnas Nashif <anas.nashif@intel.com>2016-11-22 19:34:52 -0500
commit6c8409c083b277ef7aec71b214c28c86dced4a33 (patch)
treee621297cca6c60fda4f41d697679d3ada8b90730
parentbf591e9edfeba0cc0a3c03f1334537468074e4dd (diff)
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 <benjamin.walsh@windriver.com>
-rw-r--r--arch/arc/core/reset.S21
1 files changed, 21 insertions, 0 deletions
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