exec: remove ram_addr argument from qemu_ram_block_from_host

Of the two callers, one does not use it, and the other can compute
it itself based on the other output argument (offset) and the RAMBlock.

Backports commit f615f39616c4fd1a3a3b078af8d75bb4be6390de from qemu
This commit is contained in:
Paolo Bonzini 2018-02-24 03:37:37 -05:00 committed by Lioncash
parent f26f1f123c
commit 918c626847
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 4 additions and 6 deletions

View file

@ -1433,7 +1433,6 @@ static void *qemu_ram_ptr_length(struct uc_struct *uc, RAMBlock *ram_block,
* ram_addr_t.
*/
RAMBlock *qemu_ram_block_from_host(struct uc_struct* uc, void *ptr, bool round_offset,
ram_addr_t *ram_addr,
ram_addr_t *offset)
{
RAMBlock *block;
@ -1461,7 +1460,6 @@ found:
if (round_offset) {
*offset &= TARGET_PAGE_MASK;
}
*ram_addr = block->offset + *offset;
return block;
}
@ -1491,10 +1489,10 @@ RAMBlock *qemu_ram_block_by_name(struct uc_struct* uc, const char *name)
MemoryRegion *qemu_ram_addr_from_host(struct uc_struct* uc, void *ptr, ram_addr_t *ram_addr)
{
RAMBlock *block;
ram_addr_t offset; /* Not used */
block = qemu_ram_block_from_host(uc, ptr, false, ram_addr, &offset);
ram_addr_t offset;
block = qemu_ram_block_from_host(uc, ptr, false, &offset);
*ram_addr = block->offset + offset;
if (!block) {
return NULL;
}

View file

@ -51,7 +51,7 @@ void qemu_ram_remap(struct uc_struct *uc, ram_addr_t addr, ram_addr_t length);
MemoryRegion *qemu_ram_addr_from_host(struct uc_struct* uc, void *ptr, ram_addr_t *ram_addr);
RAMBlock *qemu_ram_block_by_name(struct uc_struct* uc, const char *name);
RAMBlock *qemu_ram_block_from_host(struct uc_struct* uc, void *ptr, bool round_offset,
ram_addr_t *ram_addr, ram_addr_t *offset);
ram_addr_t *offset);
void qemu_ram_set_idstr(struct uc_struct *uc, RAMBlock *block, const char *name, DeviceState *dev);
void qemu_ram_unset_idstr(struct uc_struct *uc, RAMBlock *block);
const char *qemu_ram_get_idstr(RAMBlock *rb);