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 <Ppi/SecPlatformInformation.h>
41 #include <Library/DebugLib.h>
42 #include <Library/PeiCoreEntryPoint.h>
43 #include <Library/BaseLib.h>
44 #include <Library/HobLib.h>
45 #include <Library/PerformanceLib.h>
46 #include <Library/PeiServicesLib.h>
47 #include <Library/ReportStatusCodeLib.h>
48 #include <Library/PeCoffLib.h>
49 #include <Library/PeCoffGetEntryPointLib.h>
50 #include <Library/BaseMemoryLib.h>
51 #include <Library/CacheMaintenanceLib.h>
52 #include <Library/TimerLib.h>
53 #include <Library/PcdLib.h>
54 #include <IndustryStandard/PeImage.h>
55 #include <Library/PeiServicesTablePointerLib.h>
56 #include <Library/MemoryAllocationLib.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
;
103 // Pei Core private data structure instance
106 #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')
110 EFI_PEI_SERVICES
*PS
; // Point to ServiceTableShadow
111 PEI_PPI_DATABASE PpiData
;
113 PEI_CORE_FV_HANDLE Fv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
114 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv
)];
116 UINTN CurrentPeimFvCount
;
117 UINTN CurrentPeimCount
;
118 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
120 EFI_PEI_FV_HANDLE AllFv
[FixedPcdGet32 (PcdPeiCoreMaxFvSupported
)];
121 EFI_PEI_HOB_POINTERS HobList
;
122 BOOLEAN SwitchStackSignal
;
123 BOOLEAN PeiMemoryInstalled
;
124 EFI_PHYSICAL_ADDRESS StackBase
;
126 VOID
*BottomOfCarHeap
;
129 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
130 EFI_PEI_SERVICES ServiceTableShadow
;
131 UINTN SizeOfCacheAsRam
;
132 VOID
*MaxTopOfCarHeap
;
133 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
137 // Pei Core Instance Data Macros
140 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
141 CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)
144 // BUGBUG: Where does this go really?
148 (EFIAPI
*PEI_CORE_ENTRY_POINT
)(
149 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
150 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
151 IN PEI_CORE_INSTANCE
*OldCoreData
155 // Union of temporarily used function pointers (to save stack space)
158 PEI_CORE_ENTRY_POINT PeiCore
;
159 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
160 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
161 EFI_DXE_IPL_PPI
*DxeIpl
;
162 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
163 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
165 } PEI_CORE_TEMP_POINTERS
;
170 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
171 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
173 } PEI_CORE_PARAMETERS
;
181 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
182 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpList
,
189 The entry routine to Pei Core, invoked by PeiMain during transition
190 from SEC to PEI. After switching stack in the PEI core, it will restart
191 with the old core data.
195 PeiStartupDescriptor - Information and services provided by SEC phase.
196 OldCoreData - Pointer to old core data that is used to initialize the
201 This function never returns
202 EFI_NOT_FOUND - Never reach
208 // Dispatcher support functions
212 PeimDispatchReadiness (
213 IN EFI_PEI_SERVICES
**PeiServices
,
214 IN VOID
*DependencyExpression
220 This is the POSTFIX version of the dependency evaluator. When a
221 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
222 the evaluation stack. When that entry is poped from the evaluation
223 stack, the PPI is checked if it is installed. This method allows
224 some time savings as not all PPIs must be checked for certain
225 operation types (AND, OR).
229 PeiServices - Calling context.
231 DependencyExpression - Pointer to a dependency expression. The Grammar adheres to
232 the BNF described above and is stored in postfix notation.
236 Status = EFI_SUCCESS if it is a well-formed Grammar
237 EFI_INVALID_PARAMETER if the dependency expression overflows
239 EFI_INVALID_PARAMETER if the dependency expression underflows
241 EFI_INVALID_PARAMETER if the dependency expression is not a
249 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
250 IN PEI_CORE_INSTANCE
*PrivateData
257 Conduct PEIM dispatch.
261 PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
262 PrivateData - Pointer to the private data passed in from caller
263 DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
267 EFI_SUCCESS - Successfully dispatched PEIM.
268 EFI_NOT_FOUND - The dispatch failed.
275 InitializeDispatcherData (
276 IN PEI_CORE_INSTANCE
*PrivateData
,
277 IN PEI_CORE_INSTANCE
*OldCoreData
,
278 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
284 Initialize the Dispatcher's data members
288 PeiServices - The PEI core services table.
289 OldCoreData - Pointer to old core data (before switching stack).
290 NULL if being run in non-permament memory mode.
291 PeiStartupDescriptor - Information and services provided by SEC phase.
304 IN UINT8 CurrentPeim
,
305 IN UINT32 DispatchedPeimBitMap
311 This routine checks to see if a particular PEIM has been dispatched during
312 the PEI core dispatch.
315 CurrentPeim - The PEIM/FV in the bit array to check.
316 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
319 TRUE if PEIM already dispatched
327 IN EFI_PEI_SERVICES
**PeiServices
,
328 IN UINT8 CurrentPeim
,
329 OUT UINT32
*DispatchedPeimBitMap
335 This routine sets a PEIM as having been dispatched once its entry
336 point has been invoked.
340 PeiServices - The PEI core services table.
341 CurrentPeim - The PEIM/FV in the bit array to check.
342 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
352 IN PEI_CORE_INSTANCE
*Private
,
353 IN EFI_PEI_FILE_HANDLE FileHandle
,
360 This routine parses the Dependency Expression, if available, and
361 decides if the module can be executed.
364 PeiServices - The PEI Service Table
365 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
368 TRUE - Can be dispatched
369 FALSE - Cannot be dispatched
374 #if defined (MDE_CPU_IPF)
376 // In Ipf we should make special changes for the PHIT pointers to support
377 // recovery boot in cache mode.
379 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
380 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
383 IN PEI_CORE_INSTANCE
*CoreData
389 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
393 CoreData - The PEI core Private Data
402 #define SWITCH_TO_CACHE_MODE(CoreData)
407 // PPI support functions
410 InitializePpiServices (
411 IN PEI_CORE_INSTANCE
*PrivateData
,
412 IN PEI_CORE_INSTANCE
*OldCoreData
418 Initialize PPI services.
422 PeiServices - The PEI core services table.
423 OldCoreData - Pointer to the PEI Core data.
424 NULL if being run in non-permament memory mode.
434 IN CONST EFI_PEI_SERVICES
**PeiServices
,
435 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
436 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
442 Migrate the Hob list from the CAR stack to PEI installed memory.
446 PeiServices - The PEI core services table.
447 OldHandOffHob - The old handoff HOB list.
448 NewHandOffHob - The new handoff HOB list.
458 IN CONST EFI_PEI_SERVICES
**PeiServices
,
459 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
465 Install PPI services.
469 PeiServices - Pointer to the PEI Service Table
470 PpiList - Pointer to a list of PEI PPI Descriptors.
474 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
475 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
476 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
477 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
485 IN CONST EFI_PEI_SERVICES
**PeiServices
,
486 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
487 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
493 Re-Install PPI services.
497 PeiServices - Pointer to the PEI Service Table
498 OldPpi - Pointer to the old PEI PPI Descriptors.
499 NewPpi - Pointer to the new PEI PPI Descriptors.
503 EFI_SUCCESS - if the operation was successful
504 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
505 EFI_INVALID_PARAMETER - if NewPpi is not valid
506 EFI_NOT_FOUND - if the PPI was not in the database
514 IN CONST EFI_PEI_SERVICES
**PeiServices
,
515 IN CONST EFI_GUID
*Guid
,
517 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
524 Locate a given named PPI.
528 PeiServices - Pointer to the PEI Service Table
529 Guid - Pointer to GUID of the PPI.
530 Instance - Instance Number to discover.
531 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
532 returns a pointer to the descriptor (includes flags, etc)
533 Ppi - Pointer to reference the found PPI
537 Status - EFI_SUCCESS if the PPI is in the database
538 EFI_NOT_FOUND if the PPI is not in the database
545 IN CONST EFI_PEI_SERVICES
**PeiServices
,
546 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
552 Install a notification for a given PPI.
556 PeiServices - Pointer to the PEI Service Table
557 NotifyList - Pointer to list of Descriptors to notify upon.
561 Status - EFI_SUCCESS if successful
562 EFI_OUT_OF_RESOURCES if no space in the database
563 EFI_INVALID_PARAMETER if not a good decriptor
570 IN PEI_CORE_INSTANCE
*PrivateData
576 Process the Notify List at dispatch level.
580 PeiServices - Pointer to the PEI Service Table
589 IN PEI_CORE_INSTANCE
*PrivateData
,
591 IN INTN InstallStartIndex
,
592 IN INTN InstallStopIndex
,
593 IN INTN NotifyStartIndex
,
594 IN INTN NotifyStopIndex
600 Dispatch notifications.
604 PeiServices - Pointer to the PEI Service Table
605 NotifyType - Type of notify to fire.
606 InstallStartIndex - Install Beginning index.
607 InstallStopIndex - Install Ending index.
608 NotifyStartIndex - Notify Beginning index.
609 NotifyStopIndex - Notify Ending index.
617 // Boot mode support functions
622 IN CONST EFI_PEI_SERVICES
**PeiServices
,
623 IN OUT EFI_BOOT_MODE
*BootMode
629 This service enables PEIMs to ascertain the present value of the boot mode.
633 PeiServices - The PEI core services table.
634 BootMode - A pointer to contain the value of the boot mode.
638 EFI_SUCCESS - The boot mode was returned successfully.
639 EFI_INVALID_PARAMETER - BootMode is NULL.
647 IN CONST EFI_PEI_SERVICES
**PeiServices
,
648 IN EFI_BOOT_MODE BootMode
654 This service enables PEIMs to update the boot mode variable.
658 PeiServices - The PEI core services table.
659 BootMode - The value of the boot mode to set.
663 EFI_SUCCESS - The value was successfully updated
669 // Security support functions
672 InitializeSecurityServices (
673 IN EFI_PEI_SERVICES
**PeiServices
,
674 IN PEI_CORE_INSTANCE
*OldCoreData
680 Initialize the security services.
684 PeiServices - The PEI core services table.
685 OldCoreData - Pointer to the old core data.
686 NULL if being run in non-permament memory mode.
696 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
702 Provide a callout to the OEM FV verification service.
706 CurrentFvAddress - Pointer to the FV under investigation.
718 IN PEI_CORE_INSTANCE
*PrivateData
,
719 IN EFI_PEI_FV_HANDLE VolumeHandle
,
720 IN EFI_PEI_FILE_HANDLE FileHandle
726 Provide a callout to the security verification service.
730 PeiServices - The PEI core services table.
731 CurrentPeimAddress - Pointer to the Firmware File under investigation.
735 EFI_SUCCESS - Image is OK
736 EFI_SECURITY_VIOLATION - Image is illegal
745 IN CONST EFI_PEI_SERVICES
**PeiServices
,
746 IN OUT VOID
**HobList
752 Gets the pointer to the HOB List.
756 PeiServices - The PEI core services table.
757 HobList - Pointer to the HOB List.
761 EFI_SUCCESS - Get the pointer of HOB List
762 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
763 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
771 IN CONST EFI_PEI_SERVICES
**PeiServices
,
780 Add a new HOB to the HOB List.
784 PeiServices - The PEI core services table.
785 Type - Type of the new HOB.
786 Length - Length of the new HOB to allocate.
787 Hob - Pointer to the new HOB.
792 - EFI_INVALID_PARAMETER if Hob is NULL
793 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
794 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
800 PeiCoreBuildHobHandoffInfoTable (
801 IN EFI_BOOT_MODE BootMode
,
802 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
803 IN UINT64 MemoryLength
809 Builds a Handoff Information Table HOB
813 BootMode - Current Bootmode
814 MemoryBegin - Start Memory Address.
815 MemoryLength - Length of Memory.
826 // FFS Fw Volume support functions
831 IN CONST EFI_PEI_SERVICES
**PeiServices
,
833 IN EFI_PEI_FV_HANDLE FwVolHeader
,
834 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
839 Given the input file pointer, search for the next matching file in the
840 FFS volume as defined by SearchType. The search starts from FileHeader inside
841 the Firmware Volume defined by FwVolHeader.
844 PeiServices - Pointer to the PEI Core Services Table.
846 SearchType - Filter to find only files of this type.
847 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
849 FwVolHeader - Pointer to the FV header of the volume to search.
850 This parameter must point to a valid FFS volume.
852 FileHeader - Pointer to the current file from which to begin searching.
853 This pointer will be updated upon return to reflect the file found.
856 EFI_NOT_FOUND - No files matching the search criteria were found
864 PeiFfsFindSectionData (
865 IN CONST EFI_PEI_SERVICES
**PeiServices
,
866 IN EFI_SECTION_TYPE SectionType
,
867 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
868 IN OUT VOID
**SectionData
873 Given the input file pointer, search for the next matching section in the
877 PeiServices - Pointer to the PEI Core Services Table.
878 SearchType - Filter to find only sections of this type.
879 FfsFileHeader - Pointer to the current file to search.
880 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
881 - NULL if section not found
884 EFI_NOT_FOUND - No files matching the search criteria were found
892 PeiFvFindNextVolume (
893 IN CONST EFI_PEI_SERVICES
**PeiServices
,
895 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
901 Return the BFV location
903 BugBug -- Move this to the location of this code to where the
904 other FV and FFS support code lives.
905 Also, update to use FindFV for instances #'s >= 1.
909 PeiServices - The PEI core services table.
910 Instance - Instance of FV to find
911 FwVolHeader - Pointer to contain the data to return
914 Pointer to the Firmware Volume instance requested
916 EFI_INVALID_PARAMETER - FwVolHeader is NULL
918 EFI_SUCCESS - Firmware volume instance successfully found.
924 // Memory support functions
927 InitializeMemoryServices (
928 IN PEI_CORE_INSTANCE
*PrivateData
,
929 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
930 IN PEI_CORE_INSTANCE
*OldCoreData
936 Initialize the memory services.
940 PeiServices - The PEI core services table.
941 PeiStartupDescriptor - Information and services provided by SEC phase.
942 OldCoreData - Pointer to the PEI Core data.
943 NULL if being run in non-permament memory mode.
954 PeiInstallPeiMemory (
955 IN CONST EFI_PEI_SERVICES
**PeiServices
,
956 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
957 IN UINT64 MemoryLength
963 Install the permanent memory is now available.
964 Creates HOB (PHIT and Stack).
968 PeiServices - The PEI core services table.
969 MemoryBegin - Start of memory address.
970 MemoryLength - Length of memory.
982 IN CONST EFI_PEI_SERVICES
**PeiServices
,
983 IN EFI_MEMORY_TYPE MemoryType
,
985 OUT EFI_PHYSICAL_ADDRESS
*Memory
991 Memory allocation service on permanent memory,
992 not usable prior to the memory installation.
996 PeiServices - The PEI core services table.
997 Type - Type of allocation.
998 MemoryType - Type of memory to allocate.
999 Pages - Number of pages to allocate.
1000 Memory - Pointer of memory allocated.
1004 Status - EFI_SUCCESS The allocation was successful
1005 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1006 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1007 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1008 to allocate the number of pages.
1016 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1022 Routine Description:
1024 Memory allocation service on the CAR.
1028 PeiServices - The PEI core services table.
1030 Size - Amount of memory required
1032 Buffer - Address of pointer to the buffer
1036 Status - EFI_SUCCESS The allocation was successful
1037 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1038 to allocate the requested size.
1045 IN EFI_PEI_SERVICES
**PeiServices
,
1046 IN EFI_PEI_FILE_HANDLE FileHandle
,
1047 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1048 OUT UINT32
*AuthenticationState
1052 Routine Description:
1054 Get entry point of a Peim file.
1058 PeiServices - Calling context.
1060 PeimFileHeader - Peim file's header.
1062 EntryPoint - Entry point of that Peim file.
1074 PeiReportStatusCode (
1075 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1076 IN EFI_STATUS_CODE_TYPE CodeType
,
1077 IN EFI_STATUS_CODE_VALUE Value
,
1079 IN CONST EFI_GUID
*CallerId
,
1080 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1084 Routine Description:
1086 Core version of the Status Code reporter
1090 PeiServices - The PEI core services table.
1092 CodeType - Type of Status Code.
1094 Value - Value to output for Status Code.
1096 Instance - Instance Number of this status code.
1098 CallerId - ID of the caller of this status code.
1100 Data - Optional data associated with this status code.
1104 Status - EFI_SUCCESS if status code is successfully reported
1105 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1114 IN CONST EFI_PEI_SERVICES
**PeiServices
1118 Routine Description:
1120 Core version of the Reset System
1124 PeiServices - The PEI core services table.
1128 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1129 - EFI_DEVICE_ERROR. Did not reset system.
1131 Otherwise, resets the system.
1138 IN PEI_CORE_INSTANCE
*PrivateData
,
1139 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1143 Routine Description:
1145 Initialize PeiCore Fv List.
1148 PrivateData - Pointer to PEI_CORE_INSTANCE.
1149 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1159 FirmwareVolmeInfoPpiNotifyCallback (
1160 IN EFI_PEI_SERVICES
**PeiServices
,
1161 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1166 Routine Description:
1168 Process Firmware Volum Information once FvInfoPPI install.
1172 PeiServices - General purpose services available to every PEIM.
1176 Status - EFI_SUCCESS if the interface could be successfully
1185 PeiFfsFindFileByName (
1186 IN CONST EFI_GUID
*FileName
,
1187 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1188 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1192 Routine Description:
1194 Given the input VolumeHandle, search for the next matching name file.
1198 FileName - File name to search.
1199 VolumeHandle - The current FV to search.
1200 FileHandle - Pointer to the file matching name in VolumeHandle.
1201 - NULL if file not found
1212 IN EFI_PEI_FILE_HANDLE FileHandle
,
1213 OUT EFI_FV_FILE_INFO
*FileInfo
1217 Routine Description:
1219 Collect information of given file.
1222 FileHandle - The handle to file.
1223 FileInfo - Pointer to the file information.
1233 PeiFfsGetVolumeInfo (
1234 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1235 OUT EFI_FV_INFO
*VolumeInfo
1239 Routine Description:
1241 Collect information of given Fv Volume.
1244 VolumeHandle - The handle to Fv Volume.
1245 VolumeInfo - The pointer to volume information.
1256 PeiRegisterForShadow (
1257 IN EFI_PEI_FILE_HANDLE FileHandle
1261 Routine Description:
1263 This routine enable a PEIM to register itself to shadow when PEI Foundation
1264 discovery permanent memory.
1267 FileHandle - File handle of a PEIM.
1270 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1271 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1272 EFI_SUCCESS - Successfully to register itself.
1279 This routine enable a PEIM to register itself to shadow when PEI Foundation
1280 discovery permanent memory.
1282 @param FileHandle File handle of a PEIM.
1284 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1285 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1286 @retval EFI_SUCCESS Successfully to register itself.
1291 PeiRegisterForShadow (
1292 IN EFI_PEI_FILE_HANDLE FileHandle
1297 Transfers control to a function starting with a new stack.
1299 Transfers control to the function specified by EntryPoint using the new stack
1300 specified by NewStack and passing in the parameters specified by Context1 and
1301 Context2. Context1 and Context2 are optional and may be NULL. The function
1302 EntryPoint must never return.
1304 If EntryPoint is NULL, then ASSERT().
1305 If NewStack is NULL, then ASSERT().
1307 @param EntryPoint A pointer to function to call with the new stack.
1308 @param Context1 A pointer to the context to pass into the EntryPoint
1310 @param Context2 A pointer to the context to pass into the EntryPoint
1312 @param NewStack A pointer to the new stack to use for the EntryPoint
1314 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1315 Reserved on other architectures.
1321 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1322 IN VOID
*Context1
, OPTIONAL
1323 IN VOID
*Context2
, OPTIONAL
1330 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1331 IN CONST EFI_GUID
*FileName
, OPTIONAL
1332 IN EFI_FV_FILETYPE SearchType
,
1333 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1334 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1338 Routine Description:
1339 Given the input file pointer, search for the next matching file in the
1340 FFS volume as defined by SearchType. The search starts from FileHeader inside
1341 the Firmware Volume defined by FwVolHeader.
1344 PeiServices - Pointer to the PEI Core Services Table.
1345 SearchType - Filter to find only files of this type.
1346 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1347 FwVolHeader - Pointer to the FV header of the volume to search.
1348 This parameter must point to a valid FFS volume.
1349 FileHeader - Pointer to the current file from which to begin searching.
1350 This pointer will be updated upon return to reflect the file found.
1351 Flag - Indicator for if this is for PEI Dispath search
1354 EFI_NOT_FOUND - No files matching the search criteria were found
1361 InitializeImageServices (
1362 IN PEI_CORE_INSTANCE
*PrivateData
,
1363 IN PEI_CORE_INSTANCE
*OldCoreData
1367 Routine Description:
1369 Install Pei Load File PPI.
1373 PrivateData - Pointer to PEI_CORE_INSTANCE.
1374 OldCoreData - Pointer to PEI_CORE_INSTANCE.