aboutsummaryrefslogtreecommitdiff
path: root/hw/acpi_piix4.c
diff options
context:
space:
mode:
authorMarcelo Tosatti <mtosatti@redhat.com>2012-10-11 05:00:35 -0300
committerMarcelo Tosatti <mtosatti@redhat.com>2012-10-11 05:00:35 -0300
commit6b852ae04e3aa1adfeac5a62d6ab71870bcc7c5d (patch)
treecdf94fdf09a6b4abecff647784d82bc1ad1758c5 /hw/acpi_piix4.c
parent8ed1d2756d3347c2b021748d8c272ff650f57dd0 (diff)
parentf430694188293f99a316bfa375b7cc17d23a06ed (diff)
Merge commit 'f430694188293f99a316bfa375b7cc17d23a06ed' into upstream-merge
* commit 'f430694188293f99a316bfa375b7cc17d23a06ed': (248 commits) add pc-1.3 machine type Cleanup unused global var qemu_system_powerdown target-sparc: use notifier for signaling guest system_powerdown command target-arm: use notifier for signaling guest system_powerdown command acpi: use notifier for signaling guest system_powerdown command Introduce powerdown_notifiers tcg/i386: fix build with -march < i686 tcg: Streamline movcond_i64 using movcond_i32 tcg: Streamline movcond_i64 using 32-bit arithmetic tcg: Sanity check goto_tb input tcg: Sanity check deposit inputs tcg: Add tcg_debug_assert tcg: Implement concat*_i64 with deposit_i64 tcg: Emit XORI as NOT for appropriate constants tcg: Optimize initial inputs for ori_i64 tcg: Emit ANDI as EXTU for appropriate constants tcg: Adjust descriptions of *cond opcodes tcg/mips: fix MIPS32(R2) detection block: remove keep_read_only flag from BlockDriverState struct block: convert bdrv_commit() to use bdrv_reopen() ... Conflicts: hw/pc_piix.c Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'hw/acpi_piix4.c')
-rw-r--r--hw/acpi_piix4.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/acpi_piix4.c b/hw/acpi_piix4.c
index dad38870a..a48187fa7 100644
--- a/hw/acpi_piix4.c
+++ b/hw/acpi_piix4.c
@@ -73,6 +73,7 @@ typedef struct PIIX4PMState {
qemu_irq smi_irq;
int kvm_enabled;
Notifier machine_ready;
+ Notifier powerdown_notifier;
/* for pci hotplug */
struct gpe_regs gpe_cpu;
@@ -368,9 +369,9 @@ static void piix4_reset(void *opaque)
piix4_update_hotplug(s);
}
-static void piix4_powerdown(void *opaque, int irq, int power_failing)
+static void piix4_pm_powerdown_req(Notifier *n, void *opaque)
{
- PIIX4PMState *s = opaque;
+ PIIX4PMState *s = container_of(n, PIIX4PMState, powerdown_notifier);
assert(s != NULL);
acpi_pm1_evt_power_down(&s->ar);
@@ -427,7 +428,8 @@ static int piix4_pm_initfn(PCIDevice *dev)
acpi_pm_tmr_init(&s->ar, pm_tmr_timer);
acpi_gpe_init(&s->ar, GPE_LEN);
- qemu_system_powerdown = *qemu_allocate_irqs(piix4_powerdown, s, 1);
+ s->powerdown_notifier.notify = piix4_pm_powerdown_req;
+ qemu_register_powerdown_notifier(&s->powerdown_notifier);
pm_smbus_init(&s->dev.qdev, &s->smb);
s->machine_ready.notify = piix4_pm_machine_ready;