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