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