From 852081fc68a3b8fe372cda5fb009058d8a077ab9 Mon Sep 17 00:00:00 2001 From: jchen20 Date: Wed, 10 Feb 2010 06:10:53 +0000 Subject: [PATCH] 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 --- MdeModulePkg/Core/Dxe/DxeMain.inf | 6 ++-- MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c | 2 +- MdeModulePkg/Core/Dxe/Gcd/Gcd.c | 2 +- MdeModulePkg/Core/Dxe/Image/Image.c | 6 ++-- MdeModulePkg/Core/Dxe/Mem/Page.c | 2 +- MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c | 28 +++++++++---------- MdeModulePkg/Core/Pei/Image/Image.c | 6 ++-- MdeModulePkg/Core/Pei/PeiMain.inf | 4 +-- 8 files changed, 27 insertions(+), 29 deletions(-) diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf index 3a32e1ff31..5da6f148d9 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain.inf +++ b/MdeModulePkg/Core/Dxe/DxeMain.inf @@ -140,9 +140,7 @@ [FeaturePcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkCompatibilitySupport ## CONSUMES -[FixedPcd.common] - gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES - [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES \ No newline at end of file + gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES \ No newline at end of file diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c index 8c7bdc7074..cd2368e570 100644 --- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c +++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c @@ -295,7 +295,7 @@ DxeMain ( // 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. // - if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { Status = CoreInstallConfigurationTable (&gLoadFixedAddressConfigurationTableGuid, &gLoadModuleAtFixAddressConfigurationTable); ASSERT_EFI_ERROR (Status); } diff --git a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c index 2a026c0724..6ac093162e 100644 --- a/MdeModulePkg/Core/Dxe/Gcd/Gcd.c +++ b/MdeModulePkg/Core/Dxe/Gcd/Gcd.c @@ -1797,7 +1797,7 @@ CoreInitializeMemoryServices ( // PhitHob = Hob.HandoffInformationTable; - if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { ReservedCodePageNumber = PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber); ReservedCodePageNumber += PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber); diff --git a/MdeModulePkg/Core/Dxe/Image/Image.c b/MdeModulePkg/Core/Dxe/Image/Image.c index 7752fab70d..ae4daebd9e 100644 --- a/MdeModulePkg/Core/Dxe/Image/Image.c +++ b/MdeModulePkg/Core/Dxe/Image/Image.c @@ -355,7 +355,7 @@ GetPeCoffImageFixLoadingAssignedAddress( // hold the spcified address. If the feature is configured as load module at fixed offset, ImageAddress hold an offset // relative to top address // - if ((INT64)FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) < 0) { + if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) < 0) { ImageContext->ImageAddress = gLoadModuleAtFixAddressConfigurationTable.DxeCodeTopAddress + (INT64)ImageContext->ImageAddress; } // @@ -367,7 +367,7 @@ GetPeCoffImageFixLoadingAssignedAddress( } 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; } /** @@ -479,7 +479,7 @@ CoreLoadPeImage ( // If Loading Module At Fixed Address feature is enabled, the module should be loaded to // a specified address. // - if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 ) { + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0 ) { Status = GetPeCoffImageFixLoadingAssignedAddress (&(Image->ImageContext)); if (EFI_ERROR (Status)) { diff --git a/MdeModulePkg/Core/Dxe/Mem/Page.c b/MdeModulePkg/Core/Dxe/Mem/Page.c index 2a99507c58..f351a121f3 100644 --- a/MdeModulePkg/Core/Dxe/Mem/Page.c +++ b/MdeModulePkg/Core/Dxe/Mem/Page.c @@ -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 (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { CoreLoadingFixedAddressHook(); } diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c index 888887a418..0a4eaee482 100644 --- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c +++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c @@ -293,10 +293,10 @@ PeiLoadFixAddressHook( // TotalReservedMemorySize += PeiMemorySize; - DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressRuntimeCodePageNumber= %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: PcdLoadFixAddressPeiCodePageNumber= %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: PcdLoadFixAddressRuntimeCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressRuntimeCodePageNumber))); + DEBUG ((EFI_D_INFO, "LOADING MODULE FIXED INFO: PcdLoadFixAddressBootTimeCodePageNumber= 0x%x.\n", PcdGet32(PcdLoadFixAddressBootTimeCodePageNumber))); + 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 = 0x%lx.\n", TotalReservedMemorySize)); // // 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. // - if ((INT64)FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) > 0 ) { + if ((INT64)PcdGet64(PcdLoadModuleAtFixAddressEnable) > 0 ) { // // 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")); // // validate the Address. Loop the resource descriptor HOB to make sure the address is in valid memory range // 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); } // @@ -405,10 +405,10 @@ PeiLoadFixAddressHook( } } 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; } 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")); // // Print the recomended Top address range. @@ -429,7 +429,7 @@ PeiLoadFixAddressHook( // See if Top address specified by user is valid. // 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 + ResourceHob->ResourceLength -MINIMUM_INITIAL_MEMORY_SIZE) )); @@ -546,7 +546,7 @@ PeiLoadFixAddressHook( // Cache the top address for Loading Module at Fixed Address feature // 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 // @@ -796,7 +796,7 @@ PeiDispatcher ( )); DEBUG_CODE_END (); - if (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { // // Loading Module at Fixed Address is enabled // @@ -940,13 +940,13 @@ PeiDispatcher ( // 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 // allocation for Pei Core segment. This memory segment should be reserved for loading PEIM // 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. // Every bit in the array indicate the status of the corresponding memory page, available or not diff --git a/MdeModulePkg/Core/Pei/Image/Image.c b/MdeModulePkg/Core/Pei/Image/Image.c index c2683762b7..b5fed45bd5 100644 --- a/MdeModulePkg/Core/Pei/Image/Image.c +++ b/MdeModulePkg/Core/Pei/Image/Image.c @@ -251,7 +251,7 @@ GetPeCoffImageFixLoadingAssignedAddress( // // 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 // hold the absolute address of image base runing in memory @@ -279,7 +279,7 @@ GetPeCoffImageFixLoadingAssignedAddress( } 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; } /** @@ -336,7 +336,7 @@ LoadAndRelocatePeCoffImage ( // 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 (FixedPcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { + if (PcdGet64(PcdLoadModuleAtFixAddressEnable) != 0) { Status = GetPeCoffImageFixLoadingAssignedAddress(&ImageContext, Private); if (EFI_ERROR (Status)){ DEBUG ((EFI_D_INFO|EFI_D_LOAD, "LOADING MODULE FIXED ERROR: Failed to load module at fixed address. \n")); diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf index 2b8c4ad8b9..5c65174033 100644 --- a/MdeModulePkg/Core/Pei/PeiMain.inf +++ b/MdeModulePkg/Core/Pei/PeiMain.inf @@ -88,8 +88,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPpiSupported ## CONSUMES - gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES - + [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst ## CONSUMES @@ -97,4 +96,5 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressPeiCodePageNumber ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressBootTimeCodePageNumber ## SOMETIMES_CONSUMES gEfiMdeModulePkgTokenSpaceGuid.PcdLoadFixAddressRuntimeCodePageNumber ## SOMETIMES_CONSUMES + gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable ## CONSUMES