[uheap] Expose external heap region directly

We currently rely on implicit detection of the external heap region.
The INT 15 memory map mangler relies on examining the corresponding
in-use memory region, and the initrd reshuffler relies on performing a
separate detection of the largest free memory block after startup has
completed.

Replace these with explicit public symbols to describe the external
heap region.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-05-22 11:58:11 +01:00
parent e056041074
commit 11e01f0652
5 changed files with 55 additions and 51 deletions

View File

@@ -30,6 +30,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <fakee820.h>
#include <ipxe/init.h>
#include <ipxe/io.h>
#include <ipxe/uheap.h>
#include <ipxe/memmap.h>
/** Set to true if you want to test a fake E820 map */
@@ -132,18 +133,18 @@ void hide_textdata ( void ) {
*/
static void int15_sync ( void ) {
physaddr_t start;
size_t size;
physaddr_t end;
/* Besides our fixed base memory and textdata regions, we
* support hiding only a single in-use memory region (the
* umalloc region), which must be placed before the hidden
* textdata region (even if zero-length).
*/
start = uheap_used.start;
size = uheap_used.size;
if ( ! size )
start = virt_to_phys ( _textdata );
hide_region ( &hidemem_umalloc, start, ( start + size ) );
start = uheap_start;
end = uheap_end;
if ( start == end )
start = end = virt_to_phys ( _textdata );
hide_region ( &hidemem_umalloc, start, end );
}
/**