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