x86: Correct get_sp() implementation for 64-bit
Use an assembler implementation as is done for i386, so that the results are equivalent for i386 and x86_64. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
@@ -258,7 +258,7 @@ static ulong get_sp(void)
|
||||
ulong ret;
|
||||
|
||||
#if CONFIG_IS_ENABLED(X86_64)
|
||||
ret = gd->start_addr_sp;
|
||||
asm("mov %%rsp, %0" : "=r"(ret) : );
|
||||
#else
|
||||
asm("mov %%esp, %0" : "=r"(ret) : );
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user