Allow for relocation to a region at the very end of the physical
address space (where the next address wraps to zero).
Signed-off-by: Michael Brown <mcb30@ipxe.org>
assert ( region.last >= region.addr );
/* Use highest possible region */
- if ( memmap_is_usable ( ®ion ) && ( next >= len ) ) {
+ if ( memmap_is_usable ( ®ion ) &&
+ ( ( next == 0 ) || ( next >= len ) ) ) {
/* Determine candidate address after alignment */
try = ( ( next - len ) & ~( max_align - 1 ) );