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