From: Peter Maydell <peter.maydell@linaro.org>
To: Alistair Francis <alistair.francis@xilinx.com>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
Peter Crosthwaite <crosthwaitepeter@gmail.com>,
Markus Armbruster <armbru@redhat.com>,
Christopher Covington <cov@codeaurora.org>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v9 5/8] loader: Add AddressSpace loading support to uImages
Date: Fri, 29 Jul 2016 18:41:32 +0100 [thread overview]
Message-ID: <CAFEAcA8r6aaMKRydnQE1C7eOtsvT-hqywcGaWHpX37Ze7d35YA@mail.gmail.com> (raw)
In-Reply-To: <9404f06c7efcb58a8076c57e8b0cffa63c12868b.1468454556.git.alistair.francis@xilinx.com>
On 14 July 2016 at 01:03, Alistair Francis <alistair.francis@xilinx.com> wrote:
> Add a new function load_uimage_as() that allows the caller to
> specify an AddressSpace to use when loading the uImage. The
> original load_uimage() function doesn't have any change in
> functionality.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>
> hw/core/loader.c | 17 +++++++++++++----
> include/hw/loader.h | 6 ++++++
> 2 files changed, 19 insertions(+), 4 deletions(-)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index 0f69894..861dbc2 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -581,7 +581,7 @@ static ssize_t gunzip(void *dst, size_t dstlen, uint8_t *src,
> static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr,
> int *is_linux, uint8_t image_type,
> uint64_t (*translate_fn)(void *, uint64_t),
> - void *translate_opaque)
> + void *translate_opaque, AddressSpace *as)
> {
> int fd;
> int size;
> @@ -682,7 +682,7 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr,
> hdr->ih_size = bytes;
> }
>
> - rom_add_blob_fixed(filename, data, hdr->ih_size, address);
> + rom_add_blob_fixed_as(filename, data, hdr->ih_size, address, as);
>
> ret = hdr->ih_size;
>
> @@ -698,14 +698,23 @@ int load_uimage(const char *filename, hwaddr *ep, hwaddr *loadaddr,
> void *translate_opaque)
> {
> return load_uboot_image(filename, ep, loadaddr, is_linux, IH_TYPE_KERNEL,
> - translate_fn, translate_opaque);
> + translate_fn, translate_opaque, NULL);
> +}
> +
> +int load_uimage_as(const char *filename, hwaddr *ep, hwaddr *loadaddr,
> + int *is_linux,
> + uint64_t (*translate_fn)(void *, uint64_t),
> + void *translate_opaque, AddressSpace *as)
> +{
> + return load_uboot_image(filename, ep, loadaddr, is_linux, IH_TYPE_KERNEL,
> + translate_fn, translate_opaque, as);
> }
>
> /* Load a ramdisk. */
> int load_ramdisk(const char *filename, hwaddr addr, uint64_t max_sz)
> {
> return load_uboot_image(filename, NULL, &addr, NULL, IH_TYPE_RAMDISK,
> - NULL, NULL);
> + NULL, NULL, NULL);
> }
>
> /* Load a gzip-compressed kernel to a dynamically allocated buffer. */
> diff --git a/include/hw/loader.h b/include/hw/loader.h
> index 36a16cc..ede98f6 100644
> --- a/include/hw/loader.h
> +++ b/include/hw/loader.h
> @@ -108,6 +108,10 @@ int load_uimage(const char *filename, hwaddr *ep,
> hwaddr *loadaddr, int *is_linux,
> uint64_t (*translate_fn)(void *, uint64_t),
> void *translate_opaque);
> +int load_uimage_as(const char *filename, hwaddr *ep,
> + hwaddr *loadaddr, int *is_linux,
> + uint64_t (*translate_fn)(void *, uint64_t),
> + void *translate_opaque, AddressSpace *as);
The code changes are good, but could we have a doc comment for
this new function, please?
thanks
-- PMM
next prev parent reply other threads:[~2016-07-29 17:41 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-14 0:03 [Qemu-devel] [PATCH v9 0/8] Add a generic loader Alistair Francis
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 1/8] loader: Allow ELF loader to auto-detect the ELF arch Alistair Francis
2016-07-29 15:42 ` Peter Maydell
2016-08-02 0:03 ` Alistair Francis
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 2/8] loader: Use the specified MemoryRegion Alistair Francis
2016-07-29 17:34 ` Peter Maydell
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 3/8] loader: Allow a custom AddressSpace when loading ROMs Alistair Francis
2016-07-29 15:56 ` Peter Maydell
2016-08-02 22:59 ` Alistair Francis
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 4/8] loader: Add AddressSpace loading support to ELFs Alistair Francis
2016-07-29 17:35 ` Peter Maydell
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 5/8] loader: Add AddressSpace loading support to uImages Alistair Francis
2016-07-29 17:41 ` Peter Maydell [this message]
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support to targphys Alistair Francis
2016-07-29 17:42 ` Peter Maydell
2016-08-02 21:21 ` Alistair Francis
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 7/8] generic-loader: Add a generic loader Alistair Francis
2016-07-14 0:03 ` [Qemu-devel] [PATCH v9 8/8] docs: Add a generic loader explanation document Alistair Francis
2016-07-29 17:55 ` Peter Maydell
2016-08-03 18:22 ` Alistair Francis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAFEAcA8r6aaMKRydnQE1C7eOtsvT-hqywcGaWHpX37Ze7d35YA@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=alistair.francis@xilinx.com \
--cc=armbru@redhat.com \
--cc=cov@codeaurora.org \
--cc=crosthwaitepeter@gmail.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).