diff options
author | Avi Kivity <avi@redhat.com> | 2011-10-03 12:56:38 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-10-17 15:59:18 +0200 |
commit | 890c2b772da673785351cad38797b12dcd08d5fa (patch) | |
tree | e93c66a37ec78451ead25b5207426d66126bbb37 /hw | |
parent | 25793bfafafbd124cd1ceae8de3e3bfd30b7f2d9 (diff) |
spapr: convert to memory API
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/spapr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/spapr.c b/hw/spapr.c index b1189755d3..63e5d336ea 100644 --- a/hw/spapr.c +++ b/hw/spapr.c @@ -41,6 +41,8 @@ #include "kvm.h" #include "kvm_ppc.h" +#include "exec-memory.h" + #include <libfdt.h> #define KERNEL_LOAD_ADDR 0x00000000 @@ -324,7 +326,8 @@ static void ppc_spapr_init(ram_addr_t ram_size, { CPUState *env; int i; - ram_addr_t ram_offset; + MemoryRegion *sysmem = get_system_memory(); + MemoryRegion *ram = g_new(MemoryRegion, 1); uint32_t initrd_base; long kernel_size, initrd_size, fw_size; long pteg_shift = 17; @@ -361,8 +364,8 @@ static void ppc_spapr_init(ram_addr_t ram_size, /* allocate RAM */ spapr->ram_limit = ram_size; - ram_offset = qemu_ram_alloc(NULL, "ppc_spapr.ram", spapr->ram_limit); - cpu_register_physical_memory(0, ram_size, ram_offset); + memory_region_init_ram(ram, NULL, "ppc_spapr.ram", spapr->ram_limit); + memory_region_add_subregion(sysmem, 0, ram); /* allocate hash page table. For now we always make this 16mb, * later we should probably make it scale to the size of guest |