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 EFI_PEI_SERVICES
**PeiServices
,
305 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
306 IN OUT EFI_FFS_FILE_HEADER
**PeimFileHeader
311 Given the input file pointer, search for the next matching file in the
312 FFS volume. The search starts from FileHeader inside
313 the Firmware Volume defined by FwVolHeader.
316 PeiServices - Pointer to the PEI Core Services Table.
318 FwVolHeader - Pointer to the FV header of the volume to search.
319 This parameter must point to a valid FFS volume.
321 PeimFileHeader - Pointer to the current file from which to begin searching.
322 This pointer will be updated upon return to reflect the file found.
325 EFI_NOT_FOUND - No files matching the search criteria were found
333 IN UINT8 CurrentPeim
,
334 IN UINT32 DispatchedPeimBitMap
340 This routine checks to see if a particular PEIM has been dispatched during
341 the PEI core dispatch.
344 CurrentPeim - The PEIM/FV in the bit array to check.
345 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
348 TRUE if PEIM already dispatched
356 IN EFI_PEI_SERVICES
**PeiServices
,
357 IN UINT8 CurrentPeim
,
358 OUT UINT32
*DispatchedPeimBitMap
364 This routine sets a PEIM as having been dispatched once its entry
365 point has been invoked.
369 PeiServices - The PEI core services table.
370 CurrentPeim - The PEIM/FV in the bit array to check.
371 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
381 IN PEI_CORE_INSTANCE
*Private
,
382 IN EFI_PEI_FILE_HANDLE FileHandle
,
389 This routine parses the Dependency Expression, if available, and
390 decides if the module can be executed.
393 PeiServices - The PEI Service Table
394 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
397 TRUE - Can be dispatched
398 FALSE - Cannot be dispatched
403 #if defined (MDE_CPU_IPF)
405 // In Ipf we should make special changes for the PHIT pointers to support
406 // recovery boot in cache mode.
408 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
409 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
412 IN PEI_CORE_INSTANCE
*CoreData
418 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
422 CoreData - The PEI core Private Data
431 #define SWITCH_TO_CACHE_MODE(CoreData)
436 // PPI support functions
439 InitializePpiServices (
440 IN PEI_CORE_INSTANCE
*PrivateData
,
441 IN PEI_CORE_INSTANCE
*OldCoreData
447 Initialize PPI services.
451 PeiServices - The PEI core services table.
452 OldCoreData - Pointer to the PEI Core data.
453 NULL if being run in non-permament memory mode.
463 IN CONST EFI_PEI_SERVICES
**PeiServices
,
464 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
465 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
471 Migrate the Hob list from the CAR stack to PEI installed memory.
475 PeiServices - The PEI core services table.
476 OldHandOffHob - The old handoff HOB list.
477 NewHandOffHob - The new handoff HOB list.
487 IN CONST EFI_PEI_SERVICES
**PeiServices
,
488 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
494 Install PPI services.
498 PeiServices - Pointer to the PEI Service Table
499 PpiList - Pointer to a list of PEI PPI Descriptors.
503 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
504 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
505 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
506 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
514 IN CONST EFI_PEI_SERVICES
**PeiServices
,
515 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
516 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
522 Re-Install PPI services.
526 PeiServices - Pointer to the PEI Service Table
527 OldPpi - Pointer to the old PEI PPI Descriptors.
528 NewPpi - Pointer to the new PEI PPI Descriptors.
532 EFI_SUCCESS - if the operation was successful
533 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
534 EFI_INVALID_PARAMETER - if NewPpi is not valid
535 EFI_NOT_FOUND - if the PPI was not in the database
543 IN CONST EFI_PEI_SERVICES
**PeiServices
,
544 IN CONST EFI_GUID
*Guid
,
546 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
553 Locate a given named PPI.
557 PeiServices - Pointer to the PEI Service Table
558 Guid - Pointer to GUID of the PPI.
559 Instance - Instance Number to discover.
560 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
561 returns a pointer to the descriptor (includes flags, etc)
562 Ppi - Pointer to reference the found PPI
566 Status - EFI_SUCCESS if the PPI is in the database
567 EFI_NOT_FOUND if the PPI is not in the database
574 IN CONST EFI_PEI_SERVICES
**PeiServices
,
575 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
581 Install a notification for a given PPI.
585 PeiServices - Pointer to the PEI Service Table
586 NotifyList - Pointer to list of Descriptors to notify upon.
590 Status - EFI_SUCCESS if successful
591 EFI_OUT_OF_RESOURCES if no space in the database
592 EFI_INVALID_PARAMETER if not a good decriptor
599 IN PEI_CORE_INSTANCE
*PrivateData
605 Process the Notify List at dispatch level.
609 PeiServices - Pointer to the PEI Service Table
618 IN PEI_CORE_INSTANCE
*PrivateData
,
620 IN INTN InstallStartIndex
,
621 IN INTN InstallStopIndex
,
622 IN INTN NotifyStartIndex
,
623 IN INTN NotifyStopIndex
629 Dispatch notifications.
633 PeiServices - Pointer to the PEI Service Table
634 NotifyType - Type of notify to fire.
635 InstallStartIndex - Install Beginning index.
636 InstallStopIndex - Install Ending index.
637 NotifyStartIndex - Notify Beginning index.
638 NotifyStopIndex - Notify Ending index.
646 // Boot mode support functions
651 IN CONST EFI_PEI_SERVICES
**PeiServices
,
652 IN OUT EFI_BOOT_MODE
*BootMode
658 This service enables PEIMs to ascertain the present value of the boot mode.
662 PeiServices - The PEI core services table.
663 BootMode - A pointer to contain the value of the boot mode.
667 EFI_SUCCESS - The boot mode was returned successfully.
668 EFI_INVALID_PARAMETER - BootMode is NULL.
676 IN CONST EFI_PEI_SERVICES
**PeiServices
,
677 IN EFI_BOOT_MODE BootMode
683 This service enables PEIMs to update the boot mode variable.
687 PeiServices - The PEI core services table.
688 BootMode - The value of the boot mode to set.
692 EFI_SUCCESS - The value was successfully updated
698 // Security support functions
701 InitializeSecurityServices (
702 IN EFI_PEI_SERVICES
**PeiServices
,
703 IN PEI_CORE_INSTANCE
*OldCoreData
709 Initialize the security services.
713 PeiServices - The PEI core services table.
714 OldCoreData - Pointer to the old core data.
715 NULL if being run in non-permament memory mode.
725 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
731 Provide a callout to the OEM FV verification service.
735 CurrentFvAddress - Pointer to the FV under investigation.
747 IN PEI_CORE_INSTANCE
*PrivateData
,
748 IN EFI_PEI_FV_HANDLE VolumeHandle
,
749 IN EFI_PEI_FILE_HANDLE FileHandle
755 Provide a callout to the security verification service.
759 PeiServices - The PEI core services table.
760 CurrentPeimAddress - Pointer to the Firmware File under investigation.
764 EFI_SUCCESS - Image is OK
765 EFI_SECURITY_VIOLATION - Image is illegal
774 IN CONST EFI_PEI_SERVICES
**PeiServices
,
775 IN OUT VOID
**HobList
781 Gets the pointer to the HOB List.
785 PeiServices - The PEI core services table.
786 HobList - Pointer to the HOB List.
790 EFI_SUCCESS - Get the pointer of HOB List
791 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
792 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
800 IN CONST EFI_PEI_SERVICES
**PeiServices
,
809 Add a new HOB to the HOB List.
813 PeiServices - The PEI core services table.
814 Type - Type of the new HOB.
815 Length - Length of the new HOB to allocate.
816 Hob - Pointer to the new HOB.
821 - EFI_INVALID_PARAMETER if Hob is NULL
822 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
823 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
829 PeiCoreBuildHobHandoffInfoTable (
830 IN EFI_BOOT_MODE BootMode
,
831 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
832 IN UINT64 MemoryLength
838 Builds a Handoff Information Table HOB
842 BootMode - Current Bootmode
843 MemoryBegin - Start Memory Address.
844 MemoryLength - Length of Memory.
855 // FFS Fw Volume support functions
860 IN CONST EFI_PEI_SERVICES
**PeiServices
,
862 IN EFI_PEI_FV_HANDLE FwVolHeader
,
863 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
868 Given the input file pointer, search for the next matching file in the
869 FFS volume as defined by SearchType. The search starts from FileHeader inside
870 the Firmware Volume defined by FwVolHeader.
873 PeiServices - Pointer to the PEI Core Services Table.
875 SearchType - Filter to find only files of this type.
876 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
878 FwVolHeader - Pointer to the FV header of the volume to search.
879 This parameter must point to a valid FFS volume.
881 FileHeader - Pointer to the current file from which to begin searching.
882 This pointer will be updated upon return to reflect the file found.
885 EFI_NOT_FOUND - No files matching the search criteria were found
893 PeiFfsFindSectionData (
894 IN CONST EFI_PEI_SERVICES
**PeiServices
,
895 IN EFI_SECTION_TYPE SectionType
,
896 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
897 IN OUT VOID
**SectionData
902 Given the input file pointer, search for the next matching section in the
906 PeiServices - Pointer to the PEI Core Services Table.
907 SearchType - Filter to find only sections of this type.
908 FfsFileHeader - Pointer to the current file to search.
909 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
910 - NULL if section not found
913 EFI_NOT_FOUND - No files matching the search criteria were found
921 PeiFvFindNextVolume (
922 IN CONST EFI_PEI_SERVICES
**PeiServices
,
924 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
930 Return the BFV location
932 BugBug -- Move this to the location of this code to where the
933 other FV and FFS support code lives.
934 Also, update to use FindFV for instances #'s >= 1.
938 PeiServices - The PEI core services table.
939 Instance - Instance of FV to find
940 FwVolHeader - Pointer to contain the data to return
943 Pointer to the Firmware Volume instance requested
945 EFI_INVALID_PARAMETER - FwVolHeader is NULL
947 EFI_SUCCESS - Firmware volume instance successfully found.
953 // Memory support functions
956 InitializeMemoryServices (
957 IN PEI_CORE_INSTANCE
*PrivateData
,
958 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
959 IN PEI_CORE_INSTANCE
*OldCoreData
965 Initialize the memory services.
969 PeiServices - The PEI core services table.
970 PeiStartupDescriptor - Information and services provided by SEC phase.
971 OldCoreData - Pointer to the PEI Core data.
972 NULL if being run in non-permament memory mode.
983 PeiInstallPeiMemory (
984 IN CONST EFI_PEI_SERVICES
**PeiServices
,
985 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
986 IN UINT64 MemoryLength
992 Install the permanent memory is now available.
993 Creates HOB (PHIT and Stack).
997 PeiServices - The PEI core services table.
998 MemoryBegin - Start of memory address.
999 MemoryLength - Length of memory.
1003 Status - EFI_SUCCESS
1011 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1012 IN EFI_MEMORY_TYPE MemoryType
,
1014 OUT EFI_PHYSICAL_ADDRESS
*Memory
1018 Routine Description:
1020 Memory allocation service on permanent memory,
1021 not usable prior to the memory installation.
1025 PeiServices - The PEI core services table.
1026 Type - Type of allocation.
1027 MemoryType - Type of memory to allocate.
1028 Pages - Number of pages to allocate.
1029 Memory - Pointer of memory allocated.
1033 Status - EFI_SUCCESS The allocation was successful
1034 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1035 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1036 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1037 to allocate the number of pages.
1045 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1051 Routine Description:
1053 Memory allocation service on the CAR.
1057 PeiServices - The PEI core services table.
1059 Size - Amount of memory required
1061 Buffer - Address of pointer to the buffer
1065 Status - EFI_SUCCESS The allocation was successful
1066 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1067 to allocate the requested size.
1074 IN EFI_PEI_SERVICES
**PeiServices
,
1075 IN EFI_PEI_FILE_HANDLE FileHandle
,
1076 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1077 OUT UINT32
*AuthenticationState
1081 Routine Description:
1083 Get entry point of a Peim file.
1087 PeiServices - Calling context.
1089 PeimFileHeader - Peim file's header.
1091 EntryPoint - Entry point of that Peim file.
1103 PeiReportStatusCode (
1104 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1105 IN EFI_STATUS_CODE_TYPE CodeType
,
1106 IN EFI_STATUS_CODE_VALUE Value
,
1108 IN CONST EFI_GUID
*CallerId
,
1109 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1113 Routine Description:
1115 Core version of the Status Code reporter
1119 PeiServices - The PEI core services table.
1121 CodeType - Type of Status Code.
1123 Value - Value to output for Status Code.
1125 Instance - Instance Number of this status code.
1127 CallerId - ID of the caller of this status code.
1129 Data - Optional data associated with this status code.
1133 Status - EFI_SUCCESS if status code is successfully reported
1134 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1143 IN CONST EFI_PEI_SERVICES
**PeiServices
1147 Routine Description:
1149 Core version of the Reset System
1153 PeiServices - The PEI core services table.
1157 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1158 - EFI_DEVICE_ERROR. Did not reset system.
1160 Otherwise, resets the system.
1167 IN PEI_CORE_INSTANCE
*PrivateData
,
1168 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1172 Routine Description:
1174 Initialize PeiCore Fv List.
1177 PrivateData - Pointer to PEI_CORE_INSTANCE.
1178 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1188 FirmwareVolmeInfoPpiNotifyCallback (
1189 IN EFI_PEI_SERVICES
**PeiServices
,
1190 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1195 Routine Description:
1197 Process Firmware Volum Information once FvInfoPPI install.
1201 PeiServices - General purpose services available to every PEIM.
1205 Status - EFI_SUCCESS if the interface could be successfully
1214 PeiFfsFindFileByName (
1215 IN CONST EFI_GUID
*FileName
,
1216 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1217 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1221 Routine Description:
1223 Given the input VolumeHandle, search for the next matching name file.
1227 FileName - File name to search.
1228 VolumeHandle - The current FV to search.
1229 FileHandle - Pointer to the file matching name in VolumeHandle.
1230 - NULL if file not found
1241 IN EFI_PEI_FILE_HANDLE FileHandle
,
1242 OUT EFI_FV_FILE_INFO
*FileInfo
1246 Routine Description:
1248 Collect information of given file.
1251 FileHandle - The handle to file.
1252 FileInfo - Pointer to the file information.
1262 PeiFfsGetVolumeInfo (
1263 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1264 OUT EFI_FV_INFO
*VolumeInfo
1268 Routine Description:
1270 Collect information of given Fv Volume.
1273 VolumeHandle - The handle to Fv Volume.
1274 VolumeInfo - The pointer to volume information.
1285 PeiRegisterForShadow (
1286 IN EFI_PEI_FILE_HANDLE FileHandle
1290 Routine Description:
1292 This routine enable a PEIM to register itself to shadow when PEI Foundation
1293 discovery permanent memory.
1296 FileHandle - File handle of a PEIM.
1299 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1300 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1301 EFI_SUCCESS - Successfully to register itself.
1308 This routine enable a PEIM to register itself to shadow when PEI Foundation
1309 discovery permanent memory.
1311 @param FileHandle File handle of a PEIM.
1313 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1314 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1315 @retval EFI_SUCCESS Successfully to register itself.
1320 PeiRegisterForShadow (
1321 IN EFI_PEI_FILE_HANDLE FileHandle
1326 Transfers control to a function starting with a new stack.
1328 Transfers control to the function specified by EntryPoint using the new stack
1329 specified by NewStack and passing in the parameters specified by Context1 and
1330 Context2. Context1 and Context2 are optional and may be NULL. The function
1331 EntryPoint must never return.
1333 If EntryPoint is NULL, then ASSERT().
1334 If NewStack is NULL, then ASSERT().
1336 @param EntryPoint A pointer to function to call with the new stack.
1337 @param Context1 A pointer to the context to pass into the EntryPoint
1339 @param Context2 A pointer to the context to pass into the EntryPoint
1341 @param NewStack A pointer to the new stack to use for the EntryPoint
1343 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1344 Reserved on other architectures.
1350 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1351 IN VOID
*Context1
, OPTIONAL
1352 IN VOID
*Context2
, OPTIONAL
1359 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1360 IN CONST EFI_GUID
*FileName
, OPTIONAL
1361 IN EFI_FV_FILETYPE SearchType
,
1362 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1363 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1367 Routine Description:
1368 Given the input file pointer, search for the next matching file in the
1369 FFS volume as defined by SearchType. The search starts from FileHeader inside
1370 the Firmware Volume defined by FwVolHeader.
1373 PeiServices - Pointer to the PEI Core Services Table.
1374 SearchType - Filter to find only files of this type.
1375 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1376 FwVolHeader - Pointer to the FV header of the volume to search.
1377 This parameter must point to a valid FFS volume.
1378 FileHeader - Pointer to the current file from which to begin searching.
1379 This pointer will be updated upon return to reflect the file found.
1380 Flag - Indicator for if this is for PEI Dispath search
1383 EFI_NOT_FOUND - No files matching the search criteria were found
1390 InitializeImageServices (
1391 IN PEI_CORE_INSTANCE
*PrivateData
,
1392 IN PEI_CORE_INSTANCE
*OldCoreData
1396 Routine Description:
1398 Install Pei Load File PPI.
1402 PrivateData - Pointer to PEI_CORE_INSTANCE.
1403 OldCoreData - Pointer to PEI_CORE_INSTANCE.