From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M8DOj-0001jw-Gq for qemu-devel@nongnu.org; Sun, 24 May 2009 09:05:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M8DOf-0001hN-VA for qemu-devel@nongnu.org; Sun, 24 May 2009 09:05:53 -0400 Received: from [199.232.76.173] (port=33940 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M8DDo-0005uN-Uj for qemu-devel@nongnu.org; Sun, 24 May 2009 08:54:37 -0400 Received: from mx2.redhat.com ([66.187.237.31]:49166) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M8A1T-000149-9p for qemu-devel@nongnu.org; Sun, 24 May 2009 05:29:39 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4O9TchA008269 for ; Sun, 24 May 2009 05:29:38 -0400 From: Avi Kivity Date: Sun, 24 May 2009 12:29:35 +0300 Message-Id: <1243157375-14329-4-git-send-email-avi@redhat.com> In-Reply-To: <1243157375-14329-1-git-send-email-avi@redhat.com> References: <1243157375-14329-1-git-send-email-avi@redhat.com> Subject: [Qemu-devel] [PATCH 3/3] Convert RTL8139 to use PCI memory regitration facility List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Signed-off-by: Avi Kivity --- hw/rtl8139.c | 15 +++++---------- 1 files changed, 5 insertions(+), 10 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index c0be1de..f2bc072 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -467,6 +467,7 @@ typedef struct RTL8139State { VLANClientState *vc; uint8_t macaddr[6]; int rtl8139_mmio_io_addr; + PCIIORegionComponent *pci_mem; /* C ring mode */ uint32_t currTxDesc; @@ -3324,15 +3325,6 @@ typedef struct PCIRTL8139State { RTL8139State rtl8139; } PCIRTL8139State; -static void rtl8139_mmio_map(PCIDevice *pci_dev, int region_num, - uint32_t addr, uint32_t size, int type) -{ - PCIRTL8139State *d = (PCIRTL8139State *)pci_dev; - RTL8139State *s = &d->rtl8139; - - cpu_register_physical_memory(addr + 0, 0x100, s->rtl8139_mmio_io_addr); -} - static void rtl8139_ioport_map(PCIDevice *pci_dev, int region_num, uint32_t addr, uint32_t size, int type) { @@ -3476,7 +3468,10 @@ PCIDevice *pci_rtl8139_init(PCIBus *bus, NICInfo *nd, int devfn) PCI_ADDRESS_SPACE_IO, rtl8139_ioport_map); pci_register_io_region(&d->dev, 1, 0x100, - PCI_ADDRESS_SPACE_MEM, rtl8139_mmio_map); + PCI_ADDRESS_SPACE_MEM, NULL); + + s->pci_mem = pci_register_physical_memory(&d->dev, 1, 0x100, + s->rtl8139_mmio_io_addr); s->pci_dev = (PCIDevice *)d; memcpy(s->macaddr, nd->macaddr, 6); -- 1.6.0.6