qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: qemu-devel@nongnu.org
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH 3/8] apci: assign memory regions to piix4 acpi device
Date: Wed, 19 Dec 2012 09:46:05 +0100	[thread overview]
Message-ID: <1355906770-17199-4-git-send-email-kraxel@redhat.com> (raw)
In-Reply-To: <1355906770-17199-1-git-send-email-kraxel@redhat.com>

Get rid of get_system_io() usage.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/acpi_piix4.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index 0b5b0d3..30bafb6 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -57,6 +57,7 @@ struct pci_status {
 
 typedef struct PIIX4PMState {
     PCIDevice dev;
+
     MemoryRegion io;
     MemoryRegion io_gpe;
     MemoryRegion io_pci;
@@ -83,7 +84,8 @@ typedef struct PIIX4PMState {
     uint8_t s4_val;
 } PIIX4PMState;
 
-static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s);
+static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
+                                           PCIBus *bus, PIIX4PMState *s);
 
 #define ACPI_ENABLE 0xf1
 #define ACPI_DISABLE 0xf0
@@ -406,11 +408,13 @@ static int piix4_pm_initfn(PCIDevice *dev)
     pci_conf[0xd2] = 0x09;
     pm_smbus_init(&s->dev.qdev, &s->smb);
     memory_region_set_enabled(&s->smb.io, pci_conf[0xd2] & 1);
-    memory_region_add_subregion(get_system_io(), s->smb_io_base, &s->smb.io);
+    memory_region_add_subregion(pci_address_space_io(dev),
+                                s->smb_io_base, &s->smb.io);
 
     memory_region_init(&s->io, "piix4-pm", 64);
     memory_region_set_enabled(&s->io, false);
-    memory_region_add_subregion(get_system_io(), 0, &s->io);
+    memory_region_add_subregion(pci_address_space_io(dev),
+                                0, &s->io);
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
@@ -423,7 +427,8 @@ static int piix4_pm_initfn(PCIDevice *dev)
     s->machine_ready.notify = piix4_pm_machine_ready;
     qemu_add_machine_init_done_notifier(&s->machine_ready);
     qemu_register_reset(piix4_reset, s);
-    piix4_acpi_system_hot_add_init(dev->bus, s);
+
+    piix4_acpi_system_hot_add_init(pci_address_space_io(dev), dev->bus, s);
 
     return 0;
 }
@@ -593,15 +598,16 @@ static const MemoryRegionOps piix4_pci_ops = {
 static int piix4_device_hotplug(DeviceState *qdev, PCIDevice *dev,
                                 PCIHotplugState state);
 
-static void piix4_acpi_system_hot_add_init(PCIBus *bus, PIIX4PMState *s)
+static void piix4_acpi_system_hot_add_init(MemoryRegion *parent,
+                                           PCIBus *bus, PIIX4PMState *s)
 {
     memory_region_init_io(&s->io_gpe, &piix4_gpe_ops, s, "apci-gpe0",
                           GPE_LEN);
-    memory_region_add_subregion(get_system_io(), GPE_BASE, &s->io_gpe);
+    memory_region_add_subregion(parent, GPE_BASE, &s->io_gpe);
 
     memory_region_init_io(&s->io_pci, &piix4_pci_ops, s, "apci-pci-hotplug",
                           PCI_HOTPLUG_SIZE);
-    memory_region_add_subregion(get_system_io(), PCI_HOTPLUG_ADDR,
+    memory_region_add_subregion(parent, PCI_HOTPLUG_ADDR,
                                 &s->io_pci);
     pci_bus_hotplug(bus, piix4_device_hotplug, &s->dev.qdev);
 }
-- 
1.7.1

  parent reply	other threads:[~2012-12-19  8:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19  8:46 [Qemu-devel] [PATCH 0/8] misc acpi updates and test devices Gerd Hoffmann
2012-12-19  8:46 ` [Qemu-devel] [PATCH 1/8] configure: also symlink *.aml files Gerd Hoffmann
2012-12-19  8:46 ` [Qemu-devel] [PATCH 2/8] acpi: autoload dsdt Gerd Hoffmann
2012-12-19  8:46 ` Gerd Hoffmann [this message]
2012-12-19  8:46 ` [Qemu-devel] [PATCH 4/8] apci: assign memory regions to ich9 lpc device Gerd Hoffmann
2012-12-19  8:46 ` [Qemu-devel] [PATCH 5/8] switch debugcon to memory api Gerd Hoffmann
2012-12-19  8:46 ` [Qemu-devel] [PATCH 6/8] add isa-debug-exit device Gerd Hoffmann
2012-12-19  8:46 ` [Qemu-devel] [PATCH 7/8] hw: Add test device for unittests execution Gerd Hoffmann
2012-12-19  8:46 ` [Qemu-devel] [PATCH 8/8] pc: remove bochs bios debug ports Gerd Hoffmann

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=1355906770-17199-4-git-send-email-kraxel@redhat.com \
    --to=kraxel@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).