audk/MdePkg/Library/BaseSynchronizationLib
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
..
AArch64 MdePkg/Library/BaseSynchronizationLib: Enable VS2017/ARM64 builds 2018-04-17 14:54:28 +08:00
Arm MdePkg: BaseSynchronizationLib: fix Increment/Decrement retvals for ARM 2015-03-20 12:17:02 +00:00
Ebc MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
Ia32 MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
Ipf MdePkg: Clean up source files 2018-06-28 11:19:47 +08:00
X64 MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
BaseSynchronizationLib.inf MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
BaseSynchronizationLib.uni MdePkg: Convert all .uni files to utf-8 2015-12-15 04:53:50 +00:00
BaseSynchronizationLibInternals.h MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
InterlockedDecrementMsc.c MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
InterlockedIncrementMsc.c MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
Synchronization.c MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
SynchronizationGcc.c MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00
SynchronizationMsc.c MdePkg/SynchronizationLib: fix Interlocked[De|In]crement return value 2018-09-25 10:02:53 +08:00