/** @file\r
DXE 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
EFI_RUNTIME_SERVICES *gDxeCoreRT = &mEfiRuntimeServicesTableTemplate;\r
EFI_HANDLE gDxeCoreImageHandle = NULL;\r
\r
+BOOLEAN gMemoryMapTerminated = FALSE;\r
\r
//\r
// EFI Decompress Protocol\r
EFI_HOB_GUID_TYPE *GuidHob;\r
EFI_VECTOR_HANDOFF_INFO *VectorInfoList;\r
EFI_VECTOR_HANDOFF_INFO *VectorInfo;\r
+ VOID *EntryPoint;\r
\r
//\r
// Setup the default exception handlers\r
Status = CoreInitializeImageServices (HobStart);\r
ASSERT_EFI_ERROR (Status);\r
\r
+ //\r
+ // Initialize the Global Coherency Domain Services\r
+ //\r
+ Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);\r
+ ASSERT_EFI_ERROR (Status);\r
+\r
//\r
// Call constructor for all libraries\r
//\r
// Report DXE Core image information to the PE/COFF Extra Action Library\r
//\r
ZeroMem (&ImageContext, sizeof (ImageContext));\r
- ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;\r
- ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*) (UINTN) ImageContext.ImageAddress);\r
+ ImageContext.ImageAddress = (EFI_PHYSICAL_ADDRESS)(UINTN)gDxeCoreLoadedImage->ImageBase;\r
+ ImageContext.PdbPointer = PeCoffLoaderGetPdbPointer ((VOID*)(UINTN)ImageContext.ImageAddress);\r
+ ImageContext.SizeOfHeaders = PeCoffGetSizeOfHeaders ((VOID*)(UINTN)ImageContext.ImageAddress);\r
+ Status = PeCoffLoaderGetEntryPoint ((VOID*)(UINTN)ImageContext.ImageAddress, &EntryPoint);\r
+ if (Status == EFI_SUCCESS) {\r
+ ImageContext.EntryPoint = (EFI_PHYSICAL_ADDRESS)(UINTN)EntryPoint;\r
+ }\r
+ ImageContext.Handle = (VOID *)(UINTN)gDxeCoreLoadedImage->ImageBase;\r
+ ImageContext.ImageRead = PeCoffLoaderImageReadFromMemory;\r
PeCoffLoaderRelocateImageExtraAction (&ImageContext);\r
\r
- //\r
- // Initialize the Global Coherency Domain Services\r
- //\r
- Status = CoreInitializeGcdServices (&HobStart, MemoryBaseAddress, MemoryLength);\r
- ASSERT_EFI_ERROR (Status);\r
-\r
//\r
// Install the DXE Services Table into the EFI System Tables's Configuration Table\r
//\r
MemoryProfileInstallProtocol ();\r
\r
CoreInitializePropertiesTable ();\r
+ CoreInitializeMemoryAttributesTable ();\r
\r
//\r
// Get persisted vector hand-off info from GUIDeed HOB again due to HobStart may be updated,\r
//\r
ASSERT (FALSE);\r
CpuDeadLoop ();\r
+\r
+ UNREACHABLE ();\r
}\r
\r
\r
return Status;\r
}\r
\r
+ gMemoryMapTerminated = TRUE;\r
+\r
//\r
// Notify other drivers that we are exiting boot services.\r
//\r