[PATCH 7/7] hw/xtensa: Build hw models in common source set

Philippe Mathieu-Daudé posted 7 patches 1 month ago
Maintainers: Max Filippov <jcmvbkbc@gmail.com>, Laurent Vivier <laurent@vivier.eu>
[PATCH 7/7] hw/xtensa: Build hw models in common source set
Posted by Philippe Mathieu-Daudé 1 month ago
These files are now free of target-specific symbols,
build them as common files (thus forbidding further
uses of such target-specific symbols).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/xtensa/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xtensa/meson.build b/hw/xtensa/meson.build
index 1d5835df4bf..fec22ef7d2f 100644
--- a/hw/xtensa/meson.build
+++ b/hw/xtensa/meson.build
@@ -8,4 +8,4 @@ xtensa_ss.add(when: 'CONFIG_XTENSA_SIM', if_true: files('sim.c'))
 xtensa_ss.add(when: 'CONFIG_XTENSA_VIRT', if_true: files('virt.c'))
 xtensa_ss.add(when: 'CONFIG_XTENSA_XTFPGA', if_true: files('xtfpga.c'))
 
-hw_arch += {'xtensa': xtensa_ss}
+hw_common_arch += {'xtensa': xtensa_ss}
-- 
2.52.0


Re: [PATCH 7/7] hw/xtensa: Build hw models in common source set
Posted by Anton Johansson via qemu development 3 weeks, 6 days ago
On 07/01/26, Philippe Mathieu-Daudé wrote:
> These files are now free of target-specific symbols,
> build them as common files (thus forbidding further
> uses of such target-specific symbols).
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>  hw/xtensa/meson.build | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/xtensa/meson.build b/hw/xtensa/meson.build
> index 1d5835df4bf..fec22ef7d2f 100644
> --- a/hw/xtensa/meson.build
> +++ b/hw/xtensa/meson.build
> @@ -8,4 +8,4 @@ xtensa_ss.add(when: 'CONFIG_XTENSA_SIM', if_true: files('sim.c'))
>  xtensa_ss.add(when: 'CONFIG_XTENSA_VIRT', if_true: files('virt.c'))
>  xtensa_ss.add(when: 'CONFIG_XTENSA_XTFPGA', if_true: files('xtfpga.c'))
>  
> -hw_arch += {'xtensa': xtensa_ss}
> +hw_common_arch += {'xtensa': xtensa_ss}
> -- 
> 2.52.0
> 

nit about includes, in pic_cpu.c, xtensa_memory.h and xtfpga.c change

  #include "cpu.h" -> "target/xtensa/cpu.h"

and in cpu.h change

  #include "cpu-qom.h" -> "target/xtensa/cpu-qom.h"
  #include "qemu/cpu-float.h"
  #include "exec/cpu-common.h"
  #include "exec/cpu-defs.h"
  #include "exec/cpu-interrupt.h"
  #include "hw/core/clock.h"
  #include "xtensa-isa.h" -> "target/xtensa/xtensa-isa.h" or "hw/.."

About xtensa-isa.h, is there any reason for keeping it in hw/? Why
not move it to target/ and get rid of the single line xtensa-isa.h
file?

Anyway,

Reviewed-by: Anton Johansson <anjo@rev.ng>