To get correct stack walking and backtrace functionality in gdb,
registers fp and ra should be initialized before calling board_init_f
or board_init_r. Thus allocating stack space and zeroing it as it is
currently done in board.c becomes obsolete.
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
/* Set up temporary stack */
li sp, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
/* Set up temporary stack */
li sp, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
la t9, board_init_f
jr t9
la t9, board_init_f
jr t9
/*
* void relocate_code (addr_sp, gd, addr_moni)
/*
* void relocate_code (addr_sp, gd, addr_moni)
.ent relocate_code
relocate_code:
move sp, a0 # set new stack pointer
.ent relocate_code
relocate_code:
move sp, a0 # set new stack pointer
move s0, a1 # save gd in s0
move s2, a2 # save destination address in s2
move s0, a1 # save gd in s0
move s2, a2 # save destination address in s2
addi t1, 4
move a0, s0 # a0 <-- gd
addi t1, 4
move a0, s0 # a0 <-- gd
la t9, board_init_r
jr t9
la t9, board_init_r
jr t9
/* Set up temporary stack */
dli sp, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
/* Set up temporary stack */
dli sp, CONFIG_SYS_SDRAM_BASE + CONFIG_SYS_INIT_SP_OFFSET
dla t9, board_init_f
jr t9
dla t9, board_init_f
jr t9
/*
* void relocate_code (addr_sp, gd, addr_moni)
/*
* void relocate_code (addr_sp, gd, addr_moni)
.ent relocate_code
relocate_code:
move sp, a0 # set new stack pointer
.ent relocate_code
relocate_code:
move sp, a0 # set new stack pointer
move s0, a1 # save gd in s0
move s2, a2 # save destination address in s2
move s0, a1 # save gd in s0
move s2, a2 # save destination address in s2
daddi t1, 8
move a0, s0 # a0 <-- gd
daddi t1, 8
move a0, s0 # a0 <-- gd
dla t9, board_init_r
jr t9
dla t9, board_init_r
jr t9