From nobody Wed Feb 11 02:54:48 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529294310649505.2512493851365; Sun, 17 Jun 2018 20:58:30 -0700 (PDT) Received: from localhost ([::1]:60894 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUlJF-0000ti-UQ for importer@patchew.org; Sun, 17 Jun 2018 23:58:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49720) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fUlEY-0005Jp-6z for qemu-devel@nongnu.org; Sun, 17 Jun 2018 23:53:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fUlEW-0003yr-Q3 for qemu-devel@nongnu.org; Sun, 17 Jun 2018 23:53:38 -0400 Received: from ozlabs.org ([203.11.71.1]:43479) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fUlEW-0003wV-BR; Sun, 17 Jun 2018 23:53:36 -0400 Received: by ozlabs.org (Postfix, from userid 1007) id 418HJ94tVWz9s76; Mon, 18 Jun 2018 13:53:29 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gibson.dropbear.id.au; s=201602; t=1529294009; bh=iyLzWaZ2Srgv//IUCU1jj/dexOn4YyLUSGFtpat6bFM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PJSxYdhZhh+sJGElxrNuDZq4xWWrRikUWYgxI7WOvzd9ZWLA8jMWcl0XaIJY/IYMx ZuSUCh8Cg8vQcnI9ov+pUusWILcY++H1Goin/ajH0R3ozlymsN21X1+dxiV2/4+aaX XCYvzTkoWHZwfIu/lMMmjdoNrtCklT67nZ7qPE3g= From: David Gibson To: peter.maydell@linaro.org Date: Mon, 18 Jun 2018 13:53:04 +1000 Message-Id: <20180618035324.19907-9-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180618035324.19907-1-david@gibson.dropbear.id.au> References: <20180618035324.19907-1-david@gibson.dropbear.id.au> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 203.11.71.1 Subject: [Qemu-devel] [PULL 08/28] mac_newworld: wire up programmer switch to NMI handler X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: aik@ozlabs.ru, Mark Cave-Ayland , agraf@suse.de, qemu-devel@nongnu.org, groug@kaod.org, qemu-ppc@nongnu.org, clg@kaod.org, David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Mark Cave-Ayland The programmer switch is wired up via an external GPIO pin and can be used to aid debugging Mac guests. Signed-off-by: Mark Cave-Ayland Signed-off-by: David Gibson --- hw/misc/macio/gpio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hw/misc/macio/gpio.c b/hw/misc/macio/gpio.c index 5630afdf18..9317df759c 100644 --- a/hw/misc/macio/gpio.c +++ b/hw/misc/macio/gpio.c @@ -28,6 +28,7 @@ #include "hw/ppc/mac.h" #include "hw/misc/macio/macio.h" #include "hw/misc/macio/gpio.h" +#include "hw/nmi.h" #include "qemu/log.h" #include "trace.h" =20 @@ -193,13 +194,21 @@ static void macio_gpio_reset(DeviceState *dev) macio_set_gpio(s, 1, true); } =20 +static void macio_gpio_nmi(NMIState *n, int cpu_index, Error **errp) +{ + macio_set_gpio(MACIO_GPIO(n), 9, true); + macio_set_gpio(MACIO_GPIO(n), 9, false); +} + static void macio_gpio_class_init(ObjectClass *oc, void *data) { DeviceClass *dc =3D DEVICE_CLASS(oc); + NMIClass *nc =3D NMI_CLASS(oc); =20 dc->realize =3D macio_gpio_realize; dc->reset =3D macio_gpio_reset; dc->vmsd =3D &vmstate_macio_gpio; + nc->nmi_monitor_handler =3D macio_gpio_nmi; } =20 static const TypeInfo macio_gpio_init_info =3D { @@ -208,6 +217,10 @@ static const TypeInfo macio_gpio_init_info =3D { .instance_size =3D sizeof(MacIOGPIOState), .instance_init =3D macio_gpio_init, .class_init =3D macio_gpio_class_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_NMI }, + { } + }, }; =20 static void macio_gpio_register_types(void) --=20 2.17.1