audk/MdePkg/Library/BaseSynchronizationLib/X64
Ruiyu Ni 17634d026f MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1197

Today's InterlockedIncrement()/InterlockedDecrement() guarantees to
perform atomic increment/decrement but doesn't guarantee the return
value equals to the new value.

The patch fixes the behavior to use "XADD" instruction to guarantee
the return value equals to the new value.

The patch calls intrinsic functions for MSVC tool chain, calls the
NASM implementation for INTEL tool chain and calls GCC inline
assembly implementation (GccInline.c) for GCC tool chain.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
2018-09-25 10:02:53 +08:00
..
GccInline.c MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
InterlockedCompareExchange16.c MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIs 2016-11-17 17:08:19 -08:00
InterlockedCompareExchange16.nasm MdePkg/BaseSynchronizationLib: Fix function names in function headers 2016-11-17 17:08:26 -08:00
InterlockedCompareExchange32.c MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIs 2016-11-17 17:08:19 -08:00
InterlockedCompareExchange32.nasm MdePkg/BaseSynchronizationLib: Fix function names in function headers 2016-11-17 17:08:26 -08:00
InterlockedCompareExchange64.c MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIs 2016-11-17 17:08:19 -08:00
InterlockedCompareExchange64.nasm MdePkg/BaseSynchronizationLib: Fix function names in function headers 2016-11-17 17:08:26 -08:00
InterlockedDecrement.nasm MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
InterlockedIncrement.nasm MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00