1. Add three sample PCD in HelloWorld application for user reference of PCD usage.

2. PeiCore will always build FvHob for the extracted FvImage once it decompresses the new FvImage. 

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5930 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
lgao4 2008-09-19 05:05:40 +00:00
parent c481196831
commit 223c22d8ea
4 changed files with 66 additions and 20 deletions

View File

@ -13,6 +13,7 @@
**/
#include <Uefi.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
@ -37,10 +38,19 @@ UefiMain (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
UINT32 Index;
Print ((CHAR16 *)L"UEFI Hello World!\n");
Index = 0;
//
// Three PCD type (FeatureFlag, UINT32 and String) are used as the sample.
//
if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {
for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {
Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));
}
}
return EFI_SUCCESS;
}

View File

@ -31,18 +31,29 @@
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
#
[Sources.common]
[Sources]
HelloWorld.c
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
[LibraryClasses]
UefiBootServicesTableLib
UefiApplicationEntryPoint
UefiLib
DebugLib
PcdLib
[Guids]
[Ppis]
[Protocols]
[FeaturePcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
[Pcd]
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes

View File

@ -923,22 +923,11 @@ ProcessFvFile (
//
// Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase
// based on its parent Fvimage is informed or not.
// If FvHob of its parent fvimage is built, the extracted FvImage will be built also.
// Or, the extracted FvImage will not be built.
//
HobPtr.Raw = GetHobList ();
while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV, HobPtr.Raw)) != NULL) {
if (((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle > HobPtr.FirmwareVolume->BaseAddress) &&
((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle < HobPtr.FirmwareVolume->BaseAddress + HobPtr.FirmwareVolume->Length)) {
BuildFvHob (
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
FvImageInfo.FvSize
);
break;
}
HobPtr.Raw = GET_NEXT_HOB (HobPtr);
}
BuildFvHob (
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
FvImageInfo.FvSize
);
//
// Makes the encapsulated volume show up in DXE phase to skip processing of

View File

@ -295,6 +295,12 @@
## IF TRUE, the PeiCore will handle the framework FvHob and install FvInfo PPI for it.
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport|FALSE|BOOLEAN|0x00012009
##
# IF TRUE, HelloWorld Application will print the verbose information.
# This PCD is a sample to explain FeatureFlag PCD usage.
##
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable|TRUE|BOOLEAN|0x0001200a
[PcdsFixedAtBuild.common]
## Dynamic type PCD can be registered callback function for Pcd setting action.
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicate maximum number of callback function
@ -364,6 +370,18 @@
## Error level for hardware recorder.
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
##
# This PCD defines the print string.
# This PCD is a sample to explain FixedAtBuild String PCD usage.
##
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004
##
# This PCD defines the times to print hello world string.
# This PCD is a sample to explain FixedAtBuild UINT32 PCD usage.
##
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005
[PcdsFixedAtBuild.IA32]
## Default EFI boot path name for IA32 architecture, this path is relative to
# EFI boot disk.
@ -410,6 +428,18 @@
## Error level for hardware recorder.
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
##
# This PCD defines the print string.
# This PCD is a sample to explain Dynamic PCD usage.
##
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004
##
# This PCD defines the times to print hello world string.
# This PCD is a sample to explain Dynamic UINT32 PCD usage.
##
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005
[PcdsPatchableInModule.common]
## Maximun number of performance log entries during PEI phase.
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f
@ -439,6 +469,12 @@
## Error level for hardware recorder.
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
##
# This PCD defines the times to print hello world string.
# This PCD is a sample to explain Patchable UINT32 PCD usage.
##
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005
[PcdsFeatureFlag.IA32]
## If TRUE, the DXE IPL will load a 64-bit DxeCore.
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE|BOOLEAN|0x0001003b