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