2 Module produces EFI_FIRMWARE_VOLUME_INFO_PPI based on each FV HOB if no such PPI exist for the FV.
4 UEFI PI Spec supersedes Intel's Framework Specs.
5 EFI_FIRMWARE_VOLUME_INFO_PPI defined in PI spec is required by PI PEI core to dispatch PEIMs or find DXE core
7 This module produces produces EFI_FIRMWARE_VOLUME_INFO_PPI based on each FV HOB if no such PPI exist for the FV.
8 This module is used on platform when both of these two conditions are true:
9 1) Framework platform module produces FV HOB but does not build EFI_FIRMWARE_VOLUME_INFO_PPI.
10 2) The platform has PI PEI core that cosumes EFI_FIRMWARE_VOLUME_INFO_PPI to dispatch PEIMs or DXE core
11 in FVs other than Boot Fimware Volume.
13 Copyright (c) 2008 Intel Corporation. <BR>
14 All rights reserved. This program and the accompanying materials
15 are licensed and made available under the terms and conditions of the BSD License
16 which accompanies this distribution. The full text of the license may be found at
17 http://opensource.org/licenses/bsd-license.php
19 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
20 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
26 #include <Ppi/FirmwareVolumeInfo.h>
27 #include <Library/DebugLib.h>
28 #include <Library/PeiServicesTablePointerLib.h>
29 #include <Library/PeiServicesLib.h>
30 #include <Library/HobLib.h>
31 #include <Library/PeiPiLib.h>
35 Check if there is a matching EFI_PEI_FIRMWARE_VOLUME_INFO_PPI for the FV described by FvHob.
37 This function located all existing instance of EFI_PEI_FIRMWARE_VOLUME_INFO_PPI in the platform.
38 Then it compare the base address of the FVs found with that of FvHob. If a matching base address is
39 found, the function return TRUE. Otherwise, FALSE is returned.
41 If a matching base address of FV is found but the length of FV does not match, then ASSERT ().
43 @param FvHob The FV Hob.
45 @retval TRUE A instance of EFI_PEI_FIRMWARE_VOLUME_INFO_PPI is already installed.
50 EFI_HOB_FIRMWARE_VOLUME
* FvHob
55 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
57 for (Idx
= 0; ; Idx
++) {
58 Status
= PeiServicesLocatePpi (
59 &gEfiPeiFirmwareVolumeInfoPpiGuid
,
64 if (!EFI_ERROR (Status
)) {
65 if (FvHob
->BaseAddress
== (EFI_PHYSICAL_ADDRESS
) (UINTN
) FvInfoPpi
->FvInfo
) {
66 ASSERT (FvHob
->Length
== (UINT64
) FvInfoPpi
->FvInfoSize
);
78 PEIM's standard entry point.
80 @param FfsHeader Image's header
81 @param PeiServices Pointer of EFI_PEI_SERVICES
82 @return EFI_SUCESS This entry point always return successfully.
88 IN EFI_PEI_FILE_HANDLE FfsHeader
,
89 IN CONST EFI_PEI_SERVICES
**PeiServices
92 EFI_PEI_HOB_POINTERS HobPointer
;
94 for (HobPointer
.Raw
= GetNextHob (EFI_HOB_TYPE_FV
, GetHobList ());
95 HobPointer
.Raw
!= NULL
;
96 HobPointer
.Raw
= GetNextHob (EFI_HOB_TYPE_FV
, GET_NEXT_HOB (HobPointer
))) {
97 if (!FvInfoPpiInstalled (HobPointer
.FirmwareVolume
)) {
98 PiLibInstallFvInfoPpi (
99 &(((EFI_FIRMWARE_VOLUME_HEADER
*) (UINTN
) HobPointer
.FirmwareVolume
->BaseAddress
)->FileSystemGuid
),
100 (VOID
*) (UINTN
) HobPointer
.FirmwareVolume
->BaseAddress
,
101 (UINT32
) HobPointer
.FirmwareVolume
->Length
,