]>
Commit | Line | Data |
---|---|---|
1 | /*++\r | |
2 | \r | |
3 | Copyright (c) 2004 - 2006, Intel Corporation. All rights reserved.<BR>\r | |
4 | This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | EdkIIGlueMemoryAllocationLib.h\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | Public header file for Memory Allocation Lib\r | |
20 | \r | |
21 | --*/\r | |
22 | \r | |
23 | #ifndef __EDKII_GLUE_MEMORY_ALLOCATION_LIB_H__\r | |
24 | #define __EDKII_GLUE_MEMORY_ALLOCATION_LIB_H__\r | |
25 | \r | |
26 | \r | |
27 | #define AllocatePages(_PAGES) GlueAllocatePages(_PAGES)\r | |
28 | #define FreePages(_BUFFER, _PAGES) GlueFreePages(_BUFFER, _PAGES)\r | |
29 | #define AllocatePool(_SIZE) GlueAllocatePool(_SIZE)\r | |
30 | #define AllocateZeroPool(_ALLOCATIONSIZE) GlueAllocateZeroPool(_ALLOCATIONSIZE)\r | |
31 | #define AllocateCopyPool(_ALLOCATIONSIZE, _BUFFER) GlueAllocateCopyPool(_ALLOCATIONSIZE, _BUFFER)\r | |
32 | #define FreePool(_BUFFER) GlueFreePool(_BUFFER)\r | |
33 | \r | |
34 | \r | |
35 | /**\r | |
36 | Allocates one or more 4KB pages of type EfiBootServicesData.\r | |
37 | \r | |
38 | Allocates the number of 4KB pages of type EfiBootServicesData and returns a pointer to the\r | |
39 | allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r | |
40 | is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r | |
41 | returned.\r | |
42 | \r | |
43 | @param Pages The number of 4 KB pages to allocate.\r | |
44 | \r | |
45 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
46 | \r | |
47 | **/\r | |
48 | VOID *\r | |
49 | EFIAPI\r | |
50 | GlueAllocatePages (\r | |
51 | IN UINTN Pages\r | |
52 | );\r | |
53 | \r | |
54 | /**\r | |
55 | Allocates one or more 4KB pages of type EfiRuntimeServicesData.\r | |
56 | \r | |
57 | Allocates the number of 4KB pages of type EfiRuntimeServicesData and returns a pointer to the\r | |
58 | allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r | |
59 | is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r | |
60 | returned.\r | |
61 | \r | |
62 | @param Pages The number of 4 KB pages to allocate.\r | |
63 | \r | |
64 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
65 | \r | |
66 | **/\r | |
67 | VOID *\r | |
68 | EFIAPI\r | |
69 | AllocateRuntimePages (\r | |
70 | IN UINTN Pages\r | |
71 | );\r | |
72 | \r | |
73 | /**\r | |
74 | Allocates one or more 4KB pages of type EfiReservedMemoryType.\r | |
75 | \r | |
76 | Allocates the number of 4KB pages of type EfiReservedMemoryType and returns a pointer to the\r | |
77 | allocated buffer. The buffer returned is aligned on a 4KB boundary. If Pages is 0, then NULL\r | |
78 | is returned. If there is not enough memory remaining to satisfy the request, then NULL is\r | |
79 | returned.\r | |
80 | \r | |
81 | @param Pages The number of 4 KB pages to allocate.\r | |
82 | \r | |
83 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
84 | \r | |
85 | **/\r | |
86 | VOID *\r | |
87 | EFIAPI\r | |
88 | AllocateReservedPages (\r | |
89 | IN UINTN Pages\r | |
90 | );\r | |
91 | \r | |
92 | /**\r | |
93 | Frees one or more 4KB pages that were previously allocated with one of the page allocation\r | |
94 | functions in the Memory Allocation Library.\r | |
95 | \r | |
96 | Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer\r | |
97 | must have been allocated on a previous call to the page allocation services of the Memory\r | |
98 | Allocation Library.\r | |
99 | If Buffer was not allocated with a page allocation function in the Memory Allocation Library,\r | |
100 | then ASSERT().\r | |
101 | If Pages is zero, then ASSERT().\r | |
102 | \r | |
103 | @param Buffer Pointer to the buffer of pages to free.\r | |
104 | @param Pages The number of 4 KB pages to free.\r | |
105 | \r | |
106 | **/\r | |
107 | VOID\r | |
108 | EFIAPI\r | |
109 | GlueFreePages (\r | |
110 | IN VOID *Buffer,\r | |
111 | IN UINTN Pages\r | |
112 | );\r | |
113 | \r | |
114 | /**\r | |
115 | Allocates one or more 4KB pages of type EfiBootServicesData at a specified alignment.\r | |
116 | \r | |
117 | Allocates the number of 4KB pages specified by Pages of type EfiBootServicesData with an\r | |
118 | alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is\r | |
119 | returned. If there is not enough memory at the specified alignment remaining to satisfy the\r | |
120 | request, then NULL is returned.\r | |
121 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
122 | \r | |
123 | @param Pages The number of 4 KB pages to allocate.\r | |
124 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
125 | If Alignment is zero, then byte alignment is used.\r | |
126 | \r | |
127 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
128 | \r | |
129 | **/\r | |
130 | VOID *\r | |
131 | EFIAPI\r | |
132 | AllocateAlignedPages (\r | |
133 | IN UINTN Pages,\r | |
134 | IN UINTN Alignment\r | |
135 | );\r | |
136 | \r | |
137 | /**\r | |
138 | Allocates one or more 4KB pages of type EfiRuntimeServicesData at a specified alignment.\r | |
139 | \r | |
140 | Allocates the number of 4KB pages specified by Pages of type EfiRuntimeServicesData with an\r | |
141 | alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is\r | |
142 | returned. If there is not enough memory at the specified alignment remaining to satisfy the\r | |
143 | request, then NULL is returned.\r | |
144 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
145 | \r | |
146 | @param Pages The number of 4 KB pages to allocate.\r | |
147 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
148 | If Alignment is zero, then byte alignment is used.\r | |
149 | \r | |
150 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
151 | \r | |
152 | **/\r | |
153 | VOID *\r | |
154 | EFIAPI\r | |
155 | AllocateAlignedRuntimePages (\r | |
156 | IN UINTN Pages,\r | |
157 | IN UINTN Alignment\r | |
158 | );\r | |
159 | \r | |
160 | /**\r | |
161 | Allocates one or more 4KB pages of type EfiReservedMemoryType at a specified alignment.\r | |
162 | \r | |
163 | Allocates the number of 4KB pages specified by Pages of type EfiReservedMemoryType with an\r | |
164 | alignment specified by Alignment. The allocated buffer is returned. If Pages is 0, then NULL is\r | |
165 | returned. If there is not enough memory at the specified alignment remaining to satisfy the\r | |
166 | request, then NULL is returned.\r | |
167 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
168 | \r | |
169 | @param Pages The number of 4 KB pages to allocate.\r | |
170 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
171 | If Alignment is zero, then byte alignment is used.\r | |
172 | \r | |
173 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
174 | \r | |
175 | **/\r | |
176 | VOID *\r | |
177 | EFIAPI\r | |
178 | AllocateAlignedReservedPages (\r | |
179 | IN UINTN Pages,\r | |
180 | IN UINTN Alignment\r | |
181 | );\r | |
182 | \r | |
183 | /**\r | |
184 | Frees one or more 4KB pages that were previously allocated with one of the aligned page\r | |
185 | allocation functions in the Memory Allocation Library.\r | |
186 | \r | |
187 | Frees the number of 4KB pages specified by Pages from the buffer specified by Buffer. Buffer\r | |
188 | must have been allocated on a previous call to the aligned page allocation services of the Memory\r | |
189 | Allocation Library.\r | |
190 | If Buffer was not allocated with an aligned page allocation function in the Memory Allocation\r | |
191 | Library, then ASSERT().\r | |
192 | If Pages is zero, then ASSERT().\r | |
193 | \r | |
194 | @param Buffer Pointer to the buffer of pages to free.\r | |
195 | @param Pages The number of 4 KB pages to free.\r | |
196 | \r | |
197 | **/\r | |
198 | VOID\r | |
199 | EFIAPI\r | |
200 | FreeAlignedPages (\r | |
201 | IN VOID *Buffer,\r | |
202 | IN UINTN Pages\r | |
203 | );\r | |
204 | \r | |
205 | /**\r | |
206 | Allocates a buffer of type EfiBootServicesData.\r | |
207 | \r | |
208 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData and returns a\r | |
209 | pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is\r | |
210 | returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.\r | |
211 | \r | |
212 | @param AllocationSize The number of bytes to allocate.\r | |
213 | \r | |
214 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
215 | \r | |
216 | **/\r | |
217 | VOID *\r | |
218 | EFIAPI\r | |
219 | GlueAllocatePool (\r | |
220 | IN UINTN AllocationSize\r | |
221 | );\r | |
222 | \r | |
223 | /**\r | |
224 | Allocates a buffer of type EfiRuntimeServicesData.\r | |
225 | \r | |
226 | Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData and returns\r | |
227 | a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is\r | |
228 | returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.\r | |
229 | \r | |
230 | @param AllocationSize The number of bytes to allocate.\r | |
231 | \r | |
232 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
233 | \r | |
234 | **/\r | |
235 | VOID *\r | |
236 | EFIAPI\r | |
237 | AllocateRuntimePool (\r | |
238 | IN UINTN AllocationSize\r | |
239 | );\r | |
240 | \r | |
241 | /**\r | |
242 | Allocates a buffer of type EfieservedMemoryType.\r | |
243 | \r | |
244 | Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType and returns\r | |
245 | a pointer to the allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is\r | |
246 | returned. If there is not enough memory remaining to satisfy the request, then NULL is returned.\r | |
247 | \r | |
248 | @param AllocationSize The number of bytes to allocate.\r | |
249 | \r | |
250 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
251 | \r | |
252 | **/\r | |
253 | VOID *\r | |
254 | EFIAPI\r | |
255 | AllocateReservedPool (\r | |
256 | IN UINTN AllocationSize\r | |
257 | );\r | |
258 | \r | |
259 | /**\r | |
260 | Allocates and zeros a buffer of type EfiBootServicesData.\r | |
261 | \r | |
262 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, clears the\r | |
263 | buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a\r | |
264 | valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the\r | |
265 | request, then NULL is returned.\r | |
266 | \r | |
267 | @param AllocationSize The number of bytes to allocate and zero.\r | |
268 | \r | |
269 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
270 | \r | |
271 | **/\r | |
272 | VOID *\r | |
273 | EFIAPI\r | |
274 | GlueAllocateZeroPool (\r | |
275 | IN UINTN AllocationSize\r | |
276 | );\r | |
277 | \r | |
278 | /**\r | |
279 | Allocates and zeros a buffer of type EfiRuntimeServicesData.\r | |
280 | \r | |
281 | Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, clears the\r | |
282 | buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a\r | |
283 | valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the\r | |
284 | request, then NULL is returned.\r | |
285 | \r | |
286 | @param AllocationSize The number of bytes to allocate and zero.\r | |
287 | \r | |
288 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
289 | \r | |
290 | **/\r | |
291 | VOID *\r | |
292 | EFIAPI\r | |
293 | AllocateRuntimeZeroPool (\r | |
294 | IN UINTN AllocationSize\r | |
295 | );\r | |
296 | \r | |
297 | /**\r | |
298 | Allocates and zeros a buffer of type EfiReservedMemoryType.\r | |
299 | \r | |
300 | Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, clears the\r | |
301 | buffer with zeros, and returns a pointer to the allocated buffer. If AllocationSize is 0, then a\r | |
302 | valid buffer of 0 size is returned. If there is not enough memory remaining to satisfy the\r | |
303 | request, then NULL is returned.\r | |
304 | \r | |
305 | @param AllocationSize The number of bytes to allocate and zero.\r | |
306 | \r | |
307 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
308 | \r | |
309 | **/\r | |
310 | VOID *\r | |
311 | EFIAPI\r | |
312 | AllocateReservedZeroPool (\r | |
313 | IN UINTN AllocationSize\r | |
314 | );\r | |
315 | \r | |
316 | /**\r | |
317 | Copies a buffer to an allocated buffer of type EfiBootServicesData.\r | |
318 | \r | |
319 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData, copies\r | |
320 | AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the\r | |
321 | allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r | |
322 | is not enough memory remaining to satisfy the request, then NULL is returned.\r | |
323 | If Buffer is NULL, then ASSERT().\r | |
324 | If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r | |
325 | \r | |
326 | @param AllocationSize The number of bytes to allocate and zero.\r | |
327 | @param Buffer The buffer to copy to the allocated buffer.\r | |
328 | \r | |
329 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
330 | \r | |
331 | **/\r | |
332 | VOID *\r | |
333 | EFIAPI\r | |
334 | GlueAllocateCopyPool (\r | |
335 | IN UINTN AllocationSize,\r | |
336 | IN CONST VOID *Buffer\r | |
337 | );\r | |
338 | \r | |
339 | /**\r | |
340 | Copies a buffer to an allocated buffer of type EfiRuntimeServicesData.\r | |
341 | \r | |
342 | Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData, copies\r | |
343 | AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the\r | |
344 | allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r | |
345 | is not enough memory remaining to satisfy the request, then NULL is returned.\r | |
346 | If Buffer is NULL, then ASSERT().\r | |
347 | If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r | |
348 | \r | |
349 | @param AllocationSize The number of bytes to allocate and zero.\r | |
350 | @param Buffer The buffer to copy to the allocated buffer.\r | |
351 | \r | |
352 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
353 | \r | |
354 | **/\r | |
355 | VOID *\r | |
356 | EFIAPI\r | |
357 | AllocateRuntimeCopyPool (\r | |
358 | IN UINTN AllocationSize,\r | |
359 | IN CONST VOID *Buffer\r | |
360 | );\r | |
361 | \r | |
362 | /**\r | |
363 | Copies a buffer to an allocated buffer of type EfiReservedMemoryType.\r | |
364 | \r | |
365 | Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType, copies\r | |
366 | AllocationSize bytes from Buffer to the newly allocated buffer, and returns a pointer to the\r | |
367 | allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r | |
368 | is not enough memory remaining to satisfy the request, then NULL is returned.\r | |
369 | If Buffer is NULL, then ASSERT().\r | |
370 | If AllocationSize is greater than (MAX_ADDRESS ? Buffer + 1), then ASSERT(). \r | |
371 | \r | |
372 | @param AllocationSize The number of bytes to allocate and zero.\r | |
373 | @param Buffer The buffer to copy to the allocated buffer.\r | |
374 | \r | |
375 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
376 | \r | |
377 | **/\r | |
378 | VOID *\r | |
379 | EFIAPI\r | |
380 | AllocateReservedCopyPool (\r | |
381 | IN UINTN AllocationSize,\r | |
382 | IN CONST VOID *Buffer\r | |
383 | );\r | |
384 | \r | |
385 | /**\r | |
386 | Frees a buffer that was previously allocated with one of the pool allocation functions in the\r | |
387 | Memory Allocation Library.\r | |
388 | \r | |
389 | Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the\r | |
390 | pool allocation services of the Memory Allocation Library.\r | |
391 | If Buffer was not allocated with a pool allocation function in the Memory Allocation Library,\r | |
392 | then ASSERT().\r | |
393 | \r | |
394 | @param Buffer Pointer to the buffer to free.\r | |
395 | \r | |
396 | **/\r | |
397 | VOID\r | |
398 | EFIAPI\r | |
399 | GlueFreePool (\r | |
400 | IN VOID *Buffer\r | |
401 | );\r | |
402 | \r | |
403 | /**\r | |
404 | Allocates a buffer of type EfiBootServicesData at a specified alignment.\r | |
405 | \r | |
406 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an\r | |
407 | alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,\r | |
408 | then a valid buffer of 0 size is returned. If there is not enough memory at the specified\r | |
409 | alignment remaining to satisfy the request, then NULL is returned.\r | |
410 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
411 | \r | |
412 | @param AllocationSize The number of bytes to allocate.\r | |
413 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
414 | If Alignment is zero, then byte alignment is used.\r | |
415 | \r | |
416 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
417 | \r | |
418 | **/\r | |
419 | VOID *\r | |
420 | EFIAPI\r | |
421 | AllocateAlignedPool (\r | |
422 | IN UINTN AllocationSize,\r | |
423 | IN UINTN Alignment\r | |
424 | );\r | |
425 | \r | |
426 | /**\r | |
427 | Allocates a buffer of type EfiRuntimeServicesData at a specified alignment.\r | |
428 | \r | |
429 | Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an\r | |
430 | alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,\r | |
431 | then a valid buffer of 0 size is returned. If there is not enough memory at the specified\r | |
432 | alignment remaining to satisfy the request, then NULL is returned.\r | |
433 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
434 | \r | |
435 | @param AllocationSize The number of bytes to allocate.\r | |
436 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
437 | If Alignment is zero, then byte alignment is used.\r | |
438 | \r | |
439 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
440 | \r | |
441 | **/\r | |
442 | VOID *\r | |
443 | EFIAPI\r | |
444 | AllocateAlignedRuntimePool (\r | |
445 | IN UINTN AllocationSize,\r | |
446 | IN UINTN Alignment\r | |
447 | );\r | |
448 | \r | |
449 | /**\r | |
450 | Allocates a buffer of type EfieservedMemoryType at a specified alignment.\r | |
451 | \r | |
452 | Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an\r | |
453 | alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,\r | |
454 | then a valid buffer of 0 size is returned. If there is not enough memory at the specified\r | |
455 | alignment remaining to satisfy the request, then NULL is returned.\r | |
456 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
457 | \r | |
458 | @param AllocationSize The number of bytes to allocate.\r | |
459 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
460 | If Alignment is zero, then byte alignment is used.\r | |
461 | \r | |
462 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
463 | \r | |
464 | **/\r | |
465 | VOID *\r | |
466 | EFIAPI\r | |
467 | AllocateAlignedReservedPool (\r | |
468 | IN UINTN AllocationSize,\r | |
469 | IN UINTN Alignment\r | |
470 | );\r | |
471 | \r | |
472 | /**\r | |
473 | Allocates and zeros a buffer of type EfiBootServicesData at a specified alignment.\r | |
474 | \r | |
475 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData with an\r | |
476 | alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the\r | |
477 | allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r | |
478 | is not enough memory at the specified alignment remaining to satisfy the request, then NULL is\r | |
479 | returned.\r | |
480 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
481 | \r | |
482 | @param AllocationSize The number of bytes to allocate.\r | |
483 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
484 | If Alignment is zero, then byte alignment is used.\r | |
485 | \r | |
486 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
487 | \r | |
488 | **/\r | |
489 | VOID *\r | |
490 | EFIAPI\r | |
491 | AllocateAlignedZeroPool (\r | |
492 | IN UINTN AllocationSize,\r | |
493 | IN UINTN Alignment\r | |
494 | );\r | |
495 | \r | |
496 | /**\r | |
497 | Allocates and zeros a buffer of type EfiRuntimeServicesData at a specified alignment.\r | |
498 | \r | |
499 | Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData with an\r | |
500 | alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the\r | |
501 | allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r | |
502 | is not enough memory at the specified alignment remaining to satisfy the request, then NULL is\r | |
503 | returned.\r | |
504 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
505 | \r | |
506 | @param AllocationSize The number of bytes to allocate.\r | |
507 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
508 | If Alignment is zero, then byte alignment is used.\r | |
509 | \r | |
510 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
511 | \r | |
512 | **/\r | |
513 | VOID *\r | |
514 | EFIAPI\r | |
515 | AllocateAlignedRuntimeZeroPool (\r | |
516 | IN UINTN AllocationSize,\r | |
517 | IN UINTN Alignment\r | |
518 | );\r | |
519 | \r | |
520 | /**\r | |
521 | Allocates and zeros a buffer of type EfieservedMemoryType at a specified alignment.\r | |
522 | \r | |
523 | Allocates the number bytes specified by AllocationSize of type EfieservedMemoryType with an\r | |
524 | alignment specified by Alignment, clears the buffer with zeros, and returns a pointer to the\r | |
525 | allocated buffer. If AllocationSize is 0, then a valid buffer of 0 size is returned. If there\r | |
526 | is not enough memory at the specified alignment remaining to satisfy the request, then NULL is\r | |
527 | returned.\r | |
528 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
529 | \r | |
530 | @param AllocationSize The number of bytes to allocate.\r | |
531 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
532 | If Alignment is zero, then byte alignment is used.\r | |
533 | \r | |
534 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
535 | \r | |
536 | **/\r | |
537 | VOID *\r | |
538 | EFIAPI\r | |
539 | AllocateAlignedReservedZeroPool (\r | |
540 | IN UINTN AllocationSize,\r | |
541 | IN UINTN Alignment\r | |
542 | );\r | |
543 | \r | |
544 | /**\r | |
545 | Copies a buffer to an allocated buffer of type EfiBootServicesData at a specified alignment.\r | |
546 | \r | |
547 | Allocates the number bytes specified by AllocationSize of type EfiBootServicesData type with an\r | |
548 | alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,\r | |
549 | then a valid buffer of 0 size is returned. If there is not enough memory at the specified\r | |
550 | alignment remaining to satisfy the request, then NULL is returned.\r | |
551 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
552 | \r | |
553 | @param AllocationSize The number of bytes to allocate.\r | |
554 | @param Buffer The buffer to copy to the allocated buffer.\r | |
555 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
556 | If Alignment is zero, then byte alignment is used.\r | |
557 | \r | |
558 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
559 | \r | |
560 | **/\r | |
561 | VOID *\r | |
562 | EFIAPI\r | |
563 | AllocateAlignedCopyPool (\r | |
564 | IN UINTN AllocationSize,\r | |
565 | IN CONST VOID *Buffer,\r | |
566 | IN UINTN Alignment\r | |
567 | );\r | |
568 | \r | |
569 | /**\r | |
570 | Copies a buffer to an allocated buffer of type EfiRuntimeServicesData at a specified alignment.\r | |
571 | \r | |
572 | Allocates the number bytes specified by AllocationSize of type EfiRuntimeServicesData type with an\r | |
573 | alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,\r | |
574 | then a valid buffer of 0 size is returned. If there is not enough memory at the specified\r | |
575 | alignment remaining to satisfy the request, then NULL is returned.\r | |
576 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
577 | \r | |
578 | @param AllocationSize The number of bytes to allocate.\r | |
579 | @param Buffer The buffer to copy to the allocated buffer.\r | |
580 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
581 | If Alignment is zero, then byte alignment is used.\r | |
582 | \r | |
583 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
584 | \r | |
585 | **/\r | |
586 | VOID *\r | |
587 | EFIAPI\r | |
588 | AllocateAlignedRuntimeCopyPool (\r | |
589 | IN UINTN AllocationSize,\r | |
590 | IN CONST VOID *Buffer,\r | |
591 | IN UINTN Alignment\r | |
592 | );\r | |
593 | \r | |
594 | /**\r | |
595 | Copies a buffer to an allocated buffer of type EfiReservedMemoryType at a specified alignment.\r | |
596 | \r | |
597 | Allocates the number bytes specified by AllocationSize of type EfiReservedMemoryType type with an\r | |
598 | alignment specified by Alignment. The allocated buffer is returned. If AllocationSize is 0,\r | |
599 | then a valid buffer of 0 size is returned. If there is not enough memory at the specified\r | |
600 | alignment remaining to satisfy the request, then NULL is returned.\r | |
601 | If Alignment is not a power of two and Alignment is not zero, then ASSERT().\r | |
602 | \r | |
603 | @param AllocationSize The number of bytes to allocate.\r | |
604 | @param Buffer The buffer to copy to the allocated buffer.\r | |
605 | @param Alignment The requested alignment of the allocation. Must be a power of two.\r | |
606 | If Alignment is zero, then byte alignment is used.\r | |
607 | \r | |
608 | @return A pointer to the allocated buffer or NULL if allocation fails.\r | |
609 | \r | |
610 | **/\r | |
611 | VOID *\r | |
612 | EFIAPI\r | |
613 | AllocateAlignedReservedCopyPool (\r | |
614 | IN UINTN AllocationSize,\r | |
615 | IN CONST VOID *Buffer,\r | |
616 | IN UINTN Alignment\r | |
617 | );\r | |
618 | \r | |
619 | /**\r | |
620 | Frees a buffer that was previously allocated with one of the aligned pool allocation functions \r | |
621 | in the Memory Allocation Library.\r | |
622 | \r | |
623 | Frees the buffer specified by Buffer. Buffer must have been allocated on a previous call to the\r | |
624 | aligned pool allocation services of the Memory Allocation Library.\r | |
625 | If Buffer was not allocated with an aligned pool allocation function in the Memory Allocation\r | |
626 | Library, then ASSERT().\r | |
627 | \r | |
628 | @param Buffer Pointer to the buffer to free.\r | |
629 | \r | |
630 | **/\r | |
631 | VOID\r | |
632 | EFIAPI\r | |
633 | FreeAlignedPool (\r | |
634 | IN VOID *Buffer\r | |
635 | );\r | |
636 | \r | |
637 | #endif\r |