THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
\r
- Module Name: Synchronization.c\r
-\r
**/\r
\r
+/**\r
+ Performs an atomic compare exchange operation on a 32-bit\r
+ unsigned integer.\r
+\r
+ Performs an atomic compare exchange operation on the 32-bit\r
+ unsigned integer specified by Value. If Value is equal to\r
+ CompareValue, then Value is set to ExchangeValue and\r
+ CompareValue is returned. If Value is not equal to\r
+ CompareValue, then Value is returned. The compare exchange\r
+ operation must be performed using MP safe mechanisms.\r
+\r
+ @param Value A pointer to the 32-bit value for the\r
+ compare exchange 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
((*Value = ExchangeValue), CompareValue);\r
}\r
\r
+/**\r
+ Performs an atomic compare exchange operation on a 64-bit unsigned integer.\r
+\r
+ Performs an atomic compare exchange operation on the 64-bit unsigned integer specified \r
+ by Value. If Value is equal to CompareValue, then Value is set to ExchangeValue and \r
+ CompareValue is returned. If Value is not equal to CompareValue, then Value is returned. \r
+ The compare exchange operation must be performed using MP safe mechanisms.\r
+\r
+ @param Value A pointer to the 64-bit value for the compare exchange\r
+ operation.\r
+ @param CompareValue 64-bit value used in compare operation.\r
+ @param ExchangeValue 64-bit value used in exchange operation.\r
+\r
+ @return The original *Value before exchange.\r
+\r
+**/\r
UINT64\r
EFIAPI\r
InternalSyncCompareExchange64 (\r
((*Value = ExchangeValue), CompareValue);\r
}\r
\r
+/**\r
+ Performs an atomic increment of an 32-bit unsigned integer.\r
+\r
+ Performs an atomic increment of the 32-bit unsigned integer specified by\r
+ Value and returns the incremented value. The increment operation must be\r
+ performed using MP safe mechanisms. The state of the return value is not\r
+ guaranteed to be MP safe.\r
+\r
+ @param Value A pointer to the 32-bit value to increment.\r
+\r
+ @return The incremented value.\r
+\r
+**/\r
UINT32\r
EFIAPI\r
InternalSyncIncrement (\r
return ++*Value;\r
}\r
\r
+/**\r
+ Performs an atomic decrement of an 32-bit unsigned integer.\r
+\r
+ Performs an atomic decrement of the 32-bit unsigned integer specified by\r
+ Value and returns the decrement value. The decrement operation must be\r
+ performed using MP safe mechanisms. The state of the return value is not\r
+ guaranteed to be MP safe.\r
+\r
+ @param Value A pointer to the 32-bit value to decrement.\r
+\r
+ @return The decrement value.\r
+\r
+**/\r
UINT32\r
EFIAPI\r
InternalSyncDecrement (\r