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