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 <IndustryStandard/PeImage.h>
53 #include <Library/PeiServicesTablePointerLib.h>
54 #include <Library/MemoryAllocationLib.h>
55 #include <Guid/FirmwareFileSystem2.h>
56 #include <Guid/AprioriFileName.h>
58 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
61 // Pei Core private data structures
64 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
65 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
67 } PEI_PPI_LIST_POINTERS
;
69 #define PEI_STACK_SIZE 0x20000
71 #define MAX_PPI_DESCRIPTORS 64
77 INTN LastDispatchedInstall
;
78 INTN LastDispatchedNotify
;
79 PEI_PPI_LIST_POINTERS PpiListPtrs
[MAX_PPI_DESCRIPTORS
];
83 #define PEI_CORE_MAX_FV_SUPPORTED 4
84 #define PEI_CORE_MAX_PEIM_PER_FV 32
87 // PEI_CORE_FV_HANDE.PeimState
88 // Do not change these values as there is code doing math to change states.
89 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
91 #define PEIM_STATE_NOT_DISPATCHED 0x00
92 #define PEIM_STATE_DISPATCHED 0x01
93 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
94 #define PEIM_STATE_DONE 0x03
97 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
98 UINT8 PeimState
[PEI_CORE_MAX_PEIM_PER_FV
];
99 EFI_PEI_FILE_HANDLE FvFileHandles
[PEI_CORE_MAX_PEIM_PER_FV
];
101 } PEI_CORE_FV_HANDLE
;
104 // Pei Core private data structure instance
107 #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')
111 EFI_PEI_SERVICES
*PS
; // Point to ServiceTableShadow
112 PEI_PPI_DATABASE PpiData
;
114 PEI_CORE_FV_HANDLE Fv
[PEI_CORE_MAX_FV_SUPPORTED
];
115 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[PEI_CORE_MAX_PEIM_PER_FV
];
117 UINTN CurrentPeimFvCount
;
118 UINTN CurrentPeimCount
;
119 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
121 EFI_PEI_FV_HANDLE AllFv
[PEI_CORE_MAX_FV_SUPPORTED
];
122 EFI_PEI_HOB_POINTERS HobList
;
123 BOOLEAN SwitchStackSignal
;
124 BOOLEAN PeiMemoryInstalled
;
125 EFI_PHYSICAL_ADDRESS StackBase
;
127 VOID
*BottomOfCarHeap
;
130 EFI_PEI_SECURITY2_PPI
*PrivateSecurityPpi
;
131 EFI_PEI_SERVICES ServiceTableShadow
;
132 UINTN SizeOfCacheAsRam
;
133 VOID
*MaxTopOfCarHeap
;
134 EFI_PEI_PPI_DESCRIPTOR
*XipLoadFile
;
138 // Pei Core Instance Data Macros
141 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
142 CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)
145 // BUGBUG: Where does this go really?
149 (EFIAPI
*PEI_CORE_ENTRY_POINT
)(
150 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
151 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
,
152 IN PEI_CORE_INSTANCE
*OldCoreData
156 // Union of temporarily used function pointers (to save stack space)
159 PEI_CORE_ENTRY_POINT PeiCore
;
160 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
161 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
162 EFI_DXE_IPL_PPI
*DxeIpl
;
163 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
164 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
166 } PEI_CORE_TEMP_POINTERS
;
171 CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
;
172 EFI_PEI_PPI_DESCRIPTOR
*PpiList
;
174 } PEI_CORE_PARAMETERS
;
182 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
183 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpList
,
190 The entry routine to Pei Core, invoked by PeiMain during transition
191 from SEC to PEI. After switching stack in the PEI core, it will restart
192 with the old core data.
196 PeiStartupDescriptor - Information and services provided by SEC phase.
197 OldCoreData - Pointer to old core data that is used to initialize the
202 This function never returns
203 EFI_NOT_FOUND - Never reach
209 // Dispatcher support functions
213 PeimDispatchReadiness (
214 IN EFI_PEI_SERVICES
**PeiServices
,
215 IN VOID
*DependencyExpression
221 This is the POSTFIX version of the dependency evaluator. When a
222 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
223 the evaluation stack. When that entry is poped from the evaluation
224 stack, the PPI is checked if it is installed. This method allows
225 some time savings as not all PPIs must be checked for certain
226 operation types (AND, OR).
230 PeiServices - Calling context.
232 DependencyExpression - Pointer to a dependency expression. The Grammar adheres to
233 the BNF described above and is stored in postfix notation.
234 Runnable - is True if the driver can be scheduled and False if the driver
235 cannot be scheduled. This is the value that the schedulers
236 should use for deciding the state of the driver.
240 Status = EFI_SUCCESS if it is a well-formed Grammar
241 EFI_INVALID_PARAMETER if the dependency expression overflows
243 EFI_INVALID_PARAMETER if the dependency expression underflows
245 EFI_INVALID_PARAMETER if the dependency expression is not a
253 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
254 IN PEI_CORE_INSTANCE
*PrivateData
261 Conduct PEIM dispatch.
265 PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
266 PrivateData - Pointer to the private data passed in from caller
267 DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
271 EFI_SUCCESS - Successfully dispatched PEIM.
272 EFI_NOT_FOUND - The dispatch failed.
279 InitializeDispatcherData (
280 IN PEI_CORE_INSTANCE
*PrivateData
,
281 IN PEI_CORE_INSTANCE
*OldCoreData
,
282 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
288 Initialize the Dispatcher's data members
292 PeiServices - The PEI core services table.
293 OldCoreData - Pointer to old core data (before switching stack).
294 NULL if being run in non-permament memory mode.
295 PeiStartupDescriptor - Information and services provided by SEC phase.
308 IN EFI_PEI_SERVICES
**PeiServices
,
309 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
310 IN OUT EFI_FFS_FILE_HEADER
**PeimFileHeader
315 Given the input file pointer, search for the next matching file in the
316 FFS volume. The search starts from FileHeader inside
317 the Firmware Volume defined by FwVolHeader.
320 PeiServices - Pointer to the PEI Core Services Table.
322 FwVolHeader - Pointer to the FV header of the volume to search.
323 This parameter must point to a valid FFS volume.
325 PeimFileHeader - Pointer to the current file from which to begin searching.
326 This pointer will be updated upon return to reflect the file found.
329 EFI_NOT_FOUND - No files matching the search criteria were found
337 IN UINT8 CurrentPeim
,
338 IN UINT32 DispatchedPeimBitMap
344 This routine checks to see if a particular PEIM has been dispatched during
345 the PEI core dispatch.
348 CurrentPeim - The PEIM/FV in the bit array to check.
349 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
352 TRUE if PEIM already dispatched
360 IN EFI_PEI_SERVICES
**PeiServices
,
361 IN UINT8 CurrentPeim
,
362 OUT UINT32
*DispatchedPeimBitMap
368 This routine sets a PEIM as having been dispatched once its entry
369 point has been invoked.
373 PeiServices - The PEI core services table.
374 CurrentPeim - The PEIM/FV in the bit array to check.
375 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
385 IN PEI_CORE_INSTANCE
*Private
,
386 IN EFI_PEI_FILE_HANDLE FileHandle
,
393 This routine parses the Dependency Expression, if available, and
394 decides if the module can be executed.
397 PeiServices - The PEI Service Table
398 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
401 TRUE - Can be dispatched
402 FALSE - Cannot be dispatched
407 #if defined (MDE_CPU_IPF)
409 // In Ipf we should make special changes for the PHIT pointers to support
410 // recovery boot in cache mode.
412 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
413 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
416 IN PEI_CORE_INSTANCE
*CoreData
422 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
426 CoreData - The PEI core Private Data
435 #define SWITCH_TO_CACHE_MODE(CoreData)
440 // PPI support functions
443 InitializePpiServices (
444 IN PEI_CORE_INSTANCE
*PrivateData
,
445 IN PEI_CORE_INSTANCE
*OldCoreData
451 Initialize PPI services.
455 PeiServices - The PEI core services table.
456 OldCoreData - Pointer to the PEI Core data.
457 NULL if being run in non-permament memory mode.
467 IN CONST EFI_PEI_SERVICES
**PeiServices
,
468 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
469 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
475 Migrate the Hob list from the CAR stack to PEI installed memory.
479 PeiServices - The PEI core services table.
480 OldHandOffHob - The old handoff HOB list.
481 NewHandOffHob - The new handoff HOB list.
491 IN CONST EFI_PEI_SERVICES
**PeiServices
,
492 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
498 Install PPI services.
502 PeiServices - Pointer to the PEI Service Table
503 PpiList - Pointer to a list of PEI PPI Descriptors.
507 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
508 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
509 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
510 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
518 IN CONST EFI_PEI_SERVICES
**PeiServices
,
519 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
520 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
526 Re-Install PPI services.
530 PeiServices - Pointer to the PEI Service Table
531 OldPpi - Pointer to the old PEI PPI Descriptors.
532 NewPpi - Pointer to the new PEI PPI Descriptors.
536 EFI_SUCCESS - if the operation was successful
537 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
538 EFI_INVALID_PARAMETER - if NewPpi is not valid
539 EFI_NOT_FOUND - if the PPI was not in the database
547 IN CONST EFI_PEI_SERVICES
**PeiServices
,
548 IN CONST EFI_GUID
*Guid
,
550 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
557 Locate a given named PPI.
561 PeiServices - Pointer to the PEI Service Table
562 Guid - Pointer to GUID of the PPI.
563 Instance - Instance Number to discover.
564 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
565 returns a pointer to the descriptor (includes flags, etc)
566 Ppi - Pointer to reference the found PPI
570 Status - EFI_SUCCESS if the PPI is in the database
571 EFI_NOT_FOUND if the PPI is not in the database
578 IN CONST EFI_PEI_SERVICES
**PeiServices
,
579 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
585 Install a notification for a given PPI.
589 PeiServices - Pointer to the PEI Service Table
590 NotifyList - Pointer to list of Descriptors to notify upon.
594 Status - EFI_SUCCESS if successful
595 EFI_OUT_OF_RESOURCES if no space in the database
596 EFI_INVALID_PARAMETER if not a good decriptor
603 IN PEI_CORE_INSTANCE
*PrivateData
609 Process the Notify List at dispatch level.
613 PeiServices - Pointer to the PEI Service Table
622 IN PEI_CORE_INSTANCE
*PrivateData
,
624 IN INTN InstallStartIndex
,
625 IN INTN InstallStopIndex
,
626 IN INTN NotifyStartIndex
,
627 IN INTN NotifyStopIndex
633 Dispatch notifications.
637 PeiServices - Pointer to the PEI Service Table
638 NotifyType - Type of notify to fire.
639 InstallStartIndex - Install Beginning index.
640 InstallStopIndex - Install Ending index.
641 NotifyStartIndex - Notify Beginning index.
642 NotifyStopIndex - Notify Ending index.
650 // Boot mode support functions
655 IN CONST EFI_PEI_SERVICES
**PeiServices
,
656 IN OUT EFI_BOOT_MODE
*BootMode
662 This service enables PEIMs to ascertain the present value of the boot mode.
666 PeiServices - The PEI core services table.
667 BootMode - A pointer to contain the value of the boot mode.
671 EFI_SUCCESS - The boot mode was returned successfully.
672 EFI_INVALID_PARAMETER - BootMode is NULL.
680 IN CONST EFI_PEI_SERVICES
**PeiServices
,
681 IN EFI_BOOT_MODE BootMode
687 This service enables PEIMs to update the boot mode variable.
691 PeiServices - The PEI core services table.
692 BootMode - The value of the boot mode to set.
696 EFI_SUCCESS - The value was successfully updated
702 // Security support functions
705 InitializeSecurityServices (
706 IN EFI_PEI_SERVICES
**PeiServices
,
707 IN PEI_CORE_INSTANCE
*OldCoreData
713 Initialize the security services.
717 PeiServices - The PEI core services table.
718 OldCoreData - Pointer to the old core data.
719 NULL if being run in non-permament memory mode.
729 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
735 Provide a callout to the OEM FV verification service.
739 CurrentFvAddress - Pointer to the FV under investigation.
751 IN PEI_CORE_INSTANCE
*PrivateData
,
752 IN EFI_PEI_FV_HANDLE VolumeHandle
,
753 IN EFI_PEI_FILE_HANDLE FileHandle
759 Provide a callout to the security verification service.
763 PeiServices - The PEI core services table.
764 CurrentPeimAddress - Pointer to the Firmware File under investigation.
768 EFI_SUCCESS - Image is OK
769 EFI_SECURITY_VIOLATION - Image is illegal
778 IN CONST EFI_PEI_SERVICES
**PeiServices
,
779 IN OUT VOID
**HobList
785 Gets the pointer to the HOB List.
789 PeiServices - The PEI core services table.
790 HobList - Pointer to the HOB List.
794 EFI_SUCCESS - Get the pointer of HOB List
795 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
796 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
804 IN CONST EFI_PEI_SERVICES
**PeiServices
,
813 Add a new HOB to the HOB List.
817 PeiServices - The PEI core services table.
818 Type - Type of the new HOB.
819 Length - Length of the new HOB to allocate.
820 Hob - Pointer to the new HOB.
825 - EFI_INVALID_PARAMETER if Hob is NULL
826 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
827 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
833 PeiCoreBuildHobHandoffInfoTable (
834 IN EFI_BOOT_MODE BootMode
,
835 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
836 IN UINT64 MemoryLength
842 Builds a Handoff Information Table HOB
846 BootMode - Current Bootmode
847 MemoryBegin - Start Memory Address.
848 MemoryLength - Length of Memory.
859 // FFS Fw Volume support functions
864 IN CONST EFI_PEI_SERVICES
**PeiServices
,
866 IN EFI_PEI_FV_HANDLE FwVolHeader
,
867 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
872 Given the input file pointer, search for the next matching file in the
873 FFS volume as defined by SearchType. The search starts from FileHeader inside
874 the Firmware Volume defined by FwVolHeader.
877 PeiServices - Pointer to the PEI Core Services Table.
879 SearchType - Filter to find only files of this type.
880 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
882 FwVolHeader - Pointer to the FV header of the volume to search.
883 This parameter must point to a valid FFS volume.
885 FileHeader - Pointer to the current file from which to begin searching.
886 This pointer will be updated upon return to reflect the file found.
889 EFI_NOT_FOUND - No files matching the search criteria were found
897 PeiFfsFindSectionData (
898 IN CONST EFI_PEI_SERVICES
**PeiServices
,
899 IN EFI_SECTION_TYPE SectionType
,
900 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
901 IN OUT VOID
**SectionData
906 Given the input file pointer, search for the next matching section in the
910 PeiServices - Pointer to the PEI Core Services Table.
911 SearchType - Filter to find only sections of this type.
912 FfsFileHeader - Pointer to the current file to search.
913 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
914 - NULL if section not found
917 EFI_NOT_FOUND - No files matching the search criteria were found
925 PeiFvFindNextVolume (
926 IN CONST EFI_PEI_SERVICES
**PeiServices
,
928 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
934 Return the BFV location
936 BugBug -- Move this to the location of this code to where the
937 other FV and FFS support code lives.
938 Also, update to use FindFV for instances #'s >= 1.
942 PeiServices - The PEI core services table.
943 Instance - Instance of FV to find
944 FwVolHeader - Pointer to contain the data to return
947 Pointer to the Firmware Volume instance requested
949 EFI_INVALID_PARAMETER - FwVolHeader is NULL
951 EFI_SUCCESS - Firmware volume instance successfully found.
957 // Memory support functions
960 InitializeMemoryServices (
961 IN PEI_CORE_INSTANCE
*PrivateData
,
962 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
963 IN PEI_CORE_INSTANCE
*OldCoreData
969 Initialize the memory services.
973 PeiServices - The PEI core services table.
974 PeiStartupDescriptor - Information and services provided by SEC phase.
975 OldCoreData - Pointer to the PEI Core data.
976 NULL if being run in non-permament memory mode.
987 PeiInstallPeiMemory (
988 IN CONST EFI_PEI_SERVICES
**PeiServices
,
989 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
990 IN UINT64 MemoryLength
996 Install the permanent memory is now available.
997 Creates HOB (PHIT and Stack).
1001 PeiServices - The PEI core services table.
1002 MemoryBegin - Start of memory address.
1003 MemoryLength - Length of memory.
1007 Status - EFI_SUCCESS
1015 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1016 IN EFI_MEMORY_TYPE MemoryType
,
1018 OUT EFI_PHYSICAL_ADDRESS
*Memory
1022 Routine Description:
1024 Memory allocation service on permanent memory,
1025 not usable prior to the memory installation.
1029 PeiServices - The PEI core services table.
1030 Type - Type of allocation.
1031 MemoryType - Type of memory to allocate.
1032 Pages - Number of pages to allocate.
1033 Memory - Pointer of memory allocated.
1037 Status - EFI_SUCCESS The allocation was successful
1038 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1039 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1040 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1041 to allocate the number of pages.
1049 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1055 Routine Description:
1057 Memory allocation service on the CAR.
1061 PeiServices - The PEI core services table.
1063 Size - Amount of memory required
1065 Buffer - Address of pointer to the buffer
1069 Status - EFI_SUCCESS The allocation was successful
1070 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1071 to allocate the requested size.
1078 IN EFI_PEI_SERVICES
**PeiServices
,
1079 IN EFI_PEI_FILE_HANDLE FileHandle
,
1080 OUT EFI_PHYSICAL_ADDRESS
*EntryPoint
,
1081 OUT UINT32
*AuthenticationState
1085 Routine Description:
1087 Get entry point of a Peim file.
1091 PeiServices - Calling context.
1093 PeimFileHeader - Peim file's header.
1095 EntryPoint - Entry point of that Peim file.
1107 PeiReportStatusCode (
1108 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1109 IN EFI_STATUS_CODE_TYPE CodeType
,
1110 IN EFI_STATUS_CODE_VALUE Value
,
1112 IN CONST EFI_GUID
*CallerId
,
1113 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1117 Routine Description:
1119 Core version of the Status Code reporter
1123 PeiServices - The PEI core services table.
1125 CodeType - Type of Status Code.
1127 Value - Value to output for Status Code.
1129 Instance - Instance Number of this status code.
1131 CallerId - ID of the caller of this status code.
1133 Data - Optional data associated with this status code.
1137 Status - EFI_SUCCESS if status code is successfully reported
1138 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1147 IN CONST EFI_PEI_SERVICES
**PeiServices
1151 Routine Description:
1153 Core version of the Reset System
1157 PeiServices - The PEI core services table.
1161 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1162 - EFI_DEVICE_ERROR. Did not reset system.
1164 Otherwise, resets the system.
1171 IN PEI_CORE_INSTANCE
*PrivateData
,
1172 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
1176 Routine Description:
1178 Initialize PeiCore Fv List.
1181 PrivateData - Pointer to PEI_CORE_INSTANCE.
1182 SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.
1192 FirmwareVolmeInfoPpiNotifyCallback (
1193 IN EFI_PEI_SERVICES
**PeiServices
,
1194 IN EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
,
1199 Routine Description:
1201 Process Firmware Volum Information once FvInfoPPI install.
1205 PeiServices - General purpose services available to every PEIM.
1209 Status - EFI_SUCCESS if the interface could be successfully
1218 PeiFfsFindFileByName (
1219 IN CONST EFI_GUID
*FileName
,
1220 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1221 OUT EFI_PEI_FILE_HANDLE
*FileHandle
1225 Routine Description:
1227 Given the input VolumeHandle, search for the next matching name file.
1231 FileName - File name to search.
1232 VolumeHandle - The current FV to search.
1233 FileHandle - Pointer to the file matching name in VolumeHandle.
1234 - NULL if file not found
1245 IN EFI_PEI_FILE_HANDLE FileHandle
,
1246 OUT EFI_FV_FILE_INFO
*FileInfo
1250 Routine Description:
1252 Collect information of given file.
1255 FileHandle - The handle to file.
1256 FileInfo - Pointer to the file information.
1266 PeiFfsGetVolumeInfo (
1267 IN EFI_PEI_FV_HANDLE VolumeHandle
,
1268 OUT EFI_FV_INFO
*VolumeInfo
1272 Routine Description:
1274 Collect information of given Fv Volume.
1277 VolumeHandle - The handle to Fv Volume.
1278 VolumeInfo - The pointer to volume information.
1289 PeiRegisterForShadow (
1290 IN EFI_PEI_FILE_HANDLE FileHandle
1294 Routine Description:
1296 This routine enable a PEIM to register itself to shadow when PEI Foundation
1297 discovery permanent memory.
1300 FileHandle - File handle of a PEIM.
1303 EFI_NOT_FOUND - The file handle doesn't point to PEIM itself.
1304 EFI_ALREADY_STARTED - Indicate that the PEIM has been registered itself.
1305 EFI_SUCCESS - Successfully to register itself.
1312 This routine enable a PEIM to register itself to shadow when PEI Foundation
1313 discovery permanent memory.
1315 @param FileHandle File handle of a PEIM.
1317 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1318 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1319 @retval EFI_SUCCESS Successfully to register itself.
1324 PeiRegisterForShadow (
1325 IN EFI_PEI_FILE_HANDLE FileHandle
1330 Transfers control to a function starting with a new stack.
1332 Transfers control to the function specified by EntryPoint using the new stack
1333 specified by NewStack and passing in the parameters specified by Context1 and
1334 Context2. Context1 and Context2 are optional and may be NULL. The function
1335 EntryPoint must never return.
1337 If EntryPoint is NULL, then ASSERT().
1338 If NewStack is NULL, then ASSERT().
1340 @param EntryPoint A pointer to function to call with the new stack.
1341 @param Context1 A pointer to the context to pass into the EntryPoint
1343 @param Context2 A pointer to the context to pass into the EntryPoint
1345 @param NewStack A pointer to the new stack to use for the EntryPoint
1347 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1348 Reserved on other architectures.
1354 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1355 IN VOID
*Context1
, OPTIONAL
1356 IN VOID
*Context2
, OPTIONAL
1363 IN CONST EFI_PEI_FV_HANDLE FvHandle
,
1364 IN CONST EFI_GUID
*FileName
, OPTIONAL
1365 IN EFI_FV_FILETYPE SearchType
,
1366 IN OUT EFI_PEI_FILE_HANDLE
*FileHandle
,
1367 IN OUT EFI_PEI_FV_HANDLE
*AprioriFile OPTIONAL
1371 Routine Description:
1372 Given the input file pointer, search for the next matching file in the
1373 FFS volume as defined by SearchType. The search starts from FileHeader inside
1374 the Firmware Volume defined by FwVolHeader.
1377 PeiServices - Pointer to the PEI Core Services Table.
1378 SearchType - Filter to find only files of this type.
1379 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
1380 FwVolHeader - Pointer to the FV header of the volume to search.
1381 This parameter must point to a valid FFS volume.
1382 FileHeader - Pointer to the current file from which to begin searching.
1383 This pointer will be updated upon return to reflect the file found.
1384 Flag - Indicator for if this is for PEI Dispath search
1387 EFI_NOT_FOUND - No files matching the search criteria were found
1394 InitializeImageServices (
1395 IN PEI_CORE_INSTANCE
*PrivateData
,
1396 IN PEI_CORE_INSTANCE
*OldCoreData
1400 Routine Description:
1402 Install Pei Load File PPI.
1406 PrivateData - Pointer to PEI_CORE_INSTANCE.
1407 OldCoreData - Pointer to PEI_CORE_INSTANCE.