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