[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:
Michael Brown
2025-05-15 15:35:27 +01:00
parent 4c4c94ca09
commit 3812860e39
7 changed files with 44 additions and 35 deletions

View File

@@ -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
*