]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
sh4: Fix initramfs initialization for endiannes-mismatched targets
authorGuenter Roeck <linux@roeck-us.net>
Wed, 12 Aug 2015 14:20:36 +0000 (07:20 -0700)
committerAurelien Jarno <aurelien@aurel32.net>
Sun, 13 Sep 2015 21:08:51 +0000 (23:08 +0200)
If host and target endianness does not match, loding an initramfs does not work.
Fix by writing boot parameters with appropriate endianness conversion.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
hw/sh4/r2d.c

index 5e22ed79b2a9015d7aa600b2935e3d8358c40c29..3b0b2ecfa444cb921d1817b6beccfc161664c7cd 100644 (file)
@@ -338,9 +338,9 @@ static void r2d_init(MachineState *machine)
         }
 
         /* initialization which should be done by firmware */
-        boot_params.loader_type = 1;
-        boot_params.initrd_start = INITRD_LOAD_OFFSET;
-        boot_params.initrd_size = initrd_size;
+        boot_params.loader_type = tswap32(1);
+        boot_params.initrd_start = tswap32(INITRD_LOAD_OFFSET);
+        boot_params.initrd_size = tswap32(initrd_size);
     }
 
     if (kernel_cmdline) {