From 31e8030c055d9dd46b9871b37ce770d59f4a23f2 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Mon, 9 May 2016 16:56:35 -0700 Subject: [PATCH] nios2: set initial stack pointer to the interrupt stack Change-Id: I5a71215dde9e7fdc7d5d9de5297f5f493de40ca8 Signed-off-by: Andrew Boie --- arch/nios2/core/crt0.S | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/nios2/core/crt0.S b/arch/nios2/core/crt0.S index 0510d1bde0d..2ee23a2f785 100644 --- a/arch/nios2/core/crt0.S +++ b/arch/nios2/core/crt0.S @@ -62,9 +62,13 @@ SECTION_FUNC(TEXT, __text_start) * ZEP-275 */ - /* Set up the initial stack pointer - * ZEP-269 - */ + /* Set up the initial stack pointer to the interrupt stack, safe + * to use this as the CPU boots up with interrupts disabled and we + * don't turn them on until much later, when the kernel is on + * the main stack */ + movhi sp, %hi(_interrupt_stack) + ori sp, sp, %lo(_interrupt_stack) + addi sp, sp, CONFIG_ISR_STACK_SIZE /* TODO Setup the global pointer * ZEP-272