summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c')
-rw-r--r--MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
index 4a9fe6aca6..de1aac7e6a 100644
--- a/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
+++ b/MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
@@ -12,9 +12,9 @@
**/
-//
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics
-//
+/**
+ Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.
+**/
long _InterlockedCompareExchange(
long volatile * Destination,
long Exchange,
@@ -23,6 +23,23 @@ long _InterlockedCompareExchange(
#pragma intrinsic(_InterlockedCompareExchange)
+/**
+ Performs an atomic compare exchange operation on a 32-bit unsigned integer.
+
+ Performs an atomic compare exchange operation on the 32-bit unsigned integer
+ specified by Value. If Value is equal to CompareValue, then Value is set to
+ ExchangeValue and CompareValue is returned. If Value is not equal to CompareValue,
+ then Value is returned. The compare exchange operation must be performed using
+ MP safe mechanisms.
+
+ @param Value A pointer to the 32-bit value for the compare exchange
+ operation.
+ @param CompareValue 32-bit value used in compare operation.
+ @param ExchangeValue 32-bit value used in exchange operation.
+
+ @return The original *Value before exchange.
+
+**/
UINT32
EFIAPI
InternalSyncCompareExchange32 (