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