[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support to targphys |
Date: |
Fri, 29 Jul 2016 18:42:19 +0100 |
On 14 July 2016 at 01:03, Alistair Francis <address@hidden> 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 <address@hidden>
> ---
>
> 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
- Re: [Qemu-devel] [PATCH v9 1/8] loader: Allow ELF loader to auto-detect the ELF arch, (continued)
- [Qemu-devel] [PATCH v9 2/8] loader: Use the specified MemoryRegion, Alistair Francis, 2016/07/13
- [Qemu-devel] [PATCH v9 3/8] loader: Allow a custom AddressSpace when loading ROMs, Alistair Francis, 2016/07/13
- [Qemu-devel] [PATCH v9 4/8] loader: Add AddressSpace loading support to ELFs, Alistair Francis, 2016/07/13
- [Qemu-devel] [PATCH v9 5/8] loader: Add AddressSpace loading support to uImages, Alistair Francis, 2016/07/13
- [Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support to targphys, Alistair Francis, 2016/07/13
- Re: [Qemu-devel] [PATCH v9 6/8] loader: Add AddressSpace loading support to targphys,
Peter Maydell <=
- [Qemu-devel] [PATCH v9 7/8] generic-loader: Add a generic loader, Alistair Francis, 2016/07/13
- [Qemu-devel] [PATCH v9 8/8] docs: Add a generic loader explanation document, Alistair Francis, 2016/07/13