From: Guenter Roeck Date: Wed, 12 Aug 2015 14:20:36 +0000 (-0700) Subject: sh4: Fix initramfs initialization for endiannes-mismatched targets X-Git-Tag: v2.5.0-rc0~132^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cdd14a8cf25c34ff8d0777530e8d16565f6bf7a1;p=thirdparty%2Fqemu.git sh4: Fix initramfs initialization for endiannes-mismatched targets 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 Signed-off-by: Aurelien Jarno --- diff --git a/hw/sh4/r2d.c b/hw/sh4/r2d.c index 5e22ed79b2a..3b0b2ecfa44 100644 --- a/hw/sh4/r2d.c +++ b/hw/sh4/r2d.c @@ -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) {