From patchwork Thu Apr 22 21:54:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Igor V. Kovalenko" X-Patchwork-Id: 50762 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 442EBB7BEE for ; Fri, 23 Apr 2010 08:00:01 +1000 (EST) Received: from localhost ([127.0.0.1]:48935 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O54RC-0005N1-IM for incoming@patchwork.ozlabs.org; Thu, 22 Apr 2010 17:59:58 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O54MJ-0003oI-UA for qemu-devel@nongnu.org; Thu, 22 Apr 2010 17:54:55 -0400 Received: from [140.186.70.92] (port=35937 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O54MI-0003n3-Gf for qemu-devel@nongnu.org; Thu, 22 Apr 2010 17:54:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O54MG-0004jO-Uy for qemu-devel@nongnu.org; Thu, 22 Apr 2010 17:54:54 -0400 Received: from mail-bw0-f215.google.com ([209.85.218.215]:58917) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O54MG-0004he-P8 for qemu-devel@nongnu.org; Thu, 22 Apr 2010 17:54:52 -0400 Received: by mail-bw0-f215.google.com with SMTP id 7so9038609bwz.16 for ; Thu, 22 Apr 2010 14:54:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:subject:to:from:date :message-id:in-reply-to:references:user-agent:mime-version :content-type:content-transfer-encoding; bh=7Im0yvy2GtP1lXkkjAVKJlspw0rtuvnbnbHZZ42arhQ=; b=TotEHp2/DwtiB0WyGf05KOaYT67J9Hw81w3KFh96rcowPC6/dbFu8eexagXx9nUUh7 wSnD3CKYsP8VNfsVAfcxvU3TEmZDxGdqAlCeNXwNogCszvpurUYirluxWg5g6/LTTfih U/8RFgWNAYwj6G/KtaZnCsguL4yHmhMZmZ9zw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:to:from:date:message-id:in-reply-to:references:user-agent :mime-version:content-type:content-transfer-encoding; b=Tnpu8gbWjPexWuNI8vLhiIOFnNH0uzGQQ1hWJ4wOYZLSckh4yYq/snHfKJibD/hzlw 8eHJLMPir/uaUdQjsTos7OVNw5czFSCRSfnbmKK5ZFV0O+WE4kAo1vN7feXdftR5Bat0 zmENz7ee3+T1XpzljCxGpG2/f9otll+HsH084= Received: by 10.103.48.12 with SMTP id a12mr2615921muk.14.1271973292020; Thu, 22 Apr 2010 14:54:52 -0700 (PDT) Received: from skyserv ([87.255.14.75]) by mx.google.com with ESMTPS id j10sm1770688muh.28.2010.04.22.14.54.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 22 Apr 2010 14:54:51 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=[192.168.1.2]) by skyserv with esmtp (Exim 4.71) (envelope-from ) id 1O54ME-00053t-Kj for qemu-devel@nongnu.org; Fri, 23 Apr 2010 01:54:50 +0400 To: qemu-devel@nongnu.org From: "Igor V. Kovalenko" Date: Fri, 23 Apr 2010 01:54:50 +0400 Message-ID: <20100422215450.19357.16022.stgit@skyserv> In-Reply-To: <20100422215238.19357.13159.stgit@skyserv> References: <20100422215238.19357.13159.stgit@skyserv> User-Agent: StGit/0.15 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 2/2] cmd646: fix abort due to changed opaque pointer for ioport read X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Igor V. Kovalenko We cannot install different opaque pointer for read and write of the same i/o address. - handle zero address in bmdma_writeb_common and install the same opaque pointer for both read and write access. Signed-off-by: Igor V. Kovalenko --- hw/ide/cmd646.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/hw/ide/cmd646.c b/hw/ide/cmd646.c index c6ed0b7..cdcc9bf 100644 --- a/hw/ide/cmd646.c +++ b/hw/ide/cmd646.c @@ -123,6 +123,9 @@ static void bmdma_writeb_common(PCIIDEState *pci_dev, BMDMAState *bm, printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val); #endif switch(addr & 3) { + case 0: + bmdma_cmd_writeb(bm, addr, val); + break; case 1: pci_dev->dev.config[MRDMODE] = (pci_dev->dev.config[MRDMODE] & ~0x30) | (val & 0x30); @@ -168,13 +171,11 @@ static void bmdma_map(PCIDevice *pci_dev, int region_num, bm->bus = d->bus+i; qemu_add_vm_change_state_handler(ide_dma_restart_cb, bm); - register_ioport_write(addr, 1, 1, bmdma_cmd_writeb, bm); - if (i == 0) { - register_ioport_write(addr + 1, 3, 1, bmdma_writeb_0, d); + register_ioport_write(addr, 4, 1, bmdma_writeb_0, d); register_ioport_read(addr, 4, 1, bmdma_readb_0, d); } else { - register_ioport_write(addr + 1, 3, 1, bmdma_writeb_1, d); + register_ioport_write(addr, 4, 1, bmdma_writeb_1, d); register_ioport_read(addr, 4, 1, bmdma_readb_1, d); }