]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationServices.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Library / DxeCoreMemoryAllocationLib / DxeCoreMemoryAllocationServices.h
CommitLineData
0ac72713 1/** @file\r
2 Contains function prototypes for Memory Services in DxeCore.\r
3\r
4 This header file borrows the DxeCore Memory Allocation services as the primitive\r
d1102dba 5 for memory allocation.\r
0ac72713 6\r
d1102dba
LG
7 Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>\r
8 This program and the accompanying materials\r
9 are licensed and made available under the terms and conditions of the BSD License\r
10 which accompanies this distribution. The full text of the license may be found at\r
11 http://opensource.org/licenses/bsd-license.php\r
0ac72713 12\r
d1102dba
LG
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
0ac72713 15\r
16**/\r
17\r
18#ifndef _DXE_CORE_MEMORY_ALLOCATION_SERVICES_H_\r
19#define _DXE_CORE_MEMORY_ALLOCATION_SERVICES_H_\r
20\r
21\r
22/**\r
23 Allocates pages from the memory map.\r
24\r
25 @param Type The type of allocation to perform\r
26 @param MemoryType The type of memory to turn the allocated pages\r
27 into\r
28 @param NumberOfPages The number of pages to allocate\r
29 @param Memory A pointer to receive the base allocated memory\r
30 address\r
31\r
32 @return Status. On success, Memory is filled in with the base address allocated\r
33 @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in\r
34 spec.\r
35 @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r
36 @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r
37 @retval EFI_SUCCESS Pages successfully allocated.\r
38\r
39**/\r
40EFI_STATUS\r
41EFIAPI\r
42CoreAllocatePages (\r
43 IN EFI_ALLOCATE_TYPE Type,\r
44 IN EFI_MEMORY_TYPE MemoryType,\r
45 IN UINTN NumberOfPages,\r
46 IN OUT EFI_PHYSICAL_ADDRESS *Memory\r
47 );\r
48\r
49\r
50\r
51/**\r
52 Frees previous allocated pages.\r
53\r
54 @param Memory Base address of memory being freed\r
55 @param NumberOfPages The number of pages to free\r
56\r
57 @retval EFI_NOT_FOUND Could not find the entry that covers the range\r
58 @retval EFI_INVALID_PARAMETER Address not aligned\r
59 @return EFI_SUCCESS -Pages successfully freed.\r
60\r
61**/\r
62EFI_STATUS\r
63EFIAPI\r
64CoreFreePages (\r
65 IN EFI_PHYSICAL_ADDRESS Memory,\r
66 IN UINTN NumberOfPages\r
67 );\r
68\r
69\r
70/**\r
71 Allocate pool of a particular type.\r
72\r
73 @param PoolType Type of pool to allocate\r
74 @param Size The amount of pool to allocate\r
75 @param Buffer The address to return a pointer to the allocated\r
76 pool\r
77\r
78 @retval EFI_INVALID_PARAMETER PoolType not valid\r
79 @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r
80 @retval EFI_SUCCESS Pool successfully allocated.\r
81\r
82**/\r
83EFI_STATUS\r
84EFIAPI\r
85CoreAllocatePool (\r
86 IN EFI_MEMORY_TYPE PoolType,\r
87 IN UINTN Size,\r
88 OUT VOID **Buffer\r
89 );\r
90\r
91/**\r
92 Frees pool.\r
93\r
94 @param Buffer The allocated pool entry to free\r
95\r
96 @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r
97 @retval EFI_SUCCESS Pool successfully freed.\r
98\r
99**/\r
100EFI_STATUS\r
101EFIAPI\r
102CoreFreePool (\r
103 IN VOID *Buffer\r
104 );\r
105\r
f2added1 106#endif\r