hw/misc/mips_itu: Make MIPSITUState target agnostic
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 18 Sep 2023 05:25:49 +0000 (07:25 +0200)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 20 Oct 2023 12:46:07 +0000 (14:46 +0200)
commit454c1e1dd834b992f4021607f84e85ed9cccb26c
treef956626924b029e79ae55244e688e8e2e900e09c
parent43e61fc8953bc2e40c3549368b2600787fbd53a9
hw/misc/mips_itu: Make MIPSITUState target agnostic

When prototyping a heterogenous machine including the ITU,
we get:

  include/hw/misc/mips_itu.h:76:5: error: unknown type name 'MIPSCPU'
      MIPSCPU *cpu0;
      ^

MIPSCPU is declared in the target specific "cpu.h" header,
but we don't want to include it, because "cpu.h" is target
specific and its inclusion taints all files including
"mips_itu.h", which become target specific too. We can
however use the 'ArchCPU *' type in the public header.
By keeping the TYPE_MIPS_CPU QOM type check in the link
property declaration, QOM core code will still check the
property is a correct MIPS CPU.

TYPE_MIPS_ITU is still built per-(MIPS)target, but its header
can now be included by other targets.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20231009171443.12145-4-philmd@linaro.org>
hw/misc/mips_itu.c
include/hw/misc/mips_itu.h