From nobody Sun May 19 03:38:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1604706905; cv=none; d=zohomail.com; s=zohoarc; b=WFAs3Db2DdED6jtasLiyPDlAGJ7XNRzkOQp6Yw42opTwehwnHzhBpxS4byXd8hdIA8lhMAnO/yo/AC26VSbgTsglPFWyL9WxCS+NihAwNJGoFL46P1PKYEtk6+pfDil55UvAO6PnOmx9gkFdfMYWkbqRpG/zCusglRXPJYvhSz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604706905; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ciIxu8fgfHqLwzeZe9kzt7oqxoPUcHRTdGjgpHaZohw=; b=mhgnev7HP1R5c1NuqvkZEFCe1/UA1qMrZNVc9EJqIcHyUHIchFqkcDaO/SU1ArhqMNArxbRWj7x2GP9820tsfkufpBqvg/OJ0EgO64+8l71TfYp4AuvufxB+cXBos5gcEqS5KPkEKlKDtq/2wDzwdn197qupEUoOoYbTyRLPpWk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1604706905642505.09102865792113; Fri, 6 Nov 2020 15:55:05 -0800 (PST) Received: from localhost ([::1]:56902 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbBZQ-0001Vv-FQ for importer@patchew.org; Fri, 06 Nov 2020 18:55:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbBVl-0006BA-U3 for qemu-devel@nongnu.org; Fri, 06 Nov 2020 18:51:17 -0500 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]:53903) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbBVi-0004XZ-JK for qemu-devel@nongnu.org; Fri, 06 Nov 2020 18:51:17 -0500 Received: by mail-wm1-x341.google.com with SMTP id p22so3011623wmg.3 for ; Fri, 06 Nov 2020 15:51:13 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n8sm4025374wmc.11.2020.11.06.15.51.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 15:51:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ciIxu8fgfHqLwzeZe9kzt7oqxoPUcHRTdGjgpHaZohw=; b=W4668tyxn/0cj88UQ1FP5bqj7dji5vObycPBabRnBtNNBiE7nRTaBVhaQWxQE8GROf zYI3VmTX5BVs83tVHTxhM9J5PXiZENYXLaL5/bMVTLst8k16Vsf0oHMoOadKAEaIE4mL VV4Va2EeNZtdqacMv8hK/PIz0tC6rzZaDE2AmxqzWbJpZtPHWFgJ4aLyWYigtk+zKrH0 fXvPFyhqoXNaMYmncGJQ5ESr58lLruZ1Lac2EnGlqiRgylIu5gnocCrxH2QOXuYPpkzs FuCoGSH49PnNXtdwyxoTu1ysFxcu1vV7B9EGQeDN84bJXiTIgIBqFbeYVFwGvuSTI4Ag 9OKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=ciIxu8fgfHqLwzeZe9kzt7oqxoPUcHRTdGjgpHaZohw=; b=Lzx/Rd8KZzI+c+fKgRn5anr4wkJVKSheeapWO7DegQldkKpMRGA3W28VlgAauNnzoR +vGORKuVRqhHhACOAazPz1CA/0pJdj8pvIi4h1+p5w5o+oWgYD7SHbx7+FuYaiQ/2v7d BcV2nL8WNwrUzTs+Pwjw7KL/jXfdnlybj7y3GeLrAzAgn8xDc1dVSM4lEY7yUmdOJEst NkJKeV/6dYncqbs3q1W1v04k+TkeR4tq+LDL9+yvpFhIgA/W1a+VAAc9BpNLRaCNcxox ZSY5w8IHGQWyx/EVFVxzYE1OsGDjY0UbHq4KxTUIyU1IWm922/fy6vogDLaPCe7Pp7Lp eevA== X-Gm-Message-State: AOAM532zkHA+SubB0rxe1jjstzF0XetqqP9PYcqOCM+NYsSyutwfBMqi Eeaf0GVC5WPMKdfRyvDcMFiK89HOBusRug== X-Google-Smtp-Source: ABdhPJwlcVvabq9ZbZ2JTWQYniTKPz3dUCLsxCtxUyHBEFA+z3E5GG4RwdAHorKuBGFcU5d5ir59DQ== X-Received: by 2002:a7b:cf31:: with SMTP id m17mr1980037wmg.62.1604706672408; Fri, 06 Nov 2020 15:51:12 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 1/2] hw/m68k/q800: Don't connect two qemu_irqs directly to the same input Date: Fri, 6 Nov 2020 23:51:08 +0000 Message-Id: <20201106235109.7066-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201106235109.7066-1-peter.maydell@linaro.org> References: <20201106235109.7066-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::341; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x341.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" The q800 board code connects both of the IRQ outputs of the ESCC to the same pic[3] qemu_irq. Connecting two qemu_irqs outputs directly to the same input is not valid as it produces subtly wrong behaviour (for instance if both the IRQ lines are high, and then one goes low, the PIC input will see this as a high-to-low transition even though the second IRQ line should still be holding it high). This kind of wiring needs an explicitly created OR gate; add one. Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/m68k/q800.c | 12 ++++++++++-- hw/m68k/Kconfig | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index ce4b47c3e34..dc13007aaf2 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -28,6 +28,7 @@ #include "hw/hw.h" #include "hw/boards.h" #include "hw/irq.h" +#include "hw/or-irq.h" #include "elf.h" #include "hw/loader.h" #include "ui/console.h" @@ -171,6 +172,7 @@ static void q800_init(MachineState *machine) CPUState *cs; DeviceState *dev; DeviceState *via_dev; + DeviceState *escc_orgate; SysBusESPState *sysbus_esp; ESPState *esp; SysBusDevice *sysbus; @@ -283,8 +285,14 @@ static void q800_init(MachineState *machine) qdev_prop_set_uint32(dev, "chnAtype", 0); sysbus =3D SYS_BUS_DEVICE(dev); sysbus_realize_and_unref(sysbus, &error_fatal); - sysbus_connect_irq(sysbus, 0, pic[3]); - sysbus_connect_irq(sysbus, 1, pic[3]); + + /* Logically OR both its IRQs together */ + escc_orgate =3D DEVICE(object_new(TYPE_OR_IRQ)); + object_property_set_int(OBJECT(escc_orgate), "num-lines", 2, &error_fa= tal); + qdev_realize_and_unref(escc_orgate, NULL, &error_fatal); + sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(escc_orgate, 0)); + sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(escc_orgate, 1)); + qdev_connect_gpio_out(DEVICE(escc_orgate), 0, pic[3]); sysbus_mmio_map(sysbus, 0, SCC_BASE); =20 /* SCSI */ diff --git a/hw/m68k/Kconfig b/hw/m68k/Kconfig index c757e7dfa48..60d7bcfb8f2 100644 --- a/hw/m68k/Kconfig +++ b/hw/m68k/Kconfig @@ -22,3 +22,4 @@ config Q800 select ESCC select ESP select DP8393X + select OR_IRQ --=20 2.20.1 From nobody Sun May 19 03:38:06 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1604706786; cv=none; d=zohomail.com; s=zohoarc; b=f4ZUQOu6/a4xtYwr05aRb0BZS6RTFrpgiaZs2Z3tDGIs2IR78gmiAQsBZO98dGOXBnLjVhHL/N3ZpyhtM+MkQCEPYcxnldOeYCc4cZLSqv+GtNx9IKouD7jumbIrM53WBq+mb2qO95lb1Kt00RbLAL2bRJ/jdYWM/3jBN2IZS9A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1604706786; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=5LIhaFgUhyoIXXqpYlZHKoo2I0ctX3FWm0zLqbLaZR8=; b=lF7OSxU21b+ex3ELt+uJbHb8E3mSFHnwp4w0aklTazre/6fNK0Jd0hzRO1D+EdZlaPk2iAmMr9OkGq6PPpNYPGzAOKKuaoRNhVUH9se5gJqvzUruBlV04kGBFdsk7qPYShmBdSKuyZrlI4SAog2MKvYRnyG4LMs+WM/WH3UOFi4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160470678667129.068446843452875; Fri, 6 Nov 2020 15:53:06 -0800 (PST) Received: from localhost ([::1]:51150 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbBXV-0007YR-GM for importer@patchew.org; Fri, 06 Nov 2020 18:53:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:35872) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbBVm-0006Bu-Lk for qemu-devel@nongnu.org; Fri, 06 Nov 2020 18:51:18 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:34519) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbBVj-0004Xh-Es for qemu-devel@nongnu.org; Fri, 06 Nov 2020 18:51:18 -0500 Received: by mail-wm1-x344.google.com with SMTP id 23so1899033wmg.1 for ; Fri, 06 Nov 2020 15:51:15 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id n8sm4025374wmc.11.2020.11.06.15.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Nov 2020 15:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5LIhaFgUhyoIXXqpYlZHKoo2I0ctX3FWm0zLqbLaZR8=; b=RuT3XgjfLsS3vn1uK/kYT3Xks3sM8n44z6hdvbmiHZC9SrEpIsCP5gXvBV7kMLpxZX u3RP9TiPqNtgnlbwr04eN10sYvsXb98fr/+4pjFT0uNtEc895XptLKbJR0VYe5PFbbK+ CzwpGgbsZpJEVQXL8bQiov1WpiZC+0srwmHh8eJUgSEVQussX0MgvqbnCtKyJ+dmCSxg RkKJ3yxWX1dCimmZRIoaV4yEqC24Lp8ocEIThgXiogYd1r0BXbjA+TQbCuJ8GelnD4C9 izjDQG7jF5ixlpJR+s8+9A3SjMKy/s0xTNs69cg7CtJkY7bvfKj0p6D16UJ+GfIWHSTs Jwsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=5LIhaFgUhyoIXXqpYlZHKoo2I0ctX3FWm0zLqbLaZR8=; b=HystVigNwo3BSrVdH16riAwbiTVAAf/hQHIpFUVi5ZYSXlV6sqVqhKAwh3N1I4UTAT l8Jmgu5M4jHcSwgZ1HOzp4kxAFiLYu81FHhYU7zZlvF6dJTwVHSTOyQZBJRhY6xUDoQu EleILOm9aeT0WEyNLBIeSVeVHh7dfnDVk1meP3BpOWWqX29w/MKo30rxxAYNC91mFrL6 HqF9Ujqta4m9LRiBtROQUODXhRZz8SPVkPlvCGZYDwdDIxkkrIZcT8vvdgHKf6n32B0B PJY0BO1g7dIcaavRUG29kL2kzxctO2DjbQ/WqhtbbciYo1dyKkNf+mnt+p0wRQH8r9/6 kT4Q== X-Gm-Message-State: AOAM5323+JGnmUkleGmKsFtWpp9t8U0/V8SxKohjQKmcTRq0+F2ANua1 T1b4xW02a5aJmVcIwkgkqCgLyOY39oQRaw== X-Google-Smtp-Source: ABdhPJzLw7VYBko0GhT3rIMgrfZ0Y3mgq1Mq8DHKrepJtbWlhE0PmvSj+QzqKYdkG9b2zqR2MWYB7Q== X-Received: by 2002:a1c:6a11:: with SMTP id f17mr1977752wmc.24.1604706673831; Fri, 06 Nov 2020 15:51:13 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PATCH 2/2] hw/m68k/q800.c: Make the GLUE chip an actual QOM device Date: Fri, 6 Nov 2020 23:51:09 +0000 Message-Id: <20201106235109.7066-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201106235109.7066-1-peter.maydell@linaro.org> References: <20201106235109.7066-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::344; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x344.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @linaro.org) Content-Type: text/plain; charset="utf-8" The handling of the GLUE (General Logic Unit) device is currently open-coded. Make this into a proper QOM device. This minor piece of modernisation gets rid of the free floating qemu_irq array 'pic', which Coverity points out is technically leaked when we exit the machine init function. (The replacement glue device is not leaked because it gets added to the sysbus, so it's accessible via that.) Fixes: Coverity CID 1421883 Signed-off-by: Peter Maydell Reviewed-by: Laurent vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- hw/m68k/q800.c | 82 ++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 12 deletions(-) diff --git a/hw/m68k/q800.c b/hw/m68k/q800.c index dc13007aaf2..05bb372f958 100644 --- a/hw/m68k/q800.c +++ b/hw/m68k/q800.c @@ -47,6 +47,7 @@ #include "sysemu/qtest.h" #include "sysemu/runstate.h" #include "sysemu/reset.h" +#include "migration/vmstate.h" =20 #define MACROM_ADDR 0x40800000 #define MACROM_SIZE 0x00100000 @@ -94,10 +95,14 @@ * CPU. */ =20 -typedef struct { +#define TYPE_GLUE "q800-glue" +OBJECT_DECLARE_SIMPLE_TYPE(GLUEState, GLUE) + +struct GLUEState { + SysBusDevice parent_obj; M68kCPU *cpu; uint8_t ipr; -} GLUEState; +}; =20 static void GLUE_set_irq(void *opaque, int irq, int level) { @@ -119,6 +124,58 @@ static void GLUE_set_irq(void *opaque, int irq, int le= vel) m68k_set_irq_level(s->cpu, 0, 0); } =20 +static void glue_reset(DeviceState *dev) +{ + GLUEState *s =3D GLUE(dev); + + s->ipr =3D 0; +} + +static const VMStateDescription vmstate_glue =3D { + .name =3D "q800-glue", + .version_id =3D 0, + .minimum_version_id =3D 0, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(ipr, GLUEState), + VMSTATE_END_OF_LIST(), + }, +}; + +/* + * If the m68k CPU implemented its inbound irq lines as GPIO lines + * rather than via the m68k_set_irq_level() function we would not need + * this cpu link property and could instead provide outbound IRQ lines + * that the board could wire up to the CPU. + */ +static Property glue_properties[] =3D { + DEFINE_PROP_LINK("cpu", GLUEState, cpu, TYPE_M68K_CPU, M68kCPU *), + DEFINE_PROP_END_OF_LIST(), +}; + +static void glue_init(Object *obj) +{ + DeviceState *dev =3D DEVICE(obj); + + qdev_init_gpio_in(dev, GLUE_set_irq, 8); +} + +static void glue_class_init(ObjectClass *klass, void *data) +{ + DeviceClass *dc =3D DEVICE_CLASS(klass); + + dc->vmsd =3D &vmstate_glue; + dc->reset =3D glue_reset; + device_class_set_props(dc, glue_properties); +} + +static const TypeInfo glue_info =3D { + .name =3D TYPE_GLUE, + .parent =3D TYPE_SYS_BUS_DEVICE, + .instance_size =3D sizeof(GLUEState), + .instance_init =3D glue_init, + .class_init =3D glue_class_init, +}; + static void main_cpu_reset(void *opaque) { M68kCPU *cpu =3D opaque; @@ -178,8 +235,7 @@ static void q800_init(MachineState *machine) SysBusDevice *sysbus; BusState *adb_bus; NubusBus *nubus; - GLUEState *irq; - qemu_irq *pic; + DeviceState *glue; DriveInfo *dinfo; =20 linux_boot =3D (kernel_filename !=3D NULL); @@ -213,10 +269,9 @@ static void q800_init(MachineState *machine) } =20 /* IRQ Glue */ - - irq =3D g_new0(GLUEState, 1); - irq->cpu =3D cpu; - pic =3D qemu_allocate_irqs(GLUE_set_irq, irq, 8); + glue =3D qdev_new(TYPE_GLUE); + object_property_set_link(OBJECT(glue), "cpu", OBJECT(cpu), &error_abor= t); + sysbus_realize_and_unref(SYS_BUS_DEVICE(glue), &error_fatal); =20 /* VIA */ =20 @@ -228,8 +283,10 @@ static void q800_init(MachineState *machine) sysbus =3D SYS_BUS_DEVICE(via_dev); sysbus_realize_and_unref(sysbus, &error_fatal); sysbus_mmio_map(sysbus, 0, VIA_BASE); - qdev_connect_gpio_out_named(DEVICE(sysbus), "irq", 0, pic[0]); - qdev_connect_gpio_out_named(DEVICE(sysbus), "irq", 1, pic[1]); + qdev_connect_gpio_out_named(DEVICE(sysbus), "irq", 0, + qdev_get_gpio_in(glue, 0)); + qdev_connect_gpio_out_named(DEVICE(sysbus), "irq", 1, + qdev_get_gpio_in(glue, 1)); =20 =20 adb_bus =3D qdev_get_child_bus(via_dev, "adb.0"); @@ -270,7 +327,7 @@ static void q800_init(MachineState *machine) sysbus_realize_and_unref(sysbus, &error_fatal); sysbus_mmio_map(sysbus, 0, SONIC_BASE); sysbus_mmio_map(sysbus, 1, SONIC_PROM_BASE); - sysbus_connect_irq(sysbus, 0, pic[2]); + sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(glue, 2)); =20 /* SCC */ =20 @@ -292,7 +349,7 @@ static void q800_init(MachineState *machine) qdev_realize_and_unref(escc_orgate, NULL, &error_fatal); sysbus_connect_irq(sysbus, 0, qdev_get_gpio_in(escc_orgate, 0)); sysbus_connect_irq(sysbus, 1, qdev_get_gpio_in(escc_orgate, 1)); - qdev_connect_gpio_out(DEVICE(escc_orgate), 0, pic[3]); + qdev_connect_gpio_out(DEVICE(escc_orgate), 0, qdev_get_gpio_in(glue, 3= )); sysbus_mmio_map(sysbus, 0, SCC_BASE); =20 /* SCSI */ @@ -457,6 +514,7 @@ static const TypeInfo q800_machine_typeinfo =3D { static void q800_machine_register_types(void) { type_register_static(&q800_machine_typeinfo); + type_register_static(&glue_info); } =20 type_init(q800_machine_register_types) --=20 2.20.1