]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Pi/PiDxeCis.h
Removed tabs and fixed some minor coding style issues. Also fixed typo in EFI_PEI_ENT...
[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 EFI_STATUS
194 (EFIAPI *EFI_SET_MEMORY_SPACE_ATTRIBUTES) (
195 IN EFI_PHYSICAL_ADDRESS BaseAddress,
196 IN UINT64 Length,
197 IN UINT64 Attributes
198 )
199 ;
200
201 /**
202 Returns a map of the memory resources in the global coherency domain of the
203 processor.
204
205 @param NumberOfDescriptors Number of descriptors.
206 @param MemorySpaceMap Descriptor array
207
208 @retval EFI_INVALID_PARAMETER Invalid parameter
209 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
210 @retval EFI_SUCCESS Successfully get memory space map.
211
212 **/
213 typedef
214 EFI_STATUS
215 (EFIAPI *EFI_GET_MEMORY_SPACE_MAP) (
216 OUT UINTN *NumberOfDescriptors,
217 OUT EFI_GCD_MEMORY_SPACE_DESCRIPTOR **MemorySpaceMap
218 )
219 ;
220
221 /**
222 Adds reserved I/O or I/O resources to the global coherency domain of the processor.
223
224 @param GcdIoType IO type of the segment.
225 @param BaseAddress Base address of the segment.
226 @param Length Length of the segment.
227
228 @retval EFI_SUCCESS Merged this segment into GCD map.
229
230 **/
231 typedef
232 EFI_STATUS
233 (EFIAPI *EFI_ADD_IO_SPACE) (
234 IN EFI_GCD_IO_TYPE GcdIoType,
235 IN EFI_PHYSICAL_ADDRESS BaseAddress,
236 IN UINT64 Length
237 )
238 ;
239
240 /**
241 Allocates nonexistent I/O, reserved I/O, or I/O resources from the global coherency
242 domain of the processor.
243
244 @param GcdAllocateType The type of allocate operation
245 @param GcdIoType The desired IO type
246 @param Alignment Align with 2^Alignment
247 @param Length Length to allocate
248 @param BaseAddress Base address to allocate
249 @param Imagehandle The image handle consume the allocated space.
250 @param DeviceHandle The device handle consume the allocated space.
251
252 @retval EFI_INVALID_PARAMETER Invalid parameter.
253 @retval EFI_NOT_FOUND No descriptor contains the desired space.
254 @retval EFI_SUCCESS IO space successfully allocated.
255
256 **/
257 typedef
258 EFI_STATUS
259 (EFIAPI *EFI_ALLOCATE_IO_SPACE) (
260 IN EFI_GCD_ALLOCATE_TYPE GcdAllocateType,
261 IN EFI_GCD_IO_TYPE GcdIoType,
262 IN UINTN Alignment,
263 IN UINT64 Length,
264 IN OUT EFI_PHYSICAL_ADDRESS *BaseAddress,
265 IN EFI_HANDLE ImageHandle,
266 IN EFI_HANDLE DeviceHandle OPTIONAL
267 )
268 ;
269
270 /**
271 Frees nonexistent I/O, reserved I/O, or I/O resources from the global coherency
272 domain of the processor.
273
274 @param BaseAddress Base address of the segment.
275 @param Length Length of the segment.
276
277 @retval EFI_SUCCESS Space successfully freed.
278
279 **/
280 typedef
281 EFI_STATUS
282 (EFIAPI *EFI_FREE_IO_SPACE) (
283 IN EFI_PHYSICAL_ADDRESS BaseAddress,
284 IN UINT64 Length
285 )
286 ;
287
288 /**
289 Removes reserved I/O or I/O resources from the global coherency domain of the
290 processor.
291
292 @param BaseAddress Base address of the segment.
293 @param Length Length of the segment.
294
295 @retval EFI_SUCCESS Successfully removed a segment of IO space.
296
297 **/
298 typedef
299 EFI_STATUS
300 (EFIAPI *EFI_REMOVE_IO_SPACE) (
301 IN EFI_PHYSICAL_ADDRESS BaseAddress,
302 IN UINT64 Length
303 )
304 ;
305
306 /**
307 Retrieves the descriptor for an I/O region containing a specified address.
308
309 @param BaseAddress Specified start address
310 @param Descriptor Specified length
311
312 @retval EFI_INVALID_PARAMETER Descriptor is NULL.
313 @retval EFI_SUCCESS Successfully get the IO space descriptor.
314
315 **/
316 typedef
317 EFI_STATUS
318 (EFIAPI *EFI_GET_IO_SPACE_DESCRIPTOR) (
319 IN EFI_PHYSICAL_ADDRESS BaseAddress,
320 OUT EFI_GCD_IO_SPACE_DESCRIPTOR *Descriptor
321 )
322 ;
323
324 /**
325 Returns a map of the I/O resources in the global coherency domain of the processor.
326
327 @param NumberOfDescriptors Number of descriptors.
328 @param MemorySpaceMap Descriptor array
329
330 @retval EFI_INVALID_PARAMETER Invalid parameter
331 @retval EFI_OUT_OF_RESOURCES No enough buffer to allocate
332 @retval EFI_SUCCESS Successfully get IO space map.
333
334 **/
335 typedef
336 EFI_STATUS
337 (EFIAPI *EFI_GET_IO_SPACE_MAP) (
338 OUT UINTN *NumberOfDescriptors,
339 OUT EFI_GCD_IO_SPACE_DESCRIPTOR **IoSpaceMap
340 )
341 ;
342
343
344
345 /**
346 Loads and executed DXE drivers from firmware volumes.
347
348 @return Status code
349
350 **/
351 typedef
352 EFI_STATUS
353 (EFIAPI *EFI_DISPATCH) (
354 VOID
355 )
356 ;
357
358 /**
359 Clears the Schedule on Request (SOR) flag for a component that is stored in a firmware volume.
360
361 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
362 @param DriverName A pointer to the name of the file in a firmware volume.
363
364 @return Status code
365
366 **/
367 typedef
368 EFI_STATUS
369 (EFIAPI *EFI_SCHEDULE) (
370 IN EFI_HANDLE FirmwareVolumeHandle,
371 IN EFI_GUID *DriverName
372 )
373 ;
374
375 /**
376 Promotes a file stored in a firmware volume from the untrusted to the trusted state.
377
378 @param FirmwareVolumeHandle The handle of the firmware volume that contains the file specified by FileName.
379 @param DriverName A pointer to the name of the file in a firmware volume.
380
381 @return Status code
382
383 **/
384 typedef
385 EFI_STATUS
386 (EFIAPI *EFI_TRUST) (
387 IN EFI_HANDLE FirmwareVolumeHandle,
388 IN EFI_GUID *DriverName
389 )
390 ;
391
392 /**
393 Creates a firmware volume handle for a firmware volume that is present in system memory.
394
395 @param FirmwareVolumeHeader A pointer to the header of the firmware volume.
396 @param Size The size, in bytes, of the firmware volume.
397 @param FirmwareVolumeHandle On output, a pointer to the created handle.
398
399 @return Status code
400
401 **/
402 typedef
403 EFI_STATUS
404 (EFIAPI *EFI_PROCESS_FIRMWARE_VOLUME) (
405 IN VOID *FvHeader,
406 IN UINTN Size,
407 OUT EFI_HANDLE *FirmwareVolumeHandle
408 )
409 ;
410
411 //
412 // DXE Services Table
413 //
414 #define DXE_SERVICES_SIGNATURE 0x565245535f455844
415 #define DXE_SERVICES_REVISION ((1<<16) | (00)
416
417 typedef struct {
418 EFI_TABLE_HEADER Hdr;
419
420 //
421 // Global Coherency Domain Services
422 //
423 EFI_ADD_MEMORY_SPACE AddMemorySpace;
424 EFI_ALLOCATE_MEMORY_SPACE AllocateMemorySpace;
425 EFI_FREE_MEMORY_SPACE FreeMemorySpace;
426 EFI_REMOVE_MEMORY_SPACE RemoveMemorySpace;
427 EFI_GET_MEMORY_SPACE_DESCRIPTOR GetMemorySpaceDescriptor;
428 EFI_SET_MEMORY_SPACE_ATTRIBUTES SetMemorySpaceAttributes;
429 EFI_GET_MEMORY_SPACE_MAP GetMemorySpaceMap;
430 EFI_ADD_IO_SPACE AddIoSpace;
431 EFI_ALLOCATE_IO_SPACE AllocateIoSpace;
432 EFI_FREE_IO_SPACE FreeIoSpace;
433 EFI_REMOVE_IO_SPACE RemoveIoSpace;
434 EFI_GET_IO_SPACE_DESCRIPTOR GetIoSpaceDescriptor;
435 EFI_GET_IO_SPACE_MAP GetIoSpaceMap;
436
437 //
438 // Dispatcher Services
439 //
440 EFI_DISPATCH Dispatch;
441 EFI_SCHEDULE Schedule;
442 EFI_TRUST Trust;
443 //
444 // Service to process a single firmware volume found in a capsule
445 //
446 EFI_PROCESS_FIRMWARE_VOLUME ProcessFirmwareVolume;
447 } DXE_SERVICES;
448
449 typedef DXE_SERVICES EFI_DXE_SERVICES;
450
451 #endif