]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/Include: Add volatile to SynchronizationLib parameters
authorMichael Kinney <michael.d.kinney@intel.com>
Thu, 17 Nov 2016 18:57:53 +0000 (10:57 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Fri, 18 Nov 2016 01:08:11 +0000 (17:08 -0800)
The SpinLock functions in the SynchronicationLib use volatile
parameters to keep compiler from optimizing these functions
too much.  The volatile keyword is missing from the Interlocked*()
functions in this same library class.  Update the library class
to consistently use volatile on all functions in this class.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Andrew Fish <afish@apple.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
MdePkg/Include/Library/SynchronizationLib.h

index 7b97683ca0af769af04ed5c90a0d15376bb43ce5..6cf3d71770e7e6fcd4f027ed4fb49a2f0ef6c2a4 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Provides synchronization functions.\r
 \r
 /** @file\r
   Provides synchronization functions.\r
 \r
-Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>\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
 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
@@ -157,7 +157,7 @@ ReleaseSpinLock (
 UINT32\r
 EFIAPI\r
 InterlockedIncrement (\r
 UINT32\r
 EFIAPI\r
 InterlockedIncrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   );\r
 \r
 \r
   );\r
 \r
 \r
@@ -179,7 +179,7 @@ InterlockedIncrement (
 UINT32\r
 EFIAPI\r
 InterlockedDecrement (\r
 UINT32\r
 EFIAPI\r
 InterlockedDecrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   );\r
 \r
 \r
   );\r
 \r
 \r
@@ -204,7 +204,7 @@ InterlockedDecrement (
 UINT16\r
 EFIAPI\r
 InterlockedCompareExchange16 (\r
 UINT16\r
 EFIAPI\r
 InterlockedCompareExchange16 (\r
-  IN OUT  UINT16                    *Value,\r
+  IN OUT  volatile UINT16           *Value,\r
   IN      UINT16                    CompareValue,\r
   IN      UINT16                    ExchangeValue\r
   );\r
   IN      UINT16                    CompareValue,\r
   IN      UINT16                    ExchangeValue\r
   );\r
@@ -231,7 +231,7 @@ InterlockedCompareExchange16 (
 UINT32\r
 EFIAPI\r
 InterlockedCompareExchange32 (\r
 UINT32\r
 EFIAPI\r
 InterlockedCompareExchange32 (\r
-  IN OUT  UINT32                    *Value,\r
+  IN OUT  volatile UINT32           *Value,\r
   IN      UINT32                    CompareValue,\r
   IN      UINT32                    ExchangeValue\r
   );\r
   IN      UINT32                    CompareValue,\r
   IN      UINT32                    ExchangeValue\r
   );\r
@@ -258,7 +258,7 @@ InterlockedCompareExchange32 (
 UINT64\r
 EFIAPI\r
 InterlockedCompareExchange64 (\r
 UINT64\r
 EFIAPI\r
 InterlockedCompareExchange64 (\r
-  IN OUT  UINT64                    *Value,\r
+  IN OUT  volatile UINT64           *Value,\r
   IN      UINT64                    CompareValue,\r
   IN      UINT64                    ExchangeValue\r
   );\r
   IN      UINT64                    CompareValue,\r
   IN      UINT64                    ExchangeValue\r
   );\r
@@ -285,7 +285,7 @@ InterlockedCompareExchange64 (
 VOID *\r
 EFIAPI\r
 InterlockedCompareExchangePointer (\r
 VOID *\r
 EFIAPI\r
 InterlockedCompareExchangePointer (\r
-  IN OUT  VOID                      **Value,\r
+  IN OUT  VOID                      * volatile *Value,\r
   IN      VOID                      *CompareValue,\r
   IN      VOID                      *ExchangeValue\r
   );\r
   IN      VOID                      *CompareValue,\r
   IN      VOID                      *ExchangeValue\r
   );\r