**/\r
\r
#include <Uefi.h>\r
+#include <Library/PcdLib.h>\r
#include <Library/DebugLib.h>\r
#include <Library/UefiLib.h>\r
#include <Library/UefiApplicationEntryPoint.h>\r
IN EFI_HANDLE ImageHandle,\r
IN EFI_SYSTEM_TABLE *SystemTable\r
)\r
-\r
{\r
+ UINT32 Index;\r
+ \r
+ Index = 0;\r
\r
- Print ((CHAR16 *)L"UEFI Hello World!\n");\r
+ //\r
+ // Three PCD type (FeatureFlag, UINT32 and String) are used as the sample.\r
+ //\r
+ if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {\r
+ for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) {\r
+ Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));\r
+ }\r
+ }\r
\r
return EFI_SUCCESS;\r
}\r
\r
//\r
// Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase\r
- // based on its parent Fvimage is informed or not.\r
- // If FvHob of its parent fvimage is built, the extracted FvImage will be built also. \r
- // Or, the extracted FvImage will not be built.\r
//\r
- HobPtr.Raw = GetHobList ();\r
- while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV, HobPtr.Raw)) != NULL) {\r
- if (((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle > HobPtr.FirmwareVolume->BaseAddress) && \r
- ((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle < HobPtr.FirmwareVolume->BaseAddress + HobPtr.FirmwareVolume->Length)) {\r
- BuildFvHob (\r
- (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
- FvImageInfo.FvSize\r
- );\r
- break;\r
- }\r
- HobPtr.Raw = GET_NEXT_HOB (HobPtr);\r
- }\r
+ BuildFvHob (\r
+ (EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,\r
+ FvImageInfo.FvSize\r
+ );\r
\r
//\r
// Makes the encapsulated volume show up in DXE phase to skip processing of\r
\r
## IF TRUE, the PeiCore will handle the framework FvHob and install FvInfo PPI for it.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport|FALSE|BOOLEAN|0x00012009\r
+ \r
+ ##\r
+ # IF TRUE, HelloWorld Application will print the verbose information.\r
+ # This PCD is a sample to explain FeatureFlag PCD usage.\r
+ ##\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable|TRUE|BOOLEAN|0x0001200a\r
\r
[PcdsFixedAtBuild.common]\r
## Dynamic type PCD can be registered callback function for Pcd setting action.\r
\r
## Error level for hardware recorder.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002\r
+ \r
+ ##\r
+ # This PCD defines the print string.\r
+ # This PCD is a sample to explain FixedAtBuild String PCD usage.\r
+ ##\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004\r
+\r
+ ##\r
+ # This PCD defines the times to print hello world string.\r
+ # This PCD is a sample to explain FixedAtBuild UINT32 PCD usage.\r
+ ##\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005\r
\r
[PcdsFixedAtBuild.IA32]\r
## Default EFI boot path name for IA32 architecture, this path is relative to \r
## Error level for hardware recorder.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002\r
\r
+ ##\r
+ # This PCD defines the print string.\r
+ # This PCD is a sample to explain Dynamic PCD usage.\r
+ ##\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004\r
+\r
+ ##\r
+ # This PCD defines the times to print hello world string.\r
+ # This PCD is a sample to explain Dynamic UINT32 PCD usage.\r
+ ##\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005\r
+\r
[PcdsPatchableInModule.common]\r
## Maximun number of performance log entries during PEI phase.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f\r
## Error level for hardware recorder.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002\r
\r
+ ##\r
+ # This PCD defines the times to print hello world string.\r
+ # This PCD is a sample to explain Patchable UINT32 PCD usage.\r
+ ##\r
+ gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005\r
+\r
[PcdsFeatureFlag.IA32]\r
## If TRUE, the DXE IPL will load a 64-bit DxeCore.\r
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE|BOOLEAN|0x0001003b\r