/** @file\r
- Declaration of internal functions in BaseLib.\r
+ Declaration of internal functions in BaseSynchronizationLib.\r
\r
- Copyright (c) 2006 - 2008, Intel Corporation<BR>\r
- All rights reserved. This program and the accompanying materials\r
+ Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
+ 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
- http://opensource.org/licenses/bsd-license.php\r
+ http://opensource.org/licenses/bsd-license.php.\r
\r
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
**/\r
\r
-#ifndef __BASE_LIB_INTERNALS__\r
-#define __BASE_LIB_INTERNALS__\r
+#ifndef __BASE_SYNCHRONIZATION_LIB_INTERNALS__\r
+#define __BASE_SYNCHRONIZATION_LIB_INTERNALS__\r
\r
#include <Base.h>\r
#include <Library/SynchronizationLib.h>\r
);\r
\r
\r
+/**\r
+ Performs an atomic compare exchange operation on a 16-bit unsigned integer.\r
+\r
+ Performs an atomic compare exchange operation on the 16-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 16-bit value for the compare exchange\r
+ operation.\r
+ @param CompareValue A 16-bit value used in compare operation.\r
+ @param ExchangeValue A 16-bit value used in exchange operation.\r
+\r
+ @return The original *Value before exchange.\r
+\r
+**/\r
+UINT16\r
+EFIAPI\r
+InternalSyncCompareExchange16 (\r
+ IN volatile UINT16 *Value,\r
+ IN UINT16 CompareValue,\r
+ IN UINT16 ExchangeValue\r
+ );\r
+\r
+\r
/**\r
Performs an atomic compare exchange operation on a 32-bit unsigned integer.\r
\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
+ @param CompareValue A 32-bit value used in compare operation.\r
+ @param ExchangeValue A 32-bit value used in exchange operation.\r
\r
@return The original *Value before exchange.\r
\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
+ @param CompareValue A 64-bit value used in compare operation.\r
+ @param ExchangeValue A 64-bit value used in exchange operation.\r
\r
@return The original *Value before exchange.\r
\r
IN UINT64 ExchangeValue\r
);\r
\r
+/**\r
+ Internal function to retrieve the architecture specific spin lock alignment\r
+ requirements for optimal spin lock performance.\r
+\r
+ @return The architecture specific spin lock alignment.\r
+ \r
+**/\r
+UINTN\r
+InternalGetSpinLockProperties (\r
+ VOID\r
+ );\r
+\r
#endif\r