/** @file\r
Provides services to access SMRAM Save State Map\r
\r
-Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2010 - 2019, 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
///\r
X86_ASSEMBLY_PATCH_LABEL gPatchSmbase;\r
X86_ASSEMBLY_PATCH_LABEL gPatchSmiStack;\r
-extern UINT32 gSmiCr3;\r
+X86_ASSEMBLY_PATCH_LABEL gPatchSmiCr3;\r
extern volatile UINT8 gcSmiHandlerTemplate[];\r
extern CONST UINT16 gcSmiHandlerSize;\r
\r
return;\r
}\r
\r
+ InitShadowStack (CpuIndex, (VOID *)((UINTN)SmiStack + StackSize));\r
+\r
//\r
// Initialize values in template before copy\r
//\r
CpuSmiStack = (UINT32)((UINTN)SmiStack + StackSize - sizeof (UINTN));\r
PatchInstructionX86 (gPatchSmiStack, CpuSmiStack, 4);\r
- gSmiCr3 = Cr3;\r
+ PatchInstructionX86 (gPatchSmiCr3, Cr3, 4);\r
PatchInstructionX86 (gPatchSmbase, SmBase, 4);\r
gSmiHandlerIdtr.Base = IdtBase;\r
gSmiHandlerIdtr.Limit = (UINT16)(IdtSize - 1);\r