]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseLib/X64/InterlockedCompareExchange32.c
Fix the IN OUT modifier for parameters.
[mirror_edk2.git] / MdePkg / Library / BaseLib / X64 / InterlockedCompareExchange32.c
index c8857dbca528683780d780f84c83538f93001819..6157ac1f4b917dbb3dd5d9bee5ed0ebb4886f355 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange32 function\r
 \r
-  Copyright (c) 2006, Intel Corporation<BR>\r
+  Copyright (c) 2006 - 2007, Intel Corporation<BR>\r
   All rights reserved. This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
 \r
 **/\r
 \r
-#if _MSC_EXTENSIONS\r
+/**\r
+  Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics.\r
+**/\r
 \r
-//\r
-// Microsoft Visual Studio 7.1 Function Prototypes for I/O Intrinsics\r
-//\r
 long _InterlockedCompareExchange(\r
    long volatile * Destination,\r
    long Exchange,\r
@@ -25,6 +24,23 @@ long _InterlockedCompareExchange(
 \r
 #pragma intrinsic(_InterlockedCompareExchange)\r
 \r
+/**\r
+  Performs an atomic compare exchange operation on a 32-bit unsigned integer.\r
+\r
+  Performs an atomic compare exchange operation on the 32-bit unsigned integer\r
+  specified by Value.  If Value is equal to CompareValue, then Value is set to\r
+  ExchangeValue and CompareValue is returned.  If Value is not equal to CompareValue,\r
+  then Value is returned.  The compare exchange operation must be performed using\r
+  MP safe mechanisms.\r
+\r
+  @param  Value         A pointer to the 32-bit value for the compare exchange\r
+                        operation.\r
+  @param  CompareValue  32-bit value used in compare operation.\r
+  @param  ExchangeValue 32-bit value used in exchange operation.\r
+\r
+  @return The original *Value before exchange.\r
+\r
+**/\r
 UINT32\r
 EFIAPI\r
 InternalSyncCompareExchange32 (\r
@@ -36,5 +52,3 @@ InternalSyncCompareExchange32 (
   return _InterlockedCompareExchange (Value, ExchangeValue, CompareValue);\r
 }\r
 \r
-\r
-#endif\r