mirror of https://github.com/acidanthera/audk.git
MdeModulePkg/PeiMain: Support EFI_PEI_CORE_FV_LOCATION_PPI
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1524 When shadowing PeiCore the EFI_PEI_CORE_FV_LOCATION_PPI should be checked to see if PeiCore not in BFV, otherwise just shadowing PeiCore from BFV. Test: Verified on internal platform and booting successfully. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
This commit is contained in:
parent
c93c0dc1d5
commit
9b23c7ba9c
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Definition of Pei Core Structures and Services
|
Definition of Pei Core Structures and Services
|
||||||
|
|
||||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -31,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
#include <Ppi/TemporaryRamSupport.h>
|
#include <Ppi/TemporaryRamSupport.h>
|
||||||
#include <Ppi/TemporaryRamDone.h>
|
#include <Ppi/TemporaryRamDone.h>
|
||||||
#include <Ppi/SecHobData.h>
|
#include <Ppi/SecHobData.h>
|
||||||
|
#include <Ppi/PeiCoreFvLocation.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/PeiCoreEntryPoint.h>
|
#include <Library/PeiCoreEntryPoint.h>
|
||||||
#include <Library/BaseLib.h>
|
#include <Library/BaseLib.h>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# 2) Dispatch PEIM from discovered FV.
|
# 2) Dispatch PEIM from discovered FV.
|
||||||
# 3) Handoff control to DxeIpl to load DXE core and enter DXE phase.
|
# 3) Handoff control to DxeIpl to load DXE core and enter DXE phase.
|
||||||
#
|
#
|
||||||
# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
# Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
#
|
#
|
||||||
# This program and the accompanying materials
|
# This program and the accompanying materials
|
||||||
# are licensed and made available under the terms and conditions of the BSD License
|
# are licensed and made available under the terms and conditions of the BSD License
|
||||||
|
@ -102,6 +102,7 @@
|
||||||
gEfiTemporaryRamDonePpiGuid ## SOMETIMES_CONSUMES
|
gEfiTemporaryRamDonePpiGuid ## SOMETIMES_CONSUMES
|
||||||
gEfiPeiReset2PpiGuid ## SOMETIMES_CONSUMES
|
gEfiPeiReset2PpiGuid ## SOMETIMES_CONSUMES
|
||||||
gEfiSecHobDataPpiGuid ## SOMETIMES_CONSUMES
|
gEfiSecHobDataPpiGuid ## SOMETIMES_CONSUMES
|
||||||
|
gEfiPeiCoreFvLocationPpiGuid ## SOMETIMES_CONSUMES
|
||||||
|
|
||||||
[Pcd]
|
[Pcd]
|
||||||
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES
|
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize ## CONSUMES
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/** @file
|
/** @file
|
||||||
Pei Core Main Entry Point
|
Pei Core Main Entry Point
|
||||||
|
|
||||||
Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials
|
This program and the accompanying materials
|
||||||
are licensed and made available under the terms and conditions of the BSD License
|
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
|
which accompanies this distribution. The full text of the license may be found at
|
||||||
|
@ -80,22 +80,49 @@ ShadowPeiCore (
|
||||||
IN PEI_CORE_INSTANCE *PrivateData
|
IN PEI_CORE_INSTANCE *PrivateData
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
EFI_PEI_FILE_HANDLE PeiCoreFileHandle;
|
EFI_PEI_FILE_HANDLE PeiCoreFileHandle;
|
||||||
EFI_PHYSICAL_ADDRESS EntryPoint;
|
EFI_PHYSICAL_ADDRESS EntryPoint;
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
UINT32 AuthenticationState;
|
UINT32 AuthenticationState;
|
||||||
|
UINTN Index;
|
||||||
|
EFI_PEI_CORE_FV_LOCATION_PPI *PeiCoreFvLocationPpi;
|
||||||
|
UINTN PeiCoreFvIndex;
|
||||||
|
|
||||||
PeiCoreFileHandle = NULL;
|
PeiCoreFileHandle = NULL;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Find the PEI Core in the BFV
|
// Default PeiCore is in BFV
|
||||||
//
|
//
|
||||||
Status = PrivateData->Fv[0].FvPpi->FindFileByType (
|
PeiCoreFvIndex = 0;
|
||||||
PrivateData->Fv[0].FvPpi,
|
//
|
||||||
EFI_FV_FILETYPE_PEI_CORE,
|
// Find the PEI Core either from EFI_PEI_CORE_FV_LOCATION_PPI indicated FV or BFV
|
||||||
PrivateData->Fv[0].FvHandle,
|
//
|
||||||
&PeiCoreFileHandle
|
Status = PeiServicesLocatePpi (
|
||||||
);
|
&gEfiPeiCoreFvLocationPpiGuid,
|
||||||
|
0,
|
||||||
|
NULL,
|
||||||
|
(VOID **) &PeiCoreFvLocationPpi
|
||||||
|
);
|
||||||
|
if (!EFI_ERROR (Status) && (PeiCoreFvLocationPpi->PeiCoreFvLocation != NULL)) {
|
||||||
|
//
|
||||||
|
// If PeiCoreFvLocation present, the PEI Core should be found from indicated FV
|
||||||
|
//
|
||||||
|
for (Index = 0; Index < PrivateData->FvCount; Index ++) {
|
||||||
|
if (PrivateData->Fv[Index].FvHandle == PeiCoreFvLocationPpi->PeiCoreFvLocation) {
|
||||||
|
PeiCoreFvIndex = Index;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ASSERT (Index < PrivateData->FvCount);
|
||||||
|
}
|
||||||
|
//
|
||||||
|
// Find PEI Core from the given FV index
|
||||||
|
//
|
||||||
|
Status = PrivateData->Fv[PeiCoreFvIndex].FvPpi->FindFileByType (
|
||||||
|
PrivateData->Fv[PeiCoreFvIndex].FvPpi,
|
||||||
|
EFI_FV_FILETYPE_PEI_CORE,
|
||||||
|
PrivateData->Fv[PeiCoreFvIndex].FvHandle,
|
||||||
|
&PeiCoreFileHandle
|
||||||
|
);
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue