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 #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
135 /// Pei Core private data structure instance
141 /// Point to ServiceTableShadow
143 EFI_PEI_SERVICES
*Ps
;
144 PEI_PPI_DATABASE PpiData
;
147 /// The count of FVs which contains FFS and could be dispatched by PeiCore.
152 /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore.
154 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
155 PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
156 UINTN UnknownFvInfoCount
;
158 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
160 UINTN CurrentPeimFvCount
;
161 UINTN CurrentPeimCount
;
162 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
163 BOOLEAN PeimNeedingDispatch
;
164 BOOLEAN PeimDispatchOnThisPass
;
165 BOOLEAN PeimDispatcherReenter
;
166 EFI_PEI_HOB_POINTERS HobList
;
167 BOOLEAN SwitchStackSignal
;
168 BOOLEAN PeiMemoryInstalled
;
169 EFI_PHYSICAL_ADDRESS StackBase
;
172 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
173 EFI_PEI_SERVICES ServiceTableShadow
;
174 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
175 EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin
;
176 UINT64 PhysicalMemoryLength
;
177 EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop
;
178 VOID
* ShadowedPeiCore
;
179 CACHE_SECTION_DATA CacheSection
;
181 // For Loading modules at fixed address feature to cache the top address below which the
182 // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
183 // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
185 EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress
;
187 // The field is define for Loading modules at fixed address feature to tracker the PEI code
188 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
191 UINT64
*PeiCodeMemoryRangeUsageBitMap
;
193 // This field points to the shadowed image read function
195 PE_COFF_LOADER_READ_FILE ShadowedImageRead
;
199 /// Pei Core Instance Data Macros
201 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
202 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
205 Function Pointer type for PeiCore function.
206 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
207 and location of temporary RAM, the stack location and the BFV location.
208 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
209 An empty PPI list consists of a single descriptor with the end-tag
210 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
211 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
212 that both the PEI Foundation and any modules can leverage the associated service
213 calls and/or code in these early PPIs
214 @param OldCoreData Pointer to old core data that is used to initialize the
219 (EFIAPI
*PEICORE_FUNCTION_POINTER
)(
220 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
221 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
222 IN PEI_CORE_INSTANCE
*OldCoreData
226 /// Union of temporarily used function pointers (to save stack space)
229 PEICORE_FUNCTION_POINTER PeiCore
;
230 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
231 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
232 EFI_DXE_IPL_PPI
*DxeIpl
;
233 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
234 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
236 } PEI_CORE_TEMP_POINTERS
;
239 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
240 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
242 } PEI_CORE_PARAMETERS
;
249 The entry routine to Pei Core, invoked by PeiMain during transition
250 from SEC to PEI. After switching stack in the PEI core, it will restart
251 with the old core data.
254 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
255 and location of temporary RAM, the stack location and the BFV location.
256 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
257 An empty PPI list consists of a single descriptor with the end-tag
258 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
259 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
260 that both the PEI Foundation and any modules can leverage the associated service
261 calls and/or code in these early PPIs
262 @param Data Pointer to old core data that is used to initialize the
269 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
270 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
275 // Dispatcher support functions
280 This is the POSTFIX version of the dependency evaluator. When a
281 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
282 the evaluation stack. When that entry is poped from the evaluation
283 stack, the PPI is checked if it is installed. This method allows
284 some time savings as not all PPIs must be checked for certain
285 operation types (AND, OR).
288 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
289 @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to
290 the BNF described above and is stored in postfix notation.
292 @retval TRUE if it is a well-formed Grammar
293 @retval FALSE if the dependency expression overflows the evaluation stack
294 if the dependency expression underflows the evaluation stack
295 if the dependency expression is not a well-formed Grammar.
299 PeimDispatchReadiness (
300 IN EFI_PEI_SERVICES
**PeiServices
,
301 IN VOID
*DependencyExpression
305 Conduct PEIM dispatch.
307 @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data
308 @param PrivateData Pointer to the private data passed in from caller
313 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
314 IN PEI_CORE_INSTANCE
*PrivateData
318 Initialize the Dispatcher's data members
320 @param PrivateData PeiCore's private data structure
321 @param OldCoreData Old data from SecCore
322 NULL if being run in non-permament memory mode.
323 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
324 and location of temporary RAM, the stack location and the BFV location.
328 InitializeDispatcherData (
329 IN PEI_CORE_INSTANCE
*PrivateData
,
330 IN PEI_CORE_INSTANCE
*OldCoreData
,
331 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
335 This routine parses the Dependency Expression, if available, and
336 decides if the module can be executed.
339 @param Private PeiCore's private data structure
340 @param FileHandle PEIM's file handle
341 @param PeimCount The index of last dispatched PEIM.
343 @retval TRUE Can be dispatched
344 @retval FALSE Cannot be dispatched
349 IN PEI_CORE_INSTANCE
*Private
,
350 IN EFI_PEI_FILE_HANDLE FileHandle
,
355 // PPI support functions
359 Initialize PPI services.
361 @param PrivateData Pointer to the PEI Core data.
362 @param OldCoreData Pointer to old PEI Core data.
363 NULL if being run in non-permament memory mode.
367 InitializePpiServices (
368 IN PEI_CORE_INSTANCE
*PrivateData
,
369 IN PEI_CORE_INSTANCE
*OldCoreData
374 Migrate the Hob list from the temporary memory stack to PEI installed memory.
376 @param PrivateData Pointer to PeiCore's private data structure.
377 @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range
378 will be fixup for PpiData and PpiDescriptor pointer.
379 @param OldCheckingTop Top of temporary memory range. All Ppi in this range
380 will be fixup for PpiData and PpiDescriptor.
381 @param Fixup The address difference between
382 the new Hob list and old Hob list.
387 IN PEI_CORE_INSTANCE
*PrivateData
,
388 IN UINTN OldCheckingBottom
,
389 IN UINTN OldCheckingTop
,
395 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.
397 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
398 @param PpiList Pointer to ppi array that want to be installed.
400 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
401 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
402 if any PPI in PpiList is not valid
403 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
409 IN CONST EFI_PEI_SERVICES
**PeiServices
,
410 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
415 Re-Install PPI services.
417 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
418 @param OldPpi Pointer to the old PEI PPI Descriptors.
419 @param NewPpi Pointer to the new PEI PPI Descriptors.
421 @retval EFI_SUCCESS if the operation was successful
422 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
423 if NewPpi is not valid
424 @retval EFI_NOT_FOUND if the PPI was not in the database
430 IN CONST EFI_PEI_SERVICES
**PeiServices
,
431 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
432 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
437 Locate a given named PPI.
440 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
441 @param Guid Pointer to GUID of the PPI.
442 @param Instance Instance Number to discover.
443 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
444 returns a pointer to the descriptor (includes flags, etc)
445 @param Ppi Pointer to reference the found PPI
447 @retval EFI_SUCCESS if the PPI is in the database
448 @retval EFI_NOT_FOUND if the PPI is not in the database
454 IN CONST EFI_PEI_SERVICES
**PeiServices
,
455 IN CONST EFI_GUID
*Guid
,
457 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
463 Install a notification for a given PPI.
466 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
467 @param NotifyList Pointer to list of Descriptors to notify upon.
469 @retval EFI_SUCCESS if successful
470 @retval EFI_OUT_OF_RESOURCES if no space in the database
471 @retval EFI_INVALID_PARAMETER if not a good decriptor
477 IN CONST EFI_PEI_SERVICES
**PeiServices
,
478 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
483 Process the Notify List at dispatch level.
485 @param PrivateData PeiCore's private data structure.
490 IN PEI_CORE_INSTANCE
*PrivateData
495 Dispatch notifications.
497 @param PrivateData PeiCore's private data structure
498 @param NotifyType Type of notify to fire.
499 @param InstallStartIndex Install Beginning index.
500 @param InstallStopIndex Install Ending index.
501 @param NotifyStartIndex Notify Beginning index.
502 @param NotifyStopIndex Notify Ending index.
507 IN PEI_CORE_INSTANCE
*PrivateData
,
509 IN INTN InstallStartIndex
,
510 IN INTN InstallStopIndex
,
511 IN INTN NotifyStartIndex
,
512 IN INTN NotifyStopIndex
516 // Boot mode support functions
519 This service enables PEIMs to ascertain the present value of the boot mode.
521 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
522 @param BootMode A pointer to contain the value of the boot mode.
524 @retval EFI_SUCCESS The boot mode was returned successfully.
525 @retval EFI_INVALID_PARAMETER BootMode is NULL.
531 IN CONST EFI_PEI_SERVICES
**PeiServices
,
532 IN OUT EFI_BOOT_MODE
*BootMode
536 This service enables PEIMs to update the boot mode variable.
539 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
540 @param BootMode The value of the boot mode to set.
542 @return EFI_SUCCESS The value was successfully updated
548 IN CONST EFI_PEI_SERVICES
**PeiServices
,
549 IN EFI_BOOT_MODE BootMode
553 // Security support functions
557 Initialize the security services.
559 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
560 @param OldCoreData Pointer to the old core data.
561 NULL if being run in non-permament memory mode.
565 InitializeSecurityServices (
566 IN EFI_PEI_SERVICES
**PeiServices
,
567 IN PEI_CORE_INSTANCE
*OldCoreData
571 Verify a Firmware volume.
573 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
575 @retval EFI_SUCCESS Firmware Volume is legal
576 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test
581 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
586 Provide a callout to the security verification service.
589 @param PrivateData PeiCore's private data structure
590 @param VolumeHandle Handle of FV
591 @param FileHandle Handle of PEIM's ffs
593 @retval EFI_SUCCESS Image is OK
594 @retval EFI_SECURITY_VIOLATION Image is illegal
599 IN PEI_CORE_INSTANCE
*PrivateData
,
600 IN EFI_PEI_FV_HANDLE VolumeHandle
,
601 IN EFI_PEI_FILE_HANDLE FileHandle
606 Gets the pointer to the HOB List.
609 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
610 @param HobList Pointer to the HOB List.
612 @retval EFI_SUCCESS Get the pointer of HOB List
613 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published
614 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)
620 IN CONST EFI_PEI_SERVICES
**PeiServices
,
621 IN OUT VOID
**HobList
625 Add a new HOB to the HOB List.
627 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
628 @param Type Type of the new HOB.
629 @param Length Length of the new HOB to allocate.
630 @param Hob Pointer to the new HOB.
632 @return EFI_SUCCESS Success to create hob.
633 @retval EFI_INVALID_PARAMETER if Hob is NULL
634 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.
635 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
641 IN CONST EFI_PEI_SERVICES
**PeiServices
,
649 Builds a Handoff Information Table HOB
651 @param BootMode - Current Bootmode
652 @param MemoryBegin - Start Memory Address.
653 @param MemoryLength - Length of Memory.
655 @return EFI_SUCCESS Always success to initialize HOB.
659 PeiCoreBuildHobHandoffInfoTable (
660 IN EFI_BOOT_MODE BootMode
,
661 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
662 IN UINT64 MemoryLength
667 // FFS Fw Volume support functions
670 Searches for the next matching file in the firmware volume.
672 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
673 @param SearchType Filter to find only files of this type.
674 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
675 @param FvHandle Handle of firmware volume in which to search.
676 @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start
677 at the beginning of the firmware volume. On exit, points the file handle of the next file
678 in the volume or NULL if there are no more files.
680 @retval EFI_NOT_FOUND The file was not found.
681 @retval EFI_NOT_FOUND The header checksum was not zero.
682 @retval EFI_SUCCESS The file was found.
688 IN CONST EFI_PEI_SERVICES
**PeiServices
,
690 IN EFI_PEI_FV_HANDLE FvHandle
,
691 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
695 Searches for the next matching section within the specified file.
697 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
698 @param SectionType Filter to find only sections of this type.
699 @param FileHandle Pointer to the current file to search.
700 @param SectionData A pointer to the discovered section, if successful.
701 NULL if section not found
703 @retval EFI_NOT_FOUND The section was not found.
704 @retval EFI_SUCCESS The section was found.
709 PeiFfsFindSectionData (
710 IN CONST EFI_PEI_SERVICES
**PeiServices
,
711 IN EFI_SECTION_TYPE SectionType
,
712 IN EFI_PEI_FILE_HANDLE FileHandle
,
713 OUT VOID
**SectionData
717 Search the firmware volumes by index
719 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
720 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware
722 @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.
724 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL
725 @retval EFI_NOT_FOUND The volume was not found.
726 @retval EFI_SUCCESS The volume was found.
731 PeiFfsFindNextVolume (
732 IN CONST EFI_PEI_SERVICES
**PeiServices
,
734 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
738 // Memory support functions
742 Initialize the memory services.
744 @param PrivateData PeiCore's private data structure
745 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
746 and location of temporary RAM, the stack location and the BFV location.
747 @param OldCoreData Pointer to the PEI Core data.
748 NULL if being run in non-permament memory mode.
752 InitializeMemoryServices (
753 IN PEI_CORE_INSTANCE
*PrivateData
,
754 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
755 IN PEI_CORE_INSTANCE
*OldCoreData
760 Install the permanent memory is now available.
761 Creates HOB (PHIT and Stack).
763 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
764 @param MemoryBegin Start of memory address.
765 @param MemoryLength Length of memory.
767 @return EFI_SUCCESS Always success.
772 PeiInstallPeiMemory (
773 IN CONST EFI_PEI_SERVICES
**PeiServices
,
774 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
775 IN UINT64 MemoryLength
780 Memory allocation service on permanent memory,
781 not usable prior to the memory installation.
784 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
785 @param MemoryType Type of memory to allocate.
786 @param Pages Number of pages to allocate.
787 @param Memory Pointer of memory allocated.
789 @retval EFI_SUCCESS The allocation was successful
790 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
791 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available
792 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
793 to allocate the number of pages.
799 IN CONST EFI_PEI_SERVICES
**PeiServices
,
800 IN EFI_MEMORY_TYPE MemoryType
,
802 OUT EFI_PHYSICAL_ADDRESS
*Memory
807 Memory allocation service on the temporary memory.
810 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
811 @param Size Amount of memory required
812 @param Buffer Address of pointer to the buffer
814 @retval EFI_SUCCESS The allocation was successful
815 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
816 to allocate the requested size.
822 IN CONST EFI_PEI_SERVICES
**PeiServices
,
829 Routine for load image file.
832 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
833 @param FileHandle Pointer to the FFS file header of the image.
834 @param PeimState The dispatch state of the input PEIM handle.
835 @param EntryPoint Pointer to entry point of specified image file for output.
836 @param AuthenticationState Pointer to attestation authentication state of image.
838 @retval EFI_SUCCESS Image is successfully loaded.
839 @retval EFI_NOT_FOUND Fail to locate necessary PPI
840 @retval Others Fail to load file.
845 IN CONST EFI_PEI_SERVICES
**PeiServices
,
846 IN EFI_PEI_FILE_HANDLE FileHandle
,
848 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
849 OUT UINT32
*AuthenticationState
854 Core version of the Status Code reporter
857 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
858 @param CodeType Type of Status Code.
859 @param Value Value to output for Status Code.
860 @param Instance Instance Number of this status code.
861 @param CallerId ID of the caller of this status code.
862 @param Data Optional data associated with this status code.
864 @retval EFI_SUCCESS if status code is successfully reported
865 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
870 PeiReportStatusCode (
871 IN CONST EFI_PEI_SERVICES
**PeiServices
,
872 IN EFI_STATUS_CODE_TYPE CodeType
,
873 IN EFI_STATUS_CODE_VALUE Value
,
875 IN CONST EFI_GUID
*CallerId
,
876 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
881 Core version of the Reset System
884 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
886 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
887 @retval EFI_DEVICE_ERROR Did not reset system.
888 Otherwise, resets the system.
894 IN CONST EFI_PEI_SERVICES
**PeiServices
899 Initialize PeiCore Fv List.
902 @param PrivateData - Pointer to PEI_CORE_INSTANCE.
903 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
908 IN PEI_CORE_INSTANCE
*PrivateData
,
909 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
913 Process Firmware Volum Information once FvInfoPPI install.
915 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
916 @param NotifyDescriptor Address of the notification descriptor data structure.
917 @param Ppi Address of the PPI that was installed.
919 @retval EFI_SUCCESS if the interface could be successfully installed
924 FirmwareVolmeInfoPpiNotifyCallback (
925 IN EFI_PEI_SERVICES
**PeiServices
,
926 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
932 Given the input VolumeHandle, search for the next matching name file.
934 @param FileName File name to search.
935 @param VolumeHandle The current FV to search.
936 @param FileHandle Pointer to the file matching name in VolumeHandle.
937 NULL if file not found
939 @retval EFI_NOT_FOUND No files matching the search criteria were found
940 @retval EFI_SUCCESS Success to search given file
945 PeiFfsFindFileByName (
946 IN CONST EFI_GUID
*FileName
,
947 IN EFI_PEI_FV_HANDLE VolumeHandle
,
948 OUT EFI_PEI_FILE_HANDLE
*FileHandle
952 Returns information about a specific file.
954 @param FileHandle Handle of the file.
955 @param FileInfo Upon exit, points to the file's information.
957 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
958 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
959 @retval EFI_SUCCESS File information returned.
965 IN EFI_PEI_FILE_HANDLE FileHandle
,
966 OUT EFI_FV_FILE_INFO
*FileInfo
970 Returns information about the specified volume.
972 @param VolumeHandle Handle of the volume.
973 @param VolumeInfo Upon exit, points to the volume's information.
975 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
976 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.
977 @retval EFI_SUCCESS Volume information returned.
981 PeiFfsGetVolumeInfo (
982 IN EFI_PEI_FV_HANDLE VolumeHandle
,
983 OUT EFI_FV_INFO
*VolumeInfo
987 This routine enable a PEIM to register itself to shadow when PEI Foundation
988 discovery permanent memory.
990 @param FileHandle File handle of a PEIM.
992 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
993 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
994 @retval EFI_SUCCESS Successfully to register itself.
999 PeiRegisterForShadow (
1000 IN EFI_PEI_FILE_HANDLE FileHandle
1004 Initialize image service that install PeiLoadFilePpi.
1006 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.
1007 @param OldCoreData Pointer to Old PeiCore's private data.
1008 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.
1009 If not NULL, PeiCore is entered at second time, stack/heap has been moved
1010 to permenent memory.
1014 InitializeImageServices (
1015 IN PEI_CORE_INSTANCE
*PrivateData
,
1016 IN PEI_CORE_INSTANCE
*OldCoreData
1020 The wrapper function of PeiLoadImageLoadImage().
1022 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.
1023 @param FileHandle Pointer to the FFS file header of the image.
1024 @param ImageAddressArg Pointer to PE/TE image.
1025 @param ImageSizeArg Size of PE/TE image.
1026 @param EntryPoint Pointer to entry point of specified image file for output.
1027 @param AuthenticationState Pointer to attestation authentication state of image.
1029 @return Status of PeiLoadImageLoadImage().
1034 PeiLoadImageLoadImageWrapper (
1035 IN CONST EFI_PEI_LOAD_FILE_PPI
*This
,
1036 IN EFI_PEI_FILE_HANDLE FileHandle
,
1037 OUT EFI_PHYSICAL_ADDRESS
*ImageAddressArg
, OPTIONAL
1038 OUT UINT64
*ImageSizeArg
, OPTIONAL
1039 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1040 OUT UINT32
*AuthenticationState
1045 Provide a callback for when the security PPI is installed.
1047 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1048 @param NotifyDescriptor The descriptor for the notification event.
1049 @param Ppi Pointer to the PPI in question.
1051 @return Always success
1056 SecurityPpiNotifyCallback (
1057 IN EFI_PEI_SERVICES
**PeiServices
,
1058 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1063 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.
1065 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.
1066 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.
1068 @retval EFI_NOT_FOUND FV image can't be found.
1069 @retval EFI_SUCCESS Successfully to process it.
1070 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
1071 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
1076 IN PEI_CORE_FV_HANDLE
*ParentFvCoreHandle
,
1077 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
1081 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
1083 This routine also will install FvInfo ppi for FV hob in PI ways.
1085 @param Private Pointer of PEI_CORE_INSTANCE
1086 @param Instance The index of FV want to be searched.
1088 @return Instance of PEI_CORE_FV_HANDLE.
1090 PEI_CORE_FV_HANDLE
*
1091 FindNextCoreFvHandle (
1092 IN PEI_CORE_INSTANCE
*Private
,
1097 // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1101 Memory-based read services.
1103 This function is to perform the Memory Access Read service based on installed
1104 instance of the EFI_PEI_CPU_IO_PPI.
1105 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1106 return EFI_NOT_YET_AVAILABLE.
1108 @param PeiServices An indirect pointer to the PEI Services Table
1109 published by the PEI Foundation.
1110 @param This Pointer to local data for the interface.
1111 @param Width The width of the access. Enumerated in bytes.
1112 @param Address The physical address of the access.
1113 @param Count The number of accesses to perform.
1114 @param Buffer A pointer to the buffer of data.
1116 @retval EFI_SUCCESS The function completed successfully.
1117 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1122 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1123 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1124 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1131 Memory-based write services.
1133 This function is to perform the Memory Access Write service based on installed
1134 instance of the EFI_PEI_CPU_IO_PPI.
1135 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1136 return EFI_NOT_YET_AVAILABLE.
1138 @param PeiServices An indirect pointer to the PEI Services Table
1139 published by the PEI Foundation.
1140 @param This Pointer to local data for the interface.
1141 @param Width The width of the access. Enumerated in bytes.
1142 @param Address The physical address of the access.
1143 @param Count The number of accesses to perform.
1144 @param Buffer A pointer to the buffer of data.
1146 @retval EFI_SUCCESS The function completed successfully.
1147 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1151 PeiDefaultMemWrite (
1152 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1153 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1154 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1161 IO-based read services.
1163 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
1164 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1165 return EFI_NOT_YET_AVAILABLE.
1167 @param PeiServices An indirect pointer to the PEI Services Table
1168 published by the PEI Foundation.
1169 @param This Pointer to local data for the interface.
1170 @param Width The width of the access. Enumerated in bytes.
1171 @param Address The physical address of the access.
1172 @param Count The number of accesses to perform.
1173 @param Buffer A pointer to the buffer of data.
1175 @retval EFI_SUCCESS The function completed successfully.
1176 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1181 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1182 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1183 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1190 IO-based write services.
1192 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
1193 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1194 return EFI_NOT_YET_AVAILABLE.
1196 @param PeiServices An indirect pointer to the PEI Services Table
1197 published by the PEI Foundation.
1198 @param This Pointer to local data for the interface.
1199 @param Width The width of the access. Enumerated in bytes.
1200 @param Address The physical address of the access.
1201 @param Count The number of accesses to perform.
1202 @param Buffer A pointer to the buffer of data.
1204 @retval EFI_SUCCESS The function completed successfully.
1205 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1210 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1211 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1212 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1219 8-bit I/O read operations.
1221 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1224 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1225 @param This Pointer to local data for the interface.
1226 @param Address The physical address of the access.
1228 @return An 8-bit value returned from the I/O space.
1233 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1234 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1239 Reads an 16-bit I/O port.
1241 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1244 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1245 @param This Pointer to local data for the interface.
1246 @param Address The physical address of the access.
1248 @return A 16-bit value returned from the I/O space.
1252 PeiDefaultIoRead16 (
1253 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1254 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1259 Reads an 32-bit I/O port.
1261 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1264 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1265 @param This Pointer to local data for the interface.
1266 @param Address The physical address of the access.
1268 @return A 32-bit value returned from the I/O space.
1272 PeiDefaultIoRead32 (
1273 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1274 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1279 Reads an 64-bit I/O port.
1281 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1284 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1285 @param This Pointer to local data for the interface.
1286 @param Address The physical address of the access.
1288 @return A 64-bit value returned from the I/O space.
1292 PeiDefaultIoRead64 (
1293 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1294 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1299 8-bit I/O write operations.
1301 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1302 @param This Pointer to local data for the interface.
1303 @param Address The physical address of the access.
1304 @param Data The data to write.
1308 PeiDefaultIoWrite8 (
1309 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1310 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1316 16-bit I/O write operations.
1318 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1319 @param This Pointer to local data for the interface.
1320 @param Address The physical address of the access.
1321 @param Data The data to write.
1325 PeiDefaultIoWrite16 (
1326 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1327 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1333 32-bit I/O write operations.
1335 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1336 @param This Pointer to local data for the interface.
1337 @param Address The physical address of the access.
1338 @param Data The data to write.
1342 PeiDefaultIoWrite32 (
1343 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1344 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1350 64-bit I/O write operations.
1352 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1353 @param This Pointer to local data for the interface.
1354 @param Address The physical address of the access.
1355 @param Data The data to write.
1359 PeiDefaultIoWrite64 (
1360 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1361 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1367 8-bit memory read operations.
1369 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1372 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1373 @param This Pointer to local data for the interface.
1374 @param Address The physical address of the access.
1376 @return An 8-bit value returned from the memory space.
1381 PeiDefaultMemRead8 (
1382 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1383 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1388 16-bit memory read operations.
1390 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1393 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1394 @param This Pointer to local data for the interface.
1395 @param Address The physical address of the access.
1397 @return An 16-bit value returned from the memory space.
1402 PeiDefaultMemRead16 (
1403 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1404 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1409 32-bit memory read operations.
1411 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1414 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1415 @param This Pointer to local data for the interface.
1416 @param Address The physical address of the access.
1418 @return An 32-bit value returned from the memory space.
1423 PeiDefaultMemRead32 (
1424 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1425 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1430 64-bit memory read operations.
1432 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1435 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1436 @param This Pointer to local data for the interface.
1437 @param Address The physical address of the access.
1439 @return An 64-bit value returned from the memory space.
1444 PeiDefaultMemRead64 (
1445 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1446 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1451 8-bit memory write operations.
1453 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1454 @param This Pointer to local data for the interface.
1455 @param Address The physical address of the access.
1456 @param Data The data to write.
1461 PeiDefaultMemWrite8 (
1462 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1463 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1469 16-bit memory write operations.
1471 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1472 @param This Pointer to local data for the interface.
1473 @param Address The physical address of the access.
1474 @param Data The data to write.
1479 PeiDefaultMemWrite16 (
1480 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1481 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1487 32-bit memory write operations.
1489 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1490 @param This Pointer to local data for the interface.
1491 @param Address The physical address of the access.
1492 @param Data The data to write.
1497 PeiDefaultMemWrite32 (
1498 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1499 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1505 64-bit memory write operations.
1507 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1508 @param This Pointer to local data for the interface.
1509 @param Address The physical address of the access.
1510 @param Data The data to write.
1515 PeiDefaultMemWrite64 (
1516 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1517 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1522 extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
;
1525 // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1529 Reads from a given location in the PCI configuration space.
1531 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1532 return EFI_NOT_YET_AVAILABLE.
1534 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1535 @param This Pointer to local data for the interface.
1536 @param Width The width of the access. Enumerated in bytes.
1537 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1538 @param Address The physical address of the access. The format of
1539 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1540 @param Buffer A pointer to the buffer of data.
1542 @retval EFI_SUCCESS The function completed successfully.
1543 @retval EFI_INVALID_PARAMETER The invalid access width.
1544 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1549 PeiDefaultPciCfg2Read (
1550 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1551 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1552 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1558 Write to a given location in the PCI configuration space.
1560 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1561 return EFI_NOT_YET_AVAILABLE.
1563 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1564 @param This Pointer to local data for the interface.
1565 @param Width The width of the access. Enumerated in bytes.
1566 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1567 @param Address The physical address of the access. The format of
1568 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1569 @param Buffer A pointer to the buffer of data.
1571 @retval EFI_SUCCESS The function completed successfully.
1572 @retval EFI_INVALID_PARAMETER The invalid access width.
1573 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1577 PeiDefaultPciCfg2Write (
1578 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1579 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1580 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1586 This function performs a read-modify-write operation on the contents from a given
1587 location in the PCI configuration space.
1589 @param PeiServices An indirect pointer to the PEI Services Table
1590 published by the PEI Foundation.
1591 @param This Pointer to local data for the interface.
1592 @param Width The width of the access. Enumerated in bytes. Type
1593 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
1594 @param Address The physical address of the access.
1595 @param SetBits Points to value to bitwise-OR with the read configuration value.
1596 The size of the value is determined by Width.
1597 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
1598 The size of the value is determined by Width.
1600 @retval EFI_SUCCESS The function completed successfully.
1601 @retval EFI_INVALID_PARAMETER The invalid access width.
1602 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1606 PeiDefaultPciCfg2Modify (
1607 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1608 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1609 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1615 extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
;
1618 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
1619 be re-installed with the instance in permanent memory and all cached FvPpi pointers in
1620 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant
1623 @param PrivateData Pointer to PEI_CORE_INSTANCE.
1627 IN PEI_CORE_INSTANCE
*PrivateData