OSDN Git Service

mips_malta: cap BIOS endian swap length at 0x3e0000 bytes
authorPaul Burton <paul.burton@imgtec.com>
Fri, 14 Jun 2013 07:30:46 +0000 (08:30 +0100)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 28 Jul 2013 17:59:23 +0000 (19:59 +0200)
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>
hw/mips/mips_malta.c

index e06e19d..a740f61 100644 (file)
@@ -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++;