]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiDxeCis.h
Fix doxygen issue:
[mirror_edk2.git] / MdePkg / Include / Pi / PiDxeCis.h
1 /** @file
2 Include file matches things in PI.
3
4 Copyright (c) 2006 - 2007, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 @par Revision Reference:
14 Version 1.0.
15
16 **/
17
18 #ifndef __PI_DXECIS_H__
19 #define __PI_DXECIS_H__
20
21 #include <Pi/PiMultiPhase.h>
22
23 ///
24 /// Global Coherencey Domain types - Memory type
25 ///
26 typedef enum {
27 EfiGcdMemoryTypeNonExistent,
28 EfiGcdMemoryTypeReserved,
29 EfiGcdMemoryTypeSystemMemory,
30 EfiGcdMemoryTypeMemoryMappedIo,
31 EfiGcdMemoryTypeMaximum
32 } EFI_GCD_MEMORY_TYPE;
33
34 ///
35 /// Global Coherencey Domain types - IO type
36 ///
37 typedef enum {
38 EfiGcdIoTypeNonExistent,
39 EfiGcdIoTypeReserved,
40 EfiGcdIoTypeIo,
41 EfiGcdIoTypeMaximum
42 } EFI_GCD_IO_TYPE;
43
44 ///
45 /// The type of allocation to perform.
46 ///
47 typedef enum {
48 EfiGcdAllocateAnySearchBottomUp,
49 EfiGcdAllocateMaxAddressSearchBottomUp,
50 EfiGcdAllocateAddress,
51 EfiGcdAllocateAnySearchTopDown,
52 EfiGcdAllocateMaxAddressSearchTopDown,
53 EfiGcdMaxAllocateType
54 } EFI_GCD_ALLOCATE_TYPE;
55
56 ///
57 /// EFI_GCD_MEMORY_SPACE_DESCRIPTOR
58 ///
59 typedef struct {
60 ///
61 /// The physical address of the first byte in the memory region. Type
62 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
63 /// description in the UEFI 2.0 specification
64 ///
65 EFI_PHYSICAL_ADDRESS BaseAddress;
66
67 ///
68 /// The number of bytes in the memory region.
69 ///
70 UINT64 Length;
71
72 ///
73 /// The bit mask of attributes that the memory region is capable of supporting. The bit
74 /// mask of available attributes is defined in the GetMemoryMap() function description
75 /// in the UEFI 2.0 specification.
76 ///
77 UINT64 Capabilities;
78 ///
79 /// The bit mask of attributes that the memory region is currently using. The bit mask of
80 /// available attributes is defined in GetMemoryMap().
81 ///
82 UINT64 Attributes;
83 ///
84 /// Type of the memory region. Type EFI_GCD_MEMORY_TYPE is defined in the
85 /// AddMemorySpace() function description
86 ///
87 EFI_GCD_MEMORY_TYPE GcdMemoryType;
88
89 ///
90 /// The image handle of the agent that allocated the memory resource described by
91 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the memory
92 /// resource is not currently allocated. Type EFI_HANDLE is defined in
93 /// InstallProtocolInterface() in the UEFI 2.0 specification.
94 ///
95 EFI_HANDLE ImageHandle;
96
97 ///
98 /// The device handle for which the memory resource has been allocated. If
99 /// ImageHandle is NULL, then the memory resource is not currently allocated. If this
100 /// field is NULL, then the memory resource is not associated with a device that is
101 /// described by a device handle. Type EFI_HANDLE is defined in
102 /// InstallProtocolInterface() in the UEFI 2.0 specification.
103 ///
104 EFI_HANDLE DeviceHandle;
105 } EFI_GCD_MEMORY_SPACE_DESCRIPTOR;
106
107 ///
108 /// EFI_GCD_IO_SPACE_DESCRIPTOR
109 ///
110 typedef struct {
111 ///
112 /// Physical address of the first byte in the I/O region. Type
113 /// EFI_PHYSICAL_ADDRESS is defined in the AllocatePages() function
114 /// description in the UEFI 2.0 specification.
115 ///
116 EFI_PHYSICAL_ADDRESS BaseAddress;
117
118 /// Number of bytes in the I/O region.
119 UINT64 Length;
120
121 ///
122 /// Type of the I/O region. Type EFI_GCD_IO_TYPE is defined in the
123 /// AddIoSpace() function description.
124 ///
125 EFI_GCD_IO_TYPE GcdIoType;
126
127 ///
128 /// The image handle of the agent that allocated the I/O resource described by
129 /// PhysicalStart and NumberOfBytes. If this field is NULL, then the I/O
130 /// resource is not currently allocated. Type EFI_HANDLE is defined in
131 /// InstallProtocolInterface() in the UEFI 2.0 specification.
132 ///
133 EFI_HANDLE ImageHandle;
134
135 ///
136 /// The device handle for which the I/O resource has been allocated. If ImageHandle
137 /// is NULL, then the I/O resource is not currently allocated. If this field is NULL, then
138 /// the I/O resource is not associated with a device that is described by a device handle.
139 /// Type EFI_HANDLE is defined in InstallProtocolInterface() in the UEFI
140 /// 2.0 specification.
141 ///
142 EFI_HANDLE DeviceHandle;
143 } EFI_GCD_IO_SPACE_DESCRIPTOR;
144
145
146 /**
147 Adds reserved memory, system memory, or memory-mapped I/O resources to the
148 global coherency domain of the processor.
149
150 @param GcdMemoryType Memory type of the memory space.
151 @param BaseAddress Base address of the memory space.
152 @param Length Length of the memory space.
153 @param Capabilities alterable attributes of the memory space.
154
155 @retval EFI_SUCCESS Merged this memory space into GCD map.
156
157 **/
158 typedef
159 EFI_STATUS
160 (EFIAPI *EFI_ADD_MEMORY_SPACE)(
161 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
162 IN EFI_PHYSICAL_ADDRESS BaseAddress,
163 IN UINT64 Length,
164 IN UINT64 Capabilities
165 )
166 ;
167
168 /**
169 Allocates nonexistent memory, reserved memory, system memory, or memorymapped
170 I/O resources from the global coherency domain of the processor.
171
172 @param GcdAllocateType The type of allocate operation
173 @param GcdMemoryType The desired memory type
174 @param Alignment Align with 2^Alignment
175 @param Length Length to allocate
176 @param BaseAddress Base address to allocate
177 @param Imagehandle The image handle consume the allocated space.
178 @param DeviceHandle The device handle consume the allocated space.
179
180 @retval EFI_INVALID_PARAMETER Invalid parameter.
181 @retval EFI_NOT_FOUND No descriptor contains the desired space.
182 @retval EFI_SUCCESS Memory space successfully allocated.
183
184 **/
185 typedef
186 EFI_STATUS
187 (EFIAPI *EFI_ALLOCATE_MEMORY_SPACE)(
188 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
189 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,
190 IN UINTN Alignment,
191 IN UINT64 Length,
192 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
193 IN EFI_HANDLE ImageHandle,
194 IN EFI_HANDLE DeviceHandle OPTIONAL
195 )
196 ;
197
198 /**
199 Frees nonexistent memory, reserved memory, system memory, or memory-mapped
200 I/O resources from the global coherency domain of the processor.
201
202 @param BaseAddress Base address of the segment.
203 @param Length Length of the segment.
204
205 @retval EFI_SUCCESS Space successfully freed.
206
207 **/
208 typedef
209 EFI_STATUS
210 (EFIAPI *EFI_FREE_MEMORY_SPACE)(
211 IN EFI_PHYSICAL_ADDRESS BaseAddress,
212 IN UINT64 Length
213 )
214 ;
215
216 /**
217 Removes reserved memory, system memory, or memory-mapped I/O resources from
218 the global coherency domain of the processor.
219
220 @param BaseAddress Base address of the memory space.
221 @param Length Length of the memory space.
222
223 @retval EFI_SUCCESS Successfully remove a segment of memory space.
224
225 **/
226 typedef
227 EFI_STATUS
228 (EFIAPI *EFI_REMOVE_MEMORY_SPACE)(
229 IN EFI_PHYSICAL_ADDRESS BaseAddress,
230 IN UINT64 Length
231 )
232 ;
233
234 /**
235 Retrieves the descriptor for a memory region containing a specified address.
236
237 @param BaseAddress Specified start address
238 @param Descriptor Specified length
239
240 @retval EFI_INVALID_PARAMETER Invalid parameter
241 @retval EFI_SUCCESS Successfully get memory space descriptor.
242
243 **/
244 typedef
245 EFI_STATUS
246 (EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR)(
247 IN EFI_PHYSICAL_ADDRESS BaseAddress,
248 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor
249 )
250 ;
251
252 /**
253 Modifies the attributes for a memory region in the global coherency domain of the
254 processor.
255
256 @param BaseAddress Specified start address
257 @param Length Specified length
258 @param Attributes Specified attributes
259
260 @retval EFI_SUCCESS Successfully set attribute of a segment of memory space.
261
262 **/
263 typedef
264 EFI_STATUS
265 (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES)(
266 IN EFI_PHYSICAL_ADDRESS BaseAddress,
267 IN UINT64 Length,
268 IN UINT64 Attributes
269 )
270 ;
271
272 /**
273 Returns a map of the memory resources in the global coherency domain of the
274 processor.
275
276 @param NumberOfDescriptors Number of descriptors.
277 @param MemorySpaceMap Descriptor array
278
279 @retval EFI_INVALID_PARAMETER Invalid parameter
280 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
281 @retval EFI_SUCCESS Successfully get memory space map.
282
283 **/
284 typedef
285 EFI_STATUS
286 (EFIAPI *EFI_GET_MEMORY_SPACE_MAP)(
287 OUT UINTN *NumberOfDescriptors,
288 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
289 )
290 ;
291
292 /**
293 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
294
295 @param GcdIoType IO type of the segment.
296 @param BaseAddress Base address of the segment.
297 @param Length Length of the segment.
298
299 @retval EFI_SUCCESS Merged this segment into GCD map.
300
301 **/
302 typedef
303 EFI_STATUS
304 (EFIAPI *EFI_ADD_IO_SPACE)(
305 IN EFI_GCD_IO_TYPE GcdIoType,
306 IN EFI_PHYSICAL_ADDRESS BaseAddress,
307 IN UINT64 Length
308 )
309 ;
310
311 /**
312 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
313 domain of the processor.
314
315 @param GcdAllocateType The type of allocate operation
316 @param GcdIoType The desired IO type
317 @param Alignment Align with 2^Alignment
318 @param Length Length to allocate
319 @param BaseAddress Base address to allocate
320 @param Imagehandle The image handle consume the allocated space.
321 @param DeviceHandle The device handle consume the allocated space.
322
323 @retval EFI_INVALID_PARAMETER Invalid parameter.
324 @retval EFI_NOT_FOUND No descriptor contains the desired space.
325 @retval EFI_SUCCESS IO space successfully allocated.
326
327 **/
328 typedef
329 EFI_STATUS
330 (EFIAPI *EFI_ALLOCATE_IO_SPACE)(
331 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
332 IN EFI_GCD_IO_TYPE GcdIoType,
333 IN UINTN Alignment,
334 IN UINT64 Length,
335 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
336 IN EFI_HANDLE ImageHandle,
337 IN EFI_HANDLE DeviceHandle OPTIONAL
338 )
339 ;
340
341 /**
342 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
343 domain of the processor.
344
345 @param BaseAddress Base address of the segment.
346 @param Length Length of the segment.
347
348 @retval EFI_SUCCESS Space successfully freed.
349
350 **/
351 typedef
352 EFI_STATUS
353 (EFIAPI *EFI_FREE_IO_SPACE)(
354 IN EFI_PHYSICAL_ADDRESS BaseAddress,
355 IN UINT64 Length
356 )
357 ;
358
359 /**
360 Removes reserved I/O or I/O resources from the global coherency domain of the
361 processor.
362
363 @param BaseAddress Base address of the segment.
364 @param Length Length of the segment.
365
366 @retval EFI_SUCCESS Successfully removed a segment of IO space.
367
368 **/
369 typedef
370 EFI_STATUS
371 (EFIAPI *EFI_REMOVE_IO_SPACE)(
372 IN EFI_PHYSICAL_ADDRESS BaseAddress,
373 IN UINT64 Length
374 )
375 ;
376
377 /**
378 Retrieves the descriptor for an I/O region containing a specified address.
379
380 @param BaseAddress Specified start address
381 @param Descriptor Specified length
382
383 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
384 @retval EFI_SUCCESS Successfully get the IO space descriptor.
385
386 **/
387 typedef
388 EFI_STATUS
389 (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR)(
390 IN EFI_PHYSICAL_ADDRESS BaseAddress,
391 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
392 )
393 ;
394
395 /**
396 Returns a map of the I/O resources in the global coherency domain of the processor.
397
398 @param NumberOfDescriptors Number of descriptors.
399 @param MemorySpaceMap Descriptor array
400
401 @retval EFI_INVALID_PARAMETER Invalid parameter
402 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
403 @retval EFI_SUCCESS Successfully get IO space map.
404
405 **/
406 typedef
407 EFI_STATUS
408 (EFIAPI *EFI_GET_IO_SPACE_MAP)(
409 OUT UINTN *NumberOfDescriptors,
410 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
411 )
412 ;
413
414
415
416 /**
417 Loads and executed DXE drivers from firmware volumes.
418
419 @return Status code
420
421 **/
422 typedef
423 EFI_STATUS
424 (EFIAPI *EFI_DISPATCH)(
425 VOID
426 )
427 ;
428
429 /**
430 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
431
432 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
433 @param DriverName A pointer to the name of the file in a firmware volume.
434
435 @return Status code
436
437 **/
438 typedef
439 EFI_STATUS
440 (EFIAPI *EFI_SCHEDULE)(
441 IN EFI_HANDLE FirmwareVolumeHandle,
442 IN EFI_GUID *DriverName
443 )
444 ;
445
446 /**
447 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
448
449 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
450 @param DriverName A pointer to the name of the file in a firmware volume.
451
452 @return Status code
453
454 **/
455 typedef
456 EFI_STATUS
457 (EFIAPI *EFI_TRUST)(
458 IN EFI_HANDLE FirmwareVolumeHandle,
459 IN EFI_GUID *DriverName
460 )
461 ;
462
463 /**
464 Creates a firmware volume handle for a firmware volume that is present in system memory.
465
466 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
467 @param Size The size, in bytes, of the firmware volume.
468 @param FirmwareVolumeHandle On output, a pointer to the created handle.
469
470 @return Status code
471
472 **/
473 typedef
474 EFI_STATUS
475 (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME)(
476 IN VOID *FvHeader,
477 IN UINTN Size,
478 OUT EFI_HANDLE *FirmwareVolumeHandle
479 )
480 ;
481
482 //
483 // DXE Services Table
484 //
485 #define DXE_SERVICES_SIGNATURE 0x565245535f455844ULL
486 #define DXE_SERVICES_REVISION ((1<<16) | (00))
487
488 typedef struct {
489 EFI_TABLE_HEADER Hdr;
490
491 //
492 // Global Coherency Domain Services
493 //
494 EFI_ADD_MEMORY_SPACE AddMemorySpace;
495 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
496 EFI_FREE_MEMORY_SPACE FreeMemorySpace;
497 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
498 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
499 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
500 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
501 EFI_ADD_IO_SPACE AddIoSpace;
502 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
503 EFI_FREE_IO_SPACE FreeIoSpace;
504 EFI_REMOVE_IO_SPACE RemoveIoSpace;
505 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
506 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
507
508 //
509 // Dispatcher Services
510 //
511 EFI_DISPATCH Dispatch;
512 EFI_SCHEDULE Schedule;
513 EFI_TRUST Trust;
514 //
515 // Service to process a single firmware volume found in a capsule
516 //
517 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
518 } DXE_SERVICES;
519
520 typedef DXE_SERVICES EFI_DXE_SERVICES;
521
522 #endif