[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 01/13] mips_jazz: convert to memory API
From: |
Hervé Poussineau |
Subject: |
Re: [Qemu-devel] [PATCH 01/13] mips_jazz: convert to memory API |
Date: |
Sat, 24 Sep 2011 10:29:57 +0200 |
User-agent: |
Thunderbird 2.0.0.23 (Windows/20090812) |
Avi Kivity wrote:
> Signed-off-by: Avi Kivity <address@hidden>
> ---
>
> hw/mips_jazz.c | 90
++++++++++++++++++++++++++++----------------------------
> 1 files changed, 45 insertions(+), 45 deletions(-)
>
> diff --git a/hw/mips_jazz.c b/hw/mips_jazz.c
> index f3c9f93..7cac5da 100644
> --- a/hw/mips_jazz.c
> +++ b/hw/mips_jazz.c
>@@ -203,10 +203,11 @@ void mips_jazz_init (ram_addr_t ram_size,
> sysbus_connect_irq(sysbus, 0, rc4030[3]);
> {
> /* Simple ROM, so user doesn't have to provide one */
> - ram_addr_t rom_offset = qemu_ram_alloc(NULL, "g364fb.rom",
> 0x80000);
> - uint8_t *rom = qemu_get_ram_ptr(rom_offset);
> - cpu_register_physical_memory(0x60000000, 0x80000,
> - rom_offset | IO_MEM_ROM);
> + MemoryRegion *rom_mr = g_new(MemoryRegion, 1);
> + memory_region_init_ram(rom_mr, NULL, "g364fb.rom", 0x80000);
> + memory_region_set_readonly(rom_mr, true);
> + uint8_t *rom = memory_region_get_ram_ptr(rom_mr);
> + memory_region_add_subregion(address_space, 0x60000000,
rom_mr);
> rom[0] = 0x10; /* Mips G364 */
> }
> break;
This part breaks Magnum emulation, where firmware writes to 0x60000000,
and then checks if value has been modified.
This is not working as expected (value is modified) because
memory_region_set_readonly() is unimplemented...
Hervé
- Re: [Qemu-devel] [PATCH 01/13] mips_jazz: convert to memory API,
Hervé Poussineau <=