From nobody Mon Feb 9 07:31:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1597767796; cv=none; d=zohomail.com; s=zohoarc; b=AW4LcTM3pFJG2huNQP1dS2irxM4dbHlNWYklSJNsaJ8FWnkxPLunEDATBfd51oSsm6rrv6LZuE7ITmLwy2dIqdEvdMYHGIWqMofaihF0ezG5bBIy62owaDusUKw4nIqIEPZAiANPJVyiBZveq83qW4vLdAZdyCc9FwOBiKsELik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597767796; h=Content-Type: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=G/uCLWaQ9/GC6p92u4AC2/fMAZX9rQveSBzhpBtS05w=; b=UMRvEpIZgA+aDlp0hsIrGk2gGtUFnxYH4KOFgIBq4ut+DJDxu+ncwKKAMNoJ/wUp6HBccIHZ3CpfeS9WmNl9Dh+o79uqAVs8Ax4aqOULv1O5U4u1xWjvzI90Sf/uM88E+97lEI3l7000vQTGeN2vcVeSdN8JC8z7ED1NnT3cfOw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 159776779642737.61288545363186; Tue, 18 Aug 2020 09:23:16 -0700 (PDT) Received: from localhost ([::1]:34826 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k83Ye-0006gT-7u for importer@patchew.org; Tue, 18 Aug 2020 11:29:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40650) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k82l0-0006h6-Ng; Tue, 18 Aug 2020 10:38:34 -0400 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:37226) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k82ky-0002z5-V1; Tue, 18 Aug 2020 10:38:34 -0400 Received: by mail-wm1-x343.google.com with SMTP id k8so17248198wma.2; Tue, 18 Aug 2020 07:38:32 -0700 (PDT) Received: from localhost.localdomain (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id z8sm139177wmf.42.2020.08.18.07.38.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 07:38:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G/uCLWaQ9/GC6p92u4AC2/fMAZX9rQveSBzhpBtS05w=; b=VpCm3KD8qjtSjgc0szFsLzm2liuitP2rGzNRyHCDmQMvvBjHOq98rif2bpQI377kRt 6WxnFngKIFULlLXjkr05raic3JBRI2RXFI/J5C/jAWLmNu38aQEb5dLczfAmTOFqmt9s d1DNRgGgyaeROUhoN8/CXSzUoGAqhxijh/1nKa+NzjB3hiUr5D63JG8JM7WfyalZIYbF AmhaByNf6BiznD99ISkxmexhCBumANSsCsucJJyHqJHDr2H93kv0G+LdNKON2Bp4cO9s nDcMqqsNFbeVgfxsCGON09bXnSlQ/KF0aa0cTH+dkABNr4epW2sABCg8fHg0qTjbS2Yn eMlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=G/uCLWaQ9/GC6p92u4AC2/fMAZX9rQveSBzhpBtS05w=; b=Wi0g54HVMhNVoD/7vvNmpv1cHJX3usJ+ZqDf2lU/iRfT8O880F1jXIGWH7B6AodjAd taekXWMZF7QcptXsTDHeTxcZ971GSlP/FlmBz4UiWYwA9b8Xj33AyKR4b/7JUWQbLqVm n2X6V5OXba4chgvpIMCUzkv5uWphYRZKNqfYCDPKXHLS35WU8tMGE0J9cqwKP75Z6kjY 1zWqRygcBJTmNk4CTat6TsqNWqrR3xaSBjMeYM/oz1RJykGcQiWC6kUsgnAebFRHirrT L/KoqqP4/lRJbj374jU091UoYetYRW/WkE5AvCR6fyhxiAMsYm+2b0ybCWkjijZIXLq+ Ut2w== X-Gm-Message-State: AOAM531adJnnCk//5Y6xAp2CnjW+E9T2G5lAe7ajBAtnx+kEXdCXn+/q abXhuwUaiXZmLJbHnb/oRq6A4Ioc8RA= X-Google-Smtp-Source: ABdhPJxBdZMHsQ13wn4Jn4/vvkn9clMjwCUoscXSZQhed/ngWCJJ1shX8Y4YY5mUcoNpkpBa6BsNOA== X-Received: by 2002:a1c:f416:: with SMTP id z22mr250551wma.62.1597761509689; Tue, 18 Aug 2020 07:38:29 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 1/2] hw/core/qdev: Make qdev_pass_gpios() arguments self-describing Date: Tue, 18 Aug 2020 16:38:24 +0200 Message-Id: <20200818143825.691110-2-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818143825.691110-1-f4bug@amsat.org> References: <20200818143825.691110-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" 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::343; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x343.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: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Make the direction qdev_pass_gpios() pass the GPIOs more obvious by renaming its arguments as 'from_dev' and 'to_container'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/qdev-core.h | 10 +++++----- hw/core/qdev.c | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index ea3f73a282d..c72d4db2d26 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -643,8 +643,8 @@ static inline void qdev_init_gpio_in_named(DeviceState = *dev, =20 /** * qdev_pass_gpios: create GPIO lines on container which pass through to d= evice - * @dev: Device which has GPIO lines - * @container: Container device which needs to expose them + * @from_dev: Device which has GPIO lines + * @to_container: Container device which needs to expose them * @name: Name of GPIO array to pass through (NULL for the anonymous GPIO = array) * * In QEMU, complicated devices like SoCs are often modelled with a @@ -653,14 +653,14 @@ static inline void qdev_init_gpio_in_named(DeviceStat= e *dev, * to create GPIO arrays on itself which simply pass through to a GPIO * array of one of its internal devices. * - * If @dev has both input and output GPIOs named @name then both will + * If @from_dev has both input and output GPIOs named @name then both will * be passed through. It is not possible to pass a subset of the array * with this function. * - * To users of the container device, the GPIO array created on @container + * To users of the container device, the GPIO array created on @to_contain= er * behaves exactly like any other. */ -void qdev_pass_gpios(DeviceState *dev, DeviceState *container, +void qdev_pass_gpios(DeviceState *from_dev, DeviceState *to_container, const char *name); =20 BusState *qdev_get_parent_bus(DeviceState *dev); diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 96772a15bd5..79cbd990114 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -576,30 +576,30 @@ void qdev_connect_gpio_out(DeviceState * dev, int n, = qemu_irq pin) qdev_connect_gpio_out_named(dev, NULL, n, pin); } =20 -void qdev_pass_gpios(DeviceState *dev, DeviceState *container, +void qdev_pass_gpios(DeviceState *from_dev, DeviceState *to_container, const char *name) { int i; - NamedGPIOList *ngl =3D qdev_get_named_gpio_list(dev, name); + NamedGPIOList *ngl =3D qdev_get_named_gpio_list(from_dev, name); =20 for (i =3D 0; i < ngl->num_in; i++) { const char *nm =3D ngl->name ? ngl->name : "unnamed-gpio-in"; char *propname =3D g_strdup_printf("%s[%d]", nm, i); =20 - object_property_add_alias(OBJECT(container), propname, - OBJECT(dev), propname); + object_property_add_alias(OBJECT(to_container), propname, + OBJECT(from_dev), propname); g_free(propname); } for (i =3D 0; i < ngl->num_out; i++) { const char *nm =3D ngl->name ? ngl->name : "unnamed-gpio-out"; char *propname =3D g_strdup_printf("%s[%d]", nm, i); =20 - object_property_add_alias(OBJECT(container), propname, - OBJECT(dev), propname); + object_property_add_alias(OBJECT(to_container), propname, + OBJECT(from_dev), propname); g_free(propname); } QLIST_REMOVE(ngl, node); - QLIST_INSERT_HEAD(&container->gpios, ngl, node); + QLIST_INSERT_HEAD(&to_container->gpios, ngl, node); } =20 BusState *qdev_get_child_bus(DeviceState *dev, const char *name) --=20 2.26.2 From nobody Mon Feb 9 07:31:41 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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 ARC-Seal: i=1; a=rsa-sha256; t=1597765665; cv=none; d=zohomail.com; s=zohoarc; b=YDqjUm1t5ofGkL5MQuZ8sbHCGVEtgF7I2qyfeBf5uhjM+QwFZAfmCAEeXWiWmFGu1JVABHFXh/WKOZZ+THHDUGyblRhAVteetUvBj6/FGq3yVy7jF6ufyhMvkv+ZhAcT2QXoSfJginF/oL253CvZyhHM7feSlvminJGN0pJt4zo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1597765665; h=Content-Type: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=HBZVH8DbVP87G8OaAytsCzNyqaW3XTQSsMrdJGsu7lU=; b=ZRZ3jwHVtoEsRl2ptW+MDibuQsJ4E2H8flPU1E+8DUoRs2Mtquxx5EuLZfmuRo+MSy9nDQHsfhHkDCrO8poWP33DPkULCiH1IItj4cB8VZKBaMRziZHVQYk4/eueJpue0XtbtwZY/H3KrEI+SJY9ivb9HQNa3QVDT5w241GXz3Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1597765665248381.3561609818763; Tue, 18 Aug 2020 08:47:45 -0700 (PDT) Received: from localhost ([::1]:43714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k83pv-000145-OK for importer@patchew.org; Tue, 18 Aug 2020 11:47:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40652) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k82l0-0006hR-Ra; Tue, 18 Aug 2020 10:38:34 -0400 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:35158) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k82kz-0002z7-4W; Tue, 18 Aug 2020 10:38:34 -0400 Received: by mail-wm1-x344.google.com with SMTP id 184so17254393wmb.0; Tue, 18 Aug 2020 07:38:32 -0700 (PDT) Received: from localhost.localdomain (121.red-81-40-121.staticip.rima-tde.net. [81.40.121.121]) by smtp.gmail.com with ESMTPSA id z8sm139177wmf.42.2020.08.18.07.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Aug 2020 07:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=HBZVH8DbVP87G8OaAytsCzNyqaW3XTQSsMrdJGsu7lU=; b=DAG1SOSgzbawLFIyLqQg+HKeKRdOSXKBIsnafrvB5VE82XeY1NItAkJ07Db8Wd72xX 8KHbBHMYAepStJUVH1AeAgu20ULsvWl8Jg4pj2vmlzIDsH/QqxlqHm/xqj1unu2Yz6sS c9cT+HHq2DdOXNe3vhrGgY727CsPe2qXgZgiigibSDPHS0LxiwSlMiOaNqNKr/IeOY57 Q8rbvNGWTub4diRI3oKJ2HAx39FA5LFGqifAQjvGG1Xqy6bMSr57OB7O4zEE6A4Oi29a CGkikf8OxYLhKWm6puKoiiGTp9Ch1VNPQCAKVJtRN8swgTOkzM8q+30uMNjf8nyNzuOp aUJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=HBZVH8DbVP87G8OaAytsCzNyqaW3XTQSsMrdJGsu7lU=; b=gxcdXkpW2DVQbV30fEachprr/eaDWG00cxG3ualsZ78Hjdw28qpmCB2lpDqOgAnk5+ +jgNtT494CnLQ/wFKtyrfpXGn7F73W6hIwY/BiSxw3fqW1ahUZOIJF+6uHROdMGPPAjV XzaQ4a8QihTQTmgIbGsPEOZ3dAFWuqRGCoem0Kb6Brho/YEf3ZwqNS+0Tz71B6tGXLA3 UfHRtvEvaTMkQPTZcpYAR9sERRKVAXMuAs422IBSXF+nzLJFBRnE5pKfYMFw5fgPp05F XHXOFMThupis66PlFwqH4EVslK6EnX2KFraJZ/hdPmL2SUnw3bDl4qBWkwsbWlHbqhTQ E9jQ== X-Gm-Message-State: AOAM533ivht/dUYmK6pVrAS/Zxv75rdqpdIV5aXe0OAj7bXrDd3g6y5N 9jIPPWzzTPCiOR0kuA3l20B9smVlNBU= X-Google-Smtp-Source: ABdhPJzeATk3WZykFmKe/Kx+k1ecCKzD6QnmiAlprd2fKDp2brjhbVf69J6rHzTFJzQVDBO3GwP9kA== X-Received: by 2002:a1c:b787:: with SMTP id h129mr220955wmf.93.1597761510886; Tue, 18 Aug 2020 07:38:30 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [PATCH 2/2] hw/core/sysbus: Make sysbus_pass_irq() arguments self-describing Date: Tue, 18 Aug 2020 16:38:25 +0200 Message-Id: <20200818143825.691110-3-f4bug@amsat.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200818143825.691110-1-f4bug@amsat.org> References: <20200818143825.691110-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Type: text/plain; charset="utf-8" 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=philippe.mathieu.daude@gmail.com; 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: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Peter Maydell , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , qemu-trivial@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Make the direction sysbus_pass_irq() pass the GPIOs more obvious by renaming its arguments as 'from_dev' and 'to_dev'. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/sysbus.h | 7 ++++++- hw/core/sysbus.c | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index da9f85c58ce..65de6f6b062 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -73,7 +73,12 @@ typedef void FindSysbusDeviceFunc(SysBusDevice *sbdev, v= oid *opaque); void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory); MemoryRegion *sysbus_mmio_get_region(SysBusDevice *dev, int n); void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p); -void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target); +/** + * sysbus_pass_irq: Pass through IRQ/GPIO lines from one to another device + * @to_dev: Device which needs to expose IRQ/GPIO lines + * @from_dev: Device which has the IRQ/GPIO lines + */ +void sysbus_pass_irq(SysBusDevice *to_dev, SysBusDevice *from_dev); void sysbus_init_ioports(SysBusDevice *dev, uint32_t ioport, uint32_t size= ); =20 =20 diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 70239b7e7d0..bc23a66b5c5 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -181,10 +181,9 @@ void sysbus_init_irq(SysBusDevice *dev, qemu_irq *p) qdev_init_gpio_out_named(DEVICE(dev), p, SYSBUS_DEVICE_GPIO_IRQ, 1); } =20 -/* Pass IRQs from a target device. */ -void sysbus_pass_irq(SysBusDevice *dev, SysBusDevice *target) +void sysbus_pass_irq(SysBusDevice *to_dev, SysBusDevice *from_dev) { - qdev_pass_gpios(DEVICE(target), DEVICE(dev), SYSBUS_DEVICE_GPIO_IRQ); + qdev_pass_gpios(DEVICE(from_dev), DEVICE(to_dev), SYSBUS_DEVICE_GPIO_I= RQ); } =20 void sysbus_init_mmio(SysBusDevice *dev, MemoryRegion *memory) --=20 2.26.2