]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIs
authorMichael Kinney <michael.d.kinney@intel.com>
Wed, 16 Nov 2016 22:37:15 +0000 (14:37 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Fri, 18 Nov 2016 01:08:19 +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 instance.  Update the library instance
to consistently use volatile on all functions in the
SynchronizationLib 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>
33 files changed:
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange16.asm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange16.c
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange16.nasm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.asm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.c
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange32.nasm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.asm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.c
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedCompareExchange64.nasm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.asm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.c
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedDecrement.nasm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.asm
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.c
MdePkg/Library/BaseSynchronizationLib/Ia32/InterlockedIncrement.nasm
MdePkg/Library/BaseSynchronizationLib/Synchronization.c
MdePkg/Library/BaseSynchronizationLib/SynchronizationGcc.c
MdePkg/Library/BaseSynchronizationLib/SynchronizationMsc.c
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.asm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.c
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange16.nasm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.asm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.c
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange32.nasm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.asm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.c
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedCompareExchange64.nasm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.asm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.c
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedDecrement.nasm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.asm
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.c
MdePkg/Library/BaseSynchronizationLib/X64/InterlockedIncrement.nasm

index 92a0f49bc0909c75699bfd6d9818e394c783a3cb..7362fe9960246542cbacc879cab5a8d82e4e7b15 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 ; Copyright (c) 2015, Linaro Ltd. 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
@@ -30,7 +30,7 @@
 ; UINT16\r
 ; EFIAPI\r
 ; InternalSyncCompareExchange16 (\r
-;   IN      UINT16                    *Value,\r
+;   IN      volatile UINT16           *Value,\r
 ;   IN      UINT16                    CompareValue,\r
 ;   IN      UINT16                    ExchangeValue\r
 ;   );\r
index 3d5213743e5dca0f0e4d1e665a5ebbcb6b52f0e7..0c3a4f621bcf6971acb908944490848088ab367d 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange16 function\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2015, Linaro Ltd. 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
@@ -36,7 +36,7 @@
 UINT16\r
 EFIAPI\r
 InternalSyncCompareExchange16 (\r
-  IN      UINT16                    *Value,\r
+  IN      volatile UINT16           *Value,\r
   IN      UINT16                    CompareValue,\r
   IN      UINT16                    ExchangeValue\r
   )\r
index 8cabe66ddfa495619efb9909bb471b36cd29a1ae..7fbfd7519e901a19cf5ba408a75a48203826b7dc 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 ; Copyright (c) 2015, Linaro Ltd. 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
@@ -28,7 +28,7 @@
 ; UINT16\r
 ; EFIAPI\r
 ; InternalSyncCompareExchange16 (\r
-;   IN      UINT16                    *Value,\r
+;   IN      volatile UINT16           *Value,\r
 ;   IN      UINT16                    CompareValue,\r
 ;   IN      UINT16                    ExchangeValue\r
 ;   );\r
index 78ea72c5c4e94ca909353f54828a0611ae4367a6..1a4a611cc9807878c29735e0e0ae9c22f9677cb5 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -29,7 +29,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InternalSyncCompareExchange32 (\r
-;   IN      UINT32                    *Value,\r
+;   IN      volatile UINT32           *Value,\r
 ;   IN      UINT32                    CompareValue,\r
 ;   IN      UINT32                    ExchangeValue\r
 ;   );\r
index a2c683897046ed69cd91396eeeaac6da6677e1df..cf80ddef55787815cf2567b27abb3efcfaaf5859 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange32 function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -35,7 +35,7 @@
 UINT32\r
 EFIAPI\r
 InternalSyncCompareExchange32 (\r
-  IN      UINT32                    *Value,\r
+  IN      volatile UINT32           *Value,\r
   IN      UINT32                    CompareValue,\r
   IN      UINT32                    ExchangeValue\r
   )\r
index 539327312bed1713c746589120a8a4cb9780351d..9064c659168ad4a12659de2d7dcdd2198e126c16 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InternalSyncCompareExchange32 (\r
-;   IN      UINT32                    *Value,\r
+;   IN      volatile UINT32           *Value,\r
 ;   IN      UINT32                    CompareValue,\r
 ;   IN      UINT32                    ExchangeValue\r
 ;   );\r
index 0fcbd230ee200479c6de2974a19c91b1ae4f4d1f..e7b02dbf0c1414f4d11a84b8a487cd5aa2cc9316 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -29,7 +29,7 @@
 ; UINT64\r
 ; EFIAPI\r
 ; InternalSyncCompareExchange64 (\r
-;   IN      UINT64                    *Value,\r
+;   IN      volatile UINT64           *Value,\r
 ;   IN      UINT64                    CompareValue,\r
 ;   IN      UINT64                    ExchangeValue\r
 ;   );\r
index 73af6ef91a338f36adfc2a117a5b20678308d914..0bdbd791ecb16835a100988bc654d1f40e34b104 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange64 function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -34,7 +34,7 @@
 UINT64\r
 EFIAPI\r
 InternalSyncCompareExchange64 (\r
-  IN      UINT64                    *Value,\r
+  IN      volatile UINT64           *Value,\r
   IN      UINT64                    CompareValue,\r
   IN      UINT64                    ExchangeValue\r
   )\r
index 206de407aed62438ae1882b31d4547b77ef21080..c5c3e124593485e197c885e66d451d27ec3d6d84 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT64\r
 ; EFIAPI\r
 ; InternalSyncCompareExchange64 (\r
-;   IN      UINT64                    *Value,\r
+;   IN      volatile UINT64           *Value,\r
 ;   IN      UINT64                    CompareValue,\r
 ;   IN      UINT64                    ExchangeValue\r
 ;   );\r
index 22cb0b2d3874347e049966f6fe320709358ed2c3..b5fa44796f43984e1f03c0996d8cab19c12a012b 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -29,7 +29,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InternalSyncDecrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 InternalSyncDecrement   PROC\r
index 7f18e0b6b78bc8080b094b2fef8c8782881d2fa6..354a0e7ab1430b97bde097c29e3937c9841c00ff 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedDecrement function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -31,7 +31,7 @@
 UINT32\r
 EFIAPI\r
 InternalSyncDecrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   _asm {\r
index a7414bee7ac8294b78862d8724cec31bf0daee26..4c460411867d37e0dd5339c24b30fb9270bd4b56 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InternalSyncDecrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 global ASM_PFX(InternalSyncDecrement)\r
index 51675f600a2c8335d07cee00d2a8be02af3876f5..61c2533311c6c989aff0553bfdd5f1918c70a730 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -29,7 +29,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InternalSyncIncrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 InternalSyncIncrement   PROC\r
index cf9f92a0212f934ec0d92bfaaf5a2ae534b2f0b9..c61a550119880c20125e4afe00568e1de7bda050 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterLockedIncrement function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -31,7 +31,7 @@
 UINT32\r
 EFIAPI\r
 InternalSyncIncrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   _asm {\r
index 24f24f5d9a05f8c914a0af25b449cfb3a2f9193a..3902c732751e14b0da59401a2d1e670a6d10e5e8 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InternalSyncIncrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 global ASM_PFX(InternalSyncIncrement)\r
index bb0c8e9469fa45aedcbbda91501caaf0f3201735..4f2e21bcb32110789ad57bf549a7cd2d3b274feb 100644 (file)
@@ -244,7 +244,7 @@ ReleaseSpinLock (
 UINT32\r
 EFIAPI\r
 InterlockedIncrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   ASSERT (Value != NULL);\r
@@ -269,7 +269,7 @@ InterlockedIncrement (
 UINT32\r
 EFIAPI\r
 InterlockedDecrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   ASSERT (Value != NULL);\r
@@ -298,7 +298,7 @@ InterlockedDecrement (
 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
@@ -329,7 +329,7 @@ InterlockedCompareExchange16 (
 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
@@ -359,7 +359,7 @@ InterlockedCompareExchange32 (
 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
@@ -389,7 +389,7 @@ InterlockedCompareExchange64 (
 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
@@ -401,13 +401,13 @@ InterlockedCompareExchangePointer (
   switch (SizeOfValue) {\r
     case sizeof (UINT32):\r
       return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
-                             (UINT32*)Value,\r
+                             (volatile UINT32 *)Value,\r
                              (UINT32)(UINTN)CompareValue,\r
                              (UINT32)(UINTN)ExchangeValue\r
                              );\r
     case sizeof (UINT64):\r
       return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
-                             (UINT64*)Value,\r
+                             (volatile UINT64 *)Value,\r
                              (UINT64)(UINTN)CompareValue,\r
                              (UINT64)(UINTN)ExchangeValue\r
                              );\r
index 4b8c8e59c88ee2154365061af8a82432f1152346..98c9648632db44b3609cc740a9829fb4943b6259 100644 (file)
@@ -260,7 +260,7 @@ ReleaseSpinLock (
 UINT32\r
 EFIAPI\r
 InterlockedIncrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   ASSERT (Value != NULL);\r
@@ -285,7 +285,7 @@ InterlockedIncrement (
 UINT32\r
 EFIAPI\r
 InterlockedDecrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   ASSERT (Value != NULL);\r
@@ -314,7 +314,7 @@ InterlockedDecrement (
 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
@@ -345,7 +345,7 @@ InterlockedCompareExchange16 (
 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
@@ -375,7 +375,7 @@ InterlockedCompareExchange32 (
 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
@@ -405,7 +405,7 @@ InterlockedCompareExchange64 (
 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
@@ -417,13 +417,13 @@ InterlockedCompareExchangePointer (
   switch (SizeOfValue) {\r
     case sizeof (UINT32):\r
       return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
-                             (UINT32*)Value,\r
+                             (volatile UINT32 *)Value,\r
                              (UINT32)(UINTN)CompareValue,\r
                              (UINT32)(UINTN)ExchangeValue\r
                              );\r
     case sizeof (UINT64):\r
       return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
-                             (UINT64*)Value,\r
+                             (volatile UINT64 *)Value,\r
                              (UINT64)(UINTN)CompareValue,\r
                              (UINT64)(UINTN)ExchangeValue\r
                              );\r
index db344b7e64202af5d040910d4fac5fc2053be2c6..8bc6d2669ebd59d17a70ff63b8b43f430f982703 100644 (file)
@@ -262,7 +262,7 @@ ReleaseSpinLock (
 UINT32\r
 EFIAPI\r
 InterlockedIncrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   ASSERT (Value != NULL);\r
@@ -287,7 +287,7 @@ InterlockedIncrement (
 UINT32\r
 EFIAPI\r
 InterlockedDecrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
   ASSERT (Value != NULL);\r
@@ -316,7 +316,7 @@ InterlockedDecrement (
 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
@@ -347,7 +347,7 @@ InterlockedCompareExchange16 (
 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
@@ -377,7 +377,7 @@ InterlockedCompareExchange32 (
 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
@@ -407,7 +407,7 @@ InterlockedCompareExchange64 (
 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
@@ -419,13 +419,13 @@ InterlockedCompareExchangePointer (
   switch (SizeOfValue) {\r
     case sizeof (UINT32):\r
       return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
-                             (UINT32*)Value,\r
+                             (volatile UINT32*)Value,\r
                              (UINT32)(UINTN)CompareValue,\r
                              (UINT32)(UINTN)ExchangeValue\r
                              );\r
     case sizeof (UINT64):\r
       return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
-                             (UINT64*)Value,\r
+                             (volatile UINT64*)Value,\r
                              (UINT64)(UINTN)CompareValue,\r
                              (UINT64)(UINTN)ExchangeValue\r
                              );\r
index 79266624b1cae1967a939a4b2407b1c1287123ab..e8919222e3d7e7502af6370da9cd1339a2f78167 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 ; Copyright (c) 2015, Linaro Ltd. 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
@@ -28,7 +28,7 @@
 ; UINT16\r
 ; EFIAPI\r
 ; InterlockedCompareExchange16 (\r
-;   IN      UINT16                    *Value,\r
+;   IN      volatile UINT16           *Value,\r
 ;   IN      UINT16                    CompareValue,\r
 ;   IN      UINT16                    ExchangeValue\r
 ;   );\r
index 76aa6fbc0e81d852270ff1cba366ad24986459e3..8b51ecbc3c8466eb45ca4a9b4be9ed7f21224f01 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange16 function\r
 \r
-  Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
   Copyright (c) 2015, Linaro Ltd. 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
@@ -44,7 +44,7 @@ __int16 _InterlockedCompareExchange16(
 UINT16\r
 EFIAPI\r
 InternalSyncCompareExchange16 (\r
-  IN      UINT16                    *Value,\r
+  IN      volatile UINT16           *Value,\r
   IN      UINT16                    CompareValue,\r
   IN      UINT16                    ExchangeValue\r
   )\r
index 1d72d074f6263e2087728f3cc93e92e1d632cc4f..efe3249f98abe9cffb7f0aa18c432970b21a847b 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>\r
+; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
 ; Copyright (c) 2015, Linaro Ltd. 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
@@ -29,7 +29,7 @@
 ; UINT16\r
 ; EFIAPI\r
 ; InterlockedCompareExchange16 (\r
-;   IN      UINT16                    *Value,\r
+;   IN      volatile UINT16           *Value,\r
 ;   IN      UINT16                    CompareValue,\r
 ;   IN      UINT16                    ExchangeValue\r
 ;   );\r
index ee94ff7aefcc0c281c2132740e6aeb01aecd83d5..269a3c7e416fb159fbcdb06dc43af5777140858c 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InterlockedCompareExchange32 (\r
-;   IN      UINT32                    *Value,\r
+;   IN      volatile UINT32           *Value,\r
 ;   IN      UINT32                    CompareValue,\r
 ;   IN      UINT32                    ExchangeValue\r
 ;   );\r
index 9f8f3d351fd78a55a4e5095040ff743993edd624..ef407af9a922ae5112250c33f2596da0d5c57447 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange32 function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -44,7 +44,7 @@ long _InterlockedCompareExchange(
 UINT32\r
 EFIAPI\r
 InternalSyncCompareExchange32 (\r
-  IN      UINT32                    *Value,\r
+  IN      volatile UINT32           *Value,\r
   IN      UINT32                    CompareValue,\r
   IN      UINT32                    ExchangeValue\r
   )\r
index 4c8c8103d9dbc07734bddbe964e3c0b662b592ab..31142d03c0e5e1df05bcd950d5dfaf69be391fe6 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -28,7 +28,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InterlockedCompareExchange32 (\r
-;   IN      UINT32                    *Value,\r
+;   IN      volatile UINT32           *Value,\r
 ;   IN      UINT32                    CompareValue,\r
 ;   IN      UINT32                    ExchangeValue\r
 ;   );\r
index b5bcd258a57488dc43d4d4d203c388b243743372..80d03fd11aaffa5cd15c47efc52b6a5127726910 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT64\r
 ; EFIAPI\r
 ; InterlockedCompareExchange64 (\r
-;   IN      UINT64                    *Value,\r
+;   IN      volatile UINT64           *Value,\r
 ;   IN      UINT64                    CompareValue,\r
 ;   IN      UINT64                    ExchangeValue\r
 ;   );\r
index 56805b3d2d312e7e0643068964052a483de0ff0f..a8f9fbb594476116bfdc635656cc803f88524523 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedCompareExchange64 function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -43,7 +43,7 @@ __int64 _InterlockedCompareExchange64(
 UINT64\r
 EFIAPI\r
 InternalSyncCompareExchange64 (\r
-  IN      UINT64                    *Value,\r
+  IN      volatile UINT64           *Value,\r
   IN      UINT64                    CompareValue,\r
   IN      UINT64                    ExchangeValue\r
   )\r
index 72c350a929131e0a3a67c2b1b3d282c9f4a2a045..819daed2466be9a470eba28b092b58a7d4733a00 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -28,7 +28,7 @@
 ; UINT64\r
 ; EFIAPI\r
 ; InterlockedCompareExchange64 (\r
-;   IN      UINT64                    *Value,\r
+;   IN      volatile UINT64           *Value,\r
 ;   IN      UINT64                    CompareValue,\r
 ;   IN      UINT64                    ExchangeValue\r
 ;   );\r
index fdea0d4c18dc63fd051479a918c0e70a3158a8ae..23f03c4a7bd3a2b9d034dbe758b2a099128efc75 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InterlockedDecrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 InternalSyncDecrement   PROC\r
index 65faf014e995560d714b29aeb07185cf1a6cd0f0..da402cd4c67f792c17ed914722c552e8a240f892 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterlockedDecrement function\r
 \r
-  Copyright (c) 2006 - 2010, 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
@@ -38,9 +38,9 @@ long _InterlockedDecrement(
 UINT32\r
 EFIAPI\r
 InternalSyncDecrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
-  return _InterlockedDecrement (Value);\r
+  return _InterlockedDecrement ((long *)(UINTN)(Value));\r
 }\r
 \r
index e140e44e5533aca2edf24586e6c6094fb15a3b8b..780d9020bbce860f8b8113cb9738c2e560efcedb 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -28,7 +28,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InterlockedDecrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 global ASM_PFX(InternalSyncDecrement)\r
index 65abcf73104c655612cf1e3e74c8902283c8a378..44f264f97dfd5776b7f1d9e3bc8f6013bd005db7 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -27,7 +27,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InterlockedIncrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 InternalSyncIncrement   PROC\r
index c0deb60c54fb2e4f5e841950a216947511fb5161..bbd1384602f146da1ad361ac539890cd7b172671 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   InterLockedIncrement function\r
 \r
-  Copyright (c) 2006 - 2008, 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
@@ -38,9 +38,9 @@ long _InterlockedIncrement(
 UINT32\r
 EFIAPI\r
 InternalSyncIncrement (\r
-  IN      UINT32                    *Value\r
+  IN      volatile UINT32           *Value\r
   )\r
 {\r
-  return _InterlockedIncrement (Value);\r
+  return _InterlockedIncrement ((long *)(UINTN)(Value));\r
 }\r
 \r
index 59d90be386598919905d9ab4223b3f69b9c1c676..e1c70a448dec5638abe62b17e50a98ac4c239498 100644 (file)
@@ -1,6 +1,6 @@
 ;------------------------------------------------------------------------------\r
 ;\r
-; Copyright (c) 2006, 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
@@ -28,7 +28,7 @@
 ; UINT32\r
 ; EFIAPI\r
 ; InterlockedIncrement (\r
-;   IN      UINT32                    *Value\r
+;   IN      volatile UINT32           *Value\r
 ;   );\r
 ;------------------------------------------------------------------------------\r
 global ASM_PFX(InternalSyncIncrement)\r