]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
2 | PI PEI master include file. This file should match the PI spec.\r | |
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 |
959ccb23 | 6 | \r |
959ccb23 | 7 | @par Revision Reference:\r |
27dc016c | 8 | PI Version 1.6.\r |
959ccb23 | 9 | \r |
10 | **/\r | |
11 | \r | |
12 | #ifndef __PI_PEICIS_H__\r | |
13 | #define __PI_PEICIS_H__\r | |
14 | \r | |
d7dfd027 | 15 | #include <Uefi/UefiMultiPhase.h>\r |
959ccb23 | 16 | #include <Pi/PiMultiPhase.h>\r |
17 | \r | |
6de794cd | 18 | ///\r |
af2dc6a7 | 19 | /// The handles of EFI FV.\r |
9095d37b | 20 | ///\r |
00edb218 | 21 | typedef VOID *EFI_PEI_FV_HANDLE;\r |
6de794cd | 22 | \r |
23 | ///\r | |
af2dc6a7 | 24 | /// The handles of EFI FFS.\r |
9095d37b | 25 | ///\r |
00edb218 | 26 | typedef VOID *EFI_PEI_FILE_HANDLE;\r |
959ccb23 | 27 | \r |
6de794cd | 28 | ///\r |
af2dc6a7 | 29 | /// Declare the forward reference data structure for EFI_PEI_SERVICE.\r |
9095d37b | 30 | ///\r |
959ccb23 | 31 | typedef struct _EFI_PEI_SERVICES EFI_PEI_SERVICES;\r |
6de794cd | 32 | \r |
33 | ///\r | |
af2dc6a7 | 34 | /// Declare the forward reference data structure for EFI_PEI_NOTIFY_DESCRIPTOR.\r |
9095d37b | 35 | ///\r |
959ccb23 | 36 | typedef struct _EFI_PEI_NOTIFY_DESCRIPTOR EFI_PEI_NOTIFY_DESCRIPTOR;\r |
37 | \r | |
38 | \r | |
39 | #include <Ppi/CpuIo.h>\r | |
40 | #include <Ppi/PciCfg2.h>\r | |
41 | \r | |
fb3df220 | 42 | \r |
959ccb23 | 43 | /**\r |
9095d37b LG |
44 | The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI\r |
45 | Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.\r | |
959ccb23 | 46 | \r |
6de794cd | 47 | @param FileHandle Pointer to the FFS file header.\r |
959ccb23 | 48 | @param PeiServices Describes the list of possible PEI Services.\r |
49 | \r | |
373b5cf9 | 50 | @retval EFI_SUCCESS The PEI completed successfully.\r |
51 | @retval !EFI_SUCCESS There is error in PEIM.\r | |
959ccb23 | 52 | \r |
53 | **/\r | |
54 | typedef\r | |
55 | EFI_STATUS\r | |
1c9d209f | 56 | (EFIAPI *EFI_PEIM_ENTRY_POINT2)(\r |
b0d803fe | 57 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
58 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
959ccb23 | 59 | );\r |
60 | \r | |
61 | /**\r | |
62 | Entry point of the notification callback function itself within the PEIM.\r | |
63 | \r | |
64 | @param PeiServices Indirect reference to the PEI Services Table.\r | |
65 | @param NotifyDescriptor Address of the notification descriptor data structure.\r | |
66 | @param Ppi Address of the PPI that was installed.\r | |
67 | \r | |
373b5cf9 | 68 | @return Status of the notification.\r |
66e5133c | 69 | The status code returned from this function is ignored.\r |
959ccb23 | 70 | **/\r |
71 | typedef\r | |
72 | EFI_STATUS\r | |
6de794cd | 73 | (EFIAPI *EFI_PEIM_NOTIFY_ENTRY_POINT)(\r |
959ccb23 | 74 | IN EFI_PEI_SERVICES **PeiServices,\r |
75 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
76 | IN VOID *Ppi\r | |
77 | );\r | |
78 | \r | |
79 | //\r | |
80 | // PEI Ppi Services List Descriptors\r | |
81 | //\r | |
82 | #define EFI_PEI_PPI_DESCRIPTOR_PIC 0x00000001\r | |
83 | #define EFI_PEI_PPI_DESCRIPTOR_PPI 0x00000010\r | |
84 | #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK 0x00000020\r | |
85 | #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH 0x00000040\r | |
86 | #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES 0x00000060\r | |
87 | #define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST 0x80000000\r | |
88 | \r | |
6de794cd | 89 | ///\r |
90 | /// The data structure through which a PEIM describes available services to the PEI Foundation.\r | |
9095d37b | 91 | ///\r |
959ccb23 | 92 | typedef struct {\r |
1bf79370 LG |
93 | ///\r |
94 | /// This field is a set of flags describing the characteristics of this imported table entry.\r | |
95 | /// All flags are defined as EFI_PEI_PPI_DESCRIPTOR_***, which can also be combined into one.\r | |
96 | ///\r | |
959ccb23 | 97 | UINTN Flags;\r |
1bf79370 LG |
98 | ///\r |
99 | /// The address of the EFI_GUID that names the interface.\r | |
100 | ///\r | |
959ccb23 | 101 | EFI_GUID *Guid;\r |
1bf79370 LG |
102 | ///\r |
103 | /// A pointer to the PPI. It contains the information necessary to install a service.\r | |
104 | ///\r | |
959ccb23 | 105 | VOID *Ppi;\r |
106 | } EFI_PEI_PPI_DESCRIPTOR;\r | |
107 | \r | |
9095d37b LG |
108 | ///\r |
109 | /// The data structure in a given PEIM that tells the PEI\r | |
6de794cd | 110 | /// Foundation where to invoke the notification service.\r |
9095d37b | 111 | ///\r |
959ccb23 | 112 | struct _EFI_PEI_NOTIFY_DESCRIPTOR {\r |
1bf79370 | 113 | ///\r |
af2dc6a7 | 114 | /// Details if the type of notification are callback or dispatch.\r |
1bf79370 | 115 | ///\r |
959ccb23 | 116 | UINTN Flags;\r |
1bf79370 LG |
117 | ///\r |
118 | /// The address of the EFI_GUID that names the interface.\r | |
119 | ///\r | |
959ccb23 | 120 | EFI_GUID *Guid;\r |
1bf79370 LG |
121 | ///\r |
122 | /// Address of the notification callback function itself within the PEIM.\r | |
123 | ///\r | |
959ccb23 | 124 | EFI_PEIM_NOTIFY_ENTRY_POINT Notify;\r |
125 | };\r | |
126 | \r | |
8546d5a6 | 127 | ///\r |
128 | /// This data structure is the means by which callable services are installed and\r | |
129 | /// notifications are registered in the PEI phase.\r | |
130 | ///\r | |
131 | typedef union {\r | |
132 | ///\r | |
133 | /// The typedef structure of the notification descriptor.\r | |
134 | ///\r | |
135 | EFI_PEI_NOTIFY_DESCRIPTOR Notify;\r | |
136 | ///\r | |
137 | /// The typedef structure of the PPI descriptor.\r | |
138 | ///\r | |
139 | EFI_PEI_PPI_DESCRIPTOR Ppi;\r | |
140 | } EFI_PEI_DESCRIPTOR;\r | |
141 | \r | |
959ccb23 | 142 | /**\r |
9095d37b LG |
143 | This service is the first one provided by the PEI Foundation. This function\r |
144 | installs an interface in the PEI PPI database by GUID. The purpose of the\r | |
145 | service is to publish an interface that other parties can use to call\r | |
959ccb23 | 146 | additional PEIMs.\r |
147 | \r | |
148 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table\r | |
149 | published by the PEI Foundation.\r | |
150 | @param PpiList A pointer to the list of interfaces that the caller shall install.\r | |
151 | \r | |
152 | @retval EFI_SUCCESS The interface was successfully installed.\r | |
9095d37b LG |
153 | @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI\r |
154 | descriptors in the list do not have the\r | |
af2dc6a7 | 155 | EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r |
959ccb23 | 156 | @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r |
157 | \r | |
158 | **/\r | |
159 | typedef\r | |
160 | EFI_STATUS\r | |
6de794cd | 161 | (EFIAPI *EFI_PEI_INSTALL_PPI)(\r |
1c280088 | 162 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
163 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r | |
959ccb23 | 164 | );\r |
165 | \r | |
166 | /**\r | |
9095d37b LG |
167 | This function reinstalls an interface in the PEI PPI database by GUID.\r |
168 | The purpose of the service is to publish an interface that other parties\r | |
169 | can use to replace a same-named interface in the protocol database\r | |
170 | with a different interface.\r | |
959ccb23 | 171 | \r |
172 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table\r | |
173 | published by the PEI Foundation.\r | |
174 | @param OldPpi A pointer to the former PPI in the database.\r | |
175 | @param NewPpi A pointer to the new interfaces that the caller shall install.\r | |
176 | \r | |
177 | @retval EFI_SUCCESS The interface was successfully installed.\r | |
9095d37b | 178 | @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the\r |
959ccb23 | 179 | list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.\r |
180 | @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r | |
181 | @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.\r | |
182 | \r | |
183 | **/\r | |
184 | typedef\r | |
185 | EFI_STATUS\r | |
6de794cd | 186 | (EFIAPI *EFI_PEI_REINSTALL_PPI)(\r |
1c280088 | 187 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
188 | IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,\r | |
189 | IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi\r | |
959ccb23 | 190 | );\r |
191 | \r | |
192 | /**\r | |
9095d37b | 193 | This function locates an interface in the PEI PPI database by GUID.\r |
959ccb23 | 194 | \r |
195 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.\r | |
196 | @param Guid A pointer to the GUID whose corresponding interface needs to be found.\r | |
197 | @param Instance The N-th instance of the interface that is required.\r | |
198 | @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.\r | |
199 | @param Ppi A pointer to the instance of the interface.\r | |
200 | \r | |
201 | @retval EFI_SUCCESS The interface was successfully returned.\r | |
202 | @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.\r | |
203 | \r | |
204 | **/\r | |
205 | typedef\r | |
206 | EFI_STATUS\r | |
6de794cd | 207 | (EFIAPI *EFI_PEI_LOCATE_PPI)(\r |
1c280088 | 208 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
209 | IN CONST EFI_GUID *Guid,\r | |
210 | IN UINTN Instance,\r | |
211 | IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor OPTIONAL,\r | |
212 | IN OUT VOID **Ppi\r | |
959ccb23 | 213 | );\r |
214 | \r | |
215 | /**\r | |
9095d37b LG |
216 | This function installs a notification service to be called back when a\r |
217 | given interface is installed or reinstalled. The purpose of the service\r | |
218 | is to publish an interface that other parties can use to call additional PPIs\r | |
959ccb23 | 219 | that may materialize later.\r |
220 | \r | |
221 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r | |
222 | @param NotifyList A pointer to the list of notification interfaces that the caller shall install.\r | |
223 | \r | |
224 | @retval EFI_SUCCESS The interface was successfully installed.\r | |
9095d37b | 225 | @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL, or any of the PEI PPI descriptors in the\r |
cc948847 | 226 | list do not have the EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES bit set in the Flags field.\r |
959ccb23 | 227 | @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.\r |
228 | \r | |
229 | **/\r | |
230 | typedef\r | |
231 | EFI_STATUS\r | |
6de794cd | 232 | (EFIAPI *EFI_PEI_NOTIFY_PPI)(\r |
1c280088 | 233 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
234 | IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList\r | |
959ccb23 | 235 | );\r |
236 | \r | |
237 | /**\r | |
238 | This function returns the present value of the boot mode.\r | |
239 | \r | |
240 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
241 | @param BootMode A pointer to contain the value of the boot mode.\r | |
242 | \r | |
af2dc6a7 | 243 | @retval EFI_SUCCESS The boot mode returned successfully.\r |
959ccb23 | 244 | \r |
245 | **/\r | |
246 | typedef\r | |
247 | EFI_STATUS\r | |
6de794cd | 248 | (EFIAPI *EFI_PEI_GET_BOOT_MODE)(\r |
1c280088 | 249 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
250 | OUT EFI_BOOT_MODE *BootMode\r | |
959ccb23 | 251 | );\r |
252 | \r | |
253 | /**\r | |
254 | This function sets the value of the boot mode.\r | |
255 | \r | |
256 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r | |
257 | @param BootMode The value of the boot mode to set.\r | |
258 | \r | |
af2dc6a7 | 259 | @retval EFI_SUCCESS The boot mode returned successfully.\r |
959ccb23 | 260 | \r |
261 | **/\r | |
262 | typedef\r | |
263 | EFI_STATUS\r | |
6de794cd | 264 | (EFIAPI *EFI_PEI_SET_BOOT_MODE)(\r |
1c280088 | 265 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
266 | IN EFI_BOOT_MODE BootMode\r | |
959ccb23 | 267 | );\r |
268 | \r | |
269 | /**\r | |
9095d37b | 270 | This function returns the pointer to the list of Hand-Off Blocks (HOBs) in memory.\r |
959ccb23 | 271 | \r |
272 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r | |
273 | @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize\r | |
274 | \r | |
275 | @retval EFI_SUCCESS The list was successfully returned.\r | |
276 | @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.\r | |
277 | \r | |
278 | **/\r | |
279 | typedef\r | |
280 | EFI_STATUS\r | |
6de794cd | 281 | (EFIAPI *EFI_PEI_GET_HOB_LIST)(\r |
1c280088 | 282 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
67c89a21 | 283 | OUT VOID **HobList\r |
959ccb23 | 284 | );\r |
285 | \r | |
286 | /**\r | |
af2dc6a7 | 287 | This service, published by the PEI Foundation, abstracts the creation of a Hand-Off Block's (HOB's) headers.\r |
959ccb23 | 288 | \r |
289 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
290 | @param Type The type of HOB to be installed.\r | |
291 | @param Length The length of the HOB to be added.\r | |
292 | @param Hob The address of a pointer that will contain the HOB header.\r | |
293 | \r | |
294 | @retval EFI_SUCCESS The HOB was successfully created.\r | |
295 | @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.\r | |
296 | \r | |
297 | **/\r | |
298 | typedef\r | |
299 | EFI_STATUS\r | |
6de794cd | 300 | (EFIAPI *EFI_PEI_CREATE_HOB)(\r |
1c280088 | 301 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
302 | IN UINT16 Type,\r | |
303 | IN UINT16 Length,\r | |
7b1bf9f6 | 304 | IN OUT VOID **Hob\r |
959ccb23 | 305 | );\r |
306 | \r | |
307 | /**\r | |
9095d37b LG |
308 | The purpose of the service is to abstract the capability of the PEI\r |
309 | Foundation to discover instances of firmware volumes in the system.\r | |
c7c308ad | 310 | \r |
311 | This service enables PEIMs to discover additional firmware volumes. The PEI Foundation uses this\r | |
312 | service to abstract the locations and formats of various firmware volumes. These volumes include\r | |
313 | the Boot Firmware Volume and any other volumes exposed by EFI_PEI_FV_PPI. The service\r | |
314 | returns a volume handle of type EFI_PEI_FV_HANDLE, which must be unique within the system.\r | |
959ccb23 | 315 | \r |
316 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
c7c308ad | 317 | @param Instance This instance of the firmware volume to find.\r |
318 | The value 0 is the Boot Firmware Volume (BFV).\r | |
319 | @param VolumeHandle On exit, points to the next volumn handle or NULL if it does not exist.\r | |
959ccb23 | 320 | \r |
321 | @retval EFI_SUCCESS The volume was found.\r | |
322 | @retval EFI_NOT_FOUND The volume was not found.\r | |
7b1bf9f6 | 323 | @retval EFI_INVALID_PARAMETER VolumeHandle is NULL.\r |
959ccb23 | 324 | \r |
325 | **/\r | |
326 | typedef\r | |
327 | EFI_STATUS\r | |
6de794cd | 328 | (EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME2)(\r |
1c280088 | 329 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
330 | IN UINTN Instance,\r | |
331 | OUT EFI_PEI_FV_HANDLE *VolumeHandle\r | |
959ccb23 | 332 | );\r |
333 | \r | |
334 | /**\r | |
c7c308ad | 335 | Searches for the next matching file in the firmware volume.\r |
336 | \r | |
337 | This service enables PEIMs to discover firmware files within a specified volume.\r | |
338 | To find the first instance of a firmware file, pass a FileHandle value of NULL into the service.\r | |
339 | The service returns a file handle of type EFI_PEI_FILE_HANDLE, which must be unique within\r | |
340 | the system.\r | |
959ccb23 | 341 | \r |
342 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
343 | @param SearchType A filter to find files only of this type.\r | |
c7c308ad | 344 | @param FvHandle Handle of firmware volume in which to search.\r |
345 | @param FileHandle On entry, points to the current handle from which to begin searching\r | |
346 | or NULL to start at the beginning of the firmware volume.\r | |
347 | On exit, points the file handle of the next file in the volume or NULL\r | |
348 | if there are no more files.\r | |
959ccb23 | 349 | \r |
c7c308ad | 350 | @retval EFI_SUCCESS The file was found.\r |
351 | @retval EFI_NOT_FOUND The file was not found.\r | |
352 | @retval EFI_NOT_FOUND The header checksum was not zero.\r | |
959ccb23 | 353 | \r |
354 | **/\r | |
355 | typedef\r | |
356 | EFI_STATUS\r | |
6de794cd | 357 | (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2)(\r |
1c280088 | 358 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
359 | IN EFI_FV_FILETYPE SearchType,\r | |
c7c308ad | 360 | IN CONST EFI_PEI_FV_HANDLE FvHandle,\r |
1c280088 | 361 | IN OUT EFI_PEI_FILE_HANDLE *FileHandle\r |
959ccb23 | 362 | );\r |
363 | \r | |
364 | /**\r | |
c7c308ad | 365 | Searches for the next matching section within the specified file.\r |
366 | \r | |
367 | This service enables PEI modules to discover the first section of a given type within a valid file.\r | |
368 | This service will search within encapsulation sections (compression and GUIDed) as well. It will\r | |
369 | search inside of a GUIDed section or a compressed section, but may not, for example, search a\r | |
370 | GUIDed section inside a GUIDes section.\r | |
af2dc6a7 | 371 | This service will not search within compression sections or GUIDed sections that require\r |
c7c308ad | 372 | extraction if memory is not present.\r |
959ccb23 | 373 | \r |
374 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
375 | @param SectionType The value of the section type to find.\r | |
c7c308ad | 376 | @param FileHandle Handle of the firmware file to search.\r |
959ccb23 | 377 | @param SectionData A pointer to the discovered section, if successful.\r |
378 | \r | |
c7c308ad | 379 | @retval EFI_SUCCESS The section was found.\r |
380 | @retval EFI_NOT_FOUND The section was not found.\r | |
959ccb23 | 381 | \r |
382 | **/\r | |
383 | typedef\r | |
384 | EFI_STATUS\r | |
6de794cd | 385 | (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2)(\r |
1c280088 | 386 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
387 | IN EFI_SECTION_TYPE SectionType,\r | |
388 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
c7c308ad | 389 | OUT VOID **SectionData\r |
959ccb23 | 390 | );\r |
391 | \r | |
c7935105 SZ |
392 | /**\r |
393 | Searches for the next matching section within the specified file.\r | |
394 | \r | |
395 | This service enables PEI modules to discover the section of a given type within a valid file.\r | |
396 | This service will search within encapsulation sections (compression and GUIDed) as well. It will\r | |
397 | search inside of a GUIDed section or a compressed section, but may not, for example, search a\r | |
398 | GUIDed section inside a GUIDes section.\r | |
399 | This service will not search within compression sections or GUIDed sections that require\r | |
400 | extraction if memory is not present.\r | |
401 | \r | |
402 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
403 | @param SectionType The value of the section type to find.\r | |
404 | @param SectionInstance Section instance to find.\r | |
405 | @param FileHandle Handle of the firmware file to search.\r | |
406 | @param SectionData A pointer to the discovered section, if successful.\r | |
407 | @param AuthenticationStatus A pointer to the authentication status for this section.\r | |
408 | \r | |
409 | @retval EFI_SUCCESS The section was found.\r | |
410 | @retval EFI_NOT_FOUND The section was not found.\r | |
411 | \r | |
412 | **/\r | |
413 | typedef\r | |
414 | EFI_STATUS\r | |
415 | (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA3)(\r | |
416 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
417 | IN EFI_SECTION_TYPE SectionType,\r | |
418 | IN UINTN SectionInstance,\r | |
419 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
420 | OUT VOID **SectionData,\r | |
421 | OUT UINT32 *AuthenticationStatus\r | |
422 | );\r | |
423 | \r | |
959ccb23 | 424 | /**\r |
425 | This function registers the found memory configuration with the PEI Foundation.\r | |
426 | \r | |
427 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
af2dc6a7 | 428 | @param MemoryBegin The value of a region of installed memory.\r |
959ccb23 | 429 | @param MemoryLength The corresponding length of a region of installed memory.\r |
430 | \r | |
431 | @retval EFI_SUCCESS The region was successfully installed in a HOB.\r | |
432 | @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.\r | |
433 | @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.\r | |
434 | \r | |
435 | **/\r | |
436 | typedef\r | |
437 | EFI_STATUS\r | |
6de794cd | 438 | (EFIAPI *EFI_PEI_INSTALL_PEI_MEMORY)(\r |
1c280088 | 439 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
959ccb23 | 440 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r |
441 | IN UINT64 MemoryLength\r | |
442 | );\r | |
443 | \r | |
444 | /**\r | |
9095d37b | 445 | The purpose of the service is to publish an interface that allows\r |
959ccb23 | 446 | PEIMs to allocate memory ranges that are managed by the PEI Foundation.\r |
447 | \r | |
9f43484c SZ |
448 | Prior to InstallPeiMemory() being called, PEI will allocate pages from the heap.\r |
449 | After InstallPeiMemory() is called, PEI will allocate pages within the region\r | |
450 | of memory provided by InstallPeiMemory() service in a best-effort fashion.\r | |
451 | Location-specific allocations are not managed by the PEI foundation code.\r | |
452 | \r | |
959ccb23 | 453 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r |
454 | @param MemoryType The type of memory to allocate.\r | |
455 | @param Pages The number of contiguous 4 KB pages to allocate.\r | |
9095d37b | 456 | @param Memory A pointer to a physical address. On output, the address is set to the base\r |
959ccb23 | 457 | of the page range that was allocated.\r |
458 | \r | |
459 | @retval EFI_SUCCESS The memory range was successfully allocated.\r | |
460 | @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.\r | |
9095d37b | 461 | @retval EFI_INVALID_PARAMETER The type is not equal to EfiLoaderCode, EfiLoaderData, EfiRuntimeServicesCode,\r |
ded5aa23 | 462 | EfiRuntimeServicesData, EfiBootServicesCode, EfiBootServicesData,\r |
b7113eb0 | 463 | EfiACPIReclaimMemory, EfiReservedMemoryType, or EfiACPIMemoryNVS.\r |
959ccb23 | 464 | \r |
465 | **/\r | |
466 | typedef\r | |
467 | EFI_STATUS\r | |
6de794cd | 468 | (EFIAPI *EFI_PEI_ALLOCATE_PAGES)(\r |
1c280088 | 469 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
959ccb23 | 470 | IN EFI_MEMORY_TYPE MemoryType,\r |
471 | IN UINTN Pages,\r | |
c7c308ad | 472 | OUT EFI_PHYSICAL_ADDRESS *Memory\r |
959ccb23 | 473 | );\r |
474 | \r | |
9f43484c SZ |
475 | /**\r |
476 | Frees memory pages.\r | |
477 | \r | |
478 | @param[in] PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
479 | @param[in] Memory The base physical address of the pages to be freed.\r | |
480 | @param[in] Pages The number of contiguous 4 KB pages to free.\r | |
481 | \r | |
482 | @retval EFI_SUCCESS The requested pages were freed.\r | |
483 | @retval EFI_INVALID_PARAMETER Memory is not a page-aligned address or Pages is invalid.\r | |
484 | @retval EFI_NOT_FOUND The requested memory pages were not allocated with\r | |
485 | AllocatePages().\r | |
486 | \r | |
487 | **/\r | |
488 | typedef\r | |
489 | EFI_STATUS\r | |
490 | (EFIAPI *EFI_PEI_FREE_PAGES) (\r | |
491 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
492 | IN EFI_PHYSICAL_ADDRESS Memory,\r | |
493 | IN UINTN Pages\r | |
494 | );\r | |
495 | \r | |
959ccb23 | 496 | /**\r |
9095d37b | 497 | The purpose of this service is to publish an interface that\r |
959ccb23 | 498 | allows PEIMs to allocate memory ranges that are managed by the PEI Foundation.\r |
499 | \r | |
500 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
501 | @param Size The number of bytes to allocate from the pool.\r | |
502 | @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer; undefined otherwise.\r | |
503 | \r | |
504 | @retval EFI_SUCCESS The allocation was successful.\r | |
505 | @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.\r | |
506 | \r | |
507 | **/\r | |
508 | typedef\r | |
509 | EFI_STATUS\r | |
6de794cd | 510 | (EFIAPI *EFI_PEI_ALLOCATE_POOL)(\r |
1c280088 | 511 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
959ccb23 | 512 | IN UINTN Size,\r |
513 | OUT VOID **Buffer\r | |
514 | );\r | |
515 | \r | |
516 | /**\r | |
517 | This service copies the contents of one buffer to another buffer.\r | |
518 | \r | |
af2dc6a7 | 519 | @param Destination The pointer to the destination buffer of the memory copy.\r |
520 | @param Source The pointer to the source buffer of the memory copy.\r | |
521 | @param Length The number of bytes to copy from Source to Destination.\r | |
959ccb23 | 522 | \r |
959ccb23 | 523 | **/\r |
524 | typedef\r | |
525 | VOID\r | |
6de794cd | 526 | (EFIAPI *EFI_PEI_COPY_MEM)(\r |
959ccb23 | 527 | IN VOID *Destination,\r |
528 | IN VOID *Source,\r | |
529 | IN UINTN Length\r | |
530 | );\r | |
531 | \r | |
532 | /**\r | |
533 | The service fills a buffer with a specified value.\r | |
534 | \r | |
af2dc6a7 | 535 | @param Buffer The pointer to the buffer to fill.\r |
536 | @param Size The number of bytes in Buffer to fill.\r | |
537 | @param Value The value to fill Buffer with.\r | |
959ccb23 | 538 | \r |
959ccb23 | 539 | **/\r |
540 | typedef\r | |
541 | VOID\r | |
6de794cd | 542 | (EFIAPI *EFI_PEI_SET_MEM)(\r |
959ccb23 | 543 | IN VOID *Buffer,\r |
544 | IN UINTN Size,\r | |
545 | IN UINT8 Value\r | |
546 | );\r | |
547 | \r | |
548 | /**\r | |
549 | This service publishes an interface that allows PEIMs to report status codes.\r | |
550 | \r | |
c7c308ad | 551 | ReportStatusCode() is called by PEIMs that wish to report status information on their\r |
552 | progress. The principal use model is for a PEIM to emit one of the standard 32-bit error codes. This\r | |
553 | will allow a platform owner to ascertain the state of the system, especially under conditions where\r | |
554 | the full consoles might not have been installed.\r | |
555 | \r | |
959ccb23 | 556 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r |
557 | @param Type Indicates the type of status code being reported.\r | |
558 | @param Value Describes the current status of a hardware or\r | |
559 | software entity. This includes information about the class and\r | |
560 | subclass that is used to classify the entity as well as an operation.\r | |
561 | For progress codes, the operation is the current activity.\r | |
562 | For error codes, it is the exception.For debug codes,it is not defined at this time.\r | |
563 | @param Instance The enumeration of a hardware or software entity within\r | |
564 | the system. A system may contain multiple entities that match a class/subclass\r | |
565 | pairing. The instance differentiates between them. An instance of 0 indicates\r | |
566 | that instance information is unavailable, not meaningful, or not relevant.\r | |
567 | Valid instance numbers start with 1.\r | |
568 | @param CallerId This optional parameter may be used to identify the caller.\r | |
569 | This parameter allows the status code driver to apply different rules to\r | |
570 | different callers.\r | |
571 | @param Data This optional parameter may be used to pass additional data.\r | |
572 | \r | |
573 | @retval EFI_SUCCESS The function completed successfully.\r | |
574 | @retval EFI_NOT_AVAILABLE_YET No progress code provider has installed an interface in the system.\r | |
575 | \r | |
576 | **/\r | |
577 | typedef\r | |
578 | EFI_STATUS\r | |
6de794cd | 579 | (EFIAPI *EFI_PEI_REPORT_STATUS_CODE)(\r |
1c280088 | 580 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
581 | IN EFI_STATUS_CODE_TYPE Type,\r | |
582 | IN EFI_STATUS_CODE_VALUE Value,\r | |
583 | IN UINT32 Instance,\r | |
584 | IN CONST EFI_GUID *CallerId OPTIONAL,\r | |
585 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
959ccb23 | 586 | );\r |
587 | \r | |
588 | /**\r | |
589 | Resets the entire platform.\r | |
590 | \r | |
c7c308ad | 591 | This service resets the entire platform, including all processors\r |
592 | and devices, and reboots the system.\r | |
9095d37b | 593 | This service will never return EFI_SUCCESS.\r |
c7c308ad | 594 | \r |
959ccb23 | 595 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES\r |
596 | table published by the PEI Foundation.\r | |
597 | \r | |
959ccb23 | 598 | @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.\r |
599 | \r | |
600 | **/\r | |
601 | typedef\r | |
602 | EFI_STATUS\r | |
6de794cd | 603 | (EFIAPI *EFI_PEI_RESET_SYSTEM)(\r |
b0d803fe | 604 | IN CONST EFI_PEI_SERVICES **PeiServices\r |
959ccb23 | 605 | );\r |
606 | \r | |
ddcf46b2 SZ |
607 | /**\r |
608 | Resets the entire platform.\r | |
609 | \r | |
610 | @param[in] ResetType The type of reset to perform.\r | |
611 | @param[in] ResetStatus The status code for the reset.\r | |
c867c8ce | 612 | @param[in] DataSize The size, in bytes, of ResetData.\r |
ddcf46b2 SZ |
613 | @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown\r |
614 | the data buffer starts with a Null-terminated string, optionally\r | |
615 | followed by additional binary data. The string is a description\r | |
616 | that the caller may use to further indicate the reason for the\r | |
617 | system reset. ResetData is only valid if ResetStatus is something\r | |
618 | other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific\r | |
619 | where a minimum amount of ResetData is always required.\r | |
620 | \r | |
621 | **/\r | |
622 | typedef\r | |
623 | VOID\r | |
624 | (EFIAPI *EFI_PEI_RESET2_SYSTEM) (\r | |
625 | IN EFI_RESET_TYPE ResetType,\r | |
626 | IN EFI_STATUS ResetStatus,\r | |
627 | IN UINTN DataSize,\r | |
628 | IN VOID *ResetData OPTIONAL\r | |
629 | );\r | |
630 | \r | |
959ccb23 | 631 | /**\r |
c7c308ad | 632 | Find a file within a volume by its name.\r |
633 | \r | |
00edb218 A |
634 | This service searches for files with a specific name, within\r |
635 | either the specified firmware volume or all firmware volumes.\r | |
636 | The service returns a file handle of type EFI_PEI_FILE_HANDLE,\r | |
959ccb23 | 637 | which must be unique within the system.\r |
638 | \r | |
00edb218 A |
639 | @param FileName A pointer to the name of the file to\r |
640 | find within the firmware volume.\r | |
c7c308ad | 641 | @param VolumeHandle The firmware volume to search.\r |
642 | @param FileHandle Upon exit, points to the found file's\r | |
959ccb23 | 643 | handle or NULL if it could not be found.\r |
644 | \r | |
af2dc6a7 | 645 | @retval EFI_SUCCESS The file was found.\r |
646 | @retval EFI_NOT_FOUND The file was not found.\r | |
00edb218 A |
647 | @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or\r |
648 | FileName was NULL.\r | |
959ccb23 | 649 | \r |
959ccb23 | 650 | **/\r |
651 | typedef\r | |
652 | EFI_STATUS\r | |
6de794cd | 653 | (EFIAPI *EFI_PEI_FFS_FIND_BY_NAME)(\r |
c7c308ad | 654 | IN CONST EFI_GUID *FileName,\r |
655 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
656 | OUT EFI_PEI_FILE_HANDLE *FileHandle\r | |
00edb218 | 657 | );\r |
959ccb23 | 658 | \r |
c7c308ad | 659 | ///\r |
af2dc6a7 | 660 | /// The information of the FV file.\r |
c7c308ad | 661 | ///\r |
959ccb23 | 662 | typedef struct {\r |
c7c308ad | 663 | ///\r |
664 | /// Name of the file.\r | |
665 | ///\r | |
00edb218 | 666 | EFI_GUID FileName;\r |
c7c308ad | 667 | ///\r |
668 | /// File type.\r | |
669 | ///\r | |
00edb218 | 670 | EFI_FV_FILETYPE FileType;\r |
c7c308ad | 671 | ///\r |
672 | /// Attributes of the file.\r | |
673 | ///\r | |
00edb218 | 674 | EFI_FV_FILE_ATTRIBUTES FileAttributes;\r |
c7c308ad | 675 | ///\r |
676 | /// Points to the file's data (not the header).\r | |
677 | /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED\r | |
678 | /// is zero.\r | |
679 | ///\r | |
00edb218 | 680 | VOID *Buffer;\r |
c7c308ad | 681 | ///\r |
242942b2 | 682 | /// Size of the file's data.\r |
c7c308ad | 683 | ///\r |
00edb218 | 684 | UINT32 BufferSize;\r |
959ccb23 | 685 | } EFI_FV_FILE_INFO;\r |
686 | \r | |
c7935105 SZ |
687 | ///\r |
688 | /// The information with authentication status of the FV file.\r | |
689 | ///\r | |
690 | typedef struct {\r | |
691 | ///\r | |
692 | /// Name of the file.\r | |
693 | ///\r | |
694 | EFI_GUID FileName;\r | |
695 | ///\r | |
696 | /// File type.\r | |
697 | ///\r | |
698 | EFI_FV_FILETYPE FileType;\r | |
699 | ///\r | |
700 | /// Attributes of the file.\r | |
701 | ///\r | |
702 | EFI_FV_FILE_ATTRIBUTES FileAttributes;\r | |
703 | ///\r | |
704 | /// Points to the file's data (not the header).\r | |
705 | /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED\r | |
706 | /// is zero.\r | |
707 | ///\r | |
708 | VOID *Buffer;\r | |
709 | ///\r | |
710 | /// Size of the file's data.\r | |
711 | ///\r | |
712 | UINT32 BufferSize;\r | |
713 | ///\r | |
714 | /// Authentication status for this file.\r | |
715 | ///\r | |
716 | UINT32 AuthenticationStatus;\r | |
717 | } EFI_FV_FILE_INFO2;\r | |
718 | \r | |
959ccb23 | 719 | /**\r |
c7c308ad | 720 | Returns information about a specific file.\r |
721 | \r | |
00edb218 A |
722 | This function returns information about a specific file,\r |
723 | including its file name, type, attributes, starting address and\r | |
af2dc6a7 | 724 | size. If the firmware volume is not memory mapped, then the\r |
959ccb23 | 725 | Buffer member will be NULL.\r |
726 | \r | |
af2dc6a7 | 727 | @param FileHandle The handle of the file.\r |
5528573c | 728 | @param FileInfo Upon exit, points to the file's\r |
959ccb23 | 729 | information.\r |
730 | \r | |
af2dc6a7 | 731 | @retval EFI_SUCCESS File information was returned.\r |
732 | @retval EFI_INVALID_PARAMETER FileHandle does not\r | |
959ccb23 | 733 | represent a valid file.\r |
af2dc6a7 | 734 | @retval EFI_INVALID_PARAMETER FileInfo is NULL.\r |
9095d37b | 735 | \r |
959ccb23 | 736 | **/\r |
737 | typedef\r | |
738 | EFI_STATUS\r | |
6de794cd | 739 | (EFIAPI *EFI_PEI_FFS_GET_FILE_INFO)(\r |
c7c308ad | 740 | IN EFI_PEI_FILE_HANDLE FileHandle,\r |
1c280088 | 741 | OUT EFI_FV_FILE_INFO *FileInfo\r |
00edb218 | 742 | );\r |
959ccb23 | 743 | \r |
c7935105 SZ |
744 | /**\r |
745 | Returns information about a specific file.\r | |
746 | \r | |
747 | This function returns information about a specific file,\r | |
748 | including its file name, type, attributes, starting address, size and authentication status.\r | |
749 | If the firmware volume is not memory mapped, then the Buffer member will be NULL.\r | |
750 | \r | |
751 | @param FileHandle The handle of the file.\r | |
752 | @param FileInfo Upon exit, points to the file's\r | |
753 | information.\r | |
754 | \r | |
755 | @retval EFI_SUCCESS File information was returned.\r | |
756 | @retval EFI_INVALID_PARAMETER FileHandle does not\r | |
757 | represent a valid file.\r | |
758 | @retval EFI_INVALID_PARAMETER FileInfo is NULL.\r | |
759 | \r | |
760 | **/\r | |
761 | typedef\r | |
762 | EFI_STATUS\r | |
763 | (EFIAPI *EFI_PEI_FFS_GET_FILE_INFO2)(\r | |
764 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
765 | OUT EFI_FV_FILE_INFO2 *FileInfo\r | |
766 | );\r | |
767 | \r | |
c7c308ad | 768 | ///\r |
af2dc6a7 | 769 | /// The information of the FV volume.\r |
c7c308ad | 770 | ///\r |
959ccb23 | 771 | typedef struct {\r |
c7c308ad | 772 | ///\r |
773 | /// Attributes of the firmware volume.\r | |
774 | ///\r | |
4ba967e7 | 775 | EFI_FVB_ATTRIBUTES_2 FvAttributes;\r |
c7c308ad | 776 | ///\r |
777 | /// Format of the firmware volume.\r | |
778 | ///\r | |
4ba967e7 | 779 | EFI_GUID FvFormat;\r |
c7c308ad | 780 | ///\r |
781 | /// Name of the firmware volume.\r | |
782 | ///\r | |
4ba967e7 | 783 | EFI_GUID FvName;\r |
c7c308ad | 784 | ///\r |
785 | /// Points to the first byte of the firmware\r | |
786 | /// volume, if bit EFI_FVB_MEMORY_MAPPED is\r | |
787 | /// set in FvAttributes.\r | |
788 | ///\r | |
4ba967e7 | 789 | VOID *FvStart;\r |
c7c308ad | 790 | ///\r |
791 | /// Size of the firmware volume.\r | |
792 | ///\r | |
4ba967e7 | 793 | UINT64 FvSize;\r |
959ccb23 | 794 | } EFI_FV_INFO;\r |
795 | \r | |
796 | /**\r | |
4b503a77 | 797 | Returns information about the specified volume.\r |
c7c308ad | 798 | \r |
00edb218 A |
799 | This function returns information about a specific firmware\r |
800 | volume, including its name, type, attributes, starting address\r | |
959ccb23 | 801 | and size.\r |
802 | \r | |
803 | @param VolumeHandle Handle of the volume.\r | |
5a9403b8 | 804 | @param VolumeInfo Upon exit, points to the volume's information.\r |
959ccb23 | 805 | \r |
af2dc6a7 | 806 | @retval EFI_SUCCESS The volume information returned.\r |
5a9403b8 | 807 | @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.\r |
808 | @retval EFI_INVALID_PARAMETER If VolumeHandle is NULL.\r | |
af2dc6a7 | 809 | @retval EFI_SUCCESS Information was successfully returned.\r |
5a9403b8 | 810 | @retval EFI_INVALID_PARAMETER The volume designated by the VolumeHandle is not available.\r |
959ccb23 | 811 | \r |
812 | **/\r | |
813 | typedef\r | |
814 | EFI_STATUS\r | |
6de794cd | 815 | (EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO)(\r |
1c280088 | 816 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r |
817 | OUT EFI_FV_INFO *VolumeInfo\r | |
00edb218 | 818 | );\r |
959ccb23 | 819 | \r |
820 | /**\r | |
4b503a77 | 821 | Register a PEIM so that it will be shadowed and called again.\r |
c7c308ad | 822 | \r |
00edb218 A |
823 | This service registers a file handle so that after memory is\r |
824 | available, the PEIM will be re-loaded into permanent memory and\r | |
825 | re-initialized. The PEIM registered this way will always be\r | |
826 | initialized twice. The first time, this function call will\r | |
827 | return EFI_SUCCESS. The second time, this function call will\r | |
828 | return EFI_ALREADY_STARTED. Depending on the order in which\r | |
829 | PEIMs are dispatched, the PEIM making this call may be\r | |
830 | initialized after permanent memory is installed, even the first\r | |
959ccb23 | 831 | time.\r |
832 | \r | |
c7c308ad | 833 | @param FileHandle PEIM's file handle. Must be the currently\r |
4b503a77 | 834 | executing PEIM.\r |
9095d37b | 835 | \r |
4ba967e7 | 836 | @retval EFI_SUCCESS The PEIM was successfully registered for\r |
837 | shadowing.\r | |
00edb218 | 838 | @retval EFI_ALREADY_STARTED The PEIM was previously\r |
959ccb23 | 839 | registered for shadowing.\r |
4ba967e7 | 840 | @retval EFI_NOT_FOUND The FileHandle does not refer to a\r |
841 | valid file handle.\r | |
959ccb23 | 842 | \r |
843 | **/\r | |
844 | typedef\r | |
845 | EFI_STATUS\r | |
6de794cd | 846 | (EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW)(\r |
1c280088 | 847 | IN EFI_PEI_FILE_HANDLE FileHandle\r |
00edb218 | 848 | );\r |
959ccb23 | 849 | \r |
850 | \r | |
851 | //\r | |
852 | // PEI Specification Revision information\r | |
853 | //\r | |
854 | #define PEI_SPECIFICATION_MAJOR_REVISION 1\r | |
27dc016c | 855 | #define PEI_SPECIFICATION_MINOR_REVISION 60\r |
32d4a8ef | 856 | ///\r |
9095d37b LG |
857 | /// Specification inconsistency here:\r |
858 | /// In the PI1.0 spec, PEI_SERVICES_SIGNATURE is defined as 0x5652455320494550. But\r | |
af2dc6a7 | 859 | /// to pass a multiple tool chain, it appends an ULL.\r |
32d4a8ef | 860 | ///\r |
959ccb23 | 861 | //\r |
862 | // PEI Services Table\r | |
863 | //\r | |
f490a61d | 864 | #define PEI_SERVICES_SIGNATURE 0x5652455320494550ULL\r |
32d4a8ef | 865 | ///\r |
9095d37b LG |
866 | /// Specification inconsistency here:\r |
867 | /// In the PI1.0 specification, there is a typo error in PEI_SERVICES_REVISION. In the specification the defintion is\r | |
32d4a8ef | 868 | /// #define ((PEI_SPECIFICATION_MAJOR_REVISION<<16) |(PEI_SPECIFICATION_MINOR_REVISION))\r |
af2dc6a7 | 869 | /// and it should be as follows:\r |
32d4a8ef | 870 | ///\r |
ef4fa1a4 | 871 | #define PEI_SERVICES_REVISION ((PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION))\r |
959ccb23 | 872 | \r |
9095d37b | 873 | ///\r |
6de794cd | 874 | /// EFI_PEI_SERVICES is a collection of functions whose implementation is provided by the PEI\r |
875 | /// Foundation. These services fall into various classes, including the following:\r | |
876 | /// - Managing the boot mode\r | |
877 | /// - Allocating both early and permanent memory\r | |
878 | /// - Supporting the Firmware File System (FFS)\r | |
879 | /// - Abstracting the PPI database abstraction\r | |
af2dc6a7 | 880 | /// - Creating Hand-Off Blocks (HOBs).\r |
6de794cd | 881 | ///\r |
146332ae | 882 | struct _EFI_PEI_SERVICES {\r |
c7c308ad | 883 | ///\r |
884 | /// The table header for the PEI Services Table.\r | |
885 | ///\r | |
44717a39 | 886 | EFI_TABLE_HEADER Hdr;\r |
887 | \r | |
888 | //\r | |
889 | // PPI Functions\r | |
890 | //\r | |
891 | EFI_PEI_INSTALL_PPI InstallPpi;\r | |
892 | EFI_PEI_REINSTALL_PPI ReInstallPpi;\r | |
893 | EFI_PEI_LOCATE_PPI LocatePpi;\r | |
894 | EFI_PEI_NOTIFY_PPI NotifyPpi;\r | |
895 | \r | |
896 | //\r | |
897 | // Boot Mode Functions\r | |
898 | //\r | |
899 | EFI_PEI_GET_BOOT_MODE GetBootMode;\r | |
900 | EFI_PEI_SET_BOOT_MODE SetBootMode;\r | |
901 | \r | |
902 | //\r | |
903 | // HOB Functions\r | |
904 | //\r | |
905 | EFI_PEI_GET_HOB_LIST GetHobList;\r | |
906 | EFI_PEI_CREATE_HOB CreateHob;\r | |
907 | \r | |
908 | //\r | |
909 | // Firmware Volume Functions\r | |
910 | //\r | |
00edb218 A |
911 | EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume;\r |
912 | EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile;\r | |
913 | EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData;\r | |
44717a39 | 914 | \r |
915 | //\r | |
916 | // PEI Memory Functions\r | |
917 | //\r | |
918 | EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;\r | |
919 | EFI_PEI_ALLOCATE_PAGES AllocatePages;\r | |
920 | EFI_PEI_ALLOCATE_POOL AllocatePool;\r | |
921 | EFI_PEI_COPY_MEM CopyMem;\r | |
922 | EFI_PEI_SET_MEM SetMem;\r | |
923 | \r | |
924 | //\r | |
925 | // Status Code\r | |
926 | //\r | |
927 | EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;\r | |
928 | \r | |
929 | //\r | |
930 | // Reset\r | |
931 | //\r | |
932 | EFI_PEI_RESET_SYSTEM ResetSystem;\r | |
933 | \r | |
934 | //\r | |
935 | // (the following interfaces are installed by publishing PEIM)\r | |
936 | // I/O Abstractions\r | |
937 | //\r | |
938 | EFI_PEI_CPU_IO_PPI *CpuIo;\r | |
939 | EFI_PEI_PCI_CFG2_PPI *PciCfg;\r | |
940 | \r | |
941 | //\r | |
942 | // Future Installed Services\r | |
943 | //\r | |
944 | EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName;\r | |
945 | EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;\r | |
946 | EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;\r | |
947 | EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;\r | |
c7935105 SZ |
948 | EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3;\r |
949 | EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2;\r | |
ddcf46b2 | 950 | EFI_PEI_RESET2_SYSTEM ResetSystem2;\r |
9f43484c | 951 | EFI_PEI_FREE_PAGES FreePages;\r |
00edb218 | 952 | };\r |
959ccb23 | 953 | \r |
954 | \r | |
6de794cd | 955 | ///\r |
af2dc6a7 | 956 | /// EFI_SEC_PEI_HAND_OFF structure holds information about\r |
6de794cd | 957 | /// PEI core's operating environment, such as the size of location of\r |
958 | /// temporary RAM, the stack location and BFV location.\r | |
9095d37b | 959 | ///\r |
959ccb23 | 960 | typedef struct _EFI_SEC_PEI_HAND_OFF {\r |
c7c308ad | 961 | ///\r |
962 | /// Size of the data structure.\r | |
9095d37b | 963 | ///\r |
959ccb23 | 964 | UINT16 DataSize;\r |
965 | \r | |
c7c308ad | 966 | ///\r |
9095d37b LG |
967 | /// Points to the first byte of the boot firmware volume,\r |
968 | /// which the PEI Dispatcher should search for\r | |
c7c308ad | 969 | /// PEI modules.\r |
9095d37b | 970 | ///\r |
959ccb23 | 971 | VOID *BootFirmwareVolumeBase;\r |
972 | \r | |
c7c308ad | 973 | ///\r |
974 | /// Size of the boot firmware volume, in bytes.\r | |
9095d37b | 975 | ///\r |
959ccb23 | 976 | UINTN BootFirmwareVolumeSize;\r |
977 | \r | |
c7c308ad | 978 | ///\r |
979 | /// Points to the first byte of the temporary RAM.\r | |
9095d37b | 980 | ///\r |
959ccb23 | 981 | VOID *TemporaryRamBase;\r |
982 | \r | |
c7c308ad | 983 | ///\r |
984 | /// Size of the temporary RAM, in bytes.\r | |
9095d37b | 985 | ///\r |
959ccb23 | 986 | UINTN TemporaryRamSize;\r |
987 | \r | |
c7c308ad | 988 | ///\r |
9095d37b LG |
989 | /// Points to the first byte of the temporary RAM\r |
990 | /// available for use by the PEI Foundation. The area\r | |
991 | /// described by PeiTemporaryRamBase and PeiTemporaryRamSize\r | |
c7c308ad | 992 | /// must not extend outside beyond the area described by\r |
993 | /// TemporaryRamBase & TemporaryRamSize. This area should not\r | |
9095d37b | 994 | /// overlap with the area reported by StackBase and\r |
c7c308ad | 995 | /// StackSize.\r |
996 | ///\r | |
959ccb23 | 997 | VOID *PeiTemporaryRamBase;\r |
998 | \r | |
c7c308ad | 999 | ///\r |
9095d37b | 1000 | /// The size of the available temporary RAM available for\r |
c7c308ad | 1001 | /// use by the PEI Foundation, in bytes.\r |
9095d37b | 1002 | ///\r |
959ccb23 | 1003 | UINTN PeiTemporaryRamSize;\r |
1004 | \r | |
c7c308ad | 1005 | ///\r |
9095d37b LG |
1006 | /// Points to the first byte of the stack.\r |
1007 | /// This are may be part of the memory described by\r | |
1008 | /// TemporaryRamBase and TemporaryRamSize\r | |
c7c308ad | 1009 | /// or may be an entirely separate area.\r |
9095d37b | 1010 | ///\r |
959ccb23 | 1011 | VOID *StackBase;\r |
1012 | \r | |
c7c308ad | 1013 | ///\r |
1014 | /// Size of the stack, in bytes.\r | |
9095d37b | 1015 | ///\r |
959ccb23 | 1016 | UINTN StackSize;\r |
1017 | } EFI_SEC_PEI_HAND_OFF;\r | |
1018 | \r | |
fb3df220 | 1019 | \r |
1020 | /**\r | |
af2dc6a7 | 1021 | The entry point of PEI Foundation.\r |
fb3df220 | 1022 | \r |
1023 | This function is the entry point for the PEI Foundation, which\r | |
1024 | allows the SEC phase to pass information about the stack,\r | |
1025 | temporary RAM and the Boot Firmware Volume. In addition, it also\r | |
1026 | allows the SEC phase to pass services and data forward for use\r | |
cc948847 SZ |
1027 | during the PEI phase in the form of one or more PPIs. These PPI's\r |
1028 | will be installed and/or immediately signaled if they are\r | |
1029 | notification type. There is no limit to the number of additional\r | |
1030 | PPIs that can be passed from SEC into the PEI Foundation. As part\r | |
1031 | of its initialization phase, the PEI Foundation will add these\r | |
1032 | SEC-hosted PPIs to its PPI database such that both the PEI\r | |
1033 | Foundation and any modules can leverage the associated service\r | |
1034 | calls and/or code in these early PPIs.\r | |
fb3df220 | 1035 | \r |
1036 | @param SecCoreData Points to a data structure containing\r | |
1037 | information about the PEI core's\r | |
1038 | operating environment, such as the size\r | |
1039 | and location of temporary RAM, the stack\r | |
4b503a77 | 1040 | location and the BFV location.\r |
fb3df220 | 1041 | \r |
1042 | @param PpiList Points to a list of one or more PPI\r | |
1043 | descriptors to be installed initially by\r | |
1044 | the PEI core. An empty PPI list consists\r | |
1045 | of a single descriptor with the end-tag\r | |
1046 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.\r | |
1047 | As part of its initialization phase, the\r | |
1048 | PEI Foundation will add these SEC-hosted\r | |
1049 | PPIs to its PPI database such that both\r | |
1050 | the PEI Foundation and any modules can\r | |
1051 | leverage the associated service calls\r | |
1052 | and/or code in these early PPIs.\r | |
1053 | \r | |
1054 | \r | |
1055 | **/\r | |
1056 | typedef\r | |
1057 | VOID\r | |
e5544398 | 1058 | (EFIAPI *EFI_PEI_CORE_ENTRY_POINT)(\r |
fb3df220 | 1059 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r |
1060 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r | |
1061 | );\r | |
1062 | \r | |
959ccb23 | 1063 | #endif\r |