]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Core/Pei/PeiMain.h
Update input of disasmembler to support IfThen construct. Add prototype dos script...
[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
341a658f 4Copyright (c) 2006 - 2010, 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
341a658f 818 @param PeimState The dispatch state of the input PEIM handle.\r
1cc76977 819 @param EntryPoint Pointer to entry point of specified image file for output.\r
820 @param AuthenticationState Pointer to attestation authentication state of image.\r
192f6d4c 821\r
1cc76977 822 @retval EFI_SUCCESS Image is successfully loaded.\r
823 @retval EFI_NOT_FOUND Fail to locate necessary PPI\r
824 @retval Others Fail to load file.\r
192f6d4c 825\r
b1f6a7c6 826**/\r
192f6d4c 827EFI_STATUS\r
828PeiLoadImage (\r
6c7a807a 829 IN CONST EFI_PEI_SERVICES **PeiServices,\r
b0d803fe 830 IN EFI_PEI_FILE_HANDLE FileHandle,\r
341a658f 831 IN UINT8 PeimState,\r
b0d803fe 832 OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
833 OUT UINT32 *AuthenticationState\r
ed66e1bc 834 );\r
192f6d4c 835\r
b1f6a7c6 836/**\r
192f6d4c 837\r
b1f6a7c6 838 Core version of the Status Code reporter\r
192f6d4c 839\r
192f6d4c 840\r
1cc76977 841 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
842 @param CodeType Type of Status Code.\r
843 @param Value Value to output for Status Code.\r
844 @param Instance Instance Number of this status code.\r
845 @param CallerId ID of the caller of this status code.\r
846 @param Data Optional data associated with this status code.\r
192f6d4c 847\r
b1f6a7c6 848 @retval EFI_SUCCESS if status code is successfully reported\r
849 @retval EFI_NOT_AVAILABLE_YET if StatusCodePpi has not been installed\r
192f6d4c 850\r
b1f6a7c6 851**/\r
192f6d4c 852EFI_STATUS\r
853EFIAPI\r
854PeiReportStatusCode (\r
0c2b5da8 855 IN CONST EFI_PEI_SERVICES **PeiServices,\r
192f6d4c 856 IN EFI_STATUS_CODE_TYPE CodeType,\r
857 IN EFI_STATUS_CODE_VALUE Value,\r
858 IN UINT32 Instance,\r
0c2b5da8 859 IN CONST EFI_GUID *CallerId,\r
860 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL\r
ed66e1bc 861 );\r
192f6d4c 862\r
b1f6a7c6 863/**\r
192f6d4c 864\r
b1f6a7c6 865 Core version of the Reset System\r
192f6d4c 866\r
192f6d4c 867\r
1cc76977 868 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
192f6d4c 869\r
b1f6a7c6 870 @retval EFI_NOT_AVAILABLE_YET PPI not available yet.\r
871 @retval EFI_DEVICE_ERROR Did not reset system.\r
872 Otherwise, resets the system.\r
192f6d4c 873\r
b1f6a7c6 874**/\r
192f6d4c 875EFI_STATUS\r
876EFIAPI\r
877PeiResetSystem (\r
b0d803fe 878 IN CONST EFI_PEI_SERVICES **PeiServices\r
ed66e1bc 879 );\r
192f6d4c 880\r
b1f6a7c6 881/**\r
192f6d4c 882\r
b1f6a7c6 883 Initialize PeiCore Fv List.\r
192f6d4c 884\r
192f6d4c 885\r
b1f6a7c6 886 @param PrivateData - Pointer to PEI_CORE_INSTANCE.\r
887 @param SecCoreData - Pointer to EFI_SEC_PEI_HAND_OFF.\r
192f6d4c 888\r
b1f6a7c6 889**/\r
50cb16d9 890VOID\r
b0d803fe 891PeiInitializeFv (\r
892 IN PEI_CORE_INSTANCE *PrivateData,\r
893 IN CONST EFI_SEC_PEI_HAND_OFF *SecCoreData\r
ed66e1bc 894 );\r
b0d803fe 895\r
b1f6a7c6 896/**\r
897 Process Firmware Volum Information once FvInfoPPI install.\r
b0d803fe 898\r
1cc76977 899 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
900 @param NotifyDescriptor Address of the notification descriptor data structure.\r
901 @param Ppi Address of the PPI that was installed.\r
50cb16d9 902\r
b1f6a7c6 903 @retval EFI_SUCCESS if the interface could be successfully installed\r
b0d803fe 904\r
b1f6a7c6 905**/\r
b0d803fe 906EFI_STATUS\r
907EFIAPI\r
908FirmwareVolmeInfoPpiNotifyCallback (\r
909 IN EFI_PEI_SERVICES **PeiServices,\r
910 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
911 IN VOID *Ppi\r
ed66e1bc 912 );\r
b0d803fe 913\r
b1f6a7c6 914/**\r
50cb16d9 915\r
b1f6a7c6 916 Given the input VolumeHandle, search for the next matching name file.\r
b0d803fe 917\r
1cc76977 918 @param FileName File name to search.\r
919 @param VolumeHandle The current FV to search.\r
920 @param FileHandle Pointer to the file matching name in VolumeHandle.\r
921 NULL if file not found\r
b0d803fe 922\r
15273993 923 @retval EFI_NOT_FOUND No files matching the search criteria were found\r
924 @retval EFI_SUCCESS Success to search given file\r
b0d803fe 925\r
b1f6a7c6 926**/\r
b0d803fe 927EFI_STATUS\r
50cb16d9 928EFIAPI\r
b0d803fe 929PeiFfsFindFileByName (\r
930 IN CONST EFI_GUID *FileName,\r
931 IN EFI_PEI_FV_HANDLE VolumeHandle,\r
932 OUT EFI_PEI_FILE_HANDLE *FileHandle\r
ed66e1bc 933 );\r
b0d803fe 934\r
b1f6a7c6 935/**\r
b1f6a7c6 936 Returns information about a specific file.\r
b0d803fe 937\r
3b428ade 938 @param FileHandle Handle of the file.\r
aa75dfec 939 @param FileInfo Upon exit, points to the file's information.\r
b0d803fe 940\r
3b428ade 941 @retval EFI_INVALID_PARAMETER If FileInfo is NULL.\r
942 @retval EFI_INVALID_PARAMETER If FileHandle does not represent a valid file.\r
943 @retval EFI_SUCCESS File information returned.\r
b0d803fe 944\r
b1f6a7c6 945**/\r
b0d803fe 946EFI_STATUS\r
50cb16d9 947EFIAPI\r
b0d803fe 948PeiFfsGetFileInfo (\r
949 IN EFI_PEI_FILE_HANDLE FileHandle,\r
950 OUT EFI_FV_FILE_INFO *FileInfo\r
ed66e1bc 951 );\r
b0d803fe 952\r
b1f6a7c6 953/**\r
3b428ade 954 Returns information about the specified volume.\r
b0d803fe 955\r
3b428ade 956 @param VolumeHandle Handle of the volume.\r
aa75dfec 957 @param VolumeInfo Upon exit, points to the volume's information.\r
b0d803fe 958\r
3b428ade 959 @retval EFI_INVALID_PARAMETER If VolumeHandle does not represent a valid volume.\r
960 @retval EFI_INVALID_PARAMETER If VolumeInfo is NULL.\r
961 @retval EFI_SUCCESS Volume information returned.\r
b1f6a7c6 962**/\r
b0d803fe 963EFI_STATUS\r
50cb16d9 964EFIAPI\r
b0d803fe 965PeiFfsGetVolumeInfo (\r
966 IN EFI_PEI_FV_HANDLE VolumeHandle,\r
967 OUT EFI_FV_INFO *VolumeInfo\r
ed66e1bc 968 );\r
b0d803fe 969\r
14e8823a 970/**\r
971 This routine enable a PEIM to register itself to shadow when PEI Foundation\r
972 discovery permanent memory.\r
973\r
b1f6a7c6 974 @param FileHandle File handle of a PEIM.\r
50cb16d9 975\r
b1f6a7c6 976 @retval EFI_NOT_FOUND The file handle doesn't point to PEIM itself.\r
977 @retval EFI_ALREADY_STARTED Indicate that the PEIM has been registered itself.\r
978 @retval EFI_SUCCESS Successfully to register itself.\r
14e8823a 979\r
50cb16d9 980**/\r
14e8823a 981EFI_STATUS\r
982EFIAPI\r
983PeiRegisterForShadow (\r
984 IN EFI_PEI_FILE_HANDLE FileHandle\r
ed66e1bc 985 );\r
14e8823a 986\r
b1f6a7c6 987/**\r
15273993 988 Initialize image service that install PeiLoadFilePpi.\r
b0d803fe 989\r
15273993 990 @param PrivateData Pointer to PeiCore's private data structure PEI_CORE_INSTANCE.\r
991 @param OldCoreData Pointer to Old PeiCore's private data.\r
992 If NULL, PeiCore is entered at first time, stack/heap in temporary memory.\r
993 If not NULL, PeiCore is entered at second time, stack/heap has been moved\r
994 to permenent memory.\r
b0d803fe 995\r
b1f6a7c6 996**/\r
997VOID\r
998InitializeImageServices (\r
999 IN PEI_CORE_INSTANCE *PrivateData,\r
1000 IN PEI_CORE_INSTANCE *OldCoreData\r
ed66e1bc 1001 );\r
b0d803fe 1002\r
aa79b0b3 1003/**\r
1004 The wrapper function of PeiLoadImageLoadImage().\r
1005\r
f34aec3b 1006 @param This Pointer to EFI_PEI_LOAD_FILE_PPI.\r
1007 @param FileHandle Pointer to the FFS file header of the image.\r
1008 @param ImageAddressArg Pointer to PE/TE image.\r
1009 @param ImageSizeArg Size of PE/TE image.\r
1010 @param EntryPoint Pointer to entry point of specified image file for output.\r
1011 @param AuthenticationState Pointer to attestation authentication state of image.\r
aa79b0b3 1012\r
1013 @return Status of PeiLoadImageLoadImage().\r
1014\r
1015**/\r
1016EFI_STATUS\r
1017EFIAPI\r
1018PeiLoadImageLoadImageWrapper (\r
1019 IN CONST EFI_PEI_LOAD_FILE_PPI *This,\r
1020 IN EFI_PEI_FILE_HANDLE FileHandle,\r
1021 OUT EFI_PHYSICAL_ADDRESS *ImageAddressArg, OPTIONAL\r
1022 OUT UINT64 *ImageSizeArg, OPTIONAL\r
1023 OUT EFI_PHYSICAL_ADDRESS *EntryPoint,\r
1024 OUT UINT32 *AuthenticationState\r
1025 );\r
1026\r
1027/**\r
1028\r
1029 Provide a callback for when the security PPI is installed.\r
1030\r
1031 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.\r
1032 @param NotifyDescriptor The descriptor for the notification event.\r
1033 @param Ppi Pointer to the PPI in question.\r
1034\r
1035 @return Always success\r
1036\r
1037**/\r
1038EFI_STATUS\r
1039EFIAPI\r
1040SecurityPpiNotifyCallback (\r
1041 IN EFI_PEI_SERVICES **PeiServices,\r
1042 IN EFI_PEI_NOTIFY_DESCRIPTOR *NotifyDescriptor,\r
1043 IN VOID *Ppi\r
1044 );\r
1045\r
3b428ade 1046/**\r
1047 Get Fv image from the FV type file, then install FV INFO ppi, Build FV hob.\r
1048\r
1049 @param ParentFvCoreHandle Pointer of EFI_CORE_FV_HANDLE to parent Fv image that contain this Fv image.\r
1050 @param ParentFvFileHandle File handle of a Fv type file that contain this Fv image.\r
1051\r
1052 @retval EFI_NOT_FOUND FV image can't be found.\r
1053 @retval EFI_SUCCESS Successfully to process it.\r
1054 @retval EFI_OUT_OF_RESOURCES Can not allocate page when aligning FV image\r
1055 @retval Others Can not find EFI_SECTION_FIRMWARE_VOLUME_IMAGE section\r
1056 \r
1057**/\r
1058EFI_STATUS\r
1059ProcessFvFile (\r
1060 IN PEI_CORE_FV_HANDLE *ParentFvCoreHandle,\r
1061 IN EFI_PEI_FILE_HANDLE ParentFvFileHandle\r
1062 );\r
1063 \r
1064/**\r
1065 Get instance of PEI_CORE_FV_HANDLE for next volume according to given index.\r
1066 \r
1067 This routine also will install FvInfo ppi for FV hob in PI ways.\r
1068 \r
1069 @param Private Pointer of PEI_CORE_INSTANCE\r
1070 @param Instance The index of FV want to be searched.\r
1071 \r
1072 @return Instance of PEI_CORE_FV_HANDLE.\r
1073**/\r
1074PEI_CORE_FV_HANDLE *\r
1075FindNextCoreFvHandle (\r
1076 IN PEI_CORE_INSTANCE *Private,\r
1077 IN UINTN Instance\r
1078 );\r
1079 \r
8d415937 1080//\r
1081// Default EFI_PEI_CPU_IO_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.\r
1082// \r
1083\r
1084/**\r
1085 Memory-based read services.\r
1086 \r
1087 This function is to perform the Memory Access Read service based on installed \r
1088 instance of the EFI_PEI_CPU_IO_PPI. \r
1089 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1090 return EFI_NOT_YET_AVAILABLE. \r
1091 \r
1092 @param PeiServices An indirect pointer to the PEI Services Table\r
1093 published by the PEI Foundation.\r
1094 @param This Pointer to local data for the interface.\r
1095 @param Width The width of the access. Enumerated in bytes.\r
1096 @param Address The physical address of the access.\r
1097 @param Count The number of accesses to perform.\r
1098 @param Buffer A pointer to the buffer of data.\r
1099\r
1100 @retval EFI_SUCCESS The function completed successfully.\r
1101 @retval EFI_NOT_YET_AVAILABLE The service has not been installed. \r
1102**/\r
1103EFI_STATUS\r
1104EFIAPI\r
1105PeiDefaultMemRead (\r
1106 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1107 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1108 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
1109 IN UINT64 Address,\r
1110 IN UINTN Count,\r
1111 IN OUT VOID *Buffer\r
1112 );\r
1113 \r
1114/**\r
1115 Memory-based write services.\r
1116 \r
1117 This function is to perform the Memory Access Write service based on installed \r
1118 instance of the EFI_PEI_CPU_IO_PPI. \r
1119 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1120 return EFI_NOT_YET_AVAILABLE. \r
1121 \r
1122 @param PeiServices An indirect pointer to the PEI Services Table\r
1123 published by the PEI Foundation.\r
1124 @param This Pointer to local data for the interface.\r
1125 @param Width The width of the access. Enumerated in bytes.\r
1126 @param Address The physical address of the access.\r
1127 @param Count The number of accesses to perform.\r
1128 @param Buffer A pointer to the buffer of data.\r
1129\r
1130 @retval EFI_SUCCESS The function completed successfully.\r
1131 @retval EFI_NOT_YET_AVAILABLE The service has not been installed. \r
1132**/\r
1133EFI_STATUS\r
1134EFIAPI\r
1135PeiDefaultMemWrite (\r
1136 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1137 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1138 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
1139 IN UINT64 Address,\r
1140 IN UINTN Count,\r
1141 IN OUT VOID *Buffer\r
1142 );\r
1143 \r
1144/**\r
1145 IO-based read services.\r
1146 \r
1147 This function is to perform the IO-base read service for the EFI_PEI_CPU_IO_PPI.\r
1148 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1149 return EFI_NOT_YET_AVAILABLE. \r
1150 \r
1151 @param PeiServices An indirect pointer to the PEI Services Table\r
1152 published by the PEI Foundation.\r
1153 @param This Pointer to local data for the interface.\r
1154 @param Width The width of the access. Enumerated in bytes.\r
1155 @param Address The physical address of the access.\r
1156 @param Count The number of accesses to perform.\r
1157 @param Buffer A pointer to the buffer of data.\r
1158\r
1159 @retval EFI_SUCCESS The function completed successfully.\r
1160 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
1161**/\r
1162EFI_STATUS\r
1163EFIAPI\r
1164PeiDefaultIoRead (\r
1165 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1166 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1167 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
1168 IN UINT64 Address,\r
1169 IN UINTN Count,\r
1170 IN OUT VOID *Buffer\r
1171 );\r
1172 \r
1173/**\r
1174 IO-based write services.\r
1175 \r
1176 This function is to perform the IO-base write service for the EFI_PEI_CPU_IO_PPI.\r
1177 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1178 return EFI_NOT_YET_AVAILABLE. \r
1179 \r
1180 @param PeiServices An indirect pointer to the PEI Services Table\r
1181 published by the PEI Foundation.\r
1182 @param This Pointer to local data for the interface.\r
1183 @param Width The width of the access. Enumerated in bytes.\r
1184 @param Address The physical address of the access.\r
1185 @param Count The number of accesses to perform.\r
1186 @param Buffer A pointer to the buffer of data.\r
1187\r
1188 @retval EFI_SUCCESS The function completed successfully.\r
1189 @retval EFI_NOT_YET_AVAILABLE The service has not been installed.\r
1190**/\r
1191EFI_STATUS\r
1192EFIAPI\r
1193PeiDefaultIoWrite (\r
1194 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1195 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1196 IN EFI_PEI_CPU_IO_PPI_WIDTH Width,\r
1197 IN UINT64 Address,\r
1198 IN UINTN Count,\r
1199 IN OUT VOID *Buffer\r
1200 );\r
1201 \r
1202/**\r
1203 8-bit I/O read operations.\r
1204 \r
1205 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1206 return 0.\r
1207 \r
1208 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1209 @param This Pointer to local data for the interface.\r
1210 @param Address The physical address of the access.\r
1211\r
1212 @return An 8-bit value returned from the I/O space.\r
1213**/\r
1214UINT8\r
1215EFIAPI\r
1216PeiDefaultIoRead8 (\r
1217 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1218 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1219 IN UINT64 Address\r
1220 );\r
1221 \r
1222/**\r
1223 Reads an 16-bit I/O port.\r
1224 \r
1225 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1226 return 0.\r
1227 \r
1228 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1229 @param This Pointer to local data for the interface.\r
1230 @param Address The physical address of the access.\r
1231\r
1232 @return A 16-bit value returned from the I/O space.\r
1233**/\r
1234UINT16\r
1235EFIAPI\r
1236PeiDefaultIoRead16 (\r
1237 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1238 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1239 IN UINT64 Address\r
1240 );\r
1241 \r
1242/**\r
1243 Reads an 32-bit I/O port.\r
1244 \r
1245 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1246 return 0.\r
1247 \r
1248 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1249 @param This Pointer to local data for the interface.\r
1250 @param Address The physical address of the access.\r
1251\r
1252 @return A 32-bit value returned from the I/O space.\r
1253**/\r
1254UINT32\r
1255EFIAPI\r
1256PeiDefaultIoRead32 (\r
1257 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1258 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1259 IN UINT64 Address\r
1260 );\r
1261 \r
1262/**\r
1263 Reads an 64-bit I/O port.\r
1264 \r
1265 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1266 return 0.\r
1267 \r
1268 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1269 @param This Pointer to local data for the interface.\r
1270 @param Address The physical address of the access.\r
1271\r
1272 @return A 64-bit value returned from the I/O space.\r
1273**/\r
1274UINT64\r
1275EFIAPI\r
1276PeiDefaultIoRead64 (\r
1277 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1278 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1279 IN UINT64 Address\r
1280 );\r
1281 \r
1282/**\r
1283 8-bit I/O write operations.\r
1284\r
1285 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1286 @param This Pointer to local data for the interface.\r
1287 @param Address The physical address of the access.\r
1288 @param Data The data to write.\r
1289**/\r
1290VOID\r
1291EFIAPI\r
1292PeiDefaultIoWrite8 (\r
1293 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1294 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1295 IN UINT64 Address,\r
1296 IN UINT8 Data\r
1297 );\r
1298 \r
1299/**\r
1300 16-bit I/O write operations.\r
1301\r
1302 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1303 @param This Pointer to local data for the interface.\r
1304 @param Address The physical address of the access.\r
1305 @param Data The data to write.\r
1306**/\r
1307VOID\r
1308EFIAPI\r
1309PeiDefaultIoWrite16 (\r
1310 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1311 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1312 IN UINT64 Address,\r
1313 IN UINT16 Data\r
1314 );\r
1315 \r
1316/**\r
1317 32-bit I/O write operations.\r
1318\r
1319 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1320 @param This Pointer to local data for the interface.\r
1321 @param Address The physical address of the access.\r
1322 @param Data The data to write.\r
1323**/\r
1324VOID\r
1325EFIAPI\r
1326PeiDefaultIoWrite32 (\r
1327 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1328 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1329 IN UINT64 Address,\r
1330 IN UINT32 Data\r
1331 );\r
1332 \r
1333/**\r
1334 64-bit I/O write operations.\r
1335\r
1336 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1337 @param This Pointer to local data for the interface.\r
1338 @param Address The physical address of the access.\r
1339 @param Data The data to write.\r
1340**/\r
1341VOID\r
1342EFIAPI\r
1343PeiDefaultIoWrite64 (\r
1344 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1345 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1346 IN UINT64 Address,\r
1347 IN UINT64 Data\r
1348 );\r
1349 \r
1350/**\r
1351 8-bit memory read operations.\r
1352\r
1353 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1354 return 0.\r
1355 \r
1356 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1357 @param This Pointer to local data for the interface.\r
1358 @param Address The physical address of the access.\r
1359\r
1360 @return An 8-bit value returned from the memory space.\r
1361\r
1362**/\r
1363UINT8\r
1364EFIAPI\r
1365PeiDefaultMemRead8 (\r
1366 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1367 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1368 IN UINT64 Address\r
1369 );\r
1370 \r
1371/**\r
1372 16-bit memory read operations.\r
1373\r
1374 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1375 return 0.\r
1376 \r
1377 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1378 @param This Pointer to local data for the interface.\r
1379 @param Address The physical address of the access.\r
1380\r
1381 @return An 16-bit value returned from the memory space.\r
1382\r
1383**/\r
1384UINT16\r
1385EFIAPI\r
1386PeiDefaultMemRead16 (\r
1387 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1388 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1389 IN UINT64 Address\r
1390 );\r
1391 \r
1392/**\r
1393 32-bit memory read operations.\r
1394\r
1395 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1396 return 0.\r
1397 \r
1398 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1399 @param This Pointer to local data for the interface.\r
1400 @param Address The physical address of the access.\r
1401\r
1402 @return An 32-bit value returned from the memory space.\r
1403\r
1404**/\r
1405UINT32\r
1406EFIAPI\r
1407PeiDefaultMemRead32 (\r
1408 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1409 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1410 IN UINT64 Address\r
1411 );\r
1412 \r
1413/**\r
1414 64-bit memory read operations.\r
1415\r
1416 If the EFI_PEI_CPU_IO_PPI is not installed by platform/chipset PEIM, then \r
1417 return 0.\r
1418 \r
1419 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1420 @param This Pointer to local data for the interface.\r
1421 @param Address The physical address of the access.\r
1422\r
1423 @return An 64-bit value returned from the memory space.\r
1424\r
1425**/\r
1426UINT64\r
1427EFIAPI\r
1428PeiDefaultMemRead64 (\r
1429 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1430 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1431 IN UINT64 Address\r
1432 );\r
1433 \r
1434/**\r
1435 8-bit memory write operations.\r
1436\r
1437 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1438 @param This Pointer to local data for the interface.\r
1439 @param Address The physical address of the access.\r
1440 @param Data The data to write.\r
1441\r
1442**/\r
1443VOID\r
1444EFIAPI\r
1445PeiDefaultMemWrite8 (\r
1446 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1447 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1448 IN UINT64 Address,\r
1449 IN UINT8 Data\r
1450 );\r
1451 \r
1452/**\r
1453 16-bit memory write operations.\r
1454\r
1455 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1456 @param This Pointer to local data for the interface.\r
1457 @param Address The physical address of the access.\r
1458 @param Data The data to write.\r
1459\r
1460**/\r
1461VOID\r
1462EFIAPI\r
1463PeiDefaultMemWrite16 (\r
1464 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1465 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1466 IN UINT64 Address,\r
1467 IN UINT16 Data\r
1468 );\r
1469\r
1470/**\r
1471 32-bit memory write operations.\r
1472\r
1473 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1474 @param This Pointer to local data for the interface.\r
1475 @param Address The physical address of the access.\r
1476 @param Data The data to write.\r
1477\r
1478**/\r
1479VOID\r
1480EFIAPI\r
1481PeiDefaultMemWrite32 (\r
1482 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1483 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1484 IN UINT64 Address,\r
1485 IN UINT32 Data\r
1486 );\r
1487 \r
1488/**\r
1489 64-bit memory write operations.\r
1490\r
1491 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1492 @param This Pointer to local data for the interface.\r
1493 @param Address The physical address of the access.\r
1494 @param Data The data to write.\r
1495\r
1496**/\r
1497VOID\r
1498EFIAPI\r
1499PeiDefaultMemWrite64 (\r
1500 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1501 IN CONST EFI_PEI_CPU_IO_PPI *This,\r
1502 IN UINT64 Address,\r
1503 IN UINT64 Data\r
1504 );\r
1505 \r
1506extern EFI_PEI_CPU_IO_PPI gPeiDefaultCpuIoPpi; \r
1507\r
1508//\r
1509// Default EFI_PEI_PCI_CFG2_PPI support for EFI_PEI_SERVICES table when PeiCore initialization.\r
1510// \r
1511\r
1512/**\r
1513 Reads from a given location in the PCI configuration space.\r
1514\r
1515 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then \r
1516 return EFI_NOT_YET_AVAILABLE. \r
1517 \r
1518 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1519 @param This Pointer to local data for the interface.\r
1520 @param Width The width of the access. Enumerated in bytes.\r
1521 See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
1522 @param Address The physical address of the access. The format of\r
1523 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
1524 @param Buffer A pointer to the buffer of data.\r
1525\r
1526 @retval EFI_SUCCESS The function completed successfully.\r
1527 @retval EFI_INVALID_PARAMETER The invalid access width.\r
1528 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.\r
1529 \r
1530**/\r
1531EFI_STATUS\r
1532EFIAPI\r
1533PeiDefaultPciCfg2Read (\r
1534 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1535 IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r
1536 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
1537 IN UINT64 Address,\r
1538 IN OUT VOID *Buffer\r
1539 );\r
1540 \r
1541/**\r
1542 Write to a given location in the PCI configuration space.\r
1543\r
1544 If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM, then \r
1545 return EFI_NOT_YET_AVAILABLE. \r
1546 \r
1547 @param PeiServices An indirect pointer to the PEI Services Table published by the PEI Foundation.\r
1548 @param This Pointer to local data for the interface.\r
1549 @param Width The width of the access. Enumerated in bytes.\r
1550 See EFI_PEI_PCI_CFG_PPI_WIDTH above.\r
1551 @param Address The physical address of the access. The format of\r
1552 the address is described by EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS.\r
1553 @param Buffer A pointer to the buffer of data.\r
1554\r
1555 @retval EFI_SUCCESS The function completed successfully.\r
1556 @retval EFI_INVALID_PARAMETER The invalid access width.\r
1557 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.\r
1558**/\r
1559EFI_STATUS\r
1560EFIAPI\r
1561PeiDefaultPciCfg2Write (\r
1562 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1563 IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r
1564 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
1565 IN UINT64 Address,\r
1566 IN OUT VOID *Buffer\r
1567 );\r
1568 \r
1569/**\r
1570 This function performs a read-modify-write operation on the contents from a given\r
1571 location in the PCI configuration space.\r
1572\r
1573 @param PeiServices An indirect pointer to the PEI Services Table\r
1574 published by the PEI Foundation.\r
1575 @param This Pointer to local data for the interface.\r
1576 @param Width The width of the access. Enumerated in bytes. Type\r
1577 EFI_PEI_PCI_CFG_PPI_WIDTH is defined in Read().\r
1578 @param Address The physical address of the access.\r
1579 @param SetBits Points to value to bitwise-OR with the read configuration value.\r
1580 The size of the value is determined by Width.\r
1581 @param ClearBits Points to the value to negate and bitwise-AND with the read configuration value.\r
1582 The size of the value is determined by Width.\r
1583\r
1584 @retval EFI_SUCCESS The function completed successfully.\r
1585 @retval EFI_INVALID_PARAMETER The invalid access width.\r
1586 @retval EFI_NOT_YET_AVAILABLE If the EFI_PEI_PCI_CFG2_PPI is not installed by platform/chipset PEIM.\r
1587**/\r
1588EFI_STATUS\r
1589EFIAPI\r
1590PeiDefaultPciCfg2Modify (\r
1591 IN CONST EFI_PEI_SERVICES **PeiServices,\r
1592 IN CONST EFI_PEI_PCI_CFG2_PPI *This,\r
1593 IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,\r
1594 IN UINT64 Address,\r
1595 IN VOID *SetBits,\r
1596 IN VOID *ClearBits\r
1597 ); \r
1598 \r
1599extern EFI_PEI_PCI_CFG2_PPI gPeiDefaultPciCfg2Ppi;\r
1600\r
8e0e40ed 1601/**\r
1602 After PeiCore image is shadowed into permanent memory, all build-in FvPpi should\r
1603 be re-installed with the instance in permanent memory and all cached FvPpi pointers in \r
1604 PrivateData->Fv[] array should be fixed up to be pointed to the one in permenant\r
1605 memory.\r
1606 \r
1607 @param PrivateData Pointer to PEI_CORE_INSTANCE.\r
1608**/ \r
1609VOID\r
1610PeiReinitializeFv (\r
1611 IN PEI_CORE_INSTANCE *PrivateData\r
1612 );\r
1613 \r
192f6d4c 1614#endif\r