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