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