mirror of https://github.com/xemu-project/xemu.git
exec: Propagate cpu_memory_rw_debug() error
Do not ignore the MemTxResult error type returned by the address_space_rw() API. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
38df19fad7
commit
ddfc8b96ee
12
exec.c
12
exec.c
|
@ -3771,6 +3771,7 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
int asidx;
|
int asidx;
|
||||||
MemTxAttrs attrs;
|
MemTxAttrs attrs;
|
||||||
|
MemTxResult res;
|
||||||
|
|
||||||
page = addr & TARGET_PAGE_MASK;
|
page = addr & TARGET_PAGE_MASK;
|
||||||
phys_addr = cpu_get_phys_page_attrs_debug(cpu, page, &attrs);
|
phys_addr = cpu_get_phys_page_attrs_debug(cpu, page, &attrs);
|
||||||
|
@ -3783,11 +3784,14 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
||||||
l = len;
|
l = len;
|
||||||
phys_addr += (addr & ~TARGET_PAGE_MASK);
|
phys_addr += (addr & ~TARGET_PAGE_MASK);
|
||||||
if (is_write) {
|
if (is_write) {
|
||||||
address_space_write_rom(cpu->cpu_ases[asidx].as, phys_addr,
|
res = address_space_write_rom(cpu->cpu_ases[asidx].as, phys_addr,
|
||||||
attrs, buf, l);
|
attrs, buf, l);
|
||||||
} else {
|
} else {
|
||||||
address_space_read(cpu->cpu_ases[asidx].as, phys_addr, attrs, buf,
|
res = address_space_read(cpu->cpu_ases[asidx].as, phys_addr,
|
||||||
l);
|
attrs, buf, l);
|
||||||
|
}
|
||||||
|
if (res != MEMTX_OK) {
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
len -= l;
|
len -= l;
|
||||||
buf += l;
|
buf += l;
|
||||||
|
|
|
@ -413,6 +413,7 @@ void dump_exec_info(void);
|
||||||
void dump_opcount_info(void);
|
void dump_opcount_info(void);
|
||||||
#endif /* !CONFIG_USER_ONLY */
|
#endif /* !CONFIG_USER_ONLY */
|
||||||
|
|
||||||
|
/* Returns: 0 on success, -1 on error */
|
||||||
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
||||||
void *ptr, target_ulong len, bool is_write);
|
void *ptr, target_ulong len, bool is_write);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue