From nobody Sat May 4 20:40:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 154453132284455.44574396668679; Tue, 11 Dec 2018 04:28:42 -0800 (PST) Received: from localhost ([::1]:37756 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWh9M-0005kK-6K for importer@patchew.org; Tue, 11 Dec 2018 07:28:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gWh8R-0005CW-BN for qemu-devel@nongnu.org; Tue, 11 Dec 2018 07:27:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gWh8P-0005D6-Vb for qemu-devel@nongnu.org; Tue, 11 Dec 2018 07:27:35 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:35821) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gWh8L-00055j-M0; Tue, 11 Dec 2018 07:27:30 -0500 Received: by mail-wm1-x341.google.com with SMTP id c126so2055980wmh.0; Tue, 11 Dec 2018 04:27:28 -0800 (PST) Received: from ?IPv6:2a02:c7d:860e:5301:c996:71c2:4b1a:1870? ([2a02:c7d:860e:5301:c996:71c2:4b1a:1870]) by smtp.gmail.com with ESMTPSA id v132sm1651130wme.20.2018.12.11.04.27.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 04:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=d3J125H17xpWctfhnZswfebtNELQOmfbKciDFJ9YTk4=; b=th9vsMIvLKIzgfQuCU1ZejoXeJioROWwTgjKG3uRESvE5xIwmijA7cc1EBXc/ZO4Xg Io9MgmiTuXE7WBGZ99vH18OImauOLFiOwuNj/uqyfX7RZvVN8ElUTsWGwVhXAjU5kW9x +ygoDo2xTcF+nsFePuIRoMpe2FB+fxWcUAMhwL8/Tx21QzkiEikt9qXqp3nDjGpY4Kkw 9WCAfYtnnAdsFZDnsKA8AiJAi9kaJwaa/fIdnfMczmqUq15Djzibe/Uc/VErUQKIdwOY XC0OKVBIyys3wOxvRQ0YHffKbtGwLpINvF9j3cXACcwwqBv/3AJnO37gHm3of3N/ifA5 yGEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=d3J125H17xpWctfhnZswfebtNELQOmfbKciDFJ9YTk4=; b=IdVzNy/PcVVuq7nRt5rpqPxU8hAMHaorPhIxZbBV1ES2F99zkNctdQ49ncwfaWconT pm98aelcyTLCja4oSeF1eJcO/C6WSPw3qaCD/Q+745poKOFPjjtMzZJ9yXDu2X02Ffzw RzVbuUXPccKKl3REKgE/wfEWG9efRImdDRHB6qIO4J4o6ji3rxJoDhv5uFTzCYdrmsz3 X+yTYrotm6jlWO3eCmji/3bK2coH/3bTwgo8Zsf5+6CO/itRqeKwIceatcvRmWmVH7Yv Zi3FgIqjEuNqOExRbMj0v+KHRqXpJ/xvnSM0P302IqCtfsJ/DX3Ec5ooApIV8rk0ZgEy r7yQ== X-Gm-Message-State: AA+aEWaxaMXcTGaGaFEU+ZvjgXK9jyxHMEUBdQuxQMOsbtQi4bUAxC3T MeCkw96A/1LZpOIBtZVn9Qw= X-Google-Smtp-Source: AFSGD/VGzh7l7zqM/aAFYARbpqPeaN9Tla/HThH8KVD/z0EhY4BYfWr5K0RQL42JtH98JOtZSiacbw== X-Received: by 2002:a1c:384:: with SMTP id 126mr2179339wmd.26.1544531247033; Tue, 11 Dec 2018 04:27:27 -0800 (PST) From: Nick Hudson X-Google-Original-From: Nick Hudson To: QEMU Developers Message-ID: <975b9131-9937-cfea-3b5d-ef36d0c2b761@gmail.com> Date: Tue, 11 Dec 2018 12:27:25 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format="flowed" Content-Transfer-Encoding: quoted-printable Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::341 Subject: [Qemu-devel] [PATCH v3] Support u-boot noload images for arm as used by, NetBSD/evbarm GENERIC kernel. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , qemu-arm Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) noload kernels are loaded with the u-boot image header and as a result the header size needs adding to the entry point.=C2=A0 Fake up a hdr so the kernel image is loaded at the right address and the entry point is adjusted appropriately. The bootloader fits in the space that the uboot header would have occupied. Clarify the load_uimage API to state the passing of a load address when an image doesn't specify one, or when loading a ramdisk is expected. Adjust callers of load_uimage, etc. Signed-off-by: Nick Hudson --- =C2=A0hw/arm/boot.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = |=C2=A0 8 +++++--- =C2=A0hw/core/loader.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 | 19 ++++++++++= ++++++--- =C2=A0hw/core/uboot_image.h=C2=A0 |=C2=A0 1 + =C2=A0hw/microblaze/boot.c=C2=A0=C2=A0 |=C2=A0 2 +- =C2=A0hw/nios2/boot.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 = +- =C2=A0hw/ppc/e500.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 = |=C2=A0 1 + =C2=A0hw/ppc/ppc440_bamboo.c |=C2=A0 2 +- =C2=A0hw/ppc/sam460ex.c=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 |=C2=A0 2 +- =C2=A0include/hw/loader.h=C2=A0=C2=A0=C2=A0 |=C2=A0 7 ++++++- =C2=A09 files changed, 33 insertions(+), 11 deletions(-) diff --git a/hw/arm/boot.c b/hw/arm/boot.c index 586baa9b64..450267566a 100644 --- a/hw/arm/boot.c +++ b/hw/arm/boot.c @@ -30,8 +30,9 @@ =C2=A0 * Documentation/arm/Booting and Documentation/arm64/booting.txt =C2=A0 * They have different preferred image load offsets from system RAM = base. =C2=A0 */ -#define KERNEL_ARGS_ADDR 0x100 -#define KERNEL_LOAD_ADDR 0x00010000 +#define KERNEL_ARGS_ADDR=C2=A0=C2=A0 0x100 +#define KERNEL_NOLOAD_ADDR 0x00000000 +#define KERNEL_LOAD_ADDR=C2=A0=C2=A0 0x00010000 =C2=A0#define KERNEL64_LOAD_ADDR 0x00080000 =C2=A0#define ARM64_TEXT_OFFSET_OFFSET=C2=A0=C2=A0=C2=A0 8 @@ -1078,7 +1079,8 @@ void arm_load_kernel(ARMCPU *cpu, struct=20 arm_boot_info *info) =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 entry =3D elf_entry; =C2=A0=C2=A0=C2=A0=C2=A0 if (kernel_size < 0) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 kernel_size =3D load_uimage_as(= info->kernel_filename, &entry, NULL, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 uint64_t loadaddr =3D info->loa= der_start + KERNEL_NOLOAD_ADDR; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 kernel_size =3D load_uimage_as(= info->kernel_filename, &entry,=20 &loadaddr, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= &is_linux, NULL, NULL, as); =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 if (arm_feature(&cpu->env, ARM_FEATURE_AARCH64) &= & kernel_size < 0) { diff --git a/hw/core/loader.c b/hw/core/loader.c index aa0b3fc867..7362197162 100644 --- a/hw/core/loader.c +++ b/hw/core/loader.c @@ -638,13 +638,26 @@ static int load_uboot_image(const char *filename,=20 hwaddr *ep, hwaddr *loadaddr, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out; =C2=A0=C2=A0=C2=A0=C2=A0 if (hdr->ih_type !=3D image_type) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fprintf(stderr, "Wrong image ty= pe %d, expected %d\n", hdr->ih_type, -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0 image_type); -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto out; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (image_type !=3D IH_TYPE_KER= NEL && +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hdr->ih= _type !=3D IH_TYPE_KERNEL_NOLOAD) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fprintf= (stderr, "Wrong image type %d, expected %d\n",=20 hdr->ih_type, +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 image_type); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto ou= t; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 } =C2=A0=C2=A0=C2=A0=C2=A0 /* TODO: Implement other image types.=C2=A0 */ =C2=A0=C2=A0=C2=A0=C2=A0 switch (hdr->ih_type) { +=C2=A0=C2=A0=C2=A0 case IH_TYPE_KERNEL_NOLOAD: +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (!loadaddr || *loadaddr =3D= =3D LOAD_UIMAGE_LOADADDR_INVALID) { +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 fprintf= (stderr, "this image format (kernel_noload) cannot be " +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "loaded on this machine type"); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 goto ou= t; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 } + +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hdr->ih_load =3D *loadaddr + si= zeof(*hdr); +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hdr->ih_ep +=3D hdr->ih_load; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* fall through */ =C2=A0=C2=A0=C2=A0=C2=A0 case IH_TYPE_KERNEL: =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 address =3D hdr->ih_load; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (translate_fn) { diff --git a/hw/core/uboot_image.h b/hw/core/uboot_image.h index 34c11a70a6..608022de6e 100644 --- a/hw/core/uboot_image.h +++ b/hw/core/uboot_image.h @@ -124,6 +124,7 @@ =C2=A0#define IH_TYPE_SCRIPT=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 6=C2=A0= =C2=A0=C2=A0 /* Script file =C2=A0=C2=A0=C2=A0 */ =C2=A0#define IH_TYPE_FILESYSTEM=C2=A0=C2=A0=C2=A0 7=C2=A0=C2=A0=C2=A0 /* = Filesystem Image (any type)=C2=A0=C2=A0=C2=A0 */ =C2=A0#define IH_TYPE_FLATDT=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 8=C2=A0= =C2=A0=C2=A0 /* Binary Flat Device Tree Blob=C2=A0=C2=A0=C2=A0 */ +#define IH_TYPE_KERNEL_NOLOAD=C2=A0 14=C2=A0=C2=A0=C2=A0 /* OS Kernel Imag= e (noload)=C2=A0=C2=A0=C2=A0 */ =C2=A0/* =C2=A0 * Compression Types diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c index 35bfeda7aa..489ab839b7 100644 --- a/hw/microblaze/boot.c +++ b/hw/microblaze/boot.c @@ -156,7 +156,7 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu,=20 hwaddr ddr_base, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* If it wasn't an ELF im= age, try an u-boot image.=C2=A0 */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (kernel_size < 0) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hwaddr = uentry, loadaddr; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hwaddr = uentry, loadaddr =3D LOAD_UIMAGE_LOADADDR_INVALID; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 k= ernel_size =3D load_uimage(kernel_filename, &uentry,=20 &loadaddr, 0, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 NULL, NULL); diff --git a/hw/nios2/boot.c b/hw/nios2/boot.c index 4bb5b601d3..ed5cb28e94 100644 --- a/hw/nios2/boot.c +++ b/hw/nios2/boot.c @@ -161,7 +161,7 @@ void nios2_load_kernel(Nios2CPU *cpu, hwaddr ddr_base, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 /* If it wasn't an ELF im= age, try an u-boot image. */ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (kernel_size < 0) { -=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hwaddr = uentry, loadaddr; +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 hwaddr = uentry, loadaddr =3D LOAD_UIMAGE_LOADADDR_INVALID; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 k= ernel_size =3D load_uimage(kernel_filename, &uentry,=20 &loadaddr, 0, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0 NULL, NULL); diff --git a/hw/ppc/e500.c b/hw/ppc/e500.c index e6747fce28..e275178951 100644 --- a/hw/ppc/e500.c +++ b/hw/ppc/e500.c @@ -997,6 +997,7 @@ void ppce500_init(MachineState *machine) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * Hrm. No ELF image= ? Try a uImage, maybe someone is giving us an =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 * ePAPR compliant k= ernel =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 */ +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 loadaddr =3D LOAD_UIMAGE_LOADAD= DR_INVALID; =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 payload_size =3D load_uim= age(filename, &bios_entry, &loadaddr, NULL, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 NULL, NULL); =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 if (payload_size < 0) { diff --git a/hw/ppc/ppc440_bamboo.c b/hw/ppc/ppc440_bamboo.c index f5720f979e..70428b1865 100644 --- a/hw/ppc/ppc440_bamboo.c +++ b/hw/ppc/ppc440_bamboo.c @@ -180,7 +180,7 @@ static void bamboo_init(MachineState *machine) =C2=A0=C2=A0=C2=A0=C2=A0 CPUPPCState *env; =C2=A0=C2=A0=C2=A0=C2=A0 uint64_t elf_entry; =C2=A0=C2=A0=C2=A0=C2=A0 uint64_t elf_lowaddr; -=C2=A0=C2=A0=C2=A0 hwaddr loadaddr =3D 0; +=C2=A0=C2=A0=C2=A0 hwaddr loadaddr =3D LOAD_UIMAGE_LOADADDR_INVALID; =C2=A0=C2=A0=C2=A0=C2=A0 target_long initrd_size =3D 0; =C2=A0=C2=A0=C2=A0=C2=A0 DeviceState *dev; =C2=A0=C2=A0=C2=A0=C2=A0 int success; diff --git a/hw/ppc/sam460ex.c b/hw/ppc/sam460ex.c index 5aac58f36e..2d6d5c4402 100644 --- a/hw/ppc/sam460ex.c +++ b/hw/ppc/sam460ex.c @@ -402,7 +402,7 @@ static void sam460ex_init(MachineState *machine) =C2=A0=C2=A0=C2=A0=C2=A0 CPUPPCState *env; =C2=A0=C2=A0=C2=A0=C2=A0 PPC4xxI2CState *i2c[2]; =C2=A0=C2=A0=C2=A0=C2=A0 hwaddr entry =3D UBOOT_ENTRY; -=C2=A0=C2=A0=C2=A0 hwaddr loadaddr =3D 0; +=C2=A0=C2=A0=C2=A0 hwaddr loadaddr =3D LOAD_UIMAGE_LOADADDR_INVALID; =C2=A0=C2=A0=C2=A0=C2=A0 target_long initrd_size =3D 0; =C2=A0=C2=A0=C2=A0=C2=A0 DeviceState *dev; =C2=A0=C2=A0=C2=A0=C2=A0 SysBusDevice *sbdev; diff --git a/include/hw/loader.h b/include/hw/loader.h index 67a0af84ac..a7254bc5c4 100644 --- a/include/hw/loader.h +++ b/include/hw/loader.h @@ -160,10 +160,15 @@ void load_elf_hdr(const char *filename, void *hdr,=20 bool *is64, Error **errp); =C2=A0int load_aout(const char *filename, hwaddr addr, int max_sz, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 int bswap_needed, hwaddr target_page_size); +#define LOAD_UIMAGE_LOADADDR_INVALID (-1) + =C2=A0/** load_uimage_as: =C2=A0 * @filename: Path of uimage file =C2=A0 * @ep: Populated with program entry point. Ignored if NULL. - * @loadaddr: Populated with the load address. Ignored if NULL. + * @loadaddr: load address if none specified in the image or when=20 loading a ramdisk. + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Popul= ated with the the load address. Ignored if NULL or + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 LOAD_= UIMAGE_LOADADDR_INVALID (images which do not specify=20 a load address + *=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 will = not be loadable). =C2=A0 * @is_linux: Is set to true if the image loaded is Linux. Ignored i= f=20 NULL. =C2=A0 * @translate_fn: optional function to translate load addresses =C2=A0 * @translate_opaque: opaque data passed to @translate_fn --=20 2.17.1