From c896d682576a9159a58b1d8e3840019d0c835593 Mon Sep 17 00:00:00 2001 From: klu2 Date: Tue, 10 Nov 2009 08:45:07 +0000 Subject: Make PcdPeim/PcdDxe driver also produce EFI_PCD_PPI/EFI_PCD_PROTOCOL defined in PI 1.2 vol3. The EFI_PCD_PPI/EFI_PCD_PROTOCOL only support dynamic-ex type PCD, but original PCD_PPI/PCD_PROTOCOL in MdePkg support dynamic and dynamic-ex type PCDs. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9401 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/PCD/Dxe/Pcd.c | 35 +++++++++++++++++++++++++++++++- MdeModulePkg/Universal/PCD/Dxe/Pcd.inf | 3 ++- MdeModulePkg/Universal/PCD/Dxe/Service.h | 1 + 3 files changed, 37 insertions(+), 2 deletions(-) (limited to 'MdeModulePkg/Universal/PCD/Dxe') diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c index 288e7f785b..0bb44ff81c 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.c @@ -2,7 +2,7 @@ PCD DXE driver manage all PCD entry initialized in PEI phase and DXE phase, and produce the implementation of PCD protocol. -Copyright (c) 2006 - 2007, Intel Corporation +Copyright (c) 2006 - 2009, 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 @@ -66,6 +66,26 @@ PCD_PROTOCOL mPcdInstance = { DxePcdGetNextTokenSpace }; +EFI_PCD_PROTOCOL mEfiPcdInstance = { + DxePcdSetSku, + DxePcdGet8Ex, + DxePcdGet16Ex, + DxePcdGet32Ex, + DxePcdGet64Ex, + DxePcdGetPtrEx, + DxePcdGetBoolEx, + DxePcdGetSizeEx, + DxePcdSet8Ex, + DxePcdSet16Ex, + DxePcdSet32Ex, + DxePcdSet64Ex, + DxePcdSetPtrEx, + DxePcdSetBoolEx, + (EFI_PCD_PROTOCOL_CALLBACK_ON_SET) DxeRegisterCallBackOnSet, + (EFI_PCD_PROTOCOL_CANCEL_CALLBACK) DxeUnRegisterCallBackOnSet, + DxePcdGetNextToken, + DxePcdGetNextTokenSpace +}; // // Static global to reduce the code size @@ -107,6 +127,19 @@ PcdDxeInit ( &mPcdInstance ); + + // + // Also install gEfiPcdProtocolGuid which is only support dynamic-ex type + // PCD. + // + mNewHandle = NULL; + Status = gBS->InstallProtocolInterface ( + &mNewHandle, + &gEfiPcdProtocolGuid, + EFI_NATIVE_INTERFACE, + &mEfiPcdInstance + ); + ASSERT_EFI_ERROR (Status); return EFI_SUCCESS; diff --git a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf index 13b1859174..0b0486737e 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf +++ b/MdeModulePkg/Universal/PCD/Dxe/Pcd.inf @@ -318,7 +318,8 @@ [Protocols] gPcdProtocolGuid ## PRODUCES - + gEfiPcdProtocolGuid ## PRODUCES + [FixedPcd.common] gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.h b/MdeModulePkg/Universal/PCD/Dxe/Service.h index 8978aa8203..583b0d657d 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.h +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.h @@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include +#include #include #include #include -- cgit v1.2.3