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>
This commit is contained in:
parent
0c9268784e
commit
50eb51a745
1 changed files with 21 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue