mirror of https://github.com/acidanthera/audk.git
revise the debug message to add 0x in front of the HEX number for consistency
replace FixedPcdGetXX with PcdGetXX to access PcdLoadModuleAtFixAddressEnable git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9964 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
d7c0e60c44
commit
852081fc68
|
@ -140,9 +140,7 @@
|
||||||
[FeaturePcd.common]
|
[FeaturePcd.common]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES
|
||||||
|
|
||||||
[FixedPcd.common]
|
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
|
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
|
|
@ -295,7 +295,7 @@ DxeMain (
|
||||||
// Configuration Table so that user could easily to retrieve the top address to load Dxe and PEI
|
// Configuration Table so that user could easily to retrieve the top address to load Dxe and PEI
|
||||||
// Code and Tseg base to load SMM driver.
|
// Code and Tseg base to load SMM driver.
|
||||||
//
|
//
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||||
Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable);
|
Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1797,7 +1797,7 @@ CoreInitializeMemoryServices (
|
||||||
//
|
//
|
||||||
PhitHob = Hob.HandoffInformationTable;
|
PhitHob = Hob.HandoffInformationTable;
|
||||||
|
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||||
ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber);
|
||||||
ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
|
ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber);
|
||||||
|
|
||||||
|
|
|
@ -355,7 +355,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||||
// hold the spcified address. If the feature is configured as load module at fixed offset, ImageAddress hold an offset
|
// hold the spcified address. If the feature is configured as load module at fixed offset, ImageAddress hold an offset
|
||||||
// relative to top address
|
// relative to top address
|
||||||
//
|
//
|
||||||
if ((INT64)FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) < 0) {
|
if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) < 0) {
|
||||||
ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)ImageContext->ImageAddress;
|
ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)ImageContext->ImageAddress;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -367,7 +367,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||||
}
|
}
|
||||||
SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
|
SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
|
||||||
}
|
}
|
||||||
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address %x. Status = %r \n", ImageContext->ImageAddress, Status));
|
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address 0x%11p. Status = %r \n", (VOID *)(UINTN)(ImageContext->ImageAddress), Status));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -479,7 +479,7 @@ CoreLoadPeImage (
|
||||||
// If Loading Module At Fixed Address feature is enabled, the module should be loaded to
|
// If Loading Module At Fixed Address feature is enabled, the module should be loaded to
|
||||||
// a specified address.
|
// a specified address.
|
||||||
//
|
//
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 ) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 ) {
|
||||||
Status = GetPeCoffImageFixLoadingAssignedAddress (&(Image->ImageContext));
|
Status = GetPeCoffImageFixLoadingAssignedAddress (&(Image->ImageContext));
|
||||||
|
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
|
|
@ -533,7 +533,7 @@ CoreAddMemoryDescriptor (
|
||||||
//
|
//
|
||||||
// If Loading Module At Fixed Address feature is enabled. try to allocate memory with Runtime code & Boot time code type
|
// If Loading Module At Fixed Address feature is enabled. try to allocate memory with Runtime code & Boot time code type
|
||||||
//
|
//
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||||
CoreLoadingFixedAddressHook();
|
CoreLoadingFixedAddressHook();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,10 +293,10 @@ PeiLoadFixAddressHook(
|
||||||
//
|
//
|
||||||
TotalReservedMemorySize += PeiMemorySize;
|
TotalReservedMemorySize += PeiMemorySize;
|
||||||
|
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressRuntimeCodePageNumber= %x.\n", PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber)));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressRuntimeCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber)));
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressBootTimeCodePageNumber= %x.\n", PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber)));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressBootTimeCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber)));
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressPeiCodePageNumber= %x.\n", PcdGet32(PcdLoadFixAddressPeiCodePageNumber)));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressPeiCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressPeiCodePageNumber)));
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Total Reserved Memory Size = %lx.\n", TotalReservedMemorySize));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Total Reserved Memory Size = 0x%lx.\n", TotalReservedMemorySize));
|
||||||
//
|
//
|
||||||
// Loop through the system memory typed hob to merge the adjacent memory range
|
// Loop through the system memory typed hob to merge the adjacent memory range
|
||||||
//
|
//
|
||||||
|
@ -364,17 +364,17 @@ PeiLoadFixAddressHook(
|
||||||
//
|
//
|
||||||
// Try to find and validate the TOP address.
|
// Try to find and validate the TOP address.
|
||||||
//
|
//
|
||||||
if ((INT64)FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) > 0 ) {
|
if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) > 0 ) {
|
||||||
//
|
//
|
||||||
// The LMFA feature is enabled as load module at fixed absolute address.
|
// The LMFA feature is enabled as load module at fixed absolute address.
|
||||||
//
|
//
|
||||||
TopLoadingAddress = (EFI_PHYSICAL_ADDRESS)FixedPcdGet64(PcdLoadModuleAtFixAddressEnable);
|
TopLoadingAddress = (EFI_PHYSICAL_ADDRESS)PcdGet64(PcdLoadModuleAtFixAddressEnable);
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Loading module at fixed absolute address.\n"));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Loading module at fixed absolute address.\n"));
|
||||||
//
|
//
|
||||||
// validate the Address. Loop the resource descriptor HOB to make sure the address is in valid memory range
|
// validate the Address. Loop the resource descriptor HOB to make sure the address is in valid memory range
|
||||||
//
|
//
|
||||||
if ((TopLoadingAddress & EFI_PAGE_MASK) != 0) {
|
if ((TopLoadingAddress & EFI_PAGE_MASK) != 0) {
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address %lx is invalid since top address should be page align. \n", TopLoadingAddress));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address 0x%lx is invalid since top address should be page align. \n", TopLoadingAddress));
|
||||||
ASSERT (FALSE);
|
ASSERT (FALSE);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
@ -405,10 +405,10 @@ PeiLoadFixAddressHook(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (CurrentResourceHob != NULL) {
|
if (CurrentResourceHob != NULL) {
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO:Top Address %lx is valid \n", TopLoadingAddress));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO:Top Address 0x%lx is valid \n", TopLoadingAddress));
|
||||||
TopLoadingAddress += MINIMUM_INITIAL_MEMORY_SIZE;
|
TopLoadingAddress += MINIMUM_INITIAL_MEMORY_SIZE;
|
||||||
} else {
|
} else {
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address %lx is invalid \n", TopLoadingAddress));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:Top Address 0x%lx is invalid \n", TopLoadingAddress));
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:The recommended Top Address for the platform is: \n"));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED ERROR:The recommended Top Address for the platform is: \n"));
|
||||||
//
|
//
|
||||||
// Print the recomended Top address range.
|
// Print the recomended Top address range.
|
||||||
|
@ -429,7 +429,7 @@ PeiLoadFixAddressHook(
|
||||||
// See if Top address specified by user is valid.
|
// See if Top address specified by user is valid.
|
||||||
//
|
//
|
||||||
if (ResourceHob->ResourceLength > TotalReservedMemorySize) {
|
if (ResourceHob->ResourceLength > TotalReservedMemorySize) {
|
||||||
DEBUG ((EFI_D_INFO, "(%lx, %lx)\n",
|
DEBUG ((EFI_D_INFO, "(0x%lx, 0x%lx)\n",
|
||||||
(ResourceHob->PhysicalStart + TotalReservedMemorySize -MINIMUM_INITIAL_MEMORY_SIZE),
|
(ResourceHob->PhysicalStart + TotalReservedMemorySize -MINIMUM_INITIAL_MEMORY_SIZE),
|
||||||
(ResourceHob->PhysicalStart + ResourceHob->ResourceLength -MINIMUM_INITIAL_MEMORY_SIZE)
|
(ResourceHob->PhysicalStart + ResourceHob->ResourceLength -MINIMUM_INITIAL_MEMORY_SIZE)
|
||||||
));
|
));
|
||||||
|
@ -546,7 +546,7 @@ PeiLoadFixAddressHook(
|
||||||
// Cache the top address for Loading Module at Fixed Address feature
|
// Cache the top address for Loading Module at Fixed Address feature
|
||||||
//
|
//
|
||||||
PrivateData->LoadModuleAtFixAddressTopAddress = TopLoadingAddress - MINIMUM_INITIAL_MEMORY_SIZE;
|
PrivateData->LoadModuleAtFixAddressTopAddress = TopLoadingAddress - MINIMUM_INITIAL_MEMORY_SIZE;
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Top address = %lx\n", PrivateData->LoadModuleAtFixAddressTopAddress));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: Top address = 0x%lx\n", PrivateData->LoadModuleAtFixAddressTopAddress));
|
||||||
//
|
//
|
||||||
// reinstall the PEI memory relative to TopLoadingAddress
|
// reinstall the PEI memory relative to TopLoadingAddress
|
||||||
//
|
//
|
||||||
|
@ -796,7 +796,7 @@ PeiDispatcher (
|
||||||
));
|
));
|
||||||
DEBUG_CODE_END ();
|
DEBUG_CODE_END ();
|
||||||
|
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||||
//
|
//
|
||||||
// Loading Module at Fixed Address is enabled
|
// Loading Module at Fixed Address is enabled
|
||||||
//
|
//
|
||||||
|
@ -940,13 +940,13 @@ PeiDispatcher (
|
||||||
//
|
//
|
||||||
PrivateInMem->PeimDispatcherReenter = TRUE;
|
PrivateInMem->PeimDispatcherReenter = TRUE;
|
||||||
|
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||||
//
|
//
|
||||||
// if Loading Module at Fixed Address is enabled, This is the first invoke to page
|
// if Loading Module at Fixed Address is enabled, This is the first invoke to page
|
||||||
// allocation for Pei Core segment. This memory segment should be reserved for loading PEIM
|
// allocation for Pei Core segment. This memory segment should be reserved for loading PEIM
|
||||||
//
|
//
|
||||||
LoadFixPeiCodeBegin = AllocatePages((UINTN)PcdGet32(PcdLoadFixAddressPeiCodePageNumber));
|
LoadFixPeiCodeBegin = AllocatePages((UINTN)PcdGet32(PcdLoadFixAddressPeiCodePageNumber));
|
||||||
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PeiCodeBegin = %x, PeiCodeTop= %x\n", (UINTN)LoadFixPeiCodeBegin, ((UINTN)LoadFixPeiCodeBegin) + PcdGet32(PcdLoadFixAddressPeiCodePageNumber) * EFI_PAGE_SIZE));
|
DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PeiCodeBegin = 0x%lx, PeiCodeTop= 0xl%x\n", (UINTN)LoadFixPeiCodeBegin, ((UINTN)LoadFixPeiCodeBegin) + PcdGet32(PcdLoadFixAddressPeiCodePageNumber) * EFI_PAGE_SIZE));
|
||||||
//
|
//
|
||||||
// if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array.
|
// if Loading Module at Fixed Address is enabled, allocate the PEI code memory range usage bit map array.
|
||||||
// Every bit in the array indicate the status of the corresponding memory page, available or not
|
// Every bit in the array indicate the status of the corresponding memory page, available or not
|
||||||
|
|
|
@ -251,7 +251,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||||
//
|
//
|
||||||
// Found first section header that doesn't point to code section.
|
// Found first section header that doesn't point to code section.
|
||||||
//
|
//
|
||||||
if ((INT64)FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) > 0) {
|
if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) > 0) {
|
||||||
//
|
//
|
||||||
// When LMFA feature is configured as Load Module at Fixed Absolute Address mode, PointerToRelocations & PointerToLineNumbers field
|
// When LMFA feature is configured as Load Module at Fixed Absolute Address mode, PointerToRelocations & PointerToLineNumbers field
|
||||||
// hold the absolute address of image base runing in memory
|
// hold the absolute address of image base runing in memory
|
||||||
|
@ -279,7 +279,7 @@ GetPeCoffImageFixLoadingAssignedAddress(
|
||||||
}
|
}
|
||||||
SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
|
SectionHeaderOffset += sizeof (EFI_IMAGE_SECTION_HEADER);
|
||||||
}
|
}
|
||||||
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address %lx. Status= %r \n", FixLoaddingAddress, Status));
|
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED INFO: Loading module at fixed address 0x%11p. Status= %r \n", (VOID *)(UINTN)FixLoaddingAddress, Status));
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -336,7 +336,7 @@ LoadAndRelocatePeCoffImage (
|
||||||
// Allocate Memory for the image when memory is ready, boot mode is not S3, and image is relocatable.
|
// Allocate Memory for the image when memory is ready, boot mode is not S3, and image is relocatable.
|
||||||
//
|
//
|
||||||
if ((!ImageContext.RelocationsStripped) && (Private->PeiMemoryInstalled) && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
|
if ((!ImageContext.RelocationsStripped) && (Private->PeiMemoryInstalled) && (Private->HobList.HandoffInformationTable->BootMode != BOOT_ON_S3_RESUME)) {
|
||||||
if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) {
|
||||||
Status = GetPeCoffImageFixLoadingAssignedAddress(&ImageContext, Private);
|
Status = GetPeCoffImageFixLoadingAssignedAddress(&ImageContext, Private);
|
||||||
if (EFI_ERROR (Status)){
|
if (EFI_ERROR (Status)){
|
||||||
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Failed to load module at fixed address. \n"));
|
DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Failed to load module at fixed address. \n"));
|
||||||
|
|
|
@ -88,7 +88,6 @@
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
|
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES
|
||||||
|
@ -97,4 +96,5 @@
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressPeiCodePageNumber ## SOMETIMES_CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressPeiCodePageNumber ## SOMETIMES_CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue