3 Copyright (c) 2006 - 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 Definition of Pei Core Structures and Services
28 #include <Ppi/DxeIpl.h>
29 #include <Ppi/MemoryDiscovered.h>
30 #include <Ppi/StatusCode.h>
31 #include <Ppi/Reset.h>
32 #include <Ppi/FirmwareVolume.h>
33 #include <Ppi/FirmwareVolumeInfo.h>
34 #include <Ppi/Decompress.h>
35 #include <Ppi/GuidedSectionExtraction.h>
36 #include <Ppi/LoadFile.h>
37 #include <Ppi/Security2.h>
38 #include <Ppi/TemporaryRamSupport.h>
39 #include <Library/DebugLib.h>
40 #include <Library/PeiCoreEntryPoint.h>
41 #include <Library/BaseLib.h>
42 #include <Library/HobLib.h>
43 #include <Library/PerformanceLib.h>
44 #include <Library/PeiServicesLib.h>
45 #include <Library/ReportStatusCodeLib.h>
46 #include <Library/PeCoffLib.h>
47 #include <Library/PeCoffGetEntryPointLib.h>
48 #include <Library/BaseMemoryLib.h>
49 #include <Library/CacheMaintenanceLib.h>
50 #include <Library/TimerLib.h>
51 #include <Library/PcdLib.h>
52 #include <IndustryStandard/PeImage.h>
53 #include <Library/PeiServicesTablePointerLib.h>
54 #include <Library/MemoryAllocationLib.h>
55 #include <Library/PeiPiLib.h>
56 #include <Guid/FirmwareFileSystem2.h>
57 #include <Guid/AprioriFileName.h>
59 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
62 // Pei Core private data structures
65 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
66 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
68 } PEI_PPI_LIST_POINTERS
;
74 INTN LastDispatchedInstall
;
75 INTN LastDispatchedNotify
;
76 PEI_PPI_LIST_POINTERS PpiListPtrs
[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported
)];
81 // PEI_CORE_FV_HANDE.PeimState
82 // Do not change these values as there is code doing math to change states.
83 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
85 #define PEIM_STATE_NOT_DISPATCHED 0x00
86 #define PEIM_STATE_DISPATCHED 0x01
87 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
88 #define PEIM_STATE_DONE 0x03
91 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
92 UINT8 PeimState
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
93 EFI_PEI_FILE_HANDLE FvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
97 #define CACHE_SETION_MAX_NUMBER 0x10
99 EFI_COMMON_SECTION_HEADER
* Section
[CACHE_SETION_MAX_NUMBER
];
100 VOID
* SectionData
[CACHE_SETION_MAX_NUMBER
];
101 UINTN SectionSize
[CACHE_SETION_MAX_NUMBER
];
102 UINTN AllSectionCount
;
104 } CACHE_SECTION_DATA
;
107 // Pei Core private data structure instance
110 #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')
114 EFI_PEI_SERVICES
*PS
; // Point to ServiceTableShadow
115 PEI_PPI_DATABASE PpiData
;
117 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
118 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
120 UINTN CurrentPeimFvCount
;
121 UINTN CurrentPeimCount
;
122 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
124 EFI_PEI_FV_HANDLE AllFv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
125 EFI_PEI_HOB_POINTERS HobList
;
126 BOOLEAN SwitchStackSignal
;
127 BOOLEAN PeiMemoryInstalled
;
128 EFI_PHYSICAL_ADDRESS StackBase
;
130 VOID
*BottomOfCarHeap
;
133 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
134 EFI_PEI_SERVICES ServiceTableShadow
;
135 UINTN SizeOfTemporaryMemory
;
136 UINTN SizeOfCacheAsRam
;
137 VOID
*MaxTopOfCarHeap
;
138 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
139 EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin
;
140 UINT64 PhysicalMemoryLength
;
141 EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop
;
142 VOID
* ShadowedPeiCore
;
143 CACHE_SECTION_DATA CacheSection
;
147 // Pei Core Instance Data Macros
150 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
151 CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)
154 // BUGBUG: Where does this go really?
158 (EFIAPI
*PEI_CORE_ENTRY_POINT
)(
159 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
160 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
161 IN PEI_CORE_INSTANCE
*OldCoreData
165 // Union of temporarily used function pointers (to save stack space)
168 PEI_CORE_ENTRY_POINT PeiCore
;
169 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
170 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
171 EFI_DXE_IPL_PPI
*DxeIpl
;
172 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
173 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
175 } PEI_CORE_TEMP_POINTERS
;
180 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
181 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
183 } PEI_CORE_PARAMETERS
;
191 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
192 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpList
,
199 The entry routine to Pei Core, invoked by PeiMain during transition
200 from SEC to PEI. After switching stack in the PEI core, it will restart
201 with the old core data.
205 PeiStartupDescriptor - Information and services provided by SEC phase.
206 OldCoreData - Pointer to old core data that is used to initialize the
211 This function never returns
212 EFI_NOT_FOUND - Never reach
218 // Dispatcher support functions
222 PeimDispatchReadiness (
223 IN EFI_PEI_SERVICES
**PeiServices
,
224 IN VOID
*DependencyExpression
230 This is the POSTFIX version of the dependency evaluator. When a
231 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
232 the evaluation stack. When that entry is poped from the evaluation
233 stack, the PPI is checked if it is installed. This method allows
234 some time savings as not all PPIs must be checked for certain
235 operation types (AND, OR).
239 PeiServices - Calling context.
241 DependencyExpression - Pointer to a dependency expression. The Grammar adheres to
242 the BNF described above and is stored in postfix notation.
246 Status = EFI_SUCCESS if it is a well-formed Grammar
247 EFI_INVALID_PARAMETER if the dependency expression overflows
249 EFI_INVALID_PARAMETER if the dependency expression underflows
251 EFI_INVALID_PARAMETER if the dependency expression is not a
259 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
260 IN PEI_CORE_INSTANCE
*PrivateData
267 Conduct PEIM dispatch.
271 PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
272 PrivateData - Pointer to the private data passed in from caller
273 DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
277 EFI_SUCCESS - Successfully dispatched PEIM.
278 EFI_NOT_FOUND - The dispatch failed.
285 InitializeDispatcherData (
286 IN PEI_CORE_INSTANCE
*PrivateData
,
287 IN PEI_CORE_INSTANCE
*OldCoreData
,
288 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
294 Initialize the Dispatcher's data members
298 PeiServices - The PEI core services table.
299 OldCoreData - Pointer to old core data (before switching stack).
300 NULL if being run in non-permament memory mode.
301 PeiStartupDescriptor - Information and services provided by SEC phase.
314 IN EFI_PEI_SERVICES
**PeiServices
,
315 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
316 IN OUT EFI_FFS_FILE_HEADER
**PeimFileHeader
321 Given the input file pointer, search for the next matching file in the
322 FFS volume. The search starts from FileHeader inside
323 the Firmware Volume defined by FwVolHeader.
326 PeiServices - Pointer to the PEI Core Services Table.
328 FwVolHeader - Pointer to the FV header of the volume to search.
329 This parameter must point to a valid FFS volume.
331 PeimFileHeader - Pointer to the current file from which to begin searching.
332 This pointer will be updated upon return to reflect the file found.
335 EFI_NOT_FOUND - No files matching the search criteria were found
343 IN UINT8 CurrentPeim
,
344 IN UINT32 DispatchedPeimBitMap
350 This routine checks to see if a particular PEIM has been dispatched during
351 the PEI core dispatch.
354 CurrentPeim - The PEIM/FV in the bit array to check.
355 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
358 TRUE if PEIM already dispatched
366 IN EFI_PEI_SERVICES
**PeiServices
,
367 IN UINT8 CurrentPeim
,
368 OUT UINT32
*DispatchedPeimBitMap
374 This routine sets a PEIM as having been dispatched once its entry
375 point has been invoked.
379 PeiServices - The PEI core services table.
380 CurrentPeim - The PEIM/FV in the bit array to check.
381 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
391 IN PEI_CORE_INSTANCE
*Private
,
392 IN EFI_PEI_FILE_HANDLE FileHandle
,
399 This routine parses the Dependency Expression, if available, and
400 decides if the module can be executed.
403 PeiServices - The PEI Service Table
404 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
407 TRUE - Can be dispatched
408 FALSE - Cannot be dispatched
414 // PPI support functions
417 InitializePpiServices (
418 IN PEI_CORE_INSTANCE
*PrivateData
,
419 IN PEI_CORE_INSTANCE
*OldCoreData
425 Initialize PPI services.
429 PeiServices - The PEI core services table.
430 OldCoreData - Pointer to the PEI Core data.
431 NULL if being run in non-permament memory mode.
441 IN CONST EFI_PEI_SERVICES
**PeiServices
,
442 IN UINTN OldCheckingBottom
,
443 IN UINTN OldCheckingTop
,
444 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
450 Migrate the Hob list from the CAR stack to PEI installed memory.
454 PeiServices - The PEI core services table.
455 OldCheckingBottom - The old checking bottom.
456 OldCheckingTop - The old checking top.
457 NewHandOffHob - The new handoff HOB list.
467 IN CONST EFI_PEI_SERVICES
**PeiServices
,
468 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
474 Install PPI services.
478 PeiServices - Pointer to the PEI Service Table
479 PpiList - Pointer to a list of PEI PPI Descriptors.
483 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
484 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
485 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
486 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
494 IN CONST EFI_PEI_SERVICES
**PeiServices
,
495 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
496 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
502 Re-Install PPI services.
506 PeiServices - Pointer to the PEI Service Table
507 OldPpi - Pointer to the old PEI PPI Descriptors.
508 NewPpi - Pointer to the new PEI PPI Descriptors.
512 EFI_SUCCESS - if the operation was successful
513 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
514 EFI_INVALID_PARAMETER - if NewPpi is not valid
515 EFI_NOT_FOUND - if the PPI was not in the database
523 IN CONST EFI_PEI_SERVICES
**PeiServices
,
524 IN CONST EFI_GUID
*Guid
,
526 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
533 Locate a given named PPI.
537 PeiServices - Pointer to the PEI Service Table
538 Guid - Pointer to GUID of the PPI.
539 Instance - Instance Number to discover.
540 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
541 returns a pointer to the descriptor (includes flags, etc)
542 Ppi - Pointer to reference the found PPI
546 Status - EFI_SUCCESS if the PPI is in the database
547 EFI_NOT_FOUND if the PPI is not in the database
554 IN CONST EFI_PEI_SERVICES
**PeiServices
,
555 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
561 Install a notification for a given PPI.
565 PeiServices - Pointer to the PEI Service Table
566 NotifyList - Pointer to list of Descriptors to notify upon.
570 Status - EFI_SUCCESS if successful
571 EFI_OUT_OF_RESOURCES if no space in the database
572 EFI_INVALID_PARAMETER if not a good decriptor
579 IN PEI_CORE_INSTANCE
*PrivateData
585 Process the Notify List at dispatch level.
589 PeiServices - Pointer to the PEI Service Table
598 IN PEI_CORE_INSTANCE
*PrivateData
,
600 IN INTN InstallStartIndex
,
601 IN INTN InstallStopIndex
,
602 IN INTN NotifyStartIndex
,
603 IN INTN NotifyStopIndex
609 Dispatch notifications.
613 PeiServices - Pointer to the PEI Service Table
614 NotifyType - Type of notify to fire.
615 InstallStartIndex - Install Beginning index.
616 InstallStopIndex - Install Ending index.
617 NotifyStartIndex - Notify Beginning index.
618 NotifyStopIndex - Notify Ending index.
626 // Boot mode support functions
631 IN CONST EFI_PEI_SERVICES
**PeiServices
,
632 IN OUT EFI_BOOT_MODE
*BootMode
638 This service enables PEIMs to ascertain the present value of the boot mode.
642 PeiServices - The PEI core services table.
643 BootMode - A pointer to contain the value of the boot mode.
647 EFI_SUCCESS - The boot mode was returned successfully.
648 EFI_INVALID_PARAMETER - BootMode is NULL.
656 IN CONST EFI_PEI_SERVICES
**PeiServices
,
657 IN EFI_BOOT_MODE BootMode
663 This service enables PEIMs to update the boot mode variable.
667 PeiServices - The PEI core services table.
668 BootMode - The value of the boot mode to set.
672 EFI_SUCCESS - The value was successfully updated
678 // Security support functions
681 InitializeSecurityServices (
682 IN EFI_PEI_SERVICES
**PeiServices
,
683 IN PEI_CORE_INSTANCE
*OldCoreData
689 Initialize the security services.
693 PeiServices - The PEI core services table.
694 OldCoreData - Pointer to the old core data.
695 NULL if being run in non-permament memory mode.
705 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
711 Provide a callout to the OEM FV verification service.
715 CurrentFvAddress - Pointer to the FV under investigation.
727 IN PEI_CORE_INSTANCE
*PrivateData
,
728 IN EFI_PEI_FV_HANDLE VolumeHandle
,
729 IN EFI_PEI_FILE_HANDLE FileHandle
735 Provide a callout to the security verification service.
739 PeiServices - The PEI core services table.
740 CurrentPeimAddress - Pointer to the Firmware File under investigation.
744 EFI_SUCCESS - Image is OK
745 EFI_SECURITY_VIOLATION - Image is illegal
754 IN CONST EFI_PEI_SERVICES
**PeiServices
,
755 IN OUT VOID
**HobList
761 Gets the pointer to the HOB List.
765 PeiServices - The PEI core services table.
766 HobList - Pointer to the HOB List.
770 EFI_SUCCESS - Get the pointer of HOB List
771 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
772 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
780 IN CONST EFI_PEI_SERVICES
**PeiServices
,
789 Add a new HOB to the HOB List.
793 PeiServices - The PEI core services table.
794 Type - Type of the new HOB.
795 Length - Length of the new HOB to allocate.
796 Hob - Pointer to the new HOB.
801 - EFI_INVALID_PARAMETER if Hob is NULL
802 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
803 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
809 PeiCoreBuildHobHandoffInfoTable (
810 IN EFI_BOOT_MODE BootMode
,
811 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
812 IN UINT64 MemoryLength
818 Builds a Handoff Information Table HOB
822 BootMode - Current Bootmode
823 MemoryBegin - Start Memory Address.
824 MemoryLength - Length of Memory.
835 // FFS Fw Volume support functions
840 IN CONST EFI_PEI_SERVICES
**PeiServices
,
842 IN EFI_PEI_FV_HANDLE FwVolHeader
,
843 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
848 Given the input file pointer, search for the next matching file in the
849 FFS volume as defined by SearchType. The search starts from FileHeader inside
850 the Firmware Volume defined by FwVolHeader.
853 PeiServices - Pointer to the PEI Core Services Table.
855 SearchType - Filter to find only files of this type.
856 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
858 FwVolHeader - Pointer to the FV header of the volume to search.
859 This parameter must point to a valid FFS volume.
861 FileHeader - Pointer to the current file from which to begin searching.
862 This pointer will be updated upon return to reflect the file found.
865 EFI_NOT_FOUND - No files matching the search criteria were found
873 PeiFfsFindSectionData (
874 IN CONST EFI_PEI_SERVICES
**PeiServices
,
875 IN EFI_SECTION_TYPE SectionType
,
876 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
877 IN OUT VOID
**SectionData
882 Given the input file pointer, search for the next matching section in the
886 PeiServices - Pointer to the PEI Core Services Table.
887 SearchType - Filter to find only sections of this type.
888 FfsFileHeader - Pointer to the current file to search.
889 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
890 - NULL if section not found
893 EFI_NOT_FOUND - No files matching the search criteria were found
901 PeiFvFindNextVolume (
902 IN CONST EFI_PEI_SERVICES
**PeiServices
,
904 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
910 Return the BFV location
912 BugBug -- Move this to the location of this code to where the
913 other FV and FFS support code lives.
914 Also, update to use FindFV for instances #'s >= 1.
918 PeiServices - The PEI core services table.
919 Instance - Instance of FV to find
920 FwVolHeader - Pointer to contain the data to return
923 Pointer to the Firmware Volume instance requested
925 EFI_INVALID_PARAMETER - FwVolHeader is NULL
927 EFI_SUCCESS - Firmware volume instance successfully found.
933 // Memory support functions
936 InitializeMemoryServices (
937 IN PEI_CORE_INSTANCE
*PrivateData
,
938 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
939 IN PEI_CORE_INSTANCE
*OldCoreData
945 Initialize the memory services.
949 PeiServices - The PEI core services table.
950 PeiStartupDescriptor - Information and services provided by SEC phase.
951 OldCoreData - Pointer to the PEI Core data.
952 NULL if being run in non-permament memory mode.
963 PeiInstallPeiMemory (
964 IN CONST EFI_PEI_SERVICES
**PeiServices
,
965 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
966 IN UINT64 MemoryLength
972 Install the permanent memory is now available.
973 Creates HOB (PHIT and Stack).
977 PeiServices - The PEI core services table.
978 MemoryBegin - Start of memory address.
979 MemoryLength - Length of memory.
991 IN CONST EFI_PEI_SERVICES
**PeiServices
,
992 IN EFI_MEMORY_TYPE MemoryType
,
994 OUT EFI_PHYSICAL_ADDRESS
*Memory
1000 Memory allocation service on permanent memory,
1001 not usable prior to the memory installation.
1005 PeiServices - The PEI core services table.
1006 Type - Type of allocation.
1007 MemoryType - Type of memory to allocate.
1008 Pages - Number of pages to allocate.
1009 Memory - Pointer of memory allocated.
1013 Status - EFI_SUCCESS The allocation was successful
1014 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1015 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1016 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1017 to allocate the number of pages.
1025 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1031 Routine Description:
1033 Memory allocation service on the CAR.
1037 PeiServices - The PEI core services table.
1039 Size - Amount of memory required
1041 Buffer - Address of pointer to the buffer
1045 Status - EFI_SUCCESS The allocation was successful
1046 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1047 to allocate the requested size.
1054 IN EFI_PEI_SERVICES
**PeiServices
,
1055 IN EFI_PEI_FILE_HANDLE FileHandle
,
1056 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1057 OUT UINT32
*AuthenticationState
1061 Routine Description:
1063 Get entry point of a Peim file.
1067 PeiServices - Calling context.
1069 PeimFileHeader - Peim file's header.
1071 EntryPoint - Entry point of that Peim file.
1083 PeiReportStatusCode (
1084 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1085 IN EFI_STATUS_CODE_TYPE CodeType
,
1086 IN EFI_STATUS_CODE_VALUE Value
,
1088 IN CONST EFI_GUID
*CallerId
,
1089 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1093 Routine Description:
1095 Core version of the Status Code reporter
1099 PeiServices - The PEI core services table.
1101 CodeType - Type of Status Code.
1103 Value - Value to output for Status Code.
1105 Instance - Instance Number of this status code.
1107 CallerId - ID of the caller of this status code.
1109 Data - Optional data associated with this status code.
1113 Status - EFI_SUCCESS if status code is successfully reported
1114 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1123 IN CONST EFI_PEI_SERVICES
**PeiServices
1127 Routine Description:
1129 Core version of the Reset System
1133 PeiServices - The PEI core services table.
1137 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1138 - EFI_DEVICE_ERROR. Did not reset system.
1140 Otherwise, resets the system.
1147 IN PEI_CORE_INSTANCE
*PrivateData
,
1148 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1152 Routine Description:
1154 Initialize PeiCore Fv List.
1157 PrivateData - Pointer to PEI_CORE_INSTANCE.
1158 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1168 FirmwareVolmeInfoPpiNotifyCallback (
1169 IN EFI_PEI_SERVICES
**PeiServices
,
1170 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1175 Routine Description:
1177 Process Firmware Volum Information once FvInfoPPI install.
1181 PeiServices - General purpose services available to every PEIM.
1185 Status - EFI_SUCCESS if the interface could be successfully
1194 PeiFfsFindFileByName (
1195 IN CONST EFI_GUID
*FileName
,
1196 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1197 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1201 Routine Description:
1203 Given the input VolumeHandle, search for the next matching name file.
1207 FileName - File name to search.
1208 VolumeHandle - The current FV to search.
1209 FileHandle - Pointer to the file matching name in VolumeHandle.
1210 - NULL if file not found
1221 IN EFI_PEI_FILE_HANDLE FileHandle
,
1222 OUT EFI_FV_FILE_INFO
*FileInfo
1226 Routine Description:
1228 Collect information of given file.
1231 FileHandle - The handle to file.
1232 FileInfo - Pointer to the file information.
1242 PeiFfsGetVolumeInfo (
1243 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1244 OUT EFI_FV_INFO
*VolumeInfo
1248 Routine Description:
1250 Collect information of given Fv Volume.
1253 VolumeHandle - The handle to Fv Volume.
1254 VolumeInfo - The pointer to volume information.
1265 PeiRegisterForShadow (
1266 IN EFI_PEI_FILE_HANDLE FileHandle
1270 Routine Description:
1272 This routine enable a PEIM to register itself to shadow when PEI Foundation
1273 discovery permanent memory.
1276 FileHandle - File handle of a PEIM.
1279 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1280 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1281 EFI_SUCCESS - Successfully to register itself.
1288 This routine enable a PEIM to register itself to shadow when PEI Foundation
1289 discovery permanent memory.
1291 @param FileHandle File handle of a PEIM.
1293 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1294 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1295 @retval EFI_SUCCESS Successfully to register itself.
1300 PeiRegisterForShadow (
1301 IN EFI_PEI_FILE_HANDLE FileHandle
1307 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1308 IN CONST EFI_GUID
*FileName
, OPTIONAL
1309 IN EFI_FV_FILETYPE SearchType
,
1310 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1311 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1315 Routine Description:
1316 Given the input file pointer, search for the next matching file in the
1317 FFS volume as defined by SearchType. The search starts from FileHeader inside
1318 the Firmware Volume defined by FwVolHeader.
1321 PeiServices - Pointer to the PEI Core Services Table.
1322 SearchType - Filter to find only files of this type.
1323 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1324 FwVolHeader - Pointer to the FV header of the volume to search.
1325 This parameter must point to a valid FFS volume.
1326 FileHeader - Pointer to the current file from which to begin searching.
1327 This pointer will be updated upon return to reflect the file found.
1328 Flag - Indicator for if this is for PEI Dispath search
1331 EFI_NOT_FOUND - No files matching the search criteria were found
1338 InitializeImageServices (
1339 IN PEI_CORE_INSTANCE
*PrivateData
,
1340 IN PEI_CORE_INSTANCE
*OldCoreData
1344 Routine Description:
1346 Install Pei Load File PPI.
1350 PrivateData - Pointer to PEI_CORE_INSTANCE.
1351 OldCoreData - Pointer to PEI_CORE_INSTANCE.
1361 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.
1363 @param PeiServices Pointer to the PEI Core Services Table.
1364 @param FileHandle File handle of a Fv type file.
1365 @param AuthenticationState Pointer to attestation authentication state of image.
1368 @retval EFI_NOT_FOUND FV image can't be found.
1369 @retval EFI_SUCCESS Successfully to process it.
1374 IN EFI_PEI_SERVICES
**PeiServices
,
1375 IN EFI_PEI_FILE_HANDLE FvFileHandle
,
1376 OUT UINT32
*AuthenticationState