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 UINT8 CurrentPeim
,
304 IN UINT32 DispatchedPeimBitMap
310 This routine checks to see if a particular PEIM has been dispatched during
311 the PEI core dispatch.
314 CurrentPeim - The PEIM/FV in the bit array to check.
315 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
318 TRUE if PEIM already dispatched
326 IN EFI_PEI_SERVICES
**PeiServices
,
327 IN UINT8 CurrentPeim
,
328 OUT UINT32
*DispatchedPeimBitMap
334 This routine sets a PEIM as having been dispatched once its entry
335 point has been invoked.
339 PeiServices - The PEI core services table.
340 CurrentPeim - The PEIM/FV in the bit array to check.
341 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
351 IN PEI_CORE_INSTANCE
*Private
,
352 IN EFI_PEI_FILE_HANDLE FileHandle
,
359 This routine parses the Dependency Expression, if available, and
360 decides if the module can be executed.
363 PeiServices - The PEI Service Table
364 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
367 TRUE - Can be dispatched
368 FALSE - Cannot be dispatched
373 #if defined (MDE_CPU_IPF)
375 // In Ipf we should make special changes for the PHIT pointers to support
376 // recovery boot in cache mode.
378 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
379 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
382 IN PEI_CORE_INSTANCE
*CoreData
388 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
392 CoreData - The PEI core Private Data
401 #define SWITCH_TO_CACHE_MODE(CoreData)
406 // PPI support functions
409 InitializePpiServices (
410 IN PEI_CORE_INSTANCE
*PrivateData
,
411 IN PEI_CORE_INSTANCE
*OldCoreData
417 Initialize PPI services.
421 PeiServices - The PEI core services table.
422 OldCoreData - Pointer to the PEI Core data.
423 NULL if being run in non-permament memory mode.
433 IN CONST EFI_PEI_SERVICES
**PeiServices
,
434 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
435 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
441 Migrate the Hob list from the CAR stack to PEI installed memory.
445 PeiServices - The PEI core services table.
446 OldHandOffHob - The old handoff HOB list.
447 NewHandOffHob - The new handoff HOB list.
457 IN CONST EFI_PEI_SERVICES
**PeiServices
,
458 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
464 Install PPI services.
468 PeiServices - Pointer to the PEI Service Table
469 PpiList - Pointer to a list of PEI PPI Descriptors.
473 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
474 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
475 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
476 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
484 IN CONST EFI_PEI_SERVICES
**PeiServices
,
485 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
486 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
492 Re-Install PPI services.
496 PeiServices - Pointer to the PEI Service Table
497 OldPpi - Pointer to the old PEI PPI Descriptors.
498 NewPpi - Pointer to the new PEI PPI Descriptors.
502 EFI_SUCCESS - if the operation was successful
503 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
504 EFI_INVALID_PARAMETER - if NewPpi is not valid
505 EFI_NOT_FOUND - if the PPI was not in the database
513 IN CONST EFI_PEI_SERVICES
**PeiServices
,
514 IN CONST EFI_GUID
*Guid
,
516 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
523 Locate a given named PPI.
527 PeiServices - Pointer to the PEI Service Table
528 Guid - Pointer to GUID of the PPI.
529 Instance - Instance Number to discover.
530 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
531 returns a pointer to the descriptor (includes flags, etc)
532 Ppi - Pointer to reference the found PPI
536 Status - EFI_SUCCESS if the PPI is in the database
537 EFI_NOT_FOUND if the PPI is not in the database
544 IN CONST EFI_PEI_SERVICES
**PeiServices
,
545 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
551 Install a notification for a given PPI.
555 PeiServices - Pointer to the PEI Service Table
556 NotifyList - Pointer to list of Descriptors to notify upon.
560 Status - EFI_SUCCESS if successful
561 EFI_OUT_OF_RESOURCES if no space in the database
562 EFI_INVALID_PARAMETER if not a good decriptor
569 IN PEI_CORE_INSTANCE
*PrivateData
575 Process the Notify List at dispatch level.
579 PeiServices - Pointer to the PEI Service Table
588 IN PEI_CORE_INSTANCE
*PrivateData
,
590 IN INTN InstallStartIndex
,
591 IN INTN InstallStopIndex
,
592 IN INTN NotifyStartIndex
,
593 IN INTN NotifyStopIndex
599 Dispatch notifications.
603 PeiServices - Pointer to the PEI Service Table
604 NotifyType - Type of notify to fire.
605 InstallStartIndex - Install Beginning index.
606 InstallStopIndex - Install Ending index.
607 NotifyStartIndex - Notify Beginning index.
608 NotifyStopIndex - Notify Ending index.
616 // Boot mode support functions
621 IN CONST EFI_PEI_SERVICES
**PeiServices
,
622 IN OUT EFI_BOOT_MODE
*BootMode
628 This service enables PEIMs to ascertain the present value of the boot mode.
632 PeiServices - The PEI core services table.
633 BootMode - A pointer to contain the value of the boot mode.
637 EFI_SUCCESS - The boot mode was returned successfully.
638 EFI_INVALID_PARAMETER - BootMode is NULL.
646 IN CONST EFI_PEI_SERVICES
**PeiServices
,
647 IN EFI_BOOT_MODE BootMode
653 This service enables PEIMs to update the boot mode variable.
657 PeiServices - The PEI core services table.
658 BootMode - The value of the boot mode to set.
662 EFI_SUCCESS - The value was successfully updated
668 // Security support functions
671 InitializeSecurityServices (
672 IN EFI_PEI_SERVICES
**PeiServices
,
673 IN PEI_CORE_INSTANCE
*OldCoreData
679 Initialize the security services.
683 PeiServices - The PEI core services table.
684 OldCoreData - Pointer to the old core data.
685 NULL if being run in non-permament memory mode.
695 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
701 Provide a callout to the OEM FV verification service.
705 CurrentFvAddress - Pointer to the FV under investigation.
717 IN PEI_CORE_INSTANCE
*PrivateData
,
718 IN EFI_PEI_FV_HANDLE VolumeHandle
,
719 IN EFI_PEI_FILE_HANDLE FileHandle
725 Provide a callout to the security verification service.
729 PeiServices - The PEI core services table.
730 CurrentPeimAddress - Pointer to the Firmware File under investigation.
734 EFI_SUCCESS - Image is OK
735 EFI_SECURITY_VIOLATION - Image is illegal
744 IN CONST EFI_PEI_SERVICES
**PeiServices
,
745 IN OUT VOID
**HobList
751 Gets the pointer to the HOB List.
755 PeiServices - The PEI core services table.
756 HobList - Pointer to the HOB List.
760 EFI_SUCCESS - Get the pointer of HOB List
761 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
762 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
770 IN CONST EFI_PEI_SERVICES
**PeiServices
,
779 Add a new HOB to the HOB List.
783 PeiServices - The PEI core services table.
784 Type - Type of the new HOB.
785 Length - Length of the new HOB to allocate.
786 Hob - Pointer to the new HOB.
791 - EFI_INVALID_PARAMETER if Hob is NULL
792 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
793 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
799 PeiCoreBuildHobHandoffInfoTable (
800 IN EFI_BOOT_MODE BootMode
,
801 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
802 IN UINT64 MemoryLength
808 Builds a Handoff Information Table HOB
812 BootMode - Current Bootmode
813 MemoryBegin - Start Memory Address.
814 MemoryLength - Length of Memory.
825 // FFS Fw Volume support functions
830 IN CONST EFI_PEI_SERVICES
**PeiServices
,
832 IN EFI_PEI_FV_HANDLE FwVolHeader
,
833 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
838 Given the input file pointer, search for the next matching file in the
839 FFS volume as defined by SearchType. The search starts from FileHeader inside
840 the Firmware Volume defined by FwVolHeader.
843 PeiServices - Pointer to the PEI Core Services Table.
845 SearchType - Filter to find only files of this type.
846 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
848 FwVolHeader - Pointer to the FV header of the volume to search.
849 This parameter must point to a valid FFS volume.
851 FileHeader - Pointer to the current file from which to begin searching.
852 This pointer will be updated upon return to reflect the file found.
855 EFI_NOT_FOUND - No files matching the search criteria were found
863 PeiFfsFindSectionData (
864 IN CONST EFI_PEI_SERVICES
**PeiServices
,
865 IN EFI_SECTION_TYPE SectionType
,
866 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
867 IN OUT VOID
**SectionData
872 Given the input file pointer, search for the next matching section in the
876 PeiServices - Pointer to the PEI Core Services Table.
877 SearchType - Filter to find only sections of this type.
878 FfsFileHeader - Pointer to the current file to search.
879 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
880 - NULL if section not found
883 EFI_NOT_FOUND - No files matching the search criteria were found
891 PeiFvFindNextVolume (
892 IN CONST EFI_PEI_SERVICES
**PeiServices
,
894 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
900 Return the BFV location
902 BugBug -- Move this to the location of this code to where the
903 other FV and FFS support code lives.
904 Also, update to use FindFV for instances #'s >= 1.
908 PeiServices - The PEI core services table.
909 Instance - Instance of FV to find
910 FwVolHeader - Pointer to contain the data to return
913 Pointer to the Firmware Volume instance requested
915 EFI_INVALID_PARAMETER - FwVolHeader is NULL
917 EFI_SUCCESS - Firmware volume instance successfully found.
923 // Memory support functions
926 InitializeMemoryServices (
927 IN PEI_CORE_INSTANCE
*PrivateData
,
928 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
929 IN PEI_CORE_INSTANCE
*OldCoreData
935 Initialize the memory services.
939 PeiServices - The PEI core services table.
940 PeiStartupDescriptor - Information and services provided by SEC phase.
941 OldCoreData - Pointer to the PEI Core data.
942 NULL if being run in non-permament memory mode.
953 PeiInstallPeiMemory (
954 IN CONST EFI_PEI_SERVICES
**PeiServices
,
955 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
956 IN UINT64 MemoryLength
962 Install the permanent memory is now available.
963 Creates HOB (PHIT and Stack).
967 PeiServices - The PEI core services table.
968 MemoryBegin - Start of memory address.
969 MemoryLength - Length of memory.
981 IN CONST EFI_PEI_SERVICES
**PeiServices
,
982 IN EFI_MEMORY_TYPE MemoryType
,
984 OUT EFI_PHYSICAL_ADDRESS
*Memory
990 Memory allocation service on permanent memory,
991 not usable prior to the memory installation.
995 PeiServices - The PEI core services table.
996 Type - Type of allocation.
997 MemoryType - Type of memory to allocate.
998 Pages - Number of pages to allocate.
999 Memory - Pointer of memory allocated.
1003 Status - EFI_SUCCESS The allocation was successful
1004 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1005 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1006 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1007 to allocate the number of pages.
1015 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1021 Routine Description:
1023 Memory allocation service on the CAR.
1027 PeiServices - The PEI core services table.
1029 Size - Amount of memory required
1031 Buffer - Address of pointer to the buffer
1035 Status - EFI_SUCCESS The allocation was successful
1036 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1037 to allocate the requested size.
1044 IN EFI_PEI_SERVICES
**PeiServices
,
1045 IN EFI_PEI_FILE_HANDLE FileHandle
,
1046 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1047 OUT UINT32
*AuthenticationState
1051 Routine Description:
1053 Get entry point of a Peim file.
1057 PeiServices - Calling context.
1059 PeimFileHeader - Peim file's header.
1061 EntryPoint - Entry point of that Peim file.
1073 PeiReportStatusCode (
1074 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1075 IN EFI_STATUS_CODE_TYPE CodeType
,
1076 IN EFI_STATUS_CODE_VALUE Value
,
1078 IN CONST EFI_GUID
*CallerId
,
1079 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1083 Routine Description:
1085 Core version of the Status Code reporter
1089 PeiServices - The PEI core services table.
1091 CodeType - Type of Status Code.
1093 Value - Value to output for Status Code.
1095 Instance - Instance Number of this status code.
1097 CallerId - ID of the caller of this status code.
1099 Data - Optional data associated with this status code.
1103 Status - EFI_SUCCESS if status code is successfully reported
1104 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1113 IN CONST EFI_PEI_SERVICES
**PeiServices
1117 Routine Description:
1119 Core version of the Reset System
1123 PeiServices - The PEI core services table.
1127 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1128 - EFI_DEVICE_ERROR. Did not reset system.
1130 Otherwise, resets the system.
1137 IN PEI_CORE_INSTANCE
*PrivateData
,
1138 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1142 Routine Description:
1144 Initialize PeiCore Fv List.
1147 PrivateData - Pointer to PEI_CORE_INSTANCE.
1148 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1158 FirmwareVolmeInfoPpiNotifyCallback (
1159 IN EFI_PEI_SERVICES
**PeiServices
,
1160 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1165 Routine Description:
1167 Process Firmware Volum Information once FvInfoPPI install.
1171 PeiServices - General purpose services available to every PEIM.
1175 Status - EFI_SUCCESS if the interface could be successfully
1184 PeiFfsFindFileByName (
1185 IN CONST EFI_GUID
*FileName
,
1186 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1187 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1191 Routine Description:
1193 Given the input VolumeHandle, search for the next matching name file.
1197 FileName - File name to search.
1198 VolumeHandle - The current FV to search.
1199 FileHandle - Pointer to the file matching name in VolumeHandle.
1200 - NULL if file not found
1211 IN EFI_PEI_FILE_HANDLE FileHandle
,
1212 OUT EFI_FV_FILE_INFO
*FileInfo
1216 Routine Description:
1218 Collect information of given file.
1221 FileHandle - The handle to file.
1222 FileInfo - Pointer to the file information.
1232 PeiFfsGetVolumeInfo (
1233 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1234 OUT EFI_FV_INFO
*VolumeInfo
1238 Routine Description:
1240 Collect information of given Fv Volume.
1243 VolumeHandle - The handle to Fv Volume.
1244 VolumeInfo - The pointer to volume information.
1255 PeiRegisterForShadow (
1256 IN EFI_PEI_FILE_HANDLE FileHandle
1260 Routine Description:
1262 This routine enable a PEIM to register itself to shadow when PEI Foundation
1263 discovery permanent memory.
1266 FileHandle - File handle of a PEIM.
1269 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1270 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1271 EFI_SUCCESS - Successfully to register itself.
1278 This routine enable a PEIM to register itself to shadow when PEI Foundation
1279 discovery permanent memory.
1281 @param FileHandle File handle of a PEIM.
1283 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1284 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1285 @retval EFI_SUCCESS Successfully to register itself.
1290 PeiRegisterForShadow (
1291 IN EFI_PEI_FILE_HANDLE FileHandle
1296 Transfers control to a function starting with a new stack.
1298 Transfers control to the function specified by EntryPoint using the new stack
1299 specified by NewStack and passing in the parameters specified by Context1 and
1300 Context2. Context1 and Context2 are optional and may be NULL. The function
1301 EntryPoint must never return.
1303 If EntryPoint is NULL, then ASSERT().
1304 If NewStack is NULL, then ASSERT().
1306 @param EntryPoint A pointer to function to call with the new stack.
1307 @param Context1 A pointer to the context to pass into the EntryPoint
1309 @param Context2 A pointer to the context to pass into the EntryPoint
1311 @param NewStack A pointer to the new stack to use for the EntryPoint
1313 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1314 Reserved on other architectures.
1320 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1321 IN VOID
*Context1
, OPTIONAL
1322 IN VOID
*Context2
, OPTIONAL
1329 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1330 IN CONST EFI_GUID
*FileName
, OPTIONAL
1331 IN EFI_FV_FILETYPE SearchType
,
1332 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1333 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1337 Routine Description:
1338 Given the input file pointer, search for the next matching file in the
1339 FFS volume as defined by SearchType. The search starts from FileHeader inside
1340 the Firmware Volume defined by FwVolHeader.
1343 PeiServices - Pointer to the PEI Core Services Table.
1344 SearchType - Filter to find only files of this type.
1345 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1346 FwVolHeader - Pointer to the FV header of the volume to search.
1347 This parameter must point to a valid FFS volume.
1348 FileHeader - Pointer to the current file from which to begin searching.
1349 This pointer will be updated upon return to reflect the file found.
1350 Flag - Indicator for if this is for PEI Dispath search
1353 EFI_NOT_FOUND - No files matching the search criteria were found
1360 InitializeImageServices (
1361 IN PEI_CORE_INSTANCE
*PrivateData
,
1362 IN PEI_CORE_INSTANCE
*OldCoreData
1366 Routine Description:
1368 Install Pei Load File PPI.
1372 PrivateData - Pointer to PEI_CORE_INSTANCE.
1373 OldCoreData - Pointer to PEI_CORE_INSTANCE.