[PATCH 20/27] hw/int/loongarch: Include missing 'system/memory.h' header

Philippe Mathieu-Daudé posted 27 patches 2 days, 16 hours ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Igor Mammedov <imammedo@redhat.com>, Ani Sinha <anisinha@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Alistair Francis <alistair@alistair23.me>, Peter Maydell <peter.maydell@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, Richard Henderson <richard.henderson@linaro.org>, Artyom Tarasenko <atar4qemu@gmail.com>, Jason Wang <jasowang@redhat.com>, Michael Rolnik <mrolnik@gmail.com>, Yoshinori Sato <yoshinori.sato@nifty.com>, Magnus Damm <magnus.damm@gmail.com>, Vijai Kumar K <vijai@behindbytes.com>, Palmer Dabbelt <palmer@dabbelt.com>, Helge Deller <deller@gmx.de>, Song Gao <gaosong@loongson.cn>, Bibo Mao <maobibo@loongson.cn>, Jiaxun Yang <jiaxun.yang@flygoat.com>, Huacai Chen <chenhuacai@kernel.org>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Ran Wang <wangran@bosc.ac.cn>, Anup Patel <anup.patel@wdc.com>, Fam Zheng <fam@euphon.net>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Bastian Koppelmann <kbastian@mail.uni-paderborn.de>, Gerd Hoffmann <kraxel@redhat.com>, Jean-Christophe Dubois <jcd@tribudubois.net>
[PATCH 20/27] hw/int/loongarch: Include missing 'system/memory.h' header
Posted by Philippe Mathieu-Daudé 2 days, 16 hours ago
"system/memory.h" header is indirectly pulled by "hw/sysbus.h".
Include it explicitly to avoid when refactoring the latter:

  In file included from ../../hw/intc/loongson_ipi.c:9:
  In file included from /Users/philmd/source/qemu/include/hw/intc/loongson_ipi.h:12:
  include/hw/intc/loongson_ipi_common.h:37:18: error: field has incomplete type 'MemoryRegion' (aka 'struct MemoryRegion')
     37 |     MemoryRegion ipi_iocsr_mem;
        |                  ^

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/hw/intc/loongarch_dintc.h         | 2 +-
 include/hw/intc/loongarch_extioi_common.h | 1 +
 include/hw/intc/loongarch_pch_msi.h       | 1 +
 include/hw/intc/loongarch_pic_common.h    | 1 +
 include/hw/intc/loongson_ipi_common.h     | 2 ++
 5 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/hw/intc/loongarch_dintc.h b/include/hw/intc/loongarch_dintc.h
index 0b0b5347b2c..01bb1e465cb 100644
--- a/include/hw/intc/loongarch_dintc.h
+++ b/include/hw/intc/loongarch_dintc.h
@@ -8,7 +8,7 @@
 #include "qom/object.h"
 #include "hw/sysbus.h"
 #include "hw/loongarch/virt.h"
-
+#include "system/memory.h"
 
 #define NR_VECTORS     256
 
diff --git a/include/hw/intc/loongarch_extioi_common.h b/include/hw/intc/loongarch_extioi_common.h
index c021ccee0fa..1bd2bfa07fc 100644
--- a/include/hw/intc/loongarch_extioi_common.h
+++ b/include/hw/intc/loongarch_extioi_common.h
@@ -10,6 +10,7 @@
 #include "qom/object.h"
 #include "hw/sysbus.h"
 #include "hw/loongarch/virt.h"
+#include "system/memory.h"
 
 #define LS3A_INTC_IP                 8
 #define EXTIOI_IRQS                  (256)
diff --git a/include/hw/intc/loongarch_pch_msi.h b/include/hw/intc/loongarch_pch_msi.h
index b8586fb3b6f..ef4ec4fdeb8 100644
--- a/include/hw/intc/loongarch_pch_msi.h
+++ b/include/hw/intc/loongarch_pch_msi.h
@@ -6,6 +6,7 @@
  */
 
 #include "hw/sysbus.h"
+#include "system/memory.h"
 
 #define TYPE_LOONGARCH_PCH_MSI "loongarch_pch_msi"
 OBJECT_DECLARE_SIMPLE_TYPE(LoongArchPCHMSI, LOONGARCH_PCH_MSI)
diff --git a/include/hw/intc/loongarch_pic_common.h b/include/hw/intc/loongarch_pic_common.h
index 675ba96e64e..179361eb567 100644
--- a/include/hw/intc/loongarch_pic_common.h
+++ b/include/hw/intc/loongarch_pic_common.h
@@ -9,6 +9,7 @@
 
 #include "hw/loongarch/virt.h"
 #include "hw/sysbus.h"
+#include "system/memory.h"
 
 #define PCH_PIC_INT_ID                  0x00
 #define  PCH_PIC_INT_ID_VAL             0x7
diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongson_ipi_common.h
index e58ce2aa1c4..8b51af83e8b 100644
--- a/include/hw/intc/loongson_ipi_common.h
+++ b/include/hw/intc/loongson_ipi_common.h
@@ -11,6 +11,8 @@
 #include "qom/object.h"
 #include "hw/sysbus.h"
 #include "exec/memattrs.h"
+#include "system/memory.h"
+#include "system/memory.h"
 
 #define IPI_MBX_NUM           4
 
-- 
2.51.0


Re: [PATCH 20/27] hw/int/loongarch: Include missing 'system/memory.h' header
Posted by Bibo Mao 8 hours ago

On 2025/10/25 上午3:04, Philippe Mathieu-Daudé wrote:
> "system/memory.h" header is indirectly pulled by "hw/sysbus.h".
> Include it explicitly to avoid when refactoring the latter:
> 
>    In file included from ../../hw/intc/loongson_ipi.c:9:
>    In file included from /Users/philmd/source/qemu/include/hw/intc/loongson_ipi.h:12:
>    include/hw/intc/loongson_ipi_common.h:37:18: error: field has incomplete type 'MemoryRegion' (aka 'struct MemoryRegion')
>       37 |     MemoryRegion ipi_iocsr_mem;
>          |                  ^
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   include/hw/intc/loongarch_dintc.h         | 2 +-
>   include/hw/intc/loongarch_extioi_common.h | 1 +
>   include/hw/intc/loongarch_pch_msi.h       | 1 +
>   include/hw/intc/loongarch_pic_common.h    | 1 +
>   include/hw/intc/loongson_ipi_common.h     | 2 ++
>   5 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/include/hw/intc/loongarch_dintc.h b/include/hw/intc/loongarch_dintc.h
> index 0b0b5347b2c..01bb1e465cb 100644
> --- a/include/hw/intc/loongarch_dintc.h
> +++ b/include/hw/intc/loongarch_dintc.h
> @@ -8,7 +8,7 @@
>   #include "qom/object.h"
>   #include "hw/sysbus.h"
>   #include "hw/loongarch/virt.h"
> -
> +#include "system/memory.h"
>   
>   #define NR_VECTORS     256
>   
> diff --git a/include/hw/intc/loongarch_extioi_common.h b/include/hw/intc/loongarch_extioi_common.h
> index c021ccee0fa..1bd2bfa07fc 100644
> --- a/include/hw/intc/loongarch_extioi_common.h
> +++ b/include/hw/intc/loongarch_extioi_common.h
> @@ -10,6 +10,7 @@
>   #include "qom/object.h"
>   #include "hw/sysbus.h"
>   #include "hw/loongarch/virt.h"
> +#include "system/memory.h"
>   
>   #define LS3A_INTC_IP                 8
>   #define EXTIOI_IRQS                  (256)
> diff --git a/include/hw/intc/loongarch_pch_msi.h b/include/hw/intc/loongarch_pch_msi.h
> index b8586fb3b6f..ef4ec4fdeb8 100644
> --- a/include/hw/intc/loongarch_pch_msi.h
> +++ b/include/hw/intc/loongarch_pch_msi.h
> @@ -6,6 +6,7 @@
>    */
>   
>   #include "hw/sysbus.h"
> +#include "system/memory.h"
>   
>   #define TYPE_LOONGARCH_PCH_MSI "loongarch_pch_msi"
>   OBJECT_DECLARE_SIMPLE_TYPE(LoongArchPCHMSI, LOONGARCH_PCH_MSI)
> diff --git a/include/hw/intc/loongarch_pic_common.h b/include/hw/intc/loongarch_pic_common.h
> index 675ba96e64e..179361eb567 100644
> --- a/include/hw/intc/loongarch_pic_common.h
> +++ b/include/hw/intc/loongarch_pic_common.h
> @@ -9,6 +9,7 @@
>   
>   #include "hw/loongarch/virt.h"
>   #include "hw/sysbus.h"
> +#include "system/memory.h"
>   
>   #define PCH_PIC_INT_ID                  0x00
>   #define  PCH_PIC_INT_ID_VAL             0x7
> diff --git a/include/hw/intc/loongson_ipi_common.h b/include/hw/intc/loongson_ipi_common.h
> index e58ce2aa1c4..8b51af83e8b 100644
> --- a/include/hw/intc/loongson_ipi_common.h
> +++ b/include/hw/intc/loongson_ipi_common.h
> @@ -11,6 +11,8 @@
>   #include "qom/object.h"
>   #include "hw/sysbus.h"
>   #include "exec/memattrs.h"
> +#include "system/memory.h"
> +#include "system/memory.h"
one small nit for duplicated including here :)

Otherwise
Reviewed-by: Bibo Mao <maobibo@loongson.cn>
>   
>   #define IPI_MBX_NUM           4
>   
>