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