mirror of
https://github.com/yuzu-emu/unicorn
synced 2024-11-25 04:49:21 +00:00
qemu_ram_foreach_block: pass up error value, and down the ramblock name
check the return value of the function it calls and error if it's non-0 Fixup qemu_rdma_init_one_block that is the only current caller, and rdma_add_block the only function it calls using it. Pass the name of the ramblock to the function; helps in debugging. Backports commit e3807054e20fb3b94d18cb751c437ee2f43b6fac from qemu
This commit is contained in:
parent
71beea204c
commit
75701d03ee
2 changed files with 14 additions and 4 deletions
14
qemu/exec.c
14
qemu/exec.c
|
@ -2861,12 +2861,22 @@ bool cpu_physical_memory_is_io(AddressSpace *as, hwaddr phys_addr)
|
|||
memory_region_is_romd(mr));
|
||||
}
|
||||
|
||||
void qemu_ram_foreach_block(struct uc_struct *uc, RAMBlockIterFunc func, void *opaque)
|
||||
int qemu_ram_foreach_block(struct uc_struct *uc, RAMBlockIterFunc func, void *opaque)
|
||||
{
|
||||
RAMBlock *block;
|
||||
int ret = 0;
|
||||
|
||||
// Unicorn: commented out
|
||||
//rcu_read_lock();
|
||||
QLIST_FOREACH(block, &uc->ram_list.blocks, next) {
|
||||
func(block->host, block->offset, block->used_length, opaque);
|
||||
ret = func(block->idstr, block->host, block->offset,
|
||||
block->used_length, opaque);
|
||||
if (ret) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Unicorn: commented out
|
||||
//rcu_read_unlock();
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -116,10 +116,10 @@ void cpu_flush_icache_range(AddressSpace *as, hwaddr start, int len);
|
|||
extern struct MemoryRegion io_mem_rom;
|
||||
extern struct MemoryRegion io_mem_notdirty;
|
||||
|
||||
typedef void (RAMBlockIterFunc)(void *host_addr,
|
||||
typedef int (RAMBlockIterFunc)(const char *block_name, void *host_addr,
|
||||
ram_addr_t offset, ram_addr_t length, void *opaque);
|
||||
|
||||
void qemu_ram_foreach_block(struct uc_struct *uc, RAMBlockIterFunc func, void *opaque);
|
||||
int qemu_ram_foreach_block(struct uc_struct *uc, RAMBlockIterFunc func, void *opaque);
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue