2 Definition of Pei Core Structures and Services
4 Copyright (c) 2006 - 2010, 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/FirmwareVolume.h>
24 #include <Ppi/FirmwareVolumeInfo.h>
25 #include <Ppi/Decompress.h>
26 #include <Ppi/GuidedSectionExtraction.h>
27 #include <Ppi/LoadFile.h>
28 #include <Ppi/Security2.h>
29 #include <Ppi/TemporaryRamSupport.h>
30 #include <Library/DebugLib.h>
31 #include <Library/PeiCoreEntryPoint.h>
32 #include <Library/BaseLib.h>
33 #include <Library/HobLib.h>
34 #include <Library/PerformanceLib.h>
35 #include <Library/PeiServicesLib.h>
36 #include <Library/ReportStatusCodeLib.h>
37 #include <Library/PeCoffLib.h>
38 #include <Library/PeCoffGetEntryPointLib.h>
39 #include <Library/BaseMemoryLib.h>
40 #include <Library/CacheMaintenanceLib.h>
41 #include <Library/TimerLib.h>
42 #include <Library/PcdLib.h>
43 #include <IndustryStandard/PeImage.h>
44 #include <Library/PeiServicesTablePointerLib.h>
45 #include <Library/MemoryAllocationLib.h>
46 #include <Guid/FirmwareFileSystem2.h>
47 #include <Guid/AprioriFileName.h>
50 /// It is an FFS type extension used for PeiFindFileEx. It indicates current
51 /// Ffs searching is for all PEIMs can be dispatched by PeiCore.
53 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
56 /// Pei Core private data structures
59 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
60 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
62 } PEI_PPI_LIST_POINTERS
;
65 /// PPI database structure which contains two link: PpiList and NotifyList. PpiList
66 /// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.
70 /// index of end of PpiList link list.
74 /// index of end of notify link list.
78 /// index of the dispatched notify list.
82 /// index of last installed Ppi description in PpiList link list.
84 INTN LastDispatchedInstall
;
86 /// index of last dispatched notify in Notify link list.
88 INTN LastDispatchedNotify
;
92 PEI_PPI_LIST_POINTERS PpiListPtrs
[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported
)];
97 // PEI_CORE_FV_HANDE.PeimState
98 // Do not change these values as there is code doing math to change states.
99 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
101 #define PEIM_STATE_NOT_DISPATCHED 0x00
102 #define PEIM_STATE_DISPATCHED 0x01
103 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
104 #define PEIM_STATE_DONE 0x03
107 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
108 EFI_PEI_FIRMWARE_VOLUME_PPI
*FvPpi
;
109 EFI_PEI_FV_HANDLE FvHandle
;
110 UINT8 PeimState
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
111 EFI_PEI_FILE_HANDLE FvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
113 } PEI_CORE_FV_HANDLE
;
119 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor
;
120 } PEI_CORE_UNKNOW_FORMAT_FV_INFO
;
122 #define CACHE_SETION_MAX_NUMBER 0x10
124 EFI_COMMON_SECTION_HEADER
* Section
[CACHE_SETION_MAX_NUMBER
];
125 VOID
* SectionData
[CACHE_SETION_MAX_NUMBER
];
126 UINTN SectionSize
[CACHE_SETION_MAX_NUMBER
];
127 UINTN AllSectionCount
;
129 } CACHE_SECTION_DATA
;
132 /// Forward declaration for PEI_CORE_INSTANCE
134 typedef struct _PEI_CORE_INSTANCE PEI_CORE_INSTANCE
;
138 Function Pointer type for PeiCore function.
139 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
140 and location of temporary RAM, the stack location and the BFV location.
141 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
142 An empty PPI list consists of a single descriptor with the end-tag
143 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
144 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
145 that both the PEI Foundation and any modules can leverage the associated service
146 calls and/or code in these early PPIs
147 @param OldCoreData Pointer to old core data that is used to initialize the
152 (EFIAPI
*PEICORE_FUNCTION_POINTER
)(
153 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
154 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
155 IN PEI_CORE_INSTANCE
*OldCoreData
158 #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
161 /// Pei Core private data structure instance
163 struct _PEI_CORE_INSTANCE
{
167 /// Point to ServiceTableShadow
169 EFI_PEI_SERVICES
*Ps
;
170 PEI_PPI_DATABASE PpiData
;
173 /// The count of FVs which contains FFS and could be dispatched by PeiCore.
178 /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore.
180 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
181 PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
182 UINTN UnknownFvInfoCount
;
184 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
186 UINTN CurrentPeimFvCount
;
187 UINTN CurrentPeimCount
;
188 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
189 BOOLEAN PeimNeedingDispatch
;
190 BOOLEAN PeimDispatchOnThisPass
;
191 BOOLEAN PeimDispatcherReenter
;
192 EFI_PEI_HOB_POINTERS HobList
;
193 BOOLEAN SwitchStackSignal
;
194 BOOLEAN PeiMemoryInstalled
;
196 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
197 EFI_PEI_SERVICES ServiceTableShadow
;
198 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
199 EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin
;
200 UINT64 PhysicalMemoryLength
;
201 EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop
;
203 BOOLEAN HeapOffsetPositive
;
204 PEICORE_FUNCTION_POINTER ShadowedPeiCore
;
205 CACHE_SECTION_DATA CacheSection
;
207 // For Loading modules at fixed address feature to cache the top address below which the
208 // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
209 // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
211 EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress
;
213 // The field is define for Loading modules at fixed address feature to tracker the PEI code
214 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
217 UINT64
*PeiCodeMemoryRangeUsageBitMap
;
219 // This field points to the shadowed image read function
221 PE_COFF_LOADER_READ_FILE ShadowedImageRead
;
225 /// Pei Core Instance Data Macros
227 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
228 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
231 /// Union of temporarily used function pointers (to save stack space)
234 PEICORE_FUNCTION_POINTER PeiCore
;
235 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
236 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
237 EFI_DXE_IPL_PPI
*DxeIpl
;
238 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
239 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
241 } PEI_CORE_TEMP_POINTERS
;
244 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
245 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
247 } PEI_CORE_PARAMETERS
;
254 The entry routine to Pei Core, invoked by PeiMain during transition
255 from SEC to PEI. After switching stack in the PEI core, it will restart
256 with the old core data.
259 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
260 and location of temporary RAM, the stack location and the BFV location.
261 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
262 An empty PPI list consists of a single descriptor with the end-tag
263 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
264 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
265 that both the PEI Foundation and any modules can leverage the associated service
266 calls and/or code in these early PPIs
267 @param Data Pointer to old core data that is used to initialize the
274 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
275 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
280 // Dispatcher support functions
285 This is the POSTFIX version of the dependency evaluator. When a
286 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
287 the evaluation stack. When that entry is poped from the evaluation
288 stack, the PPI is checked if it is installed. This method allows
289 some time savings as not all PPIs must be checked for certain
290 operation types (AND, OR).
293 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
294 @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to
295 the BNF described above and is stored in postfix notation.
297 @retval TRUE if it is a well-formed Grammar
298 @retval FALSE if the dependency expression overflows the evaluation stack
299 if the dependency expression underflows the evaluation stack
300 if the dependency expression is not a well-formed Grammar.
304 PeimDispatchReadiness (
305 IN EFI_PEI_SERVICES
**PeiServices
,
306 IN VOID
*DependencyExpression
310 Conduct PEIM dispatch.
312 @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data
313 @param PrivateData Pointer to the private data passed in from caller
318 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
319 IN PEI_CORE_INSTANCE
*PrivateData
323 Initialize the Dispatcher's data members
325 @param PrivateData PeiCore's private data structure
326 @param OldCoreData Old data from SecCore
327 NULL if being run in non-permament memory mode.
328 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
329 and location of temporary RAM, the stack location and the BFV location.
333 InitializeDispatcherData (
334 IN PEI_CORE_INSTANCE
*PrivateData
,
335 IN PEI_CORE_INSTANCE
*OldCoreData
,
336 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
340 This routine parses the Dependency Expression, if available, and
341 decides if the module can be executed.
344 @param Private PeiCore's private data structure
345 @param FileHandle PEIM's file handle
346 @param PeimCount The index of last dispatched PEIM.
348 @retval TRUE Can be dispatched
349 @retval FALSE Cannot be dispatched
354 IN PEI_CORE_INSTANCE
*Private
,
355 IN EFI_PEI_FILE_HANDLE FileHandle
,
360 // PPI support functions
364 Initialize PPI services.
366 @param PrivateData Pointer to the PEI Core data.
367 @param OldCoreData Pointer to old PEI Core data.
368 NULL if being run in non-permament memory mode.
372 InitializePpiServices (
373 IN PEI_CORE_INSTANCE
*PrivateData
,
374 IN PEI_CORE_INSTANCE
*OldCoreData
379 Migrate the Hob list from the temporary memory stack to PEI installed memory.
381 @param PrivateData Pointer to PeiCore's private data structure.
382 @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range
383 will be fixup for PpiData and PpiDescriptor pointer.
384 @param OldCheckingTop Top of temporary memory range. All Ppi in this range
385 will be fixup for PpiData and PpiDescriptor.
386 @param Fixup The address difference between
387 the new Hob list and old Hob list.
388 @param FixupPositive TRUE if new Hob list is above the old Hob list.
394 IN PEI_CORE_INSTANCE
*PrivateData
,
395 IN UINTN OldCheckingBottom
,
396 IN UINTN OldCheckingTop
,
398 IN BOOLEAN FixupPositive
403 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.
405 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
406 @param PpiList Pointer to ppi array that want to be installed.
408 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
409 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
410 if any PPI in PpiList is not valid
411 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
417 IN CONST EFI_PEI_SERVICES
**PeiServices
,
418 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
423 Re-Install PPI services.
425 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
426 @param OldPpi Pointer to the old PEI PPI Descriptors.
427 @param NewPpi Pointer to the new PEI PPI Descriptors.
429 @retval EFI_SUCCESS if the operation was successful
430 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
431 if NewPpi is not valid
432 @retval EFI_NOT_FOUND if the PPI was not in the database
438 IN CONST EFI_PEI_SERVICES
**PeiServices
,
439 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
440 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
445 Locate a given named PPI.
448 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
449 @param Guid Pointer to GUID of the PPI.
450 @param Instance Instance Number to discover.
451 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
452 returns a pointer to the descriptor (includes flags, etc)
453 @param Ppi Pointer to reference the found PPI
455 @retval EFI_SUCCESS if the PPI is in the database
456 @retval EFI_NOT_FOUND if the PPI is not in the database
462 IN CONST EFI_PEI_SERVICES
**PeiServices
,
463 IN CONST EFI_GUID
*Guid
,
465 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
471 Install a notification for a given PPI.
474 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
475 @param NotifyList Pointer to list of Descriptors to notify upon.
477 @retval EFI_SUCCESS if successful
478 @retval EFI_OUT_OF_RESOURCES if no space in the database
479 @retval EFI_INVALID_PARAMETER if not a good decriptor
485 IN CONST EFI_PEI_SERVICES
**PeiServices
,
486 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
491 Process the Notify List at dispatch level.
493 @param PrivateData PeiCore's private data structure.
498 IN PEI_CORE_INSTANCE
*PrivateData
503 Dispatch notifications.
505 @param PrivateData PeiCore's private data structure
506 @param NotifyType Type of notify to fire.
507 @param InstallStartIndex Install Beginning index.
508 @param InstallStopIndex Install Ending index.
509 @param NotifyStartIndex Notify Beginning index.
510 @param NotifyStopIndex Notify Ending index.
515 IN PEI_CORE_INSTANCE
*PrivateData
,
517 IN INTN InstallStartIndex
,
518 IN INTN InstallStopIndex
,
519 IN INTN NotifyStartIndex
,
520 IN INTN NotifyStopIndex
524 // Boot mode support functions
527 This service enables PEIMs to ascertain the present value of the boot mode.
529 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
530 @param BootMode A pointer to contain the value of the boot mode.
532 @retval EFI_SUCCESS The boot mode was returned successfully.
533 @retval EFI_INVALID_PARAMETER BootMode is NULL.
539 IN CONST EFI_PEI_SERVICES
**PeiServices
,
540 IN OUT EFI_BOOT_MODE
*BootMode
544 This service enables PEIMs to update the boot mode variable.
547 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
548 @param BootMode The value of the boot mode to set.
550 @return EFI_SUCCESS The value was successfully updated
556 IN CONST EFI_PEI_SERVICES
**PeiServices
,
557 IN EFI_BOOT_MODE BootMode
561 // Security support functions
565 Initialize the security services.
567 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
568 @param OldCoreData Pointer to the old core data.
569 NULL if being run in non-permament memory mode.
573 InitializeSecurityServices (
574 IN EFI_PEI_SERVICES
**PeiServices
,
575 IN PEI_CORE_INSTANCE
*OldCoreData
579 Verify a Firmware volume.
581 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
583 @retval EFI_SUCCESS Firmware Volume is legal
584 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test
589 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
594 Provide a callout to the security verification service.
597 @param PrivateData PeiCore's private data structure
598 @param VolumeHandle Handle of FV
599 @param FileHandle Handle of PEIM's ffs
601 @retval EFI_SUCCESS Image is OK
602 @retval EFI_SECURITY_VIOLATION Image is illegal
607 IN PEI_CORE_INSTANCE
*PrivateData
,
608 IN EFI_PEI_FV_HANDLE VolumeHandle
,
609 IN EFI_PEI_FILE_HANDLE FileHandle
614 Gets the pointer to the HOB List.
617 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
618 @param HobList Pointer to the HOB List.
620 @retval EFI_SUCCESS Get the pointer of HOB List
621 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published
622 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)
628 IN CONST EFI_PEI_SERVICES
**PeiServices
,
629 IN OUT VOID
**HobList
633 Add a new HOB to the HOB List.
635 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
636 @param Type Type of the new HOB.
637 @param Length Length of the new HOB to allocate.
638 @param Hob Pointer to the new HOB.
640 @return EFI_SUCCESS Success to create hob.
641 @retval EFI_INVALID_PARAMETER if Hob is NULL
642 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.
643 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
649 IN CONST EFI_PEI_SERVICES
**PeiServices
,
657 Builds a Handoff Information Table HOB
659 @param BootMode - Current Bootmode
660 @param MemoryBegin - Start Memory Address.
661 @param MemoryLength - Length of Memory.
663 @return EFI_SUCCESS Always success to initialize HOB.
667 PeiCoreBuildHobHandoffInfoTable (
668 IN EFI_BOOT_MODE BootMode
,
669 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
670 IN UINT64 MemoryLength
675 // FFS Fw Volume support functions
678 Searches for the next matching file in the firmware volume.
680 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
681 @param SearchType Filter to find only files of this type.
682 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
683 @param FvHandle Handle of firmware volume in which to search.
684 @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start
685 at the beginning of the firmware volume. On exit, points the file handle of the next file
686 in the volume or NULL if there are no more files.
688 @retval EFI_NOT_FOUND The file was not found.
689 @retval EFI_NOT_FOUND The header checksum was not zero.
690 @retval EFI_SUCCESS The file was found.
696 IN CONST EFI_PEI_SERVICES
**PeiServices
,
698 IN EFI_PEI_FV_HANDLE FvHandle
,
699 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
703 Searches for the next matching section within the specified file.
705 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
706 @param SectionType Filter to find only sections of this type.
707 @param FileHandle Pointer to the current file to search.
708 @param SectionData A pointer to the discovered section, if successful.
709 NULL if section not found
711 @retval EFI_NOT_FOUND The section was not found.
712 @retval EFI_SUCCESS The section was found.
717 PeiFfsFindSectionData (
718 IN CONST EFI_PEI_SERVICES
**PeiServices
,
719 IN EFI_SECTION_TYPE SectionType
,
720 IN EFI_PEI_FILE_HANDLE FileHandle
,
721 OUT VOID
**SectionData
725 Search the firmware volumes by index
727 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
728 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware
730 @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.
732 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL
733 @retval EFI_NOT_FOUND The volume was not found.
734 @retval EFI_SUCCESS The volume was found.
739 PeiFfsFindNextVolume (
740 IN CONST EFI_PEI_SERVICES
**PeiServices
,
742 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
746 // Memory support functions
750 Initialize the memory services.
752 @param PrivateData PeiCore's private data structure
753 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
754 and location of temporary RAM, the stack location and the BFV location.
755 @param OldCoreData Pointer to the PEI Core data.
756 NULL if being run in non-permament memory mode.
760 InitializeMemoryServices (
761 IN PEI_CORE_INSTANCE
*PrivateData
,
762 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
763 IN PEI_CORE_INSTANCE
*OldCoreData
768 Install the permanent memory is now available.
769 Creates HOB (PHIT and Stack).
771 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
772 @param MemoryBegin Start of memory address.
773 @param MemoryLength Length of memory.
775 @return EFI_SUCCESS Always success.
780 PeiInstallPeiMemory (
781 IN CONST EFI_PEI_SERVICES
**PeiServices
,
782 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
783 IN UINT64 MemoryLength
788 Memory allocation service on permanent memory,
789 not usable prior to the memory installation.
792 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
793 @param MemoryType Type of memory to allocate.
794 @param Pages Number of pages to allocate.
795 @param Memory Pointer of memory allocated.
797 @retval EFI_SUCCESS The allocation was successful
798 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
799 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available
800 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
801 to allocate the number of pages.
807 IN CONST EFI_PEI_SERVICES
**PeiServices
,
808 IN EFI_MEMORY_TYPE MemoryType
,
810 OUT EFI_PHYSICAL_ADDRESS
*Memory
815 Memory allocation service on the temporary memory.
818 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
819 @param Size Amount of memory required
820 @param Buffer Address of pointer to the buffer
822 @retval EFI_SUCCESS The allocation was successful
823 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
824 to allocate the requested size.
830 IN CONST EFI_PEI_SERVICES
**PeiServices
,
837 Routine for load image file.
840 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
841 @param FileHandle Pointer to the FFS file header of the image.
842 @param PeimState The dispatch state of the input PEIM handle.
843 @param EntryPoint Pointer to entry point of specified image file for output.
844 @param AuthenticationState Pointer to attestation authentication state of image.
846 @retval EFI_SUCCESS Image is successfully loaded.
847 @retval EFI_NOT_FOUND Fail to locate necessary PPI
848 @retval Others Fail to load file.
853 IN CONST EFI_PEI_SERVICES
**PeiServices
,
854 IN EFI_PEI_FILE_HANDLE FileHandle
,
856 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
857 OUT UINT32
*AuthenticationState
862 Core version of the Status Code reporter
865 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
866 @param CodeType Type of Status Code.
867 @param Value Value to output for Status Code.
868 @param Instance Instance Number of this status code.
869 @param CallerId ID of the caller of this status code.
870 @param Data Optional data associated with this status code.
872 @retval EFI_SUCCESS if status code is successfully reported
873 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
878 PeiReportStatusCode (
879 IN CONST EFI_PEI_SERVICES
**PeiServices
,
880 IN EFI_STATUS_CODE_TYPE CodeType
,
881 IN EFI_STATUS_CODE_VALUE Value
,
883 IN CONST EFI_GUID
*CallerId
,
884 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
889 Core version of the Reset System
892 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
894 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
895 @retval EFI_DEVICE_ERROR Did not reset system.
896 Otherwise, resets the system.
902 IN CONST EFI_PEI_SERVICES
**PeiServices
907 Initialize PeiCore Fv List.
910 @param PrivateData - Pointer to PEI_CORE_INSTANCE.
911 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
916 IN PEI_CORE_INSTANCE
*PrivateData
,
917 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
921 Process Firmware Volum Information once FvInfoPPI install.
923 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
924 @param NotifyDescriptor Address of the notification descriptor data structure.
925 @param Ppi Address of the PPI that was installed.
927 @retval EFI_SUCCESS if the interface could be successfully installed
932 FirmwareVolmeInfoPpiNotifyCallback (
933 IN EFI_PEI_SERVICES
**PeiServices
,
934 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
940 Given the input VolumeHandle, search for the next matching name file.
942 @param FileName File name to search.
943 @param VolumeHandle The current FV to search.
944 @param FileHandle Pointer to the file matching name in VolumeHandle.
945 NULL if file not found
947 @retval EFI_NOT_FOUND No files matching the search criteria were found
948 @retval EFI_SUCCESS Success to search given file
953 PeiFfsFindFileByName (
954 IN CONST EFI_GUID
*FileName
,
955 IN EFI_PEI_FV_HANDLE VolumeHandle
,
956 OUT EFI_PEI_FILE_HANDLE
*FileHandle
960 Returns information about a specific file.
962 @param FileHandle Handle of the file.
963 @param FileInfo Upon exit, points to the file's information.
965 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
966 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
967 @retval EFI_SUCCESS File information returned.
973 IN EFI_PEI_FILE_HANDLE FileHandle
,
974 OUT EFI_FV_FILE_INFO
*FileInfo
978 Returns information about the specified volume.
980 @param VolumeHandle Handle of the volume.
981 @param VolumeInfo Upon exit, points to the volume's information.
983 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
984 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.
985 @retval EFI_SUCCESS Volume information returned.
989 PeiFfsGetVolumeInfo (
990 IN EFI_PEI_FV_HANDLE VolumeHandle
,
991 OUT EFI_FV_INFO
*VolumeInfo
995 This routine enable a PEIM to register itself to shadow when PEI Foundation
996 discovery permanent memory.
998 @param FileHandle File handle of a PEIM.
1000 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1001 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1002 @retval EFI_SUCCESS Successfully to register itself.
1007 PeiRegisterForShadow (
1008 IN EFI_PEI_FILE_HANDLE FileHandle
1012 Initialize image service that install PeiLoadFilePpi.
1014 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.
1015 @param OldCoreData Pointer to Old PeiCore's private data.
1016 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.
1017 If not NULL, PeiCore is entered at second time, stack/heap has been moved
1018 to permenent memory.
1022 InitializeImageServices (
1023 IN PEI_CORE_INSTANCE
*PrivateData
,
1024 IN PEI_CORE_INSTANCE
*OldCoreData
1028 The wrapper function of PeiLoadImageLoadImage().
1030 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.
1031 @param FileHandle Pointer to the FFS file header of the image.
1032 @param ImageAddressArg Pointer to PE/TE image.
1033 @param ImageSizeArg Size of PE/TE image.
1034 @param EntryPoint Pointer to entry point of specified image file for output.
1035 @param AuthenticationState Pointer to attestation authentication state of image.
1037 @return Status of PeiLoadImageLoadImage().
1042 PeiLoadImageLoadImageWrapper (
1043 IN CONST EFI_PEI_LOAD_FILE_PPI
*This
,
1044 IN EFI_PEI_FILE_HANDLE FileHandle
,
1045 OUT EFI_PHYSICAL_ADDRESS
*ImageAddressArg
, OPTIONAL
1046 OUT UINT64
*ImageSizeArg
, OPTIONAL
1047 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1048 OUT UINT32
*AuthenticationState
1053 Provide a callback for when the security PPI is installed.
1055 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1056 @param NotifyDescriptor The descriptor for the notification event.
1057 @param Ppi Pointer to the PPI in question.
1059 @return Always success
1064 SecurityPpiNotifyCallback (
1065 IN EFI_PEI_SERVICES
**PeiServices
,
1066 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1071 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.
1073 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.
1074 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.
1076 @retval EFI_NOT_FOUND FV image can't be found.
1077 @retval EFI_SUCCESS Successfully to process it.
1078 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
1079 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
1084 IN PEI_CORE_FV_HANDLE
*ParentFvCoreHandle
,
1085 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
1089 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
1091 This routine also will install FvInfo ppi for FV hob in PI ways.
1093 @param Private Pointer of PEI_CORE_INSTANCE
1094 @param Instance The index of FV want to be searched.
1096 @return Instance of PEI_CORE_FV_HANDLE.
1098 PEI_CORE_FV_HANDLE
*
1099 FindNextCoreFvHandle (
1100 IN PEI_CORE_INSTANCE
*Private
,
1105 // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1109 Memory-based read services.
1111 This function is to perform the Memory Access Read service based on installed
1112 instance of the EFI_PEI_CPU_IO_PPI.
1113 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1114 return EFI_NOT_YET_AVAILABLE.
1116 @param PeiServices An indirect pointer to the PEI Services Table
1117 published by the PEI Foundation.
1118 @param This Pointer to local data for the interface.
1119 @param Width The width of the access. Enumerated in bytes.
1120 @param Address The physical address of the access.
1121 @param Count The number of accesses to perform.
1122 @param Buffer A pointer to the buffer of data.
1124 @retval EFI_SUCCESS The function completed successfully.
1125 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1130 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1131 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1132 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1139 Memory-based write services.
1141 This function is to perform the Memory Access Write service based on installed
1142 instance of the EFI_PEI_CPU_IO_PPI.
1143 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1144 return EFI_NOT_YET_AVAILABLE.
1146 @param PeiServices An indirect pointer to the PEI Services Table
1147 published by the PEI Foundation.
1148 @param This Pointer to local data for the interface.
1149 @param Width The width of the access. Enumerated in bytes.
1150 @param Address The physical address of the access.
1151 @param Count The number of accesses to perform.
1152 @param Buffer A pointer to the buffer of data.
1154 @retval EFI_SUCCESS The function completed successfully.
1155 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1159 PeiDefaultMemWrite (
1160 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1161 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1162 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1169 IO-based read services.
1171 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
1172 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1173 return EFI_NOT_YET_AVAILABLE.
1175 @param PeiServices An indirect pointer to the PEI Services Table
1176 published by the PEI Foundation.
1177 @param This Pointer to local data for the interface.
1178 @param Width The width of the access. Enumerated in bytes.
1179 @param Address The physical address of the access.
1180 @param Count The number of accesses to perform.
1181 @param Buffer A pointer to the buffer of data.
1183 @retval EFI_SUCCESS The function completed successfully.
1184 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1189 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1190 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1191 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1198 IO-based write services.
1200 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
1201 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1202 return EFI_NOT_YET_AVAILABLE.
1204 @param PeiServices An indirect pointer to the PEI Services Table
1205 published by the PEI Foundation.
1206 @param This Pointer to local data for the interface.
1207 @param Width The width of the access. Enumerated in bytes.
1208 @param Address The physical address of the access.
1209 @param Count The number of accesses to perform.
1210 @param Buffer A pointer to the buffer of data.
1212 @retval EFI_SUCCESS The function completed successfully.
1213 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1218 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1219 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1220 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1227 8-bit I/O read operations.
1229 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1232 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1233 @param This Pointer to local data for the interface.
1234 @param Address The physical address of the access.
1236 @return An 8-bit value returned from the I/O space.
1241 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1242 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1247 Reads an 16-bit I/O port.
1249 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1252 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1253 @param This Pointer to local data for the interface.
1254 @param Address The physical address of the access.
1256 @return A 16-bit value returned from the I/O space.
1260 PeiDefaultIoRead16 (
1261 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1262 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1267 Reads an 32-bit I/O port.
1269 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1272 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1273 @param This Pointer to local data for the interface.
1274 @param Address The physical address of the access.
1276 @return A 32-bit value returned from the I/O space.
1280 PeiDefaultIoRead32 (
1281 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1282 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1287 Reads an 64-bit I/O port.
1289 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1292 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1293 @param This Pointer to local data for the interface.
1294 @param Address The physical address of the access.
1296 @return A 64-bit value returned from the I/O space.
1300 PeiDefaultIoRead64 (
1301 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1302 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1307 8-bit I/O write operations.
1309 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1310 @param This Pointer to local data for the interface.
1311 @param Address The physical address of the access.
1312 @param Data The data to write.
1316 PeiDefaultIoWrite8 (
1317 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1318 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1324 16-bit I/O write operations.
1326 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1327 @param This Pointer to local data for the interface.
1328 @param Address The physical address of the access.
1329 @param Data The data to write.
1333 PeiDefaultIoWrite16 (
1334 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1335 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1341 32-bit I/O write operations.
1343 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1344 @param This Pointer to local data for the interface.
1345 @param Address The physical address of the access.
1346 @param Data The data to write.
1350 PeiDefaultIoWrite32 (
1351 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1352 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1358 64-bit I/O write operations.
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.
1363 @param Data The data to write.
1367 PeiDefaultIoWrite64 (
1368 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1369 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1375 8-bit memory read operations.
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 An 8-bit value returned from the memory space.
1389 PeiDefaultMemRead8 (
1390 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1391 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1396 16-bit memory read operations.
1398 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1401 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1402 @param This Pointer to local data for the interface.
1403 @param Address The physical address of the access.
1405 @return An 16-bit value returned from the memory space.
1410 PeiDefaultMemRead16 (
1411 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1412 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1417 32-bit memory read operations.
1419 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1422 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1423 @param This Pointer to local data for the interface.
1424 @param Address The physical address of the access.
1426 @return An 32-bit value returned from the memory space.
1431 PeiDefaultMemRead32 (
1432 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1433 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1438 64-bit memory read operations.
1440 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1443 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1444 @param This Pointer to local data for the interface.
1445 @param Address The physical address of the access.
1447 @return An 64-bit value returned from the memory space.
1452 PeiDefaultMemRead64 (
1453 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1454 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1459 8-bit memory write operations.
1461 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1462 @param This Pointer to local data for the interface.
1463 @param Address The physical address of the access.
1464 @param Data The data to write.
1469 PeiDefaultMemWrite8 (
1470 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1471 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1477 16-bit memory write operations.
1479 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1480 @param This Pointer to local data for the interface.
1481 @param Address The physical address of the access.
1482 @param Data The data to write.
1487 PeiDefaultMemWrite16 (
1488 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1489 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1495 32-bit memory write operations.
1497 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1498 @param This Pointer to local data for the interface.
1499 @param Address The physical address of the access.
1500 @param Data The data to write.
1505 PeiDefaultMemWrite32 (
1506 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1507 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1513 64-bit memory write operations.
1515 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1516 @param This Pointer to local data for the interface.
1517 @param Address The physical address of the access.
1518 @param Data The data to write.
1523 PeiDefaultMemWrite64 (
1524 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1525 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1530 extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
;
1533 // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1537 Reads from a given location in the PCI configuration space.
1539 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1540 return EFI_NOT_YET_AVAILABLE.
1542 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1543 @param This Pointer to local data for the interface.
1544 @param Width The width of the access. Enumerated in bytes.
1545 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1546 @param Address The physical address of the access. The format of
1547 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1548 @param Buffer A pointer to the buffer of data.
1550 @retval EFI_SUCCESS The function completed successfully.
1551 @retval EFI_INVALID_PARAMETER The invalid access width.
1552 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1557 PeiDefaultPciCfg2Read (
1558 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1559 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1560 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1566 Write to a given location in the PCI configuration space.
1568 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1569 return EFI_NOT_YET_AVAILABLE.
1571 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1572 @param This Pointer to local data for the interface.
1573 @param Width The width of the access. Enumerated in bytes.
1574 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1575 @param Address The physical address of the access. The format of
1576 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1577 @param Buffer A pointer to the buffer of data.
1579 @retval EFI_SUCCESS The function completed successfully.
1580 @retval EFI_INVALID_PARAMETER The invalid access width.
1581 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1585 PeiDefaultPciCfg2Write (
1586 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1587 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1588 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1594 This function performs a read-modify-write operation on the contents from a given
1595 location in the PCI configuration space.
1597 @param PeiServices An indirect pointer to the PEI Services Table
1598 published by the PEI Foundation.
1599 @param This Pointer to local data for the interface.
1600 @param Width The width of the access. Enumerated in bytes. Type
1601 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
1602 @param Address The physical address of the access.
1603 @param SetBits Points to value to bitwise-OR with the read configuration value.
1604 The size of the value is determined by Width.
1605 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
1606 The size of the value is determined by Width.
1608 @retval EFI_SUCCESS The function completed successfully.
1609 @retval EFI_INVALID_PARAMETER The invalid access width.
1610 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1614 PeiDefaultPciCfg2Modify (
1615 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1616 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1617 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1623 extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
;
1626 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
1627 be re-installed with the instance in permanent memory and all cached FvPpi pointers in
1628 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant
1631 @param PrivateData Pointer to PEI_CORE_INSTANCE.
1635 IN PEI_CORE_INSTANCE
*PrivateData