MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIs

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>
This commit is contained in:
Michael Kinney
2016-11-16 14:37:15 -08:00
parent 7375f3f11a
commit 4cee954ea8
33 changed files with 86 additions and 86 deletions

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR> ; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
@ -30,7 +30,7 @@
; UINT16 ; UINT16
; EFIAPI ; EFIAPI
; InternalSyncCompareExchange16 ( ; InternalSyncCompareExchange16 (
; IN UINT16 *Value, ; IN volatile UINT16 *Value,
; IN UINT16 CompareValue, ; IN UINT16 CompareValue,
; IN UINT16 ExchangeValue ; IN UINT16 ExchangeValue
; ); ; );

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedCompareExchange16 function InterlockedCompareExchange16 function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR> Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -36,7 +36,7 @@
UINT16 UINT16
EFIAPI EFIAPI
InternalSyncCompareExchange16 ( InternalSyncCompareExchange16 (
IN UINT16 *Value, IN volatile UINT16 *Value,
IN UINT16 CompareValue, IN UINT16 CompareValue,
IN UINT16 ExchangeValue IN UINT16 ExchangeValue
) )

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR> ; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
@ -28,7 +28,7 @@
; UINT16 ; UINT16
; EFIAPI ; EFIAPI
; InternalSyncCompareExchange16 ( ; InternalSyncCompareExchange16 (
; IN UINT16 *Value, ; IN volatile UINT16 *Value,
; IN UINT16 CompareValue, ; IN UINT16 CompareValue,
; IN UINT16 ExchangeValue ; IN UINT16 ExchangeValue
; ); ; );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -29,7 +29,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InternalSyncCompareExchange32 ( ; InternalSyncCompareExchange32 (
; IN UINT32 *Value, ; IN volatile UINT32 *Value,
; IN UINT32 CompareValue, ; IN UINT32 CompareValue,
; IN UINT32 ExchangeValue ; IN UINT32 ExchangeValue
; ); ; );

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedCompareExchange32 function InterlockedCompareExchange32 function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -35,7 +35,7 @@
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncCompareExchange32 ( InternalSyncCompareExchange32 (
IN UINT32 *Value, IN volatile UINT32 *Value,
IN UINT32 CompareValue, IN UINT32 CompareValue,
IN UINT32 ExchangeValue IN UINT32 ExchangeValue
) )

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InternalSyncCompareExchange32 ( ; InternalSyncCompareExchange32 (
; IN UINT32 *Value, ; IN volatile UINT32 *Value,
; IN UINT32 CompareValue, ; IN UINT32 CompareValue,
; IN UINT32 ExchangeValue ; IN UINT32 ExchangeValue
; ); ; );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -29,7 +29,7 @@
; UINT64 ; UINT64
; EFIAPI ; EFIAPI
; InternalSyncCompareExchange64 ( ; InternalSyncCompareExchange64 (
; IN UINT64 *Value, ; IN volatile UINT64 *Value,
; IN UINT64 CompareValue, ; IN UINT64 CompareValue,
; IN UINT64 ExchangeValue ; IN UINT64 ExchangeValue
; ); ; );

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedCompareExchange64 function InterlockedCompareExchange64 function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -34,7 +34,7 @@
UINT64 UINT64
EFIAPI EFIAPI
InternalSyncCompareExchange64 ( InternalSyncCompareExchange64 (
IN UINT64 *Value, IN volatile UINT64 *Value,
IN UINT64 CompareValue, IN UINT64 CompareValue,
IN UINT64 ExchangeValue IN UINT64 ExchangeValue
) )

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT64 ; UINT64
; EFIAPI ; EFIAPI
; InternalSyncCompareExchange64 ( ; InternalSyncCompareExchange64 (
; IN UINT64 *Value, ; IN volatile UINT64 *Value,
; IN UINT64 CompareValue, ; IN UINT64 CompareValue,
; IN UINT64 ExchangeValue ; IN UINT64 ExchangeValue
; ); ; );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -29,7 +29,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InternalSyncDecrement ( ; InternalSyncDecrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
InternalSyncDecrement PROC InternalSyncDecrement PROC

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedDecrement function InterlockedDecrement function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -31,7 +31,7 @@
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncDecrement ( InternalSyncDecrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
_asm { _asm {

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InternalSyncDecrement ( ; InternalSyncDecrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
global ASM_PFX(InternalSyncDecrement) global ASM_PFX(InternalSyncDecrement)

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -29,7 +29,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InternalSyncIncrement ( ; InternalSyncIncrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
InternalSyncIncrement PROC InternalSyncIncrement PROC

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterLockedIncrement function InterLockedIncrement function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -31,7 +31,7 @@
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncIncrement ( InternalSyncIncrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
_asm { _asm {

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InternalSyncIncrement ( ; InternalSyncIncrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
global ASM_PFX(InternalSyncIncrement) global ASM_PFX(InternalSyncIncrement)

View File

@ -244,7 +244,7 @@ ReleaseSpinLock (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedIncrement ( InterlockedIncrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
ASSERT (Value != NULL); ASSERT (Value != NULL);
@ -269,7 +269,7 @@ InterlockedIncrement (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedDecrement ( InterlockedDecrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
ASSERT (Value != NULL); ASSERT (Value != NULL);
@ -298,7 +298,7 @@ InterlockedDecrement (
UINT16 UINT16
EFIAPI EFIAPI
InterlockedCompareExchange16 ( InterlockedCompareExchange16 (
IN OUT UINT16 *Value, IN OUT volatile UINT16 *Value,
IN UINT16 CompareValue, IN UINT16 CompareValue,
IN UINT16 ExchangeValue IN UINT16 ExchangeValue
) )
@ -329,7 +329,7 @@ InterlockedCompareExchange16 (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedCompareExchange32 ( InterlockedCompareExchange32 (
IN OUT UINT32 *Value, IN OUT volatile UINT32 *Value,
IN UINT32 CompareValue, IN UINT32 CompareValue,
IN UINT32 ExchangeValue IN UINT32 ExchangeValue
) )
@ -359,7 +359,7 @@ InterlockedCompareExchange32 (
UINT64 UINT64
EFIAPI EFIAPI
InterlockedCompareExchange64 ( InterlockedCompareExchange64 (
IN OUT UINT64 *Value, IN OUT volatile UINT64 *Value,
IN UINT64 CompareValue, IN UINT64 CompareValue,
IN UINT64 ExchangeValue IN UINT64 ExchangeValue
) )
@ -389,7 +389,7 @@ InterlockedCompareExchange64 (
VOID * VOID *
EFIAPI EFIAPI
InterlockedCompareExchangePointer ( InterlockedCompareExchangePointer (
IN OUT VOID **Value, IN OUT VOID * volatile *Value,
IN VOID *CompareValue, IN VOID *CompareValue,
IN VOID *ExchangeValue IN VOID *ExchangeValue
) )
@ -401,13 +401,13 @@ InterlockedCompareExchangePointer (
switch (SizeOfValue) { switch (SizeOfValue) {
case sizeof (UINT32): case sizeof (UINT32):
return (VOID*)(UINTN)InterlockedCompareExchange32 ( return (VOID*)(UINTN)InterlockedCompareExchange32 (
(UINT32*)Value, (volatile UINT32 *)Value,
(UINT32)(UINTN)CompareValue, (UINT32)(UINTN)CompareValue,
(UINT32)(UINTN)ExchangeValue (UINT32)(UINTN)ExchangeValue
); );
case sizeof (UINT64): case sizeof (UINT64):
return (VOID*)(UINTN)InterlockedCompareExchange64 ( return (VOID*)(UINTN)InterlockedCompareExchange64 (
(UINT64*)Value, (volatile UINT64 *)Value,
(UINT64)(UINTN)CompareValue, (UINT64)(UINTN)CompareValue,
(UINT64)(UINTN)ExchangeValue (UINT64)(UINTN)ExchangeValue
); );

View File

@ -260,7 +260,7 @@ ReleaseSpinLock (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedIncrement ( InterlockedIncrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
ASSERT (Value != NULL); ASSERT (Value != NULL);
@ -285,7 +285,7 @@ InterlockedIncrement (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedDecrement ( InterlockedDecrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
ASSERT (Value != NULL); ASSERT (Value != NULL);
@ -314,7 +314,7 @@ InterlockedDecrement (
UINT16 UINT16
EFIAPI EFIAPI
InterlockedCompareExchange16 ( InterlockedCompareExchange16 (
IN OUT UINT16 *Value, IN OUT volatile UINT16 *Value,
IN UINT16 CompareValue, IN UINT16 CompareValue,
IN UINT16 ExchangeValue IN UINT16 ExchangeValue
) )
@ -345,7 +345,7 @@ InterlockedCompareExchange16 (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedCompareExchange32 ( InterlockedCompareExchange32 (
IN OUT UINT32 *Value, IN OUT volatile UINT32 *Value,
IN UINT32 CompareValue, IN UINT32 CompareValue,
IN UINT32 ExchangeValue IN UINT32 ExchangeValue
) )
@ -375,7 +375,7 @@ InterlockedCompareExchange32 (
UINT64 UINT64
EFIAPI EFIAPI
InterlockedCompareExchange64 ( InterlockedCompareExchange64 (
IN OUT UINT64 *Value, IN OUT volatile UINT64 *Value,
IN UINT64 CompareValue, IN UINT64 CompareValue,
IN UINT64 ExchangeValue IN UINT64 ExchangeValue
) )
@ -405,7 +405,7 @@ InterlockedCompareExchange64 (
VOID * VOID *
EFIAPI EFIAPI
InterlockedCompareExchangePointer ( InterlockedCompareExchangePointer (
IN OUT VOID **Value, IN OUT VOID * volatile *Value,
IN VOID *CompareValue, IN VOID *CompareValue,
IN VOID *ExchangeValue IN VOID *ExchangeValue
) )
@ -417,13 +417,13 @@ InterlockedCompareExchangePointer (
switch (SizeOfValue) { switch (SizeOfValue) {
case sizeof (UINT32): case sizeof (UINT32):
return (VOID*)(UINTN)InterlockedCompareExchange32 ( return (VOID*)(UINTN)InterlockedCompareExchange32 (
(UINT32*)Value, (volatile UINT32 *)Value,
(UINT32)(UINTN)CompareValue, (UINT32)(UINTN)CompareValue,
(UINT32)(UINTN)ExchangeValue (UINT32)(UINTN)ExchangeValue
); );
case sizeof (UINT64): case sizeof (UINT64):
return (VOID*)(UINTN)InterlockedCompareExchange64 ( return (VOID*)(UINTN)InterlockedCompareExchange64 (
(UINT64*)Value, (volatile UINT64 *)Value,
(UINT64)(UINTN)CompareValue, (UINT64)(UINTN)CompareValue,
(UINT64)(UINTN)ExchangeValue (UINT64)(UINTN)ExchangeValue
); );

View File

@ -262,7 +262,7 @@ ReleaseSpinLock (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedIncrement ( InterlockedIncrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
ASSERT (Value != NULL); ASSERT (Value != NULL);
@ -287,7 +287,7 @@ InterlockedIncrement (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedDecrement ( InterlockedDecrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
ASSERT (Value != NULL); ASSERT (Value != NULL);
@ -316,7 +316,7 @@ InterlockedDecrement (
UINT16 UINT16
EFIAPI EFIAPI
InterlockedCompareExchange16 ( InterlockedCompareExchange16 (
IN OUT UINT16 *Value, IN OUT volatile UINT16 *Value,
IN UINT16 CompareValue, IN UINT16 CompareValue,
IN UINT16 ExchangeValue IN UINT16 ExchangeValue
) )
@ -347,7 +347,7 @@ InterlockedCompareExchange16 (
UINT32 UINT32
EFIAPI EFIAPI
InterlockedCompareExchange32 ( InterlockedCompareExchange32 (
IN OUT UINT32 *Value, IN OUT volatile UINT32 *Value,
IN UINT32 CompareValue, IN UINT32 CompareValue,
IN UINT32 ExchangeValue IN UINT32 ExchangeValue
) )
@ -377,7 +377,7 @@ InterlockedCompareExchange32 (
UINT64 UINT64
EFIAPI EFIAPI
InterlockedCompareExchange64 ( InterlockedCompareExchange64 (
IN OUT UINT64 *Value, IN OUT volatile UINT64 *Value,
IN UINT64 CompareValue, IN UINT64 CompareValue,
IN UINT64 ExchangeValue IN UINT64 ExchangeValue
) )
@ -407,7 +407,7 @@ InterlockedCompareExchange64 (
VOID * VOID *
EFIAPI EFIAPI
InterlockedCompareExchangePointer ( InterlockedCompareExchangePointer (
IN OUT VOID **Value, IN OUT VOID * volatile *Value,
IN VOID *CompareValue, IN VOID *CompareValue,
IN VOID *ExchangeValue IN VOID *ExchangeValue
) )
@ -419,13 +419,13 @@ InterlockedCompareExchangePointer (
switch (SizeOfValue) { switch (SizeOfValue) {
case sizeof (UINT32): case sizeof (UINT32):
return (VOID*)(UINTN)InterlockedCompareExchange32 ( return (VOID*)(UINTN)InterlockedCompareExchange32 (
(UINT32*)Value, (volatile UINT32*)Value,
(UINT32)(UINTN)CompareValue, (UINT32)(UINTN)CompareValue,
(UINT32)(UINTN)ExchangeValue (UINT32)(UINTN)ExchangeValue
); );
case sizeof (UINT64): case sizeof (UINT64):
return (VOID*)(UINTN)InterlockedCompareExchange64 ( return (VOID*)(UINTN)InterlockedCompareExchange64 (
(UINT64*)Value, (volatile UINT64*)Value,
(UINT64)(UINTN)CompareValue, (UINT64)(UINTN)CompareValue,
(UINT64)(UINTN)ExchangeValue (UINT64)(UINTN)ExchangeValue
); );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR> ; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
@ -28,7 +28,7 @@
; UINT16 ; UINT16
; EFIAPI ; EFIAPI
; InterlockedCompareExchange16 ( ; InterlockedCompareExchange16 (
; IN UINT16 *Value, ; IN volatile UINT16 *Value,
; IN UINT16 CompareValue, ; IN UINT16 CompareValue,
; IN UINT16 ExchangeValue ; IN UINT16 ExchangeValue
; ); ; );

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedCompareExchange16 function InterlockedCompareExchange16 function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR> Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
@ -44,7 +44,7 @@ __int16 _InterlockedCompareExchange16(
UINT16 UINT16
EFIAPI EFIAPI
InternalSyncCompareExchange16 ( InternalSyncCompareExchange16 (
IN UINT16 *Value, IN volatile UINT16 *Value,
IN UINT16 CompareValue, IN UINT16 CompareValue,
IN UINT16 ExchangeValue IN UINT16 ExchangeValue
) )

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR> ; Copyright (c) 2015, Linaro Ltd. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
@ -29,7 +29,7 @@
; UINT16 ; UINT16
; EFIAPI ; EFIAPI
; InterlockedCompareExchange16 ( ; InterlockedCompareExchange16 (
; IN UINT16 *Value, ; IN volatile UINT16 *Value,
; IN UINT16 CompareValue, ; IN UINT16 CompareValue,
; IN UINT16 ExchangeValue ; IN UINT16 ExchangeValue
; ); ; );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InterlockedCompareExchange32 ( ; InterlockedCompareExchange32 (
; IN UINT32 *Value, ; IN volatile UINT32 *Value,
; IN UINT32 CompareValue, ; IN UINT32 CompareValue,
; IN UINT32 ExchangeValue ; IN UINT32 ExchangeValue
; ); ; );

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedCompareExchange32 function InterlockedCompareExchange32 function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -44,7 +44,7 @@ long _InterlockedCompareExchange(
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncCompareExchange32 ( InternalSyncCompareExchange32 (
IN UINT32 *Value, IN volatile UINT32 *Value,
IN UINT32 CompareValue, IN UINT32 CompareValue,
IN UINT32 ExchangeValue IN UINT32 ExchangeValue
) )

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -28,7 +28,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InterlockedCompareExchange32 ( ; InterlockedCompareExchange32 (
; IN UINT32 *Value, ; IN volatile UINT32 *Value,
; IN UINT32 CompareValue, ; IN UINT32 CompareValue,
; IN UINT32 ExchangeValue ; IN UINT32 ExchangeValue
; ); ; );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT64 ; UINT64
; EFIAPI ; EFIAPI
; InterlockedCompareExchange64 ( ; InterlockedCompareExchange64 (
; IN UINT64 *Value, ; IN volatile UINT64 *Value,
; IN UINT64 CompareValue, ; IN UINT64 CompareValue,
; IN UINT64 ExchangeValue ; IN UINT64 ExchangeValue
; ); ; );

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedCompareExchange64 function InterlockedCompareExchange64 function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -43,7 +43,7 @@ __int64 _InterlockedCompareExchange64(
UINT64 UINT64
EFIAPI EFIAPI
InternalSyncCompareExchange64 ( InternalSyncCompareExchange64 (
IN UINT64 *Value, IN volatile UINT64 *Value,
IN UINT64 CompareValue, IN UINT64 CompareValue,
IN UINT64 ExchangeValue IN UINT64 ExchangeValue
) )

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -28,7 +28,7 @@
; UINT64 ; UINT64
; EFIAPI ; EFIAPI
; InterlockedCompareExchange64 ( ; InterlockedCompareExchange64 (
; IN UINT64 *Value, ; IN volatile UINT64 *Value,
; IN UINT64 CompareValue, ; IN UINT64 CompareValue,
; IN UINT64 ExchangeValue ; IN UINT64 ExchangeValue
; ); ; );

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InterlockedDecrement ( ; InterlockedDecrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
InternalSyncDecrement PROC InternalSyncDecrement PROC

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterlockedDecrement function InterlockedDecrement function
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -38,9 +38,9 @@ long _InterlockedDecrement(
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncDecrement ( InternalSyncDecrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
return _InterlockedDecrement (Value); return _InterlockedDecrement ((long *)(UINTN)(Value));
} }

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -28,7 +28,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InterlockedDecrement ( ; InterlockedDecrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
global ASM_PFX(InternalSyncDecrement) global ASM_PFX(InternalSyncDecrement)

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -27,7 +27,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InterlockedIncrement ( ; InterlockedIncrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
InternalSyncIncrement PROC InternalSyncIncrement PROC

View File

@ -1,7 +1,7 @@
/** @file /** @file
InterLockedIncrement function InterLockedIncrement function
Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR> Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -38,9 +38,9 @@ long _InterlockedIncrement(
UINT32 UINT32
EFIAPI EFIAPI
InternalSyncIncrement ( InternalSyncIncrement (
IN UINT32 *Value IN volatile UINT32 *Value
) )
{ {
return _InterlockedIncrement (Value); return _InterlockedIncrement ((long *)(UINTN)(Value));
} }

View File

@ -1,6 +1,6 @@
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
; ;
; Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> ; Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>
; This program and the accompanying materials ; This program and the accompanying materials
; are licensed and made available under the terms and conditions of the BSD License ; are licensed and made available under the terms and conditions of the BSD License
; which accompanies this distribution. The full text of the license may be found at ; which accompanies this distribution. The full text of the license may be found at
@ -28,7 +28,7 @@
; UINT32 ; UINT32
; EFIAPI ; EFIAPI
; InterlockedIncrement ( ; InterlockedIncrement (
; IN UINT32 *Value ; IN volatile UINT32 *Value
; ); ; );
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
global ASM_PFX(InternalSyncIncrement) global ASM_PFX(InternalSyncIncrement)