OpenCore  1.0.4
OpenCore Bootloader
1.0.4
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
UserBaseMemoryLib.c File Reference
#include <Uefi.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PhaseMemoryAllocationLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiApplicationEntryPoint.h>
#include <string.h>
#include <stdlib.h>
#include <UserMemory.h>

Go to the source code of this file.

Functions

VOID ConfigureMemoryAllocations (IN CONST UINT8 *Data, IN UINTN Size, IN OUT UINT32 *ConfigSize)
 
VOID SetPoolAllocationSizeLimit (UINTN AllocationSize)
 
VOID *EFIAPI CopyMem (OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
 
VOID *EFIAPI SetMem (OUT VOID *Buffer, IN UINTN Length, IN UINT8 Value)
 
VOID *EFIAPI ZeroMem (OUT VOID *Buffer, IN UINTN Length)
 
BOOLEAN EFIAPI IsZeroBuffer (IN CONST VOID *Buffer, IN UINTN Length)
 
BOOLEAN EFIAPI IsZeroGuid (IN CONST GUID *Guid)
 
INTN EFIAPI CompareMem (IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
 
VOID *EFIAPI ScanMem16 (IN CONST VOID *Buffer, IN UINTN Length, IN UINT16 Value)
 
VOID *EFIAPI PhaseAllocatePool (IN EFI_MEMORY_TYPE MemoryType, IN UINTN AllocationSize)
 
STATIC EFI_STATUS InternalAllocatePagesAlign (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT EFI_PHYSICAL_ADDRESS *Memory, IN UINT32 Alignment)
 
EFI_STATUS EFIAPI PhaseAllocatePages (IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN OUT EFI_PHYSICAL_ADDRESS *Memory)
 
VOID EFIAPI PhaseFreePool (IN VOID *Buffer)
 
EFI_STATUS EFIAPI PhaseFreePages (IN EFI_PHYSICAL_ADDRESS Memory, IN UINTN Pages)
 
VOID * InternalAllocateAlignedPages (IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, IN UINTN Alignment)
 
VOID InternalFreeAlignedPages (IN VOID *Buffer, IN UINTN Pages)
 
GUID *EFIAPI CopyGuid (OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
 
BOOLEAN EFIAPI CompareGuid (IN CONST GUID *Guid1, IN CONST GUID *Guid2)
 
UINT16 EFIAPI ReadUnaligned16 (IN CONST UINT16 *Buffer)
 
UINT16 EFIAPI WriteUnaligned16 (OUT UINT16 *Buffer, IN UINT16 Value)
 
UINT32 EFIAPI ReadUnaligned24 (IN CONST UINT32 *Buffer)
 
UINT32 EFIAPI ReadUnaligned32 (IN CONST UINT32 *Buffer)
 
UINT64 EFIAPI ReadUnaligned64 (IN CONST UINT64 *Buffer)
 
UINT32 EFIAPI WriteUnaligned32 (OUT UINT32 *Buffer, IN UINT32 Value)
 
UINT64 EFIAPI WriteUnaligned64 (OUT UINT64 *Buffer, IN UINT64 Value)
 

Variables

GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_MEMORY_TYPE gPhaseDefaultDataType = EfiBootServicesData
 
GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_MEMORY_TYPE gPhaseDefaultCodeType = EfiBootServicesCode
 
STATIC UINTN mPoolAllocationSizeLimit = BASE_512MB
 
GLOBAL_REMOVE_IF_UNREFERENCED UINTN mPoolAllocations
 
GLOBAL_REMOVE_IF_UNREFERENCED UINTN mPageAllocations
 
STATIC UINT64 mPoolAllocationMask = MAX_UINT64
 
STATIC UINTN mPoolAllocationIndex
 
STATIC UINT64 mPageAllocationMask = MAX_UINT64
 
STATIC UINTN mPageAllocationIndex
 

Detailed Description

Copyright (c) 2020, PMheart. All rights reserved. SPDX-License-Identifier: BSD-3-Clause

Definition in file UserBaseMemoryLib.c.

Function Documentation

◆ CompareGuid()

BOOLEAN EFIAPI CompareGuid ( IN CONST GUID * Guid1,
IN CONST GUID * Guid2 )

Definition at line 456 of file UserBaseMemoryLib.c.

◆ CompareMem()

INTN EFIAPI CompareMem ( IN CONST VOID * DestinationBuffer,
IN CONST VOID * SourceBuffer,
IN UINTN Length )

Definition at line 150 of file UserBaseMemoryLib.c.

◆ ConfigureMemoryAllocations()

VOID ConfigureMemoryAllocations ( IN CONST UINT8 * Data,
IN UINTN Size,
IN OUT UINT32 * ConfigSize )

Definition at line 41 of file UserBaseMemoryLib.c.

◆ CopyGuid()

GUID *EFIAPI CopyGuid ( OUT GUID * DestinationGuid,
IN CONST GUID * SourceGuid )

Definition at line 441 of file UserBaseMemoryLib.c.

◆ CopyMem()

VOID *EFIAPI CopyMem ( OUT VOID * DestinationBuffer,
IN CONST VOID * SourceBuffer,
IN UINTN Length )

Definition at line 75 of file UserBaseMemoryLib.c.

◆ InternalAllocateAlignedPages()

VOID * InternalAllocateAlignedPages ( IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN UINTN Alignment )

Definition at line 407 of file UserBaseMemoryLib.c.

◆ InternalAllocatePagesAlign()

STATIC EFI_STATUS InternalAllocatePagesAlign ( IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS * Memory,
IN UINT32 Alignment )

Definition at line 238 of file UserBaseMemoryLib.c.

◆ InternalFreeAlignedPages()

VOID InternalFreeAlignedPages ( IN VOID * Buffer,
IN UINTN Pages )

Definition at line 431 of file UserBaseMemoryLib.c.

◆ IsZeroBuffer()

BOOLEAN EFIAPI IsZeroBuffer ( IN CONST VOID * Buffer,
IN UINTN Length )

Definition at line 114 of file UserBaseMemoryLib.c.

◆ IsZeroGuid()

BOOLEAN EFIAPI IsZeroGuid ( IN CONST GUID * Guid)

Definition at line 135 of file UserBaseMemoryLib.c.

◆ PhaseAllocatePages()

EFI_STATUS EFIAPI PhaseAllocatePages ( IN EFI_ALLOCATE_TYPE Type,
IN EFI_MEMORY_TYPE MemoryType,
IN UINTN Pages,
IN OUT EFI_PHYSICAL_ADDRESS * Memory )

Definition at line 304 of file UserBaseMemoryLib.c.

◆ PhaseAllocatePool()

VOID *EFIAPI PhaseAllocatePool ( IN EFI_MEMORY_TYPE MemoryType,
IN UINTN AllocationSize )

Definition at line 186 of file UserBaseMemoryLib.c.

◆ PhaseFreePages()

EFI_STATUS EFIAPI PhaseFreePages ( IN EFI_PHYSICAL_ADDRESS Memory,
IN UINTN Pages )

Definition at line 352 of file UserBaseMemoryLib.c.

◆ PhaseFreePool()

VOID EFIAPI PhaseFreePool ( IN VOID * Buffer)

Definition at line 322 of file UserBaseMemoryLib.c.

◆ ReadUnaligned16()

UINT16 EFIAPI ReadUnaligned16 ( IN CONST UINT16 * Buffer)

Definition at line 469 of file UserBaseMemoryLib.c.

◆ ReadUnaligned24()

UINT32 EFIAPI ReadUnaligned24 ( IN CONST UINT32 * Buffer)

Definition at line 496 of file UserBaseMemoryLib.c.

◆ ReadUnaligned32()

UINT32 EFIAPI ReadUnaligned32 ( IN CONST UINT32 * Buffer)

Definition at line 509 of file UserBaseMemoryLib.c.

◆ ReadUnaligned64()

UINT64 EFIAPI ReadUnaligned64 ( IN CONST UINT64 * Buffer)

Definition at line 524 of file UserBaseMemoryLib.c.

◆ ScanMem16()

VOID *EFIAPI ScanMem16 ( IN CONST VOID * Buffer,
IN UINTN Length,
IN UINT16 Value )

Definition at line 164 of file UserBaseMemoryLib.c.

◆ SetMem()

VOID *EFIAPI SetMem ( OUT VOID * Buffer,
IN UINTN Length,
IN UINT8 Value )

Definition at line 89 of file UserBaseMemoryLib.c.

◆ SetPoolAllocationSizeLimit()

VOID SetPoolAllocationSizeLimit ( UINTN AllocationSize)

Definition at line 66 of file UserBaseMemoryLib.c.

◆ WriteUnaligned16()

UINT16 EFIAPI WriteUnaligned16 ( OUT UINT16 * Buffer,
IN UINT16 Value )

Definition at line 482 of file UserBaseMemoryLib.c.

◆ WriteUnaligned32()

UINT32 EFIAPI WriteUnaligned32 ( OUT UINT32 * Buffer,
IN UINT32 Value )

Definition at line 539 of file UserBaseMemoryLib.c.

◆ WriteUnaligned64()

UINT64 EFIAPI WriteUnaligned64 ( OUT UINT64 * Buffer,
IN UINT64 Value )

Definition at line 553 of file UserBaseMemoryLib.c.

◆ ZeroMem()

VOID *EFIAPI ZeroMem ( OUT VOID * Buffer,
IN UINTN Length )

Definition at line 102 of file UserBaseMemoryLib.c.

Variable Documentation

◆ gPhaseDefaultCodeType

GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_MEMORY_TYPE gPhaseDefaultCodeType = EfiBootServicesCode

Definition at line 24 of file UserBaseMemoryLib.c.

◆ gPhaseDefaultDataType

GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_MEMORY_TYPE gPhaseDefaultDataType = EfiBootServicesData

Definition at line 23 of file UserBaseMemoryLib.c.

◆ mPageAllocationIndex

STATIC UINTN mPageAllocationIndex

Definition at line 38 of file UserBaseMemoryLib.c.

◆ mPageAllocationMask

STATIC UINT64 mPageAllocationMask = MAX_UINT64

Definition at line 37 of file UserBaseMemoryLib.c.

◆ mPageAllocations

GLOBAL_REMOVE_IF_UNREFERENCED UINTN mPageAllocations

Definition at line 33 of file UserBaseMemoryLib.c.

◆ mPoolAllocationIndex

STATIC UINTN mPoolAllocationIndex

Definition at line 36 of file UserBaseMemoryLib.c.

◆ mPoolAllocationMask

STATIC UINT64 mPoolAllocationMask = MAX_UINT64

Definition at line 35 of file UserBaseMemoryLib.c.

◆ mPoolAllocations

GLOBAL_REMOVE_IF_UNREFERENCED UINTN mPoolAllocations

Definition at line 32 of file UserBaseMemoryLib.c.

◆ mPoolAllocationSizeLimit

STATIC UINTN mPoolAllocationSizeLimit = BASE_512MB

Definition at line 30 of file UserBaseMemoryLib.c.