summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseSynchronizationLib
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2018-09-29 23:13:47 +0200
committerLaszlo Ersek <lersek@redhat.com>2018-10-17 18:44:51 +0200
commit3a0329bed2a2c7d1ba45bd2376a2320141ef2bec (patch)
treea403aa16e5143b4cbcd4d19ff4c848b0270fc779 /MdePkg/Library/BaseSynchronizationLib
parente5d4e7500fc92475d079d16846671ecbbb08e8af (diff)
downloadedk2-3a0329bed2a2c7d1ba45bd2376a2320141ef2bec.tar.gz
edk2-3a0329bed2a2c7d1ba45bd2376a2320141ef2bec.tar.bz2
edk2-3a0329bed2a2c7d1ba45bd2376a2320141ef2bec.zip
MdePkg/BaseSynchronizationLib GCC: simplify IA32 InternalSyncCompareExchange64()
The IA32 variant of InternalSyncCompareExchange64() is correct, but we can simplify it. We don't need to load the lower 32 bits of ExchangeValue into EBX in two steps (first into a general register, then into EBX); we can ask GCC to populate EBX like that itself. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1208 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg/Library/BaseSynchronizationLib')
-rw-r--r--MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
index 44188e265a..af39bdeb51 100644
--- a/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
+++ b/MdePkg/Library/BaseSynchronizationLib/Ia32/GccInline.c
@@ -193,14 +193,11 @@ InternalSyncCompareExchange64 (
)
{
__asm__ __volatile__ (
- "push %%ebx \n\t"
- "movl %2,%%ebx \n\t"
"lock \n\t"
"cmpxchg8b (%1) \n\t"
- "pop %%ebx \n\t"
: "+A" (CompareValue) // %0
: "S" (Value), // %1
- "r" ((UINT32) ExchangeValue), // %2
+ "b" ((UINT32) ExchangeValue), // %2
"c" ((UINT32) (ExchangeValue >> 32)) // %3
: "memory",
"cc"