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