2 Definition of Pei Core Structures and Services
4 Copyright (c) 2006 - 2011, 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/PcdLib.h>
42 #include <IndustryStandard/PeImage.h>
43 #include <Library/PeiServicesTablePointerLib.h>
44 #include <Library/MemoryAllocationLib.h>
45 #include <Guid/FirmwareFileSystem2.h>
46 #include <Guid/AprioriFileName.h>
49 /// It is an FFS type extension used for PeiFindFileEx. It indicates current
50 /// Ffs searching is for all PEIMs can be dispatched by PeiCore.
52 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
55 /// Pei Core private data structures
58 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
59 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
61 } PEI_PPI_LIST_POINTERS
;
64 /// PPI database structure which contains two link: PpiList and NotifyList. PpiList
65 /// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.
69 /// index of end of PpiList link list.
73 /// index of end of notify link list.
77 /// index of the dispatched notify list.
81 /// index of last installed Ppi description in PpiList link list.
83 INTN LastDispatchedInstall
;
85 /// index of last dispatched notify in Notify link list.
87 INTN LastDispatchedNotify
;
91 PEI_PPI_LIST_POINTERS PpiListPtrs
[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported
)];
96 // PEI_CORE_FV_HANDE.PeimState
97 // Do not change these values as there is code doing math to change states.
98 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
100 #define PEIM_STATE_NOT_DISPATCHED 0x00
101 #define PEIM_STATE_DISPATCHED 0x01
102 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
103 #define PEIM_STATE_DONE 0x03
106 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
107 EFI_PEI_FIRMWARE_VOLUME_PPI
*FvPpi
;
108 EFI_PEI_FV_HANDLE FvHandle
;
109 UINT8 PeimState
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
110 EFI_PEI_FILE_HANDLE FvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
112 } PEI_CORE_FV_HANDLE
;
118 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor
;
119 } PEI_CORE_UNKNOW_FORMAT_FV_INFO
;
121 #define CACHE_SETION_MAX_NUMBER 0x10
123 EFI_COMMON_SECTION_HEADER
* Section
[CACHE_SETION_MAX_NUMBER
];
124 VOID
* SectionData
[CACHE_SETION_MAX_NUMBER
];
125 UINTN SectionSize
[CACHE_SETION_MAX_NUMBER
];
126 UINTN AllSectionCount
;
128 } CACHE_SECTION_DATA
;
131 /// Forward declaration for PEI_CORE_INSTANCE
133 typedef struct _PEI_CORE_INSTANCE PEI_CORE_INSTANCE
;
137 Function Pointer type for PeiCore function.
138 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
139 and location of temporary RAM, the stack location and the BFV location.
140 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
141 An empty PPI list consists of a single descriptor with the end-tag
142 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
143 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
144 that both the PEI Foundation and any modules can leverage the associated service
145 calls and/or code in these early PPIs
146 @param OldCoreData Pointer to old core data that is used to initialize the
151 (EFIAPI
*PEICORE_FUNCTION_POINTER
)(
152 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
153 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
154 IN PEI_CORE_INSTANCE
*OldCoreData
157 #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
160 /// Pei Core private data structure instance
162 struct _PEI_CORE_INSTANCE
{
166 /// Point to ServiceTableShadow
168 EFI_PEI_SERVICES
*Ps
;
169 PEI_PPI_DATABASE PpiData
;
172 /// The count of FVs which contains FFS and could be dispatched by PeiCore.
177 /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore.
179 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
180 PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
181 UINTN UnknownFvInfoCount
;
183 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
185 UINTN CurrentPeimFvCount
;
186 UINTN CurrentPeimCount
;
187 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
188 BOOLEAN PeimNeedingDispatch
;
189 BOOLEAN PeimDispatchOnThisPass
;
190 BOOLEAN PeimDispatcherReenter
;
191 EFI_PEI_HOB_POINTERS HobList
;
192 BOOLEAN SwitchStackSignal
;
193 BOOLEAN PeiMemoryInstalled
;
195 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
196 EFI_PEI_SERVICES ServiceTableShadow
;
197 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
198 EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin
;
199 UINT64 PhysicalMemoryLength
;
200 EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop
;
202 BOOLEAN HeapOffsetPositive
;
203 PEICORE_FUNCTION_POINTER ShadowedPeiCore
;
204 CACHE_SECTION_DATA CacheSection
;
206 // For Loading modules at fixed address feature to cache the top address below which the
207 // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
208 // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
210 EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress
;
212 // The field is define for Loading modules at fixed address feature to tracker the PEI code
213 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
216 UINT64
*PeiCodeMemoryRangeUsageBitMap
;
218 // This field points to the shadowed image read function
220 PE_COFF_LOADER_READ_FILE ShadowedImageRead
;
224 /// Pei Core Instance Data Macros
226 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
227 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
230 /// Union of temporarily used function pointers (to save stack space)
233 PEICORE_FUNCTION_POINTER PeiCore
;
234 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
235 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
236 EFI_DXE_IPL_PPI
*DxeIpl
;
237 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
238 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
240 } PEI_CORE_TEMP_POINTERS
;
243 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
244 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
246 } PEI_CORE_PARAMETERS
;
253 The entry routine to Pei Core, invoked by PeiMain during transition
254 from SEC to PEI. After switching stack in the PEI core, it will restart
255 with the old core data.
258 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
259 and location of temporary RAM, the stack location and the BFV location.
260 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
261 An empty PPI list consists of a single descriptor with the end-tag
262 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
263 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
264 that both the PEI Foundation and any modules can leverage the associated service
265 calls and/or code in these early PPIs
266 @param Data Pointer to old core data that is used to initialize the
273 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
274 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
279 // Dispatcher support functions
284 This is the POSTFIX version of the dependency evaluator. When a
285 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
286 the evaluation stack. When that entry is poped from the evaluation
287 stack, the PPI is checked if it is installed. This method allows
288 some time savings as not all PPIs must be checked for certain
289 operation types (AND, OR).
292 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
293 @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to
294 the BNF described above and is stored in postfix notation.
296 @retval TRUE if it is a well-formed Grammar
297 @retval FALSE if the dependency expression overflows the evaluation stack
298 if the dependency expression underflows the evaluation stack
299 if the dependency expression is not a well-formed Grammar.
303 PeimDispatchReadiness (
304 IN EFI_PEI_SERVICES
**PeiServices
,
305 IN VOID
*DependencyExpression
309 Conduct PEIM dispatch.
311 @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data
312 @param PrivateData Pointer to the private data passed in from caller
317 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
318 IN PEI_CORE_INSTANCE
*PrivateData
322 Initialize the Dispatcher's data members
324 @param PrivateData PeiCore's private data structure
325 @param OldCoreData Old data from SecCore
326 NULL if being run in non-permament memory mode.
327 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
328 and location of temporary RAM, the stack location and the BFV location.
332 InitializeDispatcherData (
333 IN PEI_CORE_INSTANCE
*PrivateData
,
334 IN PEI_CORE_INSTANCE
*OldCoreData
,
335 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
339 This routine parses the Dependency Expression, if available, and
340 decides if the module can be executed.
343 @param Private PeiCore's private data structure
344 @param FileHandle PEIM's file handle
345 @param PeimCount The index of last dispatched PEIM.
347 @retval TRUE Can be dispatched
348 @retval FALSE Cannot be dispatched
353 IN PEI_CORE_INSTANCE
*Private
,
354 IN EFI_PEI_FILE_HANDLE FileHandle
,
359 // PPI support functions
363 Initialize PPI services.
365 @param PrivateData Pointer to the PEI Core data.
366 @param OldCoreData Pointer to old PEI Core data.
367 NULL if being run in non-permament memory mode.
371 InitializePpiServices (
372 IN PEI_CORE_INSTANCE
*PrivateData
,
373 IN PEI_CORE_INSTANCE
*OldCoreData
378 Migrate the Hob list from the temporary memory stack to PEI installed memory.
380 @param PrivateData Pointer to PeiCore's private data structure.
381 @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range
382 will be fixup for PpiData and PpiDescriptor pointer.
383 @param OldCheckingTop Top of temporary memory range. All Ppi in this range
384 will be fixup for PpiData and PpiDescriptor.
385 @param Fixup The address difference between
386 the new Hob list and old Hob list.
387 @param FixupPositive TRUE if new Hob list is above the old Hob list.
393 IN PEI_CORE_INSTANCE
*PrivateData
,
394 IN UINTN OldCheckingBottom
,
395 IN UINTN OldCheckingTop
,
397 IN BOOLEAN FixupPositive
402 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.
404 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
405 @param PpiList Pointer to ppi array that want to be installed.
407 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
408 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
409 if any PPI in PpiList is not valid
410 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
416 IN CONST EFI_PEI_SERVICES
**PeiServices
,
417 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
422 Re-Install PPI services.
424 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
425 @param OldPpi Pointer to the old PEI PPI Descriptors.
426 @param NewPpi Pointer to the new PEI PPI Descriptors.
428 @retval EFI_SUCCESS if the operation was successful
429 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
430 if NewPpi is not valid
431 @retval EFI_NOT_FOUND if the PPI was not in the database
437 IN CONST EFI_PEI_SERVICES
**PeiServices
,
438 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
439 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
444 Locate a given named PPI.
447 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
448 @param Guid Pointer to GUID of the PPI.
449 @param Instance Instance Number to discover.
450 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
451 returns a pointer to the descriptor (includes flags, etc)
452 @param Ppi Pointer to reference the found PPI
454 @retval EFI_SUCCESS if the PPI is in the database
455 @retval EFI_NOT_FOUND if the PPI is not in the database
461 IN CONST EFI_PEI_SERVICES
**PeiServices
,
462 IN CONST EFI_GUID
*Guid
,
464 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
470 Install a notification for a given PPI.
473 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
474 @param NotifyList Pointer to list of Descriptors to notify upon.
476 @retval EFI_SUCCESS if successful
477 @retval EFI_OUT_OF_RESOURCES if no space in the database
478 @retval EFI_INVALID_PARAMETER if not a good decriptor
484 IN CONST EFI_PEI_SERVICES
**PeiServices
,
485 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
490 Process the Notify List at dispatch level.
492 @param PrivateData PeiCore's private data structure.
497 IN PEI_CORE_INSTANCE
*PrivateData
502 Dispatch notifications.
504 @param PrivateData PeiCore's private data structure
505 @param NotifyType Type of notify to fire.
506 @param InstallStartIndex Install Beginning index.
507 @param InstallStopIndex Install Ending index.
508 @param NotifyStartIndex Notify Beginning index.
509 @param NotifyStopIndex Notify Ending index.
514 IN PEI_CORE_INSTANCE
*PrivateData
,
516 IN INTN InstallStartIndex
,
517 IN INTN InstallStopIndex
,
518 IN INTN NotifyStartIndex
,
519 IN INTN NotifyStopIndex
523 // Boot mode support functions
526 This service enables PEIMs to ascertain the present value of the boot mode.
528 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
529 @param BootMode A pointer to contain the value of the boot mode.
531 @retval EFI_SUCCESS The boot mode was returned successfully.
532 @retval EFI_INVALID_PARAMETER BootMode is NULL.
538 IN CONST EFI_PEI_SERVICES
**PeiServices
,
539 IN OUT EFI_BOOT_MODE
*BootMode
543 This service enables PEIMs to update the boot mode variable.
546 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
547 @param BootMode The value of the boot mode to set.
549 @return EFI_SUCCESS The value was successfully updated
555 IN CONST EFI_PEI_SERVICES
**PeiServices
,
556 IN EFI_BOOT_MODE BootMode
560 // Security support functions
564 Initialize the security services.
566 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
567 @param OldCoreData Pointer to the old core data.
568 NULL if being run in non-permament memory mode.
572 InitializeSecurityServices (
573 IN EFI_PEI_SERVICES
**PeiServices
,
574 IN PEI_CORE_INSTANCE
*OldCoreData
578 Verify a Firmware volume.
580 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
582 @retval EFI_SUCCESS Firmware Volume is legal
583 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test
588 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
593 Provide a callout to the security verification service.
596 @param PrivateData PeiCore's private data structure
597 @param VolumeHandle Handle of FV
598 @param FileHandle Handle of PEIM's ffs
600 @retval EFI_SUCCESS Image is OK
601 @retval EFI_SECURITY_VIOLATION Image is illegal
606 IN PEI_CORE_INSTANCE
*PrivateData
,
607 IN EFI_PEI_FV_HANDLE VolumeHandle
,
608 IN EFI_PEI_FILE_HANDLE FileHandle
613 Gets the pointer to the HOB List.
616 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
617 @param HobList Pointer to the HOB List.
619 @retval EFI_SUCCESS Get the pointer of HOB List
620 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published
621 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)
627 IN CONST EFI_PEI_SERVICES
**PeiServices
,
628 IN OUT VOID
**HobList
632 Add a new HOB to the HOB List.
634 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
635 @param Type Type of the new HOB.
636 @param Length Length of the new HOB to allocate.
637 @param Hob Pointer to the new HOB.
639 @return EFI_SUCCESS Success to create hob.
640 @retval EFI_INVALID_PARAMETER if Hob is NULL
641 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.
642 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
648 IN CONST EFI_PEI_SERVICES
**PeiServices
,
656 Builds a Handoff Information Table HOB
658 @param BootMode - Current Bootmode
659 @param MemoryBegin - Start Memory Address.
660 @param MemoryLength - Length of Memory.
662 @return EFI_SUCCESS Always success to initialize HOB.
666 PeiCoreBuildHobHandoffInfoTable (
667 IN EFI_BOOT_MODE BootMode
,
668 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
669 IN UINT64 MemoryLength
674 // FFS Fw Volume support functions
677 Searches for the next matching file in the firmware volume.
679 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
680 @param SearchType Filter to find only files of this type.
681 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
682 @param FvHandle Handle of firmware volume in which to search.
683 @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start
684 at the beginning of the firmware volume. On exit, points the file handle of the next file
685 in the volume or NULL if there are no more files.
687 @retval EFI_NOT_FOUND The file was not found.
688 @retval EFI_NOT_FOUND The header checksum was not zero.
689 @retval EFI_SUCCESS The file was found.
695 IN CONST EFI_PEI_SERVICES
**PeiServices
,
697 IN EFI_PEI_FV_HANDLE FvHandle
,
698 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
702 Searches for the next matching section within the specified file.
704 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
705 @param SectionType Filter to find only sections of this type.
706 @param FileHandle Pointer to the current file to search.
707 @param SectionData A pointer to the discovered section, if successful.
708 NULL if section not found
710 @retval EFI_NOT_FOUND The section was not found.
711 @retval EFI_SUCCESS The section was found.
716 PeiFfsFindSectionData (
717 IN CONST EFI_PEI_SERVICES
**PeiServices
,
718 IN EFI_SECTION_TYPE SectionType
,
719 IN EFI_PEI_FILE_HANDLE FileHandle
,
720 OUT VOID
**SectionData
724 Search the firmware volumes by index
726 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
727 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware
729 @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.
731 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL
732 @retval EFI_NOT_FOUND The volume was not found.
733 @retval EFI_SUCCESS The volume was found.
738 PeiFfsFindNextVolume (
739 IN CONST EFI_PEI_SERVICES
**PeiServices
,
741 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
745 // Memory support functions
749 Initialize the memory services.
751 @param PrivateData PeiCore's private data structure
752 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
753 and location of temporary RAM, the stack location and the BFV location.
754 @param OldCoreData Pointer to the PEI Core data.
755 NULL if being run in non-permament memory mode.
759 InitializeMemoryServices (
760 IN PEI_CORE_INSTANCE
*PrivateData
,
761 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
762 IN PEI_CORE_INSTANCE
*OldCoreData
767 Install the permanent memory is now available.
768 Creates HOB (PHIT and Stack).
770 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
771 @param MemoryBegin Start of memory address.
772 @param MemoryLength Length of memory.
774 @return EFI_SUCCESS Always success.
779 PeiInstallPeiMemory (
780 IN CONST EFI_PEI_SERVICES
**PeiServices
,
781 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
782 IN UINT64 MemoryLength
787 Memory allocation service on permanent memory,
788 not usable prior to the memory installation.
791 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
792 @param MemoryType Type of memory to allocate.
793 @param Pages Number of pages to allocate.
794 @param Memory Pointer of memory allocated.
796 @retval EFI_SUCCESS The allocation was successful
797 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
798 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available
799 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
800 to allocate the number of pages.
806 IN CONST EFI_PEI_SERVICES
**PeiServices
,
807 IN EFI_MEMORY_TYPE MemoryType
,
809 OUT EFI_PHYSICAL_ADDRESS
*Memory
814 Memory allocation service on the temporary memory.
817 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
818 @param Size Amount of memory required
819 @param Buffer Address of pointer to the buffer
821 @retval EFI_SUCCESS The allocation was successful
822 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
823 to allocate the requested size.
829 IN CONST EFI_PEI_SERVICES
**PeiServices
,
836 Routine for load image file.
839 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
840 @param FileHandle Pointer to the FFS file header of the image.
841 @param PeimState The dispatch state of the input PEIM handle.
842 @param EntryPoint Pointer to entry point of specified image file for output.
843 @param AuthenticationState Pointer to attestation authentication state of image.
845 @retval EFI_SUCCESS Image is successfully loaded.
846 @retval EFI_NOT_FOUND Fail to locate necessary PPI
847 @retval Others Fail to load file.
852 IN CONST EFI_PEI_SERVICES
**PeiServices
,
853 IN EFI_PEI_FILE_HANDLE FileHandle
,
855 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
856 OUT UINT32
*AuthenticationState
861 Core version of the Status Code reporter
864 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
865 @param CodeType Type of Status Code.
866 @param Value Value to output for Status Code.
867 @param Instance Instance Number of this status code.
868 @param CallerId ID of the caller of this status code.
869 @param Data Optional data associated with this status code.
871 @retval EFI_SUCCESS if status code is successfully reported
872 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
877 PeiReportStatusCode (
878 IN CONST EFI_PEI_SERVICES
**PeiServices
,
879 IN EFI_STATUS_CODE_TYPE CodeType
,
880 IN EFI_STATUS_CODE_VALUE Value
,
882 IN CONST EFI_GUID
*CallerId
,
883 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
888 Core version of the Reset System
891 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
893 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
894 @retval EFI_DEVICE_ERROR Did not reset system.
895 Otherwise, resets the system.
901 IN CONST EFI_PEI_SERVICES
**PeiServices
906 Initialize PeiCore Fv List.
909 @param PrivateData - Pointer to PEI_CORE_INSTANCE.
910 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
915 IN PEI_CORE_INSTANCE
*PrivateData
,
916 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
920 Process Firmware Volum Information once FvInfoPPI install.
922 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
923 @param NotifyDescriptor Address of the notification descriptor data structure.
924 @param Ppi Address of the PPI that was installed.
926 @retval EFI_SUCCESS if the interface could be successfully installed
931 FirmwareVolmeInfoPpiNotifyCallback (
932 IN EFI_PEI_SERVICES
**PeiServices
,
933 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
939 Given the input VolumeHandle, search for the next matching name file.
941 @param FileName File name to search.
942 @param VolumeHandle The current FV to search.
943 @param FileHandle Pointer to the file matching name in VolumeHandle.
944 NULL if file not found
946 @retval EFI_NOT_FOUND No files matching the search criteria were found
947 @retval EFI_SUCCESS Success to search given file
952 PeiFfsFindFileByName (
953 IN CONST EFI_GUID
*FileName
,
954 IN EFI_PEI_FV_HANDLE VolumeHandle
,
955 OUT EFI_PEI_FILE_HANDLE
*FileHandle
959 Returns information about a specific file.
961 @param FileHandle Handle of the file.
962 @param FileInfo Upon exit, points to the file's information.
964 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
965 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
966 @retval EFI_SUCCESS File information returned.
972 IN EFI_PEI_FILE_HANDLE FileHandle
,
973 OUT EFI_FV_FILE_INFO
*FileInfo
977 Returns information about the specified volume.
979 @param VolumeHandle Handle of the volume.
980 @param VolumeInfo Upon exit, points to the volume's information.
982 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
983 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.
984 @retval EFI_SUCCESS Volume information returned.
988 PeiFfsGetVolumeInfo (
989 IN EFI_PEI_FV_HANDLE VolumeHandle
,
990 OUT EFI_FV_INFO
*VolumeInfo
994 This routine enable a PEIM to register itself to shadow when PEI Foundation
995 discovery permanent memory.
997 @param FileHandle File handle of a PEIM.
999 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1000 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1001 @retval EFI_SUCCESS Successfully to register itself.
1006 PeiRegisterForShadow (
1007 IN EFI_PEI_FILE_HANDLE FileHandle
1011 Initialize image service that install PeiLoadFilePpi.
1013 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.
1014 @param OldCoreData Pointer to Old PeiCore's private data.
1015 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.
1016 If not NULL, PeiCore is entered at second time, stack/heap has been moved
1017 to permenent memory.
1021 InitializeImageServices (
1022 IN PEI_CORE_INSTANCE
*PrivateData
,
1023 IN PEI_CORE_INSTANCE
*OldCoreData
1027 The wrapper function of PeiLoadImageLoadImage().
1029 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.
1030 @param FileHandle Pointer to the FFS file header of the image.
1031 @param ImageAddressArg Pointer to PE/TE image.
1032 @param ImageSizeArg Size of PE/TE image.
1033 @param EntryPoint Pointer to entry point of specified image file for output.
1034 @param AuthenticationState Pointer to attestation authentication state of image.
1036 @return Status of PeiLoadImageLoadImage().
1041 PeiLoadImageLoadImageWrapper (
1042 IN CONST EFI_PEI_LOAD_FILE_PPI
*This
,
1043 IN EFI_PEI_FILE_HANDLE FileHandle
,
1044 OUT EFI_PHYSICAL_ADDRESS
*ImageAddressArg
, OPTIONAL
1045 OUT UINT64
*ImageSizeArg
, OPTIONAL
1046 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1047 OUT UINT32
*AuthenticationState
1052 Provide a callback for when the security PPI is installed.
1054 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1055 @param NotifyDescriptor The descriptor for the notification event.
1056 @param Ppi Pointer to the PPI in question.
1058 @return Always success
1063 SecurityPpiNotifyCallback (
1064 IN EFI_PEI_SERVICES
**PeiServices
,
1065 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1070 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.
1072 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.
1073 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.
1075 @retval EFI_NOT_FOUND FV image can't be found.
1076 @retval EFI_SUCCESS Successfully to process it.
1077 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
1078 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
1083 IN PEI_CORE_FV_HANDLE
*ParentFvCoreHandle
,
1084 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
1088 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
1090 This routine also will install FvInfo ppi for FV hob in PI ways.
1092 @param Private Pointer of PEI_CORE_INSTANCE
1093 @param Instance The index of FV want to be searched.
1095 @return Instance of PEI_CORE_FV_HANDLE.
1097 PEI_CORE_FV_HANDLE
*
1098 FindNextCoreFvHandle (
1099 IN PEI_CORE_INSTANCE
*Private
,
1104 // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1108 Memory-based read services.
1110 This function is to perform the Memory Access Read service based on installed
1111 instance of the EFI_PEI_CPU_IO_PPI.
1112 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1113 return EFI_NOT_YET_AVAILABLE.
1115 @param PeiServices An indirect pointer to the PEI Services Table
1116 published by the PEI Foundation.
1117 @param This Pointer to local data for the interface.
1118 @param Width The width of the access. Enumerated in bytes.
1119 @param Address The physical address of the access.
1120 @param Count The number of accesses to perform.
1121 @param Buffer A pointer to the buffer of data.
1123 @retval EFI_SUCCESS The function completed successfully.
1124 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1129 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1130 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1131 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1138 Memory-based write services.
1140 This function is to perform the Memory Access Write service based on installed
1141 instance of the EFI_PEI_CPU_IO_PPI.
1142 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1143 return EFI_NOT_YET_AVAILABLE.
1145 @param PeiServices An indirect pointer to the PEI Services Table
1146 published by the PEI Foundation.
1147 @param This Pointer to local data for the interface.
1148 @param Width The width of the access. Enumerated in bytes.
1149 @param Address The physical address of the access.
1150 @param Count The number of accesses to perform.
1151 @param Buffer A pointer to the buffer of data.
1153 @retval EFI_SUCCESS The function completed successfully.
1154 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1158 PeiDefaultMemWrite (
1159 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1160 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1161 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1168 IO-based read services.
1170 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
1171 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1172 return EFI_NOT_YET_AVAILABLE.
1174 @param PeiServices An indirect pointer to the PEI Services Table
1175 published by the PEI Foundation.
1176 @param This Pointer to local data for the interface.
1177 @param Width The width of the access. Enumerated in bytes.
1178 @param Address The physical address of the access.
1179 @param Count The number of accesses to perform.
1180 @param Buffer A pointer to the buffer of data.
1182 @retval EFI_SUCCESS The function completed successfully.
1183 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1188 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1189 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1190 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1197 IO-based write services.
1199 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
1200 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1201 return EFI_NOT_YET_AVAILABLE.
1203 @param PeiServices An indirect pointer to the PEI Services Table
1204 published by the PEI Foundation.
1205 @param This Pointer to local data for the interface.
1206 @param Width The width of the access. Enumerated in bytes.
1207 @param Address The physical address of the access.
1208 @param Count The number of accesses to perform.
1209 @param Buffer A pointer to the buffer of data.
1211 @retval EFI_SUCCESS The function completed successfully.
1212 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1217 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1218 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1219 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1226 8-bit I/O read operations.
1228 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1231 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1232 @param This Pointer to local data for the interface.
1233 @param Address The physical address of the access.
1235 @return An 8-bit value returned from the I/O space.
1240 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1241 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1246 Reads an 16-bit I/O port.
1248 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1251 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1252 @param This Pointer to local data for the interface.
1253 @param Address The physical address of the access.
1255 @return A 16-bit value returned from the I/O space.
1259 PeiDefaultIoRead16 (
1260 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1261 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1266 Reads an 32-bit I/O port.
1268 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1271 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1272 @param This Pointer to local data for the interface.
1273 @param Address The physical address of the access.
1275 @return A 32-bit value returned from the I/O space.
1279 PeiDefaultIoRead32 (
1280 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1281 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1286 Reads an 64-bit I/O port.
1288 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1291 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1292 @param This Pointer to local data for the interface.
1293 @param Address The physical address of the access.
1295 @return A 64-bit value returned from the I/O space.
1299 PeiDefaultIoRead64 (
1300 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1301 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1306 8-bit I/O write operations.
1308 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1309 @param This Pointer to local data for the interface.
1310 @param Address The physical address of the access.
1311 @param Data The data to write.
1315 PeiDefaultIoWrite8 (
1316 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1317 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1323 16-bit I/O write operations.
1325 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1326 @param This Pointer to local data for the interface.
1327 @param Address The physical address of the access.
1328 @param Data The data to write.
1332 PeiDefaultIoWrite16 (
1333 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1334 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1340 32-bit I/O write operations.
1342 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1343 @param This Pointer to local data for the interface.
1344 @param Address The physical address of the access.
1345 @param Data The data to write.
1349 PeiDefaultIoWrite32 (
1350 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1351 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1357 64-bit I/O write operations.
1359 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1360 @param This Pointer to local data for the interface.
1361 @param Address The physical address of the access.
1362 @param Data The data to write.
1366 PeiDefaultIoWrite64 (
1367 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1368 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1374 8-bit memory read operations.
1376 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1379 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1380 @param This Pointer to local data for the interface.
1381 @param Address The physical address of the access.
1383 @return An 8-bit value returned from the memory space.
1388 PeiDefaultMemRead8 (
1389 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1390 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1395 16-bit memory read operations.
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 An 16-bit value returned from the memory space.
1409 PeiDefaultMemRead16 (
1410 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1411 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1416 32-bit memory read operations.
1418 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1421 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1422 @param This Pointer to local data for the interface.
1423 @param Address The physical address of the access.
1425 @return An 32-bit value returned from the memory space.
1430 PeiDefaultMemRead32 (
1431 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1432 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1437 64-bit memory read operations.
1439 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1442 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1443 @param This Pointer to local data for the interface.
1444 @param Address The physical address of the access.
1446 @return An 64-bit value returned from the memory space.
1451 PeiDefaultMemRead64 (
1452 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1453 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1458 8-bit memory write operations.
1460 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1461 @param This Pointer to local data for the interface.
1462 @param Address The physical address of the access.
1463 @param Data The data to write.
1468 PeiDefaultMemWrite8 (
1469 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1470 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1476 16-bit memory write operations.
1478 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1479 @param This Pointer to local data for the interface.
1480 @param Address The physical address of the access.
1481 @param Data The data to write.
1486 PeiDefaultMemWrite16 (
1487 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1488 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1494 32-bit memory write operations.
1496 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1497 @param This Pointer to local data for the interface.
1498 @param Address The physical address of the access.
1499 @param Data The data to write.
1504 PeiDefaultMemWrite32 (
1505 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1506 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1512 64-bit memory write operations.
1514 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1515 @param This Pointer to local data for the interface.
1516 @param Address The physical address of the access.
1517 @param Data The data to write.
1522 PeiDefaultMemWrite64 (
1523 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1524 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1529 extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
;
1532 // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1536 Reads from a given location in the PCI configuration space.
1538 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1539 return EFI_NOT_YET_AVAILABLE.
1541 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1542 @param This Pointer to local data for the interface.
1543 @param Width The width of the access. Enumerated in bytes.
1544 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1545 @param Address The physical address of the access. The format of
1546 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1547 @param Buffer A pointer to the buffer of data.
1549 @retval EFI_SUCCESS The function completed successfully.
1550 @retval EFI_INVALID_PARAMETER The invalid access width.
1551 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1556 PeiDefaultPciCfg2Read (
1557 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1558 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1559 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1565 Write to a given location in the PCI configuration space.
1567 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1568 return EFI_NOT_YET_AVAILABLE.
1570 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1571 @param This Pointer to local data for the interface.
1572 @param Width The width of the access. Enumerated in bytes.
1573 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1574 @param Address The physical address of the access. The format of
1575 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1576 @param Buffer A pointer to the buffer of data.
1578 @retval EFI_SUCCESS The function completed successfully.
1579 @retval EFI_INVALID_PARAMETER The invalid access width.
1580 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1584 PeiDefaultPciCfg2Write (
1585 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1586 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1587 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1593 This function performs a read-modify-write operation on the contents from a given
1594 location in the PCI configuration space.
1596 @param PeiServices An indirect pointer to the PEI Services Table
1597 published by the PEI Foundation.
1598 @param This Pointer to local data for the interface.
1599 @param Width The width of the access. Enumerated in bytes. Type
1600 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
1601 @param Address The physical address of the access.
1602 @param SetBits Points to value to bitwise-OR with the read configuration value.
1603 The size of the value is determined by Width.
1604 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
1605 The size of the value is determined by Width.
1607 @retval EFI_SUCCESS The function completed successfully.
1608 @retval EFI_INVALID_PARAMETER The invalid access width.
1609 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1613 PeiDefaultPciCfg2Modify (
1614 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1615 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1616 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1622 extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
;
1625 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
1626 be re-installed with the instance in permanent memory and all cached FvPpi pointers in
1627 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant
1630 @param PrivateData Pointer to PEI_CORE_INSTANCE.
1634 IN PEI_CORE_INSTANCE
*PrivateData