提交 ed315040 编写于 作者: P Peter Maydell

elf_ops.h: Use address_space_write() to write memory

Currently the load_elf function in elf_ops.h uses
cpu_physical_memory_write() to write the ELF file to
memory if it is not handling it as a ROM blob. This
means we ignore the AddressSpace that the function
is passed to define where it should be loaded.
Use address_space_write() instead.
Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
Reviewed-by: NPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20181122172653.3413-4-peter.maydell@linaro.org
上级 6f89ae58
......@@ -482,7 +482,9 @@ static int glue(load_elf, SZ)(const char *name, int fd,
rom_add_elf_program(label, data, file_size, mem_size,
addr, as);
} else {
cpu_physical_memory_write(addr, data, file_size);
address_space_write(as ? as : &address_space_memory,
addr, MEMTXATTRS_UNSPECIFIED,
data, file_size);
g_free(data);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册