]>
Commit | Line | Data |
---|---|---|
504214c4 LG |
1 | /** @file \r |
2 | \r | |
3 | Internal functions shared in DxeCore module.\r | |
28a00297 | 4 | \r |
504214c4 | 5 | Copyright (c) 2006 - 2008, Intel Corporation \r |
28a00297 | 6 | All rights reserved. This program and the accompanying materials \r |
7 | are licensed and made available under the terms and conditions of the BSD License \r | |
8 | which accompanies this distribution. The full text of the license may be found at \r | |
9 | http://opensource.org/licenses/bsd-license.php \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
13 | \r | |
28a00297 | 14 | --*/\r |
15 | \r | |
16 | #ifndef _DXE_LIBRARY_H_\r | |
17 | #define _DXE_LIBRARY_H_\r | |
18 | \r | |
19 | \r | |
20 | VOID\r | |
21 | CoreReportProgressCode (\r | |
22 | IN EFI_STATUS_CODE_VALUE Value\r | |
23 | )\r | |
24 | /*++\r | |
25 | \r | |
26 | Routine Description:\r | |
27 | \r | |
eba54e17 | 28 | Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid.\r |
28a00297 | 29 | \r |
30 | Arguments:\r | |
31 | \r | |
32 | Value - Describes the class/subclass/operation of the hardware or software entity \r | |
33 | that the Status Code relates to. \r | |
34 | \r | |
35 | Returns:\r | |
36 | \r | |
37 | None\r | |
38 | \r | |
39 | --*/\r | |
40 | ;\r | |
41 | \r | |
42 | VOID\r | |
43 | CoreReportProgressCodeSpecific (\r | |
44 | IN EFI_STATUS_CODE_VALUE Value,\r | |
45 | IN EFI_HANDLE Handle\r | |
46 | )\r | |
47 | /*++\r | |
48 | \r | |
49 | Routine Description:\r | |
50 | \r | |
eba54e17 | 51 | Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid, \r |
28a00297 | 52 | with a handle as additional information.\r |
53 | \r | |
54 | Arguments:\r | |
55 | \r | |
56 | Value - Describes the class/subclass/operation of the hardware or software entity \r | |
57 | that the Status Code relates to. \r | |
58 | \r | |
59 | Handle - Additional information.\r | |
60 | \r | |
61 | Returns:\r | |
62 | \r | |
63 | None\r | |
64 | \r | |
65 | --*/\r | |
66 | ;\r | |
67 | \r | |
68 | VOID\r | |
69 | CoreAcquireLock (\r | |
70 | IN EFI_LOCK *Lock\r | |
71 | )\r | |
72 | /*++\r | |
73 | \r | |
74 | Routine Description:\r | |
75 | \r | |
76 | Raising to the task priority level of the mutual exclusion\r | |
77 | lock, and then acquires ownership of the lock.\r | |
78 | \r | |
79 | Arguments:\r | |
80 | \r | |
81 | Lock - The lock to acquire\r | |
82 | \r | |
83 | Returns:\r | |
84 | \r | |
85 | Lock owned\r | |
86 | \r | |
87 | --*/\r | |
88 | ;\r | |
89 | \r | |
90 | EFI_STATUS\r | |
91 | CoreAcquireLockOrFail (\r | |
92 | IN EFI_LOCK *Lock\r | |
93 | )\r | |
94 | /*++\r | |
95 | \r | |
96 | Routine Description:\r | |
97 | \r | |
98 | Initialize a basic mutual exclusion lock. Each lock\r | |
99 | provides mutual exclusion access at it's task priority\r | |
100 | level. Since there is no-premption (at any TPL) or\r | |
101 | multiprocessor support, acquiring the lock only consists\r | |
102 | of raising to the locks TPL.\r | |
103 | \r | |
104 | Arguments:\r | |
105 | \r | |
106 | Lock - The EFI_LOCK structure to initialize\r | |
107 | \r | |
108 | Returns:\r | |
109 | \r | |
110 | EFI_SUCCESS - Lock Owned.\r | |
111 | EFI_ACCESS_DENIED - Reentrant Lock Acquisition, Lock not Owned.\r | |
112 | \r | |
113 | --*/\r | |
114 | ;\r | |
115 | \r | |
116 | VOID\r | |
117 | CoreReleaseLock (\r | |
118 | IN EFI_LOCK *Lock\r | |
119 | )\r | |
120 | /*++\r | |
121 | \r | |
122 | Routine Description:\r | |
123 | \r | |
124 | Releases ownership of the mutual exclusion lock, and\r | |
125 | restores the previous task priority level.\r | |
126 | \r | |
127 | Arguments:\r | |
128 | \r | |
129 | Lock - The lock to release\r | |
130 | \r | |
131 | Returns:\r | |
132 | \r | |
133 | Lock unowned\r | |
134 | \r | |
135 | --*/\r | |
136 | ;\r | |
137 | \r | |
138 | //\r | |
139 | // Device Path functions\r | |
140 | //\r | |
141 | \r | |
142 | UINTN\r | |
143 | CoreDevicePathSize (\r | |
144 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
145 | )\r | |
146 | /*++\r | |
147 | \r | |
148 | Routine Description:\r | |
149 | \r | |
150 | Calculate the size of a whole device path. \r | |
151 | \r | |
152 | Arguments:\r | |
153 | \r | |
154 | DevicePath - The pointer to the device path data.\r | |
155 | \r | |
156 | Returns:\r | |
157 | \r | |
158 | Size of device path data structure..\r | |
159 | \r | |
160 | --*/\r | |
161 | ;\r | |
162 | \r | |
163 | BOOLEAN\r | |
164 | CoreIsDevicePathMultiInstance (\r | |
165 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
166 | )\r | |
167 | /*++\r | |
168 | \r | |
169 | Routine Description:\r | |
170 | Return TRUE is this is a multi instance device path.\r | |
171 | \r | |
172 | Arguments:\r | |
173 | DevicePath - A pointer to a device path data structure.\r | |
174 | \r | |
175 | \r | |
176 | Returns:\r | |
177 | TRUE - If DevicePath is multi instance. FALSE - If DevicePath is not multi\r | |
178 | instance.\r | |
179 | \r | |
180 | --*/\r | |
181 | ;\r | |
182 | \r | |
183 | \r | |
184 | EFI_DEVICE_PATH_PROTOCOL *\r | |
185 | CoreDuplicateDevicePath (\r | |
186 | IN EFI_DEVICE_PATH_PROTOCOL *DevicePath\r | |
187 | )\r | |
188 | /*++\r | |
189 | \r | |
190 | Routine Description:\r | |
191 | Duplicate a new device path data structure from the old one.\r | |
192 | \r | |
193 | Arguments:\r | |
194 | DevicePath - A pointer to a device path data structure.\r | |
195 | \r | |
196 | Returns:\r | |
197 | A pointer to the new allocated device path data.\r | |
198 | Caller must free the memory used by DevicePath if it is no longer needed.\r | |
199 | \r | |
200 | --*/\r | |
201 | ;\r | |
202 | \r | |
203 | EFI_DEVICE_PATH_PROTOCOL *\r | |
204 | CoreAppendDevicePath (\r | |
205 | IN EFI_DEVICE_PATH_PROTOCOL *Src1,\r | |
206 | IN EFI_DEVICE_PATH_PROTOCOL *Node\r | |
207 | )\r | |
208 | /*++\r | |
209 | \r | |
210 | Routine Description:\r | |
211 | Function is used to append a Src1 and Src2 together.\r | |
212 | \r | |
213 | Arguments:\r | |
214 | Src1 - A pointer to a device path data structure.\r | |
215 | \r | |
216 | Node - A pointer to a device path data structure.\r | |
217 | \r | |
218 | Returns:\r | |
219 | \r | |
220 | A pointer to the new device path is returned.\r | |
221 | NULL is returned if space for the new device path could not be allocated from pool.\r | |
222 | It is up to the caller to free the memory used by Src1 and Src2 if they are no longer needed.\r | |
223 | \r | |
224 | --*/\r | |
225 | ;\r | |
226 | \r | |
227 | VOID *\r | |
228 | CoreAllocateBootServicesPool (\r | |
229 | IN UINTN AllocationSize\r | |
230 | )\r | |
231 | /*++\r | |
232 | \r | |
233 | Routine Description:\r | |
234 | \r | |
235 | Allocate pool of type EfiBootServicesData, the size is specified with AllocationSize.\r | |
236 | \r | |
237 | Arguments:\r | |
238 | \r | |
239 | AllocationSize - Size to allocate.\r | |
240 | \r | |
241 | Returns:\r | |
242 | \r | |
243 | Pointer of the allocated pool.\r | |
244 | \r | |
245 | --*/\r | |
246 | ;\r | |
247 | \r | |
248 | VOID *\r | |
249 | CoreAllocateZeroBootServicesPool (\r | |
250 | IN UINTN AllocationSize\r | |
251 | )\r | |
252 | /*++\r | |
253 | \r | |
254 | Routine Description:\r | |
255 | \r | |
256 | Allocate pool of type EfiBootServicesData and zero it, the size is specified with AllocationSize.\r | |
257 | \r | |
258 | Arguments:\r | |
259 | \r | |
260 | AllocationSize - Size to allocate.\r | |
261 | \r | |
262 | Returns:\r | |
263 | \r | |
264 | Pointer of the allocated pool.\r | |
265 | \r | |
266 | --*/\r | |
267 | ;\r | |
268 | \r | |
269 | EFI_STATUS\r | |
270 | CoreGetConfigTable (\r | |
271 | IN EFI_GUID *Guid,\r | |
272 | IN OUT VOID **Table\r | |
273 | )\r | |
274 | /*++\r | |
275 | \r | |
276 | Routine Description:\r | |
277 | \r | |
278 | Find a config table by name in system table's ConfigurationTable.\r | |
279 | \r | |
280 | Arguments:\r | |
281 | \r | |
282 | Guid - The table name to look for\r | |
283 | \r | |
284 | Table - Pointer of the config table\r | |
285 | \r | |
286 | Returns: \r | |
287 | \r | |
288 | EFI_NOT_FOUND - Could not find the table in system table's ConfigurationTable.\r | |
289 | \r | |
290 | EFI_SUCCESS - Table successfully found.\r | |
291 | \r | |
292 | --*/\r | |
293 | ;\r | |
294 | \r | |
295 | VOID *\r | |
296 | CoreAllocateRuntimeCopyPool (\r | |
297 | IN UINTN AllocationSize,\r | |
298 | IN VOID *Buffer\r | |
299 | )\r | |
300 | /*++\r | |
301 | \r | |
302 | Routine Description:\r | |
303 | \r | |
304 | Allocate pool of specified size with EfiRuntimeServicesData type, and copy specified buffer to this pool.\r | |
305 | \r | |
306 | Arguments:\r | |
307 | \r | |
308 | AllocationSize - Size to allocate.\r | |
309 | \r | |
310 | Buffer - Specified buffer that will be copy to the allocated pool\r | |
311 | \r | |
312 | Returns:\r | |
313 | \r | |
314 | Pointer of the allocated pool.\r | |
315 | \r | |
316 | --*/\r | |
317 | ;\r | |
318 | \r | |
319 | VOID *\r | |
320 | CoreAllocateRuntimePool (\r | |
321 | IN UINTN AllocationSize\r | |
322 | )\r | |
323 | /*++\r | |
324 | \r | |
325 | Routine Description:\r | |
326 | \r | |
327 | Allocate pool of type EfiRuntimeServicesData, the size is specified with AllocationSize.\r | |
328 | \r | |
329 | Arguments:\r | |
330 | \r | |
331 | AllocationSize - Size to allocate.\r | |
332 | \r | |
333 | Returns:\r | |
334 | \r | |
335 | Pointer of the allocated pool.\r | |
336 | \r | |
337 | --*/\r | |
338 | ;\r | |
339 | \r | |
340 | VOID *\r | |
341 | CoreAllocateCopyPool (\r | |
342 | IN UINTN AllocationSize,\r | |
343 | IN VOID *Buffer\r | |
344 | )\r | |
345 | /*++\r | |
346 | \r | |
347 | Routine Description:\r | |
348 | \r | |
349 | Allocate pool of specified size with EfiBootServicesData type, and copy specified buffer to this pool.\r | |
350 | \r | |
351 | Arguments:\r | |
352 | \r | |
353 | AllocationSize - Size to allocate.\r | |
354 | \r | |
355 | Buffer - Specified buffer that will be copy to the allocated pool\r | |
356 | \r | |
357 | Returns:\r | |
358 | \r | |
359 | Pointer of the allocated pool.\r | |
360 | \r | |
361 | --*/\r | |
362 | ;\r | |
363 | \r | |
364 | EFI_EVENT\r | |
365 | CoreCreateProtocolNotifyEvent (\r | |
366 | IN EFI_GUID *ProtocolGuid,\r | |
367 | IN EFI_TPL NotifyTpl,\r | |
368 | IN EFI_EVENT_NOTIFY NotifyFunction,\r | |
369 | IN VOID *NotifyContext,\r | |
370 | OUT VOID **Registration,\r | |
371 | IN BOOLEAN SignalFlag\r | |
372 | )\r | |
373 | /*++\r | |
374 | \r | |
375 | Routine Description:\r | |
376 | \r | |
377 | Create a protocol notification event and return it.\r | |
378 | \r | |
379 | Arguments:\r | |
380 | \r | |
381 | ProtocolGuid - Protocol to register notification event on.\r | |
382 | \r | |
383 | NotifyTpl - Maximum TPL to signal the NotifyFunction.\r | |
384 | \r | |
385 | NotifyFuncition - EFI notification routine.\r | |
386 | \r | |
387 | NotifyContext - Context passed into Event when it is created.\r | |
388 | \r | |
389 | Registration - Registration key returned from RegisterProtocolNotify().\r | |
390 | \r | |
391 | SignalFlag - Boolean value to decide whether kick the event after register or not. \r | |
392 | \r | |
393 | Returns:\r | |
394 | \r | |
395 | The EFI_EVENT that has been registered to be signaled when a ProtocolGuid\r | |
396 | is added to the system.\r | |
397 | \r | |
398 | --*/\r | |
399 | ;\r | |
400 | \r | |
401 | #endif\r |