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 4/8] apci: assign memory regions to ich9 lpc device
Date: Wed, 19 Dec 2012 09:46:06 +0100	[thread overview]
Message-ID: <1355906770-17199-5-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_ich9.c |    6 ++++--
 hw/acpi_ich9.h |    4 +++-
 hw/lpc_ich9.c  |    2 +-
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/hw/acpi_ich9.c b/hw/acpi_ich9.c
index c5978d3..b895422 100644
--- a/hw/acpi_ich9.c
+++ b/hw/acpi_ich9.c
@@ -201,11 +201,13 @@ static void pm_powerdown_req(Notifier *n, void *opaque)
     acpi_pm1_evt_power_down(&pm->acpi_regs);
 }
 
-void ich9_pm_init(ICH9LPCPMRegs *pm, qemu_irq sci_irq, qemu_irq cmos_s3)
+void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
+                  qemu_irq sci_irq, qemu_irq cmos_s3)
 {
     memory_region_init(&pm->io, "ich9-pm", ICH9_PMIO_SIZE);
     memory_region_set_enabled(&pm->io, false);
-    memory_region_add_subregion(get_system_io(), 0, &pm->io);
+    memory_region_add_subregion(pci_address_space_io(lpc_pci),
+                                0, &pm->io);
 
     acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
diff --git a/hw/acpi_ich9.h b/hw/acpi_ich9.h
index bc221d3..ecb82ab 100644
--- a/hw/acpi_ich9.h
+++ b/hw/acpi_ich9.h
@@ -30,9 +30,11 @@ typedef struct ICH9LPCPMRegs {
      * PM1a_CNT_BLK = 2 in FADT so it is defined as uint16_t.
      */
     ACPIREGS acpi_regs;
+
     MemoryRegion io;
     MemoryRegion io_gpe;
     MemoryRegion io_smi;
+
     uint32_t smi_en;
     uint32_t smi_sts;
 
@@ -42,7 +44,7 @@ typedef struct ICH9LPCPMRegs {
     Notifier powerdown_notifier;
 } ICH9LPCPMRegs;
 
-void ich9_pm_init(ICH9LPCPMRegs *pm,
+void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
                   qemu_irq sci_irq, qemu_irq cmos_s3_resume);
 void ich9_pm_iospace_update(ICH9LPCPMRegs *pm, uint32_t pm_io_base);
 extern const VMStateDescription vmstate_ich9_pm;
diff --git a/hw/lpc_ich9.c b/hw/lpc_ich9.c
index 878a43e..dd67b61 100644
--- a/hw/lpc_ich9.c
+++ b/hw/lpc_ich9.c
@@ -352,7 +352,7 @@ void ich9_lpc_pm_init(PCIDevice *lpc_pci, qemu_irq cmos_s3)
     qemu_irq *sci_irq;
 
     sci_irq = qemu_allocate_irqs(ich9_set_sci, lpc, 1);
-    ich9_pm_init(&lpc->pm, sci_irq[0], cmos_s3);
+    ich9_pm_init(lpc_pci, &lpc->pm, sci_irq[0], cmos_s3);
 
     ich9_lpc_reset(&lpc->d.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 ` [Qemu-devel] [PATCH 3/8] apci: assign memory regions to piix4 acpi device Gerd Hoffmann
2012-12-19  8:46 ` Gerd Hoffmann [this message]
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-5-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).