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 - 2010, Intel Corporation. All rights reserved.<BR>
14 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 FfsHeader Pointer to the FFS header of the file to load.
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 FfsHeader 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_PEI_FILE_HANDLE FfsHeader
,
78 IN CONST EFI_PEI_SERVICES
**PeiServices
82 // This thunk module can only be used together with a PI PEI core, as we
83 // assume PeiServices Pointer Table can be located in a standard way defined
86 ASSERT ((*PeiServices
)->Hdr
.Revision
>= 0x00010000);
87 return (*PeiServices
)->InstallPpi (PeiServices
, &mPpiFrameworkLoadFile
);
93 Wrap the call to PI's EFI_PEI_LOAD_FILE_PPI.
95 @param This A pointer to EFI_PEI_FV_FILE_LOADER_PPI.
96 @param FfsHeader The pointer to the file header to be loaded by the Pe/Coff loader.
97 @param ImageAddress The loaded address of the Image.
98 @param ImageSize Pointer to the size of the loaded image.
99 @param EntryPoint Pointer to the entry point of the image.
101 @retval EFI_SUCCESS The image was loaded successfully.
102 @retval EFI_OUT_OF_RESOURCE There was not enought memory.
103 @retval EFI_INVALID_PARAMETER The contents of the FFS file did not contain a valid PE/COFF image that could be loaded.
108 IN EFI_PEI_FV_FILE_LOADER_PPI
*This
,
109 IN EFI_FFS_FILE_HEADER
*FfsHeader
,
110 OUT EFI_PHYSICAL_ADDRESS
*ImageAddress
,
111 OUT UINT64
*ImageSize
,
112 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
116 EFI_PEI_LOAD_FILE_PPI
*PiLoadFile
;
117 UINT32 AuthenticationState
;
119 Status
= PeiServicesLocatePpi (
120 &gEfiPeiLoadFilePpiGuid
,
123 (VOID
**) &PiLoadFile
125 ASSERT_EFI_ERROR (Status
);
127 return PiLoadFile
->LoadFile (
129 (EFI_PEI_FILE_HANDLE
) FfsHeader
,