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/FirmwareFileSystem3.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
;
205 BOOLEAN StackOffsetPositive
;
206 PEICORE_FUNCTION_POINTER ShadowedPeiCore
;
207 CACHE_SECTION_DATA CacheSection
;
209 // For Loading modules at fixed address feature to cache the top address below which the
210 // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
211 // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
213 EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress
;
215 // The field is define for Loading modules at fixed address feature to tracker the PEI code
216 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
219 UINT64
*PeiCodeMemoryRangeUsageBitMap
;
221 // This field points to the shadowed image read function
223 PE_COFF_LOADER_READ_FILE ShadowedImageRead
;
227 /// Pei Core Instance Data Macros
229 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
230 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
233 /// Union of temporarily used function pointers (to save stack space)
236 PEICORE_FUNCTION_POINTER PeiCore
;
237 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
238 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
239 EFI_DXE_IPL_PPI
*DxeIpl
;
240 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
241 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
243 } PEI_CORE_TEMP_POINTERS
;
246 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
247 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
249 } PEI_CORE_PARAMETERS
;
256 The entry routine to Pei Core, invoked by PeiMain during transition
257 from SEC to PEI. After switching stack in the PEI core, it will restart
258 with the old core data.
261 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
262 and location of temporary RAM, the stack location and the BFV location.
263 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
264 An empty PPI list consists of a single descriptor with the end-tag
265 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
266 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
267 that both the PEI Foundation and any modules can leverage the associated service
268 calls and/or code in these early PPIs
269 @param Data Pointer to old core data that is used to initialize the
276 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
277 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
282 // Dispatcher support functions
287 This is the POSTFIX version of the dependency evaluator. When a
288 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
289 the evaluation stack. When that entry is poped from the evaluation
290 stack, the PPI is checked if it is installed. This method allows
291 some time savings as not all PPIs must be checked for certain
292 operation types (AND, OR).
295 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
296 @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to
297 the BNF described above and is stored in postfix notation.
299 @retval TRUE if it is a well-formed Grammar
300 @retval FALSE if the dependency expression overflows the evaluation stack
301 if the dependency expression underflows the evaluation stack
302 if the dependency expression is not a well-formed Grammar.
306 PeimDispatchReadiness (
307 IN EFI_PEI_SERVICES
**PeiServices
,
308 IN VOID
*DependencyExpression
312 Conduct PEIM dispatch.
314 @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data
315 @param PrivateData Pointer to the private data passed in from caller
320 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
321 IN PEI_CORE_INSTANCE
*PrivateData
325 Initialize the Dispatcher's data members
327 @param PrivateData PeiCore's private data structure
328 @param OldCoreData Old data from SecCore
329 NULL if being run in non-permament memory mode.
330 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
331 and location of temporary RAM, the stack location and the BFV location.
335 InitializeDispatcherData (
336 IN PEI_CORE_INSTANCE
*PrivateData
,
337 IN PEI_CORE_INSTANCE
*OldCoreData
,
338 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
342 This routine parses the Dependency Expression, if available, and
343 decides if the module can be executed.
346 @param Private PeiCore's private data structure
347 @param FileHandle PEIM's file handle
348 @param PeimCount The index of last dispatched PEIM.
350 @retval TRUE Can be dispatched
351 @retval FALSE Cannot be dispatched
356 IN PEI_CORE_INSTANCE
*Private
,
357 IN EFI_PEI_FILE_HANDLE FileHandle
,
362 // PPI support functions
366 Initialize PPI services.
368 @param PrivateData Pointer to the PEI Core data.
369 @param OldCoreData Pointer to old PEI Core data.
370 NULL if being run in non-permament memory mode.
374 InitializePpiServices (
375 IN PEI_CORE_INSTANCE
*PrivateData
,
376 IN PEI_CORE_INSTANCE
*OldCoreData
381 Migrate the Hob list from the temporary memory stack to PEI installed memory.
383 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
384 and location of temporary RAM, the stack location and the BFV location.
385 @param PrivateData Pointer to PeiCore's private data structure.
390 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
391 IN PEI_CORE_INSTANCE
*PrivateData
396 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.
398 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
399 @param PpiList Pointer to ppi array that want to be installed.
401 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
402 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
403 if any PPI in PpiList is not valid
404 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
410 IN CONST EFI_PEI_SERVICES
**PeiServices
,
411 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
416 Re-Install PPI services.
418 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
419 @param OldPpi Pointer to the old PEI PPI Descriptors.
420 @param NewPpi Pointer to the new PEI PPI Descriptors.
422 @retval EFI_SUCCESS if the operation was successful
423 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
424 if NewPpi is not valid
425 @retval EFI_NOT_FOUND if the PPI was not in the database
431 IN CONST EFI_PEI_SERVICES
**PeiServices
,
432 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
433 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
438 Locate a given named PPI.
441 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
442 @param Guid Pointer to GUID of the PPI.
443 @param Instance Instance Number to discover.
444 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
445 returns a pointer to the descriptor (includes flags, etc)
446 @param Ppi Pointer to reference the found PPI
448 @retval EFI_SUCCESS if the PPI is in the database
449 @retval EFI_NOT_FOUND if the PPI is not in the database
455 IN CONST EFI_PEI_SERVICES
**PeiServices
,
456 IN CONST EFI_GUID
*Guid
,
458 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
464 Install a notification for a given PPI.
467 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
468 @param NotifyList Pointer to list of Descriptors to notify upon.
470 @retval EFI_SUCCESS if successful
471 @retval EFI_OUT_OF_RESOURCES if no space in the database
472 @retval EFI_INVALID_PARAMETER if not a good decriptor
478 IN CONST EFI_PEI_SERVICES
**PeiServices
,
479 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
484 Process the Notify List at dispatch level.
486 @param PrivateData PeiCore's private data structure.
491 IN PEI_CORE_INSTANCE
*PrivateData
496 Dispatch notifications.
498 @param PrivateData PeiCore's private data structure
499 @param NotifyType Type of notify to fire.
500 @param InstallStartIndex Install Beginning index.
501 @param InstallStopIndex Install Ending index.
502 @param NotifyStartIndex Notify Beginning index.
503 @param NotifyStopIndex Notify Ending index.
508 IN PEI_CORE_INSTANCE
*PrivateData
,
510 IN INTN InstallStartIndex
,
511 IN INTN InstallStopIndex
,
512 IN INTN NotifyStartIndex
,
513 IN INTN NotifyStopIndex
517 // Boot mode support functions
520 This service enables PEIMs to ascertain the present value of the boot mode.
522 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
523 @param BootMode A pointer to contain the value of the boot mode.
525 @retval EFI_SUCCESS The boot mode was returned successfully.
526 @retval EFI_INVALID_PARAMETER BootMode is NULL.
532 IN CONST EFI_PEI_SERVICES
**PeiServices
,
533 IN OUT EFI_BOOT_MODE
*BootMode
537 This service enables PEIMs to update the boot mode variable.
540 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
541 @param BootMode The value of the boot mode to set.
543 @return EFI_SUCCESS The value was successfully updated
549 IN CONST EFI_PEI_SERVICES
**PeiServices
,
550 IN EFI_BOOT_MODE BootMode
554 // Security support functions
558 Initialize the security services.
560 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
561 @param OldCoreData Pointer to the old core data.
562 NULL if being run in non-permament memory mode.
566 InitializeSecurityServices (
567 IN EFI_PEI_SERVICES
**PeiServices
,
568 IN PEI_CORE_INSTANCE
*OldCoreData
572 Verify a Firmware volume.
574 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
576 @retval EFI_SUCCESS Firmware Volume is legal
577 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test
582 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
587 Provide a callout to the security verification service.
590 @param PrivateData PeiCore's private data structure
591 @param VolumeHandle Handle of FV
592 @param FileHandle Handle of PEIM's ffs
594 @retval EFI_SUCCESS Image is OK
595 @retval EFI_SECURITY_VIOLATION Image is illegal
600 IN PEI_CORE_INSTANCE
*PrivateData
,
601 IN EFI_PEI_FV_HANDLE VolumeHandle
,
602 IN EFI_PEI_FILE_HANDLE FileHandle
607 Gets the pointer to the HOB List.
610 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
611 @param HobList Pointer to the HOB List.
613 @retval EFI_SUCCESS Get the pointer of HOB List
614 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published
615 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)
621 IN CONST EFI_PEI_SERVICES
**PeiServices
,
622 IN OUT VOID
**HobList
626 Add a new HOB to the HOB List.
628 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
629 @param Type Type of the new HOB.
630 @param Length Length of the new HOB to allocate.
631 @param Hob Pointer to the new HOB.
633 @return EFI_SUCCESS Success to create hob.
634 @retval EFI_INVALID_PARAMETER if Hob is NULL
635 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.
636 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
642 IN CONST EFI_PEI_SERVICES
**PeiServices
,
650 Builds a Handoff Information Table HOB
652 @param BootMode - Current Bootmode
653 @param MemoryBegin - Start Memory Address.
654 @param MemoryLength - Length of Memory.
656 @return EFI_SUCCESS Always success to initialize HOB.
660 PeiCoreBuildHobHandoffInfoTable (
661 IN EFI_BOOT_MODE BootMode
,
662 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
663 IN UINT64 MemoryLength
668 // FFS Fw Volume support functions
671 Searches for the next matching file in the firmware volume.
673 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
674 @param SearchType Filter to find only files of this type.
675 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
676 @param FvHandle Handle of firmware volume in which to search.
677 @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start
678 at the beginning of the firmware volume. On exit, points the file handle of the next file
679 in the volume or NULL if there are no more files.
681 @retval EFI_NOT_FOUND The file was not found.
682 @retval EFI_NOT_FOUND The header checksum was not zero.
683 @retval EFI_SUCCESS The file was found.
689 IN CONST EFI_PEI_SERVICES
**PeiServices
,
691 IN EFI_PEI_FV_HANDLE FvHandle
,
692 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
696 Searches for the next matching section within the specified file.
698 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
699 @param SectionType Filter to find only sections of this type.
700 @param FileHandle Pointer to the current file to search.
701 @param SectionData A pointer to the discovered section, if successful.
702 NULL if section not found
704 @retval EFI_NOT_FOUND The section was not found.
705 @retval EFI_SUCCESS The section was found.
710 PeiFfsFindSectionData (
711 IN CONST EFI_PEI_SERVICES
**PeiServices
,
712 IN EFI_SECTION_TYPE SectionType
,
713 IN EFI_PEI_FILE_HANDLE FileHandle
,
714 OUT VOID
**SectionData
718 Search the firmware volumes by index
720 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
721 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware
723 @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.
725 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL
726 @retval EFI_NOT_FOUND The volume was not found.
727 @retval EFI_SUCCESS The volume was found.
732 PeiFfsFindNextVolume (
733 IN CONST EFI_PEI_SERVICES
**PeiServices
,
735 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
739 // Memory support functions
743 Initialize the memory services.
745 @param PrivateData PeiCore's private data structure
746 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
747 and location of temporary RAM, the stack location and the BFV location.
748 @param OldCoreData Pointer to the PEI Core data.
749 NULL if being run in non-permament memory mode.
753 InitializeMemoryServices (
754 IN PEI_CORE_INSTANCE
*PrivateData
,
755 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
756 IN PEI_CORE_INSTANCE
*OldCoreData
761 Install the permanent memory is now available.
762 Creates HOB (PHIT and Stack).
764 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
765 @param MemoryBegin Start of memory address.
766 @param MemoryLength Length of memory.
768 @return EFI_SUCCESS Always success.
773 PeiInstallPeiMemory (
774 IN CONST EFI_PEI_SERVICES
**PeiServices
,
775 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
776 IN UINT64 MemoryLength
781 Memory allocation service on permanent memory,
782 not usable prior to the memory installation.
785 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
786 @param MemoryType Type of memory to allocate.
787 @param Pages Number of pages to allocate.
788 @param Memory Pointer of memory allocated.
790 @retval EFI_SUCCESS The allocation was successful
791 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
792 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available
793 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
794 to allocate the number of pages.
800 IN CONST EFI_PEI_SERVICES
**PeiServices
,
801 IN EFI_MEMORY_TYPE MemoryType
,
803 OUT EFI_PHYSICAL_ADDRESS
*Memory
808 Memory allocation service on the temporary memory.
811 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
812 @param Size Amount of memory required
813 @param Buffer Address of pointer to the buffer
815 @retval EFI_SUCCESS The allocation was successful
816 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
817 to allocate the requested size.
823 IN CONST EFI_PEI_SERVICES
**PeiServices
,
830 Routine for load image file.
833 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
834 @param FileHandle Pointer to the FFS file header of the image.
835 @param PeimState The dispatch state of the input PEIM handle.
836 @param EntryPoint Pointer to entry point of specified image file for output.
837 @param AuthenticationState Pointer to attestation authentication state of image.
839 @retval EFI_SUCCESS Image is successfully loaded.
840 @retval EFI_NOT_FOUND Fail to locate necessary PPI
841 @retval Others Fail to load file.
846 IN CONST EFI_PEI_SERVICES
**PeiServices
,
847 IN EFI_PEI_FILE_HANDLE FileHandle
,
849 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
850 OUT UINT32
*AuthenticationState
855 Core version of the Status Code reporter
858 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
859 @param CodeType Type of Status Code.
860 @param Value Value to output for Status Code.
861 @param Instance Instance Number of this status code.
862 @param CallerId ID of the caller of this status code.
863 @param Data Optional data associated with this status code.
865 @retval EFI_SUCCESS if status code is successfully reported
866 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
871 PeiReportStatusCode (
872 IN CONST EFI_PEI_SERVICES
**PeiServices
,
873 IN EFI_STATUS_CODE_TYPE CodeType
,
874 IN EFI_STATUS_CODE_VALUE Value
,
876 IN CONST EFI_GUID
*CallerId
,
877 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
882 Core version of the Reset System
885 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
887 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
888 @retval EFI_DEVICE_ERROR Did not reset system.
889 Otherwise, resets the system.
895 IN CONST EFI_PEI_SERVICES
**PeiServices
900 Initialize PeiCore Fv List.
903 @param PrivateData - Pointer to PEI_CORE_INSTANCE.
904 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
909 IN PEI_CORE_INSTANCE
*PrivateData
,
910 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
914 Process Firmware Volum Information once FvInfoPPI install.
916 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
917 @param NotifyDescriptor Address of the notification descriptor data structure.
918 @param Ppi Address of the PPI that was installed.
920 @retval EFI_SUCCESS if the interface could be successfully installed
925 FirmwareVolmeInfoPpiNotifyCallback (
926 IN EFI_PEI_SERVICES
**PeiServices
,
927 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
933 Given the input VolumeHandle, search for the next matching name file.
935 @param FileName File name to search.
936 @param VolumeHandle The current FV to search.
937 @param FileHandle Pointer to the file matching name in VolumeHandle.
938 NULL if file not found
940 @retval EFI_NOT_FOUND No files matching the search criteria were found
941 @retval EFI_SUCCESS Success to search given file
946 PeiFfsFindFileByName (
947 IN CONST EFI_GUID
*FileName
,
948 IN EFI_PEI_FV_HANDLE VolumeHandle
,
949 OUT EFI_PEI_FILE_HANDLE
*FileHandle
953 Returns information about a specific file.
955 @param FileHandle Handle of the file.
956 @param FileInfo Upon exit, points to the file's information.
958 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
959 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
960 @retval EFI_SUCCESS File information returned.
966 IN EFI_PEI_FILE_HANDLE FileHandle
,
967 OUT EFI_FV_FILE_INFO
*FileInfo
971 Returns information about the specified volume.
973 @param VolumeHandle Handle of the volume.
974 @param VolumeInfo Upon exit, points to the volume's information.
976 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
977 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.
978 @retval EFI_SUCCESS Volume information returned.
982 PeiFfsGetVolumeInfo (
983 IN EFI_PEI_FV_HANDLE VolumeHandle
,
984 OUT EFI_FV_INFO
*VolumeInfo
988 This routine enable a PEIM to register itself to shadow when PEI Foundation
989 discovery permanent memory.
991 @param FileHandle File handle of a PEIM.
993 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
994 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
995 @retval EFI_SUCCESS Successfully to register itself.
1000 PeiRegisterForShadow (
1001 IN EFI_PEI_FILE_HANDLE FileHandle
1005 Initialize image service that install PeiLoadFilePpi.
1007 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.
1008 @param OldCoreData Pointer to Old PeiCore's private data.
1009 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.
1010 If not NULL, PeiCore is entered at second time, stack/heap has been moved
1011 to permenent memory.
1015 InitializeImageServices (
1016 IN PEI_CORE_INSTANCE
*PrivateData
,
1017 IN PEI_CORE_INSTANCE
*OldCoreData
1021 The wrapper function of PeiLoadImageLoadImage().
1023 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.
1024 @param FileHandle Pointer to the FFS file header of the image.
1025 @param ImageAddressArg Pointer to PE/TE image.
1026 @param ImageSizeArg Size of PE/TE image.
1027 @param EntryPoint Pointer to entry point of specified image file for output.
1028 @param AuthenticationState Pointer to attestation authentication state of image.
1030 @return Status of PeiLoadImageLoadImage().
1035 PeiLoadImageLoadImageWrapper (
1036 IN CONST EFI_PEI_LOAD_FILE_PPI
*This
,
1037 IN EFI_PEI_FILE_HANDLE FileHandle
,
1038 OUT EFI_PHYSICAL_ADDRESS
*ImageAddressArg
, OPTIONAL
1039 OUT UINT64
*ImageSizeArg
, OPTIONAL
1040 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1041 OUT UINT32
*AuthenticationState
1046 Provide a callback for when the security PPI is installed.
1048 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1049 @param NotifyDescriptor The descriptor for the notification event.
1050 @param Ppi Pointer to the PPI in question.
1052 @return Always success
1057 SecurityPpiNotifyCallback (
1058 IN EFI_PEI_SERVICES
**PeiServices
,
1059 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1064 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.
1066 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.
1067 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.
1069 @retval EFI_NOT_FOUND FV image can't be found.
1070 @retval EFI_SUCCESS Successfully to process it.
1071 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
1072 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
1077 IN PEI_CORE_FV_HANDLE
*ParentFvCoreHandle
,
1078 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
1082 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
1084 This routine also will install FvInfo ppi for FV hob in PI ways.
1086 @param Private Pointer of PEI_CORE_INSTANCE
1087 @param Instance The index of FV want to be searched.
1089 @return Instance of PEI_CORE_FV_HANDLE.
1091 PEI_CORE_FV_HANDLE
*
1092 FindNextCoreFvHandle (
1093 IN PEI_CORE_INSTANCE
*Private
,
1098 // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1102 Memory-based read services.
1104 This function is to perform the Memory Access Read service based on installed
1105 instance of the EFI_PEI_CPU_IO_PPI.
1106 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1107 return EFI_NOT_YET_AVAILABLE.
1109 @param PeiServices An indirect pointer to the PEI Services Table
1110 published by the PEI Foundation.
1111 @param This Pointer to local data for the interface.
1112 @param Width The width of the access. Enumerated in bytes.
1113 @param Address The physical address of the access.
1114 @param Count The number of accesses to perform.
1115 @param Buffer A pointer to the buffer of data.
1117 @retval EFI_SUCCESS The function completed successfully.
1118 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1123 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1124 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1125 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1132 Memory-based write services.
1134 This function is to perform the Memory Access Write service based on installed
1135 instance of the EFI_PEI_CPU_IO_PPI.
1136 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1137 return EFI_NOT_YET_AVAILABLE.
1139 @param PeiServices An indirect pointer to the PEI Services Table
1140 published by the PEI Foundation.
1141 @param This Pointer to local data for the interface.
1142 @param Width The width of the access. Enumerated in bytes.
1143 @param Address The physical address of the access.
1144 @param Count The number of accesses to perform.
1145 @param Buffer A pointer to the buffer of data.
1147 @retval EFI_SUCCESS The function completed successfully.
1148 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1152 PeiDefaultMemWrite (
1153 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1154 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1155 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1162 IO-based read services.
1164 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
1165 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1166 return EFI_NOT_YET_AVAILABLE.
1168 @param PeiServices An indirect pointer to the PEI Services Table
1169 published by the PEI Foundation.
1170 @param This Pointer to local data for the interface.
1171 @param Width The width of the access. Enumerated in bytes.
1172 @param Address The physical address of the access.
1173 @param Count The number of accesses to perform.
1174 @param Buffer A pointer to the buffer of data.
1176 @retval EFI_SUCCESS The function completed successfully.
1177 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1182 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1183 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1184 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1191 IO-based write services.
1193 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
1194 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1195 return EFI_NOT_YET_AVAILABLE.
1197 @param PeiServices An indirect pointer to the PEI Services Table
1198 published by the PEI Foundation.
1199 @param This Pointer to local data for the interface.
1200 @param Width The width of the access. Enumerated in bytes.
1201 @param Address The physical address of the access.
1202 @param Count The number of accesses to perform.
1203 @param Buffer A pointer to the buffer of data.
1205 @retval EFI_SUCCESS The function completed successfully.
1206 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1211 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1212 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1213 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1220 8-bit I/O read operations.
1222 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1225 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1226 @param This Pointer to local data for the interface.
1227 @param Address The physical address of the access.
1229 @return An 8-bit value returned from the I/O space.
1234 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1235 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1240 Reads an 16-bit I/O port.
1242 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1245 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1246 @param This Pointer to local data for the interface.
1247 @param Address The physical address of the access.
1249 @return A 16-bit value returned from the I/O space.
1253 PeiDefaultIoRead16 (
1254 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1255 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1260 Reads an 32-bit I/O port.
1262 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1265 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1266 @param This Pointer to local data for the interface.
1267 @param Address The physical address of the access.
1269 @return A 32-bit value returned from the I/O space.
1273 PeiDefaultIoRead32 (
1274 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1275 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1280 Reads an 64-bit I/O port.
1282 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1285 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1286 @param This Pointer to local data for the interface.
1287 @param Address The physical address of the access.
1289 @return A 64-bit value returned from the I/O space.
1293 PeiDefaultIoRead64 (
1294 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1295 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1300 8-bit I/O write operations.
1302 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1303 @param This Pointer to local data for the interface.
1304 @param Address The physical address of the access.
1305 @param Data The data to write.
1309 PeiDefaultIoWrite8 (
1310 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1311 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1317 16-bit I/O write operations.
1319 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1320 @param This Pointer to local data for the interface.
1321 @param Address The physical address of the access.
1322 @param Data The data to write.
1326 PeiDefaultIoWrite16 (
1327 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1328 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1334 32-bit I/O write operations.
1336 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1337 @param This Pointer to local data for the interface.
1338 @param Address The physical address of the access.
1339 @param Data The data to write.
1343 PeiDefaultIoWrite32 (
1344 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1345 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1351 64-bit I/O write operations.
1353 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1354 @param This Pointer to local data for the interface.
1355 @param Address The physical address of the access.
1356 @param Data The data to write.
1360 PeiDefaultIoWrite64 (
1361 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1362 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1368 8-bit memory read operations.
1370 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1373 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1374 @param This Pointer to local data for the interface.
1375 @param Address The physical address of the access.
1377 @return An 8-bit value returned from the memory space.
1382 PeiDefaultMemRead8 (
1383 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1384 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1389 16-bit memory read operations.
1391 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1394 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1395 @param This Pointer to local data for the interface.
1396 @param Address The physical address of the access.
1398 @return An 16-bit value returned from the memory space.
1403 PeiDefaultMemRead16 (
1404 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1405 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1410 32-bit memory read operations.
1412 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1415 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1416 @param This Pointer to local data for the interface.
1417 @param Address The physical address of the access.
1419 @return An 32-bit value returned from the memory space.
1424 PeiDefaultMemRead32 (
1425 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1426 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1431 64-bit memory read operations.
1433 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1436 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1437 @param This Pointer to local data for the interface.
1438 @param Address The physical address of the access.
1440 @return An 64-bit value returned from the memory space.
1445 PeiDefaultMemRead64 (
1446 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1447 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1452 8-bit memory write operations.
1454 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1455 @param This Pointer to local data for the interface.
1456 @param Address The physical address of the access.
1457 @param Data The data to write.
1462 PeiDefaultMemWrite8 (
1463 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1464 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1470 16-bit memory write operations.
1472 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1473 @param This Pointer to local data for the interface.
1474 @param Address The physical address of the access.
1475 @param Data The data to write.
1480 PeiDefaultMemWrite16 (
1481 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1482 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1488 32-bit memory write operations.
1490 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1491 @param This Pointer to local data for the interface.
1492 @param Address The physical address of the access.
1493 @param Data The data to write.
1498 PeiDefaultMemWrite32 (
1499 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1500 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1506 64-bit memory write operations.
1508 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1509 @param This Pointer to local data for the interface.
1510 @param Address The physical address of the access.
1511 @param Data The data to write.
1516 PeiDefaultMemWrite64 (
1517 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1518 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1523 extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
;
1526 // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1530 Reads from a given location in the PCI configuration space.
1532 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1533 return EFI_NOT_YET_AVAILABLE.
1535 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1536 @param This Pointer to local data for the interface.
1537 @param Width The width of the access. Enumerated in bytes.
1538 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1539 @param Address The physical address of the access. The format of
1540 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1541 @param Buffer A pointer to the buffer of data.
1543 @retval EFI_SUCCESS The function completed successfully.
1544 @retval EFI_INVALID_PARAMETER The invalid access width.
1545 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1550 PeiDefaultPciCfg2Read (
1551 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1552 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1553 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1559 Write to a given location in the PCI configuration space.
1561 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1562 return EFI_NOT_YET_AVAILABLE.
1564 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1565 @param This Pointer to local data for the interface.
1566 @param Width The width of the access. Enumerated in bytes.
1567 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1568 @param Address The physical address of the access. The format of
1569 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1570 @param Buffer A pointer to the buffer of data.
1572 @retval EFI_SUCCESS The function completed successfully.
1573 @retval EFI_INVALID_PARAMETER The invalid access width.
1574 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1578 PeiDefaultPciCfg2Write (
1579 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1580 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1581 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1587 This function performs a read-modify-write operation on the contents from a given
1588 location in the PCI configuration space.
1590 @param PeiServices An indirect pointer to the PEI Services Table
1591 published by the PEI Foundation.
1592 @param This Pointer to local data for the interface.
1593 @param Width The width of the access. Enumerated in bytes. Type
1594 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
1595 @param Address The physical address of the access.
1596 @param SetBits Points to value to bitwise-OR with the read configuration value.
1597 The size of the value is determined by Width.
1598 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
1599 The size of the value is determined by Width.
1601 @retval EFI_SUCCESS The function completed successfully.
1602 @retval EFI_INVALID_PARAMETER The invalid access width.
1603 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1607 PeiDefaultPciCfg2Modify (
1608 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1609 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1610 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1616 extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
;
1619 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
1620 be re-installed with the instance in permanent memory and all cached FvPpi pointers in
1621 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant
1624 @param PrivateData Pointer to PEI_CORE_INSTANCE.
1628 IN PEI_CORE_INSTANCE
*PrivateData