1. Add three sample PCD in HelloWorld application for user reference of PCD usage.
2. PeiCore will always build FvHob for the extracted FvImage once it decompresses the new FvImage. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5930 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
**/
|
||||
|
||||
#include <Uefi.h>
|
||||
#include <Library/PcdLib.h>
|
||||
#include <Library/DebugLib.h>
|
||||
#include <Library/UefiLib.h>
|
||||
#include <Library/UefiApplicationEntryPoint.h>
|
||||
@@ -37,10 +38,19 @@ 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 ++) {
|
||||
Print ((CHAR16*)PcdGetPtr (PcdHelloWorldPrintString));
|
||||
}
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@@ -31,18 +31,29 @@
|
||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||
#
|
||||
|
||||
[Sources.common]
|
||||
[Sources]
|
||||
HelloWorld.c
|
||||
|
||||
|
||||
[Packages]
|
||||
MdePkg/MdePkg.dec
|
||||
|
||||
MdeModulePkg/MdeModulePkg.dec
|
||||
|
||||
[LibraryClasses]
|
||||
UefiBootServicesTableLib
|
||||
UefiApplicationEntryPoint
|
||||
UefiLib
|
||||
DebugLib
|
||||
PcdLib
|
||||
|
||||
[Guids]
|
||||
|
||||
[Ppis]
|
||||
|
||||
[Protocols]
|
||||
|
||||
[FeaturePcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
|
||||
|
||||
[Pcd]
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString
|
||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes
|
||||
|
Reference in New Issue
Block a user