From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id A2EFB81EFA for ; Thu, 17 Nov 2016 11:34:42 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP; 17 Nov 2016 11:34:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,655,1473145200"; d="scan'208";a="192684546" Received: from mdkinney-mobl.amr.corp.intel.com ([10.232.100.14]) by fmsmga004.fm.intel.com with ESMTP; 17 Nov 2016 11:34:47 -0800 From: Michael Kinney To: edk2-devel@lists.01.org Cc: Liming Gao , Laszlo Ersek , Andrew Fish , Jeff Fan Date: Thu, 17 Nov 2016 11:34:40 -0800 Message-Id: <1479411282-10996-2-git-send-email-michael.d.kinney@intel.com> X-Mailer: git-send-email 2.6.3.windows.1 In-Reply-To: <1479411282-10996-1-git-send-email-michael.d.kinney@intel.com> References: <1479411282-10996-1-git-send-email-michael.d.kinney@intel.com> Subject: [Patch v2 1/3] MdePkg/Include: Add volatile to SynchronizationLib parameters X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2016 19:34:42 -0000 The SpinLock functions in the SynchronicationLib use volatile parameters to keep compiler from optimizing these functions too much. The volatile keyword is missing from the Interlocked*() functions in this same library class. Update the library class to consistently use volatile on all functions in this class. Cc: Liming Gao Cc: Laszlo Ersek Cc: Andrew Fish Cc: Jeff Fan Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney --- MdePkg/Include/Library/SynchronizationLib.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MdePkg/Include/Library/SynchronizationLib.h b/MdePkg/Include/Library/SynchronizationLib.h index 7b97683..6cf3d71 100644 --- a/MdePkg/Include/Library/SynchronizationLib.h +++ b/MdePkg/Include/Library/SynchronizationLib.h @@ -1,7 +1,7 @@ /** @file Provides synchronization functions. -Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials 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 @@ -157,7 +157,7 @@ ReleaseSpinLock ( UINT32 EFIAPI InterlockedIncrement ( - IN UINT32 *Value + IN volatile UINT32 *Value ); @@ -179,7 +179,7 @@ InterlockedIncrement ( UINT32 EFIAPI InterlockedDecrement ( - IN UINT32 *Value + IN volatile UINT32 *Value ); @@ -204,7 +204,7 @@ InterlockedDecrement ( UINT16 EFIAPI InterlockedCompareExchange16 ( - IN OUT UINT16 *Value, + IN OUT volatile UINT16 *Value, IN UINT16 CompareValue, IN UINT16 ExchangeValue ); @@ -231,7 +231,7 @@ InterlockedCompareExchange16 ( UINT32 EFIAPI InterlockedCompareExchange32 ( - IN OUT UINT32 *Value, + IN OUT volatile UINT32 *Value, IN UINT32 CompareValue, IN UINT32 ExchangeValue ); @@ -258,7 +258,7 @@ InterlockedCompareExchange32 ( UINT64 EFIAPI InterlockedCompareExchange64 ( - IN OUT UINT64 *Value, + IN OUT volatile UINT64 *Value, IN UINT64 CompareValue, IN UINT64 ExchangeValue ); @@ -285,7 +285,7 @@ InterlockedCompareExchange64 ( VOID * EFIAPI InterlockedCompareExchangePointer ( - IN OUT VOID **Value, + IN OUT VOID * volatile *Value, IN VOID *CompareValue, IN VOID *ExchangeValue ); -- 2.6.3.windows.1