mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-20 22:21:41 +00:00
armv8: fix gd after relocation
Commit 21f4486faa
("armv8: update gd after relocate") sets x18
without checking the return value of spl_relocate_stack_gd().
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: York Sun <york.sun@nxp.com>
CC: Kever Yang <kever.yang@rock-chips.com>
CC: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:
parent
1d0f30a8e0
commit
e421b646fc
1 changed files with 3 additions and 2 deletions
|
@ -120,8 +120,9 @@ relocation_return:
|
||||||
#endif /* !CONFIG_SPL_BUILD */
|
#endif /* !CONFIG_SPL_BUILD */
|
||||||
#if defined(CONFIG_SPL_BUILD)
|
#if defined(CONFIG_SPL_BUILD)
|
||||||
bl spl_relocate_stack_gd /* may return NULL */
|
bl spl_relocate_stack_gd /* may return NULL */
|
||||||
/* set up gd here, outside any C code */
|
/* set up gd here, outside any C code, if new stack is returned */
|
||||||
mov x18, x0
|
cmp x0, #0
|
||||||
|
csel x18, x0, x18, ne
|
||||||
/*
|
/*
|
||||||
* Perform 'sp = (x0 != NULL) ? x0 : sp' while working
|
* Perform 'sp = (x0 != NULL) ? x0 : sp' while working
|
||||||
* around the constraint that conditional moves can not
|
* around the constraint that conditional moves can not
|
||||||
|
|
Loading…
Add table
Reference in a new issue