]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLibInternals.h
MdePkg/Library/BaseStackCheckLib: Add Null handler for VS2017/ARM
[mirror_edk2.git] / MdePkg / Library / BaseSynchronizationLib / BaseSynchronizationLibInternals.h
index 9f05d06cfbcd4b1d6519a0376c2e59c901e96a4b..9716b9276b4430f52049bc281b5f537c73b3cd09 100644 (file)
@@ -1,19 +1,19 @@
 /** @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
@@ -62,6 +62,32 @@ InternalSyncDecrement (
   );\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
@@ -73,8 +99,8 @@ InternalSyncDecrement (
 \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  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
@@ -98,8 +124,8 @@ InternalSyncCompareExchange32 (
 \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  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
@@ -112,4 +138,16 @@ InternalSyncCompareExchange64 (
   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