From patchwork Wed Sep 5 21:06:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Igor Mammedov X-Patchwork-Id: 181956 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 9F4C72C0094 for ; Thu, 6 Sep 2012 07:07:10 +1000 (EST) Received: from localhost ([::1]:33162 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9MoW-0008Pa-I1 for incoming@patchwork.ozlabs.org; Wed, 05 Sep 2012 17:07:08 -0400 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 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q85L6fJH001417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Sep 2012 17:06:41 -0400 Received: from thinkpad.com (ovpn-112-16.ams2.redhat.com [10.36.112.16]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q85L6QIM025067; Wed, 5 Sep 2012 17:06:38 -0400 From: Igor Mammedov To: peter.maydell@linaro.org, qemu-devel@nongnu.org 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> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 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 Subject: [Qemu-devel] [PATCH 3/5] target-arm: use notifier for signaling guest system_powerdown command X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Igor Mammedov Acked-by: Peter Maydell --- 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);