]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/LoadFile.h
Removed tabs and fixed some minor coding style issues. Also fixed typo in EFI_PEI_ENT...
[mirror_edk2.git] / MdePkg / Include / Ppi / LoadFile.h
1 /** @file
2 Load image file from fv to memory.
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 Module Name: LoadFile.h
14
15 @par Revision Reference:
16 This PPI is defined in PI Version 1.00.
17
18 **/
19
20 #ifndef __FV_FILE_LOADER_PPI_H__
21 #define __FV_FILE_LOADER_PPI_H__
22
23 #define EFI_PEI_LOAD_FILE_PPI_GUID \
24 { 0xb9e0abfe, 0x5979, 0x4914, { 0x97, 0x7f, 0x6d, 0xee, 0x78, 0xc2, 0x78, 0xa6 } }
25
26
27 typedef struct _EFI_PEI_LOAD_FILE_PPI EFI_PEI_LOAD_FILE_PPI;
28
29 /**
30 This service is the single member function of EFI_LOAD_FILE_PPI. This service separates
31 image loading and relocating from the PEI Foundation.
32
33 @param This Interface pointer that implements
34 the Load File PPI instance.
35
36 @param FileHandle File handle of the file to load.
37 Type EFI_PEI_FILE_HANDLE is defined in
38 FfsFindNextFile().
39
40 @param ImageAddress Pointer to the address of the
41 loaded image.
42
43 @param ImageSize Pointer to the size of the loaded
44 image.
45
46 @param EntryPoint Pointer to the entry point of the
47 image.
48
49 @param AuthenticationState On exit, points to the attestation
50 authentication state of the image
51 or 0 if no attestation was
52 performed. The format of
53 AuthenticationState is defined in
54 EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI.ExtractSection()
55
56
57 @retval EFI_SUCCESS The image was loaded successfully.
58
59 @retval EFI_OUT_OF_RESOURCES There was not enough memory.
60
61 @retval EFI_LOAD_ERROR There was no supported image in
62 the file EFI_INVALID_PARAMETER
63 FileHandle was not a valid
64 firmware file handle.
65 @retval EFI_INVALID_PARAMETER EntryPoint was NULL.
66
67 @retval EFI_NOT_SUPPORTED An image requires relocations or
68 is not memory mapped.
69
70 **/
71 typedef
72 EFI_STATUS
73 (EFIAPI *EFI_PEI_LOAD_FILE) (
74 IN CONST EFI_PEI_LOAD_FILE_PPI *This,
75 IN CONST EFI_PEI_FILE_HANDLE FileHandle,
76 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
77 OUT UINT64 *ImageSize,
78 OUT EFI_PHYSICAL_ADDRESS *EntryPoint,
79 OUT UINT32 *AuthenticationState
80 );
81
82
83 /**
84 This PPI is a pointer to the Load File service.
85 This service will be published by a PEIM. The PEI Foundation
86 will use this service to launch the known PEI module images.
87
88
89 @param LoadFile Loads a PEIM into memory for subsequent
90 execution. See the LoadFile() function
91 description.
92
93 **/
94 struct _EFI_PEI_LOAD_FILE_PPI {
95 EFI_PEI_LOAD_FILE LoadFile;
96 };
97
98
99
100 #define EFI_PEI_FV_FILE_LOADER_GUID \
101 { \
102 0x7e1f0d85, 0x4ff, 0x4bb2, {0x86, 0x6a, 0x31, 0xa2, 0x99, 0x6a, 0x48, 0xa8 } \
103 }
104
105 typedef struct _EFI_PEI_FV_FILE_LOADER_PPI EFI_PEI_FV_FILE_LOADER_PPI;
106
107 /**
108 Loads a PEIM into memory for subsequent execution.
109
110 @param This Interface pointer that implements the Load File PPI instance.
111 @param FfsHeader Pointer to the FFS header of the file to load.
112 @param ImageAddress Pointer to the address of the loaded Image
113 @param ImageSize Pointer to the size of the loaded image.
114 @param EntryPoint Pointer to the entry point of the image.
115
116 @retval EFI_SUCCESS The image was loaded successfully.
117 @retval EFI_OUT_OF_RESOURCES There was not enough memory.
118 @retval EFI_INVALID_PARAMETER The contents of the FFS file did not
119 contain a valid PE/COFF image that could be loaded.
120
121 **/
122 typedef
123 EFI_STATUS
124 (EFIAPI *EFI_PEI_FV_LOAD_FILE) (
125 IN EFI_PEI_FV_FILE_LOADER_PPI *This,
126 IN EFI_FFS_FILE_HEADER *FfsHeader,
127 OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
128 OUT UINT64 *ImageSize,
129 OUT EFI_PHYSICAL_ADDRESS *EntryPoint
130 );
131
132 /**
133 @par Ppi Description:
134 This PPI is a pointer to the Load File service. This service will be
135 published by a PEIM.The PEI Foundation will use this service to
136 launch the known non-XIP PE/COFF PEIM images. This service may
137 depend upon the presence of the EFI_PEI_PERMANENT_MEMORY_INSTALLED_PPI.
138
139 @param FvLoadFile
140 Loads a PEIM into memory for subsequent execution
141
142 **/
143 struct _EFI_PEI_FV_FILE_LOADER_PPI {
144 EFI_PEI_FV_LOAD_FILE FvLoadFile;
145 };
146
147 extern EFI_GUID gEfiPeiFvFileLoaderPpiGuid;
148
149 #endif