UefiCpuPkg/PiSmmCpuDxeSmm: Add volatile to mNumberToFinish
authorMichael Kinney <michael.d.kinney@intel.com>
Thu, 17 Nov 2016 20:43:04 +0000 (12:43 -0800)
committerMichael Kinney <michael.d.kinney@intel.com>
Fri, 18 Nov 2016 01:37:50 +0000 (17:37 -0800)
Add volatile qualifier to mNumberToFinish to prevent GCC 5.4
compiler from optimizing away required logic in ACPI S3 resume.

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: Jeff Fan <jeff.fan@intel.com>
UefiCpuPkg/PiSmmCpuDxeSmm/CpuS3.c

index 4af86b7..532b7c4 100644 (file)
@@ -55,7 +55,7 @@ AsmGetAddressMap (
 #define LEGACY_REGION_BASE    (0xA0000 - LEGACY_REGION_SIZE)\r
 \r
 ACPI_CPU_DATA                mAcpiCpuData;\r
-UINT32                       mNumberToFinish;\r
+volatile UINT32              mNumberToFinish;\r
 MP_CPU_EXCHANGE_INFO         *mExchangeInfo;\r
 BOOLEAN                      mRestoreSmmConfigurationInS3 = FALSE;\r
 VOID                         *mGdtForAp = NULL;\r