diff options
author | Alistair Francis <alistair.francis@xilinx.com> | 2016-09-22 18:13:08 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2016-09-22 18:13:08 +0100 |
commit | 93ffc7c766429350d788ae0a978ea54171d652bd (patch) | |
tree | 6a54d635d3970dd166c2970be66711ef7b7f6994 /hw/core/loader.c | |
parent | 5e774eb3bd264c76484906f4bd0fb38e00b8090e (diff) | |
download | qemu-93ffc7c766429350d788ae0a978ea54171d652bd.zip qemu-93ffc7c766429350d788ae0a978ea54171d652bd.tar.gz qemu-93ffc7c766429350d788ae0a978ea54171d652bd.tar.bz2 |
loader: Add AddressSpace loading support to targphys
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>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 87de45de7acf02cbe6bae9d6c4d6fb8f3aba4f61.1474331683.git.alistair.francis@xilinx.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/core/loader.c')
-rw-r--r-- | hw/core/loader.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c index 86ed784..6e022b5 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; } |