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:
Simon Glass
2023-07-17 17:08:44 +08:00
committed by Bin Meng
parent 633af11dd6
commit 67884002f4
+1 -1
View File
@@ -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