2 Include file matches things in PI.
4 Copyright (c) 2006 - 2007, 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
;
118 /// Number of bytes in the I/O region.
122 /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the
123 /// AddIoSpace() function description.
125 EFI_GCD_IO_TYPE GcdIoType
;
128 /// The image handle of the agent that allocated the I/O resource described by
129 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O
130 /// resource is not currently allocated. Type EFI_HANDLE is defined in
131 /// InstallProtocolInterface() in the UEFI 2.0 specification.
133 EFI_HANDLE ImageHandle
;
136 /// The device handle for which the I/O resource has been allocated. If ImageHandle
137 /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then
138 /// the I/O resource is not associated with a device that is described by a device handle.
139 /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI
140 /// 2.0 specification.
142 EFI_HANDLE DeviceHandle
;
143 } EFI_GCD_IO_SPACE_DESCRIPTOR
;
147 Adds reserved memory, system memory, or memory-mapped I/O resources to the
148 global coherency domain of the processor.
150 @param GcdMemoryType Memory type of the memory space.
151 @param BaseAddress Base address of the memory space.
152 @param Length Length of the memory space.
153 @param Capabilities alterable attributes of the memory space.
155 @retval EFI_SUCCESS Merged this memory space into GCD map.
160 (EFIAPI
*EFI_ADD_MEMORY_SPACE
)(
161 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
162 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
164 IN UINT64 Capabilities
169 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
170 I/O resources from the global coherency domain of the processor.
172 @param GcdAllocateType The type of allocate operation
173 @param GcdMemoryType The desired memory type
174 @param Alignment Align with 2^Alignment
175 @param Length Length to allocate
176 @param BaseAddress Base address to allocate
177 @param Imagehandle The image handle consume the allocated space.
178 @param DeviceHandle The device handle consume the allocated space.
180 @retval EFI_INVALID_PARAMETER Invalid parameter.
181 @retval EFI_NOT_FOUND No descriptor contains the desired space.
182 @retval EFI_SUCCESS Memory space successfully allocated.
187 (EFIAPI
*EFI_ALLOCATE_MEMORY_SPACE
)(
188 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
189 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
192 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
193 IN EFI_HANDLE ImageHandle
,
194 IN EFI_HANDLE DeviceHandle OPTIONAL
199 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
200 I/O resources from the global coherency domain of the processor.
202 @param BaseAddress Base address of the segment.
203 @param Length Length of the segment.
205 @retval EFI_SUCCESS Space successfully freed.
210 (EFIAPI
*EFI_FREE_MEMORY_SPACE
)(
211 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
217 Removes reserved memory, system memory, or memory-mapped I/O resources from
218 the global coherency domain of the processor.
220 @param BaseAddress Base address of the memory space.
221 @param Length Length of the memory space.
223 @retval EFI_SUCCESS Successfully remove a segment of memory space.
228 (EFIAPI
*EFI_REMOVE_MEMORY_SPACE
)(
229 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
235 Retrieves the descriptor for a memory region containing a specified address.
237 @param BaseAddress Specified start address
238 @param Descriptor Specified length
240 @retval EFI_INVALID_PARAMETER Invalid parameter
241 @retval EFI_SUCCESS Successfully get memory space descriptor.
246 (EFIAPI
*EFI_GET_MEMORY_SPACE_DESCRIPTOR
)(
247 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
248 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
*Descriptor
253 Modifies the attributes for a memory region in the global coherency domain of the
256 @param BaseAddress Specified start address
257 @param Length Specified length
258 @param Attributes Specified attributes
260 @retval EFI_SUCCESS Successfully set attribute of a segment of memory space.
265 (EFIAPI
*EFI_SET_MEMORY_SPACE_ATTRIBUTES
)(
266 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
273 Returns a map of the memory resources in the global coherency domain of the
276 @param NumberOfDescriptors Number of descriptors.
277 @param MemorySpaceMap Descriptor array
279 @retval EFI_INVALID_PARAMETER Invalid parameter
280 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
281 @retval EFI_SUCCESS Successfully get memory space map.
286 (EFIAPI
*EFI_GET_MEMORY_SPACE_MAP
)(
287 OUT UINTN
*NumberOfDescriptors
,
288 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
**MemorySpaceMap
293 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
295 @param GcdIoType IO type of the segment.
296 @param BaseAddress Base address of the segment.
297 @param Length Length of the segment.
299 @retval EFI_SUCCESS Merged this segment into GCD map.
304 (EFIAPI
*EFI_ADD_IO_SPACE
)(
305 IN EFI_GCD_IO_TYPE GcdIoType
,
306 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
312 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
313 domain of the processor.
315 @param GcdAllocateType The type of allocate operation
316 @param GcdIoType The desired IO type
317 @param Alignment Align with 2^Alignment
318 @param Length Length to allocate
319 @param BaseAddress Base address to allocate
320 @param Imagehandle The image handle consume the allocated space.
321 @param DeviceHandle The device handle consume the allocated space.
323 @retval EFI_INVALID_PARAMETER Invalid parameter.
324 @retval EFI_NOT_FOUND No descriptor contains the desired space.
325 @retval EFI_SUCCESS IO space successfully allocated.
330 (EFIAPI
*EFI_ALLOCATE_IO_SPACE
)(
331 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
332 IN EFI_GCD_IO_TYPE GcdIoType
,
335 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
336 IN EFI_HANDLE ImageHandle
,
337 IN EFI_HANDLE DeviceHandle OPTIONAL
342 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
343 domain of the processor.
345 @param BaseAddress Base address of the segment.
346 @param Length Length of the segment.
348 @retval EFI_SUCCESS Space successfully freed.
353 (EFIAPI
*EFI_FREE_IO_SPACE
)(
354 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
360 Removes reserved I/O or I/O resources from the global coherency domain of the
363 @param BaseAddress Base address of the segment.
364 @param Length Length of the segment.
366 @retval EFI_SUCCESS Successfully removed a segment of IO space.
371 (EFIAPI
*EFI_REMOVE_IO_SPACE
)(
372 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
378 Retrieves the descriptor for an I/O region containing a specified address.
380 @param BaseAddress Specified start address
381 @param Descriptor Specified length
383 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
384 @retval EFI_SUCCESS Successfully get the IO space descriptor.
389 (EFIAPI
*EFI_GET_IO_SPACE_DESCRIPTOR
)(
390 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
391 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
*Descriptor
396 Returns a map of the I/O resources in the global coherency domain of the processor.
398 @param NumberOfDescriptors Number of descriptors.
399 @param MemorySpaceMap Descriptor array
401 @retval EFI_INVALID_PARAMETER Invalid parameter
402 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
403 @retval EFI_SUCCESS Successfully get IO space map.
408 (EFIAPI
*EFI_GET_IO_SPACE_MAP
)(
409 OUT UINTN
*NumberOfDescriptors
,
410 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
**IoSpaceMap
417 Loads and executed DXE drivers from firmware volumes.
424 (EFIAPI
*EFI_DISPATCH
)(
430 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
432 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
433 @param DriverName A pointer to the name of the file in a firmware volume.
440 (EFIAPI
*EFI_SCHEDULE
)(
441 IN EFI_HANDLE FirmwareVolumeHandle
,
442 IN EFI_GUID
*DriverName
447 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
449 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
450 @param DriverName A pointer to the name of the file in a firmware volume.
458 IN EFI_HANDLE FirmwareVolumeHandle
,
459 IN EFI_GUID
*DriverName
464 Creates a firmware volume handle for a firmware volume that is present in system memory.
466 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
467 @param Size The size, in bytes, of the firmware volume.
468 @param FirmwareVolumeHandle On output, a pointer to the created handle.
475 (EFIAPI
*EFI_PROCESS_FIRMWARE_VOLUME
)(
478 OUT EFI_HANDLE
*FirmwareVolumeHandle
483 // DXE Services Table
485 #define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
486 #define DXE_SERVICES_REVISION ((1<<16) | (00))
489 EFI_TABLE_HEADER Hdr
;
492 // Global Coherency Domain Services
494 EFI_ADD_MEMORY_SPACE AddMemorySpace
;
495 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace
;
496 EFI_FREE_MEMORY_SPACE FreeMemorySpace
;
497 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace
;
498 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor
;
499 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes
;
500 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap
;
501 EFI_ADD_IO_SPACE AddIoSpace
;
502 EFI_ALLOCATE_IO_SPACE AllocateIoSpace
;
503 EFI_FREE_IO_SPACE FreeIoSpace
;
504 EFI_REMOVE_IO_SPACE RemoveIoSpace
;
505 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor
;
506 EFI_GET_IO_SPACE_MAP GetIoSpaceMap
;
509 // Dispatcher Services
511 EFI_DISPATCH Dispatch
;
512 EFI_SCHEDULE Schedule
;
515 // Service to process a single firmware volume found in a capsule
517 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume
;
520 typedef DXE_SERVICES EFI_DXE_SERVICES
;