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