From mboxrd@z Thu Jan 1 00:00:00 1970 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:32864) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjaBh-00009m-W2 for qemu-devel@nongnu.org; Wed, 20 Jul 2011 13:03:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjaBg-0007v4-Od for qemu-devel@nongnu.org; Wed, 20 Jul 2011 13:03:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjZyx-0004xO-1U for qemu-devel@nongnu.org; Wed, 20 Jul 2011 12:50:49 -0400 From: Avi Kivity Date: Wed, 20 Jul 2011 19:50:31 +0300 Message-Id: <1311180636-17012-82-git-send-email-avi@redhat.com> In-Reply-To: <1311180636-17012-1-git-send-email-avi@redhat.com> References: <1311180636-17012-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [RFC v5 81/86] ppce500_pci: convert to sysbus_init_mmio_cb2() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kvm@vger.kernel.org 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