TianoCore EDK2 master
|
#include <CrtLibSupport.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Guid/EventGroup.h>
Go to the source code of this file.
Data Structures | |
struct | RT_MEMORY_PAGE_ENTRY |
struct | RT_MEMORY_PAGE_TABLE |
Macros | |
#define | RT_PAGE_SIZE 0x200 |
#define | RT_PAGE_MASK 0x1FF |
#define | RT_PAGE_SHIFT 9 |
#define | RT_SIZE_TO_PAGES(a) (((a) >> RT_PAGE_SHIFT) + (((a) & RT_PAGE_MASK) ? 1 : 0)) |
#define | RT_PAGES_TO_SIZE(a) ((a) << RT_PAGE_SHIFT) |
#define | RT_PAGE_FREE 0x00000000 |
#define | RT_PAGE_USED 0x00000001 |
#define | MIN_REQUIRED_BLOCKS 600 |
Functions | |
EFI_STATUS | InitializeScratchMemory (IN OUT UINT8 *ScratchBuffer, IN UINTN ScratchBufferSize) |
UINTN | LookupFreeMemRegion (IN UINTN AllocationSize) |
VOID * | RuntimeAllocateMem (IN UINTN AllocationSize) |
VOID | RuntimeFreeMem (IN VOID *Buffer) |
VOID EFIAPI | RuntimeCryptLibAddressChangeEvent (IN EFI_EVENT Event, IN VOID *Context) |
EFI_STATUS EFIAPI | RuntimeCryptLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable) |
VOID * | malloc (size_t size) |
VOID * | realloc (VOID *ptr, size_t size) |
VOID | free (VOID *ptr) |
Variables | |
RT_MEMORY_PAGE_TABLE * | mRTPageTable = NULL |
STATIC EFI_EVENT | mVirtualAddressChangeEvent |
Light-weight Memory Management Routines for MbedTLS-based Crypto Library at Runtime Phase.
Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file RuntimeMemAllocation.c.
#define MIN_REQUIRED_BLOCKS 600 |
Definition at line 36 of file RuntimeMemAllocation.c.
#define RT_PAGE_FREE 0x00000000 |
Definition at line 33 of file RuntimeMemAllocation.c.
#define RT_PAGE_MASK 0x1FF |
Definition at line 24 of file RuntimeMemAllocation.c.
#define RT_PAGE_SHIFT 9 |
Definition at line 25 of file RuntimeMemAllocation.c.
#define RT_PAGE_SIZE 0x200 |
Definition at line 23 of file RuntimeMemAllocation.c.
#define RT_PAGE_USED 0x00000001 |
Definition at line 34 of file RuntimeMemAllocation.c.
#define RT_PAGES_TO_SIZE | ( | a | ) | ((a) << RT_PAGE_SHIFT) |
Definition at line 28 of file RuntimeMemAllocation.c.
#define RT_SIZE_TO_PAGES | ( | a | ) | (((a) >> RT_PAGE_SHIFT) + (((a) & RT_PAGE_MASK) ? 1 : 0)) |
Definition at line 27 of file RuntimeMemAllocation.c.
VOID free | ( | VOID * | ptr | ) |
Deallocates or frees a memory block.
Definition at line 451 of file RuntimeMemAllocation.c.
EFI_STATUS InitializeScratchMemory | ( | IN OUT UINT8 * | ScratchBuffer, |
IN UINTN | ScratchBufferSize | ||
) |
Initializes pre-allocated memory pointed by ScratchBuffer for subsequent runtime use.
[in,out] | ScratchBuffer | Pointer to user-supplied memory buffer. |
[in] | ScratchBufferSize | Size of supplied buffer in bytes. |
EFI_SUCCESS | Successful initialization. |
Definition at line 75 of file RuntimeMemAllocation.c.
Look-up Free memory Region for object allocation.
[in] | AllocationSize | Bytes to be allocated. |
Definition at line 125 of file RuntimeMemAllocation.c.
VOID * malloc | ( | size_t | size | ) |
Allocates memory blocks.
Definition at line 390 of file RuntimeMemAllocation.c.
VOID * realloc | ( | VOID * | ptr, |
size_t | size | ||
) |
Reallocate memory blocks.
Definition at line 399 of file RuntimeMemAllocation.c.
Allocates a buffer at runtime phase.
[in] | AllocationSize | Bytes to be allocated. |
Definition at line 228 of file RuntimeMemAllocation.c.
Notification function of EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.
This is a notification function registered on EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. It converts a pointer to a new virtual address.
[in] | Event | The event whose notification function is being invoked. |
[in] | Context | The pointer to the notification function's context. |
Definition at line 325 of file RuntimeMemAllocation.c.
EFI_STATUS EFIAPI RuntimeCryptLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Constructor routine for runtime crypt library instance.
The constructor function pre-allocates space for runtime cryptographic operation.
ImageHandle | The firmware allocated handle for the EFI image. |
SystemTable | A pointer to the EFI System Table. |
EFI_SUCCESS | The construction succeeded. |
EFI_OUT_OF_RESOURCE | Failed to allocate memory. |
Definition at line 351 of file RuntimeMemAllocation.c.
VOID RuntimeFreeMem | ( | IN VOID * | Buffer | ) |
Frees a buffer that was previously allocated at runtime phase.
[in] | Buffer | Pointer to the buffer to free. |
Definition at line 283 of file RuntimeMemAllocation.c.
RT_MEMORY_PAGE_TABLE* mRTPageTable = NULL |
Definition at line 57 of file RuntimeMemAllocation.c.
Definition at line 62 of file RuntimeMemAllocation.c.