aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaul Burton <paul.burton@imgtec.com>2013-06-14 08:30:46 +0100
committerAurelien Jarno <aurelien@aurel32.net>2013-07-28 19:59:23 +0200
commit1817f56a834f55311af20d1c004b259c16fb1515 (patch)
tree32f84efbc1f61242664c636b8b5457e0e922ef8f /hw
parent02bccc7796fec8b39dca9affc8bff8edebe0a867 (diff)
downloadqemu-1817f56a834f55311af20d1c004b259c16fb1515.zip
qemu-1817f56a834f55311af20d1c004b259c16fb1515.tar.gz
qemu-1817f56a834f55311af20d1c004b259c16fb1515.tar.bz2
mips_malta: cap BIOS endian swap length at 0x3e0000 bytes
This preserves the final sector of the pflash which is used by YAMON to hold environment variables. If the endianness of the environment data is swapped then YAMON will fail to load environment variables from pflash. Signed-off-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Leon Alrae <leon.alrae@imgtec.com> Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'hw')
-rw-r--r--hw/mips/mips_malta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c
index e06e19d..a740f61 100644
--- a/hw/mips/mips_malta.c
+++ b/hw/mips/mips_malta.c
@@ -978,7 +978,7 @@ void mips_malta_init(QEMUMachineInitArgs *args)
if (!addr) {
addr = memory_region_get_ram_ptr(bios);
}
- end = (void *)addr + bios_size;
+ end = (void *)addr + MIN(bios_size, 0x3e0000);
while (addr < end) {
bswap32s(addr);
addr++;