]>
Commit | Line | Data |
---|---|---|
959ccb23 | 1 | /** @file\r |
2 | Include file matches things in PI.\r | |
3 | \r | |
9095d37b | 4 | Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9344f092 | 5 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
959ccb23 | 6 | \r |
959ccb23 | 7 | @par Revision Reference:\r |
93ddc0d1 | 8 | PI Version 1.7\r |
959ccb23 | 9 | \r |
10 | **/\r | |
11 | \r | |
12 | #ifndef __PI_DXECIS_H__\r | |
13 | #define __PI_DXECIS_H__\r | |
14 | \r | |
d7dfd027 | 15 | #include <Uefi/UefiMultiPhase.h>\r |
959ccb23 | 16 | #include <Pi/PiMultiPhase.h>\r |
17 | \r | |
dc53faa3 | 18 | ///\r |
af2dc6a7 | 19 | /// Global Coherencey Domain types - Memory type.\r |
dc53faa3 | 20 | ///\r |
959ccb23 | 21 | typedef enum {\r |
1bf79370 LG |
22 | ///\r |
23 | /// A memory region that is visible to the boot processor. However, there are no system\r | |
24 | /// components that are currently decoding this memory region.\r | |
25 | ///\r | |
959ccb23 | 26 | EfiGcdMemoryTypeNonExistent,\r |
1bf79370 LG |
27 | ///\r |
28 | /// A memory region that is visible to the boot processor. This memory region is being\r | |
29 | /// decoded by a system component, but the memory region is not considered to be either\r | |
30 | /// system memory or memory-mapped I/O.\r | |
31 | ///\r | |
959ccb23 | 32 | EfiGcdMemoryTypeReserved,\r |
1bf79370 LG |
33 | ///\r |
34 | /// A memory region that is visible to the boot processor. A memory controller is\r | |
35 | /// currently decoding this memory region and the memory controller is producing a\r | |
36 | /// tested system memory region that is available to the memory services.\r | |
37 | ///\r | |
959ccb23 | 38 | EfiGcdMemoryTypeSystemMemory,\r |
1bf79370 LG |
39 | ///\r |
40 | /// A memory region that is visible to the boot processor. This memory region is\r | |
41 | /// currently being decoded by a component as memory-mapped I/O that can be used to\r | |
42 | /// access I/O devices in the platform.\r | |
43 | ///\r | |
959ccb23 | 44 | EfiGcdMemoryTypeMemoryMappedIo,\r |
6c98edac | 45 | ///\r |
9095d37b LG |
46 | /// A memory region that is visible to the boot processor.\r |
47 | /// This memory supports byte-addressable non-volatility.\r | |
6c98edac | 48 | ///\r |
4f5687c2 LG |
49 | EfiGcdMemoryTypePersistent,\r |
50 | //\r | |
51 | // Keep original one for the compatibility.\r | |
52 | //\r | |
53 | EfiGcdMemoryTypePersistentMemory = EfiGcdMemoryTypePersistent,\r | |
e919c766 SZ |
54 | ///\r |
55 | /// A memory region that provides higher reliability relative to other memory in the\r | |
56 | /// system. If all memory has the same reliability, then this bit is not used.\r | |
57 | ///\r | |
58 | EfiGcdMemoryTypeMoreReliable,\r | |
959ccb23 | 59 | EfiGcdMemoryTypeMaximum\r |
60 | } EFI_GCD_MEMORY_TYPE;\r | |
61 | \r | |
dc53faa3 | 62 | ///\r |
af2dc6a7 | 63 | /// Global Coherencey Domain types - IO type.\r |
dc53faa3 | 64 | ///\r |
959ccb23 | 65 | typedef enum {\r |
1bf79370 LG |
66 | ///\r |
67 | /// An I/O region that is visible to the boot processor. However, there are no system\r | |
68 | /// components that are currently decoding this I/O region.\r | |
69 | ///\r | |
959ccb23 | 70 | EfiGcdIoTypeNonExistent,\r |
1bf79370 LG |
71 | ///\r |
72 | /// An I/O region that is visible to the boot processor. This I/O region is currently being\r | |
73 | /// decoded by a system component, but the I/O region cannot be used to access I/O devices.\r | |
74 | ///\r | |
959ccb23 | 75 | EfiGcdIoTypeReserved,\r |
1bf79370 LG |
76 | ///\r |
77 | /// An I/O region that is visible to the boot processor. This I/O region is currently being\r | |
78 | /// decoded by a system component that is producing I/O ports that can be used to access I/O devices.\r | |
79 | ///\r | |
959ccb23 | 80 | EfiGcdIoTypeIo,\r |
81 | EfiGcdIoTypeMaximum\r | |
82 | } EFI_GCD_IO_TYPE;\r | |
83 | \r | |
dc53faa3 | 84 | ///\r |
85 | /// The type of allocation to perform.\r | |
9095d37b | 86 | ///\r |
959ccb23 | 87 | typedef enum {\r |
1bf79370 LG |
88 | ///\r |
89 | /// The GCD memory space map is searched from the lowest address up to the highest address\r | |
90 | /// looking for unallocated memory ranges.\r | |
91 | ///\r | |
959ccb23 | 92 | EfiGcdAllocateAnySearchBottomUp,\r |
1bf79370 | 93 | ///\r |
9095d37b | 94 | /// The GCD memory space map is searched from the lowest address up\r |
1bf79370 LG |
95 | /// to the specified MaxAddress looking for unallocated memory ranges.\r |
96 | ///\r | |
959ccb23 | 97 | EfiGcdAllocateMaxAddressSearchBottomUp,\r |
1bf79370 | 98 | ///\r |
9095d37b | 99 | /// The GCD memory space map is checked to see if the memory range starting\r |
1bf79370 LG |
100 | /// at the specified Address is available.\r |
101 | ///\r | |
959ccb23 | 102 | EfiGcdAllocateAddress,\r |
1bf79370 | 103 | ///\r |
9095d37b | 104 | /// The GCD memory space map is searched from the highest address down to the lowest address\r |
1bf79370 LG |
105 | /// looking for unallocated memory ranges.\r |
106 | ///\r | |
959ccb23 | 107 | EfiGcdAllocateAnySearchTopDown,\r |
1bf79370 | 108 | ///\r |
9095d37b | 109 | /// The GCD memory space map is searched from the specified MaxAddress\r |
1bf79370 LG |
110 | /// down to the lowest address looking for unallocated memory ranges.\r |
111 | ///\r | |
959ccb23 | 112 | EfiGcdAllocateMaxAddressSearchTopDown,\r |
113 | EfiGcdMaxAllocateType\r | |
114 | } EFI_GCD_ALLOCATE_TYPE;\r | |
115 | \r | |
dc53faa3 | 116 | ///\r |
af2dc6a7 | 117 | /// EFI_GCD_MEMORY_SPACE_DESCRIPTOR.\r |
9095d37b | 118 | ///\r |
959ccb23 | 119 | typedef struct {\r |
dc53faa3 | 120 | ///\r |
121 | /// The physical address of the first byte in the memory region. Type\r | |
122 | /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function\r | |
af2dc6a7 | 123 | /// description in the UEFI 2.0 specification.\r |
9095d37b | 124 | ///\r |
2f88bd3a | 125 | EFI_PHYSICAL_ADDRESS BaseAddress;\r |
dc53faa3 | 126 | \r |
127 | ///\r | |
128 | /// The number of bytes in the memory region.\r | |
9095d37b | 129 | ///\r |
2f88bd3a | 130 | UINT64 Length;\r |
dc53faa3 | 131 | \r |
132 | ///\r | |
133 | /// The bit mask of attributes that the memory region is capable of supporting. The bit\r | |
134 | /// mask of available attributes is defined in the GetMemoryMap() function description\r | |
135 | /// in the UEFI 2.0 specification.\r | |
9095d37b | 136 | ///\r |
2f88bd3a | 137 | UINT64 Capabilities;\r |
dc53faa3 | 138 | ///\r |
139 | /// The bit mask of attributes that the memory region is currently using. The bit mask of\r | |
140 | /// available attributes is defined in GetMemoryMap().\r | |
9095d37b | 141 | ///\r |
2f88bd3a | 142 | UINT64 Attributes;\r |
dc53faa3 | 143 | ///\r |
144 | /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the\r | |
af2dc6a7 | 145 | /// AddMemorySpace() function description.\r |
9095d37b | 146 | ///\r |
2f88bd3a | 147 | EFI_GCD_MEMORY_TYPE GcdMemoryType;\r |
dc53faa3 | 148 | \r |
149 | ///\r | |
150 | /// The image handle of the agent that allocated the memory resource described by\r | |
151 | /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory\r | |
152 | /// resource is not currently allocated. Type EFI_HANDLE is defined in\r | |
153 | /// InstallProtocolInterface() in the UEFI 2.0 specification.\r | |
9095d37b | 154 | ///\r |
2f88bd3a | 155 | EFI_HANDLE ImageHandle;\r |
dc53faa3 | 156 | \r |
157 | ///\r | |
158 | /// The device handle for which the memory resource has been allocated. If\r | |
159 | /// ImageHandle is NULL, then the memory resource is not currently allocated. If this\r | |
160 | /// field is NULL, then the memory resource is not associated with a device that is\r | |
161 | /// described by a device handle. Type EFI_HANDLE is defined in\r | |
162 | /// InstallProtocolInterface() in the UEFI 2.0 specification.\r | |
9095d37b | 163 | ///\r |
2f88bd3a | 164 | EFI_HANDLE DeviceHandle;\r |
959ccb23 | 165 | } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;\r |
166 | \r | |
dc53faa3 | 167 | ///\r |
af2dc6a7 | 168 | /// EFI_GCD_IO_SPACE_DESCRIPTOR.\r |
9095d37b | 169 | ///\r |
959ccb23 | 170 | typedef struct {\r |
dc53faa3 | 171 | ///\r |
172 | /// Physical address of the first byte in the I/O region. Type\r | |
173 | /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function\r | |
174 | /// description in the UEFI 2.0 specification.\r | |
9095d37b | 175 | ///\r |
2f88bd3a | 176 | EFI_PHYSICAL_ADDRESS BaseAddress;\r |
dc53faa3 | 177 | \r |
4ba967e7 | 178 | ///\r |
dc53faa3 | 179 | /// Number of bytes in the I/O region.\r |
4ba967e7 | 180 | ///\r |
2f88bd3a | 181 | UINT64 Length;\r |
dc53faa3 | 182 | \r |
9095d37b | 183 | ///\r |
dc53faa3 | 184 | /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the\r |
185 | /// AddIoSpace() function description.\r | |
9095d37b | 186 | ///\r |
2f88bd3a | 187 | EFI_GCD_IO_TYPE GcdIoType;\r |
dc53faa3 | 188 | \r |
9095d37b | 189 | ///\r |
dc53faa3 | 190 | /// The image handle of the agent that allocated the I/O resource described by\r |
191 | /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O\r | |
192 | /// resource is not currently allocated. Type EFI_HANDLE is defined in\r | |
193 | /// InstallProtocolInterface() in the UEFI 2.0 specification.\r | |
9095d37b | 194 | ///\r |
2f88bd3a | 195 | EFI_HANDLE ImageHandle;\r |
dc53faa3 | 196 | \r |
197 | ///\r | |
198 | /// The device handle for which the I/O resource has been allocated. If ImageHandle\r | |
199 | /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then\r | |
200 | /// the I/O resource is not associated with a device that is described by a device handle.\r | |
201 | /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI\r | |
202 | /// 2.0 specification.\r | |
9095d37b | 203 | ///\r |
2f88bd3a | 204 | EFI_HANDLE DeviceHandle;\r |
959ccb23 | 205 | } EFI_GCD_IO_SPACE_DESCRIPTOR;\r |
206 | \r | |
959ccb23 | 207 | /**\r |
208 | Adds reserved memory, system memory, or memory-mapped I/O resources to the\r | |
209 | global coherency domain of the processor.\r | |
210 | \r | |
4ba967e7 | 211 | @param GcdMemoryType The type of memory resource being added.\r |
212 | @param BaseAddress The physical address that is the start address\r | |
213 | of the memory resource being added.\r | |
214 | @param Length The size, in bytes, of the memory resource that\r | |
215 | is being added.\r | |
9095d37b | 216 | @param Capabilities The bit mask of attributes that the memory\r |
4ba967e7 | 217 | resource region supports.\r |
218 | \r | |
219 | @retval EFI_SUCCESS The memory resource was added to the global\r | |
220 | coherency domain of the processor.\r | |
221 | @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.\r | |
222 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
223 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add\r | |
9095d37b | 224 | the memory resource to the global coherency\r |
4ba967e7 | 225 | domain of the processor.\r |
226 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes\r | |
9095d37b | 227 | of the memory resource range specified by\r |
4ba967e7 | 228 | BaseAddress and Length.\r |
229 | @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range\r | |
9095d37b | 230 | specified by BaseAddress and Length conflicts\r |
4ba967e7 | 231 | with a memory resource range that was previously\r |
232 | added to the global coherency domain of the processor.\r | |
233 | @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range\r | |
234 | specified by BaseAddress and Length was allocated\r | |
af2dc6a7 | 235 | in a prior call to AllocateMemorySpace().\r |
959ccb23 | 236 | \r |
237 | **/\r | |
238 | typedef\r | |
239 | EFI_STATUS\r | |
dc53faa3 | 240 | (EFIAPI *EFI_ADD_MEMORY_SPACE)(\r |
959ccb23 | 241 | IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r |
242 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
243 | IN UINT64 Length,\r | |
244 | IN UINT64 Capabilities\r | |
ed66e1bc | 245 | );\r |
959ccb23 | 246 | \r |
247 | /**\r | |
248 | Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r | |
249 | I/O resources from the global coherency domain of the processor.\r | |
250 | \r | |
4ba967e7 | 251 | @param GcdAllocateType The type of allocation to perform.\r |
252 | @param GcdMemoryType The type of memory resource being allocated.\r | |
253 | @param Alignment The log base 2 of the boundary that BaseAddress must\r | |
254 | be aligned on output. Align with 2^Alignment.\r | |
255 | @param Length The size in bytes of the memory resource range that\r | |
256 | is being allocated.\r | |
257 | @param BaseAddress A pointer to a physical address to allocate.\r | |
9095d37b | 258 | @param Imagehandle The image handle of the agent that is allocating\r |
4ba967e7 | 259 | the memory resource.\r |
260 | @param DeviceHandle The device handle for which the memory resource\r | |
261 | is being allocated.\r | |
262 | \r | |
263 | @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.\r | |
264 | @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.\r | |
265 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
266 | @retval EFI_INVALID_PARAMETER BaseAddress is NULL.\r | |
267 | @retval EFI_INVALID_PARAMETER ImageHandle is NULL.\r | |
268 | @retval EFI_NOT_FOUND The memory resource request could not be satisfied.\r | |
269 | No descriptor contains the desired space.\r | |
270 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory\r | |
271 | resource from the global coherency domain of the processor.\r | |
272 | @retval EFI_SUCCESS The memory resource was allocated from the global coherency\r | |
273 | domain of the processor.\r | |
959ccb23 | 274 | \r |
959ccb23 | 275 | \r |
276 | **/\r | |
277 | typedef\r | |
278 | EFI_STATUS\r | |
dc53faa3 | 279 | (EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)(\r |
959ccb23 | 280 | IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r |
281 | IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r | |
282 | IN UINTN Alignment,\r | |
283 | IN UINT64 Length,\r | |
284 | IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r | |
285 | IN EFI_HANDLE ImageHandle,\r | |
286 | IN EFI_HANDLE DeviceHandle OPTIONAL\r | |
ed66e1bc | 287 | );\r |
959ccb23 | 288 | \r |
289 | /**\r | |
290 | Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r | |
291 | I/O resources from the global coherency domain of the processor.\r | |
292 | \r | |
4ba967e7 | 293 | @param BaseAddress The physical address that is the start address of the memory resource being freed.\r |
294 | @param Length The size in bytes of the memory resource range that is being freed.\r | |
959ccb23 | 295 | \r |
4ba967e7 | 296 | @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of\r |
297 | the processor.\r | |
9095d37b | 298 | @retval EFI_INVALID_PARAMETER Length is zero.\r |
4ba967e7 | 299 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r |
300 | resource range specified by BaseAddress and Length.\r | |
301 | @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and\r | |
302 | Length was not allocated with previous calls to AllocateMemorySpace().\r | |
303 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource\r | |
304 | from the global coherency domain of the processor.\r | |
959ccb23 | 305 | \r |
306 | **/\r | |
307 | typedef\r | |
308 | EFI_STATUS\r | |
dc53faa3 | 309 | (EFIAPI *EFI_FREE_MEMORY_SPACE)(\r |
959ccb23 | 310 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
311 | IN UINT64 Length\r | |
ed66e1bc | 312 | );\r |
959ccb23 | 313 | \r |
314 | /**\r | |
315 | Removes reserved memory, system memory, or memory-mapped I/O resources from\r | |
316 | the global coherency domain of the processor.\r | |
317 | \r | |
4ba967e7 | 318 | @param BaseAddress The physical address that is the start address of the memory resource being removed.\r |
319 | @param Length The size in bytes of the memory resource that is being removed.\r | |
320 | \r | |
321 | @retval EFI_SUCCESS The memory resource was removed from the global coherency\r | |
322 | domain of the processor.\r | |
9095d37b | 323 | @retval EFI_INVALID_PARAMETER Length is zero.\r |
4ba967e7 | 324 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r |
325 | resource range specified by BaseAddress and Length.\r | |
326 | @retval EFI_NOT_FOUND One or more bytes of the memory resource range specified by\r | |
327 | BaseAddress and Length was not added with previous calls to\r | |
328 | AddMemorySpace().\r | |
329 | @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by\r | |
330 | BaseAddress and Length has been allocated with AllocateMemorySpace().\r | |
331 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory\r | |
332 | resource from the global coherency domain of the processor.\r | |
959ccb23 | 333 | \r |
334 | **/\r | |
335 | typedef\r | |
336 | EFI_STATUS\r | |
dc53faa3 | 337 | (EFIAPI *EFI_REMOVE_MEMORY_SPACE)(\r |
959ccb23 | 338 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
339 | IN UINT64 Length\r | |
ed66e1bc | 340 | );\r |
959ccb23 | 341 | \r |
342 | /**\r | |
343 | Retrieves the descriptor for a memory region containing a specified address.\r | |
344 | \r | |
4ba967e7 | 345 | @param BaseAddress The physical address that is the start address of a memory region.\r |
346 | @param Descriptor A pointer to a caller allocated descriptor.\r | |
959ccb23 | 347 | \r |
4ba967e7 | 348 | @retval EFI_SUCCESS The descriptor for the memory resource region containing\r |
349 | BaseAddress was returned in Descriptor.\r | |
350 | @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r | |
351 | @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found.\r | |
959ccb23 | 352 | \r |
353 | **/\r | |
354 | typedef\r | |
355 | EFI_STATUS\r | |
dc53faa3 | 356 | (EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)(\r |
959ccb23 | 357 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
358 | OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r | |
ed66e1bc | 359 | );\r |
959ccb23 | 360 | \r |
361 | /**\r | |
362 | Modifies the attributes for a memory region in the global coherency domain of the\r | |
363 | processor.\r | |
364 | \r | |
4ba967e7 | 365 | @param BaseAddress The physical address that is the start address of a memory region.\r |
366 | @param Length The size in bytes of the memory region.\r | |
367 | @param Attributes The bit mask of attributes to set for the memory region.\r | |
368 | \r | |
369 | @retval EFI_SUCCESS The attributes were set for the memory region.\r | |
9095d37b | 370 | @retval EFI_INVALID_PARAMETER Length is zero.\r |
4ba967e7 | 371 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory\r |
372 | resource range specified by BaseAddress and Length.\r | |
373 | @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource\r | |
374 | range specified by BaseAddress and Length.\r | |
771ee501 | 375 | @retval EFI_ACCESS_DENIED The attributes for the memory resource range specified by\r |
4ba967e7 | 376 | BaseAddress and Length cannot be modified.\r |
377 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of\r | |
378 | the memory resource range.\r | |
714eecd4 | 379 | @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is\r |
380 | not available yet.\r | |
959ccb23 | 381 | **/\r |
382 | typedef\r | |
959ccb23 | 383 | EFI_STATUS\r |
dc53faa3 | 384 | (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)(\r |
959ccb23 | 385 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
386 | IN UINT64 Length,\r | |
387 | IN UINT64 Attributes\r | |
ed66e1bc | 388 | );\r |
959ccb23 | 389 | \r |
771ee501 EC |
390 | /**\r |
391 | Modifies the capabilities for a memory region in the global coherency domain of the\r | |
392 | processor.\r | |
393 | \r | |
394 | @param BaseAddress The physical address that is the start address of a memory region.\r | |
395 | @param Length The size in bytes of the memory region.\r | |
396 | @param Capabilities The bit mask of capabilities that the memory region supports.\r | |
397 | \r | |
398 | @retval EFI_SUCCESS The capabilities were set for the memory region.\r | |
399 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
400 | @retval EFI_UNSUPPORTED The capabilities specified by Capabilities do not include the\r | |
401 | memory region attributes currently in use.\r | |
402 | @retval EFI_ACCESS_DENIED The capabilities for the memory resource range specified by\r | |
403 | BaseAddress and Length cannot be modified.\r | |
404 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the capabilities\r | |
405 | of the memory resource range.\r | |
406 | **/\r | |
407 | typedef\r | |
408 | EFI_STATUS\r | |
2f88bd3a | 409 | (EFIAPI *EFI_SET_MEMORY_SPACE_CAPABILITIES)(\r |
771ee501 EC |
410 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
411 | IN UINT64 Length,\r | |
412 | IN UINT64 Capabilities\r | |
413 | );\r | |
414 | \r | |
959ccb23 | 415 | /**\r |
416 | Returns a map of the memory resources in the global coherency domain of the\r | |
417 | processor.\r | |
418 | \r | |
4ba967e7 | 419 | @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.\r |
420 | @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.\r | |
959ccb23 | 421 | \r |
4ba967e7 | 422 | @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap\r |
423 | buffer, and the number of descriptors in MemorySpaceMap was\r | |
424 | returned in NumberOfDescriptors.\r | |
425 | @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.\r | |
426 | @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.\r | |
427 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap.\r | |
959ccb23 | 428 | \r |
429 | **/\r | |
430 | typedef\r | |
431 | EFI_STATUS\r | |
dc53faa3 | 432 | (EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(\r |
959ccb23 | 433 | OUT UINTN *NumberOfDescriptors,\r |
434 | OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r | |
ed66e1bc | 435 | );\r |
959ccb23 | 436 | \r |
437 | /**\r | |
438 | Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r | |
439 | \r | |
4ba967e7 | 440 | @param GcdIoType The type of I/O resource being added.\r |
441 | @param BaseAddress The physical address that is the start address of the I/O resource being added.\r | |
442 | @param Length The size in bytes of the I/O resource that is being added.\r | |
443 | \r | |
444 | @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of\r | |
445 | the processor.\r | |
446 | @retval EFI_INVALID_PARAMETER GcdIoType is invalid.\r | |
447 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
448 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to\r | |
449 | the global coherency domain of the processor.\r | |
450 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O\r | |
451 | resource range specified by BaseAddress and Length.\r | |
452 | @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by\r | |
453 | BaseAddress and Length conflicts with an I/O resource\r | |
454 | range that was previously added to the global coherency domain\r | |
455 | of the processor.\r | |
456 | @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by\r | |
457 | BaseAddress and Length was allocated in a prior call to\r | |
458 | AllocateIoSpace().\r | |
959ccb23 | 459 | \r |
460 | **/\r | |
461 | typedef\r | |
462 | EFI_STATUS\r | |
dc53faa3 | 463 | (EFIAPI *EFI_ADD_IO_SPACE)(\r |
959ccb23 | 464 | IN EFI_GCD_IO_TYPE GcdIoType,\r |
465 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r | |
466 | IN UINT64 Length\r | |
ed66e1bc | 467 | );\r |
959ccb23 | 468 | \r |
469 | /**\r | |
470 | Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r | |
471 | domain of the processor.\r | |
472 | \r | |
4ba967e7 | 473 | @param GcdAllocateType The type of allocation to perform.\r |
474 | @param GcdIoType The type of I/O resource being allocated.\r | |
475 | @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output.\r | |
476 | @param Length The size in bytes of the I/O resource range that is being allocated.\r | |
477 | @param BaseAddress A pointer to a physical address.\r | |
478 | @param Imagehandle The image handle of the agent that is allocating the I/O resource.\r | |
479 | @param DeviceHandle The device handle for which the I/O resource is being allocated.\r | |
480 | \r | |
481 | @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain\r | |
482 | of the processor.\r | |
483 | @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.\r | |
484 | @retval EFI_INVALID_PARAMETER GcdIoType is invalid.\r | |
485 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
486 | @retval EFI_INVALID_PARAMETER BaseAddress is NULL.\r | |
487 | @retval EFI_INVALID_PARAMETER ImageHandle is NULL.\r | |
488 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O\r | |
489 | resource from the global coherency domain of the processor.\r | |
490 | @retval EFI_NOT_FOUND The I/O resource request could not be satisfied.\r | |
959ccb23 | 491 | \r |
492 | **/\r | |
493 | typedef\r | |
494 | EFI_STATUS\r | |
dc53faa3 | 495 | (EFIAPI *EFI_ALLOCATE_IO_SPACE)(\r |
959ccb23 | 496 | IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r |
497 | IN EFI_GCD_IO_TYPE GcdIoType,\r | |
498 | IN UINTN Alignment,\r | |
499 | IN UINT64 Length,\r | |
500 | IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r | |
501 | IN EFI_HANDLE ImageHandle,\r | |
502 | IN EFI_HANDLE DeviceHandle OPTIONAL\r | |
ed66e1bc | 503 | );\r |
959ccb23 | 504 | \r |
505 | /**\r | |
506 | Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r | |
507 | domain of the processor.\r | |
508 | \r | |
4ba967e7 | 509 | @param BaseAddress The physical address that is the start address of the I/O resource being freed.\r |
510 | @param Length The size in bytes of the I/O resource range that is being freed.\r | |
959ccb23 | 511 | \r |
4ba967e7 | 512 | @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the\r |
513 | processor.\r | |
514 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
515 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource\r | |
516 | range specified by BaseAddress and Length.\r | |
517 | @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length\r | |
518 | was not allocated with previous calls to AllocateIoSpace().\r | |
519 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from\r | |
520 | the global coherency domain of the processor.\r | |
959ccb23 | 521 | \r |
522 | **/\r | |
523 | typedef\r | |
524 | EFI_STATUS\r | |
dc53faa3 | 525 | (EFIAPI *EFI_FREE_IO_SPACE)(\r |
959ccb23 | 526 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
527 | IN UINT64 Length\r | |
ed66e1bc | 528 | );\r |
959ccb23 | 529 | \r |
530 | /**\r | |
531 | Removes reserved I/O or I/O resources from the global coherency domain of the\r | |
532 | processor.\r | |
533 | \r | |
4ba967e7 | 534 | @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being\r |
535 | removed.\r | |
536 | @param Length The size in bytes of the I/O resource that is being removed.\r | |
537 | \r | |
538 | @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain\r | |
539 | of the processor.\r | |
540 | @retval EFI_INVALID_PARAMETER Length is zero.\r | |
541 | @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O\r | |
542 | resource range specified by BaseAddress and Length.\r | |
543 | @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by\r | |
544 | BaseAddress and Length was not added with previous\r | |
545 | calls to AddIoSpace().\r | |
546 | @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by\r | |
547 | BaseAddress and Length has been allocated with\r | |
548 | AllocateIoSpace().\r | |
549 | @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O\r | |
550 | resource from the global coherency domain of the processor.\r | |
959ccb23 | 551 | \r |
552 | **/\r | |
553 | typedef\r | |
554 | EFI_STATUS\r | |
dc53faa3 | 555 | (EFIAPI *EFI_REMOVE_IO_SPACE)(\r |
959ccb23 | 556 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
557 | IN UINT64 Length\r | |
ed66e1bc | 558 | );\r |
959ccb23 | 559 | \r |
560 | /**\r | |
561 | Retrieves the descriptor for an I/O region containing a specified address.\r | |
562 | \r | |
4ba967e7 | 563 | @param BaseAddress The physical address that is the start address of an I/O region.\r |
564 | @param Descriptor A pointer to a caller allocated descriptor.\r | |
959ccb23 | 565 | \r |
4ba967e7 | 566 | @retval EFI_SUCCESS The descriptor for the I/O resource region containing\r |
567 | BaseAddress was returned in Descriptor.\r | |
959ccb23 | 568 | @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r |
4ba967e7 | 569 | @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found.\r |
959ccb23 | 570 | \r |
571 | **/\r | |
572 | typedef\r | |
573 | EFI_STATUS\r | |
dc53faa3 | 574 | (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(\r |
959ccb23 | 575 | IN EFI_PHYSICAL_ADDRESS BaseAddress,\r |
576 | OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r | |
ed66e1bc | 577 | );\r |
959ccb23 | 578 | \r |
579 | /**\r | |
580 | Returns a map of the I/O resources in the global coherency domain of the processor.\r | |
581 | \r | |
4ba967e7 | 582 | @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.\r |
583 | @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.\r | |
584 | \r | |
585 | @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and\r | |
586 | the number of descriptors in IoSpaceMap was returned in\r | |
587 | NumberOfDescriptors.\r | |
588 | @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.\r | |
589 | @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.\r | |
590 | @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap.\r | |
959ccb23 | 591 | \r |
959ccb23 | 592 | \r |
593 | **/\r | |
594 | typedef\r | |
595 | EFI_STATUS\r | |
dc53faa3 | 596 | (EFIAPI *EFI_GET_IO_SPACE_MAP)(\r |
959ccb23 | 597 | OUT UINTN *NumberOfDescriptors,\r |
598 | OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r | |
ed66e1bc | 599 | );\r |
959ccb23 | 600 | \r |
959ccb23 | 601 | /**\r |
602 | Loads and executed DXE drivers from firmware volumes.\r | |
603 | \r | |
9095d37b LG |
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 | |
4ba967e7 | 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 | |
617 | typedef\r | |
618 | EFI_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 | |
634 | typedef\r | |
635 | EFI_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 | |
652 | typedef\r | |
653 | EFI_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 | |
9095d37b | 673 | EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL\r |
4ba967e7 | 674 | for the firmware volume described by FirmwareVolumeHeader and Size.\r |
959ccb23 | 675 | \r |
676 | **/\r | |
677 | typedef\r | |
678 | EFI_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 | |
93ddc0d1 | 690 | #define DXE_SPECIFICATION_MINOR_REVISION 70\r |
53e6937c | 691 | #define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION))\r |
959ccb23 | 692 | \r |
693 | typedef 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 | |
2f88bd3a | 698 | EFI_TABLE_HEADER Hdr;\r |
959ccb23 | 699 | \r |
700 | //\r | |
701 | // Global Coherency Domain Services\r | |
702 | //\r | |
2f88bd3a MK |
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 | |
959ccb23 | 716 | \r |
717 | //\r | |
718 | // Dispatcher Services\r | |
719 | //\r | |
2f88bd3a MK |
720 | EFI_DISPATCH Dispatch;\r |
721 | EFI_SCHEDULE Schedule;\r | |
722 | EFI_TRUST Trust;\r | |
959ccb23 | 723 | //\r |
724 | // Service to process a single firmware volume found in a capsule\r | |
725 | //\r | |
2f88bd3a | 726 | EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;\r |
771ee501 EC |
727 | //\r |
728 | // Extensions to Global Coherency Domain Services\r | |
729 | //\r | |
2f88bd3a | 730 | EFI_SET_MEMORY_SPACE_CAPABILITIES SetMemorySpaceCapabilities;\r |
959ccb23 | 731 | } DXE_SERVICES;\r |
732 | \r | |
733 | typedef DXE_SERVICES EFI_DXE_SERVICES;\r | |
734 | \r | |
735 | #endif\r |