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