OpenCore
1.0.4
OpenCore Bootloader
|
#include <Uefi.h>
#include <Guid/MemoryAttributesTable.h>
#include <Library/BaseMemoryLib.h>
#include <Library/BaseOverflowLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/OcMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiLib.h>
Go to the source code of this file.
Functions | |
EFI_STATUS | OcAllocatePagesFromTop (IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT EFI_PHYSICAL_ADDRESS *Memory, IN EFI_GET_MEMORY_MAP GetMemoryMap OPTIONAL, IN EFI_ALLOCATE_PAGES AllocatePages OPTIONAL, IN CHECK_ALLOCATION_RANGE CheckRange OPTIONAL) |
UINT64 | OcCountRuntimePages (IN UINTN MemoryMapSize, IN EFI_MEMORY_DESCRIPTOR *MemoryMap, IN UINTN DescriptorSize, OUT UINTN *DescriptorCount OPTIONAL) |
UINTN | OcCountFreePages (OUT UINTN *LowerMemory OPTIONAL) |
Copyright (C) 2019, vit9696. All rights reserved.
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file MemoryAlloc.c.
EFI_STATUS OcAllocatePagesFromTop | ( | IN EFI_MEMORY_TYPE | MemoryType, |
IN UINTN | Pages, | ||
IN OUT EFI_PHYSICAL_ADDRESS * | Memory, | ||
IN EFI_GET_MEMORY_MAP GetMemoryMap | OPTIONAL, | ||
IN EFI_ALLOCATE_PAGES AllocatePages | OPTIONAL, | ||
IN CHECK_ALLOCATION_RANGE CheckRange | OPTIONAL ) |
Allocate pages from the top of physical memory up to address specified in Memory. Unlike AllocateMaxAddress, this method guarantees to choose top most address.
[in] | MemoryType | Allocated memory type. |
[in] | Pages | Amount of pages to allocate. |
[in,out] | Memory | Top address for input, allocated address for output. |
[in] | GetMemoryMap | Custom GetMemoryMap implementation to use, optional. |
[in] | AllocatePages | Custom AllocatePages implementation to use, optional. |
[in] | CheckRange | Handler allowing to not allocate select ranges, optional. |
EFI_SUCCESS | on successful allocation. |
Definition at line 27 of file MemoryAlloc.c.
UINTN OcCountFreePages | ( | OUT UINTN *LowerMemory | OPTIONAL | ) |
Calculate number of free pages in the memory map.
[out] | LowerMemory | Number of free pages below 4 GB, optional. |
Number | of free pages. |
Definition at line 148 of file MemoryAlloc.c.
UINT64 OcCountRuntimePages | ( | IN UINTN | MemoryMapSize, |
IN EFI_MEMORY_DESCRIPTOR * | MemoryMap, | ||
IN UINTN | DescriptorSize, | ||
OUT UINTN *DescriptorCount | OPTIONAL ) |
Calculate number of runtime pages in the memory map.
[in] | MemoryMapSize | Memory map size in bytes. |
[in] | MemoryMap | Memory map to inspect. |
[in] | DescriptorSize | Memory map descriptor size in bytes. |
[out] | DescriptorCount | Number of relevant descriptors, optional. |
Number | of runtime pages. |
Definition at line 111 of file MemoryAlloc.c.