qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 10/10] wdt_i6300esb: convert to pci_register_bar_simple()
Date: Mon,  4 Apr 2011 18:28:07 +0300	[thread overview]
Message-ID: <1301930887-20705-11-git-send-email-avi@redhat.com> (raw)
In-Reply-To: <1301930887-20705-1-git-send-email-avi@redhat.com>

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/wdt_i6300esb.c |   42 +++++++++++++++---------------------------
 1 files changed, 15 insertions(+), 27 deletions(-)

diff --git a/hw/wdt_i6300esb.c b/hw/wdt_i6300esb.c
index 4a7fba7..0791721 100644
--- a/hw/wdt_i6300esb.c
+++ b/hw/wdt_i6300esb.c
@@ -355,31 +355,6 @@ static void i6300esb_mem_writel(void *vp, target_phys_addr_t addr, uint32_t val)
     }
 }
 
-static void i6300esb_map(PCIDevice *dev, int region_num,
-                         pcibus_t addr, pcibus_t size, int type)
-{
-    static CPUReadMemoryFunc * const mem_read[3] = {
-        i6300esb_mem_readb,
-        i6300esb_mem_readw,
-        i6300esb_mem_readl,
-    };
-    static CPUWriteMemoryFunc * const mem_write[3] = {
-        i6300esb_mem_writeb,
-        i6300esb_mem_writew,
-        i6300esb_mem_writel,
-    };
-    I6300State *d = DO_UPCAST(I6300State, dev, dev);
-    int io_mem;
-
-    i6300esb_debug("addr = %"FMT_PCIBUS", size = %"FMT_PCIBUS", type = %d\n",
-                   addr, size, type);
-
-    io_mem = cpu_register_io_memory(mem_read, mem_write, d,
-                                    DEVICE_NATIVE_ENDIAN);
-    cpu_register_physical_memory (addr, 0x10, io_mem);
-    /* qemu_register_coalesced_mmio (addr, 0x10); ? */
-}
-
 static const VMStateDescription vmstate_i6300esb = {
     .name = "i6300esb_wdt",
     .version_id = sizeof(I6300State),
@@ -407,6 +382,17 @@ static int i6300esb_init(PCIDevice *dev)
 {
     I6300State *d = DO_UPCAST(I6300State, dev, dev);
     uint8_t *pci_conf;
+    int io_mem;
+    static CPUReadMemoryFunc * const mem_read[3] = {
+        i6300esb_mem_readb,
+        i6300esb_mem_readw,
+        i6300esb_mem_readl,
+    };
+    static CPUWriteMemoryFunc * const mem_write[3] = {
+        i6300esb_mem_writeb,
+        i6300esb_mem_writew,
+        i6300esb_mem_writel,
+    };
 
     i6300esb_debug("I6300State = %p\n", d);
 
@@ -418,8 +404,10 @@ static int i6300esb_init(PCIDevice *dev)
     pci_config_set_device_id(pci_conf, PCI_DEVICE_ID_INTEL_ESB_9);
     pci_config_set_class(pci_conf, PCI_CLASS_SYSTEM_OTHER);
 
-    pci_register_bar(&d->dev, 0, 0x10,
-                            PCI_BASE_ADDRESS_SPACE_MEMORY, i6300esb_map);
+    io_mem = cpu_register_io_memory(mem_read, mem_write, d,
+                                    DEVICE_NATIVE_ENDIAN);
+    pci_register_bar_simple(&d->dev, 0, 0x10, 0, io_mem);
+    /* qemu_register_coalesced_mmio (addr, 0x10); ? */
 
     return 0;
 }
-- 
1.7.1

  parent reply	other threads:[~2011-04-04 15:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 15:27 [Qemu-devel] [PATCH 00/10] pci: pci_register_bar_simple Avi Kivity
2011-04-04 15:27 ` [Qemu-devel] [PATCH 01/10] pci: add pci_register_bar_simple() API Avi Kivity
2011-04-04 15:27 ` [Qemu-devel] [PATCH 02/10] rtl8139: convert to pci_register_bar_simple() Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 03/10] cirrus-vga: " Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 04/10] eepro100: " Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 05/10] ich/ahci: " Avi Kivity
2011-05-08 17:54   ` [Qemu-devel] [PATCH] ahci: Unbreak bar registration (was: Re: [PATCH 05/10] ich/ahci: convert to pci_register_bar_simple()) Jan Kiszka
2011-04-04 15:28 ` [Qemu-devel] [PATCH 06/10] hda-intel: convert to pci_register_bar_simple() Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 07/10] hda-intel: convert to pci_register_bar_simple() (partial) Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 08/10] pcnet-pci: convert to pci_register_bar_simple() Avi Kivity
2011-04-04 15:28 ` [Qemu-devel] [PATCH 09/10] usb-ohci: " Avi Kivity
2011-04-04 15:28 ` Avi Kivity [this message]
2011-04-04 15:59 ` [Qemu-devel] Re: [PATCH 00/10] pci: pci_register_bar_simple Michael S. Tsirkin
2011-04-04 16:01   ` Avi Kivity
2011-04-04 16:22   ` Anthony Liguori
2011-04-04 16:35     ` Avi Kivity
2011-04-04 17:02       ` Blue Swirl
2011-04-04 19:44         ` Michael S. Tsirkin
2011-04-04 21:05           ` Blue Swirl
2011-04-04 21:26             ` Michael S. Tsirkin
2011-04-05 18:02               ` Blue Swirl
2011-04-06 11:11                 ` Michael S. Tsirkin
2011-04-05  7:39         ` Avi Kivity
2011-04-05 18:06           ` Blue Swirl
2011-04-06  7:39             ` Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301930887-20705-11-git-send-email-avi@redhat.com \
    --to=avi@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).