X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=UefiCpuPkg%2FPiSmmCpuDxeSmm%2FSmramSaveState.c;h=3188d438181ccbed40e9d981e62dd4b8dfe792a9;hb=29dc8aa861fac78c6d62391dff312db934b755e3;hp=c37e9e8302af3c8ce1d9b1dc901dd8b6a602a6d5;hpb=f12367a0b1de7838f1cb8e0839e168ed7b862333;p=mirror_edk2.git diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c b/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c index c37e9e8302..3188d43818 100644 --- a/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/SmramSaveState.c @@ -1,7 +1,7 @@ /** @file Provides services to access SMRAM Save State Map -Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2010 - 2017, 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 @@ -687,6 +687,14 @@ InstallSmiHandler ( { PROCESSOR_SMM_DESCRIPTOR *Psd; + // + // Initialize PROCESSOR_SMM_DESCRIPTOR + // + Psd = (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)((UINTN)SmBase + SMM_PSD_OFFSET); + CopyMem (Psd, &gcPsd, sizeof (gcPsd)); + Psd->SmmGdtPtr = (UINT64)GdtBase; + Psd->SmmGdtSize = (UINT32)GdtSize; + if (SmmCpuFeaturesGetSmiHandlerSize () != 0) { // // Install SMI handler provided by library @@ -705,14 +713,6 @@ InstallSmiHandler ( return; } - // - // Initialize PROCESSOR_SMM_DESCRIPTOR - // - Psd = (PROCESSOR_SMM_DESCRIPTOR *)(VOID *)(UINTN)(SmBase + SMM_PSD_OFFSET); - CopyMem (Psd, &gcPsd, sizeof (gcPsd)); - Psd->SmmGdtPtr = (UINT64)GdtBase; - Psd->SmmGdtSize = (UINT32)GdtSize; - // // Initialize values in template before copy // @@ -731,7 +731,7 @@ InstallSmiHandler ( // Copy template to CPU specific SMI handler location // CopyMem ( - (VOID*)(UINTN)(SmBase + SMM_HANDLER_OFFSET), + (VOID*)((UINTN)SmBase + SMM_HANDLER_OFFSET), (VOID*)gcSmiHandlerTemplate, gcSmiHandlerSize );