]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Dxe/DxeCis.h
Modified comment for gDs
[mirror_edk2.git] / MdePkg / Include / Dxe / DxeCis.h
1 /** @file
2 Include file matches things in the DXE CIS.
3
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
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 Module Name: DxeCis.h
14
15 @par Revision Reference:
16 Version 0.91B.
17
18 **/
19
20 #ifndef __DXE_CIS__
21 #define __DXE_CIS__
22
23 #include <Uefi/UefiSpec.h>
24
25
26 #define TIANO_ERROR(a) (MAX_2_BITS | (a))
27
28 #if (EFI_SPECIFICATION_VERSION < 0x00020000)
29 //
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.
33 //
34 #define EFI_NOT_AVAILABLE_YET EFIERR (28)
35 #define EFI_UNLOAD_IMAGE EFIERR (29)
36 #else
37 #define EFI_NOT_AVAILABLE_YET TIANO_ERROR (0)
38 #define EFI_UNLOAD_IMAGE TIANO_ERROR (1)
39 #endif
40
41 //
42 // BugBug: Implementation contamination of UEFI 2.0
43 // Pointer to internal runtime pointer
44 //
45 #define EFI_IPF_GP_POINTER 0x00000008
46
47
48 //
49 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
50 //
51
52 //
53 // attributes for reserved memory before it is promoted to system memory
54 //
55 #define EFI_MEMORY_PRESENT 0x0100000000000000ULL
56 #define EFI_MEMORY_INITIALIZED 0x0200000000000000ULL
57 #define EFI_MEMORY_TESTED 0x0400000000000000ULL
58
59 //
60 // range for memory mapped port I/O on IPF
61 //
62 #define EFI_MEMORY_PORT_IO 0x4000000000000000ULL
63
64 //
65 // Modifier for EFI DXE Services
66 //
67 #define EFI_DXESERVICE
68
69
70 //
71 // Global Coherencey Domain types
72 //
73 typedef enum {
74 EfiGcdMemoryTypeNonExistent,
75 EfiGcdMemoryTypeReserved,
76 EfiGcdMemoryTypeSystemMemory,
77 EfiGcdMemoryTypeMemoryMappedIo,
78 EfiGcdMemoryTypeMaximum
79 } EFI_GCD_MEMORY_TYPE;
80
81 typedef enum {
82 EfiGcdIoTypeNonExistent,
83 EfiGcdIoTypeReserved,
84 EfiGcdIoTypeIo,
85 EfiGcdIoTypeMaximum
86 } EFI_GCD_IO_TYPE;
87
88 typedef enum {
89 EfiGcdAllocateAnySearchBottomUp,
90 EfiGcdAllocateMaxAddressSearchBottomUp,
91 EfiGcdAllocateAddress,
92 EfiGcdAllocateAnySearchTopDown,
93 EfiGcdAllocateMaxAddressSearchTopDown,
94 EfiGcdMaxAllocateType
95 } EFI_GCD_ALLOCATE_TYPE;
96
97 typedef struct {
98 EFI_PHYSICAL_ADDRESS BaseAddress;
99 UINT64 Length;
100 UINT64 Capabilities;
101 UINT64 Attributes;
102 EFI_GCD_MEMORY_TYPE GcdMemoryType;
103 EFI_HANDLE ImageHandle;
104 EFI_HANDLE DeviceHandle;
105 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
106
107 typedef struct {
108 EFI_PHYSICAL_ADDRESS BaseAddress;
109 UINT64 Length;
110 EFI_GCD_IO_TYPE GcdIoType;
111 EFI_HANDLE ImageHandle;
112 EFI_HANDLE DeviceHandle;
113 } EFI_GCD_IO_SPACE_DESCRIPTOR;
114
115 /**
116 Adds reserved memory, system memory, or memory-mapped I/O resources to the
117 global coherency domain of the processor.
118
119 @param GcdMemoryType Memory type of the memory space.
120
121 @param BaseAddress Base address of the memory space.
122
123 @param Length Length of the memory space.
124
125 @param Capabilities alterable attributes of the memory space.
126
127 @retval EFI_SUCCESS Merged this memory space into GCD map.
128
129 **/
130 typedef
131 EFI_STATUS
132 (EFIAPI *EFI_ADD_MEMORY_SPACE) (
133 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
134 IN EFI_PHYSICAL_ADDRESS BaseAddress,
135 IN UINT64 Length,
136 IN UINT64 Capabilities
137 )
138 ;
139
140 /**
141 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
142 I/O resources from the global coherency domain of the processor.
143
144 @param GcdAllocateType The type of allocate operation
145
146 @param GcdMemoryType The desired memory type
147
148 @param Alignment Align with 2^Alignment
149
150 @param Length Length to allocate
151
152 @param BaseAddress Base address to allocate
153
154 @param Imagehandle The image handle consume the allocated space.
155
156 @param DeviceHandle The device handle consume the allocated space.
157
158 @retval EFI_INVALID_PARAMETER Invalid parameter.
159
160 @retval EFI_NOT_FOUND No descriptor contains the desired space.
161
162 @retval EFI_SUCCESS Memory space successfully allocated.
163
164 **/
165 typedef
166 EFI_STATUS
167 (EFIAPI *EFI_ALLOCATE_MEMORY_SPACE) (
168 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
169 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
170 IN UINTN Alignment,
171 IN UINT64 Length,
172 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
173 IN EFI_HANDLE ImageHandle,
174 IN EFI_HANDLE DeviceHandle OPTIONAL
175 )
176 ;
177
178 /**
179 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
180 I/O resources from the global coherency domain of the processor.
181
182 @param BaseAddress Base address of the segment.
183
184 @param Length Length of the segment.
185
186 @retval EFI_SUCCESS Space successfully freed.
187
188 **/
189 typedef
190 EFI_STATUS
191 (EFIAPI *EFI_FREE_MEMORY_SPACE) (
192 IN EFI_PHYSICAL_ADDRESS BaseAddress,
193 IN UINT64 Length
194 )
195 ;
196
197 /**
198 Removes reserved memory, system memory, or memory-mapped I/O resources from
199 the global coherency domain of the processor.
200
201 @param BaseAddress Base address of the memory space.
202
203 @param Length Length of the memory space.
204
205 @retval EFI_SUCCESS Successfully remove a segment of memory space.
206
207 **/
208 typedef
209 EFI_STATUS
210 (EFIAPI *EFI_REMOVE_MEMORY_SPACE) (
211 IN EFI_PHYSICAL_ADDRESS BaseAddress,
212 IN UINT64 Length
213 )
214 ;
215
216 /**
217 Retrieves the descriptor for a memory region containing a specified address.
218
219 @param BaseAddress Specified start address
220
221 @param Descriptor Specified length
222
223 @retval EFI_INVALID_PARAMETER Invalid parameter
224
225 @retval EFI_SUCCESS Successfully get memory space descriptor.
226
227 **/
228 typedef
229 EFI_STATUS
230 (EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR) (
231 IN EFI_PHYSICAL_ADDRESS BaseAddress,
232 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
233 )
234 ;
235
236 /**
237 Modifies the attributes for a memory region in the global coherency domain of the
238 processor.
239
240 @param BaseAddress Specified start address
241
242 @param Length Specified length
243
244 @param Attributes Specified attributes
245
246 @retval EFI_SUCCESS Successfully set attribute of a segment of memory space.
247
248 **/
249 typedef
250
251 EFI_STATUS
252 (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES) (
253 IN EFI_PHYSICAL_ADDRESS BaseAddress,
254 IN UINT64 Length,
255 IN UINT64 Attributes
256 )
257 ;
258
259 /**
260 Returns a map of the memory resources in the global coherency domain of the
261 processor.
262
263 @param NumberOfDescriptors Number of descriptors.
264
265 @param MemorySpaceMap Descriptor array
266
267 @retval EFI_INVALID_PARAMETER Invalid parameter
268
269 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
270
271 @retval EFI_SUCCESS Successfully get memory space map.
272
273 **/
274 typedef
275 EFI_STATUS
276 (EFIAPI *EFI_GET_MEMORY_SPACE_MAP) (
277 OUT UINTN *NumberOfDescriptors,
278 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
279 )
280 ;
281
282 /**
283 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
284
285 @param GcdIoType IO type of the segment.
286
287 @param BaseAddress Base address of the segment.
288
289 @param Length Length of the segment.
290
291 @retval EFI_SUCCESS Merged this segment into GCD map.
292
293 **/
294 typedef
295 EFI_STATUS
296 (EFIAPI *EFI_ADD_IO_SPACE) (
297 IN EFI_GCD_IO_TYPE GcdIoType,
298 IN EFI_PHYSICAL_ADDRESS BaseAddress,
299 IN UINT64 Length
300 )
301 ;
302
303 /**
304 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
305 domain of the processor.
306
307 @param GcdAllocateType The type of allocate operation
308
309 @param GcdIoType The desired IO type
310
311 @param Alignment Align with 2^Alignment
312
313 @param Length Length to allocate
314
315 @param BaseAddress Base address to allocate
316
317 @param Imagehandle The image handle consume the allocated space.
318
319 @param DeviceHandle The device handle consume the allocated space.
320
321 @retval EFI_INVALID_PARAMETER Invalid parameter.
322
323 @retval EFI_NOT_FOUND No descriptor contains the desired space.
324
325 @retval EFI_SUCCESS IO space successfully allocated.
326
327 **/
328 typedef
329 EFI_STATUS
330 (EFIAPI *EFI_ALLOCATE_IO_SPACE) (
331 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
332 IN EFI_GCD_IO_TYPE GcdIoType,
333 IN UINTN Alignment,
334 IN UINT64 Length,
335 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
336 IN EFI_HANDLE ImageHandle,
337 IN EFI_HANDLE DeviceHandle OPTIONAL
338 )
339 ;
340
341 /**
342 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
343 domain of the processor.
344
345 @param BaseAddress Base address of the segment.
346
347 @param Length Length of the segment.
348
349 @retval EFI_SUCCESS Space successfully freed.
350
351 **/
352 typedef
353 EFI_STATUS
354 (EFIAPI *EFI_FREE_IO_SPACE) (
355 IN EFI_PHYSICAL_ADDRESS BaseAddress,
356 IN UINT64 Length
357 )
358 ;
359
360 /**
361 Removes reserved I/O or I/O resources from the global coherency domain of the
362 processor.
363
364 @param BaseAddress Base address of the segment.
365
366 @param Length Length of the segment.
367
368 @retval EFI_SUCCESS Successfully removed a segment of IO space.
369
370 **/
371 typedef
372 EFI_STATUS
373 (EFIAPI *EFI_REMOVE_IO_SPACE) (
374 IN EFI_PHYSICAL_ADDRESS BaseAddress,
375 IN UINT64 Length
376 )
377 ;
378
379 /**
380 Retrieves the descriptor for an I/O region containing a specified address.
381
382 @param BaseAddress Specified start address
383
384 @param Descriptor Specified length
385
386 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
387
388 @retval EFI_SUCCESS Successfully get the IO space descriptor.
389
390 **/
391 typedef
392 EFI_STATUS
393 (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR) (
394 IN EFI_PHYSICAL_ADDRESS BaseAddress,
395 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
396 )
397 ;
398
399 /**
400 Returns a map of the I/O resources in the global coherency domain of the processor.
401
402 @param NumberOfDescriptors Number of descriptors.
403
404 @param MemorySpaceMap Descriptor array
405
406 @retval EFI_INVALID_PARAMETER Invalid parameter
407
408 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
409
410 @retval EFI_SUCCESS Successfully get IO space map.
411
412 **/
413 typedef
414 EFI_STATUS
415 (EFIAPI *EFI_GET_IO_SPACE_MAP) (
416 OUT UINTN *NumberOfDescriptors,
417 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
418 )
419 ;
420
421 /**
422 Loads and executed DXE drivers from firmware volumes.
423
424 @return Status code
425
426 **/
427 typedef
428 EFI_STATUS
429 (EFIAPI *EFI_DISPATCH) (VOID)
430 ;
431
432 /**
433 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
434
435 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
436
437 @param DriverName A pointer to the name of the file in a firmware volume.
438
439 @return Status code
440
441 **/
442 typedef
443 EFI_STATUS
444 (EFIAPI *EFI_SCHEDULE) (
445 IN EFI_HANDLE FirmwareVolumeHandle,
446 IN EFI_GUID *DriverName
447 )
448 ;
449
450 /**
451 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
452
453 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
454
455 @param DriverName A pointer to the name of the file in a firmware volume.
456
457 @return Status code
458
459 **/
460 typedef
461 EFI_STATUS
462 (EFIAPI *EFI_TRUST) (
463 IN EFI_HANDLE FirmwareVolumeHandle,
464 IN EFI_GUID *DriverName
465 )
466 ;
467
468 /**
469 Creates a firmware volume handle for a firmware volume that is present in system memory.
470
471 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
472 @param Size The size, in bytes, of the firmware volume.
473 @param FirmwareVolumeHandle On output, a pointer to the created handle.
474
475 @return Status code
476
477 **/
478 typedef
479 EFI_STATUS
480 (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME) (
481 IN VOID *FvHeader,
482 IN UINTN Size,
483 OUT EFI_HANDLE *FirmwareVolumeHandle
484 )
485 ;
486
487 //
488 // DXE Services Table
489 //
490 #define EFI_DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
491 #define EFI_DXE_SERVICES_REVISION ((0 << 16) | (25))
492
493 typedef struct {
494 EFI_TABLE_HEADER Hdr;
495
496 //
497 // Global Coherency Domain Services
498 //
499 EFI_ADD_MEMORY_SPACE AddMemorySpace;
500 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
501 EFI_FREE_MEMORY_SPACE FreeMemorySpace;
502 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
503 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
504 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
505 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
506 EFI_ADD_IO_SPACE AddIoSpace;
507 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
508 EFI_FREE_IO_SPACE FreeIoSpace;
509 EFI_REMOVE_IO_SPACE RemoveIoSpace;
510 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
511 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
512
513 //
514 // Dispatcher Services
515 //
516 EFI_DISPATCH Dispatch;
517 EFI_SCHEDULE Schedule;
518 EFI_TRUST Trust;
519 //
520 // Service to process a single firmware volume found in a capsule
521 //
522 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
523 } EFI_DXE_SERVICES;
524
525
526 #include <Common/BootMode.h>
527 #include <Common/BootScript.h>
528 #include <Common/Capsule.h>
529 #include <Common/Dependency.h>
530 #include <Common/FirmwareVolumeImageFormat.h>
531 #include <Common/FirmwareVolumeHeader.h>
532 #include <Common/FirmwareFileSystem.h>
533 #include <Common/Hob.h>
534 #include <Common/InternalFormRepresentation.h>
535 #include <Common/StatusCode.h>
536 #include <Common/StatusCodeDataTypeId.h>
537
538 #include <Guid/AcpiTableStorage.h>
539 #include <Guid/Apriori.h>
540 #include <Guid/Capsule.h>
541 #include <Guid/DxeServices.h>
542 #include <Guid/EventLegacyBios.h>
543 #include <Guid/FirmwareFileSystem.h>
544 #include <Guid/FrameworkDevicePath.h>
545 #include <Guid/HobList.h>
546 #include <Guid/MemoryAllocationHob.h>
547 #include <Guid/SmramMemoryReserve.h>
548 #include <Guid/StatusCodeDataTypeId.h>
549
550 #include <Dxe/ArchProtocol/Bds.h>
551 #include <Dxe/ArchProtocol/Cpu.h>
552 #include <Dxe/ArchProtocol/Metronome.h>
553 #include <Dxe/ArchProtocol/MonotonicCounter.h>
554 #include <Dxe/ArchProtocol/RealTimeClock.h>
555 #include <Dxe/ArchProtocol/Reset.h>
556 #include <Dxe/ArchProtocol/Runtime.h>
557 #include <Dxe/ArchProtocol/Security.h>
558 #include <Dxe/ArchProtocol/SecurityPolicy.h>
559 #include <Dxe/ArchProtocol/StatusCode.h>
560 #include <Dxe/ArchProtocol/Timer.h>
561 #include <Dxe/ArchProtocol/Variable.h>
562 #include <Dxe/ArchProtocol/VariableWrite.h>
563 #include <Dxe/ArchProtocol/WatchdogTimer.h>
564
565 #include <Protocol/AcpiSupport.h>
566 #include <Protocol/BootScriptSave.h>
567 #include <Protocol/CpuIo.h>
568 #include <Protocol/DataHub.h>
569 #include <Protocol/FirmwareVolume.h>
570 #include <Protocol/FirmwareVolumeBlock.h>
571 #include <Protocol/FirmwareVolumeDispatch.h>
572 #include <Protocol/Hii.h>
573 #include <Protocol/FormBrowser.h>
574 #include <Protocol/FormCallback.h>
575 #include <Protocol/GuidedSectionExtraction.h>
576 #include <Protocol/IdeControllerInit.h>
577 #include <Protocol/IncompatiblePciDeviceSupport.h>
578 #include <Protocol/PciHostBridgeResourceAllocation.h>
579 #include <Protocol/PciHotPlugInit.h>
580 #include <Protocol/PciPlatform.h>
581 #include <Protocol/SectionExtraction.h>
582 #include <Protocol/Smbus.h>
583 #include <Protocol/LegacyBios.h>
584 #include <Protocol/Legacy8259.h>
585 #include <Protocol/LegacyRegion.h>
586 #include <Protocol/LegacyBiosPlatform.h>
587 #include <Protocol/LegacyInterrupt.h>
588
589 #endif