2 Definition of Pei Core Structures and Services
4 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 #include <Ppi/DxeIpl.h>
20 #include <Ppi/MemoryDiscovered.h>
21 #include <Ppi/StatusCode.h>
22 #include <Ppi/Reset.h>
23 #include <Ppi/Reset2.h>
24 #include <Ppi/FirmwareVolume.h>
25 #include <Ppi/FirmwareVolumeInfo.h>
26 #include <Ppi/FirmwareVolumeInfo2.h>
27 #include <Ppi/Decompress.h>
28 #include <Ppi/GuidedSectionExtraction.h>
29 #include <Ppi/LoadFile.h>
30 #include <Ppi/Security2.h>
31 #include <Ppi/TemporaryRamSupport.h>
32 #include <Ppi/TemporaryRamDone.h>
33 #include <Library/DebugLib.h>
34 #include <Library/PeiCoreEntryPoint.h>
35 #include <Library/BaseLib.h>
36 #include <Library/HobLib.h>
37 #include <Library/PerformanceLib.h>
38 #include <Library/PeiServicesLib.h>
39 #include <Library/ReportStatusCodeLib.h>
40 #include <Library/PeCoffLib.h>
41 #include <Library/PeCoffGetEntryPointLib.h>
42 #include <Library/BaseMemoryLib.h>
43 #include <Library/CacheMaintenanceLib.h>
44 #include <Library/PcdLib.h>
45 #include <IndustryStandard/PeImage.h>
46 #include <Library/PeiServicesTablePointerLib.h>
47 #include <Library/MemoryAllocationLib.h>
48 #include <Guid/FirmwareFileSystem2.h>
49 #include <Guid/FirmwareFileSystem3.h>
50 #include <Guid/AprioriFileName.h>
53 /// It is an FFS type extension used for PeiFindFileEx. It indicates current
54 /// Ffs searching is for all PEIMs can be dispatched by PeiCore.
56 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
59 /// Pei Core private data structures
62 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
63 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
65 } PEI_PPI_LIST_POINTERS
;
68 /// PPI database structure which contains two link: PpiList and NotifyList. PpiList
69 /// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.
73 /// index of end of PpiList link list.
77 /// index of end of notify link list.
81 /// index of the dispatched notify list.
85 /// index of last installed Ppi description in PpiList link list.
87 INTN LastDispatchedInstall
;
89 /// index of last dispatched notify in Notify link list.
91 INTN LastDispatchedNotify
;
93 /// Ppi database has the PcdPeiCoreMaxPpiSupported number of entries.
95 PEI_PPI_LIST_POINTERS
*PpiListPtrs
;
100 // PEI_CORE_FV_HANDE.PeimState
101 // Do not change these values as there is code doing math to change states.
102 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
104 #define PEIM_STATE_NOT_DISPATCHED 0x00
105 #define PEIM_STATE_DISPATCHED 0x01
106 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
107 #define PEIM_STATE_DONE 0x03
110 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
111 EFI_PEI_FIRMWARE_VOLUME_PPI
*FvPpi
;
112 EFI_PEI_FV_HANDLE FvHandle
;
114 // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries.
118 // Ponter to the buffer with the PcdPeiCoreMaxPeimPerFv number of Entries.
120 EFI_PEI_FILE_HANDLE
*FvFileHandles
;
122 UINT32 AuthenticationStatus
;
123 } PEI_CORE_FV_HANDLE
;
129 UINT32 AuthenticationStatus
;
130 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor
;
131 } PEI_CORE_UNKNOW_FORMAT_FV_INFO
;
133 #define CACHE_SETION_MAX_NUMBER 0x10
135 EFI_COMMON_SECTION_HEADER
* Section
[CACHE_SETION_MAX_NUMBER
];
136 VOID
* SectionData
[CACHE_SETION_MAX_NUMBER
];
137 UINTN SectionSize
[CACHE_SETION_MAX_NUMBER
];
138 UINT32 AuthenticationStatus
[CACHE_SETION_MAX_NUMBER
];
139 UINTN AllSectionCount
;
141 } CACHE_SECTION_DATA
;
143 #define HOLE_MAX_NUMBER 0x3
145 EFI_PHYSICAL_ADDRESS Base
;
148 BOOLEAN OffsetPositive
;
152 /// Forward declaration for PEI_CORE_INSTANCE
154 typedef struct _PEI_CORE_INSTANCE PEI_CORE_INSTANCE
;
158 Function Pointer type for PeiCore function.
159 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
160 and location of temporary RAM, the stack location and the BFV location.
161 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
162 An empty PPI list consists of a single descriptor with the end-tag
163 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
164 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
165 that both the PEI Foundation and any modules can leverage the associated service
166 calls and/or code in these early PPIs
167 @param OldCoreData Pointer to old core data that is used to initialize the
172 (EFIAPI
*PEICORE_FUNCTION_POINTER
)(
173 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
174 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
175 IN PEI_CORE_INSTANCE
*OldCoreData
178 #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
181 /// Pei Core private data structure instance
183 struct _PEI_CORE_INSTANCE
{
187 /// Point to ServiceTableShadow
189 EFI_PEI_SERVICES
*Ps
;
190 PEI_PPI_DATABASE PpiData
;
193 /// The count of FVs which contains FFS and could be dispatched by PeiCore.
198 /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries.
199 /// Each entry is for one FV which contains FFS and could be dispatched by PeiCore.
201 PEI_CORE_FV_HANDLE
*Fv
;
204 /// Pointer to the buffer with the PcdPeiCoreMaxFvSupported number of entries.
205 /// Each entry is for one FV which could not be dispatched by PeiCore.
207 PEI_CORE_UNKNOW_FORMAT_FV_INFO
*UnknownFvInfo
;
208 UINTN UnknownFvInfoCount
;
211 /// Pointer to the buffer with the PcdPeiCoreMaxPeimPerFv number of entries.
213 EFI_PEI_FILE_HANDLE
*CurrentFvFileHandles
;
215 UINTN CurrentPeimFvCount
;
216 UINTN CurrentPeimCount
;
217 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
218 BOOLEAN PeimNeedingDispatch
;
219 BOOLEAN PeimDispatchOnThisPass
;
220 BOOLEAN PeimDispatcherReenter
;
221 EFI_PEI_HOB_POINTERS HobList
;
222 BOOLEAN SwitchStackSignal
;
223 BOOLEAN PeiMemoryInstalled
;
225 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
226 EFI_PEI_SERVICES ServiceTableShadow
;
227 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
228 EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin
;
229 UINT64 PhysicalMemoryLength
;
230 EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop
;
232 BOOLEAN HeapOffsetPositive
;
234 BOOLEAN StackOffsetPositive
;
235 PEICORE_FUNCTION_POINTER ShadowedPeiCore
;
236 CACHE_SECTION_DATA CacheSection
;
238 // For Loading modules at fixed address feature to cache the top address below which the
239 // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
240 // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
242 EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress
;
244 // The field is define for Loading modules at fixed address feature to tracker the PEI code
245 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
248 UINT64
*PeiCodeMemoryRangeUsageBitMap
;
250 // This field points to the shadowed image read function
252 PE_COFF_LOADER_READ_FILE ShadowedImageRead
;
255 // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv + 1 number of entries.
257 EFI_PEI_FILE_HANDLE
*FileHandles
;
259 // Pointer to the temp buffer with the PcdPeiCoreMaxPeimPerFv number of entries.
264 // Temp Memory Range is not covered by PeiTempMem and Stack.
265 // Those Memory Range will be migrated into phisical memory.
267 HOLE_MEMORY_DATA HoleData
[HOLE_MAX_NUMBER
];
271 /// Pei Core Instance Data Macros
273 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
274 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
277 /// Union of temporarily used function pointers (to save stack space)
280 PEICORE_FUNCTION_POINTER PeiCore
;
281 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
282 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
283 EFI_DXE_IPL_PPI
*DxeIpl
;
284 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
285 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
287 } PEI_CORE_TEMP_POINTERS
;
290 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
291 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
293 } PEI_CORE_PARAMETERS
;
300 The entry routine to Pei Core, invoked by PeiMain during transition
301 from SEC to PEI. After switching stack in the PEI core, it will restart
302 with the old core data.
305 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
306 and location of temporary RAM, the stack location and the BFV location.
307 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
308 An empty PPI list consists of a single descriptor with the end-tag
309 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
310 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
311 that both the PEI Foundation and any modules can leverage the associated service
312 calls and/or code in these early PPIs
313 @param Data Pointer to old core data that is used to initialize the
321 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
322 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
327 // Dispatcher support functions
332 This is the POSTFIX version of the dependency evaluator. When a
333 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
334 the evaluation stack. When that entry is poped from the evaluation
335 stack, the PPI is checked if it is installed. This method allows
336 some time savings as not all PPIs must be checked for certain
337 operation types (AND, OR).
340 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
341 @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to
342 the BNF described above and is stored in postfix notation.
344 @retval TRUE if it is a well-formed Grammar
345 @retval FALSE if the dependency expression overflows the evaluation stack
346 if the dependency expression underflows the evaluation stack
347 if the dependency expression is not a well-formed Grammar.
351 PeimDispatchReadiness (
352 IN EFI_PEI_SERVICES
**PeiServices
,
353 IN VOID
*DependencyExpression
357 Conduct PEIM dispatch.
359 @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data
360 @param PrivateData Pointer to the private data passed in from caller
365 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
366 IN PEI_CORE_INSTANCE
*PrivateData
370 Initialize the Dispatcher's data members
372 @param PrivateData PeiCore's private data structure
373 @param OldCoreData Old data from SecCore
374 NULL if being run in non-permament memory mode.
375 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
376 and location of temporary RAM, the stack location and the BFV location.
380 InitializeDispatcherData (
381 IN PEI_CORE_INSTANCE
*PrivateData
,
382 IN PEI_CORE_INSTANCE
*OldCoreData
,
383 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
387 This routine parses the Dependency Expression, if available, and
388 decides if the module can be executed.
391 @param Private PeiCore's private data structure
392 @param FileHandle PEIM's file handle
393 @param PeimCount The index of last dispatched PEIM.
395 @retval TRUE Can be dispatched
396 @retval FALSE Cannot be dispatched
401 IN PEI_CORE_INSTANCE
*Private
,
402 IN EFI_PEI_FILE_HANDLE FileHandle
,
407 // PPI support functions
411 Initialize PPI services.
413 @param PrivateData Pointer to the PEI Core data.
414 @param OldCoreData Pointer to old PEI Core data.
415 NULL if being run in non-permament memory mode.
419 InitializePpiServices (
420 IN PEI_CORE_INSTANCE
*PrivateData
,
421 IN PEI_CORE_INSTANCE
*OldCoreData
426 Migrate the Hob list from the temporary memory stack to PEI installed memory.
428 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
429 and location of temporary RAM, the stack location and the BFV location.
430 @param PrivateData Pointer to PeiCore's private data structure.
435 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
436 IN PEI_CORE_INSTANCE
*PrivateData
441 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.
443 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
444 @param PpiList Pointer to ppi array that want to be installed.
446 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
447 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
448 if any PPI in PpiList is not valid
449 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
455 IN CONST EFI_PEI_SERVICES
**PeiServices
,
456 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
461 Re-Install PPI services.
463 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
464 @param OldPpi Pointer to the old PEI PPI Descriptors.
465 @param NewPpi Pointer to the new PEI PPI Descriptors.
467 @retval EFI_SUCCESS if the operation was successful
468 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
469 if NewPpi is not valid
470 @retval EFI_NOT_FOUND if the PPI was not in the database
476 IN CONST EFI_PEI_SERVICES
**PeiServices
,
477 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
478 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
483 Locate a given named PPI.
486 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
487 @param Guid Pointer to GUID of the PPI.
488 @param Instance Instance Number to discover.
489 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
490 returns a pointer to the descriptor (includes flags, etc)
491 @param Ppi Pointer to reference the found PPI
493 @retval EFI_SUCCESS if the PPI is in the database
494 @retval EFI_NOT_FOUND if the PPI is not in the database
500 IN CONST EFI_PEI_SERVICES
**PeiServices
,
501 IN CONST EFI_GUID
*Guid
,
503 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
509 Install a notification for a given PPI.
512 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
513 @param NotifyList Pointer to list of Descriptors to notify upon.
515 @retval EFI_SUCCESS if successful
516 @retval EFI_OUT_OF_RESOURCES if no space in the database
517 @retval EFI_INVALID_PARAMETER if not a good decriptor
523 IN CONST EFI_PEI_SERVICES
**PeiServices
,
524 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
529 Process the Notify List at dispatch level.
531 @param PrivateData PeiCore's private data structure.
536 IN PEI_CORE_INSTANCE
*PrivateData
541 Dispatch notifications.
543 @param PrivateData PeiCore's private data structure
544 @param NotifyType Type of notify to fire.
545 @param InstallStartIndex Install Beginning index.
546 @param InstallStopIndex Install Ending index.
547 @param NotifyStartIndex Notify Beginning index.
548 @param NotifyStopIndex Notify Ending index.
553 IN PEI_CORE_INSTANCE
*PrivateData
,
555 IN INTN InstallStartIndex
,
556 IN INTN InstallStopIndex
,
557 IN INTN NotifyStartIndex
,
558 IN INTN NotifyStopIndex
562 // Boot mode support functions
565 This service enables PEIMs to ascertain the present value of the boot mode.
567 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
568 @param BootMode A pointer to contain the value of the boot mode.
570 @retval EFI_SUCCESS The boot mode was returned successfully.
571 @retval EFI_INVALID_PARAMETER BootMode is NULL.
577 IN CONST EFI_PEI_SERVICES
**PeiServices
,
578 IN OUT EFI_BOOT_MODE
*BootMode
582 This service enables PEIMs to update the boot mode variable.
585 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
586 @param BootMode The value of the boot mode to set.
588 @return EFI_SUCCESS The value was successfully updated
594 IN CONST EFI_PEI_SERVICES
**PeiServices
,
595 IN EFI_BOOT_MODE BootMode
599 // Security support functions
603 Initialize the security services.
605 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
606 @param OldCoreData Pointer to the old core data.
607 NULL if being run in non-permament memory mode.
611 InitializeSecurityServices (
612 IN EFI_PEI_SERVICES
**PeiServices
,
613 IN PEI_CORE_INSTANCE
*OldCoreData
617 Verify a Firmware volume.
619 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
621 @retval EFI_SUCCESS Firmware Volume is legal
622 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test
627 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
631 Provide a callout to the security verification service.
633 @param PrivateData PeiCore's private data structure
634 @param VolumeHandle Handle of FV
635 @param FileHandle Handle of PEIM's ffs
636 @param AuthenticationStatus Authentication status
638 @retval EFI_SUCCESS Image is OK
639 @retval EFI_SECURITY_VIOLATION Image is illegal
640 @retval EFI_NOT_FOUND If security PPI is not installed.
644 IN PEI_CORE_INSTANCE
*PrivateData
,
645 IN EFI_PEI_FV_HANDLE VolumeHandle
,
646 IN EFI_PEI_FILE_HANDLE FileHandle
,
647 IN UINT32 AuthenticationStatus
652 Gets the pointer to the HOB List.
655 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
656 @param HobList Pointer to the HOB List.
658 @retval EFI_SUCCESS Get the pointer of HOB List
659 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published
660 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)
666 IN CONST EFI_PEI_SERVICES
**PeiServices
,
667 IN OUT VOID
**HobList
671 Add a new HOB to the HOB List.
673 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
674 @param Type Type of the new HOB.
675 @param Length Length of the new HOB to allocate.
676 @param Hob Pointer to the new HOB.
678 @return EFI_SUCCESS Success to create hob.
679 @retval EFI_INVALID_PARAMETER if Hob is NULL
680 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.
681 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
687 IN CONST EFI_PEI_SERVICES
**PeiServices
,
695 Builds a Handoff Information Table HOB
697 @param BootMode - Current Bootmode
698 @param MemoryBegin - Start Memory Address.
699 @param MemoryLength - Length of Memory.
701 @return EFI_SUCCESS Always success to initialize HOB.
705 PeiCoreBuildHobHandoffInfoTable (
706 IN EFI_BOOT_MODE BootMode
,
707 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
708 IN UINT64 MemoryLength
713 // FFS Fw Volume support functions
716 Searches for the next matching file in the firmware volume.
718 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
719 @param SearchType Filter to find only files of this type.
720 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
721 @param FvHandle Handle of firmware volume in which to search.
722 @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start
723 at the beginning of the firmware volume. On exit, points the file handle of the next file
724 in the volume or NULL if there are no more files.
726 @retval EFI_NOT_FOUND The file was not found.
727 @retval EFI_NOT_FOUND The header checksum was not zero.
728 @retval EFI_SUCCESS The file was found.
734 IN CONST EFI_PEI_SERVICES
**PeiServices
,
736 IN EFI_PEI_FV_HANDLE FvHandle
,
737 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
741 Searches for the next matching section within the specified file.
743 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
744 @param SectionType Filter to find only sections of this type.
745 @param FileHandle Pointer to the current file to search.
746 @param SectionData A pointer to the discovered section, if successful.
747 NULL if section not found
749 @retval EFI_NOT_FOUND The section was not found.
750 @retval EFI_SUCCESS The section was found.
755 PeiFfsFindSectionData (
756 IN CONST EFI_PEI_SERVICES
**PeiServices
,
757 IN EFI_SECTION_TYPE SectionType
,
758 IN EFI_PEI_FILE_HANDLE FileHandle
,
759 OUT VOID
**SectionData
763 Searches for the next matching section within the specified file.
765 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
766 @param SectionType The value of the section type to find.
767 @param SectionInstance Section instance to find.
768 @param FileHandle Handle of the firmware file to search.
769 @param SectionData A pointer to the discovered section, if successful.
770 @param AuthenticationStatus A pointer to the authentication status for this section.
772 @retval EFI_SUCCESS The section was found.
773 @retval EFI_NOT_FOUND The section was not found.
778 PeiFfsFindSectionData3 (
779 IN CONST EFI_PEI_SERVICES
**PeiServices
,
780 IN EFI_SECTION_TYPE SectionType
,
781 IN UINTN SectionInstance
,
782 IN EFI_PEI_FILE_HANDLE FileHandle
,
783 OUT VOID
**SectionData
,
784 OUT UINT32
*AuthenticationStatus
788 Search the firmware volumes by index
790 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
791 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware
793 @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.
795 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL
796 @retval EFI_NOT_FOUND The volume was not found.
797 @retval EFI_SUCCESS The volume was found.
802 PeiFfsFindNextVolume (
803 IN CONST EFI_PEI_SERVICES
**PeiServices
,
805 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
809 // Memory support functions
813 Initialize the memory services.
815 @param PrivateData PeiCore's private data structure
816 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
817 and location of temporary RAM, the stack location and the BFV location.
818 @param OldCoreData Pointer to the PEI Core data.
819 NULL if being run in non-permament memory mode.
823 InitializeMemoryServices (
824 IN PEI_CORE_INSTANCE
*PrivateData
,
825 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
826 IN PEI_CORE_INSTANCE
*OldCoreData
831 Install the permanent memory is now available.
832 Creates HOB (PHIT and Stack).
834 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
835 @param MemoryBegin Start of memory address.
836 @param MemoryLength Length of memory.
838 @return EFI_SUCCESS Always success.
843 PeiInstallPeiMemory (
844 IN CONST EFI_PEI_SERVICES
**PeiServices
,
845 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
846 IN UINT64 MemoryLength
851 Memory allocation service on permanent memory,
852 not usable prior to the memory installation.
855 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
856 @param MemoryType Type of memory to allocate.
857 @param Pages Number of pages to allocate.
858 @param Memory Pointer of memory allocated.
860 @retval EFI_SUCCESS The allocation was successful
861 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
862 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available
863 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
864 to allocate the number of pages.
870 IN CONST EFI_PEI_SERVICES
**PeiServices
,
871 IN EFI_MEMORY_TYPE MemoryType
,
873 OUT EFI_PHYSICAL_ADDRESS
*Memory
878 Memory allocation service on the temporary memory.
881 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
882 @param Size Amount of memory required
883 @param Buffer Address of pointer to the buffer
885 @retval EFI_SUCCESS The allocation was successful
886 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
887 to allocate the requested size.
893 IN CONST EFI_PEI_SERVICES
**PeiServices
,
900 Routine for load image file.
903 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
904 @param FileHandle Pointer to the FFS file header of the image.
905 @param PeimState The dispatch state of the input PEIM handle.
906 @param EntryPoint Pointer to entry point of specified image file for output.
907 @param AuthenticationState Pointer to attestation authentication state of image.
909 @retval EFI_SUCCESS Image is successfully loaded.
910 @retval EFI_NOT_FOUND Fail to locate necessary PPI
911 @retval Others Fail to load file.
916 IN CONST EFI_PEI_SERVICES
**PeiServices
,
917 IN EFI_PEI_FILE_HANDLE FileHandle
,
919 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
920 OUT UINT32
*AuthenticationState
925 Core version of the Status Code reporter
928 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
929 @param CodeType Type of Status Code.
930 @param Value Value to output for Status Code.
931 @param Instance Instance Number of this status code.
932 @param CallerId ID of the caller of this status code.
933 @param Data Optional data associated with this status code.
935 @retval EFI_SUCCESS if status code is successfully reported
936 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
941 PeiReportStatusCode (
942 IN CONST EFI_PEI_SERVICES
**PeiServices
,
943 IN EFI_STATUS_CODE_TYPE CodeType
,
944 IN EFI_STATUS_CODE_VALUE Value
,
946 IN CONST EFI_GUID
*CallerId
,
947 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
952 Core version of the Reset System
955 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
957 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
958 @retval EFI_DEVICE_ERROR Did not reset system.
959 Otherwise, resets the system.
965 IN CONST EFI_PEI_SERVICES
**PeiServices
969 Resets the entire platform.
971 @param[in] ResetType The type of reset to perform.
972 @param[in] ResetStatus The status code for the reset.
973 @param[in] DataSize The size, in bytes, of WatchdogData.
974 @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown
975 the data buffer starts with a Null-terminated string, optionally
976 followed by additional binary data. The string is a description
977 that the caller may use to further indicate the reason for the
978 system reset. ResetData is only valid if ResetStatus is something
979 other than EFI_SUCCESS unless the ResetType is EfiResetPlatformSpecific
980 where a minimum amount of ResetData is always required.
986 IN EFI_RESET_TYPE ResetType
,
987 IN EFI_STATUS ResetStatus
,
989 IN VOID
*ResetData OPTIONAL
994 Initialize PeiCore Fv List.
997 @param PrivateData - Pointer to PEI_CORE_INSTANCE.
998 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1003 IN PEI_CORE_INSTANCE
*PrivateData
,
1004 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1008 Process Firmware Volum Information once FvInfoPPI install.
1010 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1011 @param NotifyDescriptor Address of the notification descriptor data structure.
1012 @param Ppi Address of the PPI that was installed.
1014 @retval EFI_SUCCESS if the interface could be successfully installed
1019 FirmwareVolmeInfoPpiNotifyCallback (
1020 IN EFI_PEI_SERVICES
**PeiServices
,
1021 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1027 Given the input VolumeHandle, search for the next matching name file.
1029 @param FileName File name to search.
1030 @param VolumeHandle The current FV to search.
1031 @param FileHandle Pointer to the file matching name in VolumeHandle.
1032 NULL if file not found
1034 @retval EFI_NOT_FOUND No files matching the search criteria were found
1035 @retval EFI_SUCCESS Success to search given file
1040 PeiFfsFindFileByName (
1041 IN CONST EFI_GUID
*FileName
,
1042 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1043 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1047 Returns information about a specific file.
1049 @param FileHandle Handle of the file.
1050 @param FileInfo Upon exit, points to the file's information.
1052 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
1053 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
1054 @retval EFI_SUCCESS File information returned.
1060 IN EFI_PEI_FILE_HANDLE FileHandle
,
1061 OUT EFI_FV_FILE_INFO
*FileInfo
1065 Returns information about a specific file.
1067 @param FileHandle Handle of the file.
1068 @param FileInfo Upon exit, points to the file's information.
1070 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
1071 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
1072 @retval EFI_SUCCESS File information returned.
1077 PeiFfsGetFileInfo2 (
1078 IN EFI_PEI_FILE_HANDLE FileHandle
,
1079 OUT EFI_FV_FILE_INFO2
*FileInfo
1083 Returns information about the specified volume.
1085 @param VolumeHandle Handle of the volume.
1086 @param VolumeInfo Upon exit, points to the volume's information.
1088 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
1089 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.
1090 @retval EFI_SUCCESS Volume information returned.
1094 PeiFfsGetVolumeInfo (
1095 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1096 OUT EFI_FV_INFO
*VolumeInfo
1100 This routine enable a PEIM to register itself to shadow when PEI Foundation
1101 discovery permanent memory.
1103 @param FileHandle File handle of a PEIM.
1105 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1106 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1107 @retval EFI_SUCCESS Successfully to register itself.
1112 PeiRegisterForShadow (
1113 IN EFI_PEI_FILE_HANDLE FileHandle
1117 Initialize image service that install PeiLoadFilePpi.
1119 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.
1120 @param OldCoreData Pointer to Old PeiCore's private data.
1121 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.
1122 If not NULL, PeiCore is entered at second time, stack/heap has been moved
1123 to permenent memory.
1127 InitializeImageServices (
1128 IN PEI_CORE_INSTANCE
*PrivateData
,
1129 IN PEI_CORE_INSTANCE
*OldCoreData
1133 The wrapper function of PeiLoadImageLoadImage().
1135 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.
1136 @param FileHandle Pointer to the FFS file header of the image.
1137 @param ImageAddressArg Pointer to PE/TE image.
1138 @param ImageSizeArg Size of PE/TE image.
1139 @param EntryPoint Pointer to entry point of specified image file for output.
1140 @param AuthenticationState Pointer to attestation authentication state of image.
1142 @return Status of PeiLoadImageLoadImage().
1147 PeiLoadImageLoadImageWrapper (
1148 IN CONST EFI_PEI_LOAD_FILE_PPI
*This
,
1149 IN EFI_PEI_FILE_HANDLE FileHandle
,
1150 OUT EFI_PHYSICAL_ADDRESS
*ImageAddressArg
, OPTIONAL
1151 OUT UINT64
*ImageSizeArg
, OPTIONAL
1152 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1153 OUT UINT32
*AuthenticationState
1158 Provide a callback for when the security PPI is installed.
1160 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1161 @param NotifyDescriptor The descriptor for the notification event.
1162 @param Ppi Pointer to the PPI in question.
1164 @return Always success
1169 SecurityPpiNotifyCallback (
1170 IN EFI_PEI_SERVICES
**PeiServices
,
1171 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1176 Get Fv image from the FV type file, then install FV INFO(2) ppi, Build FV hob.
1178 @param PrivateData PeiCore's private data structure
1179 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.
1180 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.
1182 @retval EFI_NOT_FOUND FV image can't be found.
1183 @retval EFI_SUCCESS Successfully to process it.
1184 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
1185 @retval EFI_SECURITY_VIOLATION Image is illegal
1186 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
1191 IN PEI_CORE_INSTANCE
*PrivateData
,
1192 IN PEI_CORE_FV_HANDLE
*ParentFvCoreHandle
,
1193 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
1197 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
1199 This routine also will install FvInfo ppi for FV hob in PI ways.
1201 @param Private Pointer of PEI_CORE_INSTANCE
1202 @param Instance The index of FV want to be searched.
1204 @return Instance of PEI_CORE_FV_HANDLE.
1206 PEI_CORE_FV_HANDLE
*
1207 FindNextCoreFvHandle (
1208 IN PEI_CORE_INSTANCE
*Private
,
1213 // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1217 Memory-based read services.
1219 This function is to perform the Memory Access Read service based on installed
1220 instance of the EFI_PEI_CPU_IO_PPI.
1221 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1222 return EFI_NOT_YET_AVAILABLE.
1224 @param PeiServices An indirect pointer to the PEI Services Table
1225 published by the PEI Foundation.
1226 @param This Pointer to local data for the interface.
1227 @param Width The width of the access. Enumerated in bytes.
1228 @param Address The physical address of the access.
1229 @param Count The number of accesses to perform.
1230 @param Buffer A pointer to the buffer of data.
1232 @retval EFI_SUCCESS The function completed successfully.
1233 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1238 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1239 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1240 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1247 Memory-based write services.
1249 This function is to perform the Memory Access Write service based on installed
1250 instance of the EFI_PEI_CPU_IO_PPI.
1251 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1252 return EFI_NOT_YET_AVAILABLE.
1254 @param PeiServices An indirect pointer to the PEI Services Table
1255 published by the PEI Foundation.
1256 @param This Pointer to local data for the interface.
1257 @param Width The width of the access. Enumerated in bytes.
1258 @param Address The physical address of the access.
1259 @param Count The number of accesses to perform.
1260 @param Buffer A pointer to the buffer of data.
1262 @retval EFI_SUCCESS The function completed successfully.
1263 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1267 PeiDefaultMemWrite (
1268 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1269 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1270 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1277 IO-based read services.
1279 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
1280 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1281 return EFI_NOT_YET_AVAILABLE.
1283 @param PeiServices An indirect pointer to the PEI Services Table
1284 published by the PEI Foundation.
1285 @param This Pointer to local data for the interface.
1286 @param Width The width of the access. Enumerated in bytes.
1287 @param Address The physical address of the access.
1288 @param Count The number of accesses to perform.
1289 @param Buffer A pointer to the buffer of data.
1291 @retval EFI_SUCCESS The function completed successfully.
1292 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1297 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1298 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1299 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1306 IO-based write services.
1308 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
1309 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1310 return EFI_NOT_YET_AVAILABLE.
1312 @param PeiServices An indirect pointer to the PEI Services Table
1313 published by the PEI Foundation.
1314 @param This Pointer to local data for the interface.
1315 @param Width The width of the access. Enumerated in bytes.
1316 @param Address The physical address of the access.
1317 @param Count The number of accesses to perform.
1318 @param Buffer A pointer to the buffer of data.
1320 @retval EFI_SUCCESS The function completed successfully.
1321 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1326 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1327 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1328 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1335 8-bit I/O read operations.
1337 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1340 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1341 @param This Pointer to local data for the interface.
1342 @param Address The physical address of the access.
1344 @return An 8-bit value returned from the I/O space.
1349 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1350 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1355 Reads an 16-bit I/O port.
1357 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1360 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1361 @param This Pointer to local data for the interface.
1362 @param Address The physical address of the access.
1364 @return A 16-bit value returned from the I/O space.
1368 PeiDefaultIoRead16 (
1369 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1370 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1375 Reads an 32-bit I/O port.
1377 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1380 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1381 @param This Pointer to local data for the interface.
1382 @param Address The physical address of the access.
1384 @return A 32-bit value returned from the I/O space.
1388 PeiDefaultIoRead32 (
1389 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1390 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1395 Reads an 64-bit I/O port.
1397 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1400 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1401 @param This Pointer to local data for the interface.
1402 @param Address The physical address of the access.
1404 @return A 64-bit value returned from the I/O space.
1408 PeiDefaultIoRead64 (
1409 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1410 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1415 8-bit I/O write operations.
1417 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1418 @param This Pointer to local data for the interface.
1419 @param Address The physical address of the access.
1420 @param Data The data to write.
1424 PeiDefaultIoWrite8 (
1425 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1426 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1432 16-bit I/O write operations.
1434 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1435 @param This Pointer to local data for the interface.
1436 @param Address The physical address of the access.
1437 @param Data The data to write.
1441 PeiDefaultIoWrite16 (
1442 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1443 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1449 32-bit I/O write operations.
1451 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1452 @param This Pointer to local data for the interface.
1453 @param Address The physical address of the access.
1454 @param Data The data to write.
1458 PeiDefaultIoWrite32 (
1459 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1460 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1466 64-bit I/O write operations.
1468 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1469 @param This Pointer to local data for the interface.
1470 @param Address The physical address of the access.
1471 @param Data The data to write.
1475 PeiDefaultIoWrite64 (
1476 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1477 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1483 8-bit memory read operations.
1485 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1488 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1489 @param This Pointer to local data for the interface.
1490 @param Address The physical address of the access.
1492 @return An 8-bit value returned from the memory space.
1497 PeiDefaultMemRead8 (
1498 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1499 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1504 16-bit memory read operations.
1506 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1509 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1510 @param This Pointer to local data for the interface.
1511 @param Address The physical address of the access.
1513 @return An 16-bit value returned from the memory space.
1518 PeiDefaultMemRead16 (
1519 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1520 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1525 32-bit memory read operations.
1527 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1530 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1531 @param This Pointer to local data for the interface.
1532 @param Address The physical address of the access.
1534 @return An 32-bit value returned from the memory space.
1539 PeiDefaultMemRead32 (
1540 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1541 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1546 64-bit memory read operations.
1548 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1551 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1552 @param This Pointer to local data for the interface.
1553 @param Address The physical address of the access.
1555 @return An 64-bit value returned from the memory space.
1560 PeiDefaultMemRead64 (
1561 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1562 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1567 8-bit memory write operations.
1569 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1570 @param This Pointer to local data for the interface.
1571 @param Address The physical address of the access.
1572 @param Data The data to write.
1577 PeiDefaultMemWrite8 (
1578 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1579 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1585 16-bit memory write operations.
1587 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1588 @param This Pointer to local data for the interface.
1589 @param Address The physical address of the access.
1590 @param Data The data to write.
1595 PeiDefaultMemWrite16 (
1596 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1597 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1603 32-bit memory write operations.
1605 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1606 @param This Pointer to local data for the interface.
1607 @param Address The physical address of the access.
1608 @param Data The data to write.
1613 PeiDefaultMemWrite32 (
1614 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1615 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1621 64-bit memory write operations.
1623 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1624 @param This Pointer to local data for the interface.
1625 @param Address The physical address of the access.
1626 @param Data The data to write.
1631 PeiDefaultMemWrite64 (
1632 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1633 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1638 extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
;
1641 // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1645 Reads from a given location in the PCI configuration space.
1647 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1648 return EFI_NOT_YET_AVAILABLE.
1650 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1651 @param This Pointer to local data for the interface.
1652 @param Width The width of the access. Enumerated in bytes.
1653 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1654 @param Address The physical address of the access. The format of
1655 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1656 @param Buffer A pointer to the buffer of data.
1658 @retval EFI_SUCCESS The function completed successfully.
1659 @retval EFI_INVALID_PARAMETER The invalid access width.
1660 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1665 PeiDefaultPciCfg2Read (
1666 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1667 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1668 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1674 Write to a given location in the PCI configuration space.
1676 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1677 return EFI_NOT_YET_AVAILABLE.
1679 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1680 @param This Pointer to local data for the interface.
1681 @param Width The width of the access. Enumerated in bytes.
1682 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1683 @param Address The physical address of the access. The format of
1684 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1685 @param Buffer A pointer to the buffer of data.
1687 @retval EFI_SUCCESS The function completed successfully.
1688 @retval EFI_INVALID_PARAMETER The invalid access width.
1689 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1693 PeiDefaultPciCfg2Write (
1694 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1695 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1696 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1702 This function performs a read-modify-write operation on the contents from a given
1703 location in the PCI configuration space.
1705 @param PeiServices An indirect pointer to the PEI Services Table
1706 published by the PEI Foundation.
1707 @param This Pointer to local data for the interface.
1708 @param Width The width of the access. Enumerated in bytes. Type
1709 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
1710 @param Address The physical address of the access.
1711 @param SetBits Points to value to bitwise-OR with the read configuration value.
1712 The size of the value is determined by Width.
1713 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
1714 The size of the value is determined by Width.
1716 @retval EFI_SUCCESS The function completed successfully.
1717 @retval EFI_INVALID_PARAMETER The invalid access width.
1718 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1722 PeiDefaultPciCfg2Modify (
1723 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1724 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1725 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1731 extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
;
1734 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
1735 be re-installed with the instance in permanent memory and all cached FvPpi pointers in
1736 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant
1739 @param PrivateData Pointer to PEI_CORE_INSTANCE.
1743 IN PEI_CORE_INSTANCE
*PrivateData