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.
235 Status = EFI_SUCCESS if it is a well-formed Grammar
236 EFI_INVALID_PARAMETER if the dependency expression overflows
238 EFI_INVALID_PARAMETER if the dependency expression underflows
240 EFI_INVALID_PARAMETER if the dependency expression is not a
248 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
249 IN PEI_CORE_INSTANCE
*PrivateData
256 Conduct PEIM dispatch.
260 PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
261 PrivateData - Pointer to the private data passed in from caller
262 DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
266 EFI_SUCCESS - Successfully dispatched PEIM.
267 EFI_NOT_FOUND - The dispatch failed.
274 InitializeDispatcherData (
275 IN PEI_CORE_INSTANCE
*PrivateData
,
276 IN PEI_CORE_INSTANCE
*OldCoreData
,
277 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
283 Initialize the Dispatcher's data members
287 PeiServices - The PEI core services table.
288 OldCoreData - Pointer to old core data (before switching stack).
289 NULL if being run in non-permament memory mode.
290 PeiStartupDescriptor - Information and services provided by SEC phase.
303 IN EFI_PEI_SERVICES
**PeiServices
,
304 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
305 IN OUT EFI_FFS_FILE_HEADER
**PeimFileHeader
310 Given the input file pointer, search for the next matching file in the
311 FFS volume. The search starts from FileHeader inside
312 the Firmware Volume defined by FwVolHeader.
315 PeiServices - Pointer to the PEI Core Services Table.
317 FwVolHeader - Pointer to the FV header of the volume to search.
318 This parameter must point to a valid FFS volume.
320 PeimFileHeader - Pointer to the current file from which to begin searching.
321 This pointer will be updated upon return to reflect the file found.
324 EFI_NOT_FOUND - No files matching the search criteria were found
332 IN UINT8 CurrentPeim
,
333 IN UINT32 DispatchedPeimBitMap
339 This routine checks to see if a particular PEIM has been dispatched during
340 the PEI core dispatch.
343 CurrentPeim - The PEIM/FV in the bit array to check.
344 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
347 TRUE if PEIM already dispatched
355 IN EFI_PEI_SERVICES
**PeiServices
,
356 IN UINT8 CurrentPeim
,
357 OUT UINT32
*DispatchedPeimBitMap
363 This routine sets a PEIM as having been dispatched once its entry
364 point has been invoked.
368 PeiServices - The PEI core services table.
369 CurrentPeim - The PEIM/FV in the bit array to check.
370 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
380 IN PEI_CORE_INSTANCE
*Private
,
381 IN EFI_PEI_FILE_HANDLE FileHandle
,
388 This routine parses the Dependency Expression, if available, and
389 decides if the module can be executed.
392 PeiServices - The PEI Service Table
393 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
396 TRUE - Can be dispatched
397 FALSE - Cannot be dispatched
402 #if defined (MDE_CPU_IPF)
404 // In Ipf we should make special changes for the PHIT pointers to support
405 // recovery boot in cache mode.
407 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
408 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
411 IN PEI_CORE_INSTANCE
*CoreData
417 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
421 CoreData - The PEI core Private Data
430 #define SWITCH_TO_CACHE_MODE(CoreData)
435 // PPI support functions
438 InitializePpiServices (
439 IN PEI_CORE_INSTANCE
*PrivateData
,
440 IN PEI_CORE_INSTANCE
*OldCoreData
446 Initialize PPI services.
450 PeiServices - The PEI core services table.
451 OldCoreData - Pointer to the PEI Core data.
452 NULL if being run in non-permament memory mode.
462 IN CONST EFI_PEI_SERVICES
**PeiServices
,
463 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
464 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
470 Migrate the Hob list from the CAR stack to PEI installed memory.
474 PeiServices - The PEI core services table.
475 OldHandOffHob - The old handoff HOB list.
476 NewHandOffHob - The new handoff HOB list.
486 IN CONST EFI_PEI_SERVICES
**PeiServices
,
487 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
493 Install PPI services.
497 PeiServices - Pointer to the PEI Service Table
498 PpiList - Pointer to a list of PEI PPI Descriptors.
502 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
503 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
504 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
505 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
513 IN CONST EFI_PEI_SERVICES
**PeiServices
,
514 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
515 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
521 Re-Install PPI services.
525 PeiServices - Pointer to the PEI Service Table
526 OldPpi - Pointer to the old PEI PPI Descriptors.
527 NewPpi - Pointer to the new PEI PPI Descriptors.
531 EFI_SUCCESS - if the operation was successful
532 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
533 EFI_INVALID_PARAMETER - if NewPpi is not valid
534 EFI_NOT_FOUND - if the PPI was not in the database
542 IN CONST EFI_PEI_SERVICES
**PeiServices
,
543 IN CONST EFI_GUID
*Guid
,
545 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
552 Locate a given named PPI.
556 PeiServices - Pointer to the PEI Service Table
557 Guid - Pointer to GUID of the PPI.
558 Instance - Instance Number to discover.
559 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
560 returns a pointer to the descriptor (includes flags, etc)
561 Ppi - Pointer to reference the found PPI
565 Status - EFI_SUCCESS if the PPI is in the database
566 EFI_NOT_FOUND if the PPI is not in the database
573 IN CONST EFI_PEI_SERVICES
**PeiServices
,
574 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
580 Install a notification for a given PPI.
584 PeiServices - Pointer to the PEI Service Table
585 NotifyList - Pointer to list of Descriptors to notify upon.
589 Status - EFI_SUCCESS if successful
590 EFI_OUT_OF_RESOURCES if no space in the database
591 EFI_INVALID_PARAMETER if not a good decriptor
598 IN PEI_CORE_INSTANCE
*PrivateData
604 Process the Notify List at dispatch level.
608 PeiServices - Pointer to the PEI Service Table
617 IN PEI_CORE_INSTANCE
*PrivateData
,
619 IN INTN InstallStartIndex
,
620 IN INTN InstallStopIndex
,
621 IN INTN NotifyStartIndex
,
622 IN INTN NotifyStopIndex
628 Dispatch notifications.
632 PeiServices - Pointer to the PEI Service Table
633 NotifyType - Type of notify to fire.
634 InstallStartIndex - Install Beginning index.
635 InstallStopIndex - Install Ending index.
636 NotifyStartIndex - Notify Beginning index.
637 NotifyStopIndex - Notify Ending index.
645 // Boot mode support functions
650 IN CONST EFI_PEI_SERVICES
**PeiServices
,
651 IN OUT EFI_BOOT_MODE
*BootMode
657 This service enables PEIMs to ascertain the present value of the boot mode.
661 PeiServices - The PEI core services table.
662 BootMode - A pointer to contain the value of the boot mode.
666 EFI_SUCCESS - The boot mode was returned successfully.
667 EFI_INVALID_PARAMETER - BootMode is NULL.
675 IN CONST EFI_PEI_SERVICES
**PeiServices
,
676 IN EFI_BOOT_MODE BootMode
682 This service enables PEIMs to update the boot mode variable.
686 PeiServices - The PEI core services table.
687 BootMode - The value of the boot mode to set.
691 EFI_SUCCESS - The value was successfully updated
697 // Security support functions
700 InitializeSecurityServices (
701 IN EFI_PEI_SERVICES
**PeiServices
,
702 IN PEI_CORE_INSTANCE
*OldCoreData
708 Initialize the security services.
712 PeiServices - The PEI core services table.
713 OldCoreData - Pointer to the old core data.
714 NULL if being run in non-permament memory mode.
724 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
730 Provide a callout to the OEM FV verification service.
734 CurrentFvAddress - Pointer to the FV under investigation.
746 IN PEI_CORE_INSTANCE
*PrivateData
,
747 IN EFI_PEI_FV_HANDLE VolumeHandle
,
748 IN EFI_PEI_FILE_HANDLE FileHandle
754 Provide a callout to the security verification service.
758 PeiServices - The PEI core services table.
759 CurrentPeimAddress - Pointer to the Firmware File under investigation.
763 EFI_SUCCESS - Image is OK
764 EFI_SECURITY_VIOLATION - Image is illegal
773 IN CONST EFI_PEI_SERVICES
**PeiServices
,
774 IN OUT VOID
**HobList
780 Gets the pointer to the HOB List.
784 PeiServices - The PEI core services table.
785 HobList - Pointer to the HOB List.
789 EFI_SUCCESS - Get the pointer of HOB List
790 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
791 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
799 IN CONST EFI_PEI_SERVICES
**PeiServices
,
808 Add a new HOB to the HOB List.
812 PeiServices - The PEI core services table.
813 Type - Type of the new HOB.
814 Length - Length of the new HOB to allocate.
815 Hob - Pointer to the new HOB.
820 - EFI_INVALID_PARAMETER if Hob is NULL
821 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
822 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
828 PeiCoreBuildHobHandoffInfoTable (
829 IN EFI_BOOT_MODE BootMode
,
830 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
831 IN UINT64 MemoryLength
837 Builds a Handoff Information Table HOB
841 BootMode - Current Bootmode
842 MemoryBegin - Start Memory Address.
843 MemoryLength - Length of Memory.
854 // FFS Fw Volume support functions
859 IN CONST EFI_PEI_SERVICES
**PeiServices
,
861 IN EFI_PEI_FV_HANDLE FwVolHeader
,
862 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
867 Given the input file pointer, search for the next matching file in the
868 FFS volume as defined by SearchType. The search starts from FileHeader inside
869 the Firmware Volume defined by FwVolHeader.
872 PeiServices - Pointer to the PEI Core Services Table.
874 SearchType - Filter to find only files of this type.
875 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
877 FwVolHeader - Pointer to the FV header of the volume to search.
878 This parameter must point to a valid FFS volume.
880 FileHeader - Pointer to the current file from which to begin searching.
881 This pointer will be updated upon return to reflect the file found.
884 EFI_NOT_FOUND - No files matching the search criteria were found
892 PeiFfsFindSectionData (
893 IN CONST EFI_PEI_SERVICES
**PeiServices
,
894 IN EFI_SECTION_TYPE SectionType
,
895 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
896 IN OUT VOID
**SectionData
901 Given the input file pointer, search for the next matching section in the
905 PeiServices - Pointer to the PEI Core Services Table.
906 SearchType - Filter to find only sections of this type.
907 FfsFileHeader - Pointer to the current file to search.
908 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
909 - NULL if section not found
912 EFI_NOT_FOUND - No files matching the search criteria were found
920 PeiFvFindNextVolume (
921 IN CONST EFI_PEI_SERVICES
**PeiServices
,
923 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
929 Return the BFV location
931 BugBug -- Move this to the location of this code to where the
932 other FV and FFS support code lives.
933 Also, update to use FindFV for instances #'s >= 1.
937 PeiServices - The PEI core services table.
938 Instance - Instance of FV to find
939 FwVolHeader - Pointer to contain the data to return
942 Pointer to the Firmware Volume instance requested
944 EFI_INVALID_PARAMETER - FwVolHeader is NULL
946 EFI_SUCCESS - Firmware volume instance successfully found.
952 // Memory support functions
955 InitializeMemoryServices (
956 IN PEI_CORE_INSTANCE
*PrivateData
,
957 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
958 IN PEI_CORE_INSTANCE
*OldCoreData
964 Initialize the memory services.
968 PeiServices - The PEI core services table.
969 PeiStartupDescriptor - Information and services provided by SEC phase.
970 OldCoreData - Pointer to the PEI Core data.
971 NULL if being run in non-permament memory mode.
982 PeiInstallPeiMemory (
983 IN CONST EFI_PEI_SERVICES
**PeiServices
,
984 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
985 IN UINT64 MemoryLength
991 Install the permanent memory is now available.
992 Creates HOB (PHIT and Stack).
996 PeiServices - The PEI core services table.
997 MemoryBegin - Start of memory address.
998 MemoryLength - Length of memory.
1002 Status - EFI_SUCCESS
1010 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1011 IN EFI_MEMORY_TYPE MemoryType
,
1013 OUT EFI_PHYSICAL_ADDRESS
*Memory
1017 Routine Description:
1019 Memory allocation service on permanent memory,
1020 not usable prior to the memory installation.
1024 PeiServices - The PEI core services table.
1025 Type - Type of allocation.
1026 MemoryType - Type of memory to allocate.
1027 Pages - Number of pages to allocate.
1028 Memory - Pointer of memory allocated.
1032 Status - EFI_SUCCESS The allocation was successful
1033 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1034 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1035 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1036 to allocate the number of pages.
1044 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1050 Routine Description:
1052 Memory allocation service on the CAR.
1056 PeiServices - The PEI core services table.
1058 Size - Amount of memory required
1060 Buffer - Address of pointer to the buffer
1064 Status - EFI_SUCCESS The allocation was successful
1065 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1066 to allocate the requested size.
1073 IN EFI_PEI_SERVICES
**PeiServices
,
1074 IN EFI_PEI_FILE_HANDLE FileHandle
,
1075 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1076 OUT UINT32
*AuthenticationState
1080 Routine Description:
1082 Get entry point of a Peim file.
1086 PeiServices - Calling context.
1088 PeimFileHeader - Peim file's header.
1090 EntryPoint - Entry point of that Peim file.
1102 PeiReportStatusCode (
1103 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1104 IN EFI_STATUS_CODE_TYPE CodeType
,
1105 IN EFI_STATUS_CODE_VALUE Value
,
1107 IN CONST EFI_GUID
*CallerId
,
1108 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1112 Routine Description:
1114 Core version of the Status Code reporter
1118 PeiServices - The PEI core services table.
1120 CodeType - Type of Status Code.
1122 Value - Value to output for Status Code.
1124 Instance - Instance Number of this status code.
1126 CallerId - ID of the caller of this status code.
1128 Data - Optional data associated with this status code.
1132 Status - EFI_SUCCESS if status code is successfully reported
1133 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1142 IN CONST EFI_PEI_SERVICES
**PeiServices
1146 Routine Description:
1148 Core version of the Reset System
1152 PeiServices - The PEI core services table.
1156 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1157 - EFI_DEVICE_ERROR. Did not reset system.
1159 Otherwise, resets the system.
1166 IN PEI_CORE_INSTANCE
*PrivateData
,
1167 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1171 Routine Description:
1173 Initialize PeiCore Fv List.
1176 PrivateData - Pointer to PEI_CORE_INSTANCE.
1177 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1187 FirmwareVolmeInfoPpiNotifyCallback (
1188 IN EFI_PEI_SERVICES
**PeiServices
,
1189 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1194 Routine Description:
1196 Process Firmware Volum Information once FvInfoPPI install.
1200 PeiServices - General purpose services available to every PEIM.
1204 Status - EFI_SUCCESS if the interface could be successfully
1213 PeiFfsFindFileByName (
1214 IN CONST EFI_GUID
*FileName
,
1215 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1216 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1220 Routine Description:
1222 Given the input VolumeHandle, search for the next matching name file.
1226 FileName - File name to search.
1227 VolumeHandle - The current FV to search.
1228 FileHandle - Pointer to the file matching name in VolumeHandle.
1229 - NULL if file not found
1240 IN EFI_PEI_FILE_HANDLE FileHandle
,
1241 OUT EFI_FV_FILE_INFO
*FileInfo
1245 Routine Description:
1247 Collect information of given file.
1250 FileHandle - The handle to file.
1251 FileInfo - Pointer to the file information.
1261 PeiFfsGetVolumeInfo (
1262 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1263 OUT EFI_FV_INFO
*VolumeInfo
1267 Routine Description:
1269 Collect information of given Fv Volume.
1272 VolumeHandle - The handle to Fv Volume.
1273 VolumeInfo - The pointer to volume information.
1284 PeiRegisterForShadow (
1285 IN EFI_PEI_FILE_HANDLE FileHandle
1289 Routine Description:
1291 This routine enable a PEIM to register itself to shadow when PEI Foundation
1292 discovery permanent memory.
1295 FileHandle - File handle of a PEIM.
1298 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1299 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1300 EFI_SUCCESS - Successfully to register itself.
1307 This routine enable a PEIM to register itself to shadow when PEI Foundation
1308 discovery permanent memory.
1310 @param FileHandle File handle of a PEIM.
1312 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1313 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1314 @retval EFI_SUCCESS Successfully to register itself.
1319 PeiRegisterForShadow (
1320 IN EFI_PEI_FILE_HANDLE FileHandle
1325 Transfers control to a function starting with a new stack.
1327 Transfers control to the function specified by EntryPoint using the new stack
1328 specified by NewStack and passing in the parameters specified by Context1 and
1329 Context2. Context1 and Context2 are optional and may be NULL. The function
1330 EntryPoint must never return.
1332 If EntryPoint is NULL, then ASSERT().
1333 If NewStack is NULL, then ASSERT().
1335 @param EntryPoint A pointer to function to call with the new stack.
1336 @param Context1 A pointer to the context to pass into the EntryPoint
1338 @param Context2 A pointer to the context to pass into the EntryPoint
1340 @param NewStack A pointer to the new stack to use for the EntryPoint
1342 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1343 Reserved on other architectures.
1349 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1350 IN VOID
*Context1
, OPTIONAL
1351 IN VOID
*Context2
, OPTIONAL
1358 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1359 IN CONST EFI_GUID
*FileName
, OPTIONAL
1360 IN EFI_FV_FILETYPE SearchType
,
1361 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1362 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1366 Routine Description:
1367 Given the input file pointer, search for the next matching file in the
1368 FFS volume as defined by SearchType. The search starts from FileHeader inside
1369 the Firmware Volume defined by FwVolHeader.
1372 PeiServices - Pointer to the PEI Core Services Table.
1373 SearchType - Filter to find only files of this type.
1374 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1375 FwVolHeader - Pointer to the FV header of the volume to search.
1376 This parameter must point to a valid FFS volume.
1377 FileHeader - Pointer to the current file from which to begin searching.
1378 This pointer will be updated upon return to reflect the file found.
1379 Flag - Indicator for if this is for PEI Dispath search
1382 EFI_NOT_FOUND - No files matching the search criteria were found
1389 InitializeImageServices (
1390 IN PEI_CORE_INSTANCE
*PrivateData
,
1391 IN PEI_CORE_INSTANCE
*OldCoreData
1395 Routine Description:
1397 Install Pei Load File PPI.
1401 PrivateData - Pointer to PEI_CORE_INSTANCE.
1402 OldCoreData - Pointer to PEI_CORE_INSTANCE.