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