mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
acpi-build: remove dependency from ram_addr.h
ram_addr_t is an internal interface, everyone should go through MemoryRegion. Clean it up by making rom_add_blob return a MemoryRegion* and using the new qemu_ram_resize infrastructure. Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
37d7c08413
commit
339240b5cd
3 changed files with 27 additions and 25 deletions
|
@ -835,12 +835,12 @@ err:
|
|||
return -1;
|
||||
}
|
||||
|
||||
ram_addr_t rom_add_blob(const char *name, const void *blob, size_t len,
|
||||
MemoryRegion *rom_add_blob(const char *name, const void *blob, size_t len,
|
||||
size_t max_len, hwaddr addr, const char *fw_file_name,
|
||||
FWCfgReadCallback fw_callback, void *callback_opaque)
|
||||
{
|
||||
Rom *rom;
|
||||
ram_addr_t ret = RAM_ADDR_MAX;
|
||||
MemoryRegion *mr = NULL;
|
||||
|
||||
rom = g_malloc0(sizeof(*rom));
|
||||
rom->name = g_strdup(name);
|
||||
|
@ -858,7 +858,7 @@ ram_addr_t rom_add_blob(const char *name, const void *blob, size_t len,
|
|||
|
||||
if (rom_file_has_mr) {
|
||||
data = rom_set_mr(rom, OBJECT(fw_cfg), devpath);
|
||||
ret = memory_region_get_ram_addr(rom->mr);
|
||||
mr = rom->mr;
|
||||
} else {
|
||||
data = rom->data;
|
||||
}
|
||||
|
@ -867,7 +867,7 @@ ram_addr_t rom_add_blob(const char *name, const void *blob, size_t len,
|
|||
fw_callback, callback_opaque,
|
||||
data, rom->datasize);
|
||||
}
|
||||
return ret;
|
||||
return mr;
|
||||
}
|
||||
|
||||
/* This function is specific for elf program because we don't need to allocate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue