]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/LoadFile.h
MdePkg: Replace BSD License with BSD+Patent License
[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
19 typedef struct _EFI_PEI_LOAD_FILE_PPI EFI_PEI_LOAD_FILE_PPI;
20
21 /**
22 Loads a PEIM into memory for subsequent execution.
23
24 This service is the single member function of EFI_LOAD_FILE_PPI.
25 This service separates image loading and relocating from the PEI Foundation.
26
27 @param This Interface pointer that implements
28 the Load File PPI instance.
29 @param FileHandle File handle of the file to load.
30 @param ImageAddress Pointer to the address of the loaded image.
31 @param ImageSize Pointer to the size of the loaded image.
32 @param EntryPoint Pointer to the entry point of the image.
33 @param AuthenticationState On exit, points to the attestation
34 authentication state of the image
35 or 0 if no attestation was performed.
36
37 @retval EFI_SUCCESS The image was loaded successfully.
38 @retval EFI_OUT_OF_RESOURCES There was not enough memory.
39 @retval EFI_LOAD_ERROR There was no supported image in the file.
40 @retval EFI_INVALID_PARAMETER FileHandle was not a valid firmware file handle.
41 @retval EFI_INVALID_PARAMETER EntryPoint was NULL.
42 @retval EFI_UNSUPPORTED An image requires relocations or is not
43 memory mapped.
44 @retval EFI_WARN_BUFFER_TOO_SMALL
45 There is not enough heap to allocate the requested size.
46 This will not prevent the XIP image from being invoked.
47
48 **/
49 typedef
50 EFI_STATUS
51 (EFIAPI *EFI_PEI_LOAD_FILE)(
52 IN CONST EFI_PEI_LOAD_FILE_PPI *This,
53 IN EFI_PEI_FILE_HANDLE FileHandle,
54 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
55 OUT UINT64 *ImageSize,
56 OUT EFI_PHYSICAL_ADDRESS *EntryPoint,
57 OUT UINT32 *AuthenticationState
58 );
59
60 ///
61 /// This PPI is a pointer to the Load File service.
62 /// This service will be published by a PEIM. The PEI Foundation
63 /// will use this service to launch the known PEI module images.
64 ///
65 struct _EFI_PEI_LOAD_FILE_PPI {
66 EFI_PEI_LOAD_FILE LoadFile;
67 };
68
69 extern EFI_GUID gEfiPeiLoadFilePpiGuid;
70
71 #endif