arch: riscv: fill all IRQ stacks with 0xAA
Fill the memory of all CPU's IRQ stack with 0xAA on init, so that `z_stack_space_get` can calculate the remaining space correctly. Signed-off-by: Nicolas Pitre <npitre@baylibre.com> Signed-off-by: Yong Cong Sin <ycsin@meta.com> Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
parent
0726198776
commit
035c822253
2 changed files with 4 additions and 2 deletions
|
@ -62,7 +62,8 @@ boot_first_core:
|
||||||
#ifdef CONFIG_INIT_STACKS
|
#ifdef CONFIG_INIT_STACKS
|
||||||
/* Pre-populate all bytes in z_interrupt_stacks with 0xAA */
|
/* Pre-populate all bytes in z_interrupt_stacks with 0xAA */
|
||||||
la t0, z_interrupt_stacks
|
la t0, z_interrupt_stacks
|
||||||
li t1, __z_interrupt_stack_SIZEOF
|
/* Total size of all cores' IRQ stack */
|
||||||
|
li t1, __z_interrupt_all_stacks_SIZEOF
|
||||||
add t1, t1, t0
|
add t1, t1, t0
|
||||||
|
|
||||||
/* Populate z_interrupt_stacks with 0xaaaaaaaa */
|
/* Populate z_interrupt_stacks with 0xaaaaaaaa */
|
||||||
|
@ -71,7 +72,7 @@ aa_loop:
|
||||||
sw t2, 0x00(t0)
|
sw t2, 0x00(t0)
|
||||||
addi t0, t0, 4
|
addi t0, t0, 4
|
||||||
blt t0, t1, aa_loop
|
blt t0, t1, aa_loop
|
||||||
#endif
|
#endif /* CONFIG_INIT_STACKS */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initially, setup stack pointer to
|
* Initially, setup stack pointer to
|
||||||
|
|
|
@ -71,6 +71,7 @@ GEN_OFFSET_SYM(_thread_t, tls);
|
||||||
#endif /* CONFIG_THREAD_LOCAL_STORAGE */
|
#endif /* CONFIG_THREAD_LOCAL_STORAGE */
|
||||||
|
|
||||||
GEN_ABSOLUTE_SYM(__z_interrupt_stack_SIZEOF, sizeof(z_interrupt_stacks[0]));
|
GEN_ABSOLUTE_SYM(__z_interrupt_stack_SIZEOF, sizeof(z_interrupt_stacks[0]));
|
||||||
|
GEN_ABSOLUTE_SYM(__z_interrupt_all_stacks_SIZEOF, sizeof(z_interrupt_stacks));
|
||||||
|
|
||||||
/* member offsets in the device structure. Used in image post-processing */
|
/* member offsets in the device structure. Used in image post-processing */
|
||||||
#ifdef CONFIG_DEVICE_DEPS
|
#ifdef CONFIG_DEVICE_DEPS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue