]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiDxeCis.h
Add I2C related definition in PI 1.3 spec.
[mirror_edk2.git] / MdePkg / Include / Pi / PiDxeCis.h
1 /** @file
2 Include file matches things in PI.
3
4 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials are licensed and made available under
6 the terms and conditions of the BSD License that accompanies this distribution.
7 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 @par Revision Reference:
14 PI Version 1.2
15
16 **/
17
18 #ifndef __PI_DXECIS_H__
19 #define __PI_DXECIS_H__
20
21 #include <Uefi/UefiMultiPhase.h>
22 #include <Pi/PiMultiPhase.h>
23
24 ///
25 /// Global Coherencey Domain types - Memory type.
26 ///
27 typedef enum {
28 ///
29 /// A memory region that is visible to the boot processor. However, there are no system
30 /// components that are currently decoding this memory region.
31 ///
32 EfiGcdMemoryTypeNonExistent,
33 ///
34 /// A memory region that is visible to the boot processor. This memory region is being
35 /// decoded by a system component, but the memory region is not considered to be either
36 /// system memory or memory-mapped I/O.
37 ///
38 EfiGcdMemoryTypeReserved,
39 ///
40 /// A memory region that is visible to the boot processor. A memory controller is
41 /// currently decoding this memory region and the memory controller is producing a
42 /// tested system memory region that is available to the memory services.
43 ///
44 EfiGcdMemoryTypeSystemMemory,
45 ///
46 /// A memory region that is visible to the boot processor. This memory region is
47 /// currently being decoded by a component as memory-mapped I/O that can be used to
48 /// access I/O devices in the platform.
49 ///
50 EfiGcdMemoryTypeMemoryMappedIo,
51 EfiGcdMemoryTypeMaximum
52 } EFI_GCD_MEMORY_TYPE;
53
54 ///
55 /// Global Coherencey Domain types - IO type.
56 ///
57 typedef enum {
58 ///
59 /// An I/O region that is visible to the boot processor. However, there are no system
60 /// components that are currently decoding this I/O region.
61 ///
62 EfiGcdIoTypeNonExistent,
63 ///
64 /// An I/O region that is visible to the boot processor. This I/O region is currently being
65 /// decoded by a system component, but the I/O region cannot be used to access I/O devices.
66 ///
67 EfiGcdIoTypeReserved,
68 ///
69 /// An I/O region that is visible to the boot processor. This I/O region is currently being
70 /// decoded by a system component that is producing I/O ports that can be used to access I/O devices.
71 ///
72 EfiGcdIoTypeIo,
73 EfiGcdIoTypeMaximum
74 } EFI_GCD_IO_TYPE;
75
76 ///
77 /// The type of allocation to perform.
78 ///
79 typedef enum {
80 ///
81 /// The GCD memory space map is searched from the lowest address up to the highest address
82 /// looking for unallocated memory ranges.
83 ///
84 EfiGcdAllocateAnySearchBottomUp,
85 ///
86 /// The GCD memory space map is searched from the lowest address up
87 /// to the specified MaxAddress looking for unallocated memory ranges.
88 ///
89 EfiGcdAllocateMaxAddressSearchBottomUp,
90 ///
91 /// The GCD memory space map is checked to see if the memory range starting
92 /// at the specified Address is available.
93 ///
94 EfiGcdAllocateAddress,
95 ///
96 /// The GCD memory space map is searched from the highest address down to the lowest address
97 /// looking for unallocated memory ranges.
98 ///
99 EfiGcdAllocateAnySearchTopDown,
100 ///
101 /// The GCD memory space map is searched from the specified MaxAddress
102 /// down to the lowest address looking for unallocated memory ranges.
103 ///
104 EfiGcdAllocateMaxAddressSearchTopDown,
105 EfiGcdMaxAllocateType
106 } EFI_GCD_ALLOCATE_TYPE;
107
108 ///
109 /// EFI_GCD_MEMORY_SPACE_DESCRIPTOR.
110 ///
111 typedef struct {
112 ///
113 /// The physical address of the first byte in the memory region. Type
114 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
115 /// description in the UEFI 2.0 specification.
116 ///
117 EFI_PHYSICAL_ADDRESS BaseAddress;
118
119 ///
120 /// The number of bytes in the memory region.
121 ///
122 UINT64 Length;
123
124 ///
125 /// The bit mask of attributes that the memory region is capable of supporting. The bit
126 /// mask of available attributes is defined in the GetMemoryMap() function description
127 /// in the UEFI 2.0 specification.
128 ///
129 UINT64 Capabilities;
130 ///
131 /// The bit mask of attributes that the memory region is currently using. The bit mask of
132 /// available attributes is defined in GetMemoryMap().
133 ///
134 UINT64 Attributes;
135 ///
136 /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the
137 /// AddMemorySpace() function description.
138 ///
139 EFI_GCD_MEMORY_TYPE GcdMemoryType;
140
141 ///
142 /// The image handle of the agent that allocated the memory resource described by
143 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory
144 /// resource is not currently allocated. Type EFI_HANDLE is defined in
145 /// InstallProtocolInterface() in the UEFI 2.0 specification.
146 ///
147 EFI_HANDLE ImageHandle;
148
149 ///
150 /// The device handle for which the memory resource has been allocated. If
151 /// ImageHandle is NULL, then the memory resource is not currently allocated. If this
152 /// field is NULL, then the memory resource is not associated with a device that is
153 /// described by a device handle. Type EFI_HANDLE is defined in
154 /// InstallProtocolInterface() in the UEFI 2.0 specification.
155 ///
156 EFI_HANDLE DeviceHandle;
157 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
158
159 ///
160 /// EFI_GCD_IO_SPACE_DESCRIPTOR.
161 ///
162 typedef struct {
163 ///
164 /// Physical address of the first byte in the I/O region. Type
165 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
166 /// description in the UEFI 2.0 specification.
167 ///
168 EFI_PHYSICAL_ADDRESS BaseAddress;
169
170 ///
171 /// Number of bytes in the I/O region.
172 ///
173 UINT64 Length;
174
175 ///
176 /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the
177 /// AddIoSpace() function description.
178 ///
179 EFI_GCD_IO_TYPE GcdIoType;
180
181 ///
182 /// The image handle of the agent that allocated the I/O resource described by
183 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O
184 /// resource is not currently allocated. Type EFI_HANDLE is defined in
185 /// InstallProtocolInterface() in the UEFI 2.0 specification.
186 ///
187 EFI_HANDLE ImageHandle;
188
189 ///
190 /// The device handle for which the I/O resource has been allocated. If ImageHandle
191 /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then
192 /// the I/O resource is not associated with a device that is described by a device handle.
193 /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI
194 /// 2.0 specification.
195 ///
196 EFI_HANDLE DeviceHandle;
197 } EFI_GCD_IO_SPACE_DESCRIPTOR;
198
199
200 /**
201 Adds reserved memory, system memory, or memory-mapped I/O resources to the
202 global coherency domain of the processor.
203
204 @param GcdMemoryType The type of memory resource being added.
205 @param BaseAddress The physical address that is the start address
206 of the memory resource being added.
207 @param Length The size, in bytes, of the memory resource that
208 is being added.
209 @param Capabilities The bit mask of attributes that the memory
210 resource region supports.
211
212 @retval EFI_SUCCESS The memory resource was added to the global
213 coherency domain of the processor.
214 @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
215 @retval EFI_INVALID_PARAMETER Length is zero.
216 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add
217 the memory resource to the global coherency
218 domain of the processor.
219 @retval EFI_UNSUPPORTED The processor does not support one or more bytes
220 of the memory resource range specified by
221 BaseAddress and Length.
222 @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range
223 specified by BaseAddress and Length conflicts
224 with a memory resource range that was previously
225 added to the global coherency domain of the processor.
226 @retval EFI_ACCESS_DENIED One or more bytes of the memory resource range
227 specified by BaseAddress and Length was allocated
228 in a prior call to AllocateMemorySpace().
229
230 **/
231 typedef
232 EFI_STATUS
233 (EFIAPI *EFI_ADD_MEMORY_SPACE)(
234 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
235 IN EFI_PHYSICAL_ADDRESS BaseAddress,
236 IN UINT64 Length,
237 IN UINT64 Capabilities
238 );
239
240 /**
241 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
242 I/O resources from the global coherency domain of the processor.
243
244 @param GcdAllocateType The type of allocation to perform.
245 @param GcdMemoryType The type of memory resource being allocated.
246 @param Alignment The log base 2 of the boundary that BaseAddress must
247 be aligned on output. Align with 2^Alignment.
248 @param Length The size in bytes of the memory resource range that
249 is being allocated.
250 @param BaseAddress A pointer to a physical address to allocate.
251 @param Imagehandle The image handle of the agent that is allocating
252 the memory resource.
253 @param DeviceHandle The device handle for which the memory resource
254 is being allocated.
255
256 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
257 @retval EFI_INVALID_PARAMETER GcdMemoryType is invalid.
258 @retval EFI_INVALID_PARAMETER Length is zero.
259 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
260 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
261 @retval EFI_NOT_FOUND The memory resource request could not be satisfied.
262 No descriptor contains the desired space.
263 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the memory
264 resource from the global coherency domain of the processor.
265 @retval EFI_SUCCESS The memory resource was allocated from the global coherency
266 domain of the processor.
267
268
269 **/
270 typedef
271 EFI_STATUS
272 (EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)(
273 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
274 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
275 IN UINTN Alignment,
276 IN UINT64 Length,
277 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
278 IN EFI_HANDLE ImageHandle,
279 IN EFI_HANDLE DeviceHandle OPTIONAL
280 );
281
282 /**
283 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
284 I/O resources from the global coherency domain of the processor.
285
286 @param BaseAddress The physical address that is the start address of the memory resource being freed.
287 @param Length The size in bytes of the memory resource range that is being freed.
288
289 @retval EFI_SUCCESS The memory resource was freed from the global coherency domain of
290 the processor.
291 @retval EFI_INVALID_PARAMETER Length is zero.
292 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
293 resource range specified by BaseAddress and Length.
294 @retval EFI_NOT_FOUND The memory resource range specified by BaseAddress and
295 Length was not allocated with previous calls to AllocateMemorySpace().
296 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the memory resource
297 from the global coherency domain of the processor.
298
299 **/
300 typedef
301 EFI_STATUS
302 (EFIAPI *EFI_FREE_MEMORY_SPACE)(
303 IN EFI_PHYSICAL_ADDRESS BaseAddress,
304 IN UINT64 Length
305 );
306
307 /**
308 Removes reserved memory, system memory, or memory-mapped I/O resources from
309 the global coherency domain of the processor.
310
311 @param BaseAddress The physical address that is the start address of the memory resource being removed.
312 @param Length The size in bytes of the memory resource that is being removed.
313
314 @retval EFI_SUCCESS The memory resource was removed from the global coherency
315 domain of the processor.
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_NOT_FOUND One or more bytes of the memory resource range specified by
320 BaseAddress and Length was not added with previous calls to
321 AddMemorySpace().
322 @retval EFI_ACCESS_DEFINED One or more bytes of the memory resource range specified by
323 BaseAddress and Length has been allocated with AllocateMemorySpace().
324 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the memory
325 resource from the global coherency domain of the processor.
326
327 **/
328 typedef
329 EFI_STATUS
330 (EFIAPI *EFI_REMOVE_MEMORY_SPACE)(
331 IN EFI_PHYSICAL_ADDRESS BaseAddress,
332 IN UINT64 Length
333 );
334
335 /**
336 Retrieves the descriptor for a memory region containing a specified address.
337
338 @param BaseAddress The physical address that is the start address of a memory region.
339 @param Descriptor A pointer to a caller allocated descriptor.
340
341 @retval EFI_SUCCESS The descriptor for the memory resource region containing
342 BaseAddress was returned in Descriptor.
343 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
344 @retval EFI_NOT_FOUND A memory resource range containing BaseAddress was not found.
345
346 **/
347 typedef
348 EFI_STATUS
349 (EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)(
350 IN EFI_PHYSICAL_ADDRESS BaseAddress,
351 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
352 );
353
354 /**
355 Modifies the attributes for a memory region in the global coherency domain of the
356 processor.
357
358 @param BaseAddress The physical address that is the start address of a memory region.
359 @param Length The size in bytes of the memory region.
360 @param Attributes The bit mask of attributes to set for the memory region.
361
362 @retval EFI_SUCCESS The attributes were set for the memory region.
363 @retval EFI_INVALID_PARAMETER Length is zero.
364 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the memory
365 resource range specified by BaseAddress and Length.
366 @retval EFI_UNSUPPORTED The bit mask of attributes is not support for the memory resource
367 range specified by BaseAddress and Length.
368 @retval EFI_ACCESS_DEFINED The attributes for the memory resource range specified by
369 BaseAddress and Length cannot be modified.
370 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the attributes of
371 the memory resource range.
372 @retval EFI_NOT_AVAILABLE_YET The attributes cannot be set because CPU architectural protocol is
373 not available yet.
374 **/
375 typedef
376 EFI_STATUS
377 (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)(
378 IN EFI_PHYSICAL_ADDRESS BaseAddress,
379 IN UINT64 Length,
380 IN UINT64 Attributes
381 );
382
383 /**
384 Returns a map of the memory resources in the global coherency domain of the
385 processor.
386
387 @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.
388 @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.
389
390 @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap
391 buffer, and the number of descriptors in MemorySpaceMap was
392 returned in NumberOfDescriptors.
393 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
394 @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.
395 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap.
396
397 **/
398 typedef
399 EFI_STATUS
400 (EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(
401 OUT UINTN *NumberOfDescriptors,
402 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
403 );
404
405 /**
406 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
407
408 @param GcdIoType The type of I/O resource being added.
409 @param BaseAddress The physical address that is the start address of the I/O resource being added.
410 @param Length The size in bytes of the I/O resource that is being added.
411
412 @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of
413 the processor.
414 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
415 @retval EFI_INVALID_PARAMETER Length is zero.
416 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to
417 the global coherency domain of the processor.
418 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
419 resource range specified by BaseAddress and Length.
420 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
421 BaseAddress and Length conflicts with an I/O resource
422 range that was previously added to the global coherency domain
423 of the processor.
424 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
425 BaseAddress and Length was allocated in a prior call to
426 AllocateIoSpace().
427
428 **/
429 typedef
430 EFI_STATUS
431 (EFIAPI *EFI_ADD_IO_SPACE)(
432 IN EFI_GCD_IO_TYPE GcdIoType,
433 IN EFI_PHYSICAL_ADDRESS BaseAddress,
434 IN UINT64 Length
435 );
436
437 /**
438 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
439 domain of the processor.
440
441 @param GcdAllocateType The type of allocation to perform.
442 @param GcdIoType The type of I/O resource being allocated.
443 @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output.
444 @param Length The size in bytes of the I/O resource range that is being allocated.
445 @param BaseAddress A pointer to a physical address.
446 @param Imagehandle The image handle of the agent that is allocating the I/O resource.
447 @param DeviceHandle The device handle for which the I/O resource is being allocated.
448
449 @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain
450 of the processor.
451 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
452 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
453 @retval EFI_INVALID_PARAMETER Length is zero.
454 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
455 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
456 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O
457 resource from the global coherency domain of the processor.
458 @retval EFI_NOT_FOUND The I/O resource request could not be satisfied.
459
460 **/
461 typedef
462 EFI_STATUS
463 (EFIAPI *EFI_ALLOCATE_IO_SPACE)(
464 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
465 IN EFI_GCD_IO_TYPE GcdIoType,
466 IN UINTN Alignment,
467 IN UINT64 Length,
468 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
469 IN EFI_HANDLE ImageHandle,
470 IN EFI_HANDLE DeviceHandle OPTIONAL
471 );
472
473 /**
474 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
475 domain of the processor.
476
477 @param BaseAddress The physical address that is the start address of the I/O resource being freed.
478 @param Length The size in bytes of the I/O resource range that is being freed.
479
480 @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the
481 processor.
482 @retval EFI_INVALID_PARAMETER Length is zero.
483 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource
484 range specified by BaseAddress and Length.
485 @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length
486 was not allocated with previous calls to AllocateIoSpace().
487 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from
488 the global coherency domain of the processor.
489
490 **/
491 typedef
492 EFI_STATUS
493 (EFIAPI *EFI_FREE_IO_SPACE)(
494 IN EFI_PHYSICAL_ADDRESS BaseAddress,
495 IN UINT64 Length
496 );
497
498 /**
499 Removes reserved I/O or I/O resources from the global coherency domain of the
500 processor.
501
502 @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being
503 removed.
504 @param Length The size in bytes of the I/O resource that is being removed.
505
506 @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain
507 of the processor.
508 @retval EFI_INVALID_PARAMETER Length is zero.
509 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
510 resource range specified by BaseAddress and Length.
511 @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by
512 BaseAddress and Length was not added with previous
513 calls to AddIoSpace().
514 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
515 BaseAddress and Length has been allocated with
516 AllocateIoSpace().
517 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O
518 resource from the global coherency domain of the processor.
519
520 **/
521 typedef
522 EFI_STATUS
523 (EFIAPI *EFI_REMOVE_IO_SPACE)(
524 IN EFI_PHYSICAL_ADDRESS BaseAddress,
525 IN UINT64 Length
526 );
527
528 /**
529 Retrieves the descriptor for an I/O region containing a specified address.
530
531 @param BaseAddress The physical address that is the start address of an I/O region.
532 @param Descriptor A pointer to a caller allocated descriptor.
533
534 @retval EFI_SUCCESS The descriptor for the I/O resource region containing
535 BaseAddress was returned in Descriptor.
536 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
537 @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found.
538
539 **/
540 typedef
541 EFI_STATUS
542 (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(
543 IN EFI_PHYSICAL_ADDRESS BaseAddress,
544 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
545 );
546
547 /**
548 Returns a map of the I/O resources in the global coherency domain of the processor.
549
550 @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.
551 @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.
552
553 @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and
554 the number of descriptors in IoSpaceMap was returned in
555 NumberOfDescriptors.
556 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
557 @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.
558 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap.
559
560
561 **/
562 typedef
563 EFI_STATUS
564 (EFIAPI *EFI_GET_IO_SPACE_MAP)(
565 OUT UINTN *NumberOfDescriptors,
566 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
567 );
568
569
570
571 /**
572 Loads and executed DXE drivers from firmware volumes.
573
574 The Dispatch() function searches for DXE drivers in firmware volumes that have been
575 installed since the last time the Dispatch() service was called. It then evaluates
576 the dependency expressions of all the DXE drivers and loads and executes those DXE
577 drivers whose dependency expression evaluate to TRUE. This service must interact with
578 the Security Architectural Protocol to authenticate DXE drivers before they are executed.
579 This process is continued until no more DXE drivers can be executed.
580
581 @retval EFI_SUCCESS One or more DXE driver were dispatched.
582 @retval EFI_NOT_FOUND No DXE drivers were dispatched.
583 @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.
584 Thus, no action was taken.
585
586 **/
587 typedef
588 EFI_STATUS
589 (EFIAPI *EFI_DISPATCH)(
590 VOID
591 );
592
593 /**
594 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
595
596 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
597 @param FileName A pointer to the name of the file in a firmware volume.
598
599 @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared.
600 @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR
601 bit is not set.
602
603 **/
604 typedef
605 EFI_STATUS
606 (EFIAPI *EFI_SCHEDULE)(
607 IN EFI_HANDLE FirmwareVolumeHandle,
608 IN CONST EFI_GUID *FileName
609 );
610
611 /**
612 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
613
614 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
615 @param DriverName A pointer to the name of the file in a firmware volume.
616
617 @return Status of promoting FFS from untrusted to trusted
618 state.
619 @retval EFI_NOT_FOUND The file was not found in the untrusted state.
620
621 **/
622 typedef
623 EFI_STATUS
624 (EFIAPI *EFI_TRUST)(
625 IN EFI_HANDLE FirmwareVolumeHandle,
626 IN CONST EFI_GUID *FileName
627 );
628
629 /**
630 Creates a firmware volume handle for a firmware volume that is present in system memory.
631
632 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
633 @param Size The size, in bytes, of the firmware volume.
634 @param FirmwareVolumeHandle On output, a pointer to the created handle.
635
636 @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and
637 EFI_DEVICE_PATH_PROTOCOL were installed onto
638 FirmwareVolumeHandle for the firmware volume described
639 by FirmwareVolumeHeader and Size.
640 @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader
641 and Size is corrupted.
642 @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the
643 EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL
644 for the firmware volume described by FirmwareVolumeHeader and Size.
645
646 **/
647 typedef
648 EFI_STATUS
649 (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)(
650 IN CONST VOID *FirmwareVolumeHeader,
651 IN UINTN Size,
652 OUT EFI_HANDLE *FirmwareVolumeHandle
653 );
654
655 //
656 // DXE Services Table
657 //
658 #define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
659 #define DXE_SPECIFICATION_MAJOR_REVISION 1
660 #define DXE_SPECIFICATION_MINOR_REVISION 20
661 #define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION))
662
663 typedef struct {
664 ///
665 /// The table header for the DXE Services Table.
666 /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.
667 ///
668 EFI_TABLE_HEADER Hdr;
669
670 //
671 // Global Coherency Domain Services
672 //
673 EFI_ADD_MEMORY_SPACE AddMemorySpace;
674 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
675 EFI_FREE_MEMORY_SPACE FreeMemorySpace;
676 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
677 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
678 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
679 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
680 EFI_ADD_IO_SPACE AddIoSpace;
681 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
682 EFI_FREE_IO_SPACE FreeIoSpace;
683 EFI_REMOVE_IO_SPACE RemoveIoSpace;
684 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
685 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
686
687 //
688 // Dispatcher Services
689 //
690 EFI_DISPATCH Dispatch;
691 EFI_SCHEDULE Schedule;
692 EFI_TRUST Trust;
693 //
694 // Service to process a single firmware volume found in a capsule
695 //
696 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
697 } DXE_SERVICES;
698
699 typedef DXE_SERVICES EFI_DXE_SERVICES;
700
701
702 /**
703 The function prototype for invoking a function on an Application Processor.
704
705 This definition is used by the UEFI MP Serices Protocol, and the
706 PI SMM System Table.
707
708 @param[in,out] Buffer The pointer to private data buffer.
709 **/
710 typedef
711 VOID
712 (EFIAPI *EFI_AP_PROCEDURE)(
713 IN OUT VOID *Buffer
714 );
715
716 #endif