]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiPeiCis.h
03a1294d593016d677a9f4afb9a819346d5ea26d
[mirror_edk2.git] / MdePkg / Include / Pi / PiPeiCis.h
1
2 /** @file
3 PI PEI master include file. This file should match the PI spec.
4
5 Copyright (c) 2006 - 2007, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 @par Revision Reference:
15 Version 1.0.
16
17 **/
18
19 #ifndef __PI_PEICIS_H__
20 #define __PI_PEICIS_H__
21
22 #include <Pi/PiMultiPhase.h>
23
24 #define EFI_NOT_AVAILABLE_YET EFIERR (28)
25
26 //
27 // Handles of EFI FV/FFS.
28 //
29 typedef VOID *EFI_PEI_FV_HANDLE;
30 typedef VOID *EFI_PEI_FILE_HANDLE;
31
32 //
33 // Declare forward referenced data structures
34 //
35 typedef struct _EFI_PEI_SERVICES EFI_PEI_SERVICES;
36 typedef struct _EFI_PEI_NOTIFY_DESCRIPTOR EFI_PEI_NOTIFY_DESCRIPTOR;
37
38
39 #include <Ppi/CpuIo.h>
40 #include <Ppi/PciCfg2.h>
41
42
43 /**
44 The PEI Dispatcher will invoke each PEIM one time. During this pass, the PEI
45 Dispatcher will pass control to the PEIM at the AddressOfEntryPoint in the PE Header.
46
47 @param FfsHeader Pointer to the FFS file header.
48 @param PeiServices Describes the list of possible PEI Services.
49
50 @return Status code
51
52 **/
53 typedef
54 EFI_STATUS
55 (EFIAPI *EFI_PEIM_ENTRY_POINT)(
56 IN EFI_PEI_FILE_HANDLE *FfsHeader,
57 IN EFI_PEI_SERVICES **PeiServices
58 );
59
60 /**
61 Entry point of the notification callback function itself within the PEIM.
62
63 @param PeiServices Indirect reference to the PEI Services Table.
64 @param NotifyDescriptor Address of the notification descriptor data structure.
65 @param Ppi Address of the PPI that was installed.
66
67 @return Status code
68
69 **/
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_PEIM_NOTIFY_ENTRY_POINT) (
73 IN EFI_PEI_SERVICES **PeiServices,
74 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,
75 IN VOID *Ppi
76 );
77
78 //
79 // PEI Ppi Services List Descriptors
80 //
81 #define EFI_PEI_PPI_DESCRIPTOR_PIC 0x00000001
82 #define EFI_PEI_PPI_DESCRIPTOR_PPI 0x00000010
83 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK 0x00000020
84 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_DISPATCH 0x00000040
85 #define EFI_PEI_PPI_DESCRIPTOR_NOTIFY_TYPES 0x00000060
86 #define EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST 0x80000000
87
88 typedef struct {
89 UINTN Flags;
90 EFI_GUID *Guid;
91 VOID *Ppi;
92 } EFI_PEI_PPI_DESCRIPTOR;
93
94 struct _EFI_PEI_NOTIFY_DESCRIPTOR {
95 UINTN Flags;
96 EFI_GUID *Guid;
97 EFI_PEIM_NOTIFY_ENTRY_POINT Notify;
98 };
99
100 //
101 // Describes request of the module to be loaded to
102 // the permanent memory once it is available. Unlike most of the other HOBs,
103 // this HOB is produced and consumed during the HOB producer phase.
104 //
105 typedef struct _EFI_HOB_LOAD_PEIM {
106 EFI_HOB_GENERIC_HEADER Header;
107 EFI_PEI_FILE_HANDLE FileHandle;
108 EFI_PEIM_ENTRY_POINT EntryPoint;
109 EFI_PEIM_ENTRY_POINT InMemEntryPoint;
110 } EFI_HOB_LOAD_PEIM;
111
112
113 /**
114 This service is the first one provided by the PEI Foundation. This function
115 installs an interface in the PEI PPI database by GUID. The purpose of the
116 service is to publish an interface that other parties can use to call
117 additional PEIMs.
118
119 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
120 published by the PEI Foundation.
121 @param PpiList A pointer to the list of interfaces that the caller shall install.
122
123 @retval EFI_SUCCESS The interface was successfully installed.
124 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
125 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
126
127 **/
128 typedef
129 EFI_STATUS
130 (EFIAPI *EFI_PEI_INSTALL_PPI) (
131 IN EFI_PEI_SERVICES **PeiServices,
132 IN EFI_PEI_PPI_DESCRIPTOR *PpiList
133 );
134
135 /**
136 This function reinstalls an interface in the PEI PPI database by GUID.
137 The purpose of the service is to publish an interface that other parties
138 can use to replace a same-named interface in the protocol database
139 with a different interface.
140
141 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table
142 published by the PEI Foundation.
143 @param OldPpi A pointer to the former PPI in the database.
144 @param NewPpi A pointer to the new interfaces that the caller shall install.
145
146 @retval EFI_SUCCESS The interface was successfully installed.
147 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the
148 list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
149 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
150 @retval EFI_NOT_FOUND The PPI for which the reinstallation was requested has not been installed.
151
152 **/
153 typedef
154 EFI_STATUS
155 (EFIAPI *EFI_PEI_REINSTALL_PPI) (
156 IN EFI_PEI_SERVICES **PeiServices,
157 IN EFI_PEI_PPI_DESCRIPTOR *OldPpi,
158 IN EFI_PEI_PPI_DESCRIPTOR *NewPpi
159 );
160
161 /**
162 This function locates an interface in the PEI PPI database by GUID.
163
164 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES published by the PEI Foundation.
165 @param Guid A pointer to the GUID whose corresponding interface needs to be found.
166 @param Instance The N-th instance of the interface that is required.
167 @param PpiDescriptor A pointer to instance of the EFI_PEI_PPI_DESCRIPTOR.
168 @param Ppi A pointer to the instance of the interface.
169
170 @retval EFI_SUCCESS The interface was successfully returned.
171 @retval EFI_NOT_FOUND The PPI descriptor is not found in the database.
172
173 **/
174 typedef
175 EFI_STATUS
176 (EFIAPI *EFI_PEI_LOCATE_PPI) (
177 IN EFI_PEI_SERVICES **PeiServices,
178 IN EFI_GUID *Guid,
179 IN UINTN Instance,
180 IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,
181 IN OUT VOID **Ppi
182 );
183
184 /**
185 This function installs a notification service to be called back when a
186 given interface is installed or reinstalled. The purpose of the service
187 is to publish an interface that other parties can use to call additional PPIs
188 that may materialize later.
189
190 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
191 @param NotifyList A pointer to the list of notification interfaces that the caller shall install.
192
193 @retval EFI_SUCCESS The interface was successfully installed.
194 @retval EFI_INVALID_PARAMETER The PpiList pointer is NULL or Any of the PEI PPI descriptors in the
195 list do not have the EFI_PEI_PPI_DESCRIPTOR_PPI bit set in the Flags field.
196 @retval EFI_OUT_OF_RESOURCES There is no additional space in the PPI database.
197
198 **/
199 typedef
200 EFI_STATUS
201 (EFIAPI *EFI_PEI_NOTIFY_PPI) (
202 IN EFI_PEI_SERVICES **PeiServices,
203 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList
204 );
205
206 /**
207 This function returns the present value of the boot mode.
208
209 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
210 @param BootMode A pointer to contain the value of the boot mode.
211
212 @retval EFI_SUCCESS The boot mode was returned successfully.
213
214 **/
215 typedef
216 EFI_STATUS
217 (EFIAPI *EFI_PEI_GET_BOOT_MODE) (
218 IN EFI_PEI_SERVICES **PeiServices,
219 OUT EFI_BOOT_MODE *BootMode
220 );
221
222 /**
223 This function sets the value of the boot mode.
224
225 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
226 @param BootMode The value of the boot mode to set.
227
228 @retval EFI_SUCCESS The boot mode was returned successfully.
229
230 **/
231 typedef
232 EFI_STATUS
233 (EFIAPI *EFI_PEI_SET_BOOT_MODE) (
234 IN EFI_PEI_SERVICES **PeiServices,
235 IN EFI_BOOT_MODE BootMode
236 );
237
238 /**
239 This function returns the pointer to the list of Hand-Off Blocks (HOBs) in memory.
240
241 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
242 @param HobList A pointer to the list of HOBs that the PEI Foundation will initialize
243
244 @retval EFI_SUCCESS The list was successfully returned.
245 @retval EFI_NOT_AVAILABLE_YET The HOB list is not yet published.
246
247 **/
248 typedef
249 EFI_STATUS
250 (EFIAPI *EFI_PEI_GET_HOB_LIST) (
251 IN EFI_PEI_SERVICES **PeiServices,
252 IN OUT VOID **HobList
253 );
254
255 /**
256 This service published by the PEI Foundation abstracts the creation of a Hand-Off Block's (HOB's) headers.
257
258 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
259 @param Type The type of HOB to be installed.
260 @param Length The length of the HOB to be added.
261 @param Hob The address of a pointer that will contain the HOB header.
262
263 @retval EFI_SUCCESS The HOB was successfully created.
264 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
265
266 **/
267 typedef
268 EFI_STATUS
269 (EFIAPI *EFI_PEI_CREATE_HOB) (
270 IN EFI_PEI_SERVICES **PeiServices,
271 IN UINT16 Type,
272 IN UINT16 Length,
273 IN OUT VOID **Hob
274 );
275
276 /**
277 The purpose of the service is to abstract the capability of the PEI
278 Foundation to discover instances of firmware volumes in the system.
279 Given the input file pointer, this service searches for the next
280 matching file in the Firmware File System (FFS) volume.
281
282 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
283 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware Volume (BFV).
284 @param FwVolHeader Pointer to the firmware volume header of the volume to return.
285
286 @retval EFI_SUCCESS The volume was found.
287 @retval EFI_NOT_FOUND The volume was not found.
288 @retval EFI_INVALID_PARAMETER FwVolHeader is NULL
289
290 **/
291 typedef
292 EFI_STATUS
293 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_VOLUME2) (
294 IN EFI_PEI_SERVICES **PeiServices,
295 IN UINTN Instance,
296 IN OUT EFI_FIRMWARE_VOLUME_HEADER **FwVolHeader
297 );
298
299 /**
300 The purpose of the service is to abstract the capability of the PEI
301 Foundation to discover instances of firmware files in the system.
302 Given the input file pointer, this service searches for the next matching
303 file in the Firmware File System (FFS) volume.
304
305 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
306 @param SearchType A filter to find files only of this type.
307 @param FwVolHeader Pointer to the firmware volume header of the volume to search.This parameter
308 must point to a valid FFS volume.
309 @param FileHeader Pointer to the current file from which to begin searching.This pointer will be
310 updated upon return to reflect the file found.
311
312 @retval EFI_SUCCESS The file was found.
313 @retval EFI_NOT_FOUND The file was not found.
314 @retval EFI_NOT_FOUND The header checksum was not zero.
315
316 **/
317 typedef
318 EFI_STATUS
319 (EFIAPI *EFI_PEI_FFS_FIND_NEXT_FILE2) (
320 IN EFI_PEI_SERVICES **PeiServices,
321 IN EFI_FV_FILETYPE SearchType,
322 IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,
323 IN OUT EFI_FFS_FILE_HEADER **FileHeader
324 );
325
326 /**
327 Given the input file pointer, this service searches for the next
328 matching file in the Firmware File System (FFS) volume.
329
330 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
331 @param SectionType The value of the section type to find.
332 @param FfsFileHeader A pointer to the file header that contains the set of sections to be searched.
333 @param SectionData A pointer to the discovered section, if successful.
334
335 @retval EFI_SUCCESS The section was found.
336 @retval EFI_NOT_FOUND The section was not found.
337
338 **/
339 typedef
340 EFI_STATUS
341 (EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA2) (
342 IN EFI_PEI_SERVICES **PeiServices,
343 IN EFI_SECTION_TYPE SectionType,
344 IN EFI_FFS_FILE_HEADER *FfsFileHeader,
345 IN OUT VOID **SectionData
346 );
347
348 /**
349 This function registers the found memory configuration with the PEI Foundation.
350
351 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
352 @param MemoryBegin The value of a region of installed memory
353 @param MemoryLength The corresponding length of a region of installed memory.
354
355 @retval EFI_SUCCESS The region was successfully installed in a HOB.
356 @retval EFI_INVALID_PARAMETER MemoryBegin and MemoryLength are illegal for this system.
357 @retval EFI_OUT_OF_RESOURCES There is no additional space for HOB creation.
358
359 **/
360 typedef
361 EFI_STATUS
362 (EFIAPI *EFI_PEI_INSTALL_PEI_MEMORY) (
363 IN EFI_PEI_SERVICES **PeiServices,
364 IN EFI_PHYSICAL_ADDRESS MemoryBegin,
365 IN UINT64 MemoryLength
366 );
367
368 /**
369 The purpose of the service is to publish an interface that allows
370 PEIMs to allocate memory ranges that are managed by the PEI Foundation.
371
372 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
373 @param MemoryType The type of memory to allocate.
374 @param Pages The number of contiguous 4 KB pages to allocate.
375 @param Memory Pointer to a physical address. On output, the address is set to the base
376 of the page range that was allocated.
377
378 @retval EFI_SUCCESS The memory range was successfully allocated.
379 @retval EFI_OUT_OF_RESOURCES The pages could not be allocated.
380 @retval EFI_INVALID_PARAMETER Type is not equal to AllocateAnyPages.
381
382 **/
383 typedef
384 EFI_STATUS
385 (EFIAPI *EFI_PEI_ALLOCATE_PAGES) (
386 IN EFI_PEI_SERVICES **PeiServices,
387 IN EFI_MEMORY_TYPE MemoryType,
388 IN UINTN Pages,
389 IN OUT EFI_PHYSICAL_ADDRESS *Memory
390 );
391
392 /**
393 The purpose of this service is to publish an interface that
394 allows PEIMs to allocate memory ranges that are managed by the PEI Foundation.
395
396 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
397 @param Size The number of bytes to allocate from the pool.
398 @param Buffer If the call succeeds, a pointer to a pointer to the allocated buffer; undefined otherwise.
399
400 @retval EFI_SUCCESS The allocation was successful.
401 @retval EFI_OUT_OF_RESOURCES There is not enough heap to allocate the requested size.
402
403 **/
404 typedef
405 EFI_STATUS
406 (EFIAPI *EFI_PEI_ALLOCATE_POOL) (
407 IN EFI_PEI_SERVICES **PeiServices,
408 IN UINTN Size,
409 OUT VOID **Buffer
410 );
411
412 /**
413 This service copies the contents of one buffer to another buffer.
414
415 @param Destination Pointer to the destination buffer of the memory copy.
416 @param Source Pointer to the source buffer of the memory copy
417 @param Length Number of bytes to copy from Source to Destination.
418
419 @return None
420
421 **/
422 typedef
423 VOID
424 (EFIAPI *EFI_PEI_COPY_MEM) (
425 IN VOID *Destination,
426 IN VOID *Source,
427 IN UINTN Length
428 );
429
430 /**
431 The service fills a buffer with a specified value.
432
433 @param Buffer Pointer to the buffer to fill.
434 @param Size Number of bytes in Buffer to fill.
435 @param Value Value to fill Buffer with
436
437 @return None
438
439 **/
440 typedef
441 VOID
442 (EFIAPI *EFI_PEI_SET_MEM) (
443 IN VOID *Buffer,
444 IN UINTN Size,
445 IN UINT8 Value
446 );
447
448 /**
449 This service publishes an interface that allows PEIMs to report status codes.
450
451 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
452 @param Type Indicates the type of status code being reported.
453 @param Value Describes the current status of a hardware or
454 software entity. This includes information about the class and
455 subclass that is used to classify the entity as well as an operation.
456 For progress codes, the operation is the current activity.
457 For error codes, it is the exception.For debug codes,it is not defined at this time.
458 @param Instance The enumeration of a hardware or software entity within
459 the system. A system may contain multiple entities that match a class/subclass
460 pairing. The instance differentiates between them. An instance of 0 indicates
461 that instance information is unavailable, not meaningful, or not relevant.
462 Valid instance numbers start with 1.
463 @param CallerId This optional parameter may be used to identify the caller.
464 This parameter allows the status code driver to apply different rules to
465 different callers.
466 @param Data This optional parameter may be used to pass additional data.
467
468 @retval EFI_SUCCESS The function completed successfully.
469 @retval EFI_NOT_AVAILABLE_YET No progress code provider has installed an interface in the system.
470
471 **/
472 typedef
473 EFI_STATUS
474 (EFIAPI *EFI_PEI_REPORT_STATUS_CODE) (
475 IN EFI_PEI_SERVICES **PeiServices,
476 IN EFI_STATUS_CODE_TYPE Type,
477 IN EFI_STATUS_CODE_VALUE Value,
478 IN UINT32 Instance,
479 IN EFI_GUID *CallerId OPTIONAL,
480 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
481 );
482
483 /**
484 Resets the entire platform.
485
486 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES
487 table published by the PEI Foundation.
488
489 @retval EFI_SUCCESS The function completed successfully.
490 @retval EFI_NOT_AVAILABLE_YET The service has not been installed yet.
491
492 **/
493 typedef
494 EFI_STATUS
495 (EFIAPI *EFI_PEI_RESET_SYSTEM) (
496 IN EFI_PEI_SERVICES **PeiServices
497 );
498
499 /**
500
501 This service searches for files with a specific name, within
502 either the specified firmware volume or all firmware volumes.
503 The service returns a file handle of type EFI_PEI_FILE_HANDLE,
504 which must be unique within the system.
505
506 @param FileName A pointer to the name of the file to
507 find within the firmware volume.
508
509 @param VolumeHandle The firmware volume to search FileHandle
510 Upon exit, points to the found file's
511 handle or NULL if it could not be found.
512
513 @retval EFI_SUCCESS File was found.
514
515 @retval EFI_NOT_FOUND File was not found.
516
517 @retval EFI_INVALID_PARAMETER VolumeHandle or FileHandle or
518 FileName was NULL.
519
520
521 **/
522 typedef
523 EFI_STATUS
524 (EFIAPI *EFI_PEI_FFS_FIND_BY_NAME) (
525 IN CONST EFI_GUID *FileName,
526 IN CONST EFI_PEI_FV_HANDLE VolumeHandle,
527 OUT EFI_PEI_FILE_HANDLE *FileHandle
528 );
529
530
531 /**
532
533 @param FileName Name of the file.
534
535 @param FileType File type. See EFI_FV_FILETYPE, which is
536 defined in the Platform Initialization
537 Firmware Storage Specification.
538
539 @param FileAttributes Attributes of the file. Type
540 EFI_FV_FILE_ATTRIBUTES is defined in
541 the Platform Initialization Firmware
542 Storage Specification.
543
544 @param Buffer Points to the file's data (not the header).
545 Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED
546 is zero.
547
548 @param BufferSize Size of the file's data.
549
550 **/
551 typedef struct {
552 EFI_GUID FileName;
553 EFI_FV_FILETYPE FileType;
554 EFI_FV_FILE_ATTRIBUTES FileAttributes;
555 VOID *Buffer;
556 UINT32 BufferSize;
557 } EFI_FV_FILE_INFO;
558
559 /**
560
561 This function returns information about a specific file,
562 including its file name, type, attributes, starting address and
563 size. If the firmware volume is not memory mapped then the
564 Buffer member will be NULL.
565
566 @param FileHandle Handle of the file.
567
568 @param FileInfo Upon exit, points to the file¡¯s
569 information.
570
571 @retval EFI_SUCCESS File information returned.
572
573 @retval EFI_INVALID_PARAMETER If FileHandle does not
574 represent a valid file.
575
576 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
577
578 **/
579 typedef
580 EFI_STATUS
581 (EFIAPI *EFI_PEI_FFS_GET_FILE_INFO) (
582 IN CONST EFI_PEI_FILE_HANDLE FileHandle,
583 OUT EFI_FV_FILE_INFO *FileInfo
584 );
585
586
587 /**
588
589 @param FvAttributes Attributes of the firmware volume. Type
590 EFI_FVB_ATTRIBUTES is defined in the
591 Platform Initialization Firmware Storage
592 Specficiation.
593
594 @param FvFormat Format of the firmware volume. For PI
595 Architecture Firmware Volumes, this can
596 be copied from FileSystemGuid in
597 EFI_FIRMWARE_VOLUME_HEADER.
598
599 @param FvName Name of the firmware volume. For PI
600 Architecture Firmware Volumes, this can
601 be copied from VolumeName in the
602 extended header of
603 EFI_FIRMWARE_VOLUME_HEADER.
604
605 @param FvStart Points to the first byte of the firmware
606 volume, if bit EFI_FVB_MEMORY_MAPPED is
607 set in FvAttributes. FvSize Size of the
608 firmware volume.
609
610 **/
611 typedef struct {
612 EFI_FVB_ATTRIBUTES FvAttributes;
613 EFI_GUID FvFormat;
614 EFI_GUID FvName;
615 VOID *FvStart;
616 UINT64 FvSize;
617 } EFI_FV_INFO;
618
619 /**
620
621 This function returns information about a specific firmware
622 volume, including its name, type, attributes, starting address
623 and size.
624
625 @param VolumeHandle Handle of the volume.
626
627 @param VolumeInfo Upon exit, points to the volume¡¯s
628 information.
629
630 @retval EFI_SUCCESS File information returned.
631
632 @retval EFI_INVALID_PARAMETER If FileHandle does not
633 represent a valid file.
634
635 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
636
637 **/
638 typedef
639 EFI_STATUS
640 (EFIAPI *EFI_PEI_FFS_GET_VOLUME_INFO) (
641 IN CONST EFI_PEI_FV_HANDLE *VolumeHandle,
642 OUT EFI_FV_INFO *VolumeInfo
643 );
644
645 /**
646
647 This service registers a file handle so that after memory is
648 available, the PEIM will be re-loaded into permanent memory and
649 re-initialized. The PEIM registered this way will always be
650 initialized twice. The first time, this function call will
651 return EFI_SUCCESS. The second time, this function call will
652 return EFI_ALREADY_STARTED. Depending on the order in which
653 PEIMs are dispatched, the PEIM making this call may be
654 initialized after permanent memory is installed, even the first
655 time.
656
657 @param FileHandle PEIM¡¯s file handle. Must be the currently
658 xecuting PEIM.
659
660 @retval EFI_SUCCESS The PEIM was successfully registered for
661 shadowing.
662
663 @retval EFI_ALREADY_STARTED The PEIM was previously
664 registered for shadowing.
665
666 @retval EFI_NOT_FOUND The FileHandle does not refer to a
667 valid file handle.
668
669 **/
670 typedef
671 EFI_STATUS
672 (EFIAPI *EFI_PEI_REGISTER_FOR_SHADOW) (
673 IN CONST EFI_PEI_FILE_HANDLE FileHandle
674 );
675
676
677 //
678 // PEI Specification Revision information
679 //
680 #define PEI_SPECIFICATION_MAJOR_REVISION 1
681 #define PEI_SPECIFICATION_MINOR_REVISION 0
682
683 //
684 // PEI Services Table
685 //
686 #define PEI_SERVICES_SIGNATURE 0x5652455320494550
687 #define PEI_SERVICES_REVISION (PEI_SPECIFICATION_MAJOR_REVISION<<16) | (PEI_SPECIFICATION_MINOR_REVISION)
688
689 struct _EFI_PEI_SERVICES {
690 EFI_TABLE_HEADER Hdr;
691 //
692 // PPI Functions
693 //
694 EFI_PEI_INSTALL_PPI InstallPpi;
695 EFI_PEI_REINSTALL_PPI ReInstallPpi;
696 EFI_PEI_LOCATE_PPI LocatePpi;
697 EFI_PEI_NOTIFY_PPI NotifyPpi;
698 //
699 // Boot Mode Functions
700 //
701 EFI_PEI_GET_BOOT_MODE GetBootMode;
702 EFI_PEI_SET_BOOT_MODE SetBootMode;
703 //
704 // HOB Functions
705 //
706 EFI_PEI_GET_HOB_LIST GetHobList;
707 EFI_PEI_CREATE_HOB CreateHob;
708 //
709 // Firmware Volume Functions
710 //
711 EFI_PEI_FFS_FIND_NEXT_VOLUME2 FfsFindNextVolume;
712 EFI_PEI_FFS_FIND_NEXT_FILE2 FfsFindNextFile;
713 EFI_PEI_FFS_FIND_SECTION_DATA2 FfsFindSectionData;
714 //
715 // PEI Memory Functions
716 //
717 EFI_PEI_INSTALL_PEI_MEMORY InstallPeiMemory;
718 EFI_PEI_ALLOCATE_PAGES AllocatePages;
719 EFI_PEI_ALLOCATE_POOL AllocatePool;
720 EFI_PEI_COPY_MEM CopyMem;
721 EFI_PEI_SET_MEM SetMem;
722 //
723 // Status Code
724 EFI_PEI_REPORT_STATUS_CODE ReportStatusCode;
725 //
726 // Reset
727 //
728 EFI_PEI_RESET_SYSTEM ResetSystem;
729 //
730 // (the following interfaces are installed by publishing PEIM)
731 //
732 // I/O Abstractions
733 //
734 EFI_PEI_CPU_IO_PPI *CpuIo;
735 EFI_PEI_PCI_CFG2_PPI *PciCfg;
736 //
737 // Future Installed Services
738 EFI_PEI_FFS_FIND_BY_NAME FfsFindFileByName;
739 EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;
740 EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;
741 EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;
742 };
743
744
745 typedef struct _EFI_SEC_PEI_HAND_OFF {
746 //
747 // Size of the data structure.
748 //
749 UINT16 DataSize;
750
751 //
752 // Points to the first byte of the boot firmware volume,
753 // which the PEI Dispatcher should search for
754 // PEI modules.
755 //
756 VOID *BootFirmwareVolumeBase;
757
758 //
759 // Size of the boot firmware volume, in bytes.
760 //
761 UINTN BootFirmwareVolumeSize;
762
763 //
764 // Points to the first byte of the temporary RAM.
765 //
766 VOID *TemporaryRamBase;
767
768 //
769 // Size of the temporary RAM, in bytes.
770 //
771 UINTN TemporaryRamSize;
772
773 //
774 // Points to the first byte of the temporary RAM
775 // available for use by the PEI Foundation. The area
776 // described by PeiTemporaryRamBase and PeiTemporaryRamSize
777 // must not extend outside beyond the area described by
778 // TemporaryRamBase & TemporaryRamSize. This area should not
779 // overlap with the area reported by StackBase and
780 // StackSize.
781 //
782 VOID *PeiTemporaryRamBase;
783
784 //
785 // Size of the available temporary RAM available for
786 // use by the PEI Foundation, in bytes.
787 //
788 UINTN PeiTemporaryRamSize;
789
790 //
791 // Points to the first byte of the stack.
792 // This are may be part of the memory described by
793 // TemporaryRamBase and TemporaryRamSize
794 // or may be an entirely separate area.
795 //
796 VOID *StackBase;
797
798 //
799 // Size of the stack, in bytes.
800 //
801 UINTN StackSize;
802 } EFI_SEC_PEI_HAND_OFF;
803
804
805 /**
806
807 This function is the entry point for the PEI Foundation, which
808 allows the SEC phase to pass information about the stack,
809 temporary RAM and the Boot Firmware Volume. In addition, it also
810 allows the SEC phase to pass services and data forward for use
811 during the PEI phase in the form of one or more PPIs. There is
812 no limit to the number of additional PPIs that can be passed
813 from SEC into the PEI Foundation. As part of its initialization
814 phase, the PEI Foundation will add these SEC-hosted PPIs to its
815 PPI database such that both the PEI Foundation and any modules
816 can leverage the associated service calls and/or code in these
817 early PPIs.
818
819 @param SecCoreData Points to a data structure containing
820 information about the PEI core's
821 operating environment, such as the size
822 and location of temporary RAM, the stack
823 location and the BFV location. The type
824 EFI_SEC_PEI_HAND_OFF is
825
826 @param PpiList Points to a list of one or more PPI
827 descriptors to be installed initially by
828 the PEI core. An empty PPI list consists
829 of a single descriptor with the end-tag
830 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST.
831 As part of its initialization phase, the
832 PEI Foundation will add these SEC-hosted
833 PPIs to its PPI database such that both
834 the PEI Foundation and any modules can
835 leverage the associated service calls
836 and/or code in these early PPIs.
837
838
839 **/
840 typedef
841 VOID
842 (EFIAPI *EFI_PEI_CORE_ENTRY_POINT)(
843 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,
844 IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList
845 );
846
847 #endif