]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | Definition of Pei Core Structures and Services\r | |
3 | \r | |
4 | Copyright (c) 2006 - 2010, Intel Corporation\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | \r | |
15 | #ifndef _PEI_MAIN_H_\r | |
16 | #define _PEI_MAIN_H_\r | |
17 | \r | |
18 | #include <PiPei.h>\r | |
19 | #include <Ppi/DxeIpl.h>\r | |
20 | #include <Ppi/MemoryDiscovered.h>\r | |
21 | #include <Ppi/StatusCode.h>\r | |
22 | #include <Ppi/Reset.h>\r | |
23 | #include <Ppi/FirmwareVolume.h>\r | |
24 | #include <Ppi/FirmwareVolumeInfo.h>\r | |
25 | #include <Ppi/Decompress.h>\r | |
26 | #include <Ppi/GuidedSectionExtraction.h>\r | |
27 | #include <Ppi/LoadFile.h>\r | |
28 | #include <Ppi/Security2.h>\r | |
29 | #include <Ppi/TemporaryRamSupport.h>\r | |
30 | #include <Library/DebugLib.h>\r | |
31 | #include <Library/PeiCoreEntryPoint.h>\r | |
32 | #include <Library/BaseLib.h>\r | |
33 | #include <Library/HobLib.h>\r | |
34 | #include <Library/PerformanceLib.h>\r | |
35 | #include <Library/PeiServicesLib.h>\r | |
36 | #include <Library/ReportStatusCodeLib.h>\r | |
37 | #include <Library/PeCoffLib.h>\r | |
38 | #include <Library/PeCoffGetEntryPointLib.h>\r | |
39 | #include <Library/BaseMemoryLib.h>\r | |
40 | #include <Library/CacheMaintenanceLib.h>\r | |
41 | #include <Library/TimerLib.h>\r | |
42 | #include <Library/PcdLib.h>\r | |
43 | #include <IndustryStandard/PeImage.h>\r | |
44 | #include <Library/PeiServicesTablePointerLib.h>\r | |
45 | #include <Library/MemoryAllocationLib.h>\r | |
46 | #include <Guid/FirmwareFileSystem2.h>\r | |
47 | #include <Guid/AprioriFileName.h>\r | |
48 | \r | |
49 | ///\r | |
50 | /// It is an FFS type extension used for PeiFindFileEx. It indicates current\r | |
51 | /// Ffs searching is for all PEIMs can be dispatched by PeiCore.\r | |
52 | ///\r | |
53 | #define PEI_CORE_INTERNAL_FFS_FILE_DISPATCH_TYPE 0xff\r | |
54 | \r | |
55 | ///\r | |
56 | /// Pei Core private data structures\r | |
57 | ///\r | |
58 | typedef union {\r | |
59 | EFI_PEI_PPI_DESCRIPTOR *Ppi;\r | |
60 | EFI_PEI_NOTIFY_DESCRIPTOR *Notify;\r | |
61 | VOID *Raw;\r | |
62 | } PEI_PPI_LIST_POINTERS;\r | |
63 | \r | |
64 | ///\r | |
65 | /// PPI database structure which contains two link: PpiList and NotifyList. PpiList\r | |
66 | /// is in head of PpiListPtrs array and notify is in end of PpiListPtrs.\r | |
67 | ///\r | |
68 | typedef struct {\r | |
69 | ///\r | |
70 | /// index of end of PpiList link list.\r | |
71 | ///\r | |
72 | INTN PpiListEnd;\r | |
73 | ///\r | |
74 | /// index of end of notify link list.\r | |
75 | ///\r | |
76 | INTN NotifyListEnd;\r | |
77 | ///\r | |
78 | /// index of the dispatched notify list.\r | |
79 | ///\r | |
80 | INTN DispatchListEnd;\r | |
81 | ///\r | |
82 | /// index of last installed Ppi description in PpiList link list.\r | |
83 | ///\r | |
84 | INTN LastDispatchedInstall;\r | |
85 | ///\r | |
86 | /// index of last dispatched notify in Notify link list.\r | |
87 | /// \r | |
88 | INTN LastDispatchedNotify;\r | |
89 | ///\r | |
90 | /// Ppi database.\r | |
91 | ///\r | |
92 | PEI_PPI_LIST_POINTERS PpiListPtrs[FixedPcdGet32 (PcdPeiCoreMaxPpiSupported)];\r | |
93 | } PEI_PPI_DATABASE;\r | |
94 | \r | |
95 | \r | |
96 | //\r | |
97 | // PEI_CORE_FV_HANDE.PeimState\r | |
98 | // Do not change these values as there is code doing math to change states.\r | |
99 | // Look for Private->Fv[FvCount].PeimState[PeimCount]++;\r | |
100 | //\r | |
101 | #define PEIM_STATE_NOT_DISPATCHED 0x00\r | |
102 | #define PEIM_STATE_DISPATCHED 0x01\r | |
103 | #define PEIM_STATE_REGISITER_FOR_SHADOW 0x02\r | |
104 | #define PEIM_STATE_DONE 0x03\r | |
105 | \r | |
106 | typedef struct {\r | |
107 | EFI_FIRMWARE_VOLUME_HEADER *FvHeader;\r | |
108 | EFI_PEI_FIRMWARE_VOLUME_PPI *FvPpi;\r | |
109 | EFI_PEI_FV_HANDLE FvHandle;\r | |
110 | UINT8 PeimState[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r | |
111 | EFI_PEI_FILE_HANDLE FvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r | |
112 | BOOLEAN ScanFv;\r | |
113 | } PEI_CORE_FV_HANDLE;\r | |
114 | \r | |
115 | typedef struct {\r | |
116 | EFI_GUID FvFormat;\r | |
117 | VOID *FvInfo;\r | |
118 | UINT32 FvInfoSize;\r | |
119 | EFI_PEI_NOTIFY_DESCRIPTOR NotifyDescriptor;\r | |
120 | } PEI_CORE_UNKNOW_FORMAT_FV_INFO;\r | |
121 | \r | |
122 | #define CACHE_SETION_MAX_NUMBER 0x10\r | |
123 | typedef struct {\r | |
124 | EFI_COMMON_SECTION_HEADER* Section[CACHE_SETION_MAX_NUMBER];\r | |
125 | VOID* SectionData[CACHE_SETION_MAX_NUMBER];\r | |
126 | UINTN SectionSize[CACHE_SETION_MAX_NUMBER];\r | |
127 | UINTN AllSectionCount;\r | |
128 | UINTN SectionIndex;\r | |
129 | } CACHE_SECTION_DATA;\r | |
130 | \r | |
131 | \r | |
132 | #define PEI_CORE_HANDLE_SIGNATURE SIGNATURE_32('P','e','i','C')\r | |
133 | \r | |
134 | ///\r | |
135 | /// Pei Core private data structure instance\r | |
136 | ///\r | |
137 | typedef struct{\r | |
138 | UINTN Signature;\r | |
139 | \r | |
140 | ///\r | |
141 | /// Point to ServiceTableShadow\r | |
142 | ///\r | |
143 | EFI_PEI_SERVICES *PS;\r | |
144 | PEI_PPI_DATABASE PpiData;\r | |
145 | \r | |
146 | ///\r | |
147 | /// The count of FVs which contains FFS and could be dispatched by PeiCore.\r | |
148 | ///\r | |
149 | UINTN FvCount;\r | |
150 | \r | |
151 | ///\r | |
152 | /// The instance arrary for FVs which contains FFS and could be dispatched by PeiCore.\r | |
153 | ///\r | |
154 | PEI_CORE_FV_HANDLE Fv[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r | |
155 | PEI_CORE_UNKNOW_FORMAT_FV_INFO UnknownFvInfo[FixedPcdGet32 (PcdPeiCoreMaxFvSupported)];\r | |
156 | UINTN UnknownFvInfoCount;\r | |
157 | \r | |
158 | EFI_PEI_FILE_HANDLE CurrentFvFileHandles[FixedPcdGet32 (PcdPeiCoreMaxPeimPerFv)];\r | |
159 | UINTN AprioriCount;\r | |
160 | UINTN CurrentPeimFvCount;\r | |
161 | UINTN CurrentPeimCount;\r | |
162 | EFI_PEI_FILE_HANDLE CurrentFileHandle;\r | |
163 | BOOLEAN PeimNeedingDispatch;\r | |
164 | BOOLEAN PeimDispatchOnThisPass;\r | |
165 | BOOLEAN PeimDispatcherReenter;\r | |
166 | EFI_PEI_HOB_POINTERS HobList;\r | |
167 | BOOLEAN SwitchStackSignal;\r | |
168 | BOOLEAN PeiMemoryInstalled;\r | |
169 | EFI_PHYSICAL_ADDRESS StackBase;\r | |
170 | UINT64 StackSize;\r | |
171 | VOID *CpuIo;\r | |
172 | EFI_PEI_SECURITY2_PPI *PrivateSecurityPpi;\r | |
173 | EFI_PEI_SERVICES ServiceTableShadow;\r | |
174 | EFI_PEI_PPI_DESCRIPTOR *XipLoadFile;\r | |
175 | EFI_PHYSICAL_ADDRESS PhysicalMemoryBegin;\r | |
176 | UINT64 PhysicalMemoryLength;\r | |
177 | EFI_PHYSICAL_ADDRESS FreePhysicalMemoryTop;\r | |
178 | VOID* ShadowedPeiCore;\r | |
179 | CACHE_SECTION_DATA CacheSection;\r | |
180 | //\r | |
181 | // For Loading modules at fixed address feature to cache the top address below which the \r | |
182 | // Runtime code, boot time code and PEI memory will be placed. Please note that the offset between this field \r | |
183 | // and PS should not be changed since maybe user could get this top address by using the offet to PS. \r | |
184 | //\r | |
185 | EFI_PHYSICAL_ADDRESS LoadModuleAtFixAddressTopAddress;\r | |
186 | //\r | |
187 | // The field is define for Loading modules at fixed address feature to tracker the PEI code\r | |
188 | // memory range usage. It is a bit mapped array in which every bit indicates the correspoding memory page\r | |
189 | // available or not. \r | |
190 | //\r | |
191 | UINT64 *PeiCodeMemoryRangeUsageBitMap;\r | |
192 | } PEI_CORE_INSTANCE;\r | |
193 | \r | |
194 | ///\r | |
195 | /// Pei Core Instance Data Macros\r | |
196 | ///\r | |
197 | #define PEI_CORE_INSTANCE_FROM_PS_THIS(a) \\r | |
198 | CR(a, PEI_CORE_INSTANCE, PS, PEI_CORE_HANDLE_SIGNATURE)\r | |
199 | \r | |
200 | /**\r | |
201 | Function Pointer type for PeiCore function.\r | |
202 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r | |
203 | and location of temporary RAM, the stack location and the BFV location.\r | |
204 | @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r | |
205 | An empty PPI list consists of a single descriptor with the end-tag\r | |
206 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r | |
207 | phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such\r | |
208 | that both the PEI Foundation and any modules can leverage the associated service\r | |
209 | calls and/or code in these early PPIs\r | |
210 | @param OldCoreData Pointer to old core data that is used to initialize the\r | |
211 | core's data areas.\r | |
212 | **/\r | |
213 | typedef\r | |
214 | EFI_STATUS\r | |
215 | (EFIAPI *PEICORE_FUNCTION_POINTER)(\r | |
216 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
217 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,\r | |
218 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
219 | );\r | |
220 | \r | |
221 | ///\r | |
222 | /// Union of temporarily used function pointers (to save stack space)\r | |
223 | ///\r | |
224 | typedef union {\r | |
225 | PEICORE_FUNCTION_POINTER PeiCore;\r | |
226 | EFI_PEIM_ENTRY_POINT2 PeimEntry;\r | |
227 | EFI_PEIM_NOTIFY_ENTRY_POINT PeimNotifyEntry;\r | |
228 | EFI_DXE_IPL_PPI *DxeIpl;\r | |
229 | EFI_PEI_PPI_DESCRIPTOR *PpiDescriptor;\r | |
230 | EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor;\r | |
231 | VOID *Raw;\r | |
232 | } PEI_CORE_TEMP_POINTERS;\r | |
233 | \r | |
234 | typedef struct {\r | |
235 | CONST EFI_SEC_PEI_HAND_OFF *SecCoreData;\r | |
236 | EFI_PEI_PPI_DESCRIPTOR *PpiList;\r | |
237 | VOID *Data;\r | |
238 | } PEI_CORE_PARAMETERS;\r | |
239 | \r | |
240 | //\r | |
241 | // PeiCore function\r | |
242 | //\r | |
243 | /**\r | |
244 | \r | |
245 | The entry routine to Pei Core, invoked by PeiMain during transition\r | |
246 | from SEC to PEI. After switching stack in the PEI core, it will restart\r | |
247 | with the old core data.\r | |
248 | \r | |
249 | \r | |
250 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r | |
251 | and location of temporary RAM, the stack location and the BFV location.\r | |
252 | @param PpiList Points to a list of one or more PPI descriptors to be installed initially by the PEI core.\r | |
253 | An empty PPI list consists of a single descriptor with the end-tag\r | |
254 | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST. As part of its initialization\r | |
255 | phase, the PEI Foundation will add these SEC-hosted PPIs to its PPI database such\r | |
256 | that both the PEI Foundation and any modules can leverage the associated service\r | |
257 | calls and/or code in these early PPIs\r | |
258 | @param Data Pointer to old core data that is used to initialize the\r | |
259 | core's data areas.\r | |
260 | \r | |
261 | **/\r | |
262 | VOID\r | |
263 | EFIAPI\r | |
264 | PeiCore (\r | |
265 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
266 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList,\r | |
267 | IN VOID *Data\r | |
268 | );\r | |
269 | \r | |
270 | //\r | |
271 | // Dispatcher support functions\r | |
272 | //\r | |
273 | \r | |
274 | /**\r | |
275 | \r | |
276 | This is the POSTFIX version of the dependency evaluator. When a\r | |
277 | PUSH [PPI GUID] is encountered, a pointer to the GUID is stored on\r | |
278 | the evaluation stack. When that entry is poped from the evaluation\r | |
279 | stack, the PPI is checked if it is installed. This method allows\r | |
280 | some time savings as not all PPIs must be checked for certain\r | |
281 | operation types (AND, OR).\r | |
282 | \r | |
283 | \r | |
284 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
285 | @param DependencyExpression Pointer to a dependency expression. The Grammar adheres to\r | |
286 | the BNF described above and is stored in postfix notation.\r | |
287 | \r | |
288 | @retval TRUE if it is a well-formed Grammar\r | |
289 | @retval FALSE if the dependency expression overflows the evaluation stack\r | |
290 | if the dependency expression underflows the evaluation stack\r | |
291 | if the dependency expression is not a well-formed Grammar.\r | |
292 | \r | |
293 | **/\r | |
294 | BOOLEAN\r | |
295 | PeimDispatchReadiness (\r | |
296 | IN EFI_PEI_SERVICES **PeiServices,\r | |
297 | IN VOID *DependencyExpression\r | |
298 | );\r | |
299 | \r | |
300 | /**\r | |
301 | Conduct PEIM dispatch.\r | |
302 | \r | |
303 | @param SecCoreData Pointer to the data structure containing SEC to PEI handoff data\r | |
304 | @param PrivateData Pointer to the private data passed in from caller\r | |
305 | \r | |
306 | **/\r | |
307 | VOID\r | |
308 | PeiDispatcher (\r | |
309 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
310 | IN PEI_CORE_INSTANCE *PrivateData\r | |
311 | );\r | |
312 | \r | |
313 | /**\r | |
314 | Initialize the Dispatcher's data members\r | |
315 | \r | |
316 | @param PrivateData PeiCore's private data structure\r | |
317 | @param OldCoreData Old data from SecCore\r | |
318 | NULL if being run in non-permament memory mode.\r | |
319 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size\r | |
320 | and location of temporary RAM, the stack location and the BFV location.\r | |
321 | \r | |
322 | **/\r | |
323 | VOID\r | |
324 | InitializeDispatcherData (\r | |
325 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
326 | IN PEI_CORE_INSTANCE *OldCoreData,\r | |
327 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r | |
328 | );\r | |
329 | \r | |
330 | /**\r | |
331 | This routine parses the Dependency Expression, if available, and\r | |
332 | decides if the module can be executed.\r | |
333 | \r | |
334 | \r | |
335 | @param Private PeiCore's private data structure\r | |
336 | @param FileHandle PEIM's file handle\r | |
337 | @param PeimCount The index of last dispatched PEIM.\r | |
338 | \r | |
339 | @retval TRUE Can be dispatched\r | |
340 | @retval FALSE Cannot be dispatched\r | |
341 | \r | |
342 | **/\r | |
343 | BOOLEAN\r | |
344 | DepexSatisfied (\r | |
345 | IN PEI_CORE_INSTANCE *Private,\r | |
346 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
347 | IN UINTN PeimCount\r | |
348 | );\r | |
349 | \r | |
350 | //\r | |
351 | // PPI support functions\r | |
352 | //\r | |
353 | /**\r | |
354 | \r | |
355 | Initialize PPI services.\r | |
356 | \r | |
357 | @param PrivateData Pointer to the PEI Core data.\r | |
358 | @param OldCoreData Pointer to old PEI Core data. \r | |
359 | NULL if being run in non-permament memory mode.\r | |
360 | \r | |
361 | **/\r | |
362 | VOID\r | |
363 | InitializePpiServices (\r | |
364 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
365 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
366 | );\r | |
367 | \r | |
368 | /**\r | |
369 | \r | |
370 | Migrate the Hob list from the temporary memory stack to PEI installed memory.\r | |
371 | \r | |
372 | @param PrivateData Pointer to PeiCore's private data structure.\r | |
373 | @param OldCheckingBottom Bottom of temporary memory range. All Ppi in this range\r | |
374 | will be fixup for PpiData and PpiDescriptor pointer.\r | |
375 | @param OldCheckingTop Top of temporary memory range. All Ppi in this range\r | |
376 | will be fixup for PpiData and PpiDescriptor.\r | |
377 | @param Fixup The address difference between\r | |
378 | the new Hob list and old Hob list.\r | |
379 | \r | |
380 | **/\r | |
381 | VOID\r | |
382 | ConvertPpiPointers (\r | |
383 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
384 | IN UINTN OldCheckingBottom,\r | |
385 | IN UINTN OldCheckingTop,\r | |
386 | IN INTN Fixup\r | |
387 | );\r | |
388 | \r | |
389 | /**\r | |
390 | \r | |
391 | Install PPI services. It is implementation of EFI_PEI_SERVICE.InstallPpi.\r | |
392 | \r | |
393 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
394 | @param PpiList Pointer to ppi array that want to be installed.\r | |
395 | \r | |
396 | @retval EFI_SUCCESS if all PPIs in PpiList are successfully installed.\r | |
397 | @retval EFI_INVALID_PARAMETER if PpiList is NULL pointer\r | |
398 | if any PPI in PpiList is not valid\r | |
399 | @retval EFI_OUT_OF_RESOURCES if there is no more memory resource to install PPI\r | |
400 | \r | |
401 | **/\r | |
402 | EFI_STATUS\r | |
403 | EFIAPI\r | |
404 | PeiInstallPpi (\r | |
405 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
406 | IN CONST EFI_PEI_PPI_DESCRIPTOR *PpiList\r | |
407 | );\r | |
408 | \r | |
409 | /**\r | |
410 | \r | |
411 | Re-Install PPI services.\r | |
412 | \r | |
413 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
414 | @param OldPpi Pointer to the old PEI PPI Descriptors.\r | |
415 | @param NewPpi Pointer to the new PEI PPI Descriptors.\r | |
416 | \r | |
417 | @retval EFI_SUCCESS if the operation was successful\r | |
418 | @retval EFI_INVALID_PARAMETER if OldPpi or NewPpi is NULL\r | |
419 | if NewPpi is not valid\r | |
420 | @retval EFI_NOT_FOUND if the PPI was not in the database\r | |
421 | \r | |
422 | **/\r | |
423 | EFI_STATUS\r | |
424 | EFIAPI\r | |
425 | PeiReInstallPpi (\r | |
426 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
427 | IN CONST EFI_PEI_PPI_DESCRIPTOR *OldPpi,\r | |
428 | IN CONST EFI_PEI_PPI_DESCRIPTOR *NewPpi\r | |
429 | );\r | |
430 | \r | |
431 | /**\r | |
432 | \r | |
433 | Locate a given named PPI.\r | |
434 | \r | |
435 | \r | |
436 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
437 | @param Guid Pointer to GUID of the PPI.\r | |
438 | @param Instance Instance Number to discover.\r | |
439 | @param PpiDescriptor Pointer to reference the found descriptor. If not NULL,\r | |
440 | returns a pointer to the descriptor (includes flags, etc)\r | |
441 | @param Ppi Pointer to reference the found PPI\r | |
442 | \r | |
443 | @retval EFI_SUCCESS if the PPI is in the database\r | |
444 | @retval EFI_NOT_FOUND if the PPI is not in the database\r | |
445 | \r | |
446 | **/\r | |
447 | EFI_STATUS\r | |
448 | EFIAPI\r | |
449 | PeiLocatePpi (\r | |
450 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
451 | IN CONST EFI_GUID *Guid,\r | |
452 | IN UINTN Instance,\r | |
453 | IN OUT EFI_PEI_PPI_DESCRIPTOR **PpiDescriptor,\r | |
454 | IN OUT VOID **Ppi\r | |
455 | );\r | |
456 | \r | |
457 | /**\r | |
458 | \r | |
459 | Install a notification for a given PPI.\r | |
460 | \r | |
461 | \r | |
462 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
463 | @param NotifyList Pointer to list of Descriptors to notify upon.\r | |
464 | \r | |
465 | @retval EFI_SUCCESS if successful\r | |
466 | @retval EFI_OUT_OF_RESOURCES if no space in the database\r | |
467 | @retval EFI_INVALID_PARAMETER if not a good decriptor\r | |
468 | \r | |
469 | **/\r | |
470 | EFI_STATUS\r | |
471 | EFIAPI\r | |
472 | PeiNotifyPpi (\r | |
473 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
474 | IN CONST EFI_PEI_NOTIFY_DESCRIPTOR *NotifyList\r | |
475 | );\r | |
476 | \r | |
477 | /**\r | |
478 | \r | |
479 | Process the Notify List at dispatch level.\r | |
480 | \r | |
481 | @param PrivateData PeiCore's private data structure.\r | |
482 | \r | |
483 | **/\r | |
484 | VOID\r | |
485 | ProcessNotifyList (\r | |
486 | IN PEI_CORE_INSTANCE *PrivateData\r | |
487 | );\r | |
488 | \r | |
489 | /**\r | |
490 | \r | |
491 | Dispatch notifications.\r | |
492 | \r | |
493 | @param PrivateData PeiCore's private data structure\r | |
494 | @param NotifyType Type of notify to fire.\r | |
495 | @param InstallStartIndex Install Beginning index.\r | |
496 | @param InstallStopIndex Install Ending index.\r | |
497 | @param NotifyStartIndex Notify Beginning index.\r | |
498 | @param NotifyStopIndex Notify Ending index.\r | |
499 | \r | |
500 | **/\r | |
501 | VOID\r | |
502 | DispatchNotify (\r | |
503 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
504 | IN UINTN NotifyType,\r | |
505 | IN INTN InstallStartIndex,\r | |
506 | IN INTN InstallStopIndex,\r | |
507 | IN INTN NotifyStartIndex,\r | |
508 | IN INTN NotifyStopIndex\r | |
509 | );\r | |
510 | \r | |
511 | //\r | |
512 | // Boot mode support functions\r | |
513 | //\r | |
514 | /**\r | |
515 | This service enables PEIMs to ascertain the present value of the boot mode.\r | |
516 | \r | |
517 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
518 | @param BootMode A pointer to contain the value of the boot mode.\r | |
519 | \r | |
520 | @retval EFI_SUCCESS The boot mode was returned successfully.\r | |
521 | @retval EFI_INVALID_PARAMETER BootMode is NULL.\r | |
522 | \r | |
523 | **/\r | |
524 | EFI_STATUS\r | |
525 | EFIAPI\r | |
526 | PeiGetBootMode (\r | |
527 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
528 | IN OUT EFI_BOOT_MODE *BootMode\r | |
529 | );\r | |
530 | \r | |
531 | /**\r | |
532 | This service enables PEIMs to update the boot mode variable.\r | |
533 | \r | |
534 | \r | |
535 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
536 | @param BootMode The value of the boot mode to set.\r | |
537 | \r | |
538 | @return EFI_SUCCESS The value was successfully updated\r | |
539 | \r | |
540 | **/\r | |
541 | EFI_STATUS\r | |
542 | EFIAPI\r | |
543 | PeiSetBootMode (\r | |
544 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
545 | IN EFI_BOOT_MODE BootMode\r | |
546 | );\r | |
547 | \r | |
548 | //\r | |
549 | // Security support functions\r | |
550 | //\r | |
551 | /**\r | |
552 | \r | |
553 | Initialize the security services.\r | |
554 | \r | |
555 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
556 | @param OldCoreData Pointer to the old core data.\r | |
557 | NULL if being run in non-permament memory mode.\r | |
558 | \r | |
559 | **/\r | |
560 | VOID\r | |
561 | InitializeSecurityServices (\r | |
562 | IN EFI_PEI_SERVICES **PeiServices,\r | |
563 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
564 | );\r | |
565 | \r | |
566 | /**\r | |
567 | Verify a Firmware volume.\r | |
568 | \r | |
569 | @param CurrentFvAddress Pointer to the current Firmware Volume under consideration\r | |
570 | \r | |
571 | @retval EFI_SUCCESS Firmware Volume is legal\r | |
572 | @retval EFI_SECURITY_VIOLATION Firmware Volume fails integrity test\r | |
573 | \r | |
574 | **/\r | |
575 | EFI_STATUS\r | |
576 | VerifyFv (\r | |
577 | IN EFI_FIRMWARE_VOLUME_HEADER *CurrentFvAddress\r | |
578 | );\r | |
579 | \r | |
580 | /**\r | |
581 | \r | |
582 | Provide a callout to the security verification service.\r | |
583 | \r | |
584 | \r | |
585 | @param PrivateData PeiCore's private data structure\r | |
586 | @param VolumeHandle Handle of FV\r | |
587 | @param FileHandle Handle of PEIM's ffs\r | |
588 | \r | |
589 | @retval EFI_SUCCESS Image is OK\r | |
590 | @retval EFI_SECURITY_VIOLATION Image is illegal\r | |
591 | \r | |
592 | **/\r | |
593 | EFI_STATUS\r | |
594 | VerifyPeim (\r | |
595 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
596 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
597 | IN EFI_PEI_FILE_HANDLE FileHandle\r | |
598 | );\r | |
599 | \r | |
600 | /**\r | |
601 | \r | |
602 | Gets the pointer to the HOB List.\r | |
603 | \r | |
604 | \r | |
605 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
606 | @param HobList Pointer to the HOB List.\r | |
607 | \r | |
608 | @retval EFI_SUCCESS Get the pointer of HOB List\r | |
609 | @retval EFI_NOT_AVAILABLE_YET the HOB List is not yet published\r | |
610 | @retval EFI_INVALID_PARAMETER HobList is NULL (in debug mode)\r | |
611 | \r | |
612 | **/\r | |
613 | EFI_STATUS\r | |
614 | EFIAPI\r | |
615 | PeiGetHobList (\r | |
616 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
617 | IN OUT VOID **HobList\r | |
618 | );\r | |
619 | \r | |
620 | /**\r | |
621 | Add a new HOB to the HOB List.\r | |
622 | \r | |
623 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
624 | @param Type Type of the new HOB.\r | |
625 | @param Length Length of the new HOB to allocate.\r | |
626 | @param Hob Pointer to the new HOB.\r | |
627 | \r | |
628 | @return EFI_SUCCESS Success to create hob.\r | |
629 | @retval EFI_INVALID_PARAMETER if Hob is NULL\r | |
630 | @retval EFI_NOT_AVAILABLE_YET if HobList is still not available.\r | |
631 | @retval EFI_OUT_OF_RESOURCES if there is no more memory to grow the Hoblist.\r | |
632 | \r | |
633 | **/\r | |
634 | EFI_STATUS\r | |
635 | EFIAPI\r | |
636 | PeiCreateHob (\r | |
637 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
638 | IN UINT16 Type,\r | |
639 | IN UINT16 Length,\r | |
640 | IN OUT VOID **Hob\r | |
641 | );\r | |
642 | \r | |
643 | /**\r | |
644 | \r | |
645 | Builds a Handoff Information Table HOB\r | |
646 | \r | |
647 | @param BootMode - Current Bootmode\r | |
648 | @param MemoryBegin - Start Memory Address.\r | |
649 | @param MemoryLength - Length of Memory.\r | |
650 | \r | |
651 | @return EFI_SUCCESS Always success to initialize HOB.\r | |
652 | \r | |
653 | **/\r | |
654 | EFI_STATUS\r | |
655 | PeiCoreBuildHobHandoffInfoTable (\r | |
656 | IN EFI_BOOT_MODE BootMode,\r | |
657 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r | |
658 | IN UINT64 MemoryLength\r | |
659 | );\r | |
660 | \r | |
661 | \r | |
662 | //\r | |
663 | // FFS Fw Volume support functions\r | |
664 | //\r | |
665 | /**\r | |
666 | Searches for the next matching file in the firmware volume.\r | |
667 | \r | |
668 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
669 | @param SearchType Filter to find only files of this type.\r | |
670 | Type EFI_FV_FILETYPE_ALL causes no filtering to be done.\r | |
671 | @param FvHandle Handle of firmware volume in which to search.\r | |
672 | @param FileHandle On entry, points to the current handle from which to begin searching or NULL to start\r | |
673 | at the beginning of the firmware volume. On exit, points the file handle of the next file\r | |
674 | in the volume or NULL if there are no more files.\r | |
675 | \r | |
676 | @retval EFI_NOT_FOUND The file was not found.\r | |
677 | @retval EFI_NOT_FOUND The header checksum was not zero.\r | |
678 | @retval EFI_SUCCESS The file was found.\r | |
679 | \r | |
680 | **/\r | |
681 | EFI_STATUS\r | |
682 | EFIAPI\r | |
683 | PeiFfsFindNextFile (\r | |
684 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
685 | IN UINT8 SearchType,\r | |
686 | IN EFI_PEI_FV_HANDLE FvHandle,\r | |
687 | IN OUT EFI_PEI_FILE_HANDLE *FileHandle\r | |
688 | );\r | |
689 | \r | |
690 | /**\r | |
691 | Searches for the next matching section within the specified file.\r | |
692 | \r | |
693 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r | |
694 | @param SectionType Filter to find only sections of this type.\r | |
695 | @param FileHandle Pointer to the current file to search.\r | |
696 | @param SectionData A pointer to the discovered section, if successful.\r | |
697 | NULL if section not found\r | |
698 | \r | |
699 | @retval EFI_NOT_FOUND The section was not found.\r | |
700 | @retval EFI_SUCCESS The section was found.\r | |
701 | \r | |
702 | **/\r | |
703 | EFI_STATUS\r | |
704 | EFIAPI\r | |
705 | PeiFfsFindSectionData (\r | |
706 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
707 | IN EFI_SECTION_TYPE SectionType,\r | |
708 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
709 | OUT VOID **SectionData\r | |
710 | );\r | |
711 | \r | |
712 | /**\r | |
713 | Search the firmware volumes by index\r | |
714 | \r | |
715 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation\r | |
716 | @param Instance This instance of the firmware volume to find. The value 0 is the Boot Firmware\r | |
717 | Volume (BFV).\r | |
718 | @param VolumeHandle On exit, points to the next volume handle or NULL if it does not exist.\r | |
719 | \r | |
720 | @retval EFI_INVALID_PARAMETER VolumeHandle is NULL\r | |
721 | @retval EFI_NOT_FOUND The volume was not found.\r | |
722 | @retval EFI_SUCCESS The volume was found.\r | |
723 | \r | |
724 | **/\r | |
725 | EFI_STATUS\r | |
726 | EFIAPI\r | |
727 | PeiFfsFindNextVolume (\r | |
728 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
729 | IN UINTN Instance,\r | |
730 | IN OUT EFI_PEI_FV_HANDLE *VolumeHandle\r | |
731 | );\r | |
732 | \r | |
733 | //\r | |
734 | // Memory support functions\r | |
735 | //\r | |
736 | /**\r | |
737 | \r | |
738 | Initialize the memory services.\r | |
739 | \r | |
740 | @param PrivateData PeiCore's private data structure\r | |
741 | @param SecCoreData Points to a data structure containing SEC to PEI handoff data, such as the size \r | |
742 | and location of temporary RAM, the stack location and the BFV location.\r | |
743 | @param OldCoreData Pointer to the PEI Core data.\r | |
744 | NULL if being run in non-permament memory mode.\r | |
745 | \r | |
746 | **/\r | |
747 | VOID\r | |
748 | InitializeMemoryServices (\r | |
749 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
750 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData,\r | |
751 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
752 | );\r | |
753 | \r | |
754 | /**\r | |
755 | \r | |
756 | Install the permanent memory is now available.\r | |
757 | Creates HOB (PHIT and Stack).\r | |
758 | \r | |
759 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
760 | @param MemoryBegin Start of memory address.\r | |
761 | @param MemoryLength Length of memory.\r | |
762 | \r | |
763 | @return EFI_SUCCESS Always success.\r | |
764 | \r | |
765 | **/\r | |
766 | EFI_STATUS\r | |
767 | EFIAPI\r | |
768 | PeiInstallPeiMemory (\r | |
769 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
770 | IN EFI_PHYSICAL_ADDRESS MemoryBegin,\r | |
771 | IN UINT64 MemoryLength\r | |
772 | );\r | |
773 | \r | |
774 | /**\r | |
775 | \r | |
776 | Memory allocation service on permanent memory,\r | |
777 | not usable prior to the memory installation.\r | |
778 | \r | |
779 | \r | |
780 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
781 | @param MemoryType Type of memory to allocate.\r | |
782 | @param Pages Number of pages to allocate.\r | |
783 | @param Memory Pointer of memory allocated.\r | |
784 | \r | |
785 | @retval EFI_SUCCESS The allocation was successful\r | |
786 | @retval EFI_INVALID_PARAMETER Only AllocateAnyAddress is supported.\r | |
787 | @retval EFI_NOT_AVAILABLE_YET Called with permanent memory not available\r | |
788 | @retval EFI_OUT_OF_RESOURCES There is not enough HOB heap to satisfy the requirement\r | |
789 | to allocate the number of pages.\r | |
790 | \r | |
791 | **/\r | |
792 | EFI_STATUS\r | |
793 | EFIAPI\r | |
794 | PeiAllocatePages (\r | |
795 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
796 | IN EFI_MEMORY_TYPE MemoryType,\r | |
797 | IN UINTN Pages,\r | |
798 | OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
799 | );\r | |
800 | \r | |
801 | /**\r | |
802 | \r | |
803 | Memory allocation service on the temporary memory.\r | |
804 | \r | |
805 | \r | |
806 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
807 | @param Size Amount of memory required\r | |
808 | @param Buffer Address of pointer to the buffer\r | |
809 | \r | |
810 | @retval EFI_SUCCESS The allocation was successful\r | |
811 | @retval EFI_OUT_OF_RESOURCES There is not enough heap to satisfy the requirement\r | |
812 | to allocate the requested size.\r | |
813 | \r | |
814 | **/\r | |
815 | EFI_STATUS\r | |
816 | EFIAPI\r | |
817 | PeiAllocatePool (\r | |
818 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
819 | IN UINTN Size,\r | |
820 | OUT VOID **Buffer\r | |
821 | );\r | |
822 | \r | |
823 | /**\r | |
824 | \r | |
825 | Routine for load image file.\r | |
826 | \r | |
827 | \r | |
828 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
829 | @param FileHandle Pointer to the FFS file header of the image.\r | |
830 | @param PeimState The dispatch state of the input PEIM handle.\r | |
831 | @param EntryPoint Pointer to entry point of specified image file for output.\r | |
832 | @param AuthenticationState Pointer to attestation authentication state of image.\r | |
833 | \r | |
834 | @retval EFI_SUCCESS Image is successfully loaded.\r | |
835 | @retval EFI_NOT_FOUND Fail to locate necessary PPI\r | |
836 | @retval Others Fail to load file.\r | |
837 | \r | |
838 | **/\r | |
839 | EFI_STATUS\r | |
840 | PeiLoadImage (\r | |
841 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
842 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
843 | IN UINT8 PeimState,\r | |
844 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r | |
845 | OUT UINT32 *AuthenticationState\r | |
846 | );\r | |
847 | \r | |
848 | /**\r | |
849 | \r | |
850 | Core version of the Status Code reporter\r | |
851 | \r | |
852 | \r | |
853 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
854 | @param CodeType Type of Status Code.\r | |
855 | @param Value Value to output for Status Code.\r | |
856 | @param Instance Instance Number of this status code.\r | |
857 | @param CallerId ID of the caller of this status code.\r | |
858 | @param Data Optional data associated with this status code.\r | |
859 | \r | |
860 | @retval EFI_SUCCESS if status code is successfully reported\r | |
861 | @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed\r | |
862 | \r | |
863 | **/\r | |
864 | EFI_STATUS\r | |
865 | EFIAPI\r | |
866 | PeiReportStatusCode (\r | |
867 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
868 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
869 | IN EFI_STATUS_CODE_VALUE Value,\r | |
870 | IN UINT32 Instance,\r | |
871 | IN CONST EFI_GUID *CallerId,\r | |
872 | IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
873 | );\r | |
874 | \r | |
875 | /**\r | |
876 | \r | |
877 | Core version of the Reset System\r | |
878 | \r | |
879 | \r | |
880 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
881 | \r | |
882 | @retval EFI_NOT_AVAILABLE_YET PPI not available yet.\r | |
883 | @retval EFI_DEVICE_ERROR Did not reset system.\r | |
884 | Otherwise, resets the system.\r | |
885 | \r | |
886 | **/\r | |
887 | EFI_STATUS\r | |
888 | EFIAPI\r | |
889 | PeiResetSystem (\r | |
890 | IN CONST EFI_PEI_SERVICES **PeiServices\r | |
891 | );\r | |
892 | \r | |
893 | /**\r | |
894 | \r | |
895 | Initialize PeiCore Fv List.\r | |
896 | \r | |
897 | \r | |
898 | @param PrivateData - Pointer to PEI_CORE_INSTANCE.\r | |
899 | @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.\r | |
900 | \r | |
901 | **/\r | |
902 | VOID\r | |
903 | PeiInitializeFv (\r | |
904 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
905 | IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r | |
906 | );\r | |
907 | \r | |
908 | /**\r | |
909 | Process Firmware Volum Information once FvInfoPPI install.\r | |
910 | \r | |
911 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
912 | @param NotifyDescriptor Address of the notification descriptor data structure.\r | |
913 | @param Ppi Address of the PPI that was installed.\r | |
914 | \r | |
915 | @retval EFI_SUCCESS if the interface could be successfully installed\r | |
916 | \r | |
917 | **/\r | |
918 | EFI_STATUS\r | |
919 | EFIAPI\r | |
920 | FirmwareVolmeInfoPpiNotifyCallback (\r | |
921 | IN EFI_PEI_SERVICES **PeiServices,\r | |
922 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
923 | IN VOID *Ppi\r | |
924 | );\r | |
925 | \r | |
926 | /**\r | |
927 | \r | |
928 | Given the input VolumeHandle, search for the next matching name file.\r | |
929 | \r | |
930 | @param FileName File name to search.\r | |
931 | @param VolumeHandle The current FV to search.\r | |
932 | @param FileHandle Pointer to the file matching name in VolumeHandle.\r | |
933 | NULL if file not found\r | |
934 | \r | |
935 | @retval EFI_NOT_FOUND No files matching the search criteria were found\r | |
936 | @retval EFI_SUCCESS Success to search given file\r | |
937 | \r | |
938 | **/\r | |
939 | EFI_STATUS\r | |
940 | EFIAPI\r | |
941 | PeiFfsFindFileByName (\r | |
942 | IN CONST EFI_GUID *FileName,\r | |
943 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
944 | OUT EFI_PEI_FILE_HANDLE *FileHandle\r | |
945 | );\r | |
946 | \r | |
947 | /**\r | |
948 | Returns information about a specific file.\r | |
949 | \r | |
950 | @param FileHandle Handle of the file.\r | |
951 | @param FileInfo Upon exit, points to the file's information.\r | |
952 | \r | |
953 | @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r | |
954 | @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.\r | |
955 | @retval EFI_SUCCESS File information returned.\r | |
956 | \r | |
957 | **/\r | |
958 | EFI_STATUS\r | |
959 | EFIAPI\r | |
960 | PeiFfsGetFileInfo (\r | |
961 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
962 | OUT EFI_FV_FILE_INFO *FileInfo\r | |
963 | );\r | |
964 | \r | |
965 | /**\r | |
966 | Returns information about the specified volume.\r | |
967 | \r | |
968 | @param VolumeHandle Handle of the volume.\r | |
969 | @param VolumeInfo Upon exit, points to the volume's information.\r | |
970 | \r | |
971 | @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.\r | |
972 | @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.\r | |
973 | @retval EFI_SUCCESS Volume information returned.\r | |
974 | **/\r | |
975 | EFI_STATUS\r | |
976 | EFIAPI\r | |
977 | PeiFfsGetVolumeInfo (\r | |
978 | IN EFI_PEI_FV_HANDLE VolumeHandle,\r | |
979 | OUT EFI_FV_INFO *VolumeInfo\r | |
980 | );\r | |
981 | \r | |
982 | /**\r | |
983 | This routine enable a PEIM to register itself to shadow when PEI Foundation\r | |
984 | discovery permanent memory.\r | |
985 | \r | |
986 | @param FileHandle File handle of a PEIM.\r | |
987 | \r | |
988 | @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r | |
989 | @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r | |
990 | @retval EFI_SUCCESS Successfully to register itself.\r | |
991 | \r | |
992 | **/\r | |
993 | EFI_STATUS\r | |
994 | EFIAPI\r | |
995 | PeiRegisterForShadow (\r | |
996 | IN EFI_PEI_FILE_HANDLE FileHandle\r | |
997 | );\r | |
998 | \r | |
999 | /**\r | |
1000 | Initialize image service that install PeiLoadFilePpi.\r | |
1001 | \r | |
1002 | @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.\r | |
1003 | @param OldCoreData Pointer to Old PeiCore's private data.\r | |
1004 | If NULL, PeiCore is entered at first time, stack/heap in temporary memory.\r | |
1005 | If not NULL, PeiCore is entered at second time, stack/heap has been moved\r | |
1006 | to permenent memory.\r | |
1007 | \r | |
1008 | **/\r | |
1009 | VOID\r | |
1010 | InitializeImageServices (\r | |
1011 | IN PEI_CORE_INSTANCE *PrivateData,\r | |
1012 | IN PEI_CORE_INSTANCE *OldCoreData\r | |
1013 | );\r | |
1014 | \r | |
1015 | /**\r | |
1016 | The wrapper function of PeiLoadImageLoadImage().\r | |
1017 | \r | |
1018 | @param This Pointer to EFI_PEI_LOAD_FILE_PPI.\r | |
1019 | @param FileHandle Pointer to the FFS file header of the image.\r | |
1020 | @param ImageAddressArg Pointer to PE/TE image.\r | |
1021 | @param ImageSizeArg Size of PE/TE image.\r | |
1022 | @param EntryPoint Pointer to entry point of specified image file for output.\r | |
1023 | @param AuthenticationState Pointer to attestation authentication state of image.\r | |
1024 | \r | |
1025 | @return Status of PeiLoadImageLoadImage().\r | |
1026 | \r | |
1027 | **/\r | |
1028 | EFI_STATUS\r | |
1029 | EFIAPI\r | |
1030 | PeiLoadImageLoadImageWrapper (\r | |
1031 | IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r | |
1032 | IN EFI_PEI_FILE_HANDLE FileHandle,\r | |
1033 | OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg, OPTIONAL\r | |
1034 | OUT UINT64 *ImageSizeArg, OPTIONAL\r | |
1035 | OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r | |
1036 | OUT UINT32 *AuthenticationState\r | |
1037 | );\r | |
1038 | \r | |
1039 | /**\r | |
1040 | \r | |
1041 | Provide a callback for when the security PPI is installed.\r | |
1042 | \r | |
1043 | @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r | |
1044 | @param NotifyDescriptor The descriptor for the notification event.\r | |
1045 | @param Ppi Pointer to the PPI in question.\r | |
1046 | \r | |
1047 | @return Always success\r | |
1048 | \r | |
1049 | **/\r | |
1050 | EFI_STATUS\r | |
1051 | EFIAPI\r | |
1052 | SecurityPpiNotifyCallback (\r | |
1053 | IN EFI_PEI_SERVICES **PeiServices,\r | |
1054 | IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r | |
1055 | IN VOID *Ppi\r | |
1056 | );\r | |
1057 | \r | |
1058 | /**\r | |
1059 | Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r | |
1060 | \r | |
1061 | @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.\r | |
1062 | @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.\r | |
1063 | \r | |
1064 | @retval EFI_NOT_FOUND FV image can't be found.\r | |
1065 | @retval EFI_SUCCESS Successfully to process it.\r | |
1066 | @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image\r | |
1067 | @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section\r | |
1068 | \r | |
1069 | **/\r | |
1070 | EFI_STATUS\r | |
1071 | ProcessFvFile (\r | |
1072 | IN PEI_CORE_FV_HANDLE *ParentFvCoreHandle,\r | |
1073 | IN EFI_PEI_FILE_HANDLE ParentFvFileHandle\r | |
1074 | );\r | |
1075 | \r | |
1076 | /**\r | |
1077 | Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.\r | |
1078 | \r | |
1079 | This routine also will install FvInfo ppi for FV hob in PI ways.\r | |
1080 | \r | |
1081 | @param Private Pointer of PEI_CORE_INSTANCE\r | |
1082 | @param Instance The index of FV want to be searched.\r | |
1083 | \r | |
1084 | @return Instance of PEI_CORE_FV_HANDLE.\r | |
1085 | **/\r | |
1086 | PEI_CORE_FV_HANDLE *\r | |
1087 | FindNextCoreFvHandle (\r | |
1088 | IN PEI_CORE_INSTANCE *Private,\r | |
1089 | IN UINTN Instance\r | |
1090 | );\r | |
1091 | \r | |
1092 | //\r | |
1093 | // Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.\r | |
1094 | // \r | |
1095 | \r | |
1096 | /**\r | |
1097 | Memory-based read services.\r | |
1098 | \r | |
1099 | This function is to perform the Memory Access Read service based on installed \r | |
1100 | instance of the EFI_PEI_CPU_IO_PPI. \r | |
1101 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1102 | return EFI_NOT_YET_AVAILABLE. \r | |
1103 | \r | |
1104 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
1105 | published by the PEI Foundation.\r | |
1106 | @param This Pointer to local data for the interface.\r | |
1107 | @param Width The width of the access. Enumerated in bytes.\r | |
1108 | @param Address The physical address of the access.\r | |
1109 | @param Count The number of accesses to perform.\r | |
1110 | @param Buffer A pointer to the buffer of data.\r | |
1111 | \r | |
1112 | @retval EFI_SUCCESS The function completed successfully.\r | |
1113 | @retval EFI_NOT_YET_AVAILABLE The service has not been installed. \r | |
1114 | **/\r | |
1115 | EFI_STATUS\r | |
1116 | EFIAPI\r | |
1117 | PeiDefaultMemRead (\r | |
1118 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1119 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1120 | IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r | |
1121 | IN UINT64 Address,\r | |
1122 | IN UINTN Count,\r | |
1123 | IN OUT VOID *Buffer\r | |
1124 | );\r | |
1125 | \r | |
1126 | /**\r | |
1127 | Memory-based write services.\r | |
1128 | \r | |
1129 | This function is to perform the Memory Access Write service based on installed \r | |
1130 | instance of the EFI_PEI_CPU_IO_PPI. \r | |
1131 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1132 | return EFI_NOT_YET_AVAILABLE. \r | |
1133 | \r | |
1134 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
1135 | published by the PEI Foundation.\r | |
1136 | @param This Pointer to local data for the interface.\r | |
1137 | @param Width The width of the access. Enumerated in bytes.\r | |
1138 | @param Address The physical address of the access.\r | |
1139 | @param Count The number of accesses to perform.\r | |
1140 | @param Buffer A pointer to the buffer of data.\r | |
1141 | \r | |
1142 | @retval EFI_SUCCESS The function completed successfully.\r | |
1143 | @retval EFI_NOT_YET_AVAILABLE The service has not been installed. \r | |
1144 | **/\r | |
1145 | EFI_STATUS\r | |
1146 | EFIAPI\r | |
1147 | PeiDefaultMemWrite (\r | |
1148 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1149 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1150 | IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r | |
1151 | IN UINT64 Address,\r | |
1152 | IN UINTN Count,\r | |
1153 | IN OUT VOID *Buffer\r | |
1154 | );\r | |
1155 | \r | |
1156 | /**\r | |
1157 | IO-based read services.\r | |
1158 | \r | |
1159 | This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.\r | |
1160 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1161 | return EFI_NOT_YET_AVAILABLE. \r | |
1162 | \r | |
1163 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
1164 | published by the PEI Foundation.\r | |
1165 | @param This Pointer to local data for the interface.\r | |
1166 | @param Width The width of the access. Enumerated in bytes.\r | |
1167 | @param Address The physical address of the access.\r | |
1168 | @param Count The number of accesses to perform.\r | |
1169 | @param Buffer A pointer to the buffer of data.\r | |
1170 | \r | |
1171 | @retval EFI_SUCCESS The function completed successfully.\r | |
1172 | @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r | |
1173 | **/\r | |
1174 | EFI_STATUS\r | |
1175 | EFIAPI\r | |
1176 | PeiDefaultIoRead (\r | |
1177 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1178 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1179 | IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r | |
1180 | IN UINT64 Address,\r | |
1181 | IN UINTN Count,\r | |
1182 | IN OUT VOID *Buffer\r | |
1183 | );\r | |
1184 | \r | |
1185 | /**\r | |
1186 | IO-based write services.\r | |
1187 | \r | |
1188 | This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.\r | |
1189 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1190 | return EFI_NOT_YET_AVAILABLE. \r | |
1191 | \r | |
1192 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
1193 | published by the PEI Foundation.\r | |
1194 | @param This Pointer to local data for the interface.\r | |
1195 | @param Width The width of the access. Enumerated in bytes.\r | |
1196 | @param Address The physical address of the access.\r | |
1197 | @param Count The number of accesses to perform.\r | |
1198 | @param Buffer A pointer to the buffer of data.\r | |
1199 | \r | |
1200 | @retval EFI_SUCCESS The function completed successfully.\r | |
1201 | @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r | |
1202 | **/\r | |
1203 | EFI_STATUS\r | |
1204 | EFIAPI\r | |
1205 | PeiDefaultIoWrite (\r | |
1206 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1207 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1208 | IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r | |
1209 | IN UINT64 Address,\r | |
1210 | IN UINTN Count,\r | |
1211 | IN OUT VOID *Buffer\r | |
1212 | );\r | |
1213 | \r | |
1214 | /**\r | |
1215 | 8-bit I/O read operations.\r | |
1216 | \r | |
1217 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1218 | return 0.\r | |
1219 | \r | |
1220 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1221 | @param This Pointer to local data for the interface.\r | |
1222 | @param Address The physical address of the access.\r | |
1223 | \r | |
1224 | @return An 8-bit value returned from the I/O space.\r | |
1225 | **/\r | |
1226 | UINT8\r | |
1227 | EFIAPI\r | |
1228 | PeiDefaultIoRead8 (\r | |
1229 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1230 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1231 | IN UINT64 Address\r | |
1232 | );\r | |
1233 | \r | |
1234 | /**\r | |
1235 | Reads an 16-bit I/O port.\r | |
1236 | \r | |
1237 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1238 | return 0.\r | |
1239 | \r | |
1240 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1241 | @param This Pointer to local data for the interface.\r | |
1242 | @param Address The physical address of the access.\r | |
1243 | \r | |
1244 | @return A 16-bit value returned from the I/O space.\r | |
1245 | **/\r | |
1246 | UINT16\r | |
1247 | EFIAPI\r | |
1248 | PeiDefaultIoRead16 (\r | |
1249 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1250 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1251 | IN UINT64 Address\r | |
1252 | );\r | |
1253 | \r | |
1254 | /**\r | |
1255 | Reads an 32-bit I/O port.\r | |
1256 | \r | |
1257 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1258 | return 0.\r | |
1259 | \r | |
1260 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1261 | @param This Pointer to local data for the interface.\r | |
1262 | @param Address The physical address of the access.\r | |
1263 | \r | |
1264 | @return A 32-bit value returned from the I/O space.\r | |
1265 | **/\r | |
1266 | UINT32\r | |
1267 | EFIAPI\r | |
1268 | PeiDefaultIoRead32 (\r | |
1269 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1270 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1271 | IN UINT64 Address\r | |
1272 | );\r | |
1273 | \r | |
1274 | /**\r | |
1275 | Reads an 64-bit I/O port.\r | |
1276 | \r | |
1277 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1278 | return 0.\r | |
1279 | \r | |
1280 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1281 | @param This Pointer to local data for the interface.\r | |
1282 | @param Address The physical address of the access.\r | |
1283 | \r | |
1284 | @return A 64-bit value returned from the I/O space.\r | |
1285 | **/\r | |
1286 | UINT64\r | |
1287 | EFIAPI\r | |
1288 | PeiDefaultIoRead64 (\r | |
1289 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1290 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1291 | IN UINT64 Address\r | |
1292 | );\r | |
1293 | \r | |
1294 | /**\r | |
1295 | 8-bit I/O write operations.\r | |
1296 | \r | |
1297 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1298 | @param This Pointer to local data for the interface.\r | |
1299 | @param Address The physical address of the access.\r | |
1300 | @param Data The data to write.\r | |
1301 | **/\r | |
1302 | VOID\r | |
1303 | EFIAPI\r | |
1304 | PeiDefaultIoWrite8 (\r | |
1305 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1306 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1307 | IN UINT64 Address,\r | |
1308 | IN UINT8 Data\r | |
1309 | );\r | |
1310 | \r | |
1311 | /**\r | |
1312 | 16-bit I/O write operations.\r | |
1313 | \r | |
1314 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1315 | @param This Pointer to local data for the interface.\r | |
1316 | @param Address The physical address of the access.\r | |
1317 | @param Data The data to write.\r | |
1318 | **/\r | |
1319 | VOID\r | |
1320 | EFIAPI\r | |
1321 | PeiDefaultIoWrite16 (\r | |
1322 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1323 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1324 | IN UINT64 Address,\r | |
1325 | IN UINT16 Data\r | |
1326 | );\r | |
1327 | \r | |
1328 | /**\r | |
1329 | 32-bit I/O write operations.\r | |
1330 | \r | |
1331 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1332 | @param This Pointer to local data for the interface.\r | |
1333 | @param Address The physical address of the access.\r | |
1334 | @param Data The data to write.\r | |
1335 | **/\r | |
1336 | VOID\r | |
1337 | EFIAPI\r | |
1338 | PeiDefaultIoWrite32 (\r | |
1339 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1340 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1341 | IN UINT64 Address,\r | |
1342 | IN UINT32 Data\r | |
1343 | );\r | |
1344 | \r | |
1345 | /**\r | |
1346 | 64-bit I/O write operations.\r | |
1347 | \r | |
1348 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1349 | @param This Pointer to local data for the interface.\r | |
1350 | @param Address The physical address of the access.\r | |
1351 | @param Data The data to write.\r | |
1352 | **/\r | |
1353 | VOID\r | |
1354 | EFIAPI\r | |
1355 | PeiDefaultIoWrite64 (\r | |
1356 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1357 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1358 | IN UINT64 Address,\r | |
1359 | IN UINT64 Data\r | |
1360 | );\r | |
1361 | \r | |
1362 | /**\r | |
1363 | 8-bit memory read operations.\r | |
1364 | \r | |
1365 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1366 | return 0.\r | |
1367 | \r | |
1368 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1369 | @param This Pointer to local data for the interface.\r | |
1370 | @param Address The physical address of the access.\r | |
1371 | \r | |
1372 | @return An 8-bit value returned from the memory space.\r | |
1373 | \r | |
1374 | **/\r | |
1375 | UINT8\r | |
1376 | EFIAPI\r | |
1377 | PeiDefaultMemRead8 (\r | |
1378 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1379 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1380 | IN UINT64 Address\r | |
1381 | );\r | |
1382 | \r | |
1383 | /**\r | |
1384 | 16-bit memory read operations.\r | |
1385 | \r | |
1386 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1387 | return 0.\r | |
1388 | \r | |
1389 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1390 | @param This Pointer to local data for the interface.\r | |
1391 | @param Address The physical address of the access.\r | |
1392 | \r | |
1393 | @return An 16-bit value returned from the memory space.\r | |
1394 | \r | |
1395 | **/\r | |
1396 | UINT16\r | |
1397 | EFIAPI\r | |
1398 | PeiDefaultMemRead16 (\r | |
1399 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1400 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1401 | IN UINT64 Address\r | |
1402 | );\r | |
1403 | \r | |
1404 | /**\r | |
1405 | 32-bit memory read operations.\r | |
1406 | \r | |
1407 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1408 | return 0.\r | |
1409 | \r | |
1410 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1411 | @param This Pointer to local data for the interface.\r | |
1412 | @param Address The physical address of the access.\r | |
1413 | \r | |
1414 | @return An 32-bit value returned from the memory space.\r | |
1415 | \r | |
1416 | **/\r | |
1417 | UINT32\r | |
1418 | EFIAPI\r | |
1419 | PeiDefaultMemRead32 (\r | |
1420 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1421 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1422 | IN UINT64 Address\r | |
1423 | );\r | |
1424 | \r | |
1425 | /**\r | |
1426 | 64-bit memory read operations.\r | |
1427 | \r | |
1428 | If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r | |
1429 | return 0.\r | |
1430 | \r | |
1431 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1432 | @param This Pointer to local data for the interface.\r | |
1433 | @param Address The physical address of the access.\r | |
1434 | \r | |
1435 | @return An 64-bit value returned from the memory space.\r | |
1436 | \r | |
1437 | **/\r | |
1438 | UINT64\r | |
1439 | EFIAPI\r | |
1440 | PeiDefaultMemRead64 (\r | |
1441 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1442 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1443 | IN UINT64 Address\r | |
1444 | );\r | |
1445 | \r | |
1446 | /**\r | |
1447 | 8-bit memory write operations.\r | |
1448 | \r | |
1449 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1450 | @param This Pointer to local data for the interface.\r | |
1451 | @param Address The physical address of the access.\r | |
1452 | @param Data The data to write.\r | |
1453 | \r | |
1454 | **/\r | |
1455 | VOID\r | |
1456 | EFIAPI\r | |
1457 | PeiDefaultMemWrite8 (\r | |
1458 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1459 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1460 | IN UINT64 Address,\r | |
1461 | IN UINT8 Data\r | |
1462 | );\r | |
1463 | \r | |
1464 | /**\r | |
1465 | 16-bit memory write operations.\r | |
1466 | \r | |
1467 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1468 | @param This Pointer to local data for the interface.\r | |
1469 | @param Address The physical address of the access.\r | |
1470 | @param Data The data to write.\r | |
1471 | \r | |
1472 | **/\r | |
1473 | VOID\r | |
1474 | EFIAPI\r | |
1475 | PeiDefaultMemWrite16 (\r | |
1476 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1477 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1478 | IN UINT64 Address,\r | |
1479 | IN UINT16 Data\r | |
1480 | );\r | |
1481 | \r | |
1482 | /**\r | |
1483 | 32-bit memory write operations.\r | |
1484 | \r | |
1485 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1486 | @param This Pointer to local data for the interface.\r | |
1487 | @param Address The physical address of the access.\r | |
1488 | @param Data The data to write.\r | |
1489 | \r | |
1490 | **/\r | |
1491 | VOID\r | |
1492 | EFIAPI\r | |
1493 | PeiDefaultMemWrite32 (\r | |
1494 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1495 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1496 | IN UINT64 Address,\r | |
1497 | IN UINT32 Data\r | |
1498 | );\r | |
1499 | \r | |
1500 | /**\r | |
1501 | 64-bit memory write operations.\r | |
1502 | \r | |
1503 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1504 | @param This Pointer to local data for the interface.\r | |
1505 | @param Address The physical address of the access.\r | |
1506 | @param Data The data to write.\r | |
1507 | \r | |
1508 | **/\r | |
1509 | VOID\r | |
1510 | EFIAPI\r | |
1511 | PeiDefaultMemWrite64 (\r | |
1512 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1513 | IN CONST EFI_PEI_CPU_IO_PPI *This,\r | |
1514 | IN UINT64 Address,\r | |
1515 | IN UINT64 Data\r | |
1516 | );\r | |
1517 | \r | |
1518 | extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi; \r | |
1519 | \r | |
1520 | //\r | |
1521 | // Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.\r | |
1522 | // \r | |
1523 | \r | |
1524 | /**\r | |
1525 | Reads from a given location in the PCI configuration space.\r | |
1526 | \r | |
1527 | If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then \r | |
1528 | return EFI_NOT_YET_AVAILABLE. \r | |
1529 | \r | |
1530 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1531 | @param This Pointer to local data for the interface.\r | |
1532 | @param Width The width of the access. Enumerated in bytes.\r | |
1533 | See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r | |
1534 | @param Address The physical address of the access. The format of\r | |
1535 | the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r | |
1536 | @param Buffer A pointer to the buffer of data.\r | |
1537 | \r | |
1538 | @retval EFI_SUCCESS The function completed successfully.\r | |
1539 | @retval EFI_INVALID_PARAMETER The invalid access width.\r | |
1540 | @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.\r | |
1541 | \r | |
1542 | **/\r | |
1543 | EFI_STATUS\r | |
1544 | EFIAPI\r | |
1545 | PeiDefaultPciCfg2Read (\r | |
1546 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1547 | IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r | |
1548 | IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r | |
1549 | IN UINT64 Address,\r | |
1550 | IN OUT VOID *Buffer\r | |
1551 | );\r | |
1552 | \r | |
1553 | /**\r | |
1554 | Write to a given location in the PCI configuration space.\r | |
1555 | \r | |
1556 | If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then \r | |
1557 | return EFI_NOT_YET_AVAILABLE. \r | |
1558 | \r | |
1559 | @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r | |
1560 | @param This Pointer to local data for the interface.\r | |
1561 | @param Width The width of the access. Enumerated in bytes.\r | |
1562 | See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r | |
1563 | @param Address The physical address of the access. The format of\r | |
1564 | the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r | |
1565 | @param Buffer A pointer to the buffer of data.\r | |
1566 | \r | |
1567 | @retval EFI_SUCCESS The function completed successfully.\r | |
1568 | @retval EFI_INVALID_PARAMETER The invalid access width.\r | |
1569 | @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.\r | |
1570 | **/\r | |
1571 | EFI_STATUS\r | |
1572 | EFIAPI\r | |
1573 | PeiDefaultPciCfg2Write (\r | |
1574 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1575 | IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r | |
1576 | IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r | |
1577 | IN UINT64 Address,\r | |
1578 | IN OUT VOID *Buffer\r | |
1579 | );\r | |
1580 | \r | |
1581 | /**\r | |
1582 | This function performs a read-modify-write operation on the contents from a given\r | |
1583 | location in the PCI configuration space.\r | |
1584 | \r | |
1585 | @param PeiServices An indirect pointer to the PEI Services Table\r | |
1586 | published by the PEI Foundation.\r | |
1587 | @param This Pointer to local data for the interface.\r | |
1588 | @param Width The width of the access. Enumerated in bytes. Type\r | |
1589 | EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().\r | |
1590 | @param Address The physical address of the access.\r | |
1591 | @param SetBits Points to value to bitwise-OR with the read configuration value.\r | |
1592 | The size of the value is determined by Width.\r | |
1593 | @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.\r | |
1594 | The size of the value is determined by Width.\r | |
1595 | \r | |
1596 | @retval EFI_SUCCESS The function completed successfully.\r | |
1597 | @retval EFI_INVALID_PARAMETER The invalid access width.\r | |
1598 | @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.\r | |
1599 | **/\r | |
1600 | EFI_STATUS\r | |
1601 | EFIAPI\r | |
1602 | PeiDefaultPciCfg2Modify (\r | |
1603 | IN CONST EFI_PEI_SERVICES **PeiServices,\r | |
1604 | IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r | |
1605 | IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r | |
1606 | IN UINT64 Address,\r | |
1607 | IN VOID *SetBits,\r | |
1608 | IN VOID *ClearBits\r | |
1609 | ); \r | |
1610 | \r | |
1611 | extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi;\r | |
1612 | \r | |
1613 | /**\r | |
1614 | After PeiCore image is shadowed into permanent memory, all build-in FvPpi should\r | |
1615 | be re-installed with the instance in permanent memory and all cached FvPpi pointers in \r | |
1616 | PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant\r | |
1617 | memory.\r | |
1618 | \r | |
1619 | @param PrivateData Pointer to PEI_CORE_INSTANCE.\r | |
1620 | **/ \r | |
1621 | VOID\r | |
1622 | PeiReinitializeFv (\r | |
1623 | IN PEI_CORE_INSTANCE *PrivateData\r | |
1624 | );\r | |
1625 | \r | |
1626 | #endif\r |