X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FApplication%2FHelloWorld%2FHelloWorld.c;h=0008cd14fda9f5f0fbf21b8df2a65682bfcc013d;hb=d0def00d33fa5d4a70c427dfc9a36d826b42967d;hp=5ffddfb481ce74290584ea32bc9aa3df15510839;hpb=40394b0fd4f8f66574949ad880d43c3a02a01c73;p=mirror_edk2.git diff --git a/MdeModulePkg/Application/HelloWorld/HelloWorld.c b/MdeModulePkg/Application/HelloWorld/HelloWorld.c index 5ffddfb481..0008cd14fd 100644 --- a/MdeModulePkg/Application/HelloWorld/HelloWorld.c +++ b/MdeModulePkg/Application/HelloWorld/HelloWorld.c @@ -1,14 +1,15 @@ /** @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 - 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 + This sample application bases on HelloWorld PCD setting + to print "UEFI Hello World!" to the UEFI Console. - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + Copyright (c) 2006 - 2018, 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 + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -17,15 +18,23 @@ #include #include +// +// String token ID of help message text. +// Shell supports to find help message in the resource section of an application image if +// .MAN file is not found. This global variable is added to make build tool recognizes +// that the help string is consumed by user and then build tool will add the string into +// the resource section. Thus the application can use '-?' option to show help message in +// Shell. +// +GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_HELLO_WORLD_HELP_INFORMATION); /** The user Entry Point for Application. The user code starts with this function - as the real entry point for the image goes into a library that calls this - function. + as the real entry point for the application. - @param[in] ImageHandle The firmware allocated handle for the EFI image. + @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. @@ -37,16 +46,19 @@ UefiMain ( IN EFI_SYSTEM_TABLE *SystemTable ) { - UINT32 Index; - - Index = 0; - + UINT32 Index; + + Index = 0; + // // 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)); + for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index ++) { + // + // Use UefiLib Print API to print string to UEFI console + // + Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString)); } }