X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdePkg%2FInclude%2FLibrary%2FSynchronizationLib.h;h=6cf3d71770e7e6fcd4f027ed4fb49a2f0ef6c2a4;hp=f9756973991471e5cd32c7ff745aacc3173f846d;hb=7375f3f11a70e3c7295ef7005f6723ced176ad0a;hpb=744265eb0af7bb4bdc4a00fadb1f68795f3b6894 diff --git a/MdePkg/Include/Library/SynchronizationLib.h b/MdePkg/Include/Library/SynchronizationLib.h index f975697399..6cf3d71770 100644 --- a/MdePkg/Include/Library/SynchronizationLib.h +++ b/MdePkg/Include/Library/SynchronizationLib.h @@ -1,7 +1,7 @@ /** @file Provides synchronization functions. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -157,7 +157,7 @@ ReleaseSpinLock ( UINT32 EFIAPI InterlockedIncrement ( - IN UINT32 *Value + IN volatile UINT32 *Value ); @@ -179,10 +179,36 @@ InterlockedIncrement ( UINT32 EFIAPI InterlockedDecrement ( - IN UINT32 *Value + IN volatile UINT32 *Value ); +/** + Performs an atomic compare exchange operation on a 16-bit unsigned integer. + + Performs an atomic compare exchange operation on the 16-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. + + If Value is NULL, then ASSERT(). + + @param Value A pointer to the 16-bit value for the compare exchange + operation. + @param CompareValue 16-bit value used in compare operation. + @param ExchangeValue 16-bit value used in exchange operation. + + @return The original *Value before exchange. +**/ +UINT16 +EFIAPI +InterlockedCompareExchange16 ( + IN OUT volatile UINT16 *Value, + IN UINT16 CompareValue, + IN UINT16 ExchangeValue + ); + /** Performs an atomic compare exchange operation on a 32-bit unsigned integer. @@ -205,7 +231,7 @@ InterlockedDecrement ( UINT32 EFIAPI InterlockedCompareExchange32 ( - IN OUT UINT32 *Value, + IN OUT volatile UINT32 *Value, IN UINT32 CompareValue, IN UINT32 ExchangeValue ); @@ -232,7 +258,7 @@ InterlockedCompareExchange32 ( UINT64 EFIAPI InterlockedCompareExchange64 ( - IN OUT UINT64 *Value, + IN OUT volatile UINT64 *Value, IN UINT64 CompareValue, IN UINT64 ExchangeValue ); @@ -259,7 +285,7 @@ InterlockedCompareExchange64 ( VOID * EFIAPI InterlockedCompareExchangePointer ( - IN OUT VOID **Value, + IN OUT VOID * volatile *Value, IN VOID *CompareValue, IN VOID *ExchangeValue );