- }\r
-\r
- Status = EFI_SUCCESS;\r
-\r
- //\r
- // Install the PEI Protocols that are shared between PEI and DXE\r
- //\r
- PeiEfiPeiPeCoffLoader = (EFI_PEI_PE_COFF_LOADER_PROTOCOL *)GetPeCoffLoaderProtocol ();\r
- ASSERT (PeiEfiPeiPeCoffLoader != NULL);\r
-\r
-\r
- //\r
- // Allocate 128KB for the Stack\r
- //\r
- BaseOfStack = AllocatePages (EFI_SIZE_TO_PAGES (STACK_SIZE));\r
- ASSERT (BaseOfStack != NULL);\r
-\r
- //\r
- // Compute the top of the stack we were allocated. Pre-allocate a UINTN\r
- // for safety.\r
- //\r
- TopOfStack = (VOID *)((UINTN)BaseOfStack + EFI_SIZE_TO_PAGES (STACK_SIZE) * EFI_PAGE_SIZE - sizeof (UINTN));\r
-\r
- //\r
- // Add architecture-specifc HOBs (including the BspStore HOB)\r
- //\r
- Status = CreateArchSpecificHobs (&BspStore);\r
-\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Add HOB for the EFI Decompress Protocol\r
- //\r
- BuildGuidDataHob (\r
- &gEfiDecompressProtocolGuid,\r
- (VOID *)&gEfiDecompress,\r
- sizeof (gEfiDecompress)\r
- );\r
-\r
- //\r
- // Add HOB for the Tiano Decompress Protocol\r
- //\r
- BuildGuidDataHob (\r
- &gEfiTianoDecompressProtocolGuid,\r
- (VOID *)&gTianoDecompress,\r
- sizeof (gTianoDecompress)\r
- );\r
-\r
- //\r
- // Add HOB for the user customized Decompress Protocol\r
- //\r
- BuildGuidDataHob (\r
- &gEfiCustomizedDecompressProtocolGuid,\r
- (VOID *)&gCustomDecompress,\r
- sizeof (gCustomDecompress)\r
- );\r
-\r
- //\r
- // Add HOB for the PE/COFF Loader Protocol\r
- //\r
- BuildGuidDataHob (\r
- &gEfiPeiPeCoffLoaderGuid,\r
- (VOID *)&PeiEfiPeiPeCoffLoader,\r
- sizeof (VOID *)\r
- );\r
-\r
- //\r
- // See if we are in crisis recovery\r
- //\r
- Status = PeiServicesGetBootMode (&BootMode);\r
-\r
- if (!EFI_ERROR (Status) && (BootMode == BOOT_IN_RECOVERY_MODE)) {\r