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 <FrameworkPei.h>
29 #include <Guid/StatusCodeDataTypeId.h>
30 #include <Ppi/DxeIpl.h>
31 #include <Ppi/MemoryDiscovered.h>
32 #include <Ppi/StatusCode.h>
33 #include <Ppi/Reset.h>
34 #include <Ppi/FirmwareVolume.h>
35 #include <Ppi/FirmwareVolumeInfo.h>
36 #include <Ppi/Decompress.h>
37 #include <Ppi/GuidedSectionExtraction.h>
38 #include <Ppi/LoadFile.h>
39 #include <Ppi/Security2.h>
40 #include <Library/DebugLib.h>
41 #include <Library/PeiCoreEntryPoint.h>
42 #include <Library/BaseLib.h>
43 #include <Library/HobLib.h>
44 #include <Library/PerformanceLib.h>
45 #include <Library/PeiServicesLib.h>
46 #include <Library/ReportStatusCodeLib.h>
47 #include <Library/PeCoffLib.h>
48 #include <Library/PeCoffGetEntryPointLib.h>
49 #include <Library/BaseMemoryLib.h>
50 #include <Library/CacheMaintenanceLib.h>
51 #include <Library/TimerLib.h>
52 #include <Library/PcdLib.h>
53 #include <IndustryStandard/PeImage.h>
54 #include <Library/PeiServicesTablePointerLib.h>
55 #include <Library/MemoryAllocationLib.h>
56 #include <Library/PeiPiLib.h>
57 #include <Guid/FirmwareFileSystem2.h>
58 #include <Guid/AprioriFileName.h>
60 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
63 // Pei Core private data structures
66 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
67 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
69 } PEI_PPI_LIST_POINTERS
;
71 #define PEI_STACK_SIZE 0x20000
73 #define MAX_PPI_DESCRIPTORS 64
79 INTN LastDispatchedInstall
;
80 INTN LastDispatchedNotify
;
81 PEI_PPI_LIST_POINTERS PpiListPtrs
[MAX_PPI_DESCRIPTORS
];
86 // PEI_CORE_FV_HANDE.PeimState
87 // Do not change these values as there is code doing math to change states.
88 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
90 #define PEIM_STATE_NOT_DISPATCHED 0x00
91 #define PEIM_STATE_DISPATCHED 0x01
92 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
93 #define PEIM_STATE_DONE 0x03
96 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
97 UINT8 PeimState
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
98 EFI_PEI_FILE_HANDLE FvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
100 } PEI_CORE_FV_HANDLE
;
102 #define CACHE_SETION_MAX_NUMBER 0x10
104 EFI_COMMON_SECTION_HEADER
* Section
[CACHE_SETION_MAX_NUMBER
];
105 VOID
* SectionData
[CACHE_SETION_MAX_NUMBER
];
106 UINTN SectionSize
[CACHE_SETION_MAX_NUMBER
];
107 UINTN AllSectionCount
;
109 } CACHE_SECTION_DATA
;
112 // Pei Core private data structure instance
115 #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')
119 EFI_PEI_SERVICES
*PS
; // Point to ServiceTableShadow
120 PEI_PPI_DATABASE PpiData
;
122 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
123 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
125 UINTN CurrentPeimFvCount
;
126 UINTN CurrentPeimCount
;
127 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
129 EFI_PEI_FV_HANDLE AllFv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
130 EFI_PEI_HOB_POINTERS HobList
;
131 BOOLEAN SwitchStackSignal
;
132 BOOLEAN PeiMemoryInstalled
;
133 EFI_PHYSICAL_ADDRESS StackBase
;
135 VOID
*BottomOfCarHeap
;
138 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
139 EFI_PEI_SERVICES ServiceTableShadow
;
140 UINTN SizeOfCacheAsRam
;
141 VOID
*MaxTopOfCarHeap
;
142 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
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 UINT8 CurrentPeim
,
315 IN UINT32 DispatchedPeimBitMap
321 This routine checks to see if a particular PEIM has been dispatched during
322 the PEI core dispatch.
325 CurrentPeim - The PEIM/FV in the bit array to check.
326 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
329 TRUE if PEIM already dispatched
337 IN EFI_PEI_SERVICES
**PeiServices
,
338 IN UINT8 CurrentPeim
,
339 OUT UINT32
*DispatchedPeimBitMap
345 This routine sets a PEIM as having been dispatched once its entry
346 point has been invoked.
350 PeiServices - The PEI core services table.
351 CurrentPeim - The PEIM/FV in the bit array to check.
352 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
362 IN PEI_CORE_INSTANCE
*Private
,
363 IN EFI_PEI_FILE_HANDLE FileHandle
,
370 This routine parses the Dependency Expression, if available, and
371 decides if the module can be executed.
374 PeiServices - The PEI Service Table
375 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
378 TRUE - Can be dispatched
379 FALSE - Cannot be dispatched
384 #if defined (MDE_CPU_IPF)
386 // In Ipf we should make special changes for the PHIT pointers to support
387 // recovery boot in cache mode.
389 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
390 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
393 IN PEI_CORE_INSTANCE
*CoreData
399 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
403 CoreData - The PEI core Private Data
412 #define SWITCH_TO_CACHE_MODE(CoreData)
417 // PPI support functions
420 InitializePpiServices (
421 IN PEI_CORE_INSTANCE
*PrivateData
,
422 IN PEI_CORE_INSTANCE
*OldCoreData
428 Initialize PPI services.
432 PeiServices - The PEI core services table.
433 OldCoreData - Pointer to the PEI Core data.
434 NULL if being run in non-permament memory mode.
444 IN CONST EFI_PEI_SERVICES
**PeiServices
,
445 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
446 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
452 Migrate the Hob list from the CAR stack to PEI installed memory.
456 PeiServices - The PEI core services table.
457 OldHandOffHob - The old handoff HOB list.
458 NewHandOffHob - The new handoff HOB list.
468 IN CONST EFI_PEI_SERVICES
**PeiServices
,
469 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
475 Install PPI services.
479 PeiServices - Pointer to the PEI Service Table
480 PpiList - Pointer to a list of PEI PPI Descriptors.
484 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
485 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
486 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
487 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
495 IN CONST EFI_PEI_SERVICES
**PeiServices
,
496 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
497 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
503 Re-Install PPI services.
507 PeiServices - Pointer to the PEI Service Table
508 OldPpi - Pointer to the old PEI PPI Descriptors.
509 NewPpi - Pointer to the new PEI PPI Descriptors.
513 EFI_SUCCESS - if the operation was successful
514 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
515 EFI_INVALID_PARAMETER - if NewPpi is not valid
516 EFI_NOT_FOUND - if the PPI was not in the database
524 IN CONST EFI_PEI_SERVICES
**PeiServices
,
525 IN CONST EFI_GUID
*Guid
,
527 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
534 Locate a given named PPI.
538 PeiServices - Pointer to the PEI Service Table
539 Guid - Pointer to GUID of the PPI.
540 Instance - Instance Number to discover.
541 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
542 returns a pointer to the descriptor (includes flags, etc)
543 Ppi - Pointer to reference the found PPI
547 Status - EFI_SUCCESS if the PPI is in the database
548 EFI_NOT_FOUND if the PPI is not in the database
555 IN CONST EFI_PEI_SERVICES
**PeiServices
,
556 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
562 Install a notification for a given PPI.
566 PeiServices - Pointer to the PEI Service Table
567 NotifyList - Pointer to list of Descriptors to notify upon.
571 Status - EFI_SUCCESS if successful
572 EFI_OUT_OF_RESOURCES if no space in the database
573 EFI_INVALID_PARAMETER if not a good decriptor
580 IN PEI_CORE_INSTANCE
*PrivateData
586 Process the Notify List at dispatch level.
590 PeiServices - Pointer to the PEI Service Table
599 IN PEI_CORE_INSTANCE
*PrivateData
,
601 IN INTN InstallStartIndex
,
602 IN INTN InstallStopIndex
,
603 IN INTN NotifyStartIndex
,
604 IN INTN NotifyStopIndex
610 Dispatch notifications.
614 PeiServices - Pointer to the PEI Service Table
615 NotifyType - Type of notify to fire.
616 InstallStartIndex - Install Beginning index.
617 InstallStopIndex - Install Ending index.
618 NotifyStartIndex - Notify Beginning index.
619 NotifyStopIndex - Notify Ending index.
627 // Boot mode support functions
632 IN CONST EFI_PEI_SERVICES
**PeiServices
,
633 IN OUT EFI_BOOT_MODE
*BootMode
639 This service enables PEIMs to ascertain the present value of the boot mode.
643 PeiServices - The PEI core services table.
644 BootMode - A pointer to contain the value of the boot mode.
648 EFI_SUCCESS - The boot mode was returned successfully.
649 EFI_INVALID_PARAMETER - BootMode is NULL.
657 IN CONST EFI_PEI_SERVICES
**PeiServices
,
658 IN EFI_BOOT_MODE BootMode
664 This service enables PEIMs to update the boot mode variable.
668 PeiServices - The PEI core services table.
669 BootMode - The value of the boot mode to set.
673 EFI_SUCCESS - The value was successfully updated
679 // Security support functions
682 InitializeSecurityServices (
683 IN EFI_PEI_SERVICES
**PeiServices
,
684 IN PEI_CORE_INSTANCE
*OldCoreData
690 Initialize the security services.
694 PeiServices - The PEI core services table.
695 OldCoreData - Pointer to the old core data.
696 NULL if being run in non-permament memory mode.
706 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
712 Provide a callout to the OEM FV verification service.
716 CurrentFvAddress - Pointer to the FV under investigation.
728 IN PEI_CORE_INSTANCE
*PrivateData
,
729 IN EFI_PEI_FV_HANDLE VolumeHandle
,
730 IN EFI_PEI_FILE_HANDLE FileHandle
736 Provide a callout to the security verification service.
740 PeiServices - The PEI core services table.
741 CurrentPeimAddress - Pointer to the Firmware File under investigation.
745 EFI_SUCCESS - Image is OK
746 EFI_SECURITY_VIOLATION - Image is illegal
755 IN CONST EFI_PEI_SERVICES
**PeiServices
,
756 IN OUT VOID
**HobList
762 Gets the pointer to the HOB List.
766 PeiServices - The PEI core services table.
767 HobList - Pointer to the HOB List.
771 EFI_SUCCESS - Get the pointer of HOB List
772 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
773 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
781 IN CONST EFI_PEI_SERVICES
**PeiServices
,
790 Add a new HOB to the HOB List.
794 PeiServices - The PEI core services table.
795 Type - Type of the new HOB.
796 Length - Length of the new HOB to allocate.
797 Hob - Pointer to the new HOB.
802 - EFI_INVALID_PARAMETER if Hob is NULL
803 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
804 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
810 PeiCoreBuildHobHandoffInfoTable (
811 IN EFI_BOOT_MODE BootMode
,
812 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
813 IN UINT64 MemoryLength
819 Builds a Handoff Information Table HOB
823 BootMode - Current Bootmode
824 MemoryBegin - Start Memory Address.
825 MemoryLength - Length of Memory.
836 // FFS Fw Volume support functions
841 IN CONST EFI_PEI_SERVICES
**PeiServices
,
843 IN EFI_PEI_FV_HANDLE FwVolHeader
,
844 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
849 Given the input file pointer, search for the next matching file in the
850 FFS volume as defined by SearchType. The search starts from FileHeader inside
851 the Firmware Volume defined by FwVolHeader.
854 PeiServices - Pointer to the PEI Core Services Table.
856 SearchType - Filter to find only files of this type.
857 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
859 FwVolHeader - Pointer to the FV header of the volume to search.
860 This parameter must point to a valid FFS volume.
862 FileHeader - Pointer to the current file from which to begin searching.
863 This pointer will be updated upon return to reflect the file found.
866 EFI_NOT_FOUND - No files matching the search criteria were found
874 PeiFfsFindSectionData (
875 IN CONST EFI_PEI_SERVICES
**PeiServices
,
876 IN EFI_SECTION_TYPE SectionType
,
877 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
878 IN OUT VOID
**SectionData
883 Given the input file pointer, search for the next matching section in the
887 PeiServices - Pointer to the PEI Core Services Table.
888 SearchType - Filter to find only sections of this type.
889 FfsFileHeader - Pointer to the current file to search.
890 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
891 - NULL if section not found
894 EFI_NOT_FOUND - No files matching the search criteria were found
902 PeiFvFindNextVolume (
903 IN CONST EFI_PEI_SERVICES
**PeiServices
,
905 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
911 Return the BFV location
913 BugBug -- Move this to the location of this code to where the
914 other FV and FFS support code lives.
915 Also, update to use FindFV for instances #'s >= 1.
919 PeiServices - The PEI core services table.
920 Instance - Instance of FV to find
921 FwVolHeader - Pointer to contain the data to return
924 Pointer to the Firmware Volume instance requested
926 EFI_INVALID_PARAMETER - FwVolHeader is NULL
928 EFI_SUCCESS - Firmware volume instance successfully found.
934 // Memory support functions
937 InitializeMemoryServices (
938 IN PEI_CORE_INSTANCE
*PrivateData
,
939 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
940 IN PEI_CORE_INSTANCE
*OldCoreData
946 Initialize the memory services.
950 PeiServices - The PEI core services table.
951 PeiStartupDescriptor - Information and services provided by SEC phase.
952 OldCoreData - Pointer to the PEI Core data.
953 NULL if being run in non-permament memory mode.
964 PeiInstallPeiMemory (
965 IN CONST EFI_PEI_SERVICES
**PeiServices
,
966 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
967 IN UINT64 MemoryLength
973 Install the permanent memory is now available.
974 Creates HOB (PHIT and Stack).
978 PeiServices - The PEI core services table.
979 MemoryBegin - Start of memory address.
980 MemoryLength - Length of memory.
992 IN CONST EFI_PEI_SERVICES
**PeiServices
,
993 IN EFI_MEMORY_TYPE MemoryType
,
995 OUT EFI_PHYSICAL_ADDRESS
*Memory
1001 Memory allocation service on permanent memory,
1002 not usable prior to the memory installation.
1006 PeiServices - The PEI core services table.
1007 Type - Type of allocation.
1008 MemoryType - Type of memory to allocate.
1009 Pages - Number of pages to allocate.
1010 Memory - Pointer of memory allocated.
1014 Status - EFI_SUCCESS The allocation was successful
1015 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1016 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1017 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1018 to allocate the number of pages.
1026 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1032 Routine Description:
1034 Memory allocation service on the CAR.
1038 PeiServices - The PEI core services table.
1040 Size - Amount of memory required
1042 Buffer - Address of pointer to the buffer
1046 Status - EFI_SUCCESS The allocation was successful
1047 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1048 to allocate the requested size.
1055 IN EFI_PEI_SERVICES
**PeiServices
,
1056 IN EFI_PEI_FILE_HANDLE FileHandle
,
1057 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1058 OUT UINT32
*AuthenticationState
1062 Routine Description:
1064 Get entry point of a Peim file.
1068 PeiServices - Calling context.
1070 PeimFileHeader - Peim file's header.
1072 EntryPoint - Entry point of that Peim file.
1084 PeiReportStatusCode (
1085 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1086 IN EFI_STATUS_CODE_TYPE CodeType
,
1087 IN EFI_STATUS_CODE_VALUE Value
,
1089 IN CONST EFI_GUID
*CallerId
,
1090 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1094 Routine Description:
1096 Core version of the Status Code reporter
1100 PeiServices - The PEI core services table.
1102 CodeType - Type of Status Code.
1104 Value - Value to output for Status Code.
1106 Instance - Instance Number of this status code.
1108 CallerId - ID of the caller of this status code.
1110 Data - Optional data associated with this status code.
1114 Status - EFI_SUCCESS if status code is successfully reported
1115 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1124 IN CONST EFI_PEI_SERVICES
**PeiServices
1128 Routine Description:
1130 Core version of the Reset System
1134 PeiServices - The PEI core services table.
1138 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1139 - EFI_DEVICE_ERROR. Did not reset system.
1141 Otherwise, resets the system.
1148 IN PEI_CORE_INSTANCE
*PrivateData
,
1149 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1153 Routine Description:
1155 Initialize PeiCore Fv List.
1158 PrivateData - Pointer to PEI_CORE_INSTANCE.
1159 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1169 FirmwareVolmeInfoPpiNotifyCallback (
1170 IN EFI_PEI_SERVICES
**PeiServices
,
1171 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1176 Routine Description:
1178 Process Firmware Volum Information once FvInfoPPI install.
1182 PeiServices - General purpose services available to every PEIM.
1186 Status - EFI_SUCCESS if the interface could be successfully
1195 PeiFfsFindFileByName (
1196 IN CONST EFI_GUID
*FileName
,
1197 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1198 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1202 Routine Description:
1204 Given the input VolumeHandle, search for the next matching name file.
1208 FileName - File name to search.
1209 VolumeHandle - The current FV to search.
1210 FileHandle - Pointer to the file matching name in VolumeHandle.
1211 - NULL if file not found
1222 IN EFI_PEI_FILE_HANDLE FileHandle
,
1223 OUT EFI_FV_FILE_INFO
*FileInfo
1227 Routine Description:
1229 Collect information of given file.
1232 FileHandle - The handle to file.
1233 FileInfo - Pointer to the file information.
1243 PeiFfsGetVolumeInfo (
1244 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1245 OUT EFI_FV_INFO
*VolumeInfo
1249 Routine Description:
1251 Collect information of given Fv Volume.
1254 VolumeHandle - The handle to Fv Volume.
1255 VolumeInfo - The pointer to volume information.
1266 PeiRegisterForShadow (
1267 IN EFI_PEI_FILE_HANDLE FileHandle
1271 Routine Description:
1273 This routine enable a PEIM to register itself to shadow when PEI Foundation
1274 discovery permanent memory.
1277 FileHandle - File handle of a PEIM.
1280 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1281 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1282 EFI_SUCCESS - Successfully to register itself.
1289 This routine enable a PEIM to register itself to shadow when PEI Foundation
1290 discovery permanent memory.
1292 @param FileHandle File handle of a PEIM.
1294 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1295 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1296 @retval EFI_SUCCESS Successfully to register itself.
1301 PeiRegisterForShadow (
1302 IN EFI_PEI_FILE_HANDLE FileHandle
1307 Transfers control to a function starting with a new stack.
1309 Transfers control to the function specified by EntryPoint using the new stack
1310 specified by NewStack and passing in the parameters specified by Context1 and
1311 Context2. Context1 and Context2 are optional and may be NULL. The function
1312 EntryPoint must never return.
1314 If EntryPoint is NULL, then ASSERT().
1315 If NewStack is NULL, then ASSERT().
1317 @param EntryPoint A pointer to function to call with the new stack.
1318 @param Context1 A pointer to the context to pass into the EntryPoint
1320 @param Context2 A pointer to the context to pass into the EntryPoint
1322 @param NewStack A pointer to the new stack to use for the EntryPoint
1324 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1325 Reserved on other architectures.
1331 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1332 IN VOID
*Context1
, OPTIONAL
1333 IN VOID
*Context2
, OPTIONAL
1340 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1341 IN CONST EFI_GUID
*FileName
, OPTIONAL
1342 IN EFI_FV_FILETYPE SearchType
,
1343 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1344 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1348 Routine Description:
1349 Given the input file pointer, search for the next matching file in the
1350 FFS volume as defined by SearchType. The search starts from FileHeader inside
1351 the Firmware Volume defined by FwVolHeader.
1354 PeiServices - Pointer to the PEI Core Services Table.
1355 SearchType - Filter to find only files of this type.
1356 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1357 FwVolHeader - Pointer to the FV header of the volume to search.
1358 This parameter must point to a valid FFS volume.
1359 FileHeader - Pointer to the current file from which to begin searching.
1360 This pointer will be updated upon return to reflect the file found.
1361 Flag - Indicator for if this is for PEI Dispath search
1364 EFI_NOT_FOUND - No files matching the search criteria were found
1371 InitializeImageServices (
1372 IN PEI_CORE_INSTANCE
*PrivateData
,
1373 IN PEI_CORE_INSTANCE
*OldCoreData
1377 Routine Description:
1379 Install Pei Load File PPI.
1383 PrivateData - Pointer to PEI_CORE_INSTANCE.
1384 OldCoreData - Pointer to PEI_CORE_INSTANCE.
1394 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.
1396 @param PeiServices Pointer to the PEI Core Services Table.
1397 @param FileHandle File handle of a Fv type file.
1398 @param AuthenticationState Pointer to attestation authentication state of image.
1401 @retval EFI_NOT_FOUND FV image can't be found.
1402 @retval EFI_SUCCESS Successfully to process it.
1407 IN EFI_PEI_SERVICES
**PeiServices
,
1408 IN EFI_PEI_FILE_HANDLE FvFileHandle
,
1409 OUT UINT32
*AuthenticationState