]>
Commit | Line | Data |
---|---|---|
713b7781 | 1 | /** @file\r |
2 | Contains function prototypes for Memory Services in the SMM Core.\r | |
3 | \r | |
4 | This header file borrows the PiSmmCore Memory Allocation services as the primitive\r | |
5 | for memory allocation. \r | |
6 | \r | |
cd5ebaa0 HT |
7 | Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r |
8 | This program and the accompanying materials \r | |
713b7781 | 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 _PI_SMM_CORE_MEMORY_ALLOCATION_SERVICES_H_\r | |
19 | #define _PI_SMM_CORE_MEMORY_ALLOCATION_SERVICES_H_\r | |
20 | \r | |
21 | /**\r | |
22 | Allocates pages from the memory map.\r | |
23 | \r | |
24 | @param Type The type of allocation to perform\r | |
25 | @param MemoryType The type of memory to turn the allocated pages\r | |
26 | into\r | |
27 | @param NumberOfPages The number of pages to allocate\r | |
28 | @param Memory A pointer to receive the base allocated memory\r | |
29 | address\r | |
30 | \r | |
31 | @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in spec.\r | |
32 | @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r | |
33 | @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r | |
34 | @retval EFI_SUCCESS Pages successfully allocated.\r | |
35 | \r | |
36 | **/\r | |
37 | EFI_STATUS\r | |
38 | EFIAPI\r | |
39 | SmmAllocatePages (\r | |
40 | IN EFI_ALLOCATE_TYPE Type,\r | |
41 | IN EFI_MEMORY_TYPE MemoryType,\r | |
42 | IN UINTN NumberOfPages,\r | |
43 | OUT EFI_PHYSICAL_ADDRESS *Memory\r | |
44 | );\r | |
45 | \r | |
46 | /**\r | |
47 | Frees previous allocated pages.\r | |
48 | \r | |
49 | @param Memory Base address of memory being freed\r | |
50 | @param NumberOfPages The number of pages to free\r | |
51 | \r | |
52 | @retval EFI_NOT_FOUND Could not find the entry that covers the range\r | |
53 | @retval EFI_INVALID_PARAMETER Address not aligned\r | |
54 | @return EFI_SUCCESS Pages successfully freed.\r | |
55 | \r | |
56 | **/\r | |
57 | EFI_STATUS\r | |
58 | EFIAPI\r | |
59 | SmmFreePages (\r | |
60 | IN EFI_PHYSICAL_ADDRESS Memory,\r | |
61 | IN UINTN NumberOfPages\r | |
62 | );\r | |
63 | \r | |
64 | /**\r | |
65 | Allocate pool of a particular type.\r | |
66 | \r | |
67 | @param PoolType Type of pool to allocate\r | |
68 | @param Size The amount of pool to allocate\r | |
69 | @param Buffer The address to return a pointer to the allocated\r | |
70 | pool\r | |
71 | \r | |
72 | @retval EFI_INVALID_PARAMETER PoolType not valid\r | |
73 | @retval EFI_OUT_OF_RESOURCES Size exceeds max pool size or allocation failed.\r | |
74 | @retval EFI_SUCCESS Pool successfully allocated.\r | |
75 | \r | |
76 | **/\r | |
77 | EFI_STATUS\r | |
78 | EFIAPI\r | |
79 | SmmAllocatePool (\r | |
80 | IN EFI_MEMORY_TYPE PoolType,\r | |
81 | IN UINTN Size,\r | |
82 | OUT VOID **Buffer\r | |
83 | );\r | |
84 | \r | |
85 | /**\r | |
86 | Frees pool.\r | |
87 | \r | |
88 | @param Buffer The allocated pool entry to free\r | |
89 | \r | |
90 | @retval EFI_INVALID_PARAMETER Buffer is not a valid value.\r | |
91 | @retval EFI_SUCCESS Pool successfully freed.\r | |
92 | \r | |
93 | **/\r | |
94 | EFI_STATUS\r | |
95 | EFIAPI\r | |
96 | SmmFreePool (\r | |
97 | IN VOID *Buffer\r | |
98 | );\r | |
99 | \r | |
100 | #endif\r |