]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiDxeCis.h
MdePkg/MdeModulePkg: Implement the missing SetMemorySpaceCapabilities function.
[mirror_edk2.git] / MdePkg / Include / Pi / PiDxeCis.h
1 /** @file
2 Include file matches things in PI.
3
4 Copyright (c) 2006 - 2014, 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_DENIED 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 Modifies the capabilities for a memory region in the global coherency domain of the
385 processor.
386
387 @param BaseAddress The physical address that is the start address of a memory region.
388 @param Length The size in bytes of the memory region.
389 @param Capabilities The bit mask of capabilities that the memory region supports.
390
391 @retval EFI_SUCCESS The capabilities were set for the memory region.
392 @retval EFI_INVALID_PARAMETER Length is zero.
393 @retval EFI_UNSUPPORTED The capabilities specified by Capabilities do not include the
394 memory region attributes currently in use.
395 @retval EFI_ACCESS_DENIED The capabilities for the memory resource range specified by
396 BaseAddress and Length cannot be modified.
397 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to modify the capabilities
398 of the memory resource range.
399 **/
400 typedef
401 EFI_STATUS
402 (EFIAPI *EFI_SET_MEMORY_SPACE_CAPABILITIES) (
403 IN EFI_PHYSICAL_ADDRESS BaseAddress,
404 IN UINT64 Length,
405 IN UINT64 Capabilities
406 );
407
408 /**
409 Returns a map of the memory resources in the global coherency domain of the
410 processor.
411
412 @param NumberOfDescriptors A pointer to number of descriptors returned in the MemorySpaceMap buffer.
413 @param MemorySpaceMap A pointer to the array of EFI_GCD_MEMORY_SPACE_DESCRIPTORs.
414
415 @retval EFI_SUCCESS The memory space map was returned in the MemorySpaceMap
416 buffer, and the number of descriptors in MemorySpaceMap was
417 returned in NumberOfDescriptors.
418 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
419 @retval EFI_INVALID_PARAMETER MemorySpaceMap is NULL.
420 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate MemorySpaceMap.
421
422 **/
423 typedef
424 EFI_STATUS
425 (EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(
426 OUT UINTN *NumberOfDescriptors,
427 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
428 );
429
430 /**
431 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
432
433 @param GcdIoType The type of I/O resource being added.
434 @param BaseAddress The physical address that is the start address of the I/O resource being added.
435 @param Length The size in bytes of the I/O resource that is being added.
436
437 @retval EFI_SUCCESS The I/O resource was added to the global coherency domain of
438 the processor.
439 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
440 @retval EFI_INVALID_PARAMETER Length is zero.
441 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to add the I/O resource to
442 the global coherency domain of the processor.
443 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
444 resource range specified by BaseAddress and Length.
445 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
446 BaseAddress and Length conflicts with an I/O resource
447 range that was previously added to the global coherency domain
448 of the processor.
449 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
450 BaseAddress and Length was allocated in a prior call to
451 AllocateIoSpace().
452
453 **/
454 typedef
455 EFI_STATUS
456 (EFIAPI *EFI_ADD_IO_SPACE)(
457 IN EFI_GCD_IO_TYPE GcdIoType,
458 IN EFI_PHYSICAL_ADDRESS BaseAddress,
459 IN UINT64 Length
460 );
461
462 /**
463 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
464 domain of the processor.
465
466 @param GcdAllocateType The type of allocation to perform.
467 @param GcdIoType The type of I/O resource being allocated.
468 @param Alignment The log base 2 of the boundary that BaseAddress must be aligned on output.
469 @param Length The size in bytes of the I/O resource range that is being allocated.
470 @param BaseAddress A pointer to a physical address.
471 @param Imagehandle The image handle of the agent that is allocating the I/O resource.
472 @param DeviceHandle The device handle for which the I/O resource is being allocated.
473
474 @retval EFI_SUCCESS The I/O resource was allocated from the global coherency domain
475 of the processor.
476 @retval EFI_INVALID_PARAMETER GcdAllocateType is invalid.
477 @retval EFI_INVALID_PARAMETER GcdIoType is invalid.
478 @retval EFI_INVALID_PARAMETER Length is zero.
479 @retval EFI_INVALID_PARAMETER BaseAddress is NULL.
480 @retval EFI_INVALID_PARAMETER ImageHandle is NULL.
481 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to allocate the I/O
482 resource from the global coherency domain of the processor.
483 @retval EFI_NOT_FOUND The I/O resource request could not be satisfied.
484
485 **/
486 typedef
487 EFI_STATUS
488 (EFIAPI *EFI_ALLOCATE_IO_SPACE)(
489 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
490 IN EFI_GCD_IO_TYPE GcdIoType,
491 IN UINTN Alignment,
492 IN UINT64 Length,
493 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
494 IN EFI_HANDLE ImageHandle,
495 IN EFI_HANDLE DeviceHandle OPTIONAL
496 );
497
498 /**
499 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
500 domain of the processor.
501
502 @param BaseAddress The physical address that is the start address of the I/O resource being freed.
503 @param Length The size in bytes of the I/O resource range that is being freed.
504
505 @retval EFI_SUCCESS The I/O resource was freed from the global coherency domain of the
506 processor.
507 @retval EFI_INVALID_PARAMETER Length is zero.
508 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O resource
509 range specified by BaseAddress and Length.
510 @retval EFI_NOT_FOUND The I/O resource range specified by BaseAddress and Length
511 was not allocated with previous calls to AllocateIoSpace().
512 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to free the I/O resource from
513 the global coherency domain of the processor.
514
515 **/
516 typedef
517 EFI_STATUS
518 (EFIAPI *EFI_FREE_IO_SPACE)(
519 IN EFI_PHYSICAL_ADDRESS BaseAddress,
520 IN UINT64 Length
521 );
522
523 /**
524 Removes reserved I/O or I/O resources from the global coherency domain of the
525 processor.
526
527 @param BaseAddress A pointer to a physical address that is the start address of the I/O resource being
528 removed.
529 @param Length The size in bytes of the I/O resource that is being removed.
530
531 @retval EFI_SUCCESS The I/O resource was removed from the global coherency domain
532 of the processor.
533 @retval EFI_INVALID_PARAMETER Length is zero.
534 @retval EFI_UNSUPPORTED The processor does not support one or more bytes of the I/O
535 resource range specified by BaseAddress and Length.
536 @retval EFI_NOT_FOUND One or more bytes of the I/O resource range specified by
537 BaseAddress and Length was not added with previous
538 calls to AddIoSpace().
539 @retval EFI_ACCESS_DENIED One or more bytes of the I/O resource range specified by
540 BaseAddress and Length has been allocated with
541 AllocateIoSpace().
542 @retval EFI_OUT_OF_RESOURCES There are not enough system resources to remove the I/O
543 resource from the global coherency domain of the processor.
544
545 **/
546 typedef
547 EFI_STATUS
548 (EFIAPI *EFI_REMOVE_IO_SPACE)(
549 IN EFI_PHYSICAL_ADDRESS BaseAddress,
550 IN UINT64 Length
551 );
552
553 /**
554 Retrieves the descriptor for an I/O region containing a specified address.
555
556 @param BaseAddress The physical address that is the start address of an I/O region.
557 @param Descriptor A pointer to a caller allocated descriptor.
558
559 @retval EFI_SUCCESS The descriptor for the I/O resource region containing
560 BaseAddress was returned in Descriptor.
561 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
562 @retval EFI_NOT_FOUND An I/O resource range containing BaseAddress was not found.
563
564 **/
565 typedef
566 EFI_STATUS
567 (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(
568 IN EFI_PHYSICAL_ADDRESS BaseAddress,
569 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
570 );
571
572 /**
573 Returns a map of the I/O resources in the global coherency domain of the processor.
574
575 @param NumberOfDescriptors A pointer to number of descriptors returned in the IoSpaceMap buffer.
576 @param MemorySpaceMap A pointer to the array of EFI_GCD_IO_SPACE_DESCRIPTORs.
577
578 @retval EFI_SUCCESS The I/O space map was returned in the IoSpaceMap buffer, and
579 the number of descriptors in IoSpaceMap was returned in
580 NumberOfDescriptors.
581 @retval EFI_INVALID_PARAMETER NumberOfDescriptors is NULL.
582 @retval EFI_INVALID_PARAMETER IoSpaceMap is NULL.
583 @retval EFI_OUT_OF_RESOURCES There are not enough resources to allocate IoSpaceMap.
584
585
586 **/
587 typedef
588 EFI_STATUS
589 (EFIAPI *EFI_GET_IO_SPACE_MAP)(
590 OUT UINTN *NumberOfDescriptors,
591 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
592 );
593
594
595
596 /**
597 Loads and executed DXE drivers from firmware volumes.
598
599 The Dispatch() function searches for DXE drivers in firmware volumes that have been
600 installed since the last time the Dispatch() service was called. It then evaluates
601 the dependency expressions of all the DXE drivers and loads and executes those DXE
602 drivers whose dependency expression evaluate to TRUE. This service must interact with
603 the Security Architectural Protocol to authenticate DXE drivers before they are executed.
604 This process is continued until no more DXE drivers can be executed.
605
606 @retval EFI_SUCCESS One or more DXE driver were dispatched.
607 @retval EFI_NOT_FOUND No DXE drivers were dispatched.
608 @retval EFI_ALREADY_STARTED An attempt is being made to start the DXE Dispatcher recursively.
609 Thus, no action was taken.
610
611 **/
612 typedef
613 EFI_STATUS
614 (EFIAPI *EFI_DISPATCH)(
615 VOID
616 );
617
618 /**
619 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
620
621 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
622 @param FileName A pointer to the name of the file in a firmware volume.
623
624 @retval EFI_SUCCESS The DXE driver was found and its SOR bit was cleared.
625 @retval EFI_NOT_FOUND The DXE driver does not exist, or the DXE driver exists and its SOR
626 bit is not set.
627
628 **/
629 typedef
630 EFI_STATUS
631 (EFIAPI *EFI_SCHEDULE)(
632 IN EFI_HANDLE FirmwareVolumeHandle,
633 IN CONST EFI_GUID *FileName
634 );
635
636 /**
637 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
638
639 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
640 @param DriverName A pointer to the name of the file in a firmware volume.
641
642 @return Status of promoting FFS from untrusted to trusted
643 state.
644 @retval EFI_NOT_FOUND The file was not found in the untrusted state.
645
646 **/
647 typedef
648 EFI_STATUS
649 (EFIAPI *EFI_TRUST)(
650 IN EFI_HANDLE FirmwareVolumeHandle,
651 IN CONST EFI_GUID *FileName
652 );
653
654 /**
655 Creates a firmware volume handle for a firmware volume that is present in system memory.
656
657 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
658 @param Size The size, in bytes, of the firmware volume.
659 @param FirmwareVolumeHandle On output, a pointer to the created handle.
660
661 @retval EFI_SUCCESS The EFI_FIRMWARE_VOLUME_PROTOCOL and
662 EFI_DEVICE_PATH_PROTOCOL were installed onto
663 FirmwareVolumeHandle for the firmware volume described
664 by FirmwareVolumeHeader and Size.
665 @retval EFI_VOLUME_CORRUPTED The firmware volume described by FirmwareVolumeHeader
666 and Size is corrupted.
667 @retval EFI_OUT_OF_RESOURCES There are not enough system resources available to produce the
668 EFI_FIRMWARE_VOLUME_PROTOCOL and EFI_DEVICE_PATH_PROTOCOL
669 for the firmware volume described by FirmwareVolumeHeader and Size.
670
671 **/
672 typedef
673 EFI_STATUS
674 (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)(
675 IN CONST VOID *FirmwareVolumeHeader,
676 IN UINTN Size,
677 OUT EFI_HANDLE *FirmwareVolumeHandle
678 );
679
680 //
681 // DXE Services Table
682 //
683 #define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
684 #define DXE_SPECIFICATION_MAJOR_REVISION 1
685 #define DXE_SPECIFICATION_MINOR_REVISION 30
686 #define DXE_SERVICES_REVISION ((DXE_SPECIFICATION_MAJOR_REVISION<<16) | (DXE_SPECIFICATION_MINOR_REVISION))
687
688 typedef struct {
689 ///
690 /// The table header for the DXE Services Table.
691 /// This header contains the DXE_SERVICES_SIGNATURE and DXE_SERVICES_REVISION values.
692 ///
693 EFI_TABLE_HEADER Hdr;
694
695 //
696 // Global Coherency Domain Services
697 //
698 EFI_ADD_MEMORY_SPACE AddMemorySpace;
699 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
700 EFI_FREE_MEMORY_SPACE FreeMemorySpace;
701 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
702 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
703 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
704 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
705 EFI_ADD_IO_SPACE AddIoSpace;
706 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
707 EFI_FREE_IO_SPACE FreeIoSpace;
708 EFI_REMOVE_IO_SPACE RemoveIoSpace;
709 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
710 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
711
712 //
713 // Dispatcher Services
714 //
715 EFI_DISPATCH Dispatch;
716 EFI_SCHEDULE Schedule;
717 EFI_TRUST Trust;
718 //
719 // Service to process a single firmware volume found in a capsule
720 //
721 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
722 //
723 // Extensions to Global Coherency Domain Services
724 //
725 EFI_SET_MEMORY_SPACE_CAPABILITIES SetMemorySpaceCapabilities;
726 } DXE_SERVICES;
727
728 typedef DXE_SERVICES EFI_DXE_SERVICES;
729
730
731 /**
732 The function prototype for invoking a function on an Application Processor.
733
734 This definition is used by the UEFI MP Serices Protocol, and the
735 PI SMM System Table.
736
737 @param[in,out] Buffer The pointer to private data buffer.
738 **/
739 typedef
740 VOID
741 (EFIAPI *EFI_AP_PROCEDURE)(
742 IN OUT VOID *Buffer
743 );
744
745 #endif