mirror of
https://github.com/ipxe/ipxe
synced 2026-02-06 13:19:28 +03:00
[uheap] Add a generic external heap based on the system memory map
Add an implementation of umalloc() using the generalised model of a heap, placing the external heap in the largest usable region obtained from the system memory map. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -234,5 +234,6 @@ extern void memmap_update ( struct memmap_region *region, uint64_t start,
|
||||
uint64_t size, unsigned int flags,
|
||||
const char *name );
|
||||
extern void memmap_update_used ( struct memmap_region *region );
|
||||
extern size_t memmap_largest ( physaddr_t *start );
|
||||
|
||||
#endif /* _IPXE_MEMMAP_H */
|
||||
|
||||
18
src/include/ipxe/uheap.h
Normal file
18
src/include/ipxe/uheap.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef _IPXE_UHEAP_H
|
||||
#define _IPXE_UHEAP_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* External ("user") heap
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#ifdef UMALLOC_UHEAP
|
||||
#define UMALLOC_PREFIX_uheap
|
||||
#else
|
||||
#define UMALLOC_PREFIX_uheap __uheap_
|
||||
#endif
|
||||
|
||||
#endif /* _IPXE_UHEAP_H */
|
||||
@@ -26,6 +26,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
PROVIDE_SINGLE_API ( UMALLOC_PREFIX_ ## _subsys, _api_func, _func )
|
||||
|
||||
/* Include all architecture-independent I/O API headers */
|
||||
#include <ipxe/uheap.h>
|
||||
#include <ipxe/efi/efi_umalloc.h>
|
||||
#include <ipxe/linux/linux_umalloc.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user