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