From patchwork Thu Jul 22 21:59:38 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 59704 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 21AEC1007D9 for ; Fri, 23 Jul 2010 09:40:48 +1000 (EST) Received: from localhost ([127.0.0.1]:42603 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc4XO-0007hd-C8 for incoming@patchwork.ozlabs.org; Thu, 22 Jul 2010 18:46:46 -0400 Received: from [140.186.70.92] (port=42713 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oc3x2-00031d-8Z for qemu-devel@nongnu.org; Thu, 22 Jul 2010 18:09:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oc3o7-000308-Bd for qemu-devel@nongnu.org; Thu, 22 Jul 2010 18:00:00 -0400 Received: from mail-qw0-f45.google.com ([209.85.216.45]:35073) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oc3o7-0002yG-7k for qemu-devel@nongnu.org; Thu, 22 Jul 2010 17:59:59 -0400 Received: by mail-qw0-f45.google.com with SMTP id 6so3333686qwf.4 for ; Thu, 22 Jul 2010 14:59:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=HShXXZ8m1LIyYSTa9GH1LRlyEgUgqHLJIlXWwMBTqQI=; b=ayokMaVmzCWp8cACzNvqHUCslohWI9ft+oe0i+vRa/AHVZ/Ikj5yimQbW1MfPRagGb 2KBvI5DrPT9CVdVL8N0qiogWDW0s1nyz5xu9nQ4utvJ26NxAsFAC0QpDCfbxGxV5F6OG 5ZN4c49ouYgsRM/9aMvrZKcoAO/wyIfpdj3Cw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=uGzfDhrsBbBY4YX1TDagaVMuNpyZhlpHfAd9zCcnD6ZcRSuE4Ayy+lr7racIeF3Qwr 3ln3BAMPv3m2zrRe4UEYay5w1Jc2vIgyQkosnr4OdqqtJ4c95EZUZ6W3aNiRGnYmhs1l NzQiyn8v7SuK8zWXB7qfbZSECg1RryeUdp5gg= Received: by 10.224.47.75 with SMTP id m11mr1840335qaf.54.1279835998836; Thu, 22 Jul 2010 14:59:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.185.146 with HTTP; Thu, 22 Jul 2010 14:59:38 -0700 (PDT) From: Blue Swirl Date: Thu, 22 Jul 2010 21:59:38 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH 19/34] e1000: convert to pci_bar_map 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 Use pci_bar_map() and post_map_func instead of a mapping function. Signed-off-by: Blue Swirl --- hw/e1000.c | 15 +++------------ 1 files changed, 3 insertions(+), 12 deletions(-) diff --git a/hw/e1000.c b/hw/e1000.c index 6d1c3d4..d64fb79 100644 --- a/hw/e1000.c +++ b/hw/e1000.c @@ -149,14 +149,6 @@ static const char phy_regcap[0x20] = { }; static void -ioport_map(PCIDevice *pci_dev, int region_num, pcibus_t addr, - pcibus_t size, int type) -{ - DBGOUT(IO, "e1000_ioport_map addr=0x%04"FMT_PCIBUS - " size=0x%08"FMT_PCIBUS"\n", addr, size); -} - -static void set_interrupt_cause(E1000State *s, int index, uint32_t val) { if (val) @@ -1020,7 +1012,6 @@ static void e1000_mmio_map(PCIDevice *pci_dev, int region_num, pcibus_t addr, pcibus_t size, int type) { - E1000State *d = DO_UPCAST(E1000State, dev, pci_dev); int i; const uint32_t excluded_regs[] = { E1000_MDIC, E1000_ICR, E1000_ICS, E1000_IMS, @@ -1031,7 +1022,6 @@ e1000_mmio_map(PCIDevice *pci_dev, int region_num, DBGOUT(MMIO, "e1000_mmio_map addr=0x%08"FMT_PCIBUS" 0x%08"FMT_PCIBUS"\n", addr, size); - cpu_register_physical_memory(addr, PNPMMIO_SIZE, d->mmio_index); qemu_register_coalesced_mmio(addr, excluded_regs[0]); for (i = 0; excluded_regs[i] != PNPMMIO_SIZE; i++) @@ -1105,10 +1095,11 @@ static int pci_e1000_init(PCIDevice *pci_dev) e1000_mmio_write, d); pci_register_bar((PCIDevice *)d, 0, PNPMMIO_SIZE, - PCI_BASE_ADDRESS_SPACE_MEMORY, e1000_mmio_map, NULL); + PCI_BASE_ADDRESS_SPACE_MEMORY, NULL, e1000_mmio_map); + pci_bar_map((PCIDevice *)d, 0, 0, 0, PNPMMIO_SIZE, d->mmio_index); pci_register_bar((PCIDevice *)d, 1, IOPORT_SIZE, - PCI_BASE_ADDRESS_SPACE_IO, ioport_map, NULL); + PCI_BASE_ADDRESS_SPACE_IO, NULL, NULL); memmove(d->eeprom_data, e1000_eeprom_template, sizeof e1000_eeprom_template);