1, Correct the PCD PEIM to produce gEfiPcdPpi and gPcdPpi at same time;
2, Combine two action of InstallProtocolInstance for gEfiPcdProtocol and gPcdProtocol into InstallMultipleProtocolInstances. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9468 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
PCD DXE driver manage all PCD entry initialized in PEI phase and DXE phase, and
|
PCD DXE driver manage all PCD entry initialized in PEI phase and DXE phase, and
|
||||||
produce the implementation of PCD protocol.
|
produce the implementation of native PCD protocol and EFI_PCD_PROTOCOL defined in
|
||||||
|
PI 1.2 Vol3.
|
||||||
|
|
||||||
Copyright (c) 2006 - 2009, Intel Corporation
|
Copyright (c) 2006 - 2009, Intel Corporation
|
||||||
All rights reserved. This program and the accompanying materials
|
All rights reserved. This program and the accompanying materials
|
||||||
@@ -27,6 +28,10 @@ EFI_GUID *TmpTokenSpaceBuffer[PEI_EXMAPPING_TABLE_SIZE + DXE_EXMAPPING_TABLE_SIZ
|
|||||||
///
|
///
|
||||||
EFI_LOCK mPcdDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE(TPL_NOTIFY);
|
EFI_LOCK mPcdDatabaseLock = EFI_INITIALIZE_LOCK_VARIABLE(TPL_NOTIFY);
|
||||||
|
|
||||||
|
//
|
||||||
|
// PCD_PROTOCOL the native implementation provided by MdePkg which support dynamic
|
||||||
|
// type and dynamicEx type PCD.
|
||||||
|
//
|
||||||
PCD_PROTOCOL mPcdInstance = {
|
PCD_PROTOCOL mPcdInstance = {
|
||||||
DxePcdSetSku,
|
DxePcdSetSku,
|
||||||
|
|
||||||
@@ -66,6 +71,10 @@ PCD_PROTOCOL mPcdInstance = {
|
|||||||
DxePcdGetNextTokenSpace
|
DxePcdGetNextTokenSpace
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// EFI_PCD_PROTOCOL is defined in PI 1.2 Vol 3 which only support dynamicEx type
|
||||||
|
// PCD.
|
||||||
|
//
|
||||||
EFI_PCD_PROTOCOL mEfiPcdInstance = {
|
EFI_PCD_PROTOCOL mEfiPcdInstance = {
|
||||||
DxePcdSetSku,
|
DxePcdSetSku,
|
||||||
DxePcdGet8Ex,
|
DxePcdGet8Ex,
|
||||||
@@ -87,10 +96,8 @@ EFI_PCD_PROTOCOL mEfiPcdInstance = {
|
|||||||
DxePcdGetNextTokenSpace
|
DxePcdGetNextTokenSpace
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
|
||||||
// Static global to reduce the code size
|
|
||||||
//
|
|
||||||
EFI_HANDLE mNewHandle = NULL;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Main entry for PCD DXE driver.
|
Main entry for PCD DXE driver.
|
||||||
@@ -111,6 +118,7 @@ PcdDxeInit (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
|
EFI_HANDLE mNewHandle;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Make sure the Pcd Protocol is not already installed in the system
|
// Make sure the Pcd Protocol is not already installed in the system
|
||||||
@@ -120,23 +128,17 @@ PcdDxeInit (
|
|||||||
|
|
||||||
BuildPcdDxeDataBase ();
|
BuildPcdDxeDataBase ();
|
||||||
|
|
||||||
Status = gBS->InstallProtocolInterface (
|
mNewHandle = NULL;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Install PCD_PROTOCOL to handle dynamic type PCD
|
||||||
|
// Install EFI_PCD_PROTOCOL to handle dynamicEx type PCD
|
||||||
|
//
|
||||||
|
Status = gBS->InstallMultipleProtocolInterfaces (
|
||||||
&mNewHandle,
|
&mNewHandle,
|
||||||
&gPcdProtocolGuid,
|
&gPcdProtocolGuid,
|
||||||
EFI_NATIVE_INTERFACE,
|
&mPcdInstance,
|
||||||
&mPcdInstance
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
//
|
|
||||||
// Also install gEfiPcdProtocolGuid which is only support dynamic-ex type
|
|
||||||
// PCD.
|
|
||||||
//
|
|
||||||
mNewHandle = NULL;
|
|
||||||
Status = gBS->InstallProtocolInterface (
|
|
||||||
&mNewHandle,
|
|
||||||
&gEfiPcdProtocolGuid,
|
&gEfiPcdProtocolGuid,
|
||||||
EFI_NATIVE_INTERFACE,
|
|
||||||
&mEfiPcdInstance
|
&mEfiPcdInstance
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -14,6 +14,10 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|||||||
|
|
||||||
#include "Service.h"
|
#include "Service.h"
|
||||||
|
|
||||||
|
//
|
||||||
|
// Instance of PCD_PPI protocol is native implementation by MdePkg.
|
||||||
|
// This protocol instance support dynamic and dynamicEx type PCDs.
|
||||||
|
//
|
||||||
PCD_PPI mPcdPpiInstance = {
|
PCD_PPI mPcdPpiInstance = {
|
||||||
PeiPcdSetSku,
|
PeiPcdSetSku,
|
||||||
|
|
||||||
@@ -53,6 +57,10 @@ PCD_PPI mPcdPpiInstance = {
|
|||||||
PeiPcdGetNextTokenSpace
|
PeiPcdGetNextTokenSpace
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//
|
||||||
|
// Instance of EFI_PEI_PCD_PPI which is defined in PI 1.2 Vol 3.
|
||||||
|
// This PPI instance only support dyanmicEx type PCD.
|
||||||
|
//
|
||||||
EFI_PEI_PCD_PPI mEfiPcdPpiInstance = {
|
EFI_PEI_PCD_PPI mEfiPcdPpiInstance = {
|
||||||
PeiPcdSetSku,
|
PeiPcdSetSku,
|
||||||
|
|
||||||
@@ -90,7 +98,7 @@ EFI_PEI_PPI_DESCRIPTOR mEfiPpiPCD = {
|
|||||||
/**
|
/**
|
||||||
Main entry for PCD PEIM driver.
|
Main entry for PCD PEIM driver.
|
||||||
|
|
||||||
This routine initialize the PCD database for PEI phase and install PCD_PPI.
|
This routine initialize the PCD database for PEI phase and install PCD_PPI/EFI_PEI_PCD_PPI.
|
||||||
|
|
||||||
@param FileHandle Handle of the file being invoked.
|
@param FileHandle Handle of the file being invoked.
|
||||||
@param PeiServices Describes the list of possible PEI Services.
|
@param PeiServices Describes the list of possible PEI Services.
|
||||||
@@ -105,9 +113,24 @@ PcdPeimInit (
|
|||||||
IN CONST EFI_PEI_SERVICES **PeiServices
|
IN CONST EFI_PEI_SERVICES **PeiServices
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
EFI_STATUS Status;
|
||||||
|
|
||||||
BuildPcdDatabase ();
|
BuildPcdDatabase ();
|
||||||
|
|
||||||
return PeiServicesInstallPpi (&mPpiPCD);
|
//
|
||||||
|
// Install PCD_PPI which produce support for dynamic and dynamicEx PCD
|
||||||
|
//
|
||||||
|
Status = PeiServicesInstallPpi (&mPpiPCD);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
//
|
||||||
|
// Install EFI_PCD_PPI which produce support for dynamicEx PCD which is defined
|
||||||
|
// in PI 1.2 Vol 3 specification.
|
||||||
|
//
|
||||||
|
Status = PeiServicesInstallPpi (&mEfiPpiPCD);
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user