]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiDxeCis.h
MdePkg: Add Reset2 ppi definition.
[mirror_edk2.git] / MdePkg / Include / Pi / PiDxeCis.h
CommitLineData
959ccb23 1/** @file\r
2 Include file matches things in PI.\r
3\r
6c98edac 4Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
af2dc6a7 5This program and the accompanying materials are licensed and made available under \r
6the terms and conditions of the BSD License that accompanies this distribution. \r
7The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php. \r
959ccb23 9\r
af2dc6a7 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
959ccb23 12\r
959ccb23 13 @par Revision Reference:\r
6c98edac 14 PI Version 1.4\r
959ccb23 15\r
16**/\r
17\r
18#ifndef __PI_DXECIS_H__\r
19#define __PI_DXECIS_H__\r
20\r
d7dfd027 21#include <Uefi/UefiMultiPhase.h>\r
959ccb23 22#include <Pi/PiMultiPhase.h>\r
23\r
dc53faa3 24///\r
af2dc6a7 25/// Global Coherencey Domain types - Memory type.\r
dc53faa3 26///\r
959ccb23 27typedef enum {\r
1bf79370
LG
28 ///\r
29 /// A memory region that is visible to the boot processor. However, there are no system\r
30 /// components that are currently decoding this memory region.\r
31 ///\r
959ccb23 32 EfiGcdMemoryTypeNonExistent,\r
1bf79370
LG
33 ///\r
34 /// A memory region that is visible to the boot processor. This memory region is being\r
35 /// decoded by a system component, but the memory region is not considered to be either\r
36 /// system memory or memory-mapped I/O.\r
37 ///\r
959ccb23 38 EfiGcdMemoryTypeReserved,\r
1bf79370
LG
39 ///\r
40 /// A memory region that is visible to the boot processor. A memory controller is\r
41 /// currently decoding this memory region and the memory controller is producing a\r
42 /// tested system memory region that is available to the memory services.\r
43 ///\r
959ccb23 44 EfiGcdMemoryTypeSystemMemory,\r
1bf79370
LG
45 ///\r
46 /// A memory region that is visible to the boot processor. This memory region is\r
47 /// currently being decoded by a component as memory-mapped I/O that can be used to\r
48 /// access I/O devices in the platform.\r
49 ///\r
959ccb23 50 EfiGcdMemoryTypeMemoryMappedIo,\r
6c98edac
LG
51 ///\r
52 /// A memory region that is visible to the boot processor. \r
53 /// This memory supports byte-addressable non-volatility. \r
54 ///\r
55 EfiGcdMemoryTypePersistentMemory,\r
959ccb23 56 EfiGcdMemoryTypeMaximum\r
57} EFI_GCD_MEMORY_TYPE;\r
58\r
dc53faa3 59///\r
af2dc6a7 60/// Global Coherencey Domain types - IO type.\r
dc53faa3 61///\r
959ccb23 62typedef enum {\r
1bf79370
LG
63 ///\r
64 /// An I/O region that is visible to the boot processor. However, there are no system\r
65 /// components that are currently decoding this I/O region.\r
66 ///\r
959ccb23 67 EfiGcdIoTypeNonExistent,\r
1bf79370
LG
68 ///\r
69 /// An I/O region that is visible to the boot processor. This I/O region is currently being\r
70 /// decoded by a system component, but the I/O region cannot be used to access I/O devices.\r
71 ///\r
959ccb23 72 EfiGcdIoTypeReserved,\r
1bf79370
LG
73 ///\r
74 /// An I/O region that is visible to the boot processor. This I/O region is currently being\r
75 /// decoded by a system component that is producing I/O ports that can be used to access I/O devices.\r
76 ///\r
959ccb23 77 EfiGcdIoTypeIo,\r
78 EfiGcdIoTypeMaximum\r
79} EFI_GCD_IO_TYPE;\r
80\r
dc53faa3 81///\r
82/// The type of allocation to perform.\r
83/// \r
959ccb23 84typedef enum {\r
1bf79370
LG
85 ///\r
86 /// The GCD memory space map is searched from the lowest address up to the highest address\r
87 /// looking for unallocated memory ranges.\r
88 ///\r
959ccb23 89 EfiGcdAllocateAnySearchBottomUp,\r
1bf79370
LG
90 ///\r
91 /// The GCD memory space map is searched from the lowest address up \r
92 /// to the specified MaxAddress looking for unallocated memory ranges.\r
93 ///\r
959ccb23 94 EfiGcdAllocateMaxAddressSearchBottomUp,\r
1bf79370
LG
95 ///\r
96 /// The GCD memory space map is checked to see if the memory range starting \r
97 /// at the specified Address is available.\r
98 ///\r
959ccb23 99 EfiGcdAllocateAddress,\r
1bf79370
LG
100 ///\r
101 /// The GCD memory space map is searched from the highest address down to the lowest address \r
102 /// looking for unallocated memory ranges.\r
103 ///\r
959ccb23 104 EfiGcdAllocateAnySearchTopDown,\r
1bf79370
LG
105 ///\r
106 /// The GCD memory space map is searched from the specified MaxAddress \r
107 /// down to the lowest address looking for unallocated memory ranges.\r
108 ///\r
959ccb23 109 EfiGcdAllocateMaxAddressSearchTopDown,\r
110 EfiGcdMaxAllocateType\r
111} EFI_GCD_ALLOCATE_TYPE;\r
112\r
dc53faa3 113///\r
af2dc6a7 114/// EFI_GCD_MEMORY_SPACE_DESCRIPTOR.\r
dc53faa3 115/// \r
959ccb23 116typedef struct {\r
dc53faa3 117 ///\r
118 /// The physical address of the first byte in the memory region. Type\r
119 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function\r
af2dc6a7 120 /// description in the UEFI 2.0 specification.\r
dc53faa3 121 /// \r
959ccb23 122 EFI_PHYSICAL_ADDRESS BaseAddress;\r
dc53faa3 123\r
124 ///\r
125 /// The number of bytes in the memory region.\r
126 /// \r
959ccb23 127 UINT64 Length;\r
dc53faa3 128\r
129 ///\r
130 /// The bit mask of attributes that the memory region is capable of supporting. The bit\r
131 /// mask of available attributes is defined in the GetMemoryMap() function description\r
132 /// in the UEFI 2.0 specification.\r
133 /// \r
959ccb23 134 UINT64 Capabilities;\r
dc53faa3 135 ///\r
136 /// The bit mask of attributes that the memory region is currently using. The bit mask of\r
137 /// available attributes is defined in GetMemoryMap().\r
138 /// \r
959ccb23 139 UINT64 Attributes;\r
dc53faa3 140 ///\r
141 /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the\r
af2dc6a7 142 /// AddMemorySpace() function description.\r
dc53faa3 143 /// \r
959ccb23 144 EFI_GCD_MEMORY_TYPE GcdMemoryType;\r
dc53faa3 145\r
146 ///\r
147 /// The image handle of the agent that allocated the memory resource described by\r
148 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory\r
149 /// resource is not currently allocated. Type EFI_HANDLE is defined in\r
150 /// InstallProtocolInterface() in the UEFI 2.0 specification.\r
151 /// \r
959ccb23 152 EFI_HANDLE ImageHandle;\r
dc53faa3 153\r
154 ///\r
155 /// The device handle for which the memory resource has been allocated. If\r
156 /// ImageHandle is NULL, then the memory resource is not currently allocated. If this\r
157 /// field is NULL, then the memory resource is not associated with a device that is\r
158 /// described by a device handle. Type EFI_HANDLE is defined in\r
159 /// InstallProtocolInterface() in the UEFI 2.0 specification.\r
160 /// \r
959ccb23 161 EFI_HANDLE DeviceHandle;\r
162} EFI_GCD_MEMORY_SPACE_DESCRIPTOR;\r
163\r
dc53faa3 164///\r
af2dc6a7 165/// EFI_GCD_IO_SPACE_DESCRIPTOR.\r
dc53faa3 166/// \r
959ccb23 167typedef struct {\r
dc53faa3 168 ///\r
169 /// Physical address of the first byte in the I/O region. Type\r
170 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function\r
171 /// description in the UEFI 2.0 specification.\r
172 /// \r
959ccb23 173 EFI_PHYSICAL_ADDRESS BaseAddress;\r
dc53faa3 174\r
4ba967e7 175 ///\r
dc53faa3 176 /// Number of bytes in the I/O region.\r
4ba967e7 177 ///\r
959ccb23 178 UINT64 Length;\r
dc53faa3 179\r
180 /// \r
181 /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the\r
182 /// AddIoSpace() function description.\r
183 /// \r
959ccb23 184 EFI_GCD_IO_TYPE GcdIoType;\r
dc53faa3 185\r
186 /// \r
187 /// The image handle of the agent that allocated the I/O resource described by\r
188 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O\r
189 /// resource is not currently allocated. Type EFI_HANDLE is defined in\r
190 /// InstallProtocolInterface() in the UEFI 2.0 specification.\r
191 /// \r
959ccb23 192 EFI_HANDLE ImageHandle;\r
dc53faa3 193\r
194 ///\r
195 /// The device handle for which the I/O resource has been allocated. If ImageHandle\r
196 /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then\r
197 /// the I/O resource is not associated with a device that is described by a device handle.\r
198 /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI\r
199 /// 2.0 specification.\r
200 /// \r
959ccb23 201 EFI_HANDLE DeviceHandle;\r
202} EFI_GCD_IO_SPACE_DESCRIPTOR;\r
203\r
204\r
205/**\r
206 Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
207 global coherency domain of the processor.\r
208\r
4ba967e7 209 @param GcdMemoryType The type of memory resource being added.\r
210 @param BaseAddress The physical address that is the start address\r
211 of the memory resource being added.\r
212 @param Length The size, in bytes, of the memory resource that\r
213 is being added.\r
214 @param Capabilities The bit mask of attributes that the memory \r
215 resource region supports.\r
216\r
217 @retval EFI_SUCCESS The memory resource was added to the global\r
218 coherency domain of the processor.\r
219 @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.\r
220 @retval EFI_INVALID_PARAMETER Length is zero.\r
221 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add\r
222 the memory resource to the global coherency \r
223 domain of the processor.\r
224 @retval EFI_UNSUPPORTED The processor does not support one or more bytes\r
225 of the memory resource range specified by \r
226 BaseAddress and Length.\r
227 @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range\r
228 specified by BaseAddress and Length conflicts \r
229 with a memory resource range that was previously\r
230 added to the global coherency domain of the processor.\r
231 @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range\r
232 specified by BaseAddress and Length was allocated\r
af2dc6a7 233 in a prior call to AllocateMemorySpace().\r
959ccb23 234\r
235**/\r
236typedef\r
237EFI_STATUS\r
dc53faa3 238(EFIAPI *EFI_ADD_MEMORY_SPACE)(\r
959ccb23 239 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
240 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
241 IN UINT64 Length,\r
242 IN UINT64 Capabilities\r
ed66e1bc 243 );\r
959ccb23 244\r
245/**\r
246 Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
247 I/O resources from the global coherency domain of the processor.\r
248\r
4ba967e7 249 @param GcdAllocateType The type of allocation to perform.\r
250 @param GcdMemoryType The type of memory resource being allocated.\r
251 @param Alignment The log base 2 of the boundary that BaseAddress must\r
252 be aligned on output. Align with 2^Alignment.\r
253 @param Length The size in bytes of the memory resource range that\r
254 is being allocated.\r
255 @param BaseAddress A pointer to a physical address to allocate.\r
256 @param Imagehandle The image handle of the agent that is allocating \r
257 the memory resource.\r
258 @param DeviceHandle The device handle for which the memory resource\r
259 is being allocated.\r
260\r
261 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.\r
262 @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.\r
263 @retval EFI_INVALID_PARAMETER Length is zero.\r
264 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.\r
265 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.\r
266 @retval EFI_NOT_FOUND The memory resource request could not be satisfied.\r
267 No descriptor contains the desired space.\r
268 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory\r
269 resource from the global coherency domain of the processor.\r
270 @retval EFI_SUCCESS The memory resource was allocated from the global coherency\r
271 domain of the processor.\r
959ccb23 272\r
959ccb23 273\r
274**/\r
275typedef\r
276EFI_STATUS\r
dc53faa3 277(EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)(\r
959ccb23 278 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
279 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
280 IN UINTN Alignment,\r
281 IN UINT64 Length,\r
282 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
283 IN EFI_HANDLE ImageHandle,\r
284 IN EFI_HANDLE DeviceHandle OPTIONAL\r
ed66e1bc 285 );\r
959ccb23 286\r
287/**\r
288 Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
289 I/O resources from the global coherency domain of the processor.\r
290\r
4ba967e7 291 @param BaseAddress The physical address that is the start address of the memory resource being freed.\r
292 @param Length The size in bytes of the memory resource range that is being freed.\r
959ccb23 293\r
4ba967e7 294 @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of\r
295 the processor.\r
296 @retval EFI_INVALID_PARAMETER Length is zero. \r
297 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
298 resource range specified by BaseAddress and Length.\r
299 @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and\r
300 Length was not allocated with previous calls to AllocateMemorySpace().\r
301 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource\r
302 from the global coherency domain of the processor.\r
959ccb23 303\r
304**/\r
305typedef\r
306EFI_STATUS\r
dc53faa3 307(EFIAPI *EFI_FREE_MEMORY_SPACE)(\r
959ccb23 308 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
309 IN UINT64 Length\r
ed66e1bc 310 );\r
959ccb23 311\r
312/**\r
313 Removes reserved memory, system memory, or memory-mapped I/O resources from\r
314 the global coherency domain of the processor.\r
315\r
4ba967e7 316 @param BaseAddress The physical address that is the start address of the memory resource being removed.\r
317 @param Length The size in bytes of the memory resource that is being removed.\r
318\r
319 @retval EFI_SUCCESS The memory resource was removed from the global coherency\r
320 domain of the processor.\r
321 @retval EFI_INVALID_PARAMETER Length is zero. \r
322 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
323 resource range specified by BaseAddress and Length.\r
324 @retval EFI_NOT_FOUND One or more bytes of the memory resource range specified by\r
325 BaseAddress and Length was not added with previous calls to\r
326 AddMemorySpace().\r
327 @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by\r
328 BaseAddress and Length has been allocated with AllocateMemorySpace().\r
329 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory\r
330 resource from the global coherency domain of the processor.\r
959ccb23 331\r
332**/\r
333typedef\r
334EFI_STATUS\r
dc53faa3 335(EFIAPI *EFI_REMOVE_MEMORY_SPACE)(\r
959ccb23 336 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
337 IN UINT64 Length\r
ed66e1bc 338 );\r
959ccb23 339\r
340/**\r
341 Retrieves the descriptor for a memory region containing a specified address.\r
342\r
4ba967e7 343 @param BaseAddress The physical address that is the start address of a memory region.\r
344 @param Descriptor A pointer to a caller allocated descriptor.\r
959ccb23 345\r
4ba967e7 346 @retval EFI_SUCCESS The descriptor for the memory resource region containing\r
347 BaseAddress was returned in Descriptor.\r
348 @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
349 @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found.\r
959ccb23 350\r
351**/\r
352typedef\r
353EFI_STATUS\r
dc53faa3 354(EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)(\r
959ccb23 355 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
356 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r
ed66e1bc 357 );\r
959ccb23 358\r
359/**\r
360 Modifies the attributes for a memory region in the global coherency domain of the\r
361 processor.\r
362\r
4ba967e7 363 @param BaseAddress The physical address that is the start address of a memory region.\r
364 @param Length The size in bytes of the memory region.\r
365 @param Attributes The bit mask of attributes to set for the memory region.\r
366\r
367 @retval EFI_SUCCESS The attributes were set for the memory region.\r
368 @retval EFI_INVALID_PARAMETER Length is zero. \r
369 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r
370 resource range specified by BaseAddress and Length.\r
371 @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r
372 range specified by BaseAddress and Length.\r
771ee501 373 @retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by\r
4ba967e7 374 BaseAddress and Length cannot be modified.\r
375 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r
376 the memory resource range.\r
714eecd4 377 @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is\r
378 not available yet.\r
959ccb23 379**/\r
380typedef\r
959ccb23 381EFI_STATUS\r
dc53faa3 382(EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)(\r
959ccb23 383 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
384 IN UINT64 Length,\r
385 IN UINT64 Attributes\r
ed66e1bc 386 );\r
959ccb23 387\r
771ee501
EC
388/**\r
389 Modifies the capabilities for a memory region in the global coherency domain of the\r
390 processor.\r
391\r
392 @param BaseAddress The physical address that is the start address of a memory region.\r
393 @param Length The size in bytes of the memory region.\r
394 @param Capabilities The bit mask of capabilities that the memory region supports.\r
395\r
396 @retval EFI_SUCCESS The capabilities were set for the memory region.\r
397 @retval EFI_INVALID_PARAMETER Length is zero.\r
398 @retval EFI_UNSUPPORTED The capabilities specified by Capabilities do not include the\r
399 memory region attributes currently in use.\r
400 @retval EFI_ACCESS_DENIED The capabilities for the memory resource range specified by\r
401 BaseAddress and Length cannot be modified.\r
402 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the capabilities\r
403 of the memory resource range.\r
404**/\r
405typedef\r
406EFI_STATUS\r
407(EFIAPI *EFI_SET_MEMORY_SPACE_CAPABILITIES) (\r
408 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
409 IN UINT64 Length,\r
410 IN UINT64 Capabilities\r
411 );\r
412\r
959ccb23 413/**\r
414 Returns a map of the memory resources in the global coherency domain of the\r
415 processor.\r
416\r
4ba967e7 417 @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.\r
418 @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.\r
959ccb23 419\r
4ba967e7 420 @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap\r
421 buffer, and the number of descriptors in MemorySpaceMap was\r
422 returned in NumberOfDescriptors.\r
423 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.\r
424 @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.\r
425 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap.\r
959ccb23 426\r
427**/\r
428typedef\r
429EFI_STATUS\r
dc53faa3 430(EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(\r
959ccb23 431 OUT UINTN *NumberOfDescriptors,\r
432 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r
ed66e1bc 433 );\r
959ccb23 434\r
435/**\r
436 Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
437\r
4ba967e7 438 @param GcdIoType The type of I/O resource being added.\r
439 @param BaseAddress The physical address that is the start address of the I/O resource being added.\r
440 @param Length The size in bytes of the I/O resource that is being added.\r
441\r
442 @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of\r
443 the processor.\r
444 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.\r
445 @retval EFI_INVALID_PARAMETER Length is zero.\r
446 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to\r
447 the global coherency domain of the processor.\r
448 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O\r
449 resource range specified by BaseAddress and Length.\r
450 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by\r
451 BaseAddress and Length conflicts with an I/O resource\r
452 range that was previously added to the global coherency domain\r
453 of the processor.\r
454 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by\r
455 BaseAddress and Length was allocated in a prior call to\r
456 AllocateIoSpace().\r
959ccb23 457\r
458**/\r
459typedef\r
460EFI_STATUS\r
dc53faa3 461(EFIAPI *EFI_ADD_IO_SPACE)(\r
959ccb23 462 IN EFI_GCD_IO_TYPE GcdIoType,\r
463 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
464 IN UINT64 Length\r
ed66e1bc 465 );\r
959ccb23 466\r
467/**\r
468 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
469 domain of the processor.\r
470\r
4ba967e7 471 @param GcdAllocateType The type of allocation to perform.\r
472 @param GcdIoType The type of I/O resource being allocated.\r
473 @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output.\r
474 @param Length The size in bytes of the I/O resource range that is being allocated.\r
475 @param BaseAddress A pointer to a physical address.\r
476 @param Imagehandle The image handle of the agent that is allocating the I/O resource.\r
477 @param DeviceHandle The device handle for which the I/O resource is being allocated.\r
478\r
479 @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain\r
480 of the processor.\r
481 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.\r
482 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.\r
483 @retval EFI_INVALID_PARAMETER Length is zero.\r
484 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.\r
485 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.\r
486 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O\r
487 resource from the global coherency domain of the processor.\r
488 @retval EFI_NOT_FOUND The I/O resource request could not be satisfied.\r
959ccb23 489\r
490**/\r
491typedef\r
492EFI_STATUS\r
dc53faa3 493(EFIAPI *EFI_ALLOCATE_IO_SPACE)(\r
959ccb23 494 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
495 IN EFI_GCD_IO_TYPE GcdIoType,\r
496 IN UINTN Alignment,\r
497 IN UINT64 Length,\r
498 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
499 IN EFI_HANDLE ImageHandle,\r
500 IN EFI_HANDLE DeviceHandle OPTIONAL\r
ed66e1bc 501 );\r
959ccb23 502\r
503/**\r
504 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
505 domain of the processor.\r
506\r
4ba967e7 507 @param BaseAddress The physical address that is the start address of the I/O resource being freed.\r
508 @param Length The size in bytes of the I/O resource range that is being freed.\r
959ccb23 509\r
4ba967e7 510 @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the\r
511 processor.\r
512 @retval EFI_INVALID_PARAMETER Length is zero.\r
513 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource\r
514 range specified by BaseAddress and Length.\r
515 @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length\r
516 was not allocated with previous calls to AllocateIoSpace().\r
517 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from\r
518 the global coherency domain of the processor.\r
959ccb23 519\r
520**/\r
521typedef\r
522EFI_STATUS\r
dc53faa3 523(EFIAPI *EFI_FREE_IO_SPACE)(\r
959ccb23 524 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
525 IN UINT64 Length\r
ed66e1bc 526 );\r
959ccb23 527\r
528/**\r
529 Removes reserved I/O or I/O resources from the global coherency domain of the\r
530 processor.\r
531\r
4ba967e7 532 @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being\r
533 removed.\r
534 @param Length The size in bytes of the I/O resource that is being removed.\r
535\r
536 @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain\r
537 of the processor.\r
538 @retval EFI_INVALID_PARAMETER Length is zero.\r
539 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O\r
540 resource range specified by BaseAddress and Length.\r
541 @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by\r
542 BaseAddress and Length was not added with previous\r
543 calls to AddIoSpace().\r
544 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by\r
545 BaseAddress and Length has been allocated with\r
546 AllocateIoSpace().\r
547 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O\r
548 resource from the global coherency domain of the processor.\r
959ccb23 549\r
550**/\r
551typedef\r
552EFI_STATUS\r
dc53faa3 553(EFIAPI *EFI_REMOVE_IO_SPACE)(\r
959ccb23 554 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
555 IN UINT64 Length\r
ed66e1bc 556 );\r
959ccb23 557\r
558/**\r
559 Retrieves the descriptor for an I/O region containing a specified address.\r
560\r
4ba967e7 561 @param BaseAddress The physical address that is the start address of an I/O region.\r
562 @param Descriptor A pointer to a caller allocated descriptor.\r
959ccb23 563\r
4ba967e7 564 @retval EFI_SUCCESS The descriptor for the I/O resource region containing\r
565 BaseAddress was returned in Descriptor.\r
959ccb23 566 @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
4ba967e7 567 @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found.\r
959ccb23 568\r
569**/\r
570typedef\r
571EFI_STATUS\r
dc53faa3 572(EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(\r
959ccb23 573 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
574 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r
ed66e1bc 575 );\r
959ccb23 576\r
577/**\r
578 Returns a map of the I/O resources in the global coherency domain of the processor.\r
579\r
4ba967e7 580 @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.\r
581 @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.\r
582\r
583 @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and\r
584 the number of descriptors in IoSpaceMap was returned in\r
585 NumberOfDescriptors.\r
586 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.\r
587 @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.\r
588 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap.\r
959ccb23 589\r
959ccb23 590\r
591**/\r
592typedef\r
593EFI_STATUS\r
dc53faa3 594(EFIAPI *EFI_GET_IO_SPACE_MAP)(\r
959ccb23 595 OUT UINTN *NumberOfDescriptors,\r
596 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r
ed66e1bc 597 );\r
959ccb23 598\r
599\r
600\r
601/**\r
602 Loads and executed DXE drivers from firmware volumes.\r
603\r
4ba967e7 604 The Dispatch() function searches for DXE drivers in firmware volumes that have been \r
605 installed since the last time the Dispatch() service was called. It then evaluates \r
606 the dependency expressions of all the DXE drivers and loads and executes those DXE\r
607 drivers whose dependency expression evaluate to TRUE. This service must interact with\r
608 the Security Architectural Protocol to authenticate DXE drivers before they are executed.\r
609 This process is continued until no more DXE drivers can be executed.\r
610\r
611 @retval EFI_SUCCESS One or more DXE driver were dispatched.\r
612 @retval EFI_NOT_FOUND No DXE drivers were dispatched.\r
613 @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.\r
af2dc6a7 614 Thus, no action was taken.\r
959ccb23 615\r
616**/\r
617typedef\r
618EFI_STATUS\r
dc53faa3 619(EFIAPI *EFI_DISPATCH)(\r
00edb218 620 VOID\r
ed66e1bc 621 );\r
959ccb23 622\r
623/**\r
624 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.\r
625\r
626 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.\r
4ba967e7 627 @param FileName A pointer to the name of the file in a firmware volume.\r
959ccb23 628\r
4ba967e7 629 @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared.\r
630 @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR\r
631 bit is not set.\r
959ccb23 632\r
633**/\r
634typedef\r
635EFI_STATUS\r
dc53faa3 636(EFIAPI *EFI_SCHEDULE)(\r
959ccb23 637 IN EFI_HANDLE FirmwareVolumeHandle,\r
4ba967e7 638 IN CONST EFI_GUID *FileName\r
ed66e1bc 639 );\r
959ccb23 640\r
641/**\r
642 Promotes a file stored in a firmware volume from the untrusted to the trusted state.\r
643\r
644 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.\r
645 @param DriverName A pointer to the name of the file in a firmware volume.\r
646\r
373b5cf9 647 @return Status of promoting FFS from untrusted to trusted\r
648 state.\r
4ba967e7 649 @retval EFI_NOT_FOUND The file was not found in the untrusted state.\r
959ccb23 650\r
651**/\r
652typedef\r
653EFI_STATUS\r
dc53faa3 654(EFIAPI *EFI_TRUST)(\r
959ccb23 655 IN EFI_HANDLE FirmwareVolumeHandle,\r
4ba967e7 656 IN CONST EFI_GUID *FileName\r
ed66e1bc 657 );\r
959ccb23 658\r
659/**\r
660 Creates a firmware volume handle for a firmware volume that is present in system memory.\r
661\r
662 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.\r
663 @param Size The size, in bytes, of the firmware volume.\r
664 @param FirmwareVolumeHandle On output, a pointer to the created handle.\r
665\r
4ba967e7 666 @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and\r
667 EFI_DEVICE_PATH_PROTOCOL were installed onto\r
668 FirmwareVolumeHandle for the firmware volume described\r
669 by FirmwareVolumeHeader and Size.\r
670 @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader\r
671 and Size is corrupted.\r
672 @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the\r
673 EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL \r
674 for the firmware volume described by FirmwareVolumeHeader and Size.\r
959ccb23 675\r
676**/\r
677typedef\r
678EFI_STATUS\r
dc53faa3 679(EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)(\r
4ba967e7 680 IN CONST VOID *FirmwareVolumeHeader,\r
959ccb23 681 IN UINTN Size,\r
682 OUT EFI_HANDLE *FirmwareVolumeHandle\r
ed66e1bc 683 );\r
959ccb23 684\r
685//\r
686// DXE Services Table\r
687//\r
53e6937c 688#define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL\r
689#define DXE_SPECIFICATION_MAJOR_REVISION 1\r
693bebd9 690#define DXE_SPECIFICATION_MINOR_REVISION 40\r
53e6937c 691#define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION))\r
959ccb23 692\r
693typedef struct {\r
1bf79370
LG
694 ///\r
695 /// The table header for the DXE Services Table.\r
696 /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.\r
697 ///\r
959ccb23 698 EFI_TABLE_HEADER Hdr;\r
699\r
700 //\r
701 // Global Coherency Domain Services\r
702 //\r
703 EFI_ADD_MEMORY_SPACE AddMemorySpace;\r
704 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;\r
705 EFI_FREE_MEMORY_SPACE FreeMemorySpace;\r
706 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;\r
707 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;\r
708 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;\r
709 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;\r
710 EFI_ADD_IO_SPACE AddIoSpace;\r
711 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;\r
712 EFI_FREE_IO_SPACE FreeIoSpace;\r
713 EFI_REMOVE_IO_SPACE RemoveIoSpace;\r
714 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;\r
715 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;\r
716\r
717 //\r
718 // Dispatcher Services\r
719 //\r
720 EFI_DISPATCH Dispatch;\r
721 EFI_SCHEDULE Schedule;\r
722 EFI_TRUST Trust;\r
723 //\r
724 // Service to process a single firmware volume found in a capsule\r
725 //\r
726 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;\r
771ee501
EC
727 //\r
728 // Extensions to Global Coherency Domain Services\r
729 //\r
730 EFI_SET_MEMORY_SPACE_CAPABILITIES SetMemorySpaceCapabilities;\r
959ccb23 731} DXE_SERVICES;\r
732\r
733typedef DXE_SERVICES EFI_DXE_SERVICES;\r
734\r
a32c6dcf 735\r
736/**\r
af2dc6a7 737 The function prototype for invoking a function on an Application Processor.\r
a32c6dcf 738\r
739 This definition is used by the UEFI MP Serices Protocol, and the\r
740 PI SMM System Table.\r
741\r
af2dc6a7 742 @param[in,out] Buffer The pointer to private data buffer.\r
a32c6dcf 743**/\r
744typedef\r
745VOID\r
746(EFIAPI *EFI_AP_PROCEDURE)(\r
747 IN OUT VOID *Buffer\r
748 );\r
749\r
959ccb23 750#endif\r