qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] hw/sysbus: Restrict sysbus_get_connected_irq() to sysbus


From: wangyanan (Y)
Subject: Re: [PATCH 2/3] hw/sysbus: Restrict sysbus_get_connected_irq() to sysbus-internal.h
Date: Fri, 31 Dec 2021 15:34:26 +0800
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0


On 2021/12/30 6:52, Philippe Mathieu-Daudé wrote:
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é <philmd@redhat.com>
---
  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
Reviewed-by: Yanan Wang <wangyanan55@huawei.com>

Thanks,
Yanan
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 ioport, 
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"
/*
   * 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"
static void sysbus_dev_print(Monitor *mon, DeviceState *dev, int indent);
  static char *sysbus_get_fw_dev_path(DeviceState *dev);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]