mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[bios] Describe umalloc() heap as an in-use memory area
Use the concept of an in-use memory region defined as part of the system memory map API to describe the umalloc() heap. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -34,9 +34,9 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <ipxe/uaccess.h>
|
||||
#include <ipxe/hidemem.h>
|
||||
#include <ipxe/io.h>
|
||||
#include <ipxe/memblock.h>
|
||||
#include <ipxe/memmap.h>
|
||||
#include <ipxe/umalloc.h>
|
||||
|
||||
/** Maximum usable address for external allocated memory */
|
||||
@@ -62,6 +62,22 @@ static void *bottom = NULL;
|
||||
/** Remaining space on heap */
|
||||
static size_t heap_size;
|
||||
|
||||
/** In-use memory region */
|
||||
struct used_region umalloc_used __used_region = {
|
||||
.name = "umalloc",
|
||||
};
|
||||
|
||||
/**
|
||||
* Hide umalloc() region
|
||||
*
|
||||
* @v start Start of region
|
||||
* @v end End of region
|
||||
*/
|
||||
static void hide_umalloc ( physaddr_t start, physaddr_t end ) {
|
||||
|
||||
memmap_use ( &umalloc_used, start, ( end - start ) );
|
||||
}
|
||||
|
||||
/**
|
||||
* Find largest usable memory region
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user