]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Pi/PiDxeCis.h
Move to directory "Include"
[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
13 Module Name: PiDxeCis.h\r
14\r
15 @par Revision Reference:\r
16 Version 1.0.\r
17\r
18**/\r
19\r
20#ifndef __PI_DXECIS_H__\r
21#define __PI_DXECIS_H__\r
22\r
23#include <Pi/PiMultiPhase.h>\r
24\r
25//\r
26// Global Coherencey Domain types\r
27//\r
28typedef enum {\r
29 EfiGcdMemoryTypeNonExistent,\r
30 EfiGcdMemoryTypeReserved,\r
31 EfiGcdMemoryTypeSystemMemory,\r
32 EfiGcdMemoryTypeMemoryMappedIo,\r
33 EfiGcdMemoryTypeMaximum\r
34} EFI_GCD_MEMORY_TYPE;\r
35\r
36\r
37typedef enum {\r
38 EfiGcdIoTypeNonExistent,\r
39 EfiGcdIoTypeReserved,\r
40 EfiGcdIoTypeIo,\r
41 EfiGcdIoTypeMaximum\r
42} EFI_GCD_IO_TYPE;\r
43\r
44\r
45typedef enum {\r
46 EfiGcdAllocateAnySearchBottomUp,\r
47 EfiGcdAllocateMaxAddressSearchBottomUp,\r
48 EfiGcdAllocateAddress,\r
49 EfiGcdAllocateAnySearchTopDown,\r
50 EfiGcdAllocateMaxAddressSearchTopDown,\r
51 EfiGcdMaxAllocateType\r
52} EFI_GCD_ALLOCATE_TYPE;\r
53\r
54\r
55typedef struct {\r
56 EFI_PHYSICAL_ADDRESS BaseAddress;\r
57 UINT64 Length;\r
58 UINT64 Capabilities;\r
59 UINT64 Attributes;\r
60 EFI_GCD_MEMORY_TYPE GcdMemoryType;\r
61 EFI_HANDLE ImageHandle;\r
62 EFI_HANDLE DeviceHandle;\r
63} EFI_GCD_MEMORY_SPACE_DESCRIPTOR;\r
64\r
65\r
66typedef struct {\r
67 EFI_PHYSICAL_ADDRESS BaseAddress;\r
68 UINT64 Length;\r
69 EFI_GCD_IO_TYPE GcdIoType;\r
70 EFI_HANDLE ImageHandle;\r
71 EFI_HANDLE DeviceHandle;\r
72} EFI_GCD_IO_SPACE_DESCRIPTOR;\r
73\r
74\r
75/**\r
76 Adds reserved memory, system memory, or memory-mapped I/O resources to the\r
77 global coherency domain of the processor.\r
78\r
79 @param GcdMemoryType Memory type of the memory space.\r
80 @param BaseAddress Base address of the memory space.\r
81 @param Length Length of the memory space.\r
82 @param Capabilities alterable attributes of the memory space.\r
83\r
84 @retval EFI_SUCCESS Merged this memory space into GCD map.\r
85\r
86**/\r
87typedef\r
88EFI_STATUS\r
89(EFIAPI *EFI_ADD_MEMORY_SPACE) (\r
90 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
91 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
92 IN UINT64 Length,\r
93 IN UINT64 Capabilities\r
94 )\r
95;\r
96\r
97/**\r
98 Allocates nonexistent memory, reserved memory, system memory, or memorymapped\r
99 I/O resources from the global coherency domain of the processor.\r
100\r
101 @param GcdAllocateType The type of allocate operation\r
102 @param GcdMemoryType The desired memory type\r
103 @param Alignment Align with 2^Alignment\r
104 @param Length Length to allocate\r
105 @param BaseAddress Base address to allocate\r
106 @param Imagehandle The image handle consume the allocated space.\r
107 @param DeviceHandle The device handle consume the allocated space.\r
108\r
109 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
110 @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
111 @retval EFI_SUCCESS Memory space successfully allocated.\r
112\r
113**/\r
114typedef\r
115EFI_STATUS\r
116(EFIAPI *EFI_ALLOCATE_MEMORY_SPACE) (\r
117 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
118 IN EFI_GCD_MEMORY_TYPE GcdMemoryType,\r
119 IN UINTN Alignment,\r
120 IN UINT64 Length,\r
121 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
122 IN EFI_HANDLE ImageHandle,\r
123 IN EFI_HANDLE DeviceHandle OPTIONAL\r
124 )\r
125;\r
126\r
127/**\r
128 Frees nonexistent memory, reserved memory, system memory, or memory-mapped\r
129 I/O resources from the global coherency domain of the processor.\r
130\r
131 @param BaseAddress Base address of the segment.\r
132 @param Length Length of the segment.\r
133\r
134 @retval EFI_SUCCESS Space successfully freed.\r
135\r
136**/\r
137typedef\r
138EFI_STATUS\r
139(EFIAPI *EFI_FREE_MEMORY_SPACE) (\r
140 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
141 IN UINT64 Length\r
142 )\r
143;\r
144\r
145/**\r
146 Removes reserved memory, system memory, or memory-mapped I/O resources from\r
147 the global coherency domain of the processor.\r
148\r
149 @param BaseAddress Base address of the memory space.\r
150 @param Length Length of the memory space.\r
151\r
152 @retval EFI_SUCCESS Successfully remove a segment of memory space.\r
153\r
154**/\r
155typedef\r
156EFI_STATUS\r
157(EFIAPI *EFI_REMOVE_MEMORY_SPACE) (\r
158 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
159 IN UINT64 Length\r
160 )\r
161;\r
162\r
163/**\r
164 Retrieves the descriptor for a memory region containing a specified address.\r
165\r
166 @param BaseAddress Specified start address\r
167 @param Descriptor Specified length\r
168\r
169 @retval EFI_INVALID_PARAMETER Invalid parameter\r
170 @retval EFI_SUCCESS Successfully get memory space descriptor.\r
171\r
172**/\r
173typedef\r
174EFI_STATUS\r
175(EFIAPI *EFI_GET_MEMORY_SPACE_DESCRIPTOR) (\r
176 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
177 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR *Descriptor\r
178 )\r
179;\r
180\r
181/**\r
182 Modifies the attributes for a memory region in the global coherency domain of the\r
183 processor.\r
184\r
185 @param BaseAddress Specified start address\r
186 @param Length Specified length\r
187 @param Attributes Specified attributes\r
188\r
189 @retval EFI_SUCCESS Successfully set attribute of a segment of memory space.\r
190\r
191**/\r
192typedef\r
193\r
194EFI_STATUS\r
195(EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES) (\r
196 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
197 IN UINT64 Length,\r
198 IN UINT64 Attributes\r
199 )\r
200;\r
201\r
202/**\r
203 Returns a map of the memory resources in the global coherency domain of the\r
204 processor.\r
205\r
206 @param NumberOfDescriptors Number of descriptors.\r
207 @param MemorySpaceMap Descriptor array\r
208\r
209 @retval EFI_INVALID_PARAMETER Invalid parameter\r
210 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
211 @retval EFI_SUCCESS Successfully get memory space map.\r
212\r
213**/\r
214typedef\r
215EFI_STATUS\r
216(EFIAPI *EFI_GET_MEMORY_SPACE_MAP) (\r
217 OUT UINTN *NumberOfDescriptors,\r
218 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap\r
219 )\r
220;\r
221\r
222/**\r
223 Adds reserved I/O or I/O resources to the global coherency domain of the processor.\r
224\r
225 @param GcdIoType IO type of the segment.\r
226 @param BaseAddress Base address of the segment.\r
227 @param Length Length of the segment.\r
228\r
229 @retval EFI_SUCCESS Merged this segment into GCD map.\r
230\r
231**/\r
232typedef\r
233EFI_STATUS\r
234(EFIAPI *EFI_ADD_IO_SPACE) (\r
235 IN EFI_GCD_IO_TYPE GcdIoType,\r
236 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
237 IN UINT64 Length\r
238 )\r
239;\r
240\r
241/**\r
242 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
243 domain of the processor.\r
244\r
245 @param GcdAllocateType The type of allocate operation\r
246 @param GcdIoType The desired IO type\r
247 @param Alignment Align with 2^Alignment\r
248 @param Length Length to allocate\r
249 @param BaseAddress Base address to allocate\r
250 @param Imagehandle The image handle consume the allocated space.\r
251 @param DeviceHandle The device handle consume the allocated space.\r
252\r
253 @retval EFI_INVALID_PARAMETER Invalid parameter.\r
254 @retval EFI_NOT_FOUND No descriptor contains the desired space.\r
255 @retval EFI_SUCCESS IO space successfully allocated.\r
256\r
257**/\r
258typedef\r
259EFI_STATUS\r
260(EFIAPI *EFI_ALLOCATE_IO_SPACE) (\r
261 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,\r
262 IN EFI_GCD_IO_TYPE GcdIoType,\r
263 IN UINTN Alignment,\r
264 IN UINT64 Length,\r
265 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,\r
266 IN EFI_HANDLE ImageHandle,\r
267 IN EFI_HANDLE DeviceHandle OPTIONAL\r
268 )\r
269;\r
270\r
271/**\r
272 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency\r
273 domain of the processor.\r
274\r
275 @param BaseAddress Base address of the segment.\r
276 @param Length Length of the segment.\r
277\r
278 @retval EFI_SUCCESS Space successfully freed.\r
279\r
280**/\r
281typedef\r
282EFI_STATUS\r
283(EFIAPI *EFI_FREE_IO_SPACE) (\r
284 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
285 IN UINT64 Length\r
286 )\r
287;\r
288\r
289/**\r
290 Removes reserved I/O or I/O resources from the global coherency domain of the\r
291 processor.\r
292\r
293 @param BaseAddress Base address of the segment.\r
294 @param Length Length of the segment.\r
295\r
296 @retval EFI_SUCCESS Successfully removed a segment of IO space.\r
297\r
298**/\r
299typedef\r
300EFI_STATUS\r
301(EFIAPI *EFI_REMOVE_IO_SPACE) (\r
302 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
303 IN UINT64 Length\r
304 )\r
305;\r
306\r
307/**\r
308 Retrieves the descriptor for an I/O region containing a specified address.\r
309\r
310 @param BaseAddress Specified start address\r
311 @param Descriptor Specified length\r
312\r
313 @retval EFI_INVALID_PARAMETER Descriptor is NULL.\r
314 @retval EFI_SUCCESS Successfully get the IO space descriptor.\r
315\r
316**/\r
317typedef\r
318EFI_STATUS\r
319(EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR) (\r
320 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
321 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor\r
322 )\r
323;\r
324\r
325/**\r
326 Returns a map of the I/O resources in the global coherency domain of the processor.\r
327\r
328 @param NumberOfDescriptors Number of descriptors.\r
329 @param MemorySpaceMap Descriptor array\r
330\r
331 @retval EFI_INVALID_PARAMETER Invalid parameter\r
332 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate\r
333 @retval EFI_SUCCESS Successfully get IO space map.\r
334\r
335**/\r
336typedef\r
337EFI_STATUS\r
338(EFIAPI *EFI_GET_IO_SPACE_MAP) (\r
339 OUT UINTN *NumberOfDescriptors,\r
340 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap\r
341 )\r
342;\r
343\r
344\r
345\r
346/**\r
347 Loads and executed DXE drivers from firmware volumes.\r
348\r
349 @return Status code\r
350\r
351**/\r
352typedef\r
353EFI_STATUS\r
354(EFIAPI *EFI_DISPATCH) (VOID)\r
355;\r
356\r
357/**\r
358 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.\r
359\r
360 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.\r
361 @param DriverName A pointer to the name of the file in a firmware volume.\r
362\r
363 @return Status code\r
364\r
365**/\r
366typedef\r
367EFI_STATUS\r
368(EFIAPI *EFI_SCHEDULE) (\r
369 IN EFI_HANDLE FirmwareVolumeHandle,\r
370 IN EFI_GUID *DriverName\r
371 )\r
372;\r
373\r
374/**\r
375 Promotes a file stored in a firmware volume from the untrusted to the trusted state.\r
376\r
377 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.\r
378 @param DriverName A pointer to the name of the file in a firmware volume.\r
379\r
380 @return Status code\r
381\r
382**/\r
383typedef\r
384EFI_STATUS\r
385(EFIAPI *EFI_TRUST) (\r
386 IN EFI_HANDLE FirmwareVolumeHandle,\r
387 IN EFI_GUID *DriverName\r
388 )\r
389;\r
390\r
391/**\r
392 Creates a firmware volume handle for a firmware volume that is present in system memory.\r
393\r
394 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.\r
395 @param Size The size, in bytes, of the firmware volume.\r
396 @param FirmwareVolumeHandle On output, a pointer to the created handle.\r
397\r
398 @return Status code\r
399\r
400**/\r
401typedef\r
402EFI_STATUS\r
403(EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME) (\r
404 IN VOID *FvHeader,\r
405 IN UINTN Size,\r
406 OUT EFI_HANDLE *FirmwareVolumeHandle\r
407 )\r
408;\r
409\r
410//\r
411// DXE Services Table\r
412//\r
413#define DXE_SERVICES_SIGNATURE 0x565245535f455844\r
414#define DXE_SERVICES_REVISION ((1<<16) | (00)\r
415\r
416typedef struct {\r
417 EFI_TABLE_HEADER Hdr;\r
418\r
419 //\r
420 // Global Coherency Domain Services\r
421 //\r
422 EFI_ADD_MEMORY_SPACE AddMemorySpace;\r
423 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;\r
424 EFI_FREE_MEMORY_SPACE FreeMemorySpace;\r
425 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;\r
426 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;\r
427 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;\r
428 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;\r
429 EFI_ADD_IO_SPACE AddIoSpace;\r
430 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;\r
431 EFI_FREE_IO_SPACE FreeIoSpace;\r
432 EFI_REMOVE_IO_SPACE RemoveIoSpace;\r
433 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;\r
434 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;\r
435\r
436 //\r
437 // Dispatcher Services\r
438 //\r
439 EFI_DISPATCH Dispatch;\r
440 EFI_SCHEDULE Schedule;\r
441 EFI_TRUST Trust;\r
442 //\r
443 // Service to process a single firmware volume found in a capsule\r
444 //\r
445 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;\r
446} DXE_SERVICES;\r
447\r
448typedef DXE_SERVICES EFI_DXE_SERVICES;\r
449\r
450#endif\r