Received: from [140.186.70.92] (port=38790 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PdPEp-00035O-L0 for qemu-devel@nongnu.org; Thu, 13 Jan 2011 10:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PdPEn-0001o5-A8 for qemu-devel@nongnu.org; Thu, 13 Jan 2011 10:37:23 -0500 Received: from mail-fx0-f45.google.com ([209.85.161.45]:57193) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PdPEn-0001ns-5a for qemu-devel@nongnu.org; Thu, 13 Jan 2011 10:37:21 -0500 Received: by fxm12 with SMTP id 12so1835603fxm.4 for ; Thu, 13 Jan 2011 07:37:20 -0800 (PST) From: Dmitry Eremin-Solenikov Date: Thu, 13 Jan 2011 18:37:11 +0300 Message-Id: <1294933032-12757-2-git-send-email-dbaryshkov@gmail.com> In-Reply-To: <1294933032-12757-1-git-send-email-dbaryshkov@gmail.com> References: <1294933032-12757-1-git-send-email-dbaryshkov@gmail.com> Subject: [Qemu-devel] [PATCH 2/3] Scoop: fix access to registers from second instance List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Second instance of scoop contains registers shifted to 0x40 from the start of the page. Instead of messing with register mapping, just limit register address to 0x00..0x3f. Signed-off-by: Dmitry Eremin-Solenikov --- hw/zaurus.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/zaurus.c b/hw/zaurus.c index 54ec3f0..36be94a 100644 --- a/hw/zaurus.c +++ b/hw/zaurus.c @@ -70,7 +70,7 @@ static uint32_t scoop_readb(void *opaque, target_phys_addr_t addr) { ScoopInfo *s = (ScoopInfo *) opaque; - switch (addr) { + switch (addr & 0x3f) { case SCOOP_MCR: return s->mcr; case SCOOP_CDR: @@ -104,7 +104,7 @@ static void scoop_writeb(void *opaque, target_phys_addr_t addr, uint32_t value) ScoopInfo *s = (ScoopInfo *) opaque; value &= 0xffff; - switch (addr) { + switch (addr & 0x3f) { case SCOOP_MCR: s->mcr = value; break; -- 1.7.2.3