summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-19 05:05:40 +0000
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>2008-09-19 05:05:40 +0000
commit223c22d8ea61384a107c6dbc666d6fd33f573cce (patch)
tree9633386038d5018448b050c906ee02af46f43e72 /MdeModulePkg/Application
parentc481196831ea9e10e03e75c74ae7d88ad92a3f8e (diff)
downloadedk2-platforms-223c22d8ea61384a107c6dbc666d6fd33f573cce.tar.xz
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
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/HelloWorld/HelloWorld.c14
-rw-r--r--MdeModulePkg/Application/HelloWorld/HelloWorld.inf17
2 files changed, 26 insertions, 5 deletions
diff --git a/MdeModulePkg/Application/HelloWorld/HelloWorld.c b/MdeModulePkg/Application/HelloWorld/HelloWorld.c
index 4106753492..b1d16f76a0 100644
--- a/MdeModulePkg/Application/HelloWorld/HelloWorld.c
+++ b/MdeModulePkg/Application/HelloWorld/HelloWorld.c
@@ -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;
+
+ 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 a92bd5a966..5b4a51590d 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