]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Application/HelloWorld/HelloWorld.c
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Application / HelloWorld / HelloWorld.c
CommitLineData
b7d286b6 1/** @file\r
d1102dba 2 This sample application bases on HelloWorld PCD setting\r
109e9a61
LG
3 to print "UEFI Hello World!" to the UEFI Console.\r
4\r
d1102dba 5 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
b7d286b6 7\r
8**/\r
9\r
ab9140c8 10#include <Uefi.h>\r
223c22d8 11#include <Library/PcdLib.h>\r
ab9140c8
A
12#include <Library/UefiLib.h>\r
13#include <Library/UefiApplicationEntryPoint.h>\r
b7d286b6 14\r
0d4a6c3d
QS
15//\r
16// String token ID of help message text.\r
17// Shell supports to find help message in the resource section of an application image if\r
18// .MAN file is not found. This global variable is added to make build tool recognizes\r
19// that the help string is consumed by user and then build tool will add the string into\r
20// the resource section. Thus the application can use '-?' option to show help message in\r
21// Shell.\r
22//\r
1436aea4 23GLOBAL_REMOVE_IF_UNREFERENCED EFI_STRING_ID mStringHelpTokenId = STRING_TOKEN (STR_HELLO_WORLD_HELP_INFORMATION);\r
b9575d60
A
24\r
25/**\r
26 The user Entry Point for Application. The user code starts with this function\r
109e9a61 27 as the real entry point for the application.\r
b9575d60 28\r
d1102dba 29 @param[in] ImageHandle The firmware allocated handle for the EFI image.\r
b9575d60 30 @param[in] SystemTable A pointer to the EFI System Table.\r
d1102dba 31\r
b9575d60
A
32 @retval EFI_SUCCESS The entry point is executed successfully.\r
33 @retval other Some error occurs when executing this entry point.\r
34\r
35**/\r
b7d286b6 36EFI_STATUS\r
37EFIAPI\r
38UefiMain (\r
39 IN EFI_HANDLE ImageHandle,\r
40 IN EFI_SYSTEM_TABLE *SystemTable\r
41 )\r
b7d286b6 42{\r
1436aea4 43 UINT32 Index;\r
d1102dba
LG
44\r
45 Index = 0;\r
46\r
223c22d8
LG
47 //\r
48 // Three PCD type (FeatureFlag, UINT32 and String) are used as the sample.\r
49 //\r
50 if (FeaturePcdGet (PcdHelloWorldPrintEnable)) {\r
1436aea4 51 for (Index = 0; Index < PcdGet32 (PcdHelloWorldPrintTimes); Index++) {\r
d1102dba
LG
52 //\r
53 // Use UefiLib Print API to print string to UEFI console\r
54 //\r
1436aea4 55 Print ((CHAR16 *)PcdGetPtr (PcdHelloWorldPrintString));\r
223c22d8
LG
56 }\r
57 }\r
b7d286b6 58\r
59 return EFI_SUCCESS;\r
60}\r