From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:49975) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QivSq-0003jr-Ed for qemu-devel@nongnu.org; Mon, 18 Jul 2011 17:35:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QivSl-0002Yl-OH for qemu-devel@nongnu.org; Mon, 18 Jul 2011 17:34:56 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:45879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QivSl-0002Xh-45 for qemu-devel@nongnu.org; Mon, 18 Jul 2011 17:34:51 -0400 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Mon, 18 Jul 2011 23:34:20 +0200 Message-Id: <1311024862-7928-2-git-send-email-hpoussin@reactos.org> In-Reply-To: <1311024862-7928-1-git-send-email-hpoussin@reactos.org> References: <1311024862-7928-1-git-send-email-hpoussin@reactos.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCHv3 1/3] ds1225y: Remove protection stuff, which doesn't belong to this device List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Signed-off-by: Herv=C3=A9 Poussineau --- hw/ds1225y.c | 42 +----------------------------------------- hw/mips.h | 1 - 2 files changed, 1 insertions(+), 42 deletions(-) diff --git a/hw/ds1225y.c b/hw/ds1225y.c index b1c5232..1fd7010 100644 --- a/hw/ds1225y.c +++ b/hw/ds1225y.c @@ -33,7 +33,6 @@ typedef struct ds1225y_t uint32_t chip_size; QEMUFile *file; uint8_t *contents; - uint8_t protection; } ds1225y_t; =20 =20 @@ -98,34 +97,6 @@ static void nvram_writel (void *opaque, target_phys_ad= dr_t addr, uint32_t val) nvram_writeb(opaque, addr + 3, (val >> 24) & 0xff); } =20 -static void nvram_writeb_protected (void *opaque, target_phys_addr_t add= r, uint32_t val) -{ - ds1225y_t *s =3D opaque; - - if (s->protection !=3D 7) { -#ifdef DEBUG_NVRAM - printf("nvram: prevent write of 0x%x at " TARGET_FMT_lx "\n", val, a= ddr); -#endif - return; - } - - nvram_writeb(opaque, addr, val); -} - -static void nvram_writew_protected (void *opaque, target_phys_addr_t add= r, uint32_t val) -{ - nvram_writeb_protected(opaque, addr, val & 0xff); - nvram_writeb_protected(opaque, addr + 1, (val >> 8) & 0xff); -} - -static void nvram_writel_protected (void *opaque, target_phys_addr_t add= r, uint32_t val) -{ - nvram_writeb_protected(opaque, addr, val & 0xff); - nvram_writeb_protected(opaque, addr + 1, (val >> 8) & 0xff); - nvram_writeb_protected(opaque, addr + 2, (val >> 16) & 0xff); - nvram_writeb_protected(opaque, addr + 3, (val >> 24) & 0xff); -} - static CPUReadMemoryFunc * const nvram_read[] =3D { &nvram_readb, &nvram_readw, @@ -138,23 +109,16 @@ static CPUWriteMemoryFunc * const nvram_write[] =3D= { &nvram_writel, }; =20 -static CPUWriteMemoryFunc * const nvram_write_protected[] =3D { - &nvram_writeb_protected, - &nvram_writew_protected, - &nvram_writel_protected, -}; - /* Initialisation routine */ void *ds1225y_init(target_phys_addr_t mem_base, const char *filename) { ds1225y_t *s; - int mem_indexRW, mem_indexRP; + int mem_indexRW; QEMUFile *file; =20 s =3D qemu_mallocz(sizeof(ds1225y_t)); s->chip_size =3D 0x2000; /* Fixed for ds1225y chip: 8 KiB */ s->contents =3D qemu_mallocz(s->chip_size); - s->protection =3D 7; =20 /* Read current file */ file =3D qemu_fopen(filename, "rb"); @@ -174,9 +138,5 @@ void *ds1225y_init(target_phys_addr_t mem_base, const= char *filename) mem_indexRW =3D cpu_register_io_memory(nvram_read, nvram_write, s, DEVICE_NATIVE_ENDIAN); cpu_register_physical_memory(mem_base, s->chip_size, mem_indexRW); - /* Read/write protected memory */ - mem_indexRP =3D cpu_register_io_memory(nvram_read, nvram_write_prote= cted, s, - DEVICE_NATIVE_ENDIAN); - cpu_register_physical_memory(mem_base + s->chip_size, s->chip_size, = mem_indexRP); return s; } diff --git a/hw/mips.h b/hw/mips.h index 73aa8f8..93c8831 100644 --- a/hw/mips.h +++ b/hw/mips.h @@ -10,7 +10,6 @@ PCIBus *bonito_init(qemu_irq *pic); =20 /* ds1225y.c */ void *ds1225y_init(target_phys_addr_t mem_base, const char *filename); -void ds1225y_set_protection(void *opaque, int protection); =20 /* g364fb.c */ int g364fb_mm_init(target_phys_addr_t vram_base, --=20 1.7.5.4