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/FindFv.h>
33 #include <Ppi/StatusCode.h>
34 #include <Ppi/Security.h>
35 #include <Ppi/Reset.h>
36 #include <Ppi/FvLoadFile.h>
37 #include <Library/DebugLib.h>
38 #include <Library/PeiCoreEntryPoint.h>
39 #include <Library/BaseLib.h>
40 #include <Library/HobLib.h>
41 #include <Library/PerformanceLib.h>
42 #include <Library/PeiServicesLib.h>
43 #include <Library/ReportStatusCodeLib.h>
44 #include <Library/PeCoffGetEntryPointLib.h>
45 #include <Library/BaseMemoryLib.h>
46 #include <Library/TimerLib.h>
47 #include <IndustryStandard/PeImage.h>
48 #include <Library/PeiServicesTablePointerLib.h>
50 extern EFI_GUID gEfiPeiCorePrivateGuid
;
52 #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff
55 // Pei Core private data structures
58 EFI_PEI_PPI_DESCRIPTOR
*Ppi
;
59 EFI_PEI_NOTIFY_DESCRIPTOR
*Notify
;
61 } PEI_PPI_LIST_POINTERS
;
63 #define PEI_STACK_SIZE 0x20000
65 #define MAX_PPI_DESCRIPTORS 64
71 INTN LastDispatchedInstall
;
72 INTN LastDispatchedNotify
;
73 PEI_PPI_LIST_POINTERS PpiListPtrs
[MAX_PPI_DESCRIPTORS
];
77 #define PEI_CORE_MAX_FV_SUPPORTED 4
78 #define PEI_CORE_MAX_PEIM_PER_FV 32
81 // PEI_CORE_FV_HANDE.PeimState
82 // Do not change these values as there is code doing math to change states.
83 // Look for Private->Fv[FvCount].PeimState[PeimCount]++;
85 #define PEIM_STATE_NOT_DISPATCHED 0x00
86 #define PEIM_STATE_DISPATCHED 0x01
87 #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02
88 #define PEIM_STATE_DONE 0x03
91 EFI_FIRMWARE_VOLUME_HEADER
*FvHeader
;
92 UINT8 PeimState
[PEI_CORE_MAX_PEIM_PER_FV
];
93 EFI_PEI_FILE_HANDLE FvFileHandles
[PEI_CORE_MAX_PEIM_PER_FV
];
100 UINT32 DispatchedPeimBitMap
;
101 UINT32 PreviousPeimBitMap
;
102 EFI_FFS_FILE_HEADER
*CurrentPeimAddress
;
103 EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
;
104 EFI_FIRMWARE_VOLUME_HEADER
*BootFvAddress
;
105 EFI_PEI_FIND_FV_PPI
*FindFv
;
106 } PEI_CORE_DISPATCH_DATA
;
110 // Pei Core private data structure instance
113 #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')
117 EFI_PEI_SERVICES
*PS
; // Point to ServiceTableShadow
118 PEI_PPI_DATABASE PpiData
;
119 PEI_CORE_DISPATCH_DATA DispatchData
;
121 PEI_CORE_FV_HANDLE Fv
[PEI_CORE_MAX_FV_SUPPORTED
];
122 EFI_PEI_FILE_HANDLE CurrentFvFileHandles
[PEI_CORE_MAX_PEIM_PER_FV
];
124 UINTN CurrentPeimFvCount
;
125 UINTN CurrentPeimCount
;
126 EFI_PEI_FILE_HANDLE CurrentFileHandle
;
128 EFI_PEI_FV_HANDLE AllFv
[PEI_CORE_MAX_FV_SUPPORTED
];
129 EFI_PEI_HOB_POINTERS HobList
;
130 BOOLEAN SwitchStackSignal
;
131 BOOLEAN PeiMemoryInstalled
;
132 EFI_PHYSICAL_ADDRESS StackBase
;
134 VOID
*BottomOfCarHeap
;
137 EFI_PEI_SECURITY_PPI
*PrivateSecurityPpi
;
138 EFI_PEI_SERVICES ServiceTableShadow
;
139 UINTN SizeOfCacheAsRam
;
140 VOID
*MaxTopOfCarHeap
;
144 // Pei Core Instance Data Macros
147 #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \
148 CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)
151 // BUGBUG: Where does this go really?
155 (EFIAPI
*PEI_CORE_ENTRY_POINT
)(
156 IN EFI_PEI_STARTUP_DESCRIPTOR
*PeiStartupDescriptor
,
157 IN PEI_CORE_INSTANCE
*OldCoreData
161 // Union of temporarily used function pointers (to save stack space)
164 PEI_CORE_ENTRY_POINT PeiCore
;
165 EFI_PEIM_ENTRY_POINT2 PeimEntry
;
166 EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry
;
167 EFI_DXE_IPL_PPI
*DxeIpl
;
168 EFI_PEI_PPI_DESCRIPTOR
*PpiDescriptor
;
169 EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyDescriptor
;
171 } PEI_CORE_TEMP_POINTERS
;
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
,
214 IN OUT BOOLEAN
*Runnable
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.
233 Runnable - is True if the driver can be scheduled and False if the driver
234 cannot be scheduled. This is the value that the schedulers
235 should use for deciding the state of the driver.
239 Status = EFI_SUCCESS if it is a well-formed Grammar
240 EFI_INVALID_PARAMETER if the dependency expression overflows
242 EFI_INVALID_PARAMETER if the dependency expression underflows
244 EFI_INVALID_PARAMETER if the dependency expression is not a
252 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
253 IN PEI_CORE_INSTANCE
*PrivateData
,
254 IN PEI_CORE_DISPATCH_DATA
*DispatchData
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 EFI_PEI_SERVICES
**PeiServices
,
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 EFI_PEI_SERVICES
**PeiServices
,
386 IN VOID
*CurrentPeimAddress
392 This routine parses the Dependency Expression, if available, and
393 decides if the module can be executed.
396 PeiServices - The PEI Service Table
397 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
400 TRUE - Can be dispatched
401 FALSE - Cannot be dispatched
406 #if defined (MDE_CPU_IPF)
408 // In Ipf we should make special changes for the PHIT pointers to support
409 // recovery boot in cache mode.
411 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
412 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
415 IN PEI_CORE_INSTANCE
*CoreData
421 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
425 CoreData - The PEI core Private Data
434 #define SWITCH_TO_CACHE_MODE(CoreData)
439 // PPI support functions
442 InitializePpiServices (
443 IN EFI_PEI_SERVICES
**PeiServices
,
444 IN PEI_CORE_INSTANCE
*OldCoreData
450 Initialize PPI services.
454 PeiServices - The PEI core services table.
455 OldCoreData - Pointer to the PEI Core data.
456 NULL if being run in non-permament memory mode.
466 IN CONST EFI_PEI_SERVICES
**PeiServices
,
467 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
468 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
474 Migrate the Hob list from the CAR stack to PEI installed memory.
478 PeiServices - The PEI core services table.
479 OldHandOffHob - The old handoff HOB list.
480 NewHandOffHob - The new handoff HOB list.
490 IN CONST EFI_PEI_SERVICES
**PeiServices
,
491 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
497 Install PPI services.
501 PeiServices - Pointer to the PEI Service Table
502 PpiList - Pointer to a list of PEI PPI Descriptors.
506 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
507 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
508 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
509 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
517 IN CONST EFI_PEI_SERVICES
**PeiServices
,
518 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
519 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
525 Re-Install PPI services.
529 PeiServices - Pointer to the PEI Service Table
530 OldPpi - Pointer to the old PEI PPI Descriptors.
531 NewPpi - Pointer to the new PEI PPI Descriptors.
535 EFI_SUCCESS - if the operation was successful
536 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
537 EFI_INVALID_PARAMETER - if NewPpi is not valid
538 EFI_NOT_FOUND - if the PPI was not in the database
546 IN CONST EFI_PEI_SERVICES
**PeiServices
,
547 IN CONST EFI_GUID
*Guid
,
549 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
556 Locate a given named PPI.
560 PeiServices - Pointer to the PEI Service Table
561 Guid - Pointer to GUID of the PPI.
562 Instance - Instance Number to discover.
563 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
564 returns a pointer to the descriptor (includes flags, etc)
565 Ppi - Pointer to reference the found PPI
569 Status - EFI_SUCCESS if the PPI is in the database
570 EFI_NOT_FOUND if the PPI is not in the database
577 IN CONST EFI_PEI_SERVICES
**PeiServices
,
578 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
584 Install a notification for a given PPI.
588 PeiServices - Pointer to the PEI Service Table
589 NotifyList - Pointer to list of Descriptors to notify upon.
593 Status - EFI_SUCCESS if successful
594 EFI_OUT_OF_RESOURCES if no space in the database
595 EFI_INVALID_PARAMETER if not a good decriptor
602 IN EFI_PEI_SERVICES
**PeiServices
608 Process the Notify List at dispatch level.
612 PeiServices - Pointer to the PEI Service Table
621 IN CONST EFI_PEI_SERVICES
**PeiServices
,
623 IN INTN InstallStartIndex
,
624 IN INTN InstallStopIndex
,
625 IN INTN NotifyStartIndex
,
626 IN INTN NotifyStopIndex
632 Dispatch notifications.
636 PeiServices - Pointer to the PEI Service Table
637 NotifyType - Type of notify to fire.
638 InstallStartIndex - Install Beginning index.
639 InstallStopIndex - Install Ending index.
640 NotifyStartIndex - Notify Beginning index.
641 NotifyStopIndex - Notify Ending index.
649 // Boot mode support functions
654 IN CONST EFI_PEI_SERVICES
**PeiServices
,
655 IN OUT EFI_BOOT_MODE
*BootMode
661 This service enables PEIMs to ascertain the present value of the boot mode.
665 PeiServices - The PEI core services table.
666 BootMode - A pointer to contain the value of the boot mode.
670 EFI_SUCCESS - The boot mode was returned successfully.
671 EFI_INVALID_PARAMETER - BootMode is NULL.
679 IN CONST EFI_PEI_SERVICES
**PeiServices
,
680 IN EFI_BOOT_MODE BootMode
686 This service enables PEIMs to update the boot mode variable.
690 PeiServices - The PEI core services table.
691 BootMode - The value of the boot mode to set.
695 EFI_SUCCESS - The value was successfully updated
701 // Security support functions
704 InitializeSecurityServices (
705 IN EFI_PEI_SERVICES
**PeiServices
,
706 IN PEI_CORE_INSTANCE
*OldCoreData
712 Initialize the security services.
716 PeiServices - The PEI core services table.
717 OldCoreData - Pointer to the old core data.
718 NULL if being run in non-permament memory mode.
728 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
734 Provide a callout to the OEM FV verification service.
738 CurrentFvAddress - Pointer to the FV under investigation.
750 IN EFI_PEI_SERVICES
**PeiServices
,
751 IN EFI_FFS_FILE_HEADER
*CurrentPeimAddress
757 Provide a callout to the security verification service.
761 PeiServices - The PEI core services table.
762 CurrentPeimAddress - Pointer to the Firmware File under investigation.
766 EFI_SUCCESS - Image is OK
767 EFI_SECURITY_VIOLATION - Image is illegal
776 IN CONST EFI_PEI_SERVICES
**PeiServices
,
777 IN OUT VOID
**HobList
783 Gets the pointer to the HOB List.
787 PeiServices - The PEI core services table.
788 HobList - Pointer to the HOB List.
792 EFI_SUCCESS - Get the pointer of HOB List
793 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
794 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
802 IN CONST EFI_PEI_SERVICES
**PeiServices
,
811 Add a new HOB to the HOB List.
815 PeiServices - The PEI core services table.
816 Type - Type of the new HOB.
817 Length - Length of the new HOB to allocate.
818 Hob - Pointer to the new HOB.
823 - EFI_INVALID_PARAMETER if Hob is NULL
824 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
825 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
831 PeiCoreBuildHobHandoffInfoTable (
832 IN EFI_BOOT_MODE BootMode
,
833 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
834 IN UINT64 MemoryLength
840 Builds a Handoff Information Table HOB
844 BootMode - Current Bootmode
845 MemoryBegin - Start Memory Address.
846 MemoryLength - Length of Memory.
857 // FFS Fw Volume support functions
862 IN CONST EFI_PEI_SERVICES
**PeiServices
,
864 IN EFI_PEI_FV_HANDLE FwVolHeader
,
865 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
870 Given the input file pointer, search for the next matching file in the
871 FFS volume as defined by SearchType. The search starts from FileHeader inside
872 the Firmware Volume defined by FwVolHeader.
875 PeiServices - Pointer to the PEI Core Services Table.
877 SearchType - Filter to find only files of this type.
878 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
880 FwVolHeader - Pointer to the FV header of the volume to search.
881 This parameter must point to a valid FFS volume.
883 FileHeader - Pointer to the current file from which to begin searching.
884 This pointer will be updated upon return to reflect the file found.
887 EFI_NOT_FOUND - No files matching the search criteria were found
895 PeiFfsFindSectionData (
896 IN CONST EFI_PEI_SERVICES
**PeiServices
,
897 IN EFI_SECTION_TYPE SectionType
,
898 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
899 IN OUT VOID
**SectionData
904 Given the input file pointer, search for the next matching section in the
908 PeiServices - Pointer to the PEI Core Services Table.
909 SearchType - Filter to find only sections of this type.
910 FfsFileHeader - Pointer to the current file to search.
911 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
912 - NULL if section not found
915 EFI_NOT_FOUND - No files matching the search criteria were found
923 PeiFvFindNextVolume (
924 IN CONST EFI_PEI_SERVICES
**PeiServices
,
926 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
932 Return the BFV location
934 BugBug -- Move this to the location of this code to where the
935 other FV and FFS support code lives.
936 Also, update to use FindFV for instances #'s >= 1.
940 PeiServices - The PEI core services table.
941 Instance - Instance of FV to find
942 FwVolHeader - Pointer to contain the data to return
945 Pointer to the Firmware Volume instance requested
947 EFI_INVALID_PARAMETER - FwVolHeader is NULL
949 EFI_SUCCESS - Firmware volume instance successfully found.
955 // Memory support functions
958 InitializeMemoryServices (
959 IN EFI_PEI_SERVICES
**PeiServices
,
960 IN CONST EFI_SEC_PEI_HAND_OFF
*SecCoreData
,
961 IN PEI_CORE_INSTANCE
*OldCoreData
967 Initialize the memory services.
971 PeiServices - The PEI core services table.
972 PeiStartupDescriptor - Information and services provided by SEC phase.
973 OldCoreData - Pointer to the PEI Core data.
974 NULL if being run in non-permament memory mode.
985 PeiInstallPeiMemory (
986 IN CONST EFI_PEI_SERVICES
**PeiServices
,
987 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
988 IN UINT64 MemoryLength
994 Install the permanent memory is now available.
995 Creates HOB (PHIT and Stack).
999 PeiServices - The PEI core services table.
1000 MemoryBegin - Start of memory address.
1001 MemoryLength - Length of memory.
1005 Status - EFI_SUCCESS
1013 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1014 IN EFI_MEMORY_TYPE MemoryType
,
1016 OUT EFI_PHYSICAL_ADDRESS
*Memory
1020 Routine Description:
1022 Memory allocation service on permanent memory,
1023 not usable prior to the memory installation.
1027 PeiServices - The PEI core services table.
1028 Type - Type of allocation.
1029 MemoryType - Type of memory to allocate.
1030 Pages - Number of pages to allocate.
1031 Memory - Pointer of memory allocated.
1035 Status - EFI_SUCCESS The allocation was successful
1036 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1037 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1038 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1039 to allocate the number of pages.
1047 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1053 Routine Description:
1055 Memory allocation service on the CAR.
1059 PeiServices - The PEI core services table.
1061 Size - Amount of memory required
1063 Buffer - Address of pointer to the buffer
1067 Status - EFI_SUCCESS The allocation was successful
1068 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1069 to allocate the requested size.
1076 IN EFI_PEI_SERVICES
**PeiServices
,
1077 IN EFI_FFS_FILE_HEADER
*PeimFileHeader
,
1078 OUT VOID
**EntryPoint
1082 Routine Description:
1084 Get entry point of a Peim file.
1088 PeiServices - Calling context.
1090 PeimFileHeader - Peim file's header.
1092 EntryPoint - Entry point of that Peim file.
1104 PeiReportStatusCode (
1105 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1106 IN EFI_STATUS_CODE_TYPE CodeType
,
1107 IN EFI_STATUS_CODE_VALUE Value
,
1109 IN CONST EFI_GUID
*CallerId
,
1110 IN CONST EFI_STATUS_CODE_DATA
*Data OPTIONAL
1114 Routine Description:
1116 Core version of the Status Code reporter
1120 PeiServices - The PEI core services table.
1122 CodeType - Type of Status Code.
1124 Value - Value to output for Status Code.
1126 Instance - Instance Number of this status code.
1128 CallerId - ID of the caller of this status code.
1130 Data - Optional data associated with this status code.
1134 Status - EFI_SUCCESS if status code is successfully reported
1135 - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed
1144 IN EFI_PEI_SERVICES
**PeiServices
1148 Routine Description:
1150 Core version of the Reset System
1154 PeiServices - The PEI core services table.
1158 Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.
1159 - EFI_DEVICE_ERROR. Did not reset system.
1161 Otherwise, resets the system.
1167 This routine enable a PEIM to register itself to shadow when PEI Foundation
1168 discovery permanent memory.
1170 @param FileHandle File handle of a PEIM.
1172 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1173 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1174 @retval EFI_SUCCESS Successfully to register itself.
1179 PeiRegisterForShadow (
1180 IN EFI_PEI_FILE_HANDLE FileHandle
1185 Transfers control to a function starting with a new stack.
1187 Transfers control to the function specified by EntryPoint using the new stack
1188 specified by NewStack and passing in the parameters specified by Context1 and
1189 Context2. Context1 and Context2 are optional and may be NULL. The function
1190 EntryPoint must never return.
1192 If EntryPoint is NULL, then ASSERT().
1193 If NewStack is NULL, then ASSERT().
1195 @param EntryPoint A pointer to function to call with the new stack.
1196 @param Context1 A pointer to the context to pass into the EntryPoint
1198 @param Context2 A pointer to the context to pass into the EntryPoint
1200 @param NewStack A pointer to the new stack to use for the EntryPoint
1202 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1203 Reserved on other architectures.
1209 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1210 IN VOID
*Context1
, OPTIONAL
1211 IN VOID
*Context2
, OPTIONAL
1212 IN VOID
*Context3
, OPTIONAL