]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Ppi/LoadFile.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdePkg / Include / Ppi / LoadFile.h
CommitLineData
5879b875 1/** @file\r
9095d37b 2 Load image file from fv to memory.\r
5879b875 3\r
9095d37b 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
9344f092 5 SPDX-License-Identifier: BSD-2-Clause-Patent\r
5879b875 6\r
5879b875 7 @par Revision Reference:\r
0047820e 8 This PPI is introduced in PI Version 1.0.\r
5879b875 9\r
10**/\r
11\r
9b537078 12#ifndef __LOAD_FILE_PPI_H__\r
13#define __LOAD_FILE_PPI_H__\r
5879b875 14\r
15#define EFI_PEI_LOAD_FILE_PPI_GUID \\r
00edb218 16 { 0xb9e0abfe, 0x5979, 0x4914, { 0x97, 0x7f, 0x6d, 0xee, 0x78, 0xc2, 0x78, 0xa6 } }\r
5879b875 17\r
00edb218 18typedef struct _EFI_PEI_LOAD_FILE_PPI EFI_PEI_LOAD_FILE_PPI;\r
5879b875 19\r
20/**\r
d7132512
LG
21 Loads a PEIM into memory for subsequent execution.\r
22\r
dafa11b1 23 This service is the single member function of EFI_LOAD_FILE_PPI.\r
24 This service separates image loading and relocating from the PEI Foundation.\r
9095d37b 25\r
dafa11b1 26 @param This Interface pointer that implements\r
27 the Load File PPI instance.\r
28 @param FileHandle File handle of the file to load.\r
29 @param ImageAddress Pointer to the address of the loaded image.\r
30 @param ImageSize Pointer to the size of the loaded image.\r
31 @param EntryPoint Pointer to the entry point of the image.\r
32 @param AuthenticationState On exit, points to the attestation\r
33 authentication state of the image\r
34 or 0 if no attestation was performed.\r
35\r
36 @retval EFI_SUCCESS The image was loaded successfully.\r
00edb218 37 @retval EFI_OUT_OF_RESOURCES There was not enough memory.\r
dafa11b1 38 @retval EFI_LOAD_ERROR There was no supported image in the file.\r
39 @retval EFI_INVALID_PARAMETER FileHandle was not a valid firmware file handle.\r
40 @retval EFI_INVALID_PARAMETER EntryPoint was NULL.\r
5fbfa2d0 41 @retval EFI_UNSUPPORTED An image requires relocations or is not\r
dafa11b1 42 memory mapped.\r
9095d37b 43 @retval EFI_WARN_BUFFER_TOO_SMALL\r
5d7f3126
LG
44 There is not enough heap to allocate the requested size.\r
45 This will not prevent the XIP image from being invoked.\r
46\r
5879b875 47**/\r
48typedef\r
49EFI_STATUS\r
8b13229b 50(EFIAPI *EFI_PEI_LOAD_FILE)(\r
dafa11b1 51 IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r
52 IN EFI_PEI_FILE_HANDLE FileHandle,\r
53 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,\r
54 OUT UINT64 *ImageSize,\r
55 OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
56 OUT UINT32 *AuthenticationState\r
2f88bd3a 57 );\r
5879b875 58\r
dafa11b1 59///\r
60/// This PPI is a pointer to the Load File service.\r
61/// This service will be published by a PEIM. The PEI Foundation\r
62/// will use this service to launch the known PEI module images.\r
63///\r
5879b875 64struct _EFI_PEI_LOAD_FILE_PPI {\r
2f88bd3a 65 EFI_PEI_LOAD_FILE LoadFile;\r
5879b875 66};\r
67\r
2f88bd3a 68extern EFI_GUID gEfiPeiLoadFilePpiGuid;\r
5879b875 69\r
70#endif\r