Commit | Line | Data |
---|---|---|
192f6d4c | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006 - 2007, Intel Corporation\r | |
4 | All rights reserved. This program and the accompanying materials\r | |
5 | are licensed and made available under the terms and conditions of the BSD License\r | |
6 | which accompanies this distribution. The full text of the license may be found at\r | |
7 | http://opensource.org/licenses/bsd-license.php\r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
11 | \r | |
12 | Module Name:\r | |
13 | \r | |
14 | PeiMain.h\r | |
15 | \r | |
16 | Abstract:\r | |
17 | \r | |
18 | Definition of Pei Core Structures and Services\r | |
19 | \r | |
20 | Revision History\r | |
21 | \r | |
22 | --*/\r | |
23 | \r | |
24 | #ifndef _PEI_MAIN_H_\r | |
25 | #define _PEI_MAIN_H_\r | |
26 | \r | |
859b72fa A |
27 | #include <PiPei.h>\r |
28 | #include <FrameworkPei.h>\r | |
28dc3c67 | 29 | #include <Guid/StatusCodeDataTypeId.h>\r |
859b72fa A |
30 | #include <Ppi/DxeIpl.h>\r |
31 | #include <Ppi/MemoryDiscovered.h>\r | |
32 | #include <Ppi/FindFv.h>\r | |
33 | #include <Ppi/StatusCode.h>\r | |
34 | #include <Ppi/Security.h>\r | |
35 | #include <Ppi/Reset.h>\r | |
1df7a023 | 36 | #include <Ppi/FvLoadFile.h>\r |
859b72fa A |
37 | #include <Library/DebugLib.h>\r |
38 | #include <Library/PeiCoreEntryPoint.h>\r | |
39 | #include <Library/BaseLib.h>\r | |
40 | #include <Library/HobLib.h>\r | |
41 | #include <Library/PerformanceLib.h>\r | |
42 | #include <Library/PeiServicesLib.h>\r | |
43 | #include <Library/ReportStatusCodeLib.h>\r | |
44 | #include <Library/PeCoffGetEntryPointLib.h>\r | |
45 | #include <Library/BaseMemoryLib.h>\r | |
46 | #include <Library/TimerLib.h>\r | |
28dc3c67 | 47 | #include <IndustryStandard/PeImage.h>\r |
14e8823a | 48 | #include <Library/PeiServicesTablePointerLib.h>\r |
192f6d4c | 49 | \r |
50 | extern EFI_GUID gEfiPeiCorePrivateGuid;\r | |
51 | \r | |
3a63377f | 52 | #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff\r |
53 | \r | |
192f6d4c | 54 | //\r |
55 | // Pei Core private data structures\r | |
56 | //\r | |
57 | typedef union {\r | |
58 | EFI_PEI_PPI_DESCRIPTOR *Ppi;\r | |
59 | EFI_PEI_NOTIFY_DESCRIPTOR *Notify;\r | |
60 | VOID *Raw;\r | |
61 | } PEI_PPI_LIST_POINTERS;\r | |
62 | \r | |
63 | #define PEI_STACK_SIZE 0x20000\r | |
64 | \r | |
65 | #define MAX_PPI_DESCRIPTORS 64\r | |
66 | \r | |
67 | typedef struct {\r | |
68 | INTN PpiListEnd;\r | |
69 | INTN NotifyListEnd;\r | |
70 | INTN DispatchListEnd;\r | |
71 | INTN LastDispatchedInstall;\r | |
72 | INTN LastDispatchedNotify;\r | |
73 | PEI_PPI_LIST_POINTERS PpiListPtrs[MAX_PPI_DESCRIPTORS];\r | |
74 | } PEI_PPI_DATABASE;\r | |
75 | \r | |
3a63377f | 76 | \r |
77 | #define PEI_CORE_MAX_FV_SUPPORTED 4\r | |
78 | #define PEI_CORE_MAX_PEIM_PER_FV 32\r | |
79 | \r | |
80 | //\r | |
81 | // PEI_CORE_FV_HANDE.PeimState\r | |
82 | // Do not change these values as there is code doing math to change states.\r | |
83 | // Look for Private->Fv[FvCount].PeimState[PeimCount]++;\r | |
84 | //\r | |
85 | #define PEIM_STATE_NOT_DISPATCHED 0x00\r | |
86 | #define PEIM_STATE_DISPATCHED 0x01\r | |
87 | #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02\r | |
88 | #define PEIM_STATE_DONE 0x03\r | |
89 | \r | |
90 | typedef struct {\r | |
91 | EFI_FIRMWARE_VOLUME_HEADER *FvHeader;\r | |
92 | UINT8 PeimState[PEI_CORE_MAX_PEIM_PER_FV]; \r | |
93 | EFI_PEI_FILE_HANDLE FvFileHandles[PEI_CORE_MAX_PEIM_PER_FV];\r | |
94 | BOOLEAN ScanFv;\r | |
95 | } PEI_CORE_FV_HANDLE;\r | |
96 | \r | |
192f6d4c | 97 | typedef struct {\r |
98 | UINT8 CurrentPeim;\r | |
99 | UINT8 CurrentFv;\r | |
100 | UINT32 DispatchedPeimBitMap;\r | |
101 | UINT32 PreviousPeimBitMap;\r | |
102 | EFI_FFS_FILE_HEADER *CurrentPeimAddress;\r | |
103 | EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress;\r | |
104 | EFI_FIRMWARE_VOLUME_HEADER *BootFvAddress;\r | |
105 | EFI_PEI_FIND_FV_PPI *FindFv;\r | |
106 | } PEI_CORE_DISPATCH_DATA;\r | |
107 | \r | |
108 | \r | |
109 | //\r | |
110 | // Pei Core private data structure instance\r | |
111 | //\r | |
112 | \r | |
113 | #define PEI_CORE_HANDLE_SIGNATURE EFI_SIGNATURE_32('P','e','i','C')\r | |
114 | \r | |
115 | typedef struct{\r | |
116 | UINTN Signature;\r | |
117 | EFI_PEI_SERVICES *PS; // Point to ServiceTableShadow\r | |
118 | PEI_PPI_DATABASE PpiData;\r | |
119 | PEI_CORE_DISPATCH_DATA DispatchData;\r | |
3a63377f | 120 | UINTN FvCount;\r |
121 | PEI_CORE_FV_HANDLE Fv[PEI_CORE_MAX_FV_SUPPORTED];\r | |
122 | EFI_PEI_FILE_HANDLE CurrentFvFileHandles[PEI_CORE_MAX_PEIM_PER_FV];\r | |
123 | UINTN AprioriCount;\r | |
124 | UINTN CurrentPeimFvCount; \r | |
125 | UINTN CurrentPeimCount;\r | |
126 | EFI_PEI_FILE_HANDLE CurrentFileHandle;\r | |
127 | UINTN AllFvCount;\r | |
128 | EFI_PEI_FV_HANDLE AllFv[PEI_CORE_MAX_FV_SUPPORTED];\r | |
192f6d4c | 129 | EFI_PEI_HOB_POINTERS HobList;\r |
130 | BOOLEAN SwitchStackSignal;\r | |
131 | BOOLEAN PeiMemoryInstalled;\r | |
132 | EFI_PHYSICAL_ADDRESS StackBase;\r | |
133 | UINT64 StackSize;\r | |
134 | VOID *BottomOfCarHeap;\r | |
135 | VOID *TopOfCarHeap;\r | |
136 | VOID *CpuIo;\r | |
137 | EFI_PEI_SECURITY_PPI *PrivateSecurityPpi;\r | |
138 | EFI_PEI_SERVICES ServiceTableShadow;\r | |
139 | UINTN SizeOfCacheAsRam;\r | |
140 | VOID *MaxTopOfCarHeap;\r | |
141 | } PEI_CORE_INSTANCE;\r | |
142 | \r | |
143 | //\r | |
144 | // Pei Core Instance Data Macros\r | |
145 | //\r | |
146 | \r | |
147 | #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \\r | |
148 | CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)\r | |
149 | \r | |
150 | //\r | |
151 | // BUGBUG: Where does this go really?\r | |
152 | //\r | |
153 | typedef\r | |
154 | EFI_STATUS\r | |
155 | (EFIAPI *PEI_CORE_ENTRY_POINT)(\r | |
156 | IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r | |
157 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
158 | );\r | |
159 | \r | |
160 | //\r | |
161 | // Union of temporarily used function pointers (to save stack space)\r | |
162 | //\r | |
163 | typedef union {\r | |
164 | PEI_CORE_ENTRY_POINT PeiCore;\r | |
1c9d209f | 165 | EFI_PEIM_ENTRY_POINT2 PeimEntry;\r |
192f6d4c | 166 | EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry;\r |
167 | EFI_DXE_IPL_PPI *DxeIpl;\r | |
168 | EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;\r | |
169 | EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor;\r | |
170 | VOID *Raw;\r | |
171 | } PEI_CORE_TEMP_POINTERS;\r | |
172 | \r | |
173 | \r | |
174 | //\r | |
175 | // PeiCore function\r | |
176 | //\r | |
177 | EFI_STATUS\r | |
178 | EFIAPI\r | |
179 | PeiCore (\r | |
5aae0aa7 | 180 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r |
181 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpList,\r | |
182 | IN VOID *Data\r | |
192f6d4c | 183 | )\r |
184 | /*++\r | |
185 | \r | |
186 | Routine Description:\r | |
187 | \r | |
188 | The entry routine to Pei Core, invoked by PeiMain during transition\r | |
189 | from SEC to PEI. After switching stack in the PEI core, it will restart\r | |
190 | with the old core data.\r | |
191 | \r | |
192 | Arguments:\r | |
193 | \r | |
194 | PeiStartupDescriptor - Information and services provided by SEC phase.\r | |
195 | OldCoreData - Pointer to old core data that is used to initialize the\r | |
196 | core's data areas.\r | |
197 | \r | |
198 | Returns:\r | |
199 | \r | |
200 | This function never returns\r | |
201 | EFI_NOT_FOUND - Never reach\r | |
202 | \r | |
203 | --*/\r | |
204 | ;\r | |
205 | \r | |
206 | //\r | |
207 | // Dispatcher support functions\r | |
208 | //\r | |
209 | \r | |
210 | EFI_STATUS\r | |
211 | PeimDispatchReadiness (\r | |
212 | IN EFI_PEI_SERVICES **PeiServices,\r | |
213 | IN VOID *DependencyExpression,\r | |
214 | IN OUT BOOLEAN *Runnable\r | |
215 | )\r | |
216 | /*++\r | |
217 | \r | |
218 | Routine Description:\r | |
219 | \r | |
220 | This is the POSTFIX version of the dependency evaluator. When a\r | |
221 | PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on\r | |
222 | the evaluation stack. When that entry is poped from the evaluation\r | |
223 | stack, the PPI is checked if it is installed. This method allows\r | |
224 | some time savings as not all PPIs must be checked for certain\r | |
225 | operation types (AND, OR).\r | |
226 | \r | |
227 | Arguments:\r | |
228 | \r | |
229 | PeiServices - Calling context.\r | |
230 | \r | |
231 | DependencyExpression - Pointer to a dependency expression. The Grammar adheres to\r | |
232 | the BNF described above and is stored in postfix notation.\r | |
233 | Runnable - is True if the driver can be scheduled and False if the driver\r | |
234 | cannot be scheduled. This is the value that the schedulers\r | |
235 | should use for deciding the state of the driver.\r | |
236 | \r | |
237 | Returns:\r | |
238 | \r | |
239 | Status = EFI_SUCCESS if it is a well-formed Grammar\r | |
240 | EFI_INVALID_PARAMETER if the dependency expression overflows\r | |
241 | the evaluation stack\r | |
242 | EFI_INVALID_PARAMETER if the dependency expression underflows\r | |
243 | the evaluation stack\r | |
244 | EFI_INVALID_PARAMETER if the dependency expression is not a\r | |
245 | well-formed Grammar.\r | |
246 | --*/\r | |
247 | ;\r | |
248 | \r | |
249 | \r | |
250 | EFI_STATUS\r | |
251 | PeiDispatcher (\r | |
5aae0aa7 | 252 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r |
192f6d4c | 253 | IN PEI_CORE_INSTANCE *PrivateData,\r |
254 | IN PEI_CORE_DISPATCH_DATA *DispatchData\r | |
255 | )\r | |
256 | \r | |
257 | /*++\r | |
258 | \r | |
259 | Routine Description:\r | |
260 | \r | |
261 | Conduct PEIM dispatch.\r | |
262 | \r | |
263 | Arguments:\r | |
264 | \r | |
265 | PeiStartupDescriptor - Pointer to IN EFI_PEI_STARTUP_DESCRIPTOR\r | |
266 | PrivateData - Pointer to the private data passed in from caller\r | |
267 | DispatchData - Pointer to PEI_CORE_DISPATCH_DATA data.\r | |
268 | \r | |
269 | Returns:\r | |
270 | \r | |
271 | EFI_SUCCESS - Successfully dispatched PEIM.\r | |
272 | EFI_NOT_FOUND - The dispatch failed.\r | |
273 | \r | |
274 | --*/\r | |
275 | ;\r | |
276 | \r | |
277 | \r | |
278 | VOID\r | |
279 | InitializeDispatcherData (\r | |
280 | IN EFI_PEI_SERVICES **PeiServices,\r | |
281 | IN PEI_CORE_INSTANCE *OldCoreData,\r | |
5aae0aa7 | 282 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r |
192f6d4c | 283 | )\r |
284 | /*++\r | |
285 | \r | |
286 | Routine Description:\r | |
287 | \r | |
288 | Initialize the Dispatcher's data members\r | |
289 | \r | |
290 | Arguments:\r | |
291 | \r | |
292 | PeiServices - The PEI core services table.\r | |
293 | OldCoreData - Pointer to old core data (before switching stack).\r | |
294 | NULL if being run in non-permament memory mode.\r | |
295 | PeiStartupDescriptor - Information and services provided by SEC phase.\r | |
296 | \r | |
297 | \r | |
298 | Returns:\r | |
299 | \r | |
300 | None\r | |
301 | \r | |
302 | --*/\r | |
303 | ;\r | |
304 | \r | |
305 | \r | |
306 | EFI_STATUS\r | |
307 | FindNextPeim (\r | |
308 | IN EFI_PEI_SERVICES **PeiServices,\r | |
309 | IN EFI_FIRMWARE_VOLUME_HEADER *FwVolHeader,\r | |
310 | IN OUT EFI_FFS_FILE_HEADER **PeimFileHeader\r | |
311 | )\r | |
312 | /*++\r | |
313 | \r | |
314 | Routine Description:\r | |
315 | Given the input file pointer, search for the next matching file in the\r | |
316 | FFS volume. The search starts from FileHeader inside\r | |
317 | the Firmware Volume defined by FwVolHeader.\r | |
318 | \r | |
319 | Arguments:\r | |
320 | PeiServices - Pointer to the PEI Core Services Table.\r | |
321 | \r | |
322 | FwVolHeader - Pointer to the FV header of the volume to search.\r | |
323 | This parameter must point to a valid FFS volume.\r | |
324 | \r | |
325 | PeimFileHeader - Pointer to the current file from which to begin searching.\r | |
326 | This pointer will be updated upon return to reflect the file found.\r | |
327 | \r | |
328 | Returns:\r | |
329 | EFI_NOT_FOUND - No files matching the search criteria were found\r | |
330 | EFI_SUCCESS\r | |
331 | \r | |
332 | --*/\r | |
333 | ;\r | |
334 | \r | |
335 | BOOLEAN\r | |
336 | Dispatched (\r | |
337 | IN UINT8 CurrentPeim,\r | |
338 | IN UINT32 DispatchedPeimBitMap\r | |
339 | )\r | |
340 | /*++\r | |
341 | \r | |
342 | Routine Description:\r | |
343 | \r | |
344 | This routine checks to see if a particular PEIM has been dispatched during\r | |
345 | the PEI core dispatch.\r | |
346 | \r | |
347 | Arguments:\r | |
348 | CurrentPeim - The PEIM/FV in the bit array to check.\r | |
349 | DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.\r | |
350 | \r | |
351 | Returns:\r | |
352 | TRUE if PEIM already dispatched\r | |
353 | FALSE if not\r | |
354 | \r | |
355 | --*/\r | |
356 | ;\r | |
357 | \r | |
358 | VOID\r | |
359 | SetDispatched (\r | |
360 | IN EFI_PEI_SERVICES **PeiServices,\r | |
361 | IN UINT8 CurrentPeim,\r | |
362 | OUT UINT32 *DispatchedPeimBitMap\r | |
363 | )\r | |
364 | /*++\r | |
365 | \r | |
366 | Routine Description:\r | |
367 | \r | |
368 | This routine sets a PEIM as having been dispatched once its entry\r | |
369 | point has been invoked.\r | |
370 | \r | |
371 | Arguments:\r | |
372 | \r | |
373 | PeiServices - The PEI core services table.\r | |
374 | CurrentPeim - The PEIM/FV in the bit array to check.\r | |
375 | DispatchedPeimBitMap - Bit array, each bit corresponds to a PEIM/FV.\r | |
376 | \r | |
377 | Returns:\r | |
378 | None\r | |
379 | \r | |
380 | --*/\r | |
381 | ;\r | |
382 | \r | |
383 | BOOLEAN\r | |
384 | DepexSatisfied (\r | |
385 | IN EFI_PEI_SERVICES **PeiServices,\r | |
386 | IN VOID *CurrentPeimAddress\r | |
387 | )\r | |
388 | /*++\r | |
389 | \r | |
390 | Routine Description:\r | |
391 | \r | |
392 | This routine parses the Dependency Expression, if available, and\r | |
393 | decides if the module can be executed.\r | |
394 | \r | |
395 | Arguments:\r | |
396 | PeiServices - The PEI Service Table\r | |
397 | CurrentPeimAddress - Address of the PEIM Firmware File under investigation\r | |
398 | \r | |
399 | Returns:\r | |
400 | TRUE - Can be dispatched\r | |
401 | FALSE - Cannot be dispatched\r | |
402 | \r | |
403 | --*/\r | |
404 | ;\r | |
405 | \r | |
406 | #if defined (MDE_CPU_IPF)\r | |
407 | //\r | |
408 | // In Ipf we should make special changes for the PHIT pointers to support\r | |
409 | // recovery boot in cache mode.\r | |
410 | //\r | |
411 | #define SWITCH_TO_CACHE_MODE(CoreData) SwitchToCacheMode(CoreData)\r | |
412 | #define CACHE_MODE_ADDRESS_MASK 0x7FFFFFFFFFFFFFFFULL\r | |
413 | VOID\r | |
414 | SwitchToCacheMode (\r | |
415 | IN PEI_CORE_INSTANCE *CoreData\r | |
416 | )\r | |
417 | /*++\r | |
418 | \r | |
419 | Routine Description:\r | |
420 | \r | |
421 | Switch the PHIT pointers to cache mode after InstallPeiMemory in CAR.\r | |
422 | \r | |
423 | Arguments:\r | |
424 | \r | |
425 | CoreData - The PEI core Private Data\r | |
426 | \r | |
427 | Returns:\r | |
428 | \r | |
429 | --*/\r | |
430 | ;\r | |
431 | \r | |
432 | #else\r | |
433 | \r | |
434 | #define SWITCH_TO_CACHE_MODE(CoreData)\r | |
435 | \r | |
436 | #endif\r | |
437 | \r | |
438 | //\r | |
439 | // PPI support functions\r | |
440 | //\r | |
441 | VOID\r | |
442 | InitializePpiServices (\r | |
443 | IN EFI_PEI_SERVICES **PeiServices,\r | |
444 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
445 | )\r | |
446 | /*++\r | |
447 | \r | |
448 | Routine Description:\r | |
449 | \r | |
450 | Initialize PPI services.\r | |
451 | \r | |
452 | Arguments:\r | |
453 | \r | |
454 | PeiServices - The PEI core services table.\r | |
455 | OldCoreData - Pointer to the PEI Core data.\r | |
456 | NULL if being run in non-permament memory mode.\r | |
457 | \r | |
458 | Returns:\r | |
459 | Nothing\r | |
460 | \r | |
461 | --*/\r | |
462 | ;\r | |
463 | \r | |
464 | VOID\r | |
465 | ConvertPpiPointers (\r | |
0c2b5da8 | 466 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 467 | IN EFI_HOB_HANDOFF_INFO_TABLE *OldHandOffHob,\r |
468 | IN EFI_HOB_HANDOFF_INFO_TABLE *NewHandOffHob\r | |
469 | )\r | |
470 | /*++\r | |
471 | \r | |
472 | Routine Description:\r | |
473 | \r | |
474 | Migrate the Hob list from the CAR stack to PEI installed memory.\r | |
475 | \r | |
476 | Arguments:\r | |
477 | \r | |
478 | PeiServices - The PEI core services table.\r | |
479 | OldHandOffHob - The old handoff HOB list.\r | |
480 | NewHandOffHob - The new handoff HOB list.\r | |
481 | \r | |
482 | Returns:\r | |
483 | \r | |
484 | --*/\r | |
485 | ;\r | |
486 | \r | |
487 | EFI_STATUS\r | |
488 | EFIAPI\r | |
489 | PeiInstallPpi (\r | |
0c2b5da8 | 490 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
491 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r | |
192f6d4c | 492 | )\r |
493 | /*++\r | |
494 | \r | |
495 | Routine Description:\r | |
496 | \r | |
497 | Install PPI services.\r | |
498 | \r | |
499 | Arguments:\r | |
500 | \r | |
501 | PeiServices - Pointer to the PEI Service Table\r | |
502 | PpiList - Pointer to a list of PEI PPI Descriptors.\r | |
503 | \r | |
504 | Returns:\r | |
505 | \r | |
506 | EFI_SUCCESS - if all PPIs in PpiList are successfully installed.\r | |
507 | EFI_INVALID_PARAMETER - if PpiList is NULL pointer\r | |
508 | EFI_INVALID_PARAMETER - if any PPI in PpiList is not valid\r | |
509 | EFI_OUT_OF_RESOURCES - if there is no more memory resource to install PPI\r | |
510 | \r | |
511 | --*/\r | |
512 | ;\r | |
513 | \r | |
514 | EFI_STATUS\r | |
515 | EFIAPI\r | |
516 | PeiReInstallPpi (\r | |
0c2b5da8 | 517 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
518 | IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,\r | |
519 | IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi\r | |
192f6d4c | 520 | )\r |
521 | /*++\r | |
522 | \r | |
523 | Routine Description:\r | |
524 | \r | |
525 | Re-Install PPI services.\r | |
526 | \r | |
527 | Arguments:\r | |
528 | \r | |
529 | PeiServices - Pointer to the PEI Service Table\r | |
530 | OldPpi - Pointer to the old PEI PPI Descriptors.\r | |
531 | NewPpi - Pointer to the new PEI PPI Descriptors.\r | |
532 | \r | |
533 | Returns:\r | |
534 | \r | |
535 | EFI_SUCCESS - if the operation was successful\r | |
536 | EFI_INVALID_PARAMETER - if OldPpi or NewPpi is NULL\r | |
537 | EFI_INVALID_PARAMETER - if NewPpi is not valid\r | |
538 | EFI_NOT_FOUND - if the PPI was not in the database\r | |
539 | \r | |
540 | --*/\r | |
541 | ;\r | |
542 | \r | |
543 | EFI_STATUS\r | |
544 | EFIAPI\r | |
545 | PeiLocatePpi (\r | |
0c2b5da8 | 546 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
547 | IN CONST EFI_GUID *Guid,\r | |
192f6d4c | 548 | IN UINTN Instance,\r |
549 | IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,\r | |
550 | IN OUT VOID **Ppi\r | |
551 | )\r | |
552 | /*++\r | |
553 | \r | |
554 | Routine Description:\r | |
555 | \r | |
556 | Locate a given named PPI.\r | |
557 | \r | |
558 | Arguments:\r | |
559 | \r | |
560 | PeiServices - Pointer to the PEI Service Table\r | |
561 | Guid - Pointer to GUID of the PPI.\r | |
562 | Instance - Instance Number to discover.\r | |
563 | PpiDescriptor - Pointer to reference the found descriptor. If not NULL,\r | |
564 | returns a pointer to the descriptor (includes flags, etc)\r | |
565 | Ppi - Pointer to reference the found PPI\r | |
566 | \r | |
567 | Returns:\r | |
568 | \r | |
569 | Status - EFI_SUCCESS if the PPI is in the database\r | |
570 | EFI_NOT_FOUND if the PPI is not in the database\r | |
571 | --*/\r | |
572 | ;\r | |
573 | \r | |
574 | EFI_STATUS\r | |
575 | EFIAPI\r | |
576 | PeiNotifyPpi (\r | |
0c2b5da8 | 577 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
578 | IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList\r | |
192f6d4c | 579 | )\r |
580 | /*++\r | |
581 | \r | |
582 | Routine Description:\r | |
583 | \r | |
584 | Install a notification for a given PPI.\r | |
585 | \r | |
586 | Arguments:\r | |
587 | \r | |
588 | PeiServices - Pointer to the PEI Service Table\r | |
589 | NotifyList - Pointer to list of Descriptors to notify upon.\r | |
590 | \r | |
591 | Returns:\r | |
592 | \r | |
593 | Status - EFI_SUCCESS if successful\r | |
594 | EFI_OUT_OF_RESOURCES if no space in the database\r | |
595 | EFI_INVALID_PARAMETER if not a good decriptor\r | |
596 | \r | |
597 | --*/\r | |
598 | ;\r | |
599 | \r | |
600 | VOID\r | |
601 | ProcessNotifyList (\r | |
602 | IN EFI_PEI_SERVICES **PeiServices\r | |
603 | )\r | |
604 | /*++\r | |
605 | \r | |
606 | Routine Description:\r | |
607 | \r | |
608 | Process the Notify List at dispatch level.\r | |
609 | \r | |
610 | Arguments:\r | |
611 | \r | |
612 | PeiServices - Pointer to the PEI Service Table\r | |
613 | \r | |
614 | Returns:\r | |
615 | \r | |
616 | --*/\r | |
617 | ;\r | |
618 | \r | |
619 | VOID\r | |
620 | DispatchNotify (\r | |
0c2b5da8 | 621 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 622 | IN UINTN NotifyType,\r |
623 | IN INTN InstallStartIndex,\r | |
624 | IN INTN InstallStopIndex,\r | |
625 | IN INTN NotifyStartIndex,\r | |
626 | IN INTN NotifyStopIndex\r | |
627 | )\r | |
628 | /*++\r | |
629 | \r | |
630 | Routine Description:\r | |
631 | \r | |
632 | Dispatch notifications.\r | |
633 | \r | |
634 | Arguments:\r | |
635 | \r | |
636 | PeiServices - Pointer to the PEI Service Table\r | |
637 | NotifyType - Type of notify to fire.\r | |
638 | InstallStartIndex - Install Beginning index.\r | |
639 | InstallStopIndex - Install Ending index.\r | |
640 | NotifyStartIndex - Notify Beginning index.\r | |
641 | NotifyStopIndex - Notify Ending index.\r | |
642 | \r | |
643 | Returns: None\r | |
644 | \r | |
645 | --*/\r | |
646 | ;\r | |
647 | \r | |
648 | //\r | |
649 | // Boot mode support functions\r | |
650 | //\r | |
651 | EFI_STATUS\r | |
652 | EFIAPI\r | |
653 | PeiGetBootMode (\r | |
0c2b5da8 | 654 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 655 | IN OUT EFI_BOOT_MODE *BootMode\r |
656 | )\r | |
657 | /*++\r | |
658 | \r | |
659 | Routine Description:\r | |
660 | \r | |
661 | This service enables PEIMs to ascertain the present value of the boot mode.\r | |
662 | \r | |
663 | Arguments:\r | |
664 | \r | |
665 | PeiServices - The PEI core services table.\r | |
666 | BootMode - A pointer to contain the value of the boot mode.\r | |
667 | \r | |
668 | Returns:\r | |
669 | \r | |
670 | EFI_SUCCESS - The boot mode was returned successfully.\r | |
671 | EFI_INVALID_PARAMETER - BootMode is NULL.\r | |
672 | \r | |
673 | --*/\r | |
674 | ;\r | |
675 | \r | |
676 | EFI_STATUS\r | |
677 | EFIAPI\r | |
678 | PeiSetBootMode (\r | |
0c2b5da8 | 679 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 680 | IN EFI_BOOT_MODE BootMode\r |
681 | )\r | |
682 | /*++\r | |
683 | \r | |
684 | Routine Description:\r | |
685 | \r | |
686 | This service enables PEIMs to update the boot mode variable.\r | |
687 | \r | |
688 | Arguments:\r | |
689 | \r | |
690 | PeiServices - The PEI core services table.\r | |
691 | BootMode - The value of the boot mode to set.\r | |
692 | \r | |
693 | Returns:\r | |
694 | \r | |
695 | EFI_SUCCESS - The value was successfully updated\r | |
696 | \r | |
697 | --*/\r | |
698 | ;\r | |
699 | \r | |
700 | //\r | |
701 | // Security support functions\r | |
702 | //\r | |
703 | VOID\r | |
704 | InitializeSecurityServices (\r | |
705 | IN EFI_PEI_SERVICES **PeiServices,\r | |
706 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
707 | )\r | |
708 | /*++\r | |
709 | \r | |
710 | Routine Description:\r | |
711 | \r | |
712 | Initialize the security services.\r | |
713 | \r | |
714 | Arguments:\r | |
715 | \r | |
716 | PeiServices - The PEI core services table.\r | |
717 | OldCoreData - Pointer to the old core data.\r | |
718 | NULL if being run in non-permament memory mode.\r | |
719 | Returns:\r | |
720 | \r | |
721 | None\r | |
722 | \r | |
723 | --*/\r | |
724 | ;\r | |
725 | \r | |
726 | EFI_STATUS\r | |
727 | VerifyFv (\r | |
728 | IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress\r | |
729 | )\r | |
730 | /*++\r | |
731 | \r | |
732 | Routine Description:\r | |
733 | \r | |
734 | Provide a callout to the OEM FV verification service.\r | |
735 | \r | |
736 | Arguments:\r | |
737 | \r | |
738 | CurrentFvAddress - Pointer to the FV under investigation.\r | |
739 | \r | |
740 | Returns:\r | |
741 | \r | |
742 | Status - EFI_SUCCESS\r | |
743 | \r | |
744 | --*/\r | |
745 | ;\r | |
746 | \r | |
747 | \r | |
748 | EFI_STATUS\r | |
749 | VerifyPeim (\r | |
750 | IN EFI_PEI_SERVICES **PeiServices,\r | |
751 | IN EFI_FFS_FILE_HEADER *CurrentPeimAddress\r | |
752 | )\r | |
753 | /*++\r | |
754 | \r | |
755 | Routine Description:\r | |
756 | \r | |
757 | Provide a callout to the security verification service.\r | |
758 | \r | |
759 | Arguments:\r | |
760 | \r | |
761 | PeiServices - The PEI core services table.\r | |
762 | CurrentPeimAddress - Pointer to the Firmware File under investigation.\r | |
763 | \r | |
764 | Returns:\r | |
765 | \r | |
766 | EFI_SUCCESS - Image is OK\r | |
767 | EFI_SECURITY_VIOLATION - Image is illegal\r | |
768 | \r | |
769 | --*/\r | |
770 | ;\r | |
771 | \r | |
772 | \r | |
773 | EFI_STATUS\r | |
774 | EFIAPI\r | |
775 | PeiGetHobList (\r | |
0c2b5da8 | 776 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 777 | IN OUT VOID **HobList\r |
778 | )\r | |
779 | /*++\r | |
780 | \r | |
781 | Routine Description:\r | |
782 | \r | |
783 | Gets the pointer to the HOB List.\r | |
784 | \r | |
785 | Arguments:\r | |
786 | \r | |
787 | PeiServices - The PEI core services table.\r | |
788 | HobList - Pointer to the HOB List.\r | |
789 | \r | |
790 | Returns:\r | |
791 | \r | |
792 | EFI_SUCCESS - Get the pointer of HOB List\r | |
793 | EFI_NOT_AVAILABLE_YET - the HOB List is not yet published\r | |
794 | EFI_INVALID_PARAMETER - HobList is NULL (in debug mode)\r | |
795 | \r | |
796 | --*/\r | |
797 | ;\r | |
798 | \r | |
799 | EFI_STATUS\r | |
800 | EFIAPI\r | |
801 | PeiCreateHob (\r | |
0c2b5da8 | 802 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 803 | IN UINT16 Type,\r |
804 | IN UINT16 Length,\r | |
805 | IN OUT VOID **Hob\r | |
806 | )\r | |
807 | /*++\r | |
808 | \r | |
809 | Routine Description:\r | |
810 | \r | |
811 | Add a new HOB to the HOB List.\r | |
812 | \r | |
813 | Arguments:\r | |
814 | \r | |
815 | PeiServices - The PEI core services table.\r | |
816 | Type - Type of the new HOB.\r | |
817 | Length - Length of the new HOB to allocate.\r | |
818 | Hob - Pointer to the new HOB.\r | |
819 | \r | |
820 | Returns:\r | |
821 | \r | |
822 | Status - EFI_SUCCESS\r | |
823 | - EFI_INVALID_PARAMETER if Hob is NULL\r | |
824 | - EFI_NOT_AVAILABLE_YET if HobList is still not available.\r | |
825 | - EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.\r | |
826 | \r | |
827 | --*/\r | |
828 | ;\r | |
829 | \r | |
830 | EFI_STATUS\r | |
831 | PeiCoreBuildHobHandoffInfoTable (\r | |
832 | IN EFI_BOOT_MODE BootMode,\r | |
833 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r | |
834 | IN UINT64 MemoryLength\r | |
835 | )\r | |
836 | /*++\r | |
837 | \r | |
838 | Routine Description:\r | |
839 | \r | |
840 | Builds a Handoff Information Table HOB\r | |
841 | \r | |
842 | Arguments:\r | |
843 | \r | |
844 | BootMode - Current Bootmode\r | |
845 | MemoryBegin - Start Memory Address.\r | |
846 | MemoryLength - Length of Memory.\r | |
847 | \r | |
848 | Returns:\r | |
849 | \r | |
850 | EFI_SUCCESS\r | |
851 | \r | |
852 | --*/\r | |
853 | ;\r | |
854 | \r | |
855 | \r | |
856 | //\r | |
857 | // FFS Fw Volume support functions\r | |
858 | //\r | |
859 | EFI_STATUS\r | |
860 | EFIAPI\r | |
861 | PeiFfsFindNextFile (\r | |
0c2b5da8 | 862 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 863 | IN UINT8 SearchType,\r |
0c2b5da8 | 864 | IN EFI_PEI_FV_HANDLE FwVolHeader,\r |
865 | IN OUT EFI_PEI_FILE_HANDLE *FileHeader\r | |
192f6d4c | 866 | )\r |
867 | /*++\r | |
868 | \r | |
869 | Routine Description:\r | |
870 | Given the input file pointer, search for the next matching file in the\r | |
871 | FFS volume as defined by SearchType. The search starts from FileHeader inside\r | |
872 | the Firmware Volume defined by FwVolHeader.\r | |
873 | \r | |
874 | Arguments:\r | |
875 | PeiServices - Pointer to the PEI Core Services Table.\r | |
876 | \r | |
877 | SearchType - Filter to find only files of this type.\r | |
878 | Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r | |
879 | \r | |
880 | FwVolHeader - Pointer to the FV header of the volume to search.\r | |
881 | This parameter must point to a valid FFS volume.\r | |
882 | \r | |
883 | FileHeader - Pointer to the current file from which to begin searching.\r | |
884 | This pointer will be updated upon return to reflect the file found.\r | |
885 | \r | |
886 | Returns:\r | |
887 | EFI_NOT_FOUND - No files matching the search criteria were found\r | |
888 | EFI_SUCCESS\r | |
889 | \r | |
890 | --*/\r | |
891 | ;\r | |
892 | \r | |
893 | EFI_STATUS\r | |
894 | EFIAPI\r | |
895 | PeiFfsFindSectionData (\r | |
0c2b5da8 | 896 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 897 | IN EFI_SECTION_TYPE SectionType,\r |
0c2b5da8 | 898 | IN EFI_PEI_FILE_HANDLE FfsFileHeader,\r |
192f6d4c | 899 | IN OUT VOID **SectionData\r |
900 | )\r | |
901 | /*++\r | |
902 | \r | |
903 | Routine Description:\r | |
904 | Given the input file pointer, search for the next matching section in the\r | |
905 | FFS volume.\r | |
906 | \r | |
907 | Arguments:\r | |
908 | PeiServices - Pointer to the PEI Core Services Table.\r | |
909 | SearchType - Filter to find only sections of this type.\r | |
910 | FfsFileHeader - Pointer to the current file to search.\r | |
911 | SectionData - Pointer to the Section matching SectionType in FfsFileHeader.\r | |
912 | - NULL if section not found\r | |
913 | \r | |
914 | Returns:\r | |
915 | EFI_NOT_FOUND - No files matching the search criteria were found\r | |
916 | EFI_SUCCESS\r | |
917 | \r | |
918 | --*/\r | |
919 | ;\r | |
920 | \r | |
921 | EFI_STATUS\r | |
922 | EFIAPI\r | |
923 | PeiFvFindNextVolume (\r | |
0c2b5da8 | 924 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 925 | IN UINTN Instance,\r |
0c2b5da8 | 926 | IN OUT EFI_PEI_FV_HANDLE *FwVolHeader\r |
192f6d4c | 927 | )\r |
928 | /*++\r | |
929 | \r | |
930 | Routine Description:\r | |
931 | \r | |
932 | Return the BFV location\r | |
933 | \r | |
934 | BugBug -- Move this to the location of this code to where the\r | |
935 | other FV and FFS support code lives.\r | |
936 | Also, update to use FindFV for instances #'s >= 1.\r | |
937 | \r | |
938 | Arguments:\r | |
939 | \r | |
940 | PeiServices - The PEI core services table.\r | |
941 | Instance - Instance of FV to find\r | |
942 | FwVolHeader - Pointer to contain the data to return\r | |
943 | \r | |
944 | Returns:\r | |
945 | Pointer to the Firmware Volume instance requested\r | |
946 | \r | |
947 | EFI_INVALID_PARAMETER - FwVolHeader is NULL\r | |
948 | \r | |
949 | EFI_SUCCESS - Firmware volume instance successfully found.\r | |
950 | \r | |
951 | --*/\r | |
952 | ;\r | |
953 | \r | |
954 | //\r | |
955 | // Memory support functions\r | |
956 | //\r | |
957 | VOID\r | |
958 | InitializeMemoryServices (\r | |
959 | IN EFI_PEI_SERVICES **PeiServices,\r | |
5aae0aa7 | 960 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r |
192f6d4c | 961 | IN PEI_CORE_INSTANCE *OldCoreData\r |
962 | )\r | |
963 | /*++\r | |
964 | \r | |
965 | Routine Description:\r | |
966 | \r | |
967 | Initialize the memory services.\r | |
968 | \r | |
969 | Arguments:\r | |
970 | \r | |
971 | PeiServices - The PEI core services table.\r | |
972 | PeiStartupDescriptor - Information and services provided by SEC phase.\r | |
973 | OldCoreData - Pointer to the PEI Core data.\r | |
974 | NULL if being run in non-permament memory mode.\r | |
975 | \r | |
976 | Returns:\r | |
977 | \r | |
978 | None\r | |
979 | \r | |
980 | --*/\r | |
981 | ;\r | |
982 | \r | |
983 | EFI_STATUS\r | |
984 | EFIAPI\r | |
985 | PeiInstallPeiMemory (\r | |
0c2b5da8 | 986 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 987 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r |
988 | IN UINT64 MemoryLength\r | |
989 | )\r | |
990 | /*++\r | |
991 | \r | |
992 | Routine Description:\r | |
993 | \r | |
994 | Install the permanent memory is now available.\r | |
995 | Creates HOB (PHIT and Stack).\r | |
996 | \r | |
997 | Arguments:\r | |
998 | \r | |
999 | PeiServices - The PEI core services table.\r | |
1000 | MemoryBegin - Start of memory address.\r | |
1001 | MemoryLength - Length of memory.\r | |
1002 | \r | |
1003 | Returns:\r | |
1004 | \r | |
1005 | Status - EFI_SUCCESS\r | |
1006 | \r | |
1007 | --*/\r | |
1008 | ;\r | |
1009 | \r | |
1010 | EFI_STATUS\r | |
1011 | EFIAPI\r | |
1012 | PeiAllocatePages (\r | |
0c2b5da8 | 1013 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 1014 | IN EFI_MEMORY_TYPE MemoryType,\r |
1015 | IN UINTN Pages,\r | |
1016 | OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
1017 | )\r | |
1018 | /*++\r | |
1019 | \r | |
1020 | Routine Description:\r | |
1021 | \r | |
1022 | Memory allocation service on permanent memory,\r | |
1023 | not usable prior to the memory installation.\r | |
1024 | \r | |
1025 | Arguments:\r | |
1026 | \r | |
1027 | PeiServices - The PEI core services table.\r | |
1028 | Type - Type of allocation.\r | |
1029 | MemoryType - Type of memory to allocate.\r | |
1030 | Pages - Number of pages to allocate.\r | |
1031 | Memory - Pointer of memory allocated.\r | |
1032 | \r | |
1033 | Returns:\r | |
1034 | \r | |
1035 | Status - EFI_SUCCESS The allocation was successful\r | |
1036 | EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.\r | |
1037 | EFI_NOT_AVAILABLE_YET Called with permanent memory not available\r | |
1038 | EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement\r | |
1039 | to allocate the number of pages.\r | |
1040 | \r | |
1041 | --*/\r | |
1042 | ;\r | |
1043 | \r | |
1044 | EFI_STATUS\r | |
1045 | EFIAPI\r | |
1046 | PeiAllocatePool (\r | |
0c2b5da8 | 1047 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 1048 | IN UINTN Size,\r |
1049 | OUT VOID **Buffer\r | |
1050 | )\r | |
1051 | /*++\r | |
1052 | \r | |
1053 | Routine Description:\r | |
1054 | \r | |
1055 | Memory allocation service on the CAR.\r | |
1056 | \r | |
1057 | Arguments:\r | |
1058 | \r | |
1059 | PeiServices - The PEI core services table.\r | |
1060 | \r | |
1061 | Size - Amount of memory required\r | |
1062 | \r | |
1063 | Buffer - Address of pointer to the buffer\r | |
1064 | \r | |
1065 | Returns:\r | |
1066 | \r | |
1067 | Status - EFI_SUCCESS The allocation was successful\r | |
1068 | EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement\r | |
1069 | to allocate the requested size.\r | |
1070 | \r | |
1071 | --*/\r | |
1072 | ;\r | |
1073 | \r | |
1074 | EFI_STATUS\r | |
1075 | PeiLoadImage (\r | |
1076 | IN EFI_PEI_SERVICES **PeiServices,\r | |
1077 | IN EFI_FFS_FILE_HEADER *PeimFileHeader,\r | |
1078 | OUT VOID **EntryPoint\r | |
1079 | )\r | |
1080 | /*++\r | |
1081 | \r | |
1082 | Routine Description:\r | |
1083 | \r | |
1084 | Get entry point of a Peim file.\r | |
1085 | \r | |
1086 | Arguments:\r | |
1087 | \r | |
1088 | PeiServices - Calling context.\r | |
1089 | \r | |
1090 | PeimFileHeader - Peim file's header.\r | |
1091 | \r | |
1092 | EntryPoint - Entry point of that Peim file.\r | |
1093 | \r | |
1094 | Returns:\r | |
1095 | \r | |
1096 | Status code.\r | |
1097 | \r | |
1098 | --*/\r | |
1099 | ;\r | |
1100 | \r | |
1101 | \r | |
1102 | EFI_STATUS\r | |
1103 | EFIAPI\r | |
1104 | PeiReportStatusCode (\r | |
0c2b5da8 | 1105 | IN CONST EFI_PEI_SERVICES **PeiServices,\r |
192f6d4c | 1106 | IN EFI_STATUS_CODE_TYPE CodeType,\r |
1107 | IN EFI_STATUS_CODE_VALUE Value,\r | |
1108 | IN UINT32 Instance,\r | |
0c2b5da8 | 1109 | IN CONST EFI_GUID *CallerId,\r |
1110 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
192f6d4c | 1111 | )\r |
1112 | /*++\r | |
1113 | \r | |
1114 | Routine Description:\r | |
1115 | \r | |
1116 | Core version of the Status Code reporter\r | |
1117 | \r | |
1118 | Arguments:\r | |
1119 | \r | |
1120 | PeiServices - The PEI core services table.\r | |
1121 | \r | |
1122 | CodeType - Type of Status Code.\r | |
1123 | \r | |
1124 | Value - Value to output for Status Code.\r | |
1125 | \r | |
1126 | Instance - Instance Number of this status code.\r | |
1127 | \r | |
1128 | CallerId - ID of the caller of this status code.\r | |
1129 | \r | |
1130 | Data - Optional data associated with this status code.\r | |
1131 | \r | |
1132 | Returns:\r | |
1133 | \r | |
1134 | Status - EFI_SUCCESS if status code is successfully reported\r | |
1135 | - EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed\r | |
1136 | \r | |
1137 | --*/\r | |
1138 | ;\r | |
1139 | \r | |
1140 | \r | |
1141 | EFI_STATUS\r | |
1142 | EFIAPI\r | |
1143 | PeiResetSystem (\r | |
1144 | IN EFI_PEI_SERVICES **PeiServices\r | |
1145 | )\r | |
1146 | /*++\r | |
1147 | \r | |
1148 | Routine Description:\r | |
1149 | \r | |
1150 | Core version of the Reset System\r | |
1151 | \r | |
1152 | Arguments:\r | |
1153 | \r | |
1154 | PeiServices - The PEI core services table.\r | |
1155 | \r | |
1156 | Returns:\r | |
1157 | \r | |
1158 | Status - EFI_NOT_AVAILABLE_YET. PPI not available yet.\r | |
1159 | - EFI_DEVICE_ERROR. Did not reset system.\r | |
1160 | \r | |
1161 | Otherwise, resets the system.\r | |
1162 | \r | |
1163 | --*/\r | |
1164 | ;\r | |
1165 | \r | |
14e8823a | 1166 | /**\r |
1167 | This routine enable a PEIM to register itself to shadow when PEI Foundation\r | |
1168 | discovery permanent memory.\r | |
1169 | \r | |
1170 | @param FileHandle File handle of a PEIM.\r | |
1171 | \r | |
1172 | @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r | |
1173 | @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r | |
1174 | @retval EFI_SUCCESS Successfully to register itself.\r | |
1175 | \r | |
1176 | **/ \r | |
1177 | EFI_STATUS\r | |
1178 | EFIAPI\r | |
1179 | PeiRegisterForShadow (\r | |
1180 | IN EFI_PEI_FILE_HANDLE FileHandle\r | |
1181 | )\r | |
1182 | ;\r | |
1183 | \r | |
192f6d4c | 1184 | /**\r |
1185 | Transfers control to a function starting with a new stack.\r | |
1186 | \r | |
1187 | Transfers control to the function specified by EntryPoint using the new stack\r | |
1188 | specified by NewStack and passing in the parameters specified by Context1 and\r | |
1189 | Context2. Context1 and Context2 are optional and may be NULL. The function\r | |
1190 | EntryPoint must never return.\r | |
1191 | \r | |
1192 | If EntryPoint is NULL, then ASSERT().\r | |
1193 | If NewStack is NULL, then ASSERT().\r | |
1194 | \r | |
1195 | @param EntryPoint A pointer to function to call with the new stack.\r | |
1196 | @param Context1 A pointer to the context to pass into the EntryPoint\r | |
1197 | function.\r | |
1198 | @param Context2 A pointer to the context to pass into the EntryPoint\r | |
1199 | function.\r | |
1200 | @param NewStack A pointer to the new stack to use for the EntryPoint\r | |
1201 | function.\r | |
1202 | @param NewBsp A pointer to the new BSP for the EntryPoint on IPF. It's\r | |
1203 | Reserved on other architectures.\r | |
1204 | \r | |
1205 | **/\r | |
1206 | VOID\r | |
1207 | EFIAPI\r | |
1208 | PeiSwitchStacks (\r | |
1209 | IN SWITCH_STACK_ENTRY_POINT EntryPoint,\r | |
1210 | IN VOID *Context1, OPTIONAL\r | |
1211 | IN VOID *Context2, OPTIONAL\r | |
5aae0aa7 | 1212 | IN VOID *Context3, OPTIONAL\r |
192f6d4c | 1213 | IN VOID *NewStack,\r |
1214 | IN VOID *NewBsp\r | |
1215 | );\r | |
1216 | \r | |
1217 | #endif\r |