]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Library/Dxe/Include/EfiCombinationLib.h
a2e9f662841991c6c3ec2160f66085028372b7f4
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Library / Dxe / Include / EfiCombinationLib.h
1 /*++
2
3 Copyright (c) 2004, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 EfiCombinationLib.h
15
16 Abstract:
17
18 Library functions that can be called in both PEI and DXE phase
19
20 --*/
21
22 #ifndef _EFI_COMBINATION_LIB_H_
23 #define _EFI_COMBINATION_LIB_H_
24
25 EFI_STATUS
26 EfiInitializeCommonDriverLib (
27 IN EFI_HANDLE ImageHandle,
28 IN VOID *SystemTable
29 )
30 /*++
31
32 Routine Description:
33
34 Initialize lib function calling phase: PEI or DXE
35
36 Arguments:
37
38 ImageHandle - The firmware allocated handle for the EFI image.
39
40 SystemTable - A pointer to the EFI System Table.
41
42 Returns:
43
44 EFI_STATUS always returns EFI_SUCCESS
45
46 --*/
47 ;
48
49 EFI_STATUS
50 EfiCommonIoRead (
51 IN UINT8 Width,
52 IN UINTN Address,
53 IN UINTN Count,
54 IN OUT VOID *Buffer
55 )
56 /*++
57
58 Routine Description:
59
60 Io read operation.
61
62 Arguments:
63
64 Width - Width of read operation
65 Address - Start IO address to read
66 Count - Read count
67 Buffer - Buffer to store result
68
69 Returns:
70
71 Status code
72
73 --*/
74 ;
75
76 EFI_STATUS
77 EfiCommonIoWrite (
78 IN UINT8 Width,
79 IN UINTN Address,
80 IN UINTN Count,
81 IN OUT VOID *Buffer
82 )
83 /*++
84
85 Routine Description:
86
87 Io write operation.
88
89 Arguments:
90
91 Width - Width of write operation
92 Address - Start IO address to write
93 Count - Write count
94 Buffer - Buffer to write to the address
95
96 Returns:
97
98 Status code
99
100 --*/
101 ;
102
103 EFI_STATUS
104 EfiCommonPciRead (
105 IN UINT8 Width,
106 IN UINT64 Address,
107 IN UINTN Count,
108 IN OUT VOID *Buffer
109 )
110 /*++
111
112 Routine Description:
113
114 Pci read operation
115
116 Arguments:
117
118 Width - Width of PCI read
119 Address - PCI address to read
120 Count - Read count
121 Buffer - Output buffer for the read
122
123 Returns:
124
125 Status code
126
127 --*/
128 ;
129
130 EFI_STATUS
131 EfiCommonPciWrite (
132 IN UINT8 Width,
133 IN UINT64 Address,
134 IN UINTN Count,
135 IN OUT VOID *Buffer
136 )
137 /*++
138
139 Routine Description:
140
141 Pci write operation
142
143 Arguments:
144
145 Width - Width of PCI write
146 Address - PCI address to write
147 Count - Write count
148 Buffer - Buffer to write to the address
149
150 Returns:
151
152 Status code
153
154 --*/
155 ;
156
157 EFI_STATUS
158 EfiCommonStall (
159 IN UINTN Microseconds
160 )
161 /*++
162
163 Routine Description:
164
165 Induces a fine-grained stall.
166
167 Arguments:
168
169 Microseconds - The number of microseconds to stall execution.
170
171 Returns:
172
173 Status code
174
175 --*/
176 ;
177
178 EFI_STATUS
179 EfiCommonCopyMem (
180 IN VOID *Destination,
181 IN VOID *Source,
182 IN UINTN Length
183 )
184 /*++
185
186 Routine Description:
187
188 Copy Length bytes from Source to Destination.
189
190 Arguments:
191
192 Destination - Target of copy
193
194 Source - Place to copy from
195
196 Length - Number of bytes to copy
197
198 Returns:
199
200 Status code
201
202 --*/
203 ;
204
205 EFI_STATUS
206 EfiCommonAllocatePages (
207 IN EFI_ALLOCATE_TYPE Type,
208 IN EFI_MEMORY_TYPE MemoryType,
209 IN UINTN Pages,
210 IN OUT EFI_PHYSICAL_ADDRESS *Memory
211 )
212 /*++
213
214 Routine Description:
215
216 Allocates memory pages from the system.
217
218 Arguments:
219
220 Type - The type of allocation to perform.
221 MemoryType - The type of memory to allocate.
222 Pages - The number of contiguous pages to allocate.
223 Memory - Pointer to a physical address.
224
225 Returns:
226
227 EFI_OUT_OF_RESOURCES - The pages could not be allocated.
228
229 EFI_INVALID_PARAMETER - Invalid parameter
230
231 EFI_NOT_FOUND - The requested pages could not be found.
232
233 EFI_SUCCESS - The requested pages were allocated.
234
235 --*/
236 ;
237
238 EFI_STATUS
239 EfiCommonLocateInterface (
240 IN EFI_GUID *Guid,
241 OUT VOID **Interface
242 )
243 /*++
244
245 Routine Description:
246
247 Returns the first protocol instance that matches the given protocol.
248
249 Arguments:
250
251 Guid - Provides the protocol to search for.
252 Interface - On return, a pointer to the first interface that matches Protocol
253
254 Returns:
255
256 Status code
257
258 --*/
259 ;
260
261 EFI_STATUS
262 EfiCommonReportStatusCode (
263 IN EFI_STATUS_CODE_TYPE CodeType,
264 IN EFI_STATUS_CODE_VALUE Value,
265 IN UINT32 Instance,
266 IN EFI_GUID * CallerId,
267 IN EFI_STATUS_CODE_DATA * Data OPTIONAL
268 )
269 /*++
270
271 Routine Description:
272
273 Status Code reporter
274
275 Arguments:
276
277 CodeType - Type of Status Code.
278
279 Value - Value to output for Status Code.
280
281 Instance - Instance Number of this status code.
282
283 CallerId - ID of the caller of this status code.
284
285 Data - Optional data associated with this status code.
286
287 Returns:
288
289 Status code
290
291 --*/
292 ;
293
294 #endif