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