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 <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
;
70 #define PEI_STACK_SIZE 0x20000
72 #define MAX_PPI_DESCRIPTORS 64
78 INTN LastDispatchedInstall
;
79 INTN LastDispatchedNotify
;
80 PEI_PPI_LIST_POINTERS PpiListPtrs
[MAX_PPI_DESCRIPTORS
];
85 // PEI_CORE_FV_HANDE.PeimState
86 // Do not change these values as there is code doing math to change states.
87 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
89 #define PEIM_STATE_NOT_DISPATCHED 0x00
90 #define PEIM_STATE_DISPATCHED 0x01
91 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
92 #define PEIM_STATE_DONE 0x03
95 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
96 UINT8 PeimState
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
97 EFI_PEI_FILE_HANDLE FvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
102 // Pei Core private data structure instance
105 #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')
109 EFI_PEI_SERVICES
*PS
; // Point to ServiceTableShadow
110 PEI_PPI_DATABASE PpiData
;
112 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
113 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
115 UINTN CurrentPeimFvCount
;
116 UINTN CurrentPeimCount
;
117 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
119 EFI_PEI_FV_HANDLE AllFv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
120 EFI_PEI_HOB_POINTERS HobList
;
121 BOOLEAN SwitchStackSignal
;
122 BOOLEAN PeiMemoryInstalled
;
123 EFI_PHYSICAL_ADDRESS StackBase
;
125 VOID
*BottomOfCarHeap
;
128 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
129 EFI_PEI_SERVICES ServiceTableShadow
;
130 UINTN SizeOfCacheAsRam
;
131 VOID
*MaxTopOfCarHeap
;
132 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
136 // Pei Core Instance Data Macros
139 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
140 CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)
143 // BUGBUG: Where does this go really?
147 (EFIAPI
*PEI_CORE_ENTRY_POINT
)(
148 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
149 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
150 IN PEI_CORE_INSTANCE
*OldCoreData
154 // Union of temporarily used function pointers (to save stack space)
157 PEI_CORE_ENTRY_POINT PeiCore
;
158 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
159 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
160 EFI_DXE_IPL_PPI
*DxeIpl
;
161 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
162 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
164 } PEI_CORE_TEMP_POINTERS
;
169 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
170 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
172 } PEI_CORE_PARAMETERS
;
180 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
181 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpList
,
188 The entry routine to Pei Core, invoked by PeiMain during transition
189 from SEC to PEI. After switching stack in the PEI core, it will restart
190 with the old core data.
194 PeiStartupDescriptor - Information and services provided by SEC phase.
195 OldCoreData - Pointer to old core data that is used to initialize the
200 This function never returns
201 EFI_NOT_FOUND - Never reach
207 // Dispatcher support functions
211 PeimDispatchReadiness (
212 IN EFI_PEI_SERVICES
**PeiServices
,
213 IN VOID
*DependencyExpression
219 This is the POSTFIX version of the dependency evaluator. When a
220 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
221 the evaluation stack. When that entry is poped from the evaluation
222 stack, the PPI is checked if it is installed. This method allows
223 some time savings as not all PPIs must be checked for certain
224 operation types (AND, OR).
228 PeiServices - Calling context.
230 DependencyExpression - Pointer to a dependency expression. The Grammar adheres to
231 the BNF described above and is stored in postfix notation.
232 Runnable - is True if the driver can be scheduled and False if the driver
233 cannot be scheduled. This is the value that the schedulers
234 should use for deciding the state of the driver.
238 Status = EFI_SUCCESS if it is a well-formed Grammar
239 EFI_INVALID_PARAMETER if the dependency expression overflows
241 EFI_INVALID_PARAMETER if the dependency expression underflows
243 EFI_INVALID_PARAMETER if the dependency expression is not a
251 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
252 IN PEI_CORE_INSTANCE
*PrivateData
259 Conduct PEIM dispatch.
263 PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
264 PrivateData - Pointer to the private data passed in from caller
265 DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
269 EFI_SUCCESS - Successfully dispatched PEIM.
270 EFI_NOT_FOUND - The dispatch failed.
277 InitializeDispatcherData (
278 IN PEI_CORE_INSTANCE
*PrivateData
,
279 IN PEI_CORE_INSTANCE
*OldCoreData
,
280 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
286 Initialize the Dispatcher's data members
290 PeiServices - The PEI core services table.
291 OldCoreData - Pointer to old core data (before switching stack).
292 NULL if being run in non-permament memory mode.
293 PeiStartupDescriptor - Information and services provided by SEC phase.
306 IN EFI_PEI_SERVICES
**PeiServices
,
307 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
308 IN OUT EFI_FFS_FILE_HEADER
**PeimFileHeader
313 Given the input file pointer, search for the next matching file in the
314 FFS volume. The search starts from FileHeader inside
315 the Firmware Volume defined by FwVolHeader.
318 PeiServices - Pointer to the PEI Core Services Table.
320 FwVolHeader - Pointer to the FV header of the volume to search.
321 This parameter must point to a valid FFS volume.
323 PeimFileHeader - Pointer to the current file from which to begin searching.
324 This pointer will be updated upon return to reflect the file found.
327 EFI_NOT_FOUND - No files matching the search criteria were found
335 IN UINT8 CurrentPeim
,
336 IN UINT32 DispatchedPeimBitMap
342 This routine checks to see if a particular PEIM has been dispatched during
343 the PEI core dispatch.
346 CurrentPeim - The PEIM/FV in the bit array to check.
347 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
350 TRUE if PEIM already dispatched
358 IN EFI_PEI_SERVICES
**PeiServices
,
359 IN UINT8 CurrentPeim
,
360 OUT UINT32
*DispatchedPeimBitMap
366 This routine sets a PEIM as having been dispatched once its entry
367 point has been invoked.
371 PeiServices - The PEI core services table.
372 CurrentPeim - The PEIM/FV in the bit array to check.
373 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
383 IN PEI_CORE_INSTANCE
*Private
,
384 IN EFI_PEI_FILE_HANDLE FileHandle
,
391 This routine parses the Dependency Expression, if available, and
392 decides if the module can be executed.
395 PeiServices - The PEI Service Table
396 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
399 TRUE - Can be dispatched
400 FALSE - Cannot be dispatched
405 #if defined (MDE_CPU_IPF)
407 // In Ipf we should make special changes for the PHIT pointers to support
408 // recovery boot in cache mode.
410 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
411 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
414 IN PEI_CORE_INSTANCE
*CoreData
420 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
424 CoreData - The PEI core Private Data
433 #define SWITCH_TO_CACHE_MODE(CoreData)
438 // PPI support functions
441 InitializePpiServices (
442 IN PEI_CORE_INSTANCE
*PrivateData
,
443 IN PEI_CORE_INSTANCE
*OldCoreData
449 Initialize PPI services.
453 PeiServices - The PEI core services table.
454 OldCoreData - Pointer to the PEI Core data.
455 NULL if being run in non-permament memory mode.
465 IN CONST EFI_PEI_SERVICES
**PeiServices
,
466 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
467 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
473 Migrate the Hob list from the CAR stack to PEI installed memory.
477 PeiServices - The PEI core services table.
478 OldHandOffHob - The old handoff HOB list.
479 NewHandOffHob - The new handoff HOB list.
489 IN CONST EFI_PEI_SERVICES
**PeiServices
,
490 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
496 Install PPI services.
500 PeiServices - Pointer to the PEI Service Table
501 PpiList - Pointer to a list of PEI PPI Descriptors.
505 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
506 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
507 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
508 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
516 IN CONST EFI_PEI_SERVICES
**PeiServices
,
517 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
518 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
524 Re-Install PPI services.
528 PeiServices - Pointer to the PEI Service Table
529 OldPpi - Pointer to the old PEI PPI Descriptors.
530 NewPpi - Pointer to the new PEI PPI Descriptors.
534 EFI_SUCCESS - if the operation was successful
535 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
536 EFI_INVALID_PARAMETER - if NewPpi is not valid
537 EFI_NOT_FOUND - if the PPI was not in the database
545 IN CONST EFI_PEI_SERVICES
**PeiServices
,
546 IN CONST EFI_GUID
*Guid
,
548 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
555 Locate a given named PPI.
559 PeiServices - Pointer to the PEI Service Table
560 Guid - Pointer to GUID of the PPI.
561 Instance - Instance Number to discover.
562 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
563 returns a pointer to the descriptor (includes flags, etc)
564 Ppi - Pointer to reference the found PPI
568 Status - EFI_SUCCESS if the PPI is in the database
569 EFI_NOT_FOUND if the PPI is not in the database
576 IN CONST EFI_PEI_SERVICES
**PeiServices
,
577 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
583 Install a notification for a given PPI.
587 PeiServices - Pointer to the PEI Service Table
588 NotifyList - Pointer to list of Descriptors to notify upon.
592 Status - EFI_SUCCESS if successful
593 EFI_OUT_OF_RESOURCES if no space in the database
594 EFI_INVALID_PARAMETER if not a good decriptor
601 IN PEI_CORE_INSTANCE
*PrivateData
607 Process the Notify List at dispatch level.
611 PeiServices - Pointer to the PEI Service Table
620 IN PEI_CORE_INSTANCE
*PrivateData
,
622 IN INTN InstallStartIndex
,
623 IN INTN InstallStopIndex
,
624 IN INTN NotifyStartIndex
,
625 IN INTN NotifyStopIndex
631 Dispatch notifications.
635 PeiServices - Pointer to the PEI Service Table
636 NotifyType - Type of notify to fire.
637 InstallStartIndex - Install Beginning index.
638 InstallStopIndex - Install Ending index.
639 NotifyStartIndex - Notify Beginning index.
640 NotifyStopIndex - Notify Ending index.
648 // Boot mode support functions
653 IN CONST EFI_PEI_SERVICES
**PeiServices
,
654 IN OUT EFI_BOOT_MODE
*BootMode
660 This service enables PEIMs to ascertain the present value of the boot mode.
664 PeiServices - The PEI core services table.
665 BootMode - A pointer to contain the value of the boot mode.
669 EFI_SUCCESS - The boot mode was returned successfully.
670 EFI_INVALID_PARAMETER - BootMode is NULL.
678 IN CONST EFI_PEI_SERVICES
**PeiServices
,
679 IN EFI_BOOT_MODE BootMode
685 This service enables PEIMs to update the boot mode variable.
689 PeiServices - The PEI core services table.
690 BootMode - The value of the boot mode to set.
694 EFI_SUCCESS - The value was successfully updated
700 // Security support functions
703 InitializeSecurityServices (
704 IN EFI_PEI_SERVICES
**PeiServices
,
705 IN PEI_CORE_INSTANCE
*OldCoreData
711 Initialize the security services.
715 PeiServices - The PEI core services table.
716 OldCoreData - Pointer to the old core data.
717 NULL if being run in non-permament memory mode.
727 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
733 Provide a callout to the OEM FV verification service.
737 CurrentFvAddress - Pointer to the FV under investigation.
749 IN PEI_CORE_INSTANCE
*PrivateData
,
750 IN EFI_PEI_FV_HANDLE VolumeHandle
,
751 IN EFI_PEI_FILE_HANDLE FileHandle
757 Provide a callout to the security verification service.
761 PeiServices - The PEI core services table.
762 CurrentPeimAddress - Pointer to the Firmware File under investigation.
766 EFI_SUCCESS - Image is OK
767 EFI_SECURITY_VIOLATION - Image is illegal
776 IN CONST EFI_PEI_SERVICES
**PeiServices
,
777 IN OUT VOID
**HobList
783 Gets the pointer to the HOB List.
787 PeiServices - The PEI core services table.
788 HobList - Pointer to the HOB List.
792 EFI_SUCCESS - Get the pointer of HOB List
793 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
794 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
802 IN CONST EFI_PEI_SERVICES
**PeiServices
,
811 Add a new HOB to the HOB List.
815 PeiServices - The PEI core services table.
816 Type - Type of the new HOB.
817 Length - Length of the new HOB to allocate.
818 Hob - Pointer to the new HOB.
823 - EFI_INVALID_PARAMETER if Hob is NULL
824 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
825 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
831 PeiCoreBuildHobHandoffInfoTable (
832 IN EFI_BOOT_MODE BootMode
,
833 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
834 IN UINT64 MemoryLength
840 Builds a Handoff Information Table HOB
844 BootMode - Current Bootmode
845 MemoryBegin - Start Memory Address.
846 MemoryLength - Length of Memory.
857 // FFS Fw Volume support functions
862 IN CONST EFI_PEI_SERVICES
**PeiServices
,
864 IN EFI_PEI_FV_HANDLE FwVolHeader
,
865 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
870 Given the input file pointer, search for the next matching file in the
871 FFS volume as defined by SearchType. The search starts from FileHeader inside
872 the Firmware Volume defined by FwVolHeader.
875 PeiServices - Pointer to the PEI Core Services Table.
877 SearchType - Filter to find only files of this type.
878 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
880 FwVolHeader - Pointer to the FV header of the volume to search.
881 This parameter must point to a valid FFS volume.
883 FileHeader - Pointer to the current file from which to begin searching.
884 This pointer will be updated upon return to reflect the file found.
887 EFI_NOT_FOUND - No files matching the search criteria were found
895 PeiFfsFindSectionData (
896 IN CONST EFI_PEI_SERVICES
**PeiServices
,
897 IN EFI_SECTION_TYPE SectionType
,
898 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
899 IN OUT VOID
**SectionData
904 Given the input file pointer, search for the next matching section in the
908 PeiServices - Pointer to the PEI Core Services Table.
909 SearchType - Filter to find only sections of this type.
910 FfsFileHeader - Pointer to the current file to search.
911 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
912 - NULL if section not found
915 EFI_NOT_FOUND - No files matching the search criteria were found
923 PeiFvFindNextVolume (
924 IN CONST EFI_PEI_SERVICES
**PeiServices
,
926 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
932 Return the BFV location
934 BugBug -- Move this to the location of this code to where the
935 other FV and FFS support code lives.
936 Also, update to use FindFV for instances #'s >= 1.
940 PeiServices - The PEI core services table.
941 Instance - Instance of FV to find
942 FwVolHeader - Pointer to contain the data to return
945 Pointer to the Firmware Volume instance requested
947 EFI_INVALID_PARAMETER - FwVolHeader is NULL
949 EFI_SUCCESS - Firmware volume instance successfully found.
955 // Memory support functions
958 InitializeMemoryServices (
959 IN PEI_CORE_INSTANCE
*PrivateData
,
960 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
961 IN PEI_CORE_INSTANCE
*OldCoreData
967 Initialize the memory services.
971 PeiServices - The PEI core services table.
972 PeiStartupDescriptor - Information and services provided by SEC phase.
973 OldCoreData - Pointer to the PEI Core data.
974 NULL if being run in non-permament memory mode.
985 PeiInstallPeiMemory (
986 IN CONST EFI_PEI_SERVICES
**PeiServices
,
987 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
988 IN UINT64 MemoryLength
994 Install the permanent memory is now available.
995 Creates HOB (PHIT and Stack).
999 PeiServices - The PEI core services table.
1000 MemoryBegin - Start of memory address.
1001 MemoryLength - Length of memory.
1005 Status - EFI_SUCCESS
1013 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1014 IN EFI_MEMORY_TYPE MemoryType
,
1016 OUT EFI_PHYSICAL_ADDRESS
*Memory
1020 Routine Description:
1022 Memory allocation service on permanent memory,
1023 not usable prior to the memory installation.
1027 PeiServices - The PEI core services table.
1028 Type - Type of allocation.
1029 MemoryType - Type of memory to allocate.
1030 Pages - Number of pages to allocate.
1031 Memory - Pointer of memory allocated.
1035 Status - EFI_SUCCESS The allocation was successful
1036 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1037 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1038 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1039 to allocate the number of pages.
1047 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1053 Routine Description:
1055 Memory allocation service on the CAR.
1059 PeiServices - The PEI core services table.
1061 Size - Amount of memory required
1063 Buffer - Address of pointer to the buffer
1067 Status - EFI_SUCCESS The allocation was successful
1068 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1069 to allocate the requested size.
1076 IN EFI_PEI_SERVICES
**PeiServices
,
1077 IN EFI_PEI_FILE_HANDLE FileHandle
,
1078 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1079 OUT UINT32
*AuthenticationState
1083 Routine Description:
1085 Get entry point of a Peim file.
1089 PeiServices - Calling context.
1091 PeimFileHeader - Peim file's header.
1093 EntryPoint - Entry point of that Peim file.
1105 PeiReportStatusCode (
1106 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1107 IN EFI_STATUS_CODE_TYPE CodeType
,
1108 IN EFI_STATUS_CODE_VALUE Value
,
1110 IN CONST EFI_GUID
*CallerId
,
1111 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1115 Routine Description:
1117 Core version of the Status Code reporter
1121 PeiServices - The PEI core services table.
1123 CodeType - Type of Status Code.
1125 Value - Value to output for Status Code.
1127 Instance - Instance Number of this status code.
1129 CallerId - ID of the caller of this status code.
1131 Data - Optional data associated with this status code.
1135 Status - EFI_SUCCESS if status code is successfully reported
1136 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1145 IN CONST EFI_PEI_SERVICES
**PeiServices
1149 Routine Description:
1151 Core version of the Reset System
1155 PeiServices - The PEI core services table.
1159 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1160 - EFI_DEVICE_ERROR. Did not reset system.
1162 Otherwise, resets the system.
1169 IN PEI_CORE_INSTANCE
*PrivateData
,
1170 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1174 Routine Description:
1176 Initialize PeiCore Fv List.
1179 PrivateData - Pointer to PEI_CORE_INSTANCE.
1180 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1190 FirmwareVolmeInfoPpiNotifyCallback (
1191 IN EFI_PEI_SERVICES
**PeiServices
,
1192 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1197 Routine Description:
1199 Process Firmware Volum Information once FvInfoPPI install.
1203 PeiServices - General purpose services available to every PEIM.
1207 Status - EFI_SUCCESS if the interface could be successfully
1216 PeiFfsFindFileByName (
1217 IN CONST EFI_GUID
*FileName
,
1218 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1219 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1223 Routine Description:
1225 Given the input VolumeHandle, search for the next matching name file.
1229 FileName - File name to search.
1230 VolumeHandle - The current FV to search.
1231 FileHandle - Pointer to the file matching name in VolumeHandle.
1232 - NULL if file not found
1243 IN EFI_PEI_FILE_HANDLE FileHandle
,
1244 OUT EFI_FV_FILE_INFO
*FileInfo
1248 Routine Description:
1250 Collect information of given file.
1253 FileHandle - The handle to file.
1254 FileInfo - Pointer to the file information.
1264 PeiFfsGetVolumeInfo (
1265 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1266 OUT EFI_FV_INFO
*VolumeInfo
1270 Routine Description:
1272 Collect information of given Fv Volume.
1275 VolumeHandle - The handle to Fv Volume.
1276 VolumeInfo - The pointer to volume information.
1287 PeiRegisterForShadow (
1288 IN EFI_PEI_FILE_HANDLE FileHandle
1292 Routine Description:
1294 This routine enable a PEIM to register itself to shadow when PEI Foundation
1295 discovery permanent memory.
1298 FileHandle - File handle of a PEIM.
1301 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1302 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1303 EFI_SUCCESS - Successfully to register itself.
1310 This routine enable a PEIM to register itself to shadow when PEI Foundation
1311 discovery permanent memory.
1313 @param FileHandle File handle of a PEIM.
1315 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1316 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1317 @retval EFI_SUCCESS Successfully to register itself.
1322 PeiRegisterForShadow (
1323 IN EFI_PEI_FILE_HANDLE FileHandle
1328 Transfers control to a function starting with a new stack.
1330 Transfers control to the function specified by EntryPoint using the new stack
1331 specified by NewStack and passing in the parameters specified by Context1 and
1332 Context2. Context1 and Context2 are optional and may be NULL. The function
1333 EntryPoint must never return.
1335 If EntryPoint is NULL, then ASSERT().
1336 If NewStack is NULL, then ASSERT().
1338 @param EntryPoint A pointer to function to call with the new stack.
1339 @param Context1 A pointer to the context to pass into the EntryPoint
1341 @param Context2 A pointer to the context to pass into the EntryPoint
1343 @param NewStack A pointer to the new stack to use for the EntryPoint
1345 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1346 Reserved on other architectures.
1352 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1353 IN VOID
*Context1
, OPTIONAL
1354 IN VOID
*Context2
, OPTIONAL
1361 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1362 IN CONST EFI_GUID
*FileName
, OPTIONAL
1363 IN EFI_FV_FILETYPE SearchType
,
1364 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1365 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1369 Routine Description:
1370 Given the input file pointer, search for the next matching file in the
1371 FFS volume as defined by SearchType. The search starts from FileHeader inside
1372 the Firmware Volume defined by FwVolHeader.
1375 PeiServices - Pointer to the PEI Core Services Table.
1376 SearchType - Filter to find only files of this type.
1377 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1378 FwVolHeader - Pointer to the FV header of the volume to search.
1379 This parameter must point to a valid FFS volume.
1380 FileHeader - Pointer to the current file from which to begin searching.
1381 This pointer will be updated upon return to reflect the file found.
1382 Flag - Indicator for if this is for PEI Dispath search
1385 EFI_NOT_FOUND - No files matching the search criteria were found
1392 InitializeImageServices (
1393 IN PEI_CORE_INSTANCE
*PrivateData
,
1394 IN PEI_CORE_INSTANCE
*OldCoreData
1398 Routine Description:
1400 Install Pei Load File PPI.
1404 PrivateData - Pointer to PEI_CORE_INSTANCE.
1405 OldCoreData - Pointer to PEI_CORE_INSTANCE.