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