You've already forked slimbootloader
mirror of
https://github.com/Dasharo/slimbootloader.git
synced 2026-03-06 15:26:20 -08:00
626a8db20e
There are cases where temporary memory is required in stages. Since MemoryAllocationLib instance for stages has no de-allocation function, it needs special handling. This patch added temporary memory management into standard MemoryAllocatoinLib interface. Signed-off-by: Maurice Ma <maurice.ma@intel.com>
40 lines
808 B
C
40 lines
808 B
C
/** @file
|
|
|
|
Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
|
|
|
**/
|
|
|
|
#ifndef __BL_MEMORY_ALLOCATION_LIB_H__
|
|
#define __BL_MEMORY_ALLOCATION_LIB_H__
|
|
|
|
#include <Library/MemoryAllocationLib.h>
|
|
|
|
/**
|
|
This function allocates temporary memory pool.
|
|
|
|
@param[in] AllocationSize The memory pool size to allocate.
|
|
|
|
@retval A pointer to the allocated temporary buffer or NULL if allocation fails.
|
|
|
|
**/
|
|
VOID *
|
|
EFIAPI
|
|
AllocateTemporaryMemory (
|
|
IN UINTN AllocationSize
|
|
);
|
|
|
|
/**
|
|
This function frees temporary memory pool.
|
|
|
|
@param[in] Buffer Temporary memory pool to free.
|
|
NULL indicates to free all temporary memory pool previously allocated
|
|
**/
|
|
VOID
|
|
EFIAPI
|
|
FreeTemporaryMemory (
|
|
IN VOID *Buffer
|
|
);
|
|
|
|
#endif
|