From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7Ncg-0005vW-M2 for qemu-devel@nongnu.org; Sat, 24 Sep 2011 04:30:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R7Ncf-0006kC-IA for qemu-devel@nongnu.org; Sat, 24 Sep 2011 04:30:10 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:46460) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R7Nce-0006eY-Qu for qemu-devel@nongnu.org; Sat, 24 Sep 2011 04:30:09 -0400 Message-ID: <4E7D9505.6000605@reactos.org> Date: Sat, 24 Sep 2011 10:29:57 +0200 From: =?ISO-8859-1?Q?Herv=E9_Poussineau?= MIME-Version: 1.0 References: 1316593164-25199-2-git-send-email-avi@redhat.com Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 01/13] mips_jazz: convert to memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: avi@redhat.com Cc: QEMU Developers Avi Kivity wrote: > Signed-off-by: Avi Kivity > --- > > hw/mips_jazz.c | 90=20 ++++++++++++++++++++++++++++---------------------------- > 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 =3D qemu_ram_alloc(NULL, "g364fb.ro= m", > 0x80000); > - uint8_t *rom =3D qemu_get_ram_ptr(rom_offset); > - cpu_register_physical_memory(0x60000000, 0x80000, > - rom_offset | IO_MEM_ROM); > + MemoryRegion *rom_mr =3D g_new(MemoryRegion, 1); > + memory_region_init_ram(rom_mr, NULL, "g364fb.rom", 0x8000= 0); > + memory_region_set_readonly(rom_mr, true); > + uint8_t *rom =3D memory_region_get_ram_ptr(rom_mr); > + memory_region_add_subregion(address_space, 0x60000000,=20 rom_mr); > rom[0] =3D 0x10; /* Mips G364 */ > } > break; This part breaks Magnum emulation, where firmware writes to 0x60000000,=20 and then checks if value has been modified. This is not working as expected (value is modified) because=20 memory_region_set_readonly() is unimplemented... Herv=E9