From nobody Mon Feb 9 17:36:59 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1640818341; cv=none; d=zohomail.com; s=zohoarc; b=dKVpc91G1CTBQENChjmzDHv3KjCHXKy+a/C0zi0Is6QTw2vItmQdGWYUqQY6cl5WuW90HGfu92e85B5AB8L+pgy21Tti1DAHx/kURvDJx7Gif+r5IBuLttRBEgfbb/W78tCX4dCEWr2dlLPjOYyg0QxcQLLA+pT136+kSLiXhUc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1640818341; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=QoRpcBVSaExXmb7fG4VqILyo3dvxz3orNpgQdbWBHqE=; b=JBEP+AbLnLWHU5WunXFdhiEOMdi8pXhxSOsQCjj1NDdMrShHmd2OJd2W/NK82wKHM337K9t4KWIbpuh8cidsziZhc/l1CKPdRKEJVgaAOPODyooay4khBn/ItW9MaS7VpJo05sHQBvdAwqoToP3ZvevFKSSkmmTxlEc0sgWdaNc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1640818341835586.8806968892585; Wed, 29 Dec 2021 14:52:21 -0800 (PST) Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-558-_WCHzHugMxSxPL5CQggSLw-1; Wed, 29 Dec 2021 17:52:20 -0500 Received: by mail-wm1-f69.google.com with SMTP id j11-20020a05600c410b00b00345812649ddso1327256wmi.8 for ; Wed, 29 Dec 2021 14:52:19 -0800 (PST) Return-Path: Return-Path: Received: from x1w.. (26.red-83-50-86.dynamicip.rima-tde.net. [83.50.86.26]) by smtp.gmail.com with ESMTPSA id n9sm27898232wmq.37.2021.12.29.14.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Dec 2021 14:52:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1640818341; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QoRpcBVSaExXmb7fG4VqILyo3dvxz3orNpgQdbWBHqE=; b=QsVde0gxvY3GqRT4LVklU1XYFA9Kgxe8to/N7F0ZO6STQu04kM8nptx9WOMAO56bSTan3i FO53nSpzwZWHeTMsjr8U5eM6J6/YffvgWlAhFD2sYlx8GG8vX1plcaSej4JzFKU1uQ19qD s3bMRXbYZcCt9sc1tVkYXtk/3MKoe0A= X-MC-Unique: _WCHzHugMxSxPL5CQggSLw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QoRpcBVSaExXmb7fG4VqILyo3dvxz3orNpgQdbWBHqE=; b=Bbzh3WGKLbDrLw/244dE7Vf02YvZgWDld6A8xLOrwrKsZZVj20iVuk6dv6folRPzz0 xgwiAv1dqH6tiZFFyhCPxQqieEmuvQaIlwiP+nL4InaqIizhuSt+FPCy9OkSVM2f0bjh lpGY4sEAXQkmQEoJ7uiNHuT/27/yDybx/QsMHeu/Uj8i+YOTCstJx004Lx21F5ENb45h BvyegudQGYGASjZkyRIuiRmC5WboiAGsPD3CaCurcpIpfwFNv1CxEofWb1h9KpJT6Gd4 bQl4fUijDkiR+nMppSvZ31cnhcKy1rPveJOZD7acjVKsw3i8cVAsm6oZs6B9Xu9L98JD PdYQ== X-Gm-Message-State: AOAM531kZyXIi6jplOlNpuIlLQWtrO0561U8z03jWohMHZHMEfMT09Uh R/qHbEdzAjKtMfcNqGbvNVqop9oeVdB9sZx07jdKJnQOzR8vDIDgP3BVLBlr3NcP4d84xreTI5/ qiooyrl9mc0YEog== X-Received: by 2002:a05:600c:204d:: with SMTP id p13mr24293395wmg.102.1640818338846; Wed, 29 Dec 2021 14:52:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPE5b8DuLYePT6Y64gnwlRrsxQC6MembPp94mt7rHfJzJ5kIt/jQTJNtbRZIKLfHzQvWr+qg== X-Received: by 2002:a05:600c:204d:: with SMTP id p13mr24293379wmg.102.1640818338702; Wed, 29 Dec 2021 14:52:18 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yanan Wang , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Eduardo Habkost , Peter Maydell , Richard Henderson , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/3] hw/sysbus: Restrict sysbus_get_connected_irq() to sysbus-internal.h Date: Wed, 29 Dec 2021 23:52:05 +0100 Message-Id: <20211229225206.171882-3-philmd@redhat.com> X-Mailer: git-send-email 2.33.1 In-Reply-To: <20211229225206.171882-1-philmd@redhat.com> References: <20211229225206.171882-1-philmd@redhat.com> MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1640818342128000001 sysbus_get_connected_irq() and sysbus_is_irq_connected() are only used by platform-bus.c; restrict them to hw/core/ by adding a local "sysbus-internal.h" header. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Yanan Wang --- hw/core/sysbus-internal.h | 16 ++++++++++++++++ include/hw/sysbus.h | 2 -- hw/core/platform-bus.c | 2 +- hw/core/sysbus.c | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 hw/core/sysbus-internal.h diff --git a/hw/core/sysbus-internal.h b/hw/core/sysbus-internal.h new file mode 100644 index 00000000000..991b3e3159c --- /dev/null +++ b/hw/core/sysbus-internal.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +/* + * SysBus internal helpers + * + * Copyright (c) 2021 QEMU contributors + */ +#ifndef HW_CORE_SYSBUS_INTERNAL_H +#define HW_CORE_SYSBUS_INTERNAL_H + +#include "hw/sysbus.h" + +/* Following functions are only used by the platform-bus subsystem */ +qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n); +bool sysbus_is_irq_connected(SysBusDevice *dev, int n); + +#endif /* HW_CORE_SYSBUS_INTERNAL_H */ diff --git a/include/hw/sysbus.h b/include/hw/sysbus.h index 3564b7b6a22..24645ee7996 100644 --- a/include/hw/sysbus.h +++ b/include/hw/sysbus.h @@ -77,8 +77,6 @@ void sysbus_init_ioports(SysBusDevice *dev, uint32_t iopo= rt, uint32_t size); bool sysbus_has_irq(SysBusDevice *dev, int n); bool sysbus_has_mmio(SysBusDevice *dev, unsigned int n); void sysbus_connect_irq(SysBusDevice *dev, int n, qemu_irq irq); -bool sysbus_is_irq_connected(SysBusDevice *dev, int n); -qemu_irq sysbus_get_connected_irq(SysBusDevice *dev, int n); void sysbus_mmio_map(SysBusDevice *dev, int n, hwaddr addr); void sysbus_mmio_map_overlap(SysBusDevice *dev, int n, hwaddr addr, int priority); diff --git a/hw/core/platform-bus.c b/hw/core/platform-bus.c index b8487b26b67..016fb71eba1 100644 --- a/hw/core/platform-bus.c +++ b/hw/core/platform-bus.c @@ -25,7 +25,7 @@ #include "qapi/error.h" #include "qemu/error-report.h" #include "qemu/module.h" - +#include "sysbus-internal.h" =20 /* * Returns the PlatformBus IRQ number for a SysBusDevice irq number or -1 = if diff --git a/hw/core/sysbus.c b/hw/core/sysbus.c index 0e6773c8df7..dcd7beda184 100644 --- a/hw/core/sysbus.c +++ b/hw/core/sysbus.c @@ -24,6 +24,7 @@ #include "monitor/monitor.h" #include "exec/address-spaces.h" #include "qdev-internal.h" +#include "sysbus-internal.h" =20 static void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *sysbus_get_fw_dev_path(DeviceState *dev); --=20 2.33.1