From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6lfp-0006bu-OR for qemu-devel@nongnu.org; Wed, 29 Aug 2012 13:03:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6lfl-0003Pr-OV for qemu-devel@nongnu.org; Wed, 29 Aug 2012 13:03:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45207) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6lfl-0003PH-GI for qemu-devel@nongnu.org; Wed, 29 Aug 2012 13:03:21 -0400 From: Igor Mammedov Date: Wed, 29 Aug 2012 19:02:45 +0200 Message-Id: <1346259767-991-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1346259767-991-1-git-send-email-imammedo@redhat.com> References: <1346259767-991-1-git-send-email-imammedo@redhat.com> Subject: [Qemu-devel] [PATCH 3/5] target-arm: use notifier for signaling guest system_powerdown command List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: peter.maydell@linaro.org, qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, mst@redhat.com, jan.kiszka@siemens.com, lcapitulino@redhat.com, blauwirbel@gmail.com, alex.williamson@redhat.com, kraxel@redhat.com, pbonzini@redhat.com Signed-off-by: Igor Mammedov --- hw/nseries.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/nseries.c b/hw/nseries.c index 4df2670..6df71eb 100644 --- a/hw/nseries.c +++ b/hw/nseries.c @@ -189,6 +189,17 @@ static void n8x0_nand_setup(struct n800_s *s) /* XXX: in theory should also update the OOB for both pages */ } +static qemu_irq n8x0_system_powerdown; + +static void n8x0_powerdown_req(Notifier *n, void *opaque) +{ + qemu_irq_raise(n8x0_system_powerdown); +} + +static Notifier n8x0_system_powerdown_notifier = { + .notify = n8x0_powerdown_req +}; + static void n8x0_i2c_setup(struct n800_s *s) { DeviceState *dev; @@ -201,7 +212,8 @@ static void n8x0_i2c_setup(struct n800_s *s) qdev_get_gpio_in(s->mpu->ih[0], OMAP_INT_24XX_SYS_NIRQ)); - qemu_system_powerdown = qdev_get_gpio_in(dev, 3); + n8x0_system_powerdown = qdev_get_gpio_in(dev, 3); + qemu_register_powerdown_notifier(&n8x0_system_powerdown_notifier); /* Attach a TMP105 PM chip (A0 wired to ground) */ dev = i2c_create_slave(i2c, "tmp105", N8X0_TMP105_ADDR); -- 1.7.11.4