qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alistair Francis <alistair.francis@xilinx.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Alistair Francis <alistair.francis@xilinx.com>,
	Christopher Covington <cov@codeaurora.org>,
	Peter Crosthwaite <crosthwaitepeter@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support to targphys
Date: Tue, 2 Aug 2016 14:21:14 -0700	[thread overview]
Message-ID: <CAKmqyKMYiL+aKZw2PvMNzOZTJxURwhNgKaLQ50W4PjDAN5Sq6w@mail.gmail.com> (raw)
In-Reply-To: <CAFEAcA_N6yHYsO=dY7+7Zp2qkK5_SMPWM6z2f-JDOc09ioJyJQ@mail.gmail.com>

On Fri, Jul 29, 2016 at 10:42 AM, Peter Maydell
<peter.maydell@linaro.org> wrote:
> 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?

I have added comments to both.

Thanks,

Alistair

>
> thanks
> -- PMM
>

  reply	other threads:[~2016-08-02 21:21 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
2016-08-02 21:21     ` Alistair Francis [this message]
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=CAKmqyKMYiL+aKZw2PvMNzOZTJxURwhNgKaLQ50W4PjDAN5Sq6w@mail.gmail.com \
    --to=alistair.francis@xilinx.com \
    --cc=armbru@redhat.com \
    --cc=cov@codeaurora.org \
    --cc=crosthwaitepeter@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --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).