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 EFI_PEI_STARTUP_DESCRIPTOR
*PeiStartupDescriptor
,
187 The entry routine to Pei Core, invoked by PeiMain during transition
188 from SEC to PEI. After switching stack in the PEI core, it will restart
189 with the old core data.
193 PeiStartupDescriptor - Information and services provided by SEC phase.
194 OldCoreData - Pointer to old core data that is used to initialize the
199 This function never returns
200 EFI_NOT_FOUND - Never reach
206 // Dispatcher support functions
210 PeimDispatchReadiness (
211 IN EFI_PEI_SERVICES
**PeiServices
,
212 IN VOID
*DependencyExpression
,
213 IN OUT BOOLEAN
*Runnable
219 This is the POSTFIX version of the dependency evaluator. When a
220 PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on
221 the evaluation stack. When that entry is poped from the evaluation
222 stack, the PPI is checked if it is installed. This method allows
223 some time savings as not all PPIs must be checked for certain
224 operation types (AND, OR).
228 PeiServices - Calling context.
230 DependencyExpression - Pointer to a dependency expression. The Grammar adheres to
231 the BNF described above and is stored in postfix notation.
232 Runnable - is True if the driver can be scheduled and False if the driver
233 cannot be scheduled. This is the value that the schedulers
234 should use for deciding the state of the driver.
238 Status = EFI_SUCCESS if it is a well-formed Grammar
239 EFI_INVALID_PARAMETER if the dependency expression overflows
241 EFI_INVALID_PARAMETER if the dependency expression underflows
243 EFI_INVALID_PARAMETER if the dependency expression is not a
251 IN EFI_PEI_STARTUP_DESCRIPTOR
*PeiStartupDescriptor
,
252 IN PEI_CORE_INSTANCE
*PrivateData
,
253 IN PEI_CORE_DISPATCH_DATA
*DispatchData
260 Conduct PEIM dispatch.
264 PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR
265 PrivateData - Pointer to the private data passed in from caller
266 DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.
270 EFI_SUCCESS - Successfully dispatched PEIM.
271 EFI_NOT_FOUND - The dispatch failed.
278 InitializeDispatcherData (
279 IN EFI_PEI_SERVICES
**PeiServices
,
280 IN PEI_CORE_INSTANCE
*OldCoreData
,
281 IN EFI_PEI_STARTUP_DESCRIPTOR
*PeiStartupDescriptor
287 Initialize the Dispatcher's data members
291 PeiServices - The PEI core services table.
292 OldCoreData - Pointer to old core data (before switching stack).
293 NULL if being run in non-permament memory mode.
294 PeiStartupDescriptor - Information and services provided by SEC phase.
307 IN EFI_PEI_SERVICES
**PeiServices
,
308 IN EFI_FIRMWARE_VOLUME_HEADER
*FwVolHeader
,
309 IN OUT EFI_FFS_FILE_HEADER
**PeimFileHeader
314 Given the input file pointer, search for the next matching file in the
315 FFS volume. The search starts from FileHeader inside
316 the Firmware Volume defined by FwVolHeader.
319 PeiServices - Pointer to the PEI Core Services Table.
321 FwVolHeader - Pointer to the FV header of the volume to search.
322 This parameter must point to a valid FFS volume.
324 PeimFileHeader - Pointer to the current file from which to begin searching.
325 This pointer will be updated upon return to reflect the file found.
328 EFI_NOT_FOUND - No files matching the search criteria were found
336 IN UINT8 CurrentPeim
,
337 IN UINT32 DispatchedPeimBitMap
343 This routine checks to see if a particular PEIM has been dispatched during
344 the PEI core dispatch.
347 CurrentPeim - The PEIM/FV in the bit array to check.
348 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
351 TRUE if PEIM already dispatched
359 IN EFI_PEI_SERVICES
**PeiServices
,
360 IN UINT8 CurrentPeim
,
361 OUT UINT32
*DispatchedPeimBitMap
367 This routine sets a PEIM as having been dispatched once its entry
368 point has been invoked.
372 PeiServices - The PEI core services table.
373 CurrentPeim - The PEIM/FV in the bit array to check.
374 DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.
384 IN EFI_PEI_SERVICES
**PeiServices
,
385 IN VOID
*CurrentPeimAddress
391 This routine parses the Dependency Expression, if available, and
392 decides if the module can be executed.
395 PeiServices - The PEI Service Table
396 CurrentPeimAddress - Address of the PEIM Firmware File under investigation
399 TRUE - Can be dispatched
400 FALSE - Cannot be dispatched
405 #if defined (MDE_CPU_IPF)
407 // In Ipf we should make special changes for the PHIT pointers to support
408 // recovery boot in cache mode.
410 #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)
411 #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL
414 IN PEI_CORE_INSTANCE
*CoreData
420 Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.
424 CoreData - The PEI core Private Data
433 #define SWITCH_TO_CACHE_MODE(CoreData)
438 // PPI support functions
441 InitializePpiServices (
442 IN EFI_PEI_SERVICES
**PeiServices
,
443 IN PEI_CORE_INSTANCE
*OldCoreData
449 Initialize PPI services.
453 PeiServices - The PEI core services table.
454 OldCoreData - Pointer to the PEI Core data.
455 NULL if being run in non-permament memory mode.
465 IN CONST EFI_PEI_SERVICES
**PeiServices
,
466 IN EFI_HOB_HANDOFF_INFO_TABLE
*OldHandOffHob
,
467 IN EFI_HOB_HANDOFF_INFO_TABLE
*NewHandOffHob
473 Migrate the Hob list from the CAR stack to PEI installed memory.
477 PeiServices - The PEI core services table.
478 OldHandOffHob - The old handoff HOB list.
479 NewHandOffHob - The new handoff HOB list.
489 IN CONST EFI_PEI_SERVICES
**PeiServices
,
490 IN CONST EFI_PEI_PPI_DESCRIPTOR
*PpiList
496 Install PPI services.
500 PeiServices - Pointer to the PEI Service Table
501 PpiList - Pointer to a list of PEI PPI Descriptors.
505 EFI_SUCCESS - if all PPIs in PpiList are successfully installed.
506 EFI_INVALID_PARAMETER - if PpiList is NULL pointer
507 EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid
508 EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI
516 IN CONST EFI_PEI_SERVICES
**PeiServices
,
517 IN CONST EFI_PEI_PPI_DESCRIPTOR
*OldPpi
,
518 IN CONST EFI_PEI_PPI_DESCRIPTOR
*NewPpi
524 Re-Install PPI services.
528 PeiServices - Pointer to the PEI Service Table
529 OldPpi - Pointer to the old PEI PPI Descriptors.
530 NewPpi - Pointer to the new PEI PPI Descriptors.
534 EFI_SUCCESS - if the operation was successful
535 EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL
536 EFI_INVALID_PARAMETER - if NewPpi is not valid
537 EFI_NOT_FOUND - if the PPI was not in the database
545 IN CONST EFI_PEI_SERVICES
**PeiServices
,
546 IN CONST EFI_GUID
*Guid
,
548 IN OUT EFI_PEI_PPI_DESCRIPTOR
**PpiDescriptor
,
555 Locate a given named PPI.
559 PeiServices - Pointer to the PEI Service Table
560 Guid - Pointer to GUID of the PPI.
561 Instance - Instance Number to discover.
562 PpiDescriptor - Pointer to reference the found descriptor. If not NULL,
563 returns a pointer to the descriptor (includes flags, etc)
564 Ppi - Pointer to reference the found PPI
568 Status - EFI_SUCCESS if the PPI is in the database
569 EFI_NOT_FOUND if the PPI is not in the database
576 IN CONST EFI_PEI_SERVICES
**PeiServices
,
577 IN CONST EFI_PEI_NOTIFY_DESCRIPTOR
*NotifyList
583 Install a notification for a given PPI.
587 PeiServices - Pointer to the PEI Service Table
588 NotifyList - Pointer to list of Descriptors to notify upon.
592 Status - EFI_SUCCESS if successful
593 EFI_OUT_OF_RESOURCES if no space in the database
594 EFI_INVALID_PARAMETER if not a good decriptor
601 IN EFI_PEI_SERVICES
**PeiServices
607 Process the Notify List at dispatch level.
611 PeiServices - Pointer to the PEI Service Table
620 IN CONST EFI_PEI_SERVICES
**PeiServices
,
622 IN INTN InstallStartIndex
,
623 IN INTN InstallStopIndex
,
624 IN INTN NotifyStartIndex
,
625 IN INTN NotifyStopIndex
631 Dispatch notifications.
635 PeiServices - Pointer to the PEI Service Table
636 NotifyType - Type of notify to fire.
637 InstallStartIndex - Install Beginning index.
638 InstallStopIndex - Install Ending index.
639 NotifyStartIndex - Notify Beginning index.
640 NotifyStopIndex - Notify Ending index.
648 // Boot mode support functions
653 IN CONST EFI_PEI_SERVICES
**PeiServices
,
654 IN OUT EFI_BOOT_MODE
*BootMode
660 This service enables PEIMs to ascertain the present value of the boot mode.
664 PeiServices - The PEI core services table.
665 BootMode - A pointer to contain the value of the boot mode.
669 EFI_SUCCESS - The boot mode was returned successfully.
670 EFI_INVALID_PARAMETER - BootMode is NULL.
678 IN CONST EFI_PEI_SERVICES
**PeiServices
,
679 IN EFI_BOOT_MODE BootMode
685 This service enables PEIMs to update the boot mode variable.
689 PeiServices - The PEI core services table.
690 BootMode - The value of the boot mode to set.
694 EFI_SUCCESS - The value was successfully updated
700 // Security support functions
703 InitializeSecurityServices (
704 IN EFI_PEI_SERVICES
**PeiServices
,
705 IN PEI_CORE_INSTANCE
*OldCoreData
711 Initialize the security services.
715 PeiServices - The PEI core services table.
716 OldCoreData - Pointer to the old core data.
717 NULL if being run in non-permament memory mode.
727 IN EFI_FIRMWARE_VOLUME_HEADER
*CurrentFvAddress
733 Provide a callout to the OEM FV verification service.
737 CurrentFvAddress - Pointer to the FV under investigation.
749 IN EFI_PEI_SERVICES
**PeiServices
,
750 IN EFI_FFS_FILE_HEADER
*CurrentPeimAddress
756 Provide a callout to the security verification service.
760 PeiServices - The PEI core services table.
761 CurrentPeimAddress - Pointer to the Firmware File under investigation.
765 EFI_SUCCESS - Image is OK
766 EFI_SECURITY_VIOLATION - Image is illegal
775 IN CONST EFI_PEI_SERVICES
**PeiServices
,
776 IN OUT VOID
**HobList
782 Gets the pointer to the HOB List.
786 PeiServices - The PEI core services table.
787 HobList - Pointer to the HOB List.
791 EFI_SUCCESS - Get the pointer of HOB List
792 EFI_NOT_AVAILABLE_YET - the HOB List is not yet published
793 EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)
801 IN CONST EFI_PEI_SERVICES
**PeiServices
,
810 Add a new HOB to the HOB List.
814 PeiServices - The PEI core services table.
815 Type - Type of the new HOB.
816 Length - Length of the new HOB to allocate.
817 Hob - Pointer to the new HOB.
822 - EFI_INVALID_PARAMETER if Hob is NULL
823 - EFI_NOT_AVAILABLE_YET if HobList is still not available.
824 - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.
830 PeiCoreBuildHobHandoffInfoTable (
831 IN EFI_BOOT_MODE BootMode
,
832 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
833 IN UINT64 MemoryLength
839 Builds a Handoff Information Table HOB
843 BootMode - Current Bootmode
844 MemoryBegin - Start Memory Address.
845 MemoryLength - Length of Memory.
856 // FFS Fw Volume support functions
861 IN CONST EFI_PEI_SERVICES
**PeiServices
,
863 IN EFI_PEI_FV_HANDLE FwVolHeader
,
864 IN OUT EFI_PEI_FILE_HANDLE
*FileHeader
869 Given the input file pointer, search for the next matching file in the
870 FFS volume as defined by SearchType. The search starts from FileHeader inside
871 the Firmware Volume defined by FwVolHeader.
874 PeiServices - Pointer to the PEI Core Services Table.
876 SearchType - Filter to find only files of this type.
877 Type EFI_FV_FILETYPE_ALL causes no filtering to be done.
879 FwVolHeader - Pointer to the FV header of the volume to search.
880 This parameter must point to a valid FFS volume.
882 FileHeader - Pointer to the current file from which to begin searching.
883 This pointer will be updated upon return to reflect the file found.
886 EFI_NOT_FOUND - No files matching the search criteria were found
894 PeiFfsFindSectionData (
895 IN CONST EFI_PEI_SERVICES
**PeiServices
,
896 IN EFI_SECTION_TYPE SectionType
,
897 IN EFI_PEI_FILE_HANDLE FfsFileHeader
,
898 IN OUT VOID
**SectionData
903 Given the input file pointer, search for the next matching section in the
907 PeiServices - Pointer to the PEI Core Services Table.
908 SearchType - Filter to find only sections of this type.
909 FfsFileHeader - Pointer to the current file to search.
910 SectionData - Pointer to the Section matching SectionType in FfsFileHeader.
911 - NULL if section not found
914 EFI_NOT_FOUND - No files matching the search criteria were found
922 PeiFvFindNextVolume (
923 IN CONST EFI_PEI_SERVICES
**PeiServices
,
925 IN OUT EFI_PEI_FV_HANDLE
*FwVolHeader
931 Return the BFV location
933 BugBug -- Move this to the location of this code to where the
934 other FV and FFS support code lives.
935 Also, update to use FindFV for instances #'s >= 1.
939 PeiServices - The PEI core services table.
940 Instance - Instance of FV to find
941 FwVolHeader - Pointer to contain the data to return
944 Pointer to the Firmware Volume instance requested
946 EFI_INVALID_PARAMETER - FwVolHeader is NULL
948 EFI_SUCCESS - Firmware volume instance successfully found.
954 // Memory support functions
957 InitializeMemoryServices (
958 IN EFI_PEI_SERVICES
**PeiServices
,
959 IN EFI_PEI_STARTUP_DESCRIPTOR
*PeiStartupDescriptor
,
960 IN PEI_CORE_INSTANCE
*OldCoreData
966 Initialize the memory services.
970 PeiServices - The PEI core services table.
971 PeiStartupDescriptor - Information and services provided by SEC phase.
972 OldCoreData - Pointer to the PEI Core data.
973 NULL if being run in non-permament memory mode.
984 PeiInstallPeiMemory (
985 IN CONST EFI_PEI_SERVICES
**PeiServices
,
986 IN EFI_PHYSICAL_ADDRESS MemoryBegin
,
987 IN UINT64 MemoryLength
993 Install the permanent memory is now available.
994 Creates HOB (PHIT and Stack).
998 PeiServices - The PEI core services table.
999 MemoryBegin - Start of memory address.
1000 MemoryLength - Length of memory.
1004 Status - EFI_SUCCESS
1012 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1013 IN EFI_MEMORY_TYPE MemoryType
,
1015 OUT EFI_PHYSICAL_ADDRESS
*Memory
1019 Routine Description:
1021 Memory allocation service on permanent memory,
1022 not usable prior to the memory installation.
1026 PeiServices - The PEI core services table.
1027 Type - Type of allocation.
1028 MemoryType - Type of memory to allocate.
1029 Pages - Number of pages to allocate.
1030 Memory - Pointer of memory allocated.
1034 Status - EFI_SUCCESS The allocation was successful
1035 EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.
1036 EFI_NOT_AVAILABLE_YET Called with permanent memory not available
1037 EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement
1038 to allocate the number of pages.
1046 IN CONST EFI_PEI_SERVICES
**PeiServices
,
1052 Routine Description:
1054 Memory allocation service on the CAR.
1058 PeiServices - The PEI core services table.
1060 Size - Amount of memory required
1062 Buffer - Address of pointer to the buffer
1066 Status - EFI_SUCCESS The allocation was successful
1067 EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement
1068 to allocate the requested size.
1075 IN EFI_PEI_SERVICES
**PeiServices
,
1076 IN EFI_FFS_FILE_HEADER
*PeimFileHeader
,
1077 OUT VOID
**EntryPoint
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 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.
1166 This routine enable a PEIM to register itself to shadow when PEI Foundation
1167 discovery permanent memory.
1169 @param FileHandle File handle of a PEIM.
1171 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.
1172 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.
1173 @retval EFI_SUCCESS Successfully to register itself.
1178 PeiRegisterForShadow (
1179 IN EFI_PEI_FILE_HANDLE FileHandle
1184 Transfers control to a function starting with a new stack.
1186 Transfers control to the function specified by EntryPoint using the new stack
1187 specified by NewStack and passing in the parameters specified by Context1 and
1188 Context2. Context1 and Context2 are optional and may be NULL. The function
1189 EntryPoint must never return.
1191 If EntryPoint is NULL, then ASSERT().
1192 If NewStack is NULL, then ASSERT().
1194 @param EntryPoint A pointer to function to call with the new stack.
1195 @param Context1 A pointer to the context to pass into the EntryPoint
1197 @param Context2 A pointer to the context to pass into the EntryPoint
1199 @param NewStack A pointer to the new stack to use for the EntryPoint
1201 @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's
1202 Reserved on other architectures.
1208 IN SWITCH_STACK_ENTRY_POINT EntryPoint
,
1209 IN VOID
*Context1
, OPTIONAL
1210 IN VOID
*Context2
, OPTIONAL