aboutsummaryrefslogtreecommitdiff
path: root/hw/leon3.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/leon3.c')
-rw-r--r--hw/leon3.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/hw/leon3.c b/hw/leon3.c
index 607ec852fe..a62a9419f3 100644
--- a/hw/leon3.c
+++ b/hw/leon3.c
@@ -29,7 +29,6 @@
#include "loader.h"
#include "elf.h"
#include "trace.h"
-#include "exec-memory.h"
#include "grlib.h"
@@ -101,9 +100,7 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,
const char *cpu_model)
{
CPUState *env;
- MemoryRegion *address_space_mem = get_system_memory();
- MemoryRegion *ram = g_new(MemoryRegion, 1);
- MemoryRegion *prom = g_new(MemoryRegion, 1);
+ ram_addr_t ram_offset, prom_offset;
int ret;
char *filename;
qemu_irq *cpu_irqs = NULL;
@@ -142,14 +139,14 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,
exit(1);
}
- memory_region_init_ram(ram, NULL, "leon3.ram", ram_size);
- memory_region_add_subregion(address_space_mem, 0x40000000, ram);
+ ram_offset = qemu_ram_alloc(NULL, "leon3.ram", ram_size);
+ cpu_register_physical_memory(0x40000000, ram_size, ram_offset | IO_MEM_RAM);
/* Allocate BIOS */
prom_size = 8 * 1024 * 1024; /* 8Mb */
- memory_region_init_ram(prom, NULL, "Leon3.bios", prom_size);
- memory_region_set_readonly(prom, true);
- memory_region_add_subregion(address_space_mem, 0x00000000, prom);
+ prom_offset = qemu_ram_alloc(NULL, "Leon3.bios", prom_size);
+ cpu_register_physical_memory(0x00000000, prom_size,
+ prom_offset | IO_MEM_ROM);
/* Load boot prom */
if (bios_name == NULL) {