From patchwork Mon Aug 15 14:17:33 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 1067682 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p7FEI1GC026614 for ; Mon, 15 Aug 2011 14:18:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753903Ab1HOOSH (ORCPT ); Mon, 15 Aug 2011 10:18:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39535 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753638Ab1HOORp (ORCPT ); Mon, 15 Aug 2011 10:17:45 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p7FEHh40001887 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 15 Aug 2011 10:17:43 -0400 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p7FEHg6Z007296; Mon, 15 Aug 2011 10:17:43 -0400 Received: from s01.tlv.redhat.com (s01.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id AB4A0250B5B; Mon, 15 Aug 2011 17:17:40 +0300 (IDT) From: Avi Kivity To: Anthony Liguori , qemu-devel@nongnu.org Cc: kvm@vger.kernel.org Subject: [PATCH v2 19/24] ppce500_pci: convert to sysbus_init_mmio_cb2() Date: Mon, 15 Aug 2011 17:17:33 +0300 Message-Id: <1313417858-6454-20-git-send-email-avi@redhat.com> In-Reply-To: <1313417858-6454-1-git-send-email-avi@redhat.com> References: <1313417858-6454-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Mon, 15 Aug 2011 14:18:35 +0000 (UTC) Not a huge step forward, but at least we now have a 1:1 relationship between registration and unregistration. Signed-off-by: Avi Kivity --- hw/ppce500_pci.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-) diff --git a/hw/ppce500_pci.c b/hw/ppce500_pci.c index 6a9f979..4390aeb 100644 --- a/hw/ppce500_pci.c +++ b/hw/ppce500_pci.c @@ -274,6 +274,16 @@ static void e500_pci_map(SysBusDevice *dev, target_phys_addr_t base) s->reg); } +static void e500_pci_unmap(SysBusDevice *dev, target_phys_addr_t base) +{ + cpu_register_physical_memory(base + PCIE500_CFGADDR, 4, + IO_MEM_UNASSIGNED); + cpu_register_physical_memory(base + PCIE500_CFGDATA, 4, + IO_MEM_UNASSIGNED); + cpu_register_physical_memory(base + PCIE500_REG_BASE, PCIE500_REG_SIZE, + IO_MEM_UNASSIGNED); +} + #include "exec-memory.h" static int e500_pcihost_initfn(SysBusDevice *dev) @@ -304,7 +314,7 @@ static int e500_pcihost_initfn(SysBusDevice *dev) DEVICE_LITTLE_ENDIAN); s->reg = cpu_register_io_memory(e500_pci_reg_read, e500_pci_reg_write, s, DEVICE_BIG_ENDIAN); - sysbus_init_mmio_cb(dev, PCIE500_ALL_SIZE, e500_pci_map); + sysbus_init_mmio_cb2(dev, e500_pci_map, e500_pci_unmap); return 0; }