qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
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 6/8] loader: Add AddressSpace loading support to targphys
Date: Fri, 29 Jul 2016 18:42:19 +0100	[thread overview]
Message-ID: <CAFEAcA_N6yHYsO=dY7+7Zp2qkK5_SMPWM6z2f-JDOc09ioJyJQ@mail.gmail.com> (raw)
In-Reply-To: <808c92d5d8b54da500fbe5426d7dce5b3034ffd1.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_image_targphys_as() that allows the caller
> to specify an AddressSpace to use when loading a targphys. The
> original load_image_targphys() function doesn't have any change in
> functionality.
>
> Signed-off-by: Alistair Francis <alistair.francis@xilinx.com>
> ---
>
>  hw/core/loader.c    | 10 ++++++++--
>  include/hw/loader.h |  5 +++++
>  2 files changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index 861dbc2..31a2d4a 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -133,10 +133,16 @@ ssize_t read_targphys(const char *name,
>      return did;
>  }
>
> -/* return the size or -1 if error */
>  int load_image_targphys(const char *filename,
>                          hwaddr addr, uint64_t max_sz)
>  {
> +    return load_image_targphys_as(filename, addr, max_sz, NULL);
> +}
> +
> +/* return the size or -1 if error */
> +int load_image_targphys_as(const char *filename,
> +                           hwaddr addr, uint64_t max_sz, AddressSpace *as)
> +{
>      int size;
>
>      size = get_image_size(filename);
> @@ -144,7 +150,7 @@ int load_image_targphys(const char *filename,
>          return -1;
>      }
>      if (size > 0) {
> -        rom_add_file_fixed(filename, addr, -1);
> +        rom_add_file_fixed_as(filename, addr, -1, as);
>      }
>      return size;
>  }
> diff --git a/include/hw/loader.h b/include/hw/loader.h
> index ede98f6..1a9053f 100644
> --- a/include/hw/loader.h
> +++ b/include/hw/loader.h
> @@ -16,6 +16,9 @@ int load_image(const char *filename, uint8_t *addr); /* deprecated */
>  ssize_t load_image_size(const char *filename, void *addr, size_t size);
>  int load_image_targphys(const char *filename, hwaddr,
>                          uint64_t max_sz);
> +int load_image_targphys_as(const char *filename,
> +                           hwaddr addr, uint64_t max_sz, AddressSpace *as);
> +

Again, code changes are fine but could we have a doc comment?

thanks
-- PMM

  reply	other threads:[~2016-07-29 17:42 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
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 [this message]
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='CAFEAcA_N6yHYsO=dY7+7Zp2qkK5_SMPWM6z2f-JDOc09ioJyJQ@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).