mirror of https://github.com/xemu-project/xemu.git
exec: introduce qemu_ram_unset_idstr() to unset RAMBlock idstr
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
01a9c03c39
commit
20cfe8810d
26
exec.c
26
exec.c
|
@ -1201,17 +1201,24 @@ static void qemu_ram_setup_dump(void *addr, ram_addr_t size)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev)
|
static RAMBlock *find_ram_block(ram_addr_t addr)
|
||||||
{
|
{
|
||||||
RAMBlock *new_block, *block;
|
RAMBlock *block;
|
||||||
|
|
||||||
new_block = NULL;
|
|
||||||
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
|
QTAILQ_FOREACH(block, &ram_list.blocks, next) {
|
||||||
if (block->offset == addr) {
|
if (block->offset == addr) {
|
||||||
new_block = block;
|
return block;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev)
|
||||||
|
{
|
||||||
|
RAMBlock *new_block = find_ram_block(addr);
|
||||||
|
RAMBlock *block;
|
||||||
|
|
||||||
assert(new_block);
|
assert(new_block);
|
||||||
assert(!new_block->idstr[0]);
|
assert(!new_block->idstr[0]);
|
||||||
|
|
||||||
|
@ -1236,6 +1243,15 @@ void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev)
|
||||||
qemu_mutex_unlock_ramlist();
|
qemu_mutex_unlock_ramlist();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void qemu_ram_unset_idstr(ram_addr_t addr)
|
||||||
|
{
|
||||||
|
RAMBlock *block = find_ram_block(addr);
|
||||||
|
|
||||||
|
if (block) {
|
||||||
|
memset(block->idstr, 0, sizeof(block->idstr));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int memory_try_enable_merging(void *addr, size_t len)
|
static int memory_try_enable_merging(void *addr, size_t len)
|
||||||
{
|
{
|
||||||
if (!qemu_opt_get_bool(qemu_get_machine_opts(), "mem-merge", true)) {
|
if (!qemu_opt_get_bool(qemu_get_machine_opts(), "mem-merge", true)) {
|
||||||
|
|
|
@ -54,6 +54,7 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length);
|
||||||
/* This should not be used by devices. */
|
/* This should not be used by devices. */
|
||||||
MemoryRegion *qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr);
|
MemoryRegion *qemu_ram_addr_from_host(void *ptr, ram_addr_t *ram_addr);
|
||||||
void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev);
|
void qemu_ram_set_idstr(ram_addr_t addr, const char *name, DeviceState *dev);
|
||||||
|
void qemu_ram_unset_idstr(ram_addr_t addr);
|
||||||
|
|
||||||
void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
|
void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
|
||||||
int len, int is_write);
|
int len, int is_write);
|
||||||
|
|
Loading…
Reference in New Issue