iPXE
PiDxeCis.h
Go to the documentation of this file.
00001 /** @file
00002   Include file matches things in PI.
00003 
00004 Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
00005 This program and the accompanying materials are licensed and made available under
00006 the terms and conditions of the BSD License that accompanies this distribution.
00007 The full text of the license may be found at
00008 http://opensource.org/licenses/bsd-license.php.
00009 
00010 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
00011 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
00012 
00013   @par Revision Reference:
00014   PI Version 1.4
00015 
00016 **/
00017 
00018 #ifndef __PI_DXECIS_H__
00019 #define __PI_DXECIS_H__
00020 
00021 FILE_LICENCE ( BSD3 );
00022 
00023 #include <ipxe/efi/Uefi/UefiMultiPhase.h>
00024 #include <ipxe/efi/Pi/PiMultiPhase.h>
00025 
00026 ///
00027 /// Global Coherencey Domain types - Memory type.
00028 ///
00029 typedef enum {
00030   ///
00031   /// A memory region that is visible to the boot processor. However, there are no system
00032   /// components that are currently decoding this memory region.
00033   ///
00034   EfiGcdMemoryTypeNonExistent,
00035   ///
00036   /// A memory region that is visible to the boot processor. This memory region is being
00037   /// decoded by a system component, but the memory region is not considered to be either
00038   /// system memory or memory-mapped I/O.
00039   ///
00040   EfiGcdMemoryTypeReserved,
00041   ///
00042   /// A memory region that is visible to the boot processor. A memory controller is
00043   /// currently decoding this memory region and the memory controller is producing a
00044   /// tested system memory region that is available to the memory services.
00045   ///
00046   EfiGcdMemoryTypeSystemMemory,
00047   ///
00048   /// A memory region that is visible to the boot processor. This memory region is
00049   /// currently being decoded by a component as memory-mapped I/O that can be used to
00050   /// access I/O devices in the platform.
00051   ///
00052   EfiGcdMemoryTypeMemoryMappedIo,
00053   ///
00054   /// A memory region that is visible to the boot processor.
00055   /// This memory supports byte-addressable non-volatility.
00056   ///
00057   EfiGcdMemoryTypePersistentMemory,
00058   ///
00059   /// A memory region that provides higher reliability relative to other memory in the
00060   /// system. If all memory has the same reliability, then this bit is not used.
00061   ///
00062   EfiGcdMemoryTypeMoreReliable,
00063   EfiGcdMemoryTypeMaximum
00064 } EFI_GCD_MEMORY_TYPE;
00065 
00066 ///
00067 /// Global Coherencey Domain types - IO type.
00068 ///
00069 typedef enum {
00070   ///
00071   /// An I/O region that is visible to the boot processor. However, there are no system
00072   /// components that are currently decoding this I/O region.
00073   ///
00074   EfiGcdIoTypeNonExistent,
00075   ///
00076   /// An I/O region that is visible to the boot processor. This I/O region is currently being
00077   /// decoded by a system component, but the I/O region cannot be used to access I/O devices.
00078   ///
00079   EfiGcdIoTypeReserved,
00080   ///
00081   /// An I/O region that is visible to the boot processor. This I/O region is currently being
00082   /// decoded by a system component that is producing I/O ports that can be used to access I/O devices.
00083   ///
00084   EfiGcdIoTypeIo,
00085   EfiGcdIoTypeMaximum
00086 } EFI_GCD_IO_TYPE;
00087 
00088 ///
00089 /// The type of allocation to perform.
00090 ///
00091 typedef enum {
00092   ///
00093   /// The GCD memory space map is searched from the lowest address up to the highest address
00094   /// looking for unallocated memory ranges.
00095   ///
00096   EfiGcdAllocateAnySearchBottomUp,
00097   ///
00098   /// The GCD memory space map is searched from the lowest address up
00099   /// to the specified MaxAddress looking for unallocated memory ranges.
00100   ///
00101   EfiGcdAllocateMaxAddressSearchBottomUp,
00102   ///
00103   /// The GCD memory space map is checked to see if the memory range starting
00104   /// at the specified Address is available.
00105   ///
00106   EfiGcdAllocateAddress,
00107   ///
00108   /// The GCD memory space map is searched from the highest address down to the lowest address
00109   /// looking for unallocated memory ranges.
00110   ///
00111   EfiGcdAllocateAnySearchTopDown,
00112   ///
00113   /// The GCD memory space map is searched from the specified MaxAddress
00114   /// down to the lowest address looking for unallocated memory ranges.
00115   ///
00116   EfiGcdAllocateMaxAddressSearchTopDown,
00117   EfiGcdMaxAllocateType
00118 } EFI_GCD_ALLOCATE_TYPE;
00119 
00120 ///
00121 /// EFI_GCD_MEMORY_SPACE_DESCRIPTOR.
00122 ///
00123 typedef struct {
00124   ///
00125   /// The physical address of the first byte in the memory region. Type
00126   /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
00127   /// description in the UEFI 2.0 specification.
00128   ///
00129   EFI_PHYSICAL_ADDRESS  BaseAddress;
00130 
00131   ///
00132   /// The number of bytes in the memory region.
00133   ///
00134   UINT64                Length;
00135 
00136   ///
00137   /// The bit mask of attributes that the memory region is capable of supporting. The bit
00138   /// mask of available attributes is defined in the GetMemoryMap() function description
00139   /// in the UEFI 2.0 specification.
00140   ///
00141   UINT64                Capabilities;
00142   ///
00143   /// The bit mask of attributes that the memory region is currently using. The bit mask of
00144   /// available attributes is defined in GetMemoryMap().
00145   ///
00146   UINT64                Attributes;
00147   ///
00148   /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the
00149   /// AddMemorySpace() function description.
00150   ///
00151   EFI_GCD_MEMORY_TYPE   GcdMemoryType;
00152 
00153   ///
00154   /// The image handle of the agent that allocated the memory resource described by
00155   /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory
00156   /// resource is not currently allocated. Type EFI_HANDLE is defined in
00157   /// InstallProtocolInterface() in the UEFI 2.0 specification.
00158   ///
00159   EFI_HANDLE            ImageHandle;
00160 
00161   ///
00162   /// The device handle for which the memory resource has been allocated. If
00163   /// ImageHandle is NULL, then the memory resource is not currently allocated. If this
00164   /// field is NULL, then the memory resource is not associated with a device that is
00165   /// described by a device handle. Type EFI_HANDLE is defined in
00166   /// InstallProtocolInterface() in the UEFI 2.0 specification.
00167   ///
00168   EFI_HANDLE            DeviceHandle;
00169 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
00170 
00171 ///
00172 /// EFI_GCD_IO_SPACE_DESCRIPTOR.
00173 ///
00174 typedef struct {
00175   ///
00176   /// Physical address of the first byte in the I/O region. Type
00177   /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
00178   /// description in the UEFI 2.0 specification.
00179   ///
00180   EFI_PHYSICAL_ADDRESS  BaseAddress;
00181 
00182   ///
00183   /// Number of bytes in the I/O region.
00184   ///
00185   UINT64                Length;
00186 
00187   ///
00188   /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the
00189   /// AddIoSpace() function description.
00190   ///
00191   EFI_GCD_IO_TYPE       GcdIoType;
00192 
00193   ///
00194   /// The image handle of the agent that allocated the I/O resource described by
00195   /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O
00196   /// resource is not currently allocated. Type EFI_HANDLE is defined in
00197   /// InstallProtocolInterface() in the UEFI 2.0 specification.
00198   ///
00199   EFI_HANDLE            ImageHandle;
00200 
00201   ///
00202   /// The device handle for which the I/O resource has been allocated. If ImageHandle
00203   /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then
00204   /// the I/O resource is not associated with a device that is described by a device handle.
00205   /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI
00206   /// 2.0 specification.
00207   ///
00208   EFI_HANDLE            DeviceHandle;
00209 } EFI_GCD_IO_SPACE_DESCRIPTOR;
00210 
00211 
00212 /**
00213   Adds reserved memory, system memory, or memory-mapped I/O resources to the
00214   global coherency domain of the processor.
00215 
00216   @param  GcdMemoryType    The type of memory resource being added.
00217   @param  BaseAddress      The physical address that is the start address
00218                            of the memory resource being added.
00219   @param  Length           The size, in bytes, of the memory resource that
00220                            is being added.
00221   @param  Capabilities     The bit mask of attributes that the memory
00222                            resource region supports.
00223 
00224   @retval EFI_SUCCESS            The memory resource was added to the global
00225                                  coherency domain of the processor.
00226   @retval EFI_INVALID_PARAMETER  GcdMemoryType is invalid.
00227   @retval EFI_INVALID_PARAMETER  Length is zero.
00228   @retval EFI_OUT_OF_RESOURCES   There are not enough system resources to add
00229                                  the memory resource to the global coherency
00230                                  domain of the processor.
00231   @retval EFI_UNSUPPORTED        The processor does not support one or more bytes
00232                                  of the memory resource range specified by
00233                                  BaseAddress and Length.
00234   @retval EFI_ACCESS_DENIED      One or more bytes of the memory resource range
00235                                  specified by BaseAddress and Length conflicts
00236                                  with a memory resource range that was previously
00237                                  added to the global coherency domain of the processor.
00238   @retval EFI_ACCESS_DENIED      One or more bytes of the memory resource range
00239                                  specified by BaseAddress and Length was allocated
00240                                  in a prior call to AllocateMemorySpace().
00241 
00242 **/
00243 typedef
00244 EFI_STATUS
00245 (EFIAPI *EFI_ADD_MEMORY_SPACE)(
00246   IN EFI_GCD_MEMORY_TYPE   GcdMemoryType,
00247   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00248   IN UINT64                Length,
00249   IN UINT64                Capabilities
00250   );
00251 
00252 /**
00253   Allocates nonexistent memory, reserved memory, system memory, or memorymapped
00254   I/O resources from the global coherency domain of the processor.
00255 
00256   @param  GcdAllocateType  The type of allocation to perform.
00257   @param  GcdMemoryType    The type of memory resource being allocated.
00258   @param  Alignment        The log base 2 of the boundary that BaseAddress must
00259                            be aligned on output. Align with 2^Alignment.
00260   @param  Length           The size in bytes of the memory resource range that
00261                            is being allocated.
00262   @param  BaseAddress      A pointer to a physical address to allocate.
00263   @param  Imagehandle      The image handle of the agent that is allocating
00264                            the memory resource.
00265   @param  DeviceHandle     The device handle for which the memory resource
00266                            is being allocated.
00267 
00268   @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
00269   @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
00270   @retval EFI_INVALID_PARAMETER Length is zero.
00271   @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
00272   @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
00273   @retval EFI_NOT_FOUND         The memory resource request could not be satisfied.
00274                                 No descriptor contains the desired space.
00275   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to allocate the memory
00276                                 resource from the global coherency domain of the processor.
00277   @retval EFI_SUCCESS           The memory resource was allocated from the global coherency
00278                                 domain of the processor.
00279 
00280 
00281 **/
00282 typedef
00283 EFI_STATUS
00284 (EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)(
00285   IN     EFI_GCD_ALLOCATE_TYPE               GcdAllocateType,
00286   IN     EFI_GCD_MEMORY_TYPE                 GcdMemoryType,
00287   IN     UINTN                               Alignment,
00288   IN     UINT64                              Length,
00289   IN OUT EFI_PHYSICAL_ADDRESS                *BaseAddress,
00290   IN     EFI_HANDLE                          ImageHandle,
00291   IN     EFI_HANDLE                          DeviceHandle OPTIONAL
00292   );
00293 
00294 /**
00295   Frees nonexistent memory, reserved memory, system memory, or memory-mapped
00296   I/O resources from the global coherency domain of the processor.
00297 
00298   @param  BaseAddress      The physical address that is the start address of the memory resource being freed.
00299   @param  Length           The size in bytes of the memory resource range that is being freed.
00300 
00301   @retval EFI_SUCCESS           The memory resource was freed from the global coherency domain of
00302                                 the processor.
00303   @retval EFI_INVALID_PARAMETER Length is zero.
00304   @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the memory
00305                                 resource range specified by BaseAddress and Length.
00306   @retval EFI_NOT_FOUND         The memory resource range specified by BaseAddress and
00307                                 Length was not allocated with previous calls to AllocateMemorySpace().
00308   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to free the memory resource
00309                                 from the global coherency domain of the processor.
00310 
00311 **/
00312 typedef
00313 EFI_STATUS
00314 (EFIAPI *EFI_FREE_MEMORY_SPACE)(
00315   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00316   IN UINT64                Length
00317   );
00318 
00319 /**
00320   Removes reserved memory, system memory, or memory-mapped I/O resources from
00321   the global coherency domain of the processor.
00322 
00323   @param  BaseAddress      The physical address that is the start address of the memory resource being removed.
00324   @param  Length           The size in bytes of the memory resource that is being removed.
00325 
00326   @retval EFI_SUCCESS           The memory resource was removed from the global coherency
00327                                 domain of the processor.
00328   @retval EFI_INVALID_PARAMETER Length is zero.
00329   @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the memory
00330                                 resource range specified by BaseAddress and Length.
00331   @retval EFI_NOT_FOUND         One or more bytes of the memory resource range specified by
00332                                 BaseAddress and Length was not added with previous calls to
00333                                 AddMemorySpace().
00334   @retval EFI_ACCESS_DEFINED    One or more bytes of the memory resource range specified by
00335                                 BaseAddress and Length has been allocated with AllocateMemorySpace().
00336   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to remove the memory
00337                                 resource from the global coherency domain of the processor.
00338 
00339 **/
00340 typedef
00341 EFI_STATUS
00342 (EFIAPI *EFI_REMOVE_MEMORY_SPACE)(
00343   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00344   IN UINT64                Length
00345   );
00346 
00347 /**
00348   Retrieves the descriptor for a memory region containing a specified address.
00349 
00350   @param  BaseAddress      The physical address that is the start address of a memory region.
00351   @param  Descriptor       A pointer to a caller allocated descriptor.
00352 
00353   @retval EFI_SUCCESS           The descriptor for the memory resource region containing
00354                                 BaseAddress was returned in Descriptor.
00355   @retval EFI_INVALID_PARAMETER Descriptor is NULL.
00356   @retval EFI_NOT_FOUND         A memory resource range containing BaseAddress was not found.
00357 
00358 **/
00359 typedef
00360 EFI_STATUS
00361 (EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)(
00362   IN  EFI_PHYSICAL_ADDRESS             BaseAddress,
00363   OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  *Descriptor
00364   );
00365 
00366 /**
00367   Modifies the attributes for a memory region in the global coherency domain of the
00368   processor.
00369 
00370   @param  BaseAddress      The physical address that is the start address of a memory region.
00371   @param  Length           The size in bytes of the memory region.
00372   @param  Attributes       The bit mask of attributes to set for the memory region.
00373 
00374   @retval EFI_SUCCESS           The attributes were set for the memory region.
00375   @retval EFI_INVALID_PARAMETER Length is zero.
00376   @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the memory
00377                                 resource range specified by BaseAddress and Length.
00378   @retval EFI_UNSUPPORTED       The bit mask of attributes is not support for the memory resource
00379                                 range specified by BaseAddress and Length.
00380   @retval EFI_ACCESS_DENIED     The attributes for the memory resource range specified by
00381                                 BaseAddress and Length cannot be modified.
00382   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the attributes of
00383                                 the memory resource range.
00384   @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is
00385                                 not available yet.
00386 **/
00387 typedef
00388 EFI_STATUS
00389 (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)(
00390   IN EFI_PHYSICAL_ADDRESS         BaseAddress,
00391   IN UINT64                       Length,
00392   IN UINT64                       Attributes
00393   );
00394 
00395 /**
00396   Modifies the capabilities for a memory region in the global coherency domain of the
00397   processor.
00398 
00399   @param  BaseAddress      The physical address that is the start address of a memory region.
00400   @param  Length           The size in bytes of the memory region.
00401   @param  Capabilities     The bit mask of capabilities that the memory region supports.
00402 
00403   @retval EFI_SUCCESS           The capabilities were set for the memory region.
00404   @retval EFI_INVALID_PARAMETER Length is zero.
00405   @retval EFI_UNSUPPORTED       The capabilities specified by Capabilities do not include the
00406                                 memory region attributes currently in use.
00407   @retval EFI_ACCESS_DENIED     The capabilities for the memory resource range specified by
00408                                 BaseAddress and Length cannot be modified.
00409   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to modify the capabilities
00410                                 of the memory resource range.
00411 **/
00412 typedef
00413 EFI_STATUS
00414 (EFIAPI *EFI_SET_MEMORY_SPACE_CAPABILITIES) (
00415   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00416   IN UINT64                Length,
00417   IN UINT64                Capabilities
00418   );
00419 
00420 /**
00421   Returns a map of the memory resources in the global coherency domain of the
00422   processor.
00423 
00424   @param  NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.
00425   @param  MemorySpaceMap      A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.
00426 
00427   @retval EFI_SUCCESS           The memory space map was returned in the MemorySpaceMap
00428                                 buffer, and the number of descriptors in MemorySpaceMap was
00429                                 returned in NumberOfDescriptors.
00430   @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
00431   @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.
00432   @retval EFI_OUT_OF_RESOURCES  There are not enough resources to allocate MemorySpaceMap.
00433 
00434 **/
00435 typedef
00436 EFI_STATUS
00437 (EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(
00438   OUT UINTN                            *NumberOfDescriptors,
00439   OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR  **MemorySpaceMap
00440   );
00441 
00442 /**
00443   Adds reserved I/O or I/O resources to the global coherency domain of the processor.
00444 
00445   @param  GcdIoType        The type of I/O resource being added.
00446   @param  BaseAddress      The physical address that is the start address of the I/O resource being added.
00447   @param  Length           The size in bytes of the I/O resource that is being added.
00448 
00449   @retval EFI_SUCCESS           The I/O resource was added to the global coherency domain of
00450                                 the processor.
00451   @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
00452   @retval EFI_INVALID_PARAMETER Length is zero.
00453   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to add the I/O resource to
00454                                 the global coherency domain of the processor.
00455   @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the I/O
00456                                 resource range specified by BaseAddress and Length.
00457   @retval EFI_ACCESS_DENIED     One or more bytes of the I/O resource range specified by
00458                                 BaseAddress and Length conflicts with an I/O resource
00459                                 range that was previously added to the global coherency domain
00460                                 of the processor.
00461   @retval EFI_ACCESS_DENIED     One or more bytes of the I/O resource range specified by
00462                                 BaseAddress and Length was allocated in a prior call to
00463                                 AllocateIoSpace().
00464 
00465 **/
00466 typedef
00467 EFI_STATUS
00468 (EFIAPI *EFI_ADD_IO_SPACE)(
00469   IN EFI_GCD_IO_TYPE       GcdIoType,
00470   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00471   IN UINT64                Length
00472   );
00473 
00474 /**
00475   Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
00476   domain of the processor.
00477 
00478   @param  GcdAllocateType  The type of allocation to perform.
00479   @param  GcdIoType        The type of I/O resource being allocated.
00480   @param  Alignment        The log base 2 of the boundary that BaseAddress must be aligned on output.
00481   @param  Length           The size in bytes of the I/O resource range that is being allocated.
00482   @param  BaseAddress      A pointer to a physical address.
00483   @param  Imagehandle      The image handle of the agent that is allocating the I/O resource.
00484   @param  DeviceHandle     The device handle for which the I/O resource is being allocated.
00485 
00486   @retval EFI_SUCCESS           The I/O resource was allocated from the global coherency domain
00487                                 of the processor.
00488   @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
00489   @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
00490   @retval EFI_INVALID_PARAMETER Length is zero.
00491   @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
00492   @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
00493   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to allocate the I/O
00494                                 resource from the global coherency domain of the processor.
00495   @retval EFI_NOT_FOUND         The I/O resource request could not be satisfied.
00496 
00497 **/
00498 typedef
00499 EFI_STATUS
00500 (EFIAPI *EFI_ALLOCATE_IO_SPACE)(
00501   IN     EFI_GCD_ALLOCATE_TYPE               GcdAllocateType,
00502   IN     EFI_GCD_IO_TYPE                     GcdIoType,
00503   IN     UINTN                               Alignment,
00504   IN     UINT64                              Length,
00505   IN OUT EFI_PHYSICAL_ADDRESS                *BaseAddress,
00506   IN     EFI_HANDLE                          ImageHandle,
00507   IN     EFI_HANDLE                          DeviceHandle OPTIONAL
00508   );
00509 
00510 /**
00511   Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
00512   domain of the processor.
00513 
00514   @param  BaseAddress      The physical address that is the start address of the I/O resource being freed.
00515   @param  Length           The size in bytes of the I/O resource range that is being freed.
00516 
00517   @retval EFI_SUCCESS           The I/O resource was freed from the global coherency domain of the
00518                                 processor.
00519   @retval EFI_INVALID_PARAMETER Length is zero.
00520   @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the I/O resource
00521                                 range specified by BaseAddress and Length.
00522   @retval EFI_NOT_FOUND         The I/O resource range specified by BaseAddress and Length
00523                                 was not allocated with previous calls to AllocateIoSpace().
00524   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to free the I/O resource from
00525                                 the global coherency domain of the processor.
00526 
00527 **/
00528 typedef
00529 EFI_STATUS
00530 (EFIAPI *EFI_FREE_IO_SPACE)(
00531   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00532   IN UINT64                Length
00533   );
00534 
00535 /**
00536   Removes reserved I/O or I/O resources from the global coherency domain of the
00537   processor.
00538 
00539   @param  BaseAddress      A pointer to a physical address that is the start address of the I/O resource being
00540                            removed.
00541   @param Length            The size in bytes of the I/O resource that is being removed.
00542 
00543   @retval EFI_SUCCESS           The I/O resource was removed from the global coherency domain
00544                                 of the processor.
00545   @retval EFI_INVALID_PARAMETER Length is zero.
00546   @retval EFI_UNSUPPORTED       The processor does not support one or more bytes of the I/O
00547                                 resource range specified by BaseAddress and Length.
00548   @retval EFI_NOT_FOUND         One or more bytes of the I/O resource range specified by
00549                                 BaseAddress and Length was not added with previous
00550                                 calls to AddIoSpace().
00551   @retval EFI_ACCESS_DENIED     One or more bytes of the I/O resource range specified by
00552                                 BaseAddress and Length has been allocated with
00553                                 AllocateIoSpace().
00554   @retval EFI_OUT_OF_RESOURCES  There are not enough system resources to remove the I/O
00555                                 resource from the global coherency domain of the processor.
00556 
00557 **/
00558 typedef
00559 EFI_STATUS
00560 (EFIAPI *EFI_REMOVE_IO_SPACE)(
00561   IN EFI_PHYSICAL_ADDRESS  BaseAddress,
00562   IN UINT64                Length
00563   );
00564 
00565 /**
00566   Retrieves the descriptor for an I/O region containing a specified address.
00567 
00568   @param  BaseAddress      The physical address that is the start address of an I/O region.
00569   @param  Descriptor       A pointer to a caller allocated descriptor.
00570 
00571   @retval EFI_SUCCESS           The descriptor for the I/O resource region containing
00572                                 BaseAddress was returned in Descriptor.
00573   @retval EFI_INVALID_PARAMETER Descriptor is NULL.
00574   @retval EFI_NOT_FOUND         An I/O resource range containing BaseAddress was not found.
00575 
00576 **/
00577 typedef
00578 EFI_STATUS
00579 (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(
00580   IN  EFI_PHYSICAL_ADDRESS         BaseAddress,
00581   OUT EFI_GCD_IO_SPACE_DESCRIPTOR  *Descriptor
00582   );
00583 
00584 /**
00585   Returns a map of the I/O resources in the global coherency domain of the processor.
00586 
00587   @param  NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.
00588   @param  MemorySpaceMap      A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.
00589 
00590   @retval EFI_SUCCESS           The I/O space map was returned in the IoSpaceMap buffer, and
00591                                 the number of descriptors in IoSpaceMap was returned in
00592                                 NumberOfDescriptors.
00593   @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
00594   @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.
00595   @retval EFI_OUT_OF_RESOURCES  There are not enough resources to allocate IoSpaceMap.
00596 
00597 
00598 **/
00599 typedef
00600 EFI_STATUS
00601 (EFIAPI *EFI_GET_IO_SPACE_MAP)(
00602   OUT UINTN                        *NumberOfDescriptors,
00603   OUT EFI_GCD_IO_SPACE_DESCRIPTOR  **IoSpaceMap
00604   );
00605 
00606 
00607 
00608 /**
00609   Loads and executed DXE drivers from firmware volumes.
00610 
00611   The Dispatch() function searches for DXE drivers in firmware volumes that have been
00612   installed since the last time the Dispatch() service was called. It then evaluates
00613   the dependency expressions of all the DXE drivers and loads and executes those DXE
00614   drivers whose dependency expression evaluate to TRUE. This service must interact with
00615   the Security Architectural Protocol to authenticate DXE drivers before they are executed.
00616   This process is continued until no more DXE drivers can be executed.
00617 
00618   @retval EFI_SUCCESS         One or more DXE driver were dispatched.
00619   @retval EFI_NOT_FOUND       No DXE drivers were dispatched.
00620   @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.
00621                               Thus, no action was taken.
00622 
00623 **/
00624 typedef
00625 EFI_STATUS
00626 (EFIAPI *EFI_DISPATCH)(
00627   VOID
00628   );
00629 
00630 /**
00631   Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
00632 
00633   @param  FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
00634   @param  FileName             A pointer to the name of the file in a firmware volume.
00635 
00636   @retval EFI_SUCCESS         The DXE driver was found and its SOR bit was cleared.
00637   @retval EFI_NOT_FOUND       The DXE driver does not exist, or the DXE driver exists and its SOR
00638                               bit is not set.
00639 
00640 **/
00641 typedef
00642 EFI_STATUS
00643 (EFIAPI *EFI_SCHEDULE)(
00644   IN EFI_HANDLE  FirmwareVolumeHandle,
00645   IN CONST EFI_GUID    *FileName
00646   );
00647 
00648 /**
00649   Promotes a file stored in a firmware volume from the untrusted to the trusted state.
00650 
00651   @param  FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
00652   @param  DriverName           A pointer to the name of the file in a firmware volume.
00653 
00654   @return Status of promoting FFS from untrusted to trusted
00655           state.
00656   @retval EFI_NOT_FOUND       The file was not found in the untrusted state.
00657 
00658 **/
00659 typedef
00660 EFI_STATUS
00661 (EFIAPI *EFI_TRUST)(
00662   IN EFI_HANDLE  FirmwareVolumeHandle,
00663   IN CONST EFI_GUID    *FileName
00664   );
00665 
00666 /**
00667   Creates a firmware volume handle for a firmware volume that is present in system memory.
00668 
00669   @param  FirmwareVolumeHeader A pointer to the header of the firmware volume.
00670   @param  Size                 The size, in bytes, of the firmware volume.
00671   @param  FirmwareVolumeHandle On output, a pointer to the created handle.
00672 
00673   @retval EFI_SUCCESS          The EFI_FIRMWARE_VOLUME_PROTOCOL and
00674                                EFI_DEVICE_PATH_PROTOCOL were installed onto
00675                                FirmwareVolumeHandle for the firmware volume described
00676                                by FirmwareVolumeHeader and Size.
00677   @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader
00678                                and Size is corrupted.
00679   @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the
00680                                EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL
00681                                for the firmware volume described by FirmwareVolumeHeader and Size.
00682 
00683 **/
00684 typedef
00685 EFI_STATUS
00686 (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)(
00687   IN CONST VOID                       *FirmwareVolumeHeader,
00688   IN UINTN                            Size,
00689   OUT EFI_HANDLE                      *FirmwareVolumeHandle
00690   );
00691 
00692 //
00693 // DXE Services Table
00694 //
00695 #define DXE_SERVICES_SIGNATURE            0x565245535f455844ULL
00696 #define DXE_SPECIFICATION_MAJOR_REVISION  1
00697 #define DXE_SPECIFICATION_MINOR_REVISION  40
00698 #define DXE_SERVICES_REVISION             ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION))
00699 
00700 typedef struct {
00701   ///
00702   /// The table header for the DXE Services Table.
00703   /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.
00704   ///
00705   EFI_TABLE_HEADER                Hdr;
00706 
00707   //
00708   // Global Coherency Domain Services
00709   //
00710   EFI_ADD_MEMORY_SPACE            AddMemorySpace;
00711   EFI_ALLOCATE_MEMORY_SPACE       AllocateMemorySpace;
00712   EFI_FREE_MEMORY_SPACE           FreeMemorySpace;
00713   EFI_REMOVE_MEMORY_SPACE         RemoveMemorySpace;
00714   EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
00715   EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
00716   EFI_GET_MEMORY_SPACE_MAP        GetMemorySpaceMap;
00717   EFI_ADD_IO_SPACE                AddIoSpace;
00718   EFI_ALLOCATE_IO_SPACE           AllocateIoSpace;
00719   EFI_FREE_IO_SPACE               FreeIoSpace;
00720   EFI_REMOVE_IO_SPACE             RemoveIoSpace;
00721   EFI_GET_IO_SPACE_DESCRIPTOR     GetIoSpaceDescriptor;
00722   EFI_GET_IO_SPACE_MAP            GetIoSpaceMap;
00723 
00724   //
00725   // Dispatcher Services
00726   //
00727   EFI_DISPATCH                    Dispatch;
00728   EFI_SCHEDULE                    Schedule;
00729   EFI_TRUST                       Trust;
00730   //
00731   // Service to process a single firmware volume found in a capsule
00732   //
00733   EFI_PROCESS_FIRMWARE_VOLUME     ProcessFirmwareVolume;
00734   //
00735   // Extensions to Global Coherency Domain Services
00736   //
00737   EFI_SET_MEMORY_SPACE_CAPABILITIES SetMemorySpaceCapabilities;
00738 } DXE_SERVICES;
00739 
00740 typedef DXE_SERVICES EFI_DXE_SERVICES;
00741 
00742 #endif