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:
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT16\r
; EFIAPI\r
; InternalSyncCompareExchange16 (\r
; UINT16\r
; EFIAPI\r
; InternalSyncCompareExchange16 (\r
+; IN volatile UINT16 *Value,\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
/** @file\r
InterlockedCompareExchange16 function\r
\r
/** @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
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
UINT16\r
EFIAPI\r
InternalSyncCompareExchange16 (\r
UINT16\r
EFIAPI\r
InternalSyncCompareExchange16 (\r
+ IN volatile UINT16 *Value,\r
IN UINT16 CompareValue,\r
IN UINT16 ExchangeValue\r
)\r
IN UINT16 CompareValue,\r
IN UINT16 ExchangeValue\r
)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT16\r
; EFIAPI\r
; InternalSyncCompareExchange16 (\r
; UINT16\r
; EFIAPI\r
; InternalSyncCompareExchange16 (\r
+; IN volatile UINT16 *Value,\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InternalSyncCompareExchange32 (\r
; UINT32\r
; EFIAPI\r
; InternalSyncCompareExchange32 (\r
+; IN volatile UINT32 *Value,\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
/** @file\r
InterlockedCompareExchange32 function\r
\r
/** @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
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
UINT32\r
EFIAPI\r
InternalSyncCompareExchange32 (\r
UINT32\r
EFIAPI\r
InternalSyncCompareExchange32 (\r
+ IN volatile UINT32 *Value,\r
IN UINT32 CompareValue,\r
IN UINT32 ExchangeValue\r
)\r
IN UINT32 CompareValue,\r
IN UINT32 ExchangeValue\r
)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InternalSyncCompareExchange32 (\r
; UINT32\r
; EFIAPI\r
; InternalSyncCompareExchange32 (\r
+; IN volatile UINT32 *Value,\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT64\r
; EFIAPI\r
; InternalSyncCompareExchange64 (\r
; UINT64\r
; EFIAPI\r
; InternalSyncCompareExchange64 (\r
+; IN volatile UINT64 *Value,\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
/** @file\r
InterlockedCompareExchange64 function\r
\r
/** @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
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
UINT64\r
EFIAPI\r
InternalSyncCompareExchange64 (\r
UINT64\r
EFIAPI\r
InternalSyncCompareExchange64 (\r
+ IN volatile UINT64 *Value,\r
IN UINT64 CompareValue,\r
IN UINT64 ExchangeValue\r
)\r
IN UINT64 CompareValue,\r
IN UINT64 ExchangeValue\r
)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT64\r
; EFIAPI\r
; InternalSyncCompareExchange64 (\r
; UINT64\r
; EFIAPI\r
; InternalSyncCompareExchange64 (\r
+; IN volatile UINT64 *Value,\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InternalSyncDecrement (\r
; UINT32\r
; EFIAPI\r
; InternalSyncDecrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncDecrement PROC\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncDecrement PROC\r
/** @file\r
InterlockedDecrement function\r
\r
/** @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
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
UINT32\r
EFIAPI\r
InternalSyncDecrement (\r
UINT32\r
EFIAPI\r
InternalSyncDecrement (\r
+ IN volatile UINT32 *Value\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InternalSyncDecrement (\r
; UINT32\r
; EFIAPI\r
; InternalSyncDecrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncDecrement)\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncDecrement)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InternalSyncIncrement (\r
; UINT32\r
; EFIAPI\r
; InternalSyncIncrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncIncrement PROC\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncIncrement PROC\r
/** @file\r
InterLockedIncrement function\r
\r
/** @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
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
UINT32\r
EFIAPI\r
InternalSyncIncrement (\r
UINT32\r
EFIAPI\r
InternalSyncIncrement (\r
+ IN volatile UINT32 *Value\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InternalSyncIncrement (\r
; UINT32\r
; EFIAPI\r
; InternalSyncIncrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncIncrement)\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncIncrement)\r
UINT32\r
EFIAPI\r
InterlockedIncrement (\r
UINT32\r
EFIAPI\r
InterlockedIncrement (\r
+ IN volatile UINT32 *Value\r
)\r
{\r
ASSERT (Value != NULL);\r
)\r
{\r
ASSERT (Value != NULL);\r
UINT32\r
EFIAPI\r
InterlockedDecrement (\r
UINT32\r
EFIAPI\r
InterlockedDecrement (\r
+ IN volatile UINT32 *Value\r
)\r
{\r
ASSERT (Value != NULL);\r
)\r
{\r
ASSERT (Value != NULL);\r
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
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
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
VOID *\r
EFIAPI\r
InterlockedCompareExchangePointer (\r
VOID *\r
EFIAPI\r
InterlockedCompareExchangePointer (\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
switch (SizeOfValue) {\r
case sizeof (UINT32):\r
return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
switch (SizeOfValue) {\r
case sizeof (UINT32):\r
return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
+ (volatile UINT32 *)Value,\r
(UINT32)(UINTN)CompareValue,\r
(UINT32)(UINTN)ExchangeValue\r
);\r
case sizeof (UINT64):\r
return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
(UINT32)(UINTN)CompareValue,\r
(UINT32)(UINTN)ExchangeValue\r
);\r
case sizeof (UINT64):\r
return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
+ (volatile UINT64 *)Value,\r
(UINT64)(UINTN)CompareValue,\r
(UINT64)(UINTN)ExchangeValue\r
);\r
(UINT64)(UINTN)CompareValue,\r
(UINT64)(UINTN)ExchangeValue\r
);\r
UINT32\r
EFIAPI\r
InterlockedIncrement (\r
UINT32\r
EFIAPI\r
InterlockedIncrement (\r
+ IN volatile UINT32 *Value\r
)\r
{\r
ASSERT (Value != NULL);\r
)\r
{\r
ASSERT (Value != NULL);\r
UINT32\r
EFIAPI\r
InterlockedDecrement (\r
UINT32\r
EFIAPI\r
InterlockedDecrement (\r
+ IN volatile UINT32 *Value\r
)\r
{\r
ASSERT (Value != NULL);\r
)\r
{\r
ASSERT (Value != NULL);\r
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
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
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
VOID *\r
EFIAPI\r
InterlockedCompareExchangePointer (\r
VOID *\r
EFIAPI\r
InterlockedCompareExchangePointer (\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
switch (SizeOfValue) {\r
case sizeof (UINT32):\r
return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
switch (SizeOfValue) {\r
case sizeof (UINT32):\r
return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
+ (volatile UINT32 *)Value,\r
(UINT32)(UINTN)CompareValue,\r
(UINT32)(UINTN)ExchangeValue\r
);\r
case sizeof (UINT64):\r
return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
(UINT32)(UINTN)CompareValue,\r
(UINT32)(UINTN)ExchangeValue\r
);\r
case sizeof (UINT64):\r
return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
+ (volatile UINT64 *)Value,\r
(UINT64)(UINTN)CompareValue,\r
(UINT64)(UINTN)ExchangeValue\r
);\r
(UINT64)(UINTN)CompareValue,\r
(UINT64)(UINTN)ExchangeValue\r
);\r
UINT32\r
EFIAPI\r
InterlockedIncrement (\r
UINT32\r
EFIAPI\r
InterlockedIncrement (\r
+ IN volatile UINT32 *Value\r
)\r
{\r
ASSERT (Value != NULL);\r
)\r
{\r
ASSERT (Value != NULL);\r
UINT32\r
EFIAPI\r
InterlockedDecrement (\r
UINT32\r
EFIAPI\r
InterlockedDecrement (\r
+ IN volatile UINT32 *Value\r
)\r
{\r
ASSERT (Value != NULL);\r
)\r
{\r
ASSERT (Value != NULL);\r
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
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
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
VOID *\r
EFIAPI\r
InterlockedCompareExchangePointer (\r
VOID *\r
EFIAPI\r
InterlockedCompareExchangePointer (\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
switch (SizeOfValue) {\r
case sizeof (UINT32):\r
return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
switch (SizeOfValue) {\r
case sizeof (UINT32):\r
return (VOID*)(UINTN)InterlockedCompareExchange32 (\r
+ (volatile UINT32*)Value,\r
(UINT32)(UINTN)CompareValue,\r
(UINT32)(UINTN)ExchangeValue\r
);\r
case sizeof (UINT64):\r
return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
(UINT32)(UINTN)CompareValue,\r
(UINT32)(UINTN)ExchangeValue\r
);\r
case sizeof (UINT64):\r
return (VOID*)(UINTN)InterlockedCompareExchange64 (\r
+ (volatile UINT64*)Value,\r
(UINT64)(UINTN)CompareValue,\r
(UINT64)(UINTN)ExchangeValue\r
);\r
(UINT64)(UINTN)CompareValue,\r
(UINT64)(UINTN)ExchangeValue\r
);\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT16\r
; EFIAPI\r
; InterlockedCompareExchange16 (\r
; UINT16\r
; EFIAPI\r
; InterlockedCompareExchange16 (\r
+; IN volatile UINT16 *Value,\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
/** @file\r
InterlockedCompareExchange16 function\r
\r
/** @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
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
UINT16\r
EFIAPI\r
InternalSyncCompareExchange16 (\r
UINT16\r
EFIAPI\r
InternalSyncCompareExchange16 (\r
+ IN volatile UINT16 *Value,\r
IN UINT16 CompareValue,\r
IN UINT16 ExchangeValue\r
)\r
IN UINT16 CompareValue,\r
IN UINT16 ExchangeValue\r
)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT16\r
; EFIAPI\r
; InterlockedCompareExchange16 (\r
; UINT16\r
; EFIAPI\r
; InterlockedCompareExchange16 (\r
+; IN volatile UINT16 *Value,\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
; IN UINT16 CompareValue,\r
; IN UINT16 ExchangeValue\r
; );\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InterlockedCompareExchange32 (\r
; UINT32\r
; EFIAPI\r
; InterlockedCompareExchange32 (\r
+; IN volatile UINT32 *Value,\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
/** @file\r
InterlockedCompareExchange32 function\r
\r
/** @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
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
UINT32\r
EFIAPI\r
InternalSyncCompareExchange32 (\r
UINT32\r
EFIAPI\r
InternalSyncCompareExchange32 (\r
+ IN volatile UINT32 *Value,\r
IN UINT32 CompareValue,\r
IN UINT32 ExchangeValue\r
)\r
IN UINT32 CompareValue,\r
IN UINT32 ExchangeValue\r
)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InterlockedCompareExchange32 (\r
; UINT32\r
; EFIAPI\r
; InterlockedCompareExchange32 (\r
+; IN volatile UINT32 *Value,\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
; IN UINT32 CompareValue,\r
; IN UINT32 ExchangeValue\r
; );\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT64\r
; EFIAPI\r
; InterlockedCompareExchange64 (\r
; UINT64\r
; EFIAPI\r
; InterlockedCompareExchange64 (\r
+; IN volatile UINT64 *Value,\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
/** @file\r
InterlockedCompareExchange64 function\r
\r
/** @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
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
UINT64\r
EFIAPI\r
InternalSyncCompareExchange64 (\r
UINT64\r
EFIAPI\r
InternalSyncCompareExchange64 (\r
+ IN volatile UINT64 *Value,\r
IN UINT64 CompareValue,\r
IN UINT64 ExchangeValue\r
)\r
IN UINT64 CompareValue,\r
IN UINT64 ExchangeValue\r
)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT64\r
; EFIAPI\r
; InterlockedCompareExchange64 (\r
; UINT64\r
; EFIAPI\r
; InterlockedCompareExchange64 (\r
+; IN volatile UINT64 *Value,\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
; IN UINT64 CompareValue,\r
; IN UINT64 ExchangeValue\r
; );\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InterlockedDecrement (\r
; UINT32\r
; EFIAPI\r
; InterlockedDecrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncDecrement PROC\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncDecrement PROC\r
/** @file\r
InterlockedDecrement function\r
\r
/** @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
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
UINT32\r
EFIAPI\r
InternalSyncDecrement (\r
UINT32\r
EFIAPI\r
InternalSyncDecrement (\r
+ IN volatile UINT32 *Value\r
- return _InterlockedDecrement (Value);\r
+ return _InterlockedDecrement ((long *)(UINTN)(Value));\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InterlockedDecrement (\r
; UINT32\r
; EFIAPI\r
; InterlockedDecrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncDecrement)\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncDecrement)\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InterlockedIncrement (\r
; UINT32\r
; EFIAPI\r
; InterlockedIncrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncIncrement PROC\r
; );\r
;------------------------------------------------------------------------------\r
InternalSyncIncrement PROC\r
/** @file\r
InterLockedIncrement function\r
\r
/** @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
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
UINT32\r
EFIAPI\r
InternalSyncIncrement (\r
UINT32\r
EFIAPI\r
InternalSyncIncrement (\r
+ IN volatile UINT32 *Value\r
- return _InterlockedIncrement (Value);\r
+ return _InterlockedIncrement ((long *)(UINTN)(Value));\r
;------------------------------------------------------------------------------\r
;\r
;------------------------------------------------------------------------------\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
; 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
; UINT32\r
; EFIAPI\r
; InterlockedIncrement (\r
; UINT32\r
; EFIAPI\r
; InterlockedIncrement (\r
+; IN volatile UINT32 *Value\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncIncrement)\r
; );\r
;------------------------------------------------------------------------------\r
global ASM_PFX(InternalSyncIncrement)\r