X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FApplication%2FHelloWorld%2FHelloWorld.c;h=1821b2dd7642a85b6839ecc21e1f132120b225a1;hp=bcabed5796dec4b95305ed0d59a2c861ef0147a7;hb=0677cc4925d580f7016ac092dc591be0ebe03495;hpb=b7d286b6f9c1b447c706ab75377848bf05a3dfed diff --git a/MdeModulePkg/Application/HelloWorld/HelloWorld.c b/MdeModulePkg/Application/HelloWorld/HelloWorld.c index bcabed5796..1821b2dd76 100644 --- a/MdeModulePkg/Application/HelloWorld/HelloWorld.c +++ b/MdeModulePkg/Application/HelloWorld/HelloWorld.c @@ -1,8 +1,9 @@ /** @file - This simple application just print a "UEFI Hello World!" to the UEFI Console. - - Copyright (c) 2006 - 2007, Intel Corporation - All rights reserved. This program and the accompanying materials + This sample application bases on HelloWorld PCD setting + to print "UEFI Hello World!" to the UEFI Console. + + Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php @@ -12,21 +13,45 @@ **/ -// -// Include common header file for this module. -// -#include "CommonHeader.h" +#include +#include +#include +#include + + +/** + The user Entry Point for Application. The user code starts with this function + as the real entry point for the application. + @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] SystemTable A pointer to the EFI System Table. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval other Some error occurs when executing this entry point. + +**/ EFI_STATUS EFIAPI 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 ++) { + // + // Use UefiLib Print API to print string to UEFI console + // + Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString)); + } + } return EFI_SUCCESS; }