2 Include file matches things in PI.
4 Copyright (c) 2006 - 2008, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
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.
13 @par Revision Reference:
18 #ifndef __PI_DXECIS_H__
19 #define __PI_DXECIS_H__
21 #include <Pi/PiMultiPhase.h>
24 /// Global Coherencey Domain types - Memory type
27 EfiGcdMemoryTypeNonExistent
,
28 EfiGcdMemoryTypeReserved
,
29 EfiGcdMemoryTypeSystemMemory
,
30 EfiGcdMemoryTypeMemoryMappedIo
,
31 EfiGcdMemoryTypeMaximum
32 } EFI_GCD_MEMORY_TYPE
;
35 /// Global Coherencey Domain types - IO type
38 EfiGcdIoTypeNonExistent
,
45 /// The type of allocation to perform.
48 EfiGcdAllocateAnySearchBottomUp
,
49 EfiGcdAllocateMaxAddressSearchBottomUp
,
50 EfiGcdAllocateAddress
,
51 EfiGcdAllocateAnySearchTopDown
,
52 EfiGcdAllocateMaxAddressSearchTopDown
,
54 } EFI_GCD_ALLOCATE_TYPE
;
57 /// EFI_GCD_MEMORY_SPACE_DESCRIPTOR
61 /// The physical address of the first byte in the memory region. Type
62 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
63 /// description in the UEFI 2.0 specification
65 EFI_PHYSICAL_ADDRESS BaseAddress
;
68 /// The number of bytes in the memory region.
73 /// The bit mask of attributes that the memory region is capable of supporting. The bit
74 /// mask of available attributes is defined in the GetMemoryMap() function description
75 /// in the UEFI 2.0 specification.
79 /// The bit mask of attributes that the memory region is currently using. The bit mask of
80 /// available attributes is defined in GetMemoryMap().
84 /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the
85 /// AddMemorySpace() function description
87 EFI_GCD_MEMORY_TYPE GcdMemoryType
;
90 /// The image handle of the agent that allocated the memory resource described by
91 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory
92 /// resource is not currently allocated. Type EFI_HANDLE is defined in
93 /// InstallProtocolInterface() in the UEFI 2.0 specification.
95 EFI_HANDLE ImageHandle
;
98 /// The device handle for which the memory resource has been allocated. If
99 /// ImageHandle is NULL, then the memory resource is not currently allocated. If this
100 /// field is NULL, then the memory resource is not associated with a device that is
101 /// described by a device handle. Type EFI_HANDLE is defined in
102 /// InstallProtocolInterface() in the UEFI 2.0 specification.
104 EFI_HANDLE DeviceHandle
;
105 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR
;
108 /// EFI_GCD_IO_SPACE_DESCRIPTOR
112 /// Physical address of the first byte in the I/O region. Type
113 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
114 /// description in the UEFI 2.0 specification.
116 EFI_PHYSICAL_ADDRESS BaseAddress
;
119 /// Number of bytes in the I/O region.
124 /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the
125 /// AddIoSpace() function description.
127 EFI_GCD_IO_TYPE GcdIoType
;
130 /// The image handle of the agent that allocated the I/O resource described by
131 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O
132 /// resource is not currently allocated. Type EFI_HANDLE is defined in
133 /// InstallProtocolInterface() in the UEFI 2.0 specification.
135 EFI_HANDLE ImageHandle
;
138 /// The device handle for which the I/O resource has been allocated. If ImageHandle
139 /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then
140 /// the I/O resource is not associated with a device that is described by a device handle.
141 /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI
142 /// 2.0 specification.
144 EFI_HANDLE DeviceHandle
;
145 } EFI_GCD_IO_SPACE_DESCRIPTOR
;
149 Adds reserved memory, system memory, or memory-mapped I/O resources to the
150 global coherency domain of the processor.
152 @param GcdMemoryType The type of memory resource being added.
153 @param BaseAddress The physical address that is the start address
154 of the memory resource being added.
155 @param Length The size, in bytes, of the memory resource that
157 @param Capabilities The bit mask of attributes that the memory
158 resource region supports.
160 @retval EFI_SUCCESS The memory resource was added to the global
161 coherency domain of the processor.
162 @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
163 @retval EFI_INVALID_PARAMETER Length is zero.
164 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add
165 the memory resource to the global coherency
166 domain of the processor.
167 @retval EFI_UNSUPPORTED The processor does not support one or more bytes
168 of the memory resource range specified by
169 BaseAddress and Length.
170 @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range
171 specified by BaseAddress and Length conflicts
172 with a memory resource range that was previously
173 added to the global coherency domain of the processor.
174 @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range
175 specified by BaseAddress and Length was allocated
176 in a prior call to AllocateMemorySpace()..
181 (EFIAPI
*EFI_ADD_MEMORY_SPACE
)(
182 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
183 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
185 IN UINT64 Capabilities
190 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
191 I/O resources from the global coherency domain of the processor.
193 @param GcdAllocateType The type of allocation to perform.
194 @param GcdMemoryType The type of memory resource being allocated.
195 @param Alignment The log base 2 of the boundary that BaseAddress must
196 be aligned on output. Align with 2^Alignment.
197 @param Length The size in bytes of the memory resource range that
199 @param BaseAddress A pointer to a physical address to allocate.
200 @param Imagehandle The image handle of the agent that is allocating
202 @param DeviceHandle The device handle for which the memory resource
205 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
206 @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
207 @retval EFI_INVALID_PARAMETER Length is zero.
208 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
209 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
210 @retval EFI_NOT_FOUND The memory resource request could not be satisfied.
211 No descriptor contains the desired space.
212 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory
213 resource from the global coherency domain of the processor.
214 @retval EFI_SUCCESS The memory resource was allocated from the global coherency
215 domain of the processor.
221 (EFIAPI
*EFI_ALLOCATE_MEMORY_SPACE
)(
222 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
223 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
226 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
227 IN EFI_HANDLE ImageHandle
,
228 IN EFI_HANDLE DeviceHandle OPTIONAL
233 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
234 I/O resources from the global coherency domain of the processor.
236 @param BaseAddress The physical address that is the start address of the memory resource being freed.
237 @param Length The size in bytes of the memory resource range that is being freed.
239 @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of
241 @retval EFI_INVALID_PARAMETER Length is zero.
242 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
243 resource range specified by BaseAddress and Length.
244 @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and
245 Length was not allocated with previous calls to AllocateMemorySpace().
246 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource
247 from the global coherency domain of the processor.
252 (EFIAPI
*EFI_FREE_MEMORY_SPACE
)(
253 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
259 Removes reserved memory, system memory, or memory-mapped I/O resources from
260 the global coherency domain of the processor.
262 @param BaseAddress The physical address that is the start address of the memory resource being removed.
263 @param Length The size in bytes of the memory resource that is being removed.
265 @retval EFI_SUCCESS The memory resource was removed from the global coherency
266 domain of the processor.
267 @retval EFI_INVALID_PARAMETER Length is zero.
268 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
269 resource range specified by BaseAddress and Length.
270 @retval EFI_NOT_FOUND One or more bytes of the memory resource range specified by
271 BaseAddress and Length was not added with previous calls to
273 @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by
274 BaseAddress and Length has been allocated with AllocateMemorySpace().
275 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory
276 resource from the global coherency domain of the processor.
281 (EFIAPI
*EFI_REMOVE_MEMORY_SPACE
)(
282 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
288 Retrieves the descriptor for a memory region containing a specified address.
290 @param BaseAddress The physical address that is the start address of a memory region.
291 @param Descriptor A pointer to a caller allocated descriptor.
293 @retval EFI_SUCCESS The descriptor for the memory resource region containing
294 BaseAddress was returned in Descriptor.
295 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
296 @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found.
301 (EFIAPI
*EFI_GET_MEMORY_SPACE_DESCRIPTOR
)(
302 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
303 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
*Descriptor
308 Modifies the attributes for a memory region in the global coherency domain of the
311 @param BaseAddress The physical address that is the start address of a memory region.
312 @param Length The size in bytes of the memory region.
313 @param Attributes The bit mask of attributes to set for the memory region.
315 @retval EFI_SUCCESS The attributes were set for the memory region.
316 @retval EFI_INVALID_PARAMETER Length is zero.
317 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
318 resource range specified by BaseAddress and Length.
319 @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource
320 range specified by BaseAddress and Length.
321 @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by
322 BaseAddress and Length cannot be modified.
323 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of
324 the memory resource range.
329 (EFIAPI
*EFI_SET_MEMORY_SPACE_ATTRIBUTES
)(
330 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
337 Returns a map of the memory resources in the global coherency domain of the
340 @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.
341 @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.
343 @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap
344 buffer, and the number of descriptors in MemorySpaceMap was
345 returned in NumberOfDescriptors.
346 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
347 @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.
348 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap.
353 (EFIAPI
*EFI_GET_MEMORY_SPACE_MAP
)(
354 OUT UINTN
*NumberOfDescriptors
,
355 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
**MemorySpaceMap
360 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
362 @param GcdIoType The type of I/O resource being added.
363 @param BaseAddress The physical address that is the start address of the I/O resource being added.
364 @param Length The size in bytes of the I/O resource that is being added.
366 @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of
368 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
369 @retval EFI_INVALID_PARAMETER Length is zero.
370 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to
371 the global coherency domain of the processor.
372 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
373 resource range specified by BaseAddress and Length.
374 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
375 BaseAddress and Length conflicts with an I/O resource
376 range that was previously added to the global coherency domain
378 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
379 BaseAddress and Length was allocated in a prior call to
385 (EFIAPI
*EFI_ADD_IO_SPACE
)(
386 IN EFI_GCD_IO_TYPE GcdIoType
,
387 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
393 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
394 domain of the processor.
396 @param GcdAllocateType The type of allocation to perform.
397 @param GcdIoType The type of I/O resource being allocated.
398 @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output.
399 @param Length The size in bytes of the I/O resource range that is being allocated.
400 @param BaseAddress A pointer to a physical address.
401 @param Imagehandle The image handle of the agent that is allocating the I/O resource.
402 @param DeviceHandle The device handle for which the I/O resource is being allocated.
404 @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain
406 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
407 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
408 @retval EFI_INVALID_PARAMETER Length is zero.
409 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
410 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
411 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O
412 resource from the global coherency domain of the processor.
413 @retval EFI_NOT_FOUND The I/O resource request could not be satisfied.
418 (EFIAPI
*EFI_ALLOCATE_IO_SPACE
)(
419 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
420 IN EFI_GCD_IO_TYPE GcdIoType
,
423 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
424 IN EFI_HANDLE ImageHandle
,
425 IN EFI_HANDLE DeviceHandle OPTIONAL
430 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
431 domain of the processor.
433 @param BaseAddress The physical address that is the start address of the I/O resource being freed.
434 @param Length The size in bytes of the I/O resource range that is being freed.
436 @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the
438 @retval EFI_INVALID_PARAMETER Length is zero.
439 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource
440 range specified by BaseAddress and Length.
441 @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length
442 was not allocated with previous calls to AllocateIoSpace().
443 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from
444 the global coherency domain of the processor.
449 (EFIAPI
*EFI_FREE_IO_SPACE
)(
450 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
456 Removes reserved I/O or I/O resources from the global coherency domain of the
459 @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being
461 @param Length The size in bytes of the I/O resource that is being removed.
463 @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain
465 @retval EFI_INVALID_PARAMETER Length is zero.
466 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
467 resource range specified by BaseAddress and Length.
468 @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by
469 BaseAddress and Length was not added with previous
470 calls to AddIoSpace().
471 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
472 BaseAddress and Length has been allocated with
474 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O
475 resource from the global coherency domain of the processor.
480 (EFIAPI
*EFI_REMOVE_IO_SPACE
)(
481 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
487 Retrieves the descriptor for an I/O region containing a specified address.
489 @param BaseAddress The physical address that is the start address of an I/O region.
490 @param Descriptor A pointer to a caller allocated descriptor.
492 @retval EFI_SUCCESS The descriptor for the I/O resource region containing
493 BaseAddress was returned in Descriptor.
494 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
495 @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found.
500 (EFIAPI
*EFI_GET_IO_SPACE_DESCRIPTOR
)(
501 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
502 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
*Descriptor
507 Returns a map of the I/O resources in the global coherency domain of the processor.
509 @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.
510 @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.
512 @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and
513 the number of descriptors in IoSpaceMap was returned in
515 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
516 @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.
517 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap.
523 (EFIAPI
*EFI_GET_IO_SPACE_MAP
)(
524 OUT UINTN
*NumberOfDescriptors
,
525 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
**IoSpaceMap
532 Loads and executed DXE drivers from firmware volumes.
534 The Dispatch() function searches for DXE drivers in firmware volumes that have been
535 installed since the last time the Dispatch() service was called. It then evaluates
536 the dependency expressions of all the DXE drivers and loads and executes those DXE
537 drivers whose dependency expression evaluate to TRUE. This service must interact with
538 the Security Architectural Protocol to authenticate DXE drivers before they are executed.
539 This process is continued until no more DXE drivers can be executed.
541 @retval EFI_SUCCESS One or more DXE driver were dispatched.
542 @retval EFI_NOT_FOUND No DXE drivers were dispatched.
543 @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.
544 Thus no action was taken.
549 (EFIAPI
*EFI_DISPATCH
)(
555 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
557 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
558 @param FileName A pointer to the name of the file in a firmware volume.
560 @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared.
561 @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR
567 (EFIAPI
*EFI_SCHEDULE
)(
568 IN EFI_HANDLE FirmwareVolumeHandle
,
569 IN CONST EFI_GUID
*FileName
574 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
576 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
577 @param DriverName A pointer to the name of the file in a firmware volume.
579 @return Status of promoting FFS from untrusted to trusted
581 @retval EFI_NOT_FOUND The file was not found in the untrusted state.
587 IN EFI_HANDLE FirmwareVolumeHandle
,
588 IN CONST EFI_GUID
*FileName
593 Creates a firmware volume handle for a firmware volume that is present in system memory.
595 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
596 @param Size The size, in bytes, of the firmware volume.
597 @param FirmwareVolumeHandle On output, a pointer to the created handle.
599 @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and
600 EFI_DEVICE_PATH_PROTOCOL were installed onto
601 FirmwareVolumeHandle for the firmware volume described
602 by FirmwareVolumeHeader and Size.
603 @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader
604 and Size is corrupted.
605 @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the
606 EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL
607 for the firmware volume described by FirmwareVolumeHeader and Size.
612 (EFIAPI
*EFI_PROCESS_FIRMWARE_VOLUME
)(
613 IN CONST VOID
*FirmwareVolumeHeader
,
615 OUT EFI_HANDLE
*FirmwareVolumeHandle
620 // DXE Services Table
622 #define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
623 #define DXE_SERVICES_REVISION ((1<<16) | (00))
626 EFI_TABLE_HEADER Hdr
;
629 // Global Coherency Domain Services
631 EFI_ADD_MEMORY_SPACE AddMemorySpace
;
632 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace
;
633 EFI_FREE_MEMORY_SPACE FreeMemorySpace
;
634 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace
;
635 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor
;
636 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes
;
637 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap
;
638 EFI_ADD_IO_SPACE AddIoSpace
;
639 EFI_ALLOCATE_IO_SPACE AllocateIoSpace
;
640 EFI_FREE_IO_SPACE FreeIoSpace
;
641 EFI_REMOVE_IO_SPACE RemoveIoSpace
;
642 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor
;
643 EFI_GET_IO_SPACE_MAP GetIoSpaceMap
;
646 // Dispatcher Services
648 EFI_DISPATCH Dispatch
;
649 EFI_SCHEDULE Schedule
;
652 // Service to process a single firmware volume found in a capsule
654 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume
;
657 typedef DXE_SERVICES EFI_DXE_SERVICES
;