mirror of
https://github.com/ipxe/ipxe
synced 2026-02-07 19:38:57 +03:00
[fdtmem] Allow iPXE to be relocated to the top of the address space
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>
This commit is contained in:
@@ -300,7 +300,8 @@ physaddr_t fdtmem_relocate ( struct fdt_header *hdr, physaddr_t max ) {
|
|||||||
assert ( region.last >= region.addr );
|
assert ( region.last >= region.addr );
|
||||||
|
|
||||||
/* Use highest possible region */
|
/* 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 */
|
/* Determine candidate address after alignment */
|
||||||
try = ( ( next - len ) & ~( max_align - 1 ) );
|
try = ( ( next - len ) & ~( max_align - 1 ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user