/** @file\r
Data structure and functions to allocate and free memory space.\r
\r
-Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
@param PoolType The type of memory for the new pool pages\r
@param NumberOfPages No of pages to allocate\r
@param Alignment Bits to align.\r
+ @param NeedGuard Flag to indicate Guard page is needed or not\r
\r
@return The allocated memory, or NULL\r
\r
CoreAllocatePoolPages (\r
IN EFI_MEMORY_TYPE PoolType,\r
IN UINTN NumberOfPages,\r
- IN UINTN Alignment\r
+ IN UINTN Alignment,\r
+ IN BOOLEAN NeedGuard\r
);\r
\r
\r
\r
@param PoolType Type of pool to allocate\r
@param Size The amount of pool to allocate\r
+ @param NeedGuard Flag to indicate Guard page is needed or not\r
\r
@return The allocate pool, or NULL\r
\r
VOID *\r
CoreAllocatePoolI (\r
IN EFI_MEMORY_TYPE PoolType,\r
- IN UINTN Size\r
+ IN UINTN Size,\r
+ IN BOOLEAN NeedGuard\r
);\r
\r
\r
VOID\r
);\r
\r
+/**\r
+ Allocates pages from the memory map.\r
+\r
+ @param Type The type of allocation to perform\r
+ @param MemoryType The type of memory to turn the allocated pages\r
+ into\r
+ @param NumberOfPages The number of pages to allocate\r
+ @param Memory A pointer to receive the base allocated memory\r
+ address\r
+ @param NeedGuard Flag to indicate Guard page is needed or not\r
+\r
+ @return Status. On success, Memory is filled in with the base address allocated\r
+ @retval EFI_INVALID_PARAMETER Parameters violate checking rules defined in\r
+ spec.\r
+ @retval EFI_NOT_FOUND Could not allocate pages match the requirement.\r
+ @retval EFI_OUT_OF_RESOURCES No enough pages to allocate.\r
+ @retval EFI_SUCCESS Pages successfully allocated.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+CoreInternalAllocatePages (\r
+ IN EFI_ALLOCATE_TYPE Type,\r
+ IN EFI_MEMORY_TYPE MemoryType,\r
+ IN UINTN NumberOfPages,\r
+ IN OUT EFI_PHYSICAL_ADDRESS *Memory,\r
+ IN BOOLEAN NeedGuard\r
+ );\r
\r
//\r
// Internal Global data\r