2 Module produce Framework's EFI_PEI_FV_FILE_LOADER_PPI top of EFI_PEI_LOAD_FILE_PPI.
4 UEFI PI Spec supersedes Intel's Framework Specs.
5 EFI_PEI_FV_FILE_LOADER_PPI defined in Intel Framework Pkg is replaced by EFI_PEI_LOAD_FILE_PPI
7 This module produces EFI_PEI_FV_FILE_LOADER_PPI on top of EFI_PEI_LOAD_FILE_PPI .
8 This module is used on platform when both of these two conditions are true:
9 1) Framework module consumes EFI_PEI_FV_FILE_LOADER_PPI is present.
10 2) The platform has PI modules that produce EFI_PEI_LOAD_FILE_PPI.
12 Copyright (c) 2008, Intel Corporation
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/LoadFile.h>
27 #include <Ppi/FvLoadFile.h>
28 #include <Library/DebugLib.h>
29 #include <Library/PeiServicesLib.h>
33 Wrap the call to PI's EFI_PEI_LOAD_FILE_PPI.
35 @param This A pointer to EFI_PEI_FV_FILE_LOADER_PPI.
36 @param FileHeader The pointer to the file header to be loaded by the Pe/Coff loader.
37 @param ImageAddress The loaded address of the Image.
38 @param ImageSize Pointer to the size of the loaded image.
39 @param EntryPoint Pointer to the entry point of the image.
41 @retval EFI_SUCCESS The image was loaded successfully.
42 @retval EFI_OUT_OF_RESOURCE There was not enought memory.
43 @retval EFI_INVALID_PARAMETER The contents of the FFS file did not contain a valid PE/COFF image that could be loaded.
48 IN EFI_PEI_FV_FILE_LOADER_PPI
*This
,
49 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
50 OUT EFI_PHYSICAL_ADDRESS
*ImageAddress
,
51 OUT UINT64
*ImageSize
,
52 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
55 EFI_PEI_FV_FILE_LOADER_PPI mLoadFilePpi
= {
59 EFI_PEI_PPI_DESCRIPTOR mPpiFrameworkLoadFile
= {
60 (EFI_PEI_PPI_DESCRIPTOR_PPI
| EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST
),
61 &gEfiPeiFvFileLoaderPpiGuid
,
66 Standard entry point of a PEIM.
68 @param FfsHeadher The FFS file header
69 @param PeiServices General purpose services available to every PEIM.
71 @retval EFI_SUCCESS If the gEfiPeiReadOnlyVariablePpiGuid interface could be successfully installed.
77 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
78 IN CONST EFI_PEI_SERVICES
**PeiServices
81 return (*PeiServices
)->InstallPpi (PeiServices
, &mPpiFrameworkLoadFile
);
87 Wrap the call to PI's EFI_PEI_LOAD_FILE_PPI.
89 @param This A pointer to EFI_PEI_FV_FILE_LOADER_PPI.
90 @param FileHeader The pointer to the file header to be loaded by the Pe/Coff loader.
91 @param ImageAddress The loaded address of the Image.
92 @param ImageSize Pointer to the size of the loaded image.
93 @param EntryPoint Pointer to the entry point of the image.
95 @retval EFI_SUCCESS The image was loaded successfully.
96 @retval EFI_OUT_OF_RESOURCE There was not enought memory.
97 @retval EFI_INVALID_PARAMETER The contents of the FFS file did not contain a valid PE/COFF image that could be loaded.
102 IN EFI_PEI_FV_FILE_LOADER_PPI
*This
,
103 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
104 OUT EFI_PHYSICAL_ADDRESS
*ImageAddress
,
105 OUT UINT64
*ImageSize
,
106 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
110 EFI_PEI_LOAD_FILE_PPI
*PiLoadFile
;
111 UINT32 AuthenticationState
;
113 Status
= PeiServicesLocatePpi (
114 &gEfiPeiLoadFilePpiGuid
,
117 (VOID
**) &PiLoadFile
119 ASSERT_EFI_ERROR (Status
);
121 return PiLoadFile
->LoadFile (
123 (EFI_PEI_FILE_HANDLE
) FfsHeader
,