[relocate] Guard against systems that report empty memory regions
authorMichael Brown <mcb30@etherboot.org>
Tue, 23 Sep 2008 00:13:28 +0000 (01:13 +0100)
committerMichael Brown <mcb30@etherboot.org>
Tue, 23 Sep 2008 00:13:28 +0000 (01:13 +0100)
commitca0b0f061673b27bb7bfa6f62e99385273c097da
treecf2c06b66558f8f85fbf69e37af1885f189c7d7e
parent0fd1e54026d9c941fce041157bb00cb42fdef9dd
[relocate] Guard against systems that report empty memory regions

If the INT 15,e820 memory map reports a region [0,0), this confuses
the "truncate to even megabytes" logic, which ends up rounding the
region 'down' to [0,fff00000).

Fix by ensuring that the region's end address is at least 1, before we
subtract 1 to obtain the "last byte in region" address.
src/arch/i386/core/relocate.c