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