diff options
| author | Michael Brown | 2025-05-22 17:13:36 +0200 |
|---|---|---|
| committer | Michael Brown | 2025-05-22 17:16:14 +0200 |
| commit | b9095a045aeebefc0beff8ea2d30d7d0b73e44a0 (patch) | |
| tree | 3957880ca2d18321d00234463140c3895fe1c48e /src | |
| parent | [riscv] Speed up memmove() when copying in forwards direction (diff) | |
| download | ipxe-b9095a045aeebefc0beff8ea2d30d7d0b73e44a0.tar.gz ipxe-b9095a045aeebefc0beff8ea2d30d7d0b73e44a0.tar.xz ipxe-b9095a045aeebefc0beff8ea2d30d7d0b73e44a0.zip | |
[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>
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/fdtmem.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/fdtmem.c b/src/core/fdtmem.c index b357287c5..ef1ceb59d 100644 --- a/src/core/fdtmem.c +++ b/src/core/fdtmem.c @@ -300,7 +300,8 @@ physaddr_t fdtmem_relocate ( struct fdt_header *hdr, physaddr_t max ) { 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 ) ); |
