]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Application/HelloWorld/HelloWorld.c
Code scrub for the following drivers and librarys.
[mirror_edk2.git] / MdeModulePkg / Application / HelloWorld / HelloWorld.c
index 4106753492a2bd91fe30b269e7a4fe78c08a3844..19e5791fa8ebe718a7148d210997bea4223bc417 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
-  This simple application just print a "UEFI Hello World!" to the UEFI Console.\r
-  \r
-  Copyright (c) 2006 - 2007, Intel Corporation                                                         \r
+  This sample application bases on HelloWorld PCD setting \r
+  to print "UEFI Hello World!" to the UEFI Console.\r
+\r
+  Copyright (c) 2006 - 2008, Intel Corporation                                                         \r
   All rights reserved. This program and the accompanying materials                          \r
   are licensed and made available under the terms and conditions of the BSD License         \r
   which accompanies this distribution.  The full text of the license may be found at        \r
 **/\r
 \r
 #include <Uefi.h>\r
-#include <Library/DebugLib.h>\r
+#include <Library/PcdLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/UefiApplicationEntryPoint.h>\r
-#include <Library/UefiBootServicesTableLib.h>\r
 \r
 \r
 /**\r
   The user Entry Point for Application. The user code starts with this function\r
-  as the real entry point for the image goes into a library that calls this \r
-  function.\r
+  as the real entry point for the application.\r
 \r
   @param[in] ImageHandle    The firmware allocated handle for the EFI image.  \r
   @param[in] SystemTable    A pointer to the EFI System Table.\r
@@ -37,10 +36,22 @@ 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
+         //\r
+         // Use UefiLib Print API to print string to UEFI console\r
+         //\r
+       Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));\r
+    }\r
+  }\r
 \r
   return EFI_SUCCESS;\r
 }\r