From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38996) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Mo9-0008DI-FC for qemu-devel@nongnu.org; Wed, 05 Sep 2012 17:06:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9Mo8-0001iV-DB for qemu-devel@nongnu.org; Wed, 05 Sep 2012 17:06:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9Mo8-0001iP-4b for qemu-devel@nongnu.org; Wed, 05 Sep 2012 17:06:44 -0400 From: Igor Mammedov Date: Wed, 5 Sep 2012 23:06:23 +0200 Message-Id: <1346879185-19299-4-git-send-email-imammedo@redhat.com> In-Reply-To: <1346879185-19299-1-git-send-email-imammedo@redhat.com> References: <1346879185-19299-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