From: Satoshi Tanda Date: Mon, 24 May 2021 04:50:18 +0000 (+0800) Subject: MdePkg/BaseLib: Fix AsmReadSs() with GCC toolchain X-Git-Tag: edk2-stable202108~250 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=c410ad4da4b7785170d3d42a3ba190c2caac6feb MdePkg/BaseLib: Fix AsmReadSs() with GCC toolchain REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3405 AsmReadSs() in Ia32/GccInlinePriv.c and X64/GccInlinePriv.c return the DS segment selector value instead of SS. Signed-off-by: Satoshi Tanda Reviewed-by: Liming Gao Reviewed-by: Laszlo Ersek --- diff --git a/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c b/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c index 40e8c08beb..b8b5b85e73 100644 --- a/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c +++ b/MdePkg/Library/BaseLib/Ia32/GccInlinePriv.c @@ -902,7 +902,7 @@ AsmReadSs ( UINT16 Data; __asm__ __volatile__ ( - "mov %%ds, %0" + "mov %%ss, %0" :"=a" (Data) ); diff --git a/MdePkg/Library/BaseLib/X64/GccInlinePriv.c b/MdePkg/Library/BaseLib/X64/GccInlinePriv.c index 244bd62ee6..c3feb9f922 100644 --- a/MdePkg/Library/BaseLib/X64/GccInlinePriv.c +++ b/MdePkg/Library/BaseLib/X64/GccInlinePriv.c @@ -911,7 +911,7 @@ AsmReadSs ( UINT16 Data; __asm__ __volatile__ ( - "mov %%ds, %0" + "mov %%ss, %0" :"=a" (Data) );