2 MDE PI library functions and macros for PEI phase
4 Copyright (c) 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #include <Ppi/FirmwareVolumeInfo.h>
17 #include <Guid/FirmwareFileSystem2.h>
20 #include <Library/DebugLib.h>
21 #include <Library/MemoryAllocationLib.h>
22 #include <Library/PeiServicesLib.h>
23 #include <Library/PeiPiLib.h>
26 STATIC CONST EFI_PEI_FIRMWARE_VOLUME_INFO_PPI mFvInfoPpiTemplate
= {
27 EFI_FIRMWARE_FILE_SYSTEM2_GUID
,
31 NULL
//ParentFileName;
36 PeiPiLibBuildPiFvInfoPpi (
37 IN EFI_PHYSICAL_ADDRESS FvStart
,
39 IN EFI_GUID
*ParentFvName
,
40 IN EFI_GUID
*ParentFileName
44 EFI_PEI_FIRMWARE_VOLUME_INFO_PPI
*FvInfoPpi
;
45 EFI_PEI_PPI_DESCRIPTOR
*FvInfoPpiDescriptor
;
47 FvInfoPpi
= AllocateCopyPool (sizeof (*FvInfoPpi
), &mFvInfoPpiTemplate
);
48 ASSERT( FvInfoPpi
!= NULL
);
50 FvInfoPpi
->FvInfo
= (VOID
*) (UINTN
) FvStart
;
51 FvInfoPpi
->FvInfoSize
= (UINT32
) FvLength
;
52 FvInfoPpi
->ParentFvName
= ParentFvName
;
53 FvInfoPpi
->ParentFileName
= ParentFileName
;
56 FvInfoPpiDescriptor
= AllocatePool (sizeof(EFI_PEI_PPI_DESCRIPTOR
));
57 ASSERT (FvInfoPpiDescriptor
!= NULL
);
59 FvInfoPpiDescriptor
->Flags
= EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
;
60 FvInfoPpiDescriptor
->Guid
= &gEfiPeiFirmwareVolumeInfoPpiGuid
;
61 FvInfoPpiDescriptor
->Ppi
= (VOID
*) FvInfoPpi
;
62 Status
= PeiServicesInstallPpi (FvInfoPpiDescriptor
);
63 ASSERT_EFI_ERROR (Status
);