2 Include file matches things in the DXE CIS.
4 Copyright (c) 2006, 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.
15 @par Revision Reference:
23 #include <Uefi/UefiSpec.h>
26 #define TIANO_ERROR(a) (MAX_2_BITS | (a))
28 #if (EFI_SPECIFICATION_VERSION < 0x00020000)
30 // Tiano added a couple of return types. These are owned by UEFI specification
31 // and Tiano can not use them. Thus for UEFI 2.0/R9 support we moved the values
32 // to a UEFI OEM extension range to conform to UEFI specification.
34 #define EFI_NOT_AVAILABLE_YET EFIERR (28)
35 #define EFI_UNLOAD_IMAGE EFIERR (29)
37 #define EFI_NOT_AVAILABLE_YET TIANO_ERROR (0)
38 #define EFI_UNLOAD_IMAGE TIANO_ERROR (1)
42 // Implementation contamination of UEFI 2.0
43 // Pointer to internal runtime pointer
45 #define EFI_IPF_GP_POINTER 0x00000008
49 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
53 // attributes for reserved memory before it is promoted to system memory
55 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
56 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
57 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
60 // range for memory mapped port I/O on IPF
62 #define EFI_MEMORY_PORT_IO 0x4000000000000000ULL
65 // Modifier for EFI DXE Services
67 #define EFI_DXESERVICE
71 // Global Coherencey Domain types
74 EfiGcdMemoryTypeNonExistent
,
75 EfiGcdMemoryTypeReserved
,
76 EfiGcdMemoryTypeSystemMemory
,
77 EfiGcdMemoryTypeMemoryMappedIo
,
78 EfiGcdMemoryTypeMaximum
79 } EFI_GCD_MEMORY_TYPE
;
82 EfiGcdIoTypeNonExistent
,
89 EfiGcdAllocateAnySearchBottomUp
,
90 EfiGcdAllocateMaxAddressSearchBottomUp
,
91 EfiGcdAllocateAddress
,
92 EfiGcdAllocateAnySearchTopDown
,
93 EfiGcdAllocateMaxAddressSearchTopDown
,
95 } EFI_GCD_ALLOCATE_TYPE
;
98 EFI_PHYSICAL_ADDRESS BaseAddress
;
102 EFI_GCD_MEMORY_TYPE GcdMemoryType
;
103 EFI_HANDLE ImageHandle
;
104 EFI_HANDLE DeviceHandle
;
105 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR
;
108 EFI_PHYSICAL_ADDRESS BaseAddress
;
110 EFI_GCD_IO_TYPE GcdIoType
;
111 EFI_HANDLE ImageHandle
;
112 EFI_HANDLE DeviceHandle
;
113 } EFI_GCD_IO_SPACE_DESCRIPTOR
;
116 Adds reserved memory, system memory, or memory-mapped I/O resources to the
117 global coherency domain of the processor.
119 @param GcdMemoryType Memory type of the memory space.
120 @param BaseAddress Base address of the memory space.
121 @param Length Length of the memory space.
122 @param Capabilities alterable attributes of the memory space.
124 @retval EFI_SUCCESS Merged this memory space into GCD map.
129 (EFIAPI
*EFI_ADD_MEMORY_SPACE
) (
130 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
131 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
133 IN UINT64 Capabilities
138 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
139 I/O resources from the global coherency domain of the processor.
141 @param GcdAllocateType The type of allocate operation
142 @param GcdMemoryType The desired memory type
143 @param Alignment Align with 2^Alignment
144 @param Length Length to allocate
145 @param BaseAddress Base address to allocate
146 @param Imagehandle The image handle consume the allocated space.
147 @param DeviceHandle The device handle consume the allocated space.
149 @retval EFI_INVALID_PARAMETER Invalid parameter.
150 @retval EFI_NOT_FOUND No descriptor contains the desired space.
151 @retval EFI_SUCCESS Memory space successfully allocated.
156 (EFIAPI
*EFI_ALLOCATE_MEMORY_SPACE
) (
157 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
158 IN EFI_GCD_MEMORY_TYPE GcdMemoryType
,
161 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
162 IN EFI_HANDLE ImageHandle
,
163 IN EFI_HANDLE DeviceHandle OPTIONAL
168 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
169 I/O resources from the global coherency domain of the processor.
171 @param BaseAddress Base address of the segment.
172 @param Length Length of the segment.
174 @retval EFI_SUCCESS Space successfully freed.
179 (EFIAPI
*EFI_FREE_MEMORY_SPACE
) (
180 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
186 Removes reserved memory, system memory, or memory-mapped I/O resources from
187 the global coherency domain of the processor.
189 @param BaseAddress Base address of the memory space.
190 @param Length Length of the memory space.
192 @retval EFI_SUCCESS Successfully remove a segment of memory space.
197 (EFIAPI
*EFI_REMOVE_MEMORY_SPACE
) (
198 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
204 Retrieves the descriptor for a memory region containing a specified address.
206 @param BaseAddress Specified start address
207 @param Descriptor Specified length
209 @retval EFI_INVALID_PARAMETER Invalid parameter
210 @retval EFI_SUCCESS Successfully get memory space descriptor.
215 (EFIAPI
*EFI_GET_MEMORY_SPACE_DESCRIPTOR
) (
216 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
217 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
*Descriptor
222 Modifies the attributes for a memory region in the global coherency domain of the
225 @param BaseAddress Specified start address
226 @param Length Specified length
227 @param Attributes Specified attributes
229 @retval EFI_SUCCESS Successfully set attribute of a segment of memory space.
235 (EFIAPI
*EFI_SET_MEMORY_SPACE_ATTRIBUTES
) (
236 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
243 Returns a map of the memory resources in the global coherency domain of the
246 @param NumberOfDescriptors Number of descriptors.
247 @param MemorySpaceMap Descriptor array
249 @retval EFI_INVALID_PARAMETER Invalid parameter
250 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
251 @retval EFI_SUCCESS Successfully get memory space map.
256 (EFIAPI
*EFI_GET_MEMORY_SPACE_MAP
) (
257 OUT UINTN
*NumberOfDescriptors
,
258 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR
**MemorySpaceMap
263 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
265 @param GcdIoType IO type of the segment.
266 @param BaseAddress Base address of the segment.
267 @param Length Length of the segment.
269 @retval EFI_SUCCESS Merged this segment into GCD map.
274 (EFIAPI
*EFI_ADD_IO_SPACE
) (
275 IN EFI_GCD_IO_TYPE GcdIoType
,
276 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
282 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
283 domain of the processor.
285 @param GcdAllocateType The type of allocate operation
286 @param GcdIoType The desired IO type
287 @param Alignment Align with 2^Alignment
288 @param Length Length to allocate
289 @param BaseAddress Base address to allocate
290 @param Imagehandle The image handle consume the allocated space.
291 @param DeviceHandle The device handle consume the allocated space.
293 @retval EFI_INVALID_PARAMETER Invalid parameter.
294 @retval EFI_NOT_FOUND No descriptor contains the desired space.
295 @retval EFI_SUCCESS IO space successfully allocated.
300 (EFIAPI
*EFI_ALLOCATE_IO_SPACE
) (
301 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType
,
302 IN EFI_GCD_IO_TYPE GcdIoType
,
305 IN OUT EFI_PHYSICAL_ADDRESS
*BaseAddress
,
306 IN EFI_HANDLE ImageHandle
,
307 IN EFI_HANDLE DeviceHandle OPTIONAL
312 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
313 domain of the processor.
315 @param BaseAddress Base address of the segment.
316 @param Length Length of the segment.
318 @retval EFI_SUCCESS Space successfully freed.
323 (EFIAPI
*EFI_FREE_IO_SPACE
) (
324 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
330 Removes reserved I/O or I/O resources from the global coherency domain of the
333 @param BaseAddress Base address of the segment.
334 @param Length Length of the segment.
336 @retval EFI_SUCCESS Successfully removed a segment of IO space.
341 (EFIAPI
*EFI_REMOVE_IO_SPACE
) (
342 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
348 Retrieves the descriptor for an I/O region containing a specified address.
350 @param BaseAddress Specified start address
351 @param Descriptor Specified length
353 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
354 @retval EFI_SUCCESS Successfully get the IO space descriptor.
359 (EFIAPI
*EFI_GET_IO_SPACE_DESCRIPTOR
) (
360 IN EFI_PHYSICAL_ADDRESS BaseAddress
,
361 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
*Descriptor
366 Returns a map of the I/O resources in the global coherency domain of the processor.
368 @param NumberOfDescriptors Number of descriptors.
369 @param MemorySpaceMap Descriptor array
371 @retval EFI_INVALID_PARAMETER Invalid parameter
372 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
373 @retval EFI_SUCCESS Successfully get IO space map.
378 (EFIAPI
*EFI_GET_IO_SPACE_MAP
) (
379 OUT UINTN
*NumberOfDescriptors
,
380 OUT EFI_GCD_IO_SPACE_DESCRIPTOR
**IoSpaceMap
385 Loads and executed DXE drivers from firmware volumes.
392 (EFIAPI
*EFI_DISPATCH
) (VOID
)
396 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
398 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
399 @param DriverName A pointer to the name of the file in a firmware volume.
406 (EFIAPI
*EFI_SCHEDULE
) (
407 IN EFI_HANDLE FirmwareVolumeHandle
,
408 IN EFI_GUID
*DriverName
413 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
415 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
416 @param DriverName A pointer to the name of the file in a firmware volume.
423 (EFIAPI
*EFI_TRUST
) (
424 IN EFI_HANDLE FirmwareVolumeHandle
,
425 IN EFI_GUID
*DriverName
430 Creates a firmware volume handle for a firmware volume that is present in system memory.
432 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
433 @param Size The size, in bytes, of the firmware volume.
434 @param FirmwareVolumeHandle On output, a pointer to the created handle.
441 (EFIAPI
*EFI_PROCESS_FIRMWARE_VOLUME
) (
444 OUT EFI_HANDLE
*FirmwareVolumeHandle
449 // DXE Services Table
451 #define EFI_DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
452 #define EFI_DXE_SERVICES_REVISION ((0 << 16) | (90))
455 EFI_TABLE_HEADER Hdr
;
458 // Global Coherency Domain Services
460 EFI_ADD_MEMORY_SPACE AddMemorySpace
;
461 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace
;
462 EFI_FREE_MEMORY_SPACE FreeMemorySpace
;
463 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace
;
464 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor
;
465 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes
;
466 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap
;
467 EFI_ADD_IO_SPACE AddIoSpace
;
468 EFI_ALLOCATE_IO_SPACE AllocateIoSpace
;
469 EFI_FREE_IO_SPACE FreeIoSpace
;
470 EFI_REMOVE_IO_SPACE RemoveIoSpace
;
471 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor
;
472 EFI_GET_IO_SPACE_MAP GetIoSpaceMap
;
475 // Dispatcher Services
477 EFI_DISPATCH Dispatch
;
478 EFI_SCHEDULE Schedule
;
481 // Service to process a single firmware volume found in a capsule
483 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume
;
487 #include <Common/BootMode.h>
488 #include <Common/BootScript.h>
489 #include <Common/Capsule.h>
490 #include <Common/Dependency.h>
491 #include <Common/FirmwareVolumeImageFormat.h>
492 #include <Common/FirmwareVolumeHeader.h>
493 #include <Common/FirmwareFileSystem.h>
494 #include <Common/Hob.h>
495 #include <Common/InternalFormRepresentation.h>
496 #include <Common/StatusCode.h>
497 #include <Common/StatusCodeDataTypeId.h>
499 #include <Guid/AcpiTableStorage.h>
500 #include <Guid/Apriori.h>
501 #include <Guid/Capsule.h>
502 #include <Guid/DxeServices.h>
503 #include <Guid/EventLegacyBios.h>
504 #include <Guid/FirmwareFileSystem.h>
505 #include <Guid/FrameworkDevicePath.h>
506 #include <Guid/HobList.h>
507 #include <Guid/MemoryAllocationHob.h>
508 #include <Guid/SmramMemoryReserve.h>
509 #include <Guid/StatusCodeDataTypeId.h>
511 #include <Dxe/ArchProtocol/Bds.h>
512 #include <Dxe/ArchProtocol/Cpu.h>
513 #include <Dxe/ArchProtocol/Metronome.h>
514 #include <Dxe/ArchProtocol/MonotonicCounter.h>
515 #include <Dxe/ArchProtocol/RealTimeClock.h>
516 #include <Dxe/ArchProtocol/Reset.h>
517 #include <Dxe/ArchProtocol/Runtime.h>
518 #include <Dxe/ArchProtocol/Security.h>
519 #include <Dxe/ArchProtocol/SecurityPolicy.h>
520 #include <Dxe/ArchProtocol/StatusCode.h>
521 #include <Dxe/ArchProtocol/Timer.h>
522 #include <Dxe/ArchProtocol/Variable.h>
523 #include <Dxe/ArchProtocol/VariableWrite.h>
524 #include <Dxe/ArchProtocol/WatchdogTimer.h>
526 #include <Protocol/AcpiSupport.h>
527 #include <Protocol/BootScriptSave.h>
528 #include <Protocol/CpuIo.h>
529 #include <Protocol/DataHub.h>
530 #include <Protocol/FirmwareVolume.h>
531 #include <Protocol/FirmwareVolumeBlock.h>
532 #include <Protocol/FirmwareVolumeDispatch.h>
533 #include <Protocol/Hii.h>
534 #include <Protocol/FormBrowser.h>
535 #include <Protocol/FormCallback.h>
536 #include <Protocol/GuidedSectionExtraction.h>
537 #include <Protocol/IdeControllerInit.h>
538 #include <Protocol/IncompatiblePciDeviceSupport.h>
539 #include <Protocol/PciHostBridgeResourceAllocation.h>
540 #include <Protocol/PciHotPlugInit.h>
541 #include <Protocol/PciPlatform.h>
542 #include <Protocol/SectionExtraction.h>
543 #include <Protocol/Smbus.h>
544 #include <Protocol/LegacyBios.h>
545 #include <Protocol/Legacy8259.h>
546 #include <Protocol/LegacyRegion.h>
547 #include <Protocol/LegacyBiosPlatform.h>
548 #include <Protocol/LegacyInterrupt.h>