&mDxeIplPpi\r
};\r
\r
-static EFI_PEI_PPI_DESCRIPTOR mPpiPeiInMemory = {\r
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
- &gPeiInMemoryGuid,\r
- NULL\r
-};\r
-\r
static EFI_PEI_PPI_DESCRIPTOR mPpiSignal = {\r
(EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),\r
&gEfiEndOfPeiSignalPpiGuid,\r
\r
ASSERT_EFI_ERROR (Status);\r
\r
- Status = PeiServicesLocatePpi (\r
- &gPeiInMemoryGuid,\r
- 0,\r
- NULL,\r
- NULL\r
- );\r
-\r
- if (EFI_ERROR (Status) && (BootMode != BOOT_ON_S3_RESUME)) { \r
+ if (!gInMemory && (BootMode != BOOT_ON_S3_RESUME)) { \r
//\r
// The DxeIpl has not yet been shadowed\r
//\r
\r
} else {\r
if (BootMode != BOOT_ON_S3_RESUME) {\r
- //\r
- // The DxeIpl has been shadowed\r
- //\r
- gInMemory = TRUE;\r
\r
//\r
// Install LoadFile PPI\r
//\r
// Install DxeIpl PPI\r
//\r
- PeiServicesInstallPpi (&mPpiList);\r
+ Status = PeiServicesInstallPpi (&mPpiList);\r
\r
if (EFI_ERROR (Status)) {\r
return Status;\r
\r
if (Status == EFI_SUCCESS) {\r
//\r
- // Install PeiInMemory to indicate the Dxeipl is shadowed\r
+ // Set gInMemory global variable to TRUE to indicate the dxeipl is shadowed.\r
//\r
- Status = PeiServicesInstallPpi (&mPpiPeiInMemory);\r
-\r
- if (EFI_ERROR (Status)) {\r
- return Status;\r
- }\r
-\r
+ *(BOOLEAN *) ((UINTN) &gInMemory + (UINTN) DxeIplEntryPoint - (UINTN) _ModuleEntryPoint) = TRUE;\r
Status = ((EFI_PEIM_ENTRY_POINT) (UINTN) DxeIplEntryPoint) (DxeIplFileHeader, GetPeiServicesTablePointer());\r
}\r
\r