aboutsummaryrefslogtreecommitdiff
path: root/exec.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2011-12-18 15:48:55 +0200
committerAvi Kivity <avi@redhat.com>2011-12-19 17:23:24 +0200
commitfce537d4a741521ac182d54465c568b101b9a71e (patch)
tree5eaa74102ac97de28b109d285c5eef65726d8eb5 /exec.c
parent5ab97b7f81dccccee03a3f1d03a4d09a27f0eeff (diff)
memory, xen: pass MemoryRegion to xen_ram_alloc()
Currently xen_ram_alloc() relies on ram_addr, which is going away. Give it something else to use as a cookie. Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'exec.c')
-rw-r--r--exec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/exec.c b/exec.c
index 06889bdf18..fbcb1bf028 100644
--- a/exec.c
+++ b/exec.c
@@ -2916,7 +2916,8 @@ static ram_addr_t last_ram_offset(void)
}
ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name,
- ram_addr_t size, void *host)
+ ram_addr_t size, void *host,
+ MemoryRegion *mr)
{
RAMBlock *new_block, *block;
@@ -2972,7 +2973,7 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name,
}
#else
if (xen_enabled()) {
- xen_ram_alloc(new_block->offset, size);
+ xen_ram_alloc(new_block->offset, size, mr);
} else {
new_block->host = qemu_vmalloc(size);
}
@@ -2995,9 +2996,10 @@ ram_addr_t qemu_ram_alloc_from_ptr(DeviceState *dev, const char *name,
return new_block->offset;
}
-ram_addr_t qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size)
+ram_addr_t qemu_ram_alloc(DeviceState *dev, const char *name, ram_addr_t size,
+ MemoryRegion *mr)
{
- return qemu_ram_alloc_from_ptr(dev, name, size, NULL);
+ return qemu_ram_alloc_from_ptr(dev, name, size, NULL, mr);
}
void qemu_ram_free_from_ptr(ram_addr_t addr)