From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:52234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBl7R-00043G-To for qemu-devel@nongnu.org; Thu, 06 Oct 2011 06:24:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RBl7J-0002Ou-H0 for qemu-devel@nongnu.org; Thu, 06 Oct 2011 06:24:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RBl7J-0002O9-8b for qemu-devel@nongnu.org; Thu, 06 Oct 2011 06:23:53 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p96ANqEh011707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 6 Oct 2011 06:23:52 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p96ANnvm018713 for ; Thu, 6 Oct 2011 06:23:52 -0400 From: Avi Kivity Date: Thu, 6 Oct 2011 12:23:22 +0200 Message-Id: <1317896615-25202-13-git-send-email-avi@redhat.com> In-Reply-To: <1317896615-25202-1-git-send-email-avi@redhat.com> References: <1317896615-25202-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 12/25] memory: Fix old portio word accesses List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Jan Kiszka As we register old portio regions via ioport_register, we are also responsible for providing the word access wrapper. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- memory.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/memory.c b/memory.c index 528e5fb..a8359b1 100644 --- a/memory.c +++ b/memory.c @@ -404,6 +404,11 @@ static void memory_region_iorange_read(IORange *iorange, *data = ((uint64_t)1 << (width * 8)) - 1; if (mrp) { *data = mrp->read(mr->opaque, offset + mr->offset); + } else if (width == 2) { + mrp = find_portio(mr, offset, 1, false); + assert(mrp); + *data = mrp->read(mr->opaque, offset + mr->offset) | + (mrp->read(mr->opaque, offset + mr->offset + 1) << 8); } return; } @@ -426,6 +431,11 @@ static void memory_region_iorange_write(IORange *iorange, if (mrp) { mrp->write(mr->opaque, offset + mr->offset, data); + } else if (width == 2) { + mrp = find_portio(mr, offset, 1, false); + assert(mrp); + mrp->write(mr->opaque, offset + mr->offset, data & 0xff); + mrp->write(mr->opaque, offset + mr->offset + 1, data >> 8); } return; } -- 1.7.6.3