mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-03 03:44:23 +02:00
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:
parent
c481196831
commit
223c22d8ea
@ -13,6 +13,7 @@
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
#include <Uefi.h>
|
#include <Uefi.h>
|
||||||
|
#include <Library/PcdLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/UefiLib.h>
|
#include <Library/UefiLib.h>
|
||||||
#include <Library/UefiApplicationEntryPoint.h>
|
#include <Library/UefiApplicationEntryPoint.h>
|
||||||
@ -37,10 +38,19 @@ UefiMain (
|
|||||||
IN EFI_HANDLE ImageHandle,
|
IN EFI_HANDLE ImageHandle,
|
||||||
IN EFI_SYSTEM_TABLE *SystemTable
|
IN EFI_SYSTEM_TABLE *SystemTable
|
||||||
)
|
)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
UINT32 Index;
|
||||||
|
|
||||||
Print ((CHAR16 *)L"UEFI Hello World!\n");
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -31,18 +31,29 @@
|
|||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.common]
|
[Sources]
|
||||||
HelloWorld.c
|
HelloWorld.c
|
||||||
|
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
UefiBootServicesTableLib
|
UefiBootServicesTableLib
|
||||||
UefiApplicationEntryPoint
|
UefiApplicationEntryPoint
|
||||||
UefiLib
|
UefiLib
|
||||||
DebugLib
|
DebugLib
|
||||||
|
PcdLib
|
||||||
|
|
||||||
|
[Guids]
|
||||||
|
|
||||||
|
[Ppis]
|
||||||
|
|
||||||
|
[Protocols]
|
||||||
|
|
||||||
|
[FeaturePcd]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable
|
||||||
|
|
||||||
|
[Pcd]
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes
|
||||||
|
@ -923,22 +923,11 @@ ProcessFvFile (
|
|||||||
|
|
||||||
//
|
//
|
||||||
// Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase
|
// Inform the extracted FvImage to Fv HOB consumer phase, i.e. DXE phase
|
||||||
// based on its parent Fvimage is informed or not.
|
|
||||||
// If FvHob of its parent fvimage is built, the extracted FvImage will be built also.
|
|
||||||
// Or, the extracted FvImage will not be built.
|
|
||||||
//
|
//
|
||||||
HobPtr.Raw = GetHobList ();
|
|
||||||
while ((HobPtr.Raw = GetNextHob (EFI_HOB_TYPE_FV, HobPtr.Raw)) != NULL) {
|
|
||||||
if (((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle > HobPtr.FirmwareVolume->BaseAddress) &&
|
|
||||||
((EFI_PHYSICAL_ADDRESS) (UINTN)FvFileHandle < HobPtr.FirmwareVolume->BaseAddress + HobPtr.FirmwareVolume->Length)) {
|
|
||||||
BuildFvHob (
|
BuildFvHob (
|
||||||
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
|
(EFI_PHYSICAL_ADDRESS) (UINTN) FvImageInfo.FvStart,
|
||||||
FvImageInfo.FvSize
|
FvImageInfo.FvSize
|
||||||
);
|
);
|
||||||
break;
|
|
||||||
}
|
|
||||||
HobPtr.Raw = GET_NEXT_HOB (HobPtr);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Makes the encapsulated volume show up in DXE phase to skip processing of
|
// Makes the encapsulated volume show up in DXE phase to skip processing of
|
||||||
|
@ -295,6 +295,12 @@
|
|||||||
## IF TRUE, the PeiCore will handle the framework FvHob and install FvInfo PPI for it.
|
## IF TRUE, the PeiCore will handle the framework FvHob and install FvInfo PPI for it.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport|FALSE|BOOLEAN|0x00012009
|
gEfiMdeModulePkgTokenSpaceGuid.PcdFrameworkFvHobCompatibilitySupport|FALSE|BOOLEAN|0x00012009
|
||||||
|
|
||||||
|
##
|
||||||
|
# IF TRUE, HelloWorld Application will print the verbose information.
|
||||||
|
# This PCD is a sample to explain FeatureFlag PCD usage.
|
||||||
|
##
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintEnable|TRUE|BOOLEAN|0x0001200a
|
||||||
|
|
||||||
[PcdsFixedAtBuild.common]
|
[PcdsFixedAtBuild.common]
|
||||||
## Dynamic type PCD can be registered callback function for Pcd setting action.
|
## Dynamic type PCD can be registered callback function for Pcd setting action.
|
||||||
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicate maximum number of callback function
|
# PcdMaxPeiPcdCallBackNumberPerPcdEntry indicate maximum number of callback function
|
||||||
@ -364,6 +370,18 @@
|
|||||||
## Error level for hardware recorder.
|
## Error level for hardware recorder.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
|
||||||
|
|
||||||
|
##
|
||||||
|
# This PCD defines the print string.
|
||||||
|
# This PCD is a sample to explain FixedAtBuild String PCD usage.
|
||||||
|
##
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004
|
||||||
|
|
||||||
|
##
|
||||||
|
# This PCD defines the times to print hello world string.
|
||||||
|
# This PCD is a sample to explain FixedAtBuild UINT32 PCD usage.
|
||||||
|
##
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005
|
||||||
|
|
||||||
[PcdsFixedAtBuild.IA32]
|
[PcdsFixedAtBuild.IA32]
|
||||||
## Default EFI boot path name for IA32 architecture, this path is relative to
|
## Default EFI boot path name for IA32 architecture, this path is relative to
|
||||||
# EFI boot disk.
|
# EFI boot disk.
|
||||||
@ -410,6 +428,18 @@
|
|||||||
## Error level for hardware recorder.
|
## Error level for hardware recorder.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
|
||||||
|
|
||||||
|
##
|
||||||
|
# This PCD defines the print string.
|
||||||
|
# This PCD is a sample to explain Dynamic PCD usage.
|
||||||
|
##
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintString|L"UEFI Hello World!\n"|VOID*|0x40000004
|
||||||
|
|
||||||
|
##
|
||||||
|
# This PCD defines the times to print hello world string.
|
||||||
|
# This PCD is a sample to explain Dynamic UINT32 PCD usage.
|
||||||
|
##
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005
|
||||||
|
|
||||||
[PcdsPatchableInModule.common]
|
[PcdsPatchableInModule.common]
|
||||||
## Maximun number of performance log entries during PEI phase.
|
## Maximun number of performance log entries during PEI phase.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f
|
gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|40|UINT8|0x0001002f
|
||||||
@ -439,6 +469,12 @@
|
|||||||
## Error level for hardware recorder.
|
## Error level for hardware recorder.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|1|UINT16|0x40000002
|
||||||
|
|
||||||
|
##
|
||||||
|
# This PCD defines the times to print hello world string.
|
||||||
|
# This PCD is a sample to explain Patchable UINT32 PCD usage.
|
||||||
|
##
|
||||||
|
gEfiMdeModulePkgTokenSpaceGuid.PcdHelloWorldPrintTimes|1|UINT32|0x40000005
|
||||||
|
|
||||||
[PcdsFeatureFlag.IA32]
|
[PcdsFeatureFlag.IA32]
|
||||||
## If TRUE, the DXE IPL will load a 64-bit DxeCore.
|
## If TRUE, the DXE IPL will load a 64-bit DxeCore.
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE|BOOLEAN|0x0001003b
|
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode|TRUE|BOOLEAN|0x0001003b
|
||||||
|
Loading…
x
Reference in New Issue
Block a user