]>
Commit | Line | Data |
---|---|---|
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 | |
5 | for memory allocation. \r | |
6 | \r | |
cd5ebaa0 HT |
7 | Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r |
8 | This program and the accompanying materials \r | |
0ac72713 | 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 | |
12 | \r | |
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 | |
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 | |
40 | EFI_STATUS\r | |
41 | EFIAPI\r | |
42 | CoreAllocatePages (\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 | |
62 | EFI_STATUS\r | |
63 | EFIAPI\r | |
64 | CoreFreePages (\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 | |
83 | EFI_STATUS\r | |
84 | EFIAPI\r | |
85 | CoreAllocatePool (\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 | |
100 | EFI_STATUS\r | |
101 | EFIAPI\r | |
102 | CoreFreePool (\r | |
103 | IN VOID *Buffer\r | |
104 | );\r | |
105 | \r | |
f2added1 | 106 | #endif\r |