/** @file\r
Pei Core Main Entry Point\r
\r
-Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2016, 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
PeiFfsGetVolumeInfo,\r
PeiRegisterForShadow,\r
PeiFfsFindSectionData3,\r
- PeiFfsGetFileInfo2\r
+ PeiFfsGetFileInfo2,\r
+ PeiResetSystem2\r
};\r
\r
/**\r
OldCoreData->FileHandles = (EFI_PEI_FILE_HANDLE *) ((UINT8 *) OldCoreData->FileHandles - OldCoreData->HeapOffset);\r
}\r
\r
- //\r
- // Initialize libraries that the PEI Core is linked against\r
- //\r
- ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&OldCoreData->Ps);\r
- \r
//\r
// Fixup for PeiService's address\r
//\r
SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&OldCoreData->Ps);\r
\r
//\r
- // Update HandOffHob for new installed permenent memory\r
+ // Initialize libraries that the PEI Core is linked against\r
+ //\r
+ ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&OldCoreData->Ps);\r
+\r
+ //\r
+ // Update HandOffHob for new installed permanent memory\r
//\r
HandoffInformationTable = OldCoreData->HobList.HandoffInformationTable;\r
if (OldCoreData->HeapOffsetPositive) {\r
\r
//\r
// After the whole temporary memory is migrated, then we can allocate page in\r
- // permenent memory.\r
+ // permanent memory.\r
//\r
OldCoreData->PeiMemoryInstalled = TRUE;\r
\r
// Shadow PEI Core. When permanent memory is avaiable, shadow\r
// PEI Core and PEIMs to get high performance.\r
//\r
- OldCoreData->ShadowedPeiCore = ShadowPeiCore (OldCoreData);\r
+ OldCoreData->ShadowedPeiCore = (PEICORE_FUNCTION_POINTER) (UINTN) PeiCore;\r
+ if ((HandoffInformationTable->BootMode == BOOT_ON_S3_RESUME && PcdGetBool (PcdShadowPeimOnS3Boot))\r
+ || (HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME && PcdGetBool (PcdShadowPeimOnBoot))) {\r
+ OldCoreData->ShadowedPeiCore = ShadowPeiCore (OldCoreData);\r
+ }\r
\r
//\r
// PEI Core has now been shadowed to memory. Restart PEI Core in memory.\r
//\r
ASSERT (FALSE);\r
CpuDeadLoop();\r
+\r
+ UNREACHABLE ();\r
}\r
\r
//\r
PrivateData.Ps = &PrivateData.ServiceTableShadow;\r
\r
//\r
- // Initialize libraries that the PEI Core is linked against\r
+ // Save PeiServicePointer so that it can be retrieved anywhere.\r
//\r
- ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps);\r
+ SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps);\r
\r
//\r
- // Save PeiServicePointer so that it can be retrieved anywhere.\r
+ // Initialize libraries that the PEI Core is linked against\r
//\r
- SetPeiServicesTablePointer ((CONST EFI_PEI_SERVICES **)&PrivateData.Ps);\r
+ ProcessLibraryConstructorList (NULL, (CONST EFI_PEI_SERVICES **)&PrivateData.Ps);\r
\r
//\r
// Initialize PEI Core Services\r
//\r
PeiDispatcher (SecCoreData, &PrivateData);\r
\r
- //\r
- // Check if InstallPeiMemory service was called.\r
- //\r
- ASSERT(PrivateData.PeiMemoryInstalled == TRUE);\r
+ if (PrivateData.HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME) {\r
+ //\r
+ // Check if InstallPeiMemory service was called on non-S3 resume boot path.\r
+ //\r
+ ASSERT(PrivateData.PeiMemoryInstalled == TRUE);\r
+ }\r
\r
//\r
// Measure PEI Core execution time.\r
//\r
ASSERT_EFI_ERROR (Status);\r
CpuDeadLoop();\r
+\r
+ UNREACHABLE ();\r
}\r