diff options
author | Igor Mammedov <imammedo@redhat.com> | 2012-09-05 23:06:24 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2012-09-25 18:37:41 -0500 |
commit | bea42280dad1e016225654a062b98bafe99e51fe (patch) | |
tree | fc739d1ea75aab569843a4b73534c56c484d7d68 /hw/sun4m.c | |
parent | c72ddb1e4734ce021c3101b6b4f8ed02439c9e21 (diff) | |
download | hqemu-bea42280dad1e016225654a062b98bafe99e51fe.zip hqemu-bea42280dad1e016225654a062b98bafe99e51fe.tar.gz |
target-sparc: use notifier for signaling guest system_powerdown command
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/sun4m.c')
-rw-r--r-- | hw/sun4m.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -472,6 +472,17 @@ static void slavio_timer_init_all(target_phys_addr_t addr, qemu_irq master_irq, } } +static qemu_irq slavio_system_powerdown; + +static void slavio_powerdown_req(Notifier *n, void *opaque) +{ + qemu_irq_raise(slavio_system_powerdown); +} + +static Notifier slavio_system_powerdown_notifier = { + .notify = slavio_powerdown_req +}; + #define MISC_LEDS 0x01600000 #define MISC_CFG 0x01800000 #define MISC_DIAG 0x01a00000 @@ -514,7 +525,8 @@ static void slavio_misc_init(target_phys_addr_t base, } sysbus_connect_irq(s, 0, irq); sysbus_connect_irq(s, 1, fdc_tc); - qemu_system_powerdown = qdev_get_gpio_in(dev, 0); + slavio_system_powerdown = qdev_get_gpio_in(dev, 0); + qemu_register_powerdown_notifier(&slavio_system_powerdown_notifier); } static void ecc_init(target_phys_addr_t base, qemu_irq irq, uint32_t version) |