]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/HelloWorld/HelloWorld.c
1. Add three sample PCD in HelloWorld application for user reference of PCD usage.
[mirror_edk2.git] / MdeModulePkg / Application / HelloWorld / HelloWorld.c
index 4106753492a2bd91fe30b269e7a4fe78c08a3844..b1d16f76a0b0b9a2de7ec7987c042c5b47606419 100644 (file)
@@ -13,6 +13,7 @@
 **/\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
@@ -37,10 +38,19 @@ UefiMain (
   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