From: Avi Kivity Subject: [RFC v5 81/86] ppce500_pci: convert to sysbus_init_mmio_cb2() Date: Wed, 20 Jul 2011 19:50:31 +0300 Message-ID: <1311180636-17012-82-git-send-email-avi@redhat.com> References: <1311180636-17012-1-git-send-email-avi@redhat.com> Cc: kvm@vger.kernel.org To: qemu-devel@nongnu.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:26352 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752373Ab1GTQu4 (ORCPT ); Wed, 20 Jul 2011 12:50:56 -0400 In-Reply-To: <1311180636-17012-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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; } -- 1.7.5.3