From 223c22d8ea61384a107c6dbc666d6fd33f573cce Mon Sep 17 00:00:00 2001 From: lgao4 Date: Fri, 19 Sep 2008 05:05:40 +0000 Subject: 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 --- MdeModulePkg/Application/HelloWorld/HelloWorld.c | 14 ++++++++++++-- MdeModulePkg/Application/HelloWorld/HelloWorld.inf | 17 ++++++++++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) (limited to 'MdeModulePkg/Application') diff --git a/MdeModulePkg/Application/HelloWorld/HelloWorld.c b/MdeModulePkg/Application/HelloWorld/HelloWorld.c index 4106753..b1d16f7 100644 --- a/MdeModulePkg/Application/HelloWorld/HelloWorld.c +++ b/MdeModulePkg/Application/HelloWorld/HelloWorld.c @@ -13,6 +13,7 @@ **/ #include +#include #include #include #include @@ -37,10 +38,19 @@ UefiMain ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable ) - { + UINT32 Index; + + Index = 0; - Print ((CHAR16 *)L"UEFI Hello World!\n"); + // + // 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; } diff --git a/MdeModulePkg/Application/HelloWorld/HelloWorld.inf b/MdeModulePkg/Application/HelloWorld/HelloWorld.inf index a92bd5a..5b4a515 100644 --- a/MdeModulePkg/Application/HelloWorld/HelloWorld.inf +++ b/MdeModulePkg/Application/HelloWorld/HelloWorld.inf @@ -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 -- cgit v1.1