2 Definition of Pei Core Structures and Services
4 Copyright (c) 2006 - 2013, 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/FirmwareVolumeInfo2.h>
26 #include <Ppi/Decompress.h>
27 #include <Ppi/GuidedSectionExtraction.h>
28 #include <Ppi/LoadFile.h>
29 #include <Ppi/Security2.h>
30 #include <Ppi/TemporaryRamSupport.h>
31 #include <Library/DebugLib.h>
32 #include <Library/PeiCoreEntryPoint.h>
33 #include <Library/BaseLib.h>
34 #include <Library/HobLib.h>
35 #include <Library/PerformanceLib.h>
36 #include <Library/PeiServicesLib.h>
37 #include <Library/ReportStatusCodeLib.h>
38 #include <Library/PeCoffLib.h>
39 #include <Library/PeCoffGetEntryPointLib.h>
40 #include <Library/BaseMemoryLib.h>
41 #include <Library/CacheMaintenanceLib.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/FirmwareFileSystem3.h>
48 #include <Guid/AprioriFileName.h>
51 /// It is an FFS type extension used for PeiFindFileEx. It indicates current
52 /// Ffs searching is for all PEIMs can be dispatched by PeiCore.
54 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
57 /// Pei Core private data structures
60 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
61 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
63 } PEI_PPI_LIST_POINTERS
;
66 /// PPI database structure which contains two link: PpiList and NotifyList. PpiList
67 /// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.
71 /// index of end of PpiList link list.
75 /// index of end of notify link list.
79 /// index of the dispatched notify list.
83 /// index of last installed Ppi description in PpiList link list.
85 INTN LastDispatchedInstall
;
87 /// index of last dispatched notify in Notify link list.
89 INTN LastDispatchedNotify
;
93 PEI_PPI_LIST_POINTERS PpiListPtrs
[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported
)];
98 // PEI_CORE_FV_HANDE.PeimState
99 // Do not change these values as there is code doing math to change states.
100 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
102 #define PEIM_STATE_NOT_DISPATCHED 0x00
103 #define PEIM_STATE_DISPATCHED 0x01
104 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
105 #define PEIM_STATE_DONE 0x03
108 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
109 EFI_PEI_FIRMWARE_VOLUME_PPI
*FvPpi
;
110 EFI_PEI_FV_HANDLE FvHandle
;
111 UINT8 PeimState
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
112 EFI_PEI_FILE_HANDLE FvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
114 UINT32 AuthenticationStatus
;
115 } PEI_CORE_FV_HANDLE
;
121 UINT32 AuthenticationStatus
;
122 EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor
;
123 } PEI_CORE_UNKNOW_FORMAT_FV_INFO
;
125 #define CACHE_SETION_MAX_NUMBER 0x10
127 EFI_COMMON_SECTION_HEADER
* Section
[CACHE_SETION_MAX_NUMBER
];
128 VOID
* SectionData
[CACHE_SETION_MAX_NUMBER
];
129 UINTN SectionSize
[CACHE_SETION_MAX_NUMBER
];
130 UINT32 AuthenticationStatus
[CACHE_SETION_MAX_NUMBER
];
131 UINTN AllSectionCount
;
133 } CACHE_SECTION_DATA
;
136 /// Forward declaration for PEI_CORE_INSTANCE
138 typedef struct _PEI_CORE_INSTANCE PEI_CORE_INSTANCE
;
142 Function Pointer type for PeiCore function.
143 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
144 and location of temporary RAM, the stack location and the BFV location.
145 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
146 An empty PPI list consists of a single descriptor with the end-tag
147 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
148 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
149 that both the PEI Foundation and any modules can leverage the associated service
150 calls and/or code in these early PPIs
151 @param OldCoreData Pointer to old core data that is used to initialize the
156 (EFIAPI
*PEICORE_FUNCTION_POINTER
)(
157 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
158 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
159 IN PEI_CORE_INSTANCE
*OldCoreData
162 #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')
165 /// Pei Core private data structure instance
167 struct _PEI_CORE_INSTANCE
{
171 /// Point to ServiceTableShadow
173 EFI_PEI_SERVICES
*Ps
;
174 PEI_PPI_DATABASE PpiData
;
177 /// The count of FVs which contains FFS and could be dispatched by PeiCore.
182 /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore.
184 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
185 PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
186 UINTN UnknownFvInfoCount
;
188 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
190 UINTN CurrentPeimFvCount
;
191 UINTN CurrentPeimCount
;
192 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
193 BOOLEAN PeimNeedingDispatch
;
194 BOOLEAN PeimDispatchOnThisPass
;
195 BOOLEAN PeimDispatcherReenter
;
196 EFI_PEI_HOB_POINTERS HobList
;
197 BOOLEAN SwitchStackSignal
;
198 BOOLEAN PeiMemoryInstalled
;
200 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
201 EFI_PEI_SERVICES ServiceTableShadow
;
202 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
203 EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin
;
204 UINT64 PhysicalMemoryLength
;
205 EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop
;
207 BOOLEAN HeapOffsetPositive
;
209 BOOLEAN StackOffsetPositive
;
210 PEICORE_FUNCTION_POINTER ShadowedPeiCore
;
211 CACHE_SECTION_DATA CacheSection
;
213 // For Loading modules at fixed address feature to cache the top address below which the
214 // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field
215 // and Ps should not be changed since maybe user could get this top address by using the offet to Ps.
217 EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress
;
219 // The field is define for Loading modules at fixed address feature to tracker the PEI code
220 // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page
223 UINT64
*PeiCodeMemoryRangeUsageBitMap
;
225 // This field points to the shadowed image read function
227 PE_COFF_LOADER_READ_FILE ShadowedImageRead
;
231 /// Pei Core Instance Data Macros
233 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
234 CR(a, PEI_CORE_INSTANCE, Ps, PEI_CORE_HANDLE_SIGNATURE)
237 /// Union of temporarily used function pointers (to save stack space)
240 PEICORE_FUNCTION_POINTER PeiCore
;
241 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
242 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
243 EFI_DXE_IPL_PPI
*DxeIpl
;
244 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
245 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
247 } PEI_CORE_TEMP_POINTERS
;
250 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
251 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
253 } PEI_CORE_PARAMETERS
;
260 The entry routine to Pei Core, invoked by PeiMain during transition
261 from SEC to PEI. After switching stack in the PEI core, it will restart
262 with the old core data.
265 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
266 and location of temporary RAM, the stack location and the BFV location.
267 @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.
268 An empty PPI list consists of a single descriptor with the end-tag
269 EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization
270 phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such
271 that both the PEI Foundation and any modules can leverage the associated service
272 calls and/or code in these early PPIs
273 @param Data Pointer to old core data that is used to initialize the
280 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
281 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
286 // Dispatcher support functions
291 This is the POSTFIX version of the dependency evaluator. When a
292 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
293 the evaluation stack. When that entry is poped from the evaluation
294 stack, the PPI is checked if it is installed. This method allows
295 some time savings as not all PPIs must be checked for certain
296 operation types (AND, OR).
299 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
300 @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to
301 the BNF described above and is stored in postfix notation.
303 @retval TRUE if it is a well-formed Grammar
304 @retval FALSE if the dependency expression overflows the evaluation stack
305 if the dependency expression underflows the evaluation stack
306 if the dependency expression is not a well-formed Grammar.
310 PeimDispatchReadiness (
311 IN EFI_PEI_SERVICES
**PeiServices
,
312 IN VOID
*DependencyExpression
316 Conduct PEIM dispatch.
318 @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data
319 @param PrivateData Pointer to the private data passed in from caller
324 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
325 IN PEI_CORE_INSTANCE
*PrivateData
329 Initialize the Dispatcher's data members
331 @param PrivateData PeiCore's private data structure
332 @param OldCoreData Old data from SecCore
333 NULL if being run in non-permament memory mode.
334 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
335 and location of temporary RAM, the stack location and the BFV location.
339 InitializeDispatcherData (
340 IN PEI_CORE_INSTANCE
*PrivateData
,
341 IN PEI_CORE_INSTANCE
*OldCoreData
,
342 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
346 This routine parses the Dependency Expression, if available, and
347 decides if the module can be executed.
350 @param Private PeiCore's private data structure
351 @param FileHandle PEIM's file handle
352 @param PeimCount The index of last dispatched PEIM.
354 @retval TRUE Can be dispatched
355 @retval FALSE Cannot be dispatched
360 IN PEI_CORE_INSTANCE
*Private
,
361 IN EFI_PEI_FILE_HANDLE FileHandle
,
366 // PPI support functions
370 Initialize PPI services.
372 @param PrivateData Pointer to the PEI Core data.
373 @param OldCoreData Pointer to old PEI Core data.
374 NULL if being run in non-permament memory mode.
378 InitializePpiServices (
379 IN PEI_CORE_INSTANCE
*PrivateData
,
380 IN PEI_CORE_INSTANCE
*OldCoreData
385 Migrate the Hob list from the temporary memory stack to PEI installed memory.
387 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
388 and location of temporary RAM, the stack location and the BFV location.
389 @param PrivateData Pointer to PeiCore's private data structure.
394 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
395 IN PEI_CORE_INSTANCE
*PrivateData
400 Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.
402 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
403 @param PpiList Pointer to ppi array that want to be installed.
405 @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.
406 @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer
407 if any PPI in PpiList is not valid
408 @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI
414 IN CONST EFI_PEI_SERVICES
**PeiServices
,
415 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
420 Re-Install PPI services.
422 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
423 @param OldPpi Pointer to the old PEI PPI Descriptors.
424 @param NewPpi Pointer to the new PEI PPI Descriptors.
426 @retval EFI_SUCCESS if the operation was successful
427 @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL
428 if NewPpi is not valid
429 @retval EFI_NOT_FOUND if the PPI was not in the database
435 IN CONST EFI_PEI_SERVICES
**PeiServices
,
436 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
437 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
442 Locate a given named PPI.
445 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
446 @param Guid Pointer to GUID of the PPI.
447 @param Instance Instance Number to discover.
448 @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,
449 returns a pointer to the descriptor (includes flags, etc)
450 @param Ppi Pointer to reference the found PPI
452 @retval EFI_SUCCESS if the PPI is in the database
453 @retval EFI_NOT_FOUND if the PPI is not in the database
459 IN CONST EFI_PEI_SERVICES
**PeiServices
,
460 IN CONST EFI_GUID
*Guid
,
462 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
468 Install a notification for a given PPI.
471 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
472 @param NotifyList Pointer to list of Descriptors to notify upon.
474 @retval EFI_SUCCESS if successful
475 @retval EFI_OUT_OF_RESOURCES if no space in the database
476 @retval EFI_INVALID_PARAMETER if not a good decriptor
482 IN CONST EFI_PEI_SERVICES
**PeiServices
,
483 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
488 Process the Notify List at dispatch level.
490 @param PrivateData PeiCore's private data structure.
495 IN PEI_CORE_INSTANCE
*PrivateData
500 Dispatch notifications.
502 @param PrivateData PeiCore's private data structure
503 @param NotifyType Type of notify to fire.
504 @param InstallStartIndex Install Beginning index.
505 @param InstallStopIndex Install Ending index.
506 @param NotifyStartIndex Notify Beginning index.
507 @param NotifyStopIndex Notify Ending index.
512 IN PEI_CORE_INSTANCE
*PrivateData
,
514 IN INTN InstallStartIndex
,
515 IN INTN InstallStopIndex
,
516 IN INTN NotifyStartIndex
,
517 IN INTN NotifyStopIndex
521 // Boot mode support functions
524 This service enables PEIMs to ascertain the present value of the boot mode.
526 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
527 @param BootMode A pointer to contain the value of the boot mode.
529 @retval EFI_SUCCESS The boot mode was returned successfully.
530 @retval EFI_INVALID_PARAMETER BootMode is NULL.
536 IN CONST EFI_PEI_SERVICES
**PeiServices
,
537 IN OUT EFI_BOOT_MODE
*BootMode
541 This service enables PEIMs to update the boot mode variable.
544 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
545 @param BootMode The value of the boot mode to set.
547 @return EFI_SUCCESS The value was successfully updated
553 IN CONST EFI_PEI_SERVICES
**PeiServices
,
554 IN EFI_BOOT_MODE BootMode
558 // Security support functions
562 Initialize the security services.
564 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
565 @param OldCoreData Pointer to the old core data.
566 NULL if being run in non-permament memory mode.
570 InitializeSecurityServices (
571 IN EFI_PEI_SERVICES
**PeiServices
,
572 IN PEI_CORE_INSTANCE
*OldCoreData
576 Verify a Firmware volume.
578 @param CurrentFvAddress Pointer to the current Firmware Volume under consideration
580 @retval EFI_SUCCESS Firmware Volume is legal
581 @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test
586 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
590 Provide a callout to the security verification service.
592 @param PrivateData PeiCore's private data structure
593 @param VolumeHandle Handle of FV
594 @param FileHandle Handle of PEIM's ffs
595 @param AuthenticationStatus Authentication status
597 @retval EFI_SUCCESS Image is OK
598 @retval EFI_SECURITY_VIOLATION Image is illegal
599 @retval EFI_NOT_FOUND If security PPI is not installed.
603 IN PEI_CORE_INSTANCE
*PrivateData
,
604 IN EFI_PEI_FV_HANDLE VolumeHandle
,
605 IN EFI_PEI_FILE_HANDLE FileHandle
,
606 IN UINT32 AuthenticationStatus
611 Gets the pointer to the HOB List.
614 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
615 @param HobList Pointer to the HOB List.
617 @retval EFI_SUCCESS Get the pointer of HOB List
618 @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published
619 @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)
625 IN CONST EFI_PEI_SERVICES
**PeiServices
,
626 IN OUT VOID
**HobList
630 Add a new HOB to the HOB List.
632 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
633 @param Type Type of the new HOB.
634 @param Length Length of the new HOB to allocate.
635 @param Hob Pointer to the new HOB.
637 @return EFI_SUCCESS Success to create hob.
638 @retval EFI_INVALID_PARAMETER if Hob is NULL
639 @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.
640 @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
646 IN CONST EFI_PEI_SERVICES
**PeiServices
,
654 Builds a Handoff Information Table HOB
656 @param BootMode - Current Bootmode
657 @param MemoryBegin - Start Memory Address.
658 @param MemoryLength - Length of Memory.
660 @return EFI_SUCCESS Always success to initialize HOB.
664 PeiCoreBuildHobHandoffInfoTable (
665 IN EFI_BOOT_MODE BootMode
,
666 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
667 IN UINT64 MemoryLength
672 // FFS Fw Volume support functions
675 Searches for the next matching file in the firmware volume.
677 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
678 @param SearchType Filter to find only files of this type.
679 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
680 @param FvHandle Handle of firmware volume in which to search.
681 @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start
682 at the beginning of the firmware volume. On exit, points the file handle of the next file
683 in the volume or NULL if there are no more files.
685 @retval EFI_NOT_FOUND The file was not found.
686 @retval EFI_NOT_FOUND The header checksum was not zero.
687 @retval EFI_SUCCESS The file was found.
693 IN CONST EFI_PEI_SERVICES
**PeiServices
,
695 IN EFI_PEI_FV_HANDLE FvHandle
,
696 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
700 Searches for the next matching section within the specified file.
702 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
703 @param SectionType Filter to find only sections of this type.
704 @param FileHandle Pointer to the current file to search.
705 @param SectionData A pointer to the discovered section, if successful.
706 NULL if section not found
708 @retval EFI_NOT_FOUND The section was not found.
709 @retval EFI_SUCCESS The section was found.
714 PeiFfsFindSectionData (
715 IN CONST EFI_PEI_SERVICES
**PeiServices
,
716 IN EFI_SECTION_TYPE SectionType
,
717 IN EFI_PEI_FILE_HANDLE FileHandle
,
718 OUT VOID
**SectionData
722 Searches for the next matching section within the specified file.
724 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
725 @param SectionType The value of the section type to find.
726 @param SectionInstance Section instance to find.
727 @param FileHandle Handle of the firmware file to search.
728 @param SectionData A pointer to the discovered section, if successful.
729 @param AuthenticationStatus A pointer to the authentication status for this section.
731 @retval EFI_SUCCESS The section was found.
732 @retval EFI_NOT_FOUND The section was not found.
737 PeiFfsFindSectionData3 (
738 IN CONST EFI_PEI_SERVICES
**PeiServices
,
739 IN EFI_SECTION_TYPE SectionType
,
740 IN UINTN SectionInstance
,
741 IN EFI_PEI_FILE_HANDLE FileHandle
,
742 OUT VOID
**SectionData
,
743 OUT UINT32
*AuthenticationStatus
747 Search the firmware volumes by index
749 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation
750 @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware
752 @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.
754 @retval EFI_INVALID_PARAMETER VolumeHandle is NULL
755 @retval EFI_NOT_FOUND The volume was not found.
756 @retval EFI_SUCCESS The volume was found.
761 PeiFfsFindNextVolume (
762 IN CONST EFI_PEI_SERVICES
**PeiServices
,
764 IN OUT EFI_PEI_FV_HANDLE
*VolumeHandle
768 // Memory support functions
772 Initialize the memory services.
774 @param PrivateData PeiCore's private data structure
775 @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size
776 and location of temporary RAM, the stack location and the BFV location.
777 @param OldCoreData Pointer to the PEI Core data.
778 NULL if being run in non-permament memory mode.
782 InitializeMemoryServices (
783 IN PEI_CORE_INSTANCE
*PrivateData
,
784 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
785 IN PEI_CORE_INSTANCE
*OldCoreData
790 Install the permanent memory is now available.
791 Creates HOB (PHIT and Stack).
793 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
794 @param MemoryBegin Start of memory address.
795 @param MemoryLength Length of memory.
797 @return EFI_SUCCESS Always success.
802 PeiInstallPeiMemory (
803 IN CONST EFI_PEI_SERVICES
**PeiServices
,
804 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
805 IN UINT64 MemoryLength
810 Memory allocation service on permanent memory,
811 not usable prior to the memory installation.
814 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
815 @param MemoryType Type of memory to allocate.
816 @param Pages Number of pages to allocate.
817 @param Memory Pointer of memory allocated.
819 @retval EFI_SUCCESS The allocation was successful
820 @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
821 @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available
822 @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
823 to allocate the number of pages.
829 IN CONST EFI_PEI_SERVICES
**PeiServices
,
830 IN EFI_MEMORY_TYPE MemoryType
,
832 OUT EFI_PHYSICAL_ADDRESS
*Memory
837 Memory allocation service on the temporary memory.
840 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
841 @param Size Amount of memory required
842 @param Buffer Address of pointer to the buffer
844 @retval EFI_SUCCESS The allocation was successful
845 @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
846 to allocate the requested size.
852 IN CONST EFI_PEI_SERVICES
**PeiServices
,
859 Routine for load image file.
862 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
863 @param FileHandle Pointer to the FFS file header of the image.
864 @param PeimState The dispatch state of the input PEIM handle.
865 @param EntryPoint Pointer to entry point of specified image file for output.
866 @param AuthenticationState Pointer to attestation authentication state of image.
868 @retval EFI_SUCCESS Image is successfully loaded.
869 @retval EFI_NOT_FOUND Fail to locate necessary PPI
870 @retval Others Fail to load file.
875 IN CONST EFI_PEI_SERVICES
**PeiServices
,
876 IN EFI_PEI_FILE_HANDLE FileHandle
,
878 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
879 OUT UINT32
*AuthenticationState
884 Core version of the Status Code reporter
887 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
888 @param CodeType Type of Status Code.
889 @param Value Value to output for Status Code.
890 @param Instance Instance Number of this status code.
891 @param CallerId ID of the caller of this status code.
892 @param Data Optional data associated with this status code.
894 @retval EFI_SUCCESS if status code is successfully reported
895 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
900 PeiReportStatusCode (
901 IN CONST EFI_PEI_SERVICES
**PeiServices
,
902 IN EFI_STATUS_CODE_TYPE CodeType
,
903 IN EFI_STATUS_CODE_VALUE Value
,
905 IN CONST EFI_GUID
*CallerId
,
906 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
911 Core version of the Reset System
914 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
916 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.
917 @retval EFI_DEVICE_ERROR Did not reset system.
918 Otherwise, resets the system.
924 IN CONST EFI_PEI_SERVICES
**PeiServices
929 Initialize PeiCore Fv List.
932 @param PrivateData - Pointer to PEI_CORE_INSTANCE.
933 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
938 IN PEI_CORE_INSTANCE
*PrivateData
,
939 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
943 Process Firmware Volum Information once FvInfoPPI install.
945 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
946 @param NotifyDescriptor Address of the notification descriptor data structure.
947 @param Ppi Address of the PPI that was installed.
949 @retval EFI_SUCCESS if the interface could be successfully installed
954 FirmwareVolmeInfoPpiNotifyCallback (
955 IN EFI_PEI_SERVICES
**PeiServices
,
956 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
962 Given the input VolumeHandle, search for the next matching name file.
964 @param FileName File name to search.
965 @param VolumeHandle The current FV to search.
966 @param FileHandle Pointer to the file matching name in VolumeHandle.
967 NULL if file not found
969 @retval EFI_NOT_FOUND No files matching the search criteria were found
970 @retval EFI_SUCCESS Success to search given file
975 PeiFfsFindFileByName (
976 IN CONST EFI_GUID
*FileName
,
977 IN EFI_PEI_FV_HANDLE VolumeHandle
,
978 OUT EFI_PEI_FILE_HANDLE
*FileHandle
982 Returns information about a specific file.
984 @param FileHandle Handle of the file.
985 @param FileInfo Upon exit, points to the file's information.
987 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
988 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
989 @retval EFI_SUCCESS File information returned.
995 IN EFI_PEI_FILE_HANDLE FileHandle
,
996 OUT EFI_FV_FILE_INFO
*FileInfo
1000 Returns information about a specific file.
1002 @param FileHandle Handle of the file.
1003 @param FileInfo Upon exit, points to the file's information.
1005 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
1006 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.
1007 @retval EFI_SUCCESS File information returned.
1012 PeiFfsGetFileInfo2 (
1013 IN EFI_PEI_FILE_HANDLE FileHandle
,
1014 OUT EFI_FV_FILE_INFO2
*FileInfo
1018 Returns information about the specified volume.
1020 @param VolumeHandle Handle of the volume.
1021 @param VolumeInfo Upon exit, points to the volume's information.
1023 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.
1024 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.
1025 @retval EFI_SUCCESS Volume information returned.
1029 PeiFfsGetVolumeInfo (
1030 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1031 OUT EFI_FV_INFO
*VolumeInfo
1035 This routine enable a PEIM to register itself to shadow when PEI Foundation
1036 discovery permanent memory.
1038 @param FileHandle File handle of a PEIM.
1040 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1041 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1042 @retval EFI_SUCCESS Successfully to register itself.
1047 PeiRegisterForShadow (
1048 IN EFI_PEI_FILE_HANDLE FileHandle
1052 Initialize image service that install PeiLoadFilePpi.
1054 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.
1055 @param OldCoreData Pointer to Old PeiCore's private data.
1056 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.
1057 If not NULL, PeiCore is entered at second time, stack/heap has been moved
1058 to permenent memory.
1062 InitializeImageServices (
1063 IN PEI_CORE_INSTANCE
*PrivateData
,
1064 IN PEI_CORE_INSTANCE
*OldCoreData
1068 The wrapper function of PeiLoadImageLoadImage().
1070 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.
1071 @param FileHandle Pointer to the FFS file header of the image.
1072 @param ImageAddressArg Pointer to PE/TE image.
1073 @param ImageSizeArg Size of PE/TE image.
1074 @param EntryPoint Pointer to entry point of specified image file for output.
1075 @param AuthenticationState Pointer to attestation authentication state of image.
1077 @return Status of PeiLoadImageLoadImage().
1082 PeiLoadImageLoadImageWrapper (
1083 IN CONST EFI_PEI_LOAD_FILE_PPI
*This
,
1084 IN EFI_PEI_FILE_HANDLE FileHandle
,
1085 OUT EFI_PHYSICAL_ADDRESS
*ImageAddressArg
, OPTIONAL
1086 OUT UINT64
*ImageSizeArg
, OPTIONAL
1087 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1088 OUT UINT32
*AuthenticationState
1093 Provide a callback for when the security PPI is installed.
1095 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
1096 @param NotifyDescriptor The descriptor for the notification event.
1097 @param Ppi Pointer to the PPI in question.
1099 @return Always success
1104 SecurityPpiNotifyCallback (
1105 IN EFI_PEI_SERVICES
**PeiServices
,
1106 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1111 Get Fv image from the FV type file, then install FV INFO(2) ppi, Build FV hob.
1113 @param PrivateData PeiCore's private data structure
1114 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.
1115 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.
1117 @retval EFI_NOT_FOUND FV image can't be found.
1118 @retval EFI_SUCCESS Successfully to process it.
1119 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image
1120 @retval EFI_SECURITY_VIOLATION Image is illegal
1121 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section
1126 IN PEI_CORE_INSTANCE
*PrivateData
,
1127 IN PEI_CORE_FV_HANDLE
*ParentFvCoreHandle
,
1128 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle
1132 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.
1134 This routine also will install FvInfo ppi for FV hob in PI ways.
1136 @param Private Pointer of PEI_CORE_INSTANCE
1137 @param Instance The index of FV want to be searched.
1139 @return Instance of PEI_CORE_FV_HANDLE.
1141 PEI_CORE_FV_HANDLE
*
1142 FindNextCoreFvHandle (
1143 IN PEI_CORE_INSTANCE
*Private
,
1148 // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1152 Memory-based read services.
1154 This function is to perform the Memory Access Read service based on installed
1155 instance of the EFI_PEI_CPU_IO_PPI.
1156 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1157 return EFI_NOT_YET_AVAILABLE.
1159 @param PeiServices An indirect pointer to the PEI Services Table
1160 published by the PEI Foundation.
1161 @param This Pointer to local data for the interface.
1162 @param Width The width of the access. Enumerated in bytes.
1163 @param Address The physical address of the access.
1164 @param Count The number of accesses to perform.
1165 @param Buffer A pointer to the buffer of data.
1167 @retval EFI_SUCCESS The function completed successfully.
1168 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1173 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1174 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1175 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1182 Memory-based write services.
1184 This function is to perform the Memory Access Write service based on installed
1185 instance of the EFI_PEI_CPU_IO_PPI.
1186 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1187 return EFI_NOT_YET_AVAILABLE.
1189 @param PeiServices An indirect pointer to the PEI Services Table
1190 published by the PEI Foundation.
1191 @param This Pointer to local data for the interface.
1192 @param Width The width of the access. Enumerated in bytes.
1193 @param Address The physical address of the access.
1194 @param Count The number of accesses to perform.
1195 @param Buffer A pointer to the buffer of data.
1197 @retval EFI_SUCCESS The function completed successfully.
1198 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1202 PeiDefaultMemWrite (
1203 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1204 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1205 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1212 IO-based read services.
1214 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.
1215 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1216 return EFI_NOT_YET_AVAILABLE.
1218 @param PeiServices An indirect pointer to the PEI Services Table
1219 published by the PEI Foundation.
1220 @param This Pointer to local data for the interface.
1221 @param Width The width of the access. Enumerated in bytes.
1222 @param Address The physical address of the access.
1223 @param Count The number of accesses to perform.
1224 @param Buffer A pointer to the buffer of data.
1226 @retval EFI_SUCCESS The function completed successfully.
1227 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1232 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1233 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1234 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1241 IO-based write services.
1243 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.
1244 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1245 return EFI_NOT_YET_AVAILABLE.
1247 @param PeiServices An indirect pointer to the PEI Services Table
1248 published by the PEI Foundation.
1249 @param This Pointer to local data for the interface.
1250 @param Width The width of the access. Enumerated in bytes.
1251 @param Address The physical address of the access.
1252 @param Count The number of accesses to perform.
1253 @param Buffer A pointer to the buffer of data.
1255 @retval EFI_SUCCESS The function completed successfully.
1256 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.
1261 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1262 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1263 IN EFI_PEI_CPU_IO_PPI_WIDTH Width
,
1270 8-bit I/O read operations.
1272 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1275 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1276 @param This Pointer to local data for the interface.
1277 @param Address The physical address of the access.
1279 @return An 8-bit value returned from the I/O space.
1284 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1285 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1290 Reads an 16-bit I/O port.
1292 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1295 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1296 @param This Pointer to local data for the interface.
1297 @param Address The physical address of the access.
1299 @return A 16-bit value returned from the I/O space.
1303 PeiDefaultIoRead16 (
1304 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1305 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1310 Reads an 32-bit I/O port.
1312 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1315 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1316 @param This Pointer to local data for the interface.
1317 @param Address The physical address of the access.
1319 @return A 32-bit value returned from the I/O space.
1323 PeiDefaultIoRead32 (
1324 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1325 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1330 Reads an 64-bit I/O port.
1332 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
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.
1339 @return A 64-bit value returned from the I/O space.
1343 PeiDefaultIoRead64 (
1344 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1345 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1350 8-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 PeiDefaultIoWrite8 (
1360 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1361 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1367 16-bit I/O write operations.
1369 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1370 @param This Pointer to local data for the interface.
1371 @param Address The physical address of the access.
1372 @param Data The data to write.
1376 PeiDefaultIoWrite16 (
1377 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1378 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1384 32-bit I/O write operations.
1386 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1387 @param This Pointer to local data for the interface.
1388 @param Address The physical address of the access.
1389 @param Data The data to write.
1393 PeiDefaultIoWrite32 (
1394 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1395 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1401 64-bit I/O write operations.
1403 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1404 @param This Pointer to local data for the interface.
1405 @param Address The physical address of the access.
1406 @param Data The data to write.
1410 PeiDefaultIoWrite64 (
1411 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1412 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1418 8-bit memory read operations.
1420 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1423 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1424 @param This Pointer to local data for the interface.
1425 @param Address The physical address of the access.
1427 @return An 8-bit value returned from the memory space.
1432 PeiDefaultMemRead8 (
1433 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1434 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1439 16-bit memory read operations.
1441 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1444 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1445 @param This Pointer to local data for the interface.
1446 @param Address The physical address of the access.
1448 @return An 16-bit value returned from the memory space.
1453 PeiDefaultMemRead16 (
1454 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1455 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1460 32-bit memory read operations.
1462 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1465 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1466 @param This Pointer to local data for the interface.
1467 @param Address The physical address of the access.
1469 @return An 32-bit value returned from the memory space.
1474 PeiDefaultMemRead32 (
1475 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1476 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1481 64-bit memory read operations.
1483 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then
1486 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1487 @param This Pointer to local data for the interface.
1488 @param Address The physical address of the access.
1490 @return An 64-bit value returned from the memory space.
1495 PeiDefaultMemRead64 (
1496 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1497 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1502 8-bit memory write operations.
1504 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1505 @param This Pointer to local data for the interface.
1506 @param Address The physical address of the access.
1507 @param Data The data to write.
1512 PeiDefaultMemWrite8 (
1513 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1514 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1520 16-bit memory write operations.
1522 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1523 @param This Pointer to local data for the interface.
1524 @param Address The physical address of the access.
1525 @param Data The data to write.
1530 PeiDefaultMemWrite16 (
1531 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1532 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1538 32-bit memory write operations.
1540 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1541 @param This Pointer to local data for the interface.
1542 @param Address The physical address of the access.
1543 @param Data The data to write.
1548 PeiDefaultMemWrite32 (
1549 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1550 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1556 64-bit memory write operations.
1558 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1559 @param This Pointer to local data for the interface.
1560 @param Address The physical address of the access.
1561 @param Data The data to write.
1566 PeiDefaultMemWrite64 (
1567 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1568 IN CONST EFI_PEI_CPU_IO_PPI
*This
,
1573 extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi
;
1576 // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.
1580 Reads from a given location in the PCI configuration space.
1582 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1583 return EFI_NOT_YET_AVAILABLE.
1585 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1586 @param This Pointer to local data for the interface.
1587 @param Width The width of the access. Enumerated in bytes.
1588 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1589 @param Address The physical address of the access. The format of
1590 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1591 @param Buffer A pointer to the buffer of data.
1593 @retval EFI_SUCCESS The function completed successfully.
1594 @retval EFI_INVALID_PARAMETER The invalid access width.
1595 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1600 PeiDefaultPciCfg2Read (
1601 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1602 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1603 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1609 Write to a given location in the PCI configuration space.
1611 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then
1612 return EFI_NOT_YET_AVAILABLE.
1614 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.
1615 @param This Pointer to local data for the interface.
1616 @param Width The width of the access. Enumerated in bytes.
1617 See EFI_PEI_PCI_CFG_PPI_WIDTH above.
1618 @param Address The physical address of the access. The format of
1619 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.
1620 @param Buffer A pointer to the buffer of data.
1622 @retval EFI_SUCCESS The function completed successfully.
1623 @retval EFI_INVALID_PARAMETER The invalid access width.
1624 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1628 PeiDefaultPciCfg2Write (
1629 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1630 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1631 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1637 This function performs a read-modify-write operation on the contents from a given
1638 location in the PCI configuration space.
1640 @param PeiServices An indirect pointer to the PEI Services Table
1641 published by the PEI Foundation.
1642 @param This Pointer to local data for the interface.
1643 @param Width The width of the access. Enumerated in bytes. Type
1644 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().
1645 @param Address The physical address of the access.
1646 @param SetBits Points to value to bitwise-OR with the read configuration value.
1647 The size of the value is determined by Width.
1648 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.
1649 The size of the value is determined by Width.
1651 @retval EFI_SUCCESS The function completed successfully.
1652 @retval EFI_INVALID_PARAMETER The invalid access width.
1653 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.
1657 PeiDefaultPciCfg2Modify (
1658 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1659 IN CONST EFI_PEI_PCI_CFG2_PPI
*This
,
1660 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width
,
1666 extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi
;
1669 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should
1670 be re-installed with the instance in permanent memory and all cached FvPpi pointers in
1671 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant
1674 @param PrivateData Pointer to PEI_CORE_INSTANCE.
1678 IN PEI_CORE_INSTANCE
*PrivateData