From patchwork Wed Aug 10 22:28:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 109471 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 1C2DDB6F76 for ; Thu, 11 Aug 2011 09:12:30 +1000 (EST) Received: from localhost ([::1]:51979 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrHI4-0006PA-MM for incoming@patchwork.ozlabs.org; Wed, 10 Aug 2011 18:30:20 -0400 Received: from eggs.gnu.org ([140.186.70.92]:49824) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrHHO-0004kX-PB for qemu-devel@nongnu.org; Wed, 10 Aug 2011 18:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QrHHN-0006QK-R0 for qemu-devel@nongnu.org; Wed, 10 Aug 2011 18:29:38 -0400 Received: from mail-ww0-f53.google.com ([74.125.82.53]:54887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QrHHN-0006La-Mj for qemu-devel@nongnu.org; Wed, 10 Aug 2011 18:29:37 -0400 Received: by mail-ww0-f53.google.com with SMTP id 25so1339901wwf.10 for ; Wed, 10 Aug 2011 15:29:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=sz3nIW0n0bDltR52Ai/8XHrA3SCUjRqcr0xjZFgbBNA=; b=Lt63eMbiiyB/12lB8Tv/4T+kzP/gDj+nytj/q7fI6DjWZ2SbmFu6CviWPeAO8RZmvP VxIb1jSjNTACoEJeBEVgOXbJCQ5mfuFEuNy2DfmcIfTNZY/CQQRQDjae6/4gEEPTxiCw 0ZC9SyupbcLHJm3Ekmla/IHSZZ78kXmHfTKfE= Received: by 10.216.169.211 with SMTP id n61mr1086176wel.83.1313015377381; Wed, 10 Aug 2011 15:29:37 -0700 (PDT) Received: from localhost.localdomain (c-71-227-161-214.hsd1.wa.comcast.net [71.227.161.214]) by mx.google.com with ESMTPS id m38sm880619weq.21.2011.08.10.15.29.35 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 10 Aug 2011 15:29:36 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 10 Aug 2011 15:28:19 -0700 Message-Id: <1313015300-23920-11-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.6 In-Reply-To: <1313015300-23920-1-git-send-email-rth@twiddle.net> References: <1313015300-23920-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.53 Cc: avi@redhat.com Subject: [Qemu-devel] [PATCH 10/11] memory: Fix old_portio vs non-zero offset. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org The legacy functions that we're wrapping expect that offset to be included in the register. Indeed, they generally expect the absolute address and then mask off the "high" bits. The FDC is the first converted device with a non-zero offset. Signed-off-by: Richard Henderson --- memory.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/memory.c b/memory.c index a1f118b..2c82cd3 100644 --- a/memory.c +++ b/memory.c @@ -367,7 +367,7 @@ static void memory_region_iorange_read(IORange *iorange, *data = ((uint64_t)1 << (width * 8)) - 1; if (mrp) { - *data = mrp->read(mr->opaque, offset - mrp->offset); + *data = mrp->read(mr->opaque, offset); } return; } @@ -391,7 +391,7 @@ static void memory_region_iorange_write(IORange *iorange, const MemoryRegionPortio *mrp = find_portio(mr, offset, width, true); if (mrp) { - mrp->write(mr->opaque, offset - mrp->offset, data); + mrp->write(mr->opaque, offset, data); } return; }