From: Bin Meng Date: Thu, 24 Mar 2022 13:48:12 +0000 (+0800) Subject: hw/core: loader: Set is_linux to true for VxWorks uImage X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8fe63fe8e512d77583d6798acd2164f1fa1e40ab;p=qemu.git hw/core: loader: Set is_linux to true for VxWorks uImage VxWorks 7 uses the same boot interface as the Linux kernel on Arm (64-bit only), PowerPC and RISC-V architectures. Add logic to set is_linux to true for VxWorks uImage for these architectures in load_uboot_image(). Signed-off-by: Bin Meng Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Alistair Francis Message-Id: <20220324134812.541274-2-bmeng.cn@gmail.com> Signed-off-by: Alistair Francis --- diff --git a/hw/core/loader.c b/hw/core/loader.c index 8167301f04..edde657ac3 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -696,6 +696,21 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr, if (is_linux) { if (hdr->ih_os == IH_OS_LINUX) { *is_linux = 1; + } else if (hdr->ih_os == IH_OS_VXWORKS) { + /* + * VxWorks 7 uses the same boot interface as the Linux kernel + * on Arm (64-bit only), PowerPC and RISC-V architectures. + */ + switch (hdr->ih_arch) { + case IH_ARCH_ARM64: + case IH_ARCH_PPC: + case IH_ARCH_RISCV: + *is_linux = 1; + break; + default: + *is_linux = 0; + break; + } } else { *is_linux = 0; }