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