[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 14/46] hw/misc/mips_itu: Make MIPSITUState target agnostic
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 14/46] hw/misc/mips_itu: Make MIPSITUState target agnostic |
Date: |
Thu, 19 Oct 2023 23:17:39 +0200 |
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>
---
include/hw/misc/mips_itu.h | 2 +-
hw/misc/mips_itu.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/hw/misc/mips_itu.h b/include/hw/misc/mips_itu.h
index a413789151..5caed6cc36 100644
--- a/include/hw/misc/mips_itu.h
+++ b/include/hw/misc/mips_itu.h
@@ -73,7 +73,7 @@ struct MIPSITUState {
/* SAAR */
uint64_t *saar;
- MIPSCPU *cpu0;
+ ArchCPU *cpu0;
};
/* Get ITC Configuration Tag memory region. */
diff --git a/hw/misc/mips_itu.c b/hw/misc/mips_itu.c
index 0eda302db4..5a83ccc4e8 100644
--- a/hw/misc/mips_itu.c
+++ b/hw/misc/mips_itu.c
@@ -532,7 +532,7 @@ static void mips_itu_realize(DeviceState *dev, Error **errp)
return;
}
- env = &s->cpu0->env;
+ env = &MIPS_CPU(s->cpu0)->env;
if (env->saarp) {
s->saar = env->CP0_SAAR;
}
@@ -563,7 +563,7 @@ static Property mips_itu_properties[] = {
ITC_FIFO_NUM_MAX),
DEFINE_PROP_UINT32("num-semaphores", MIPSITUState, num_semaphores,
ITC_SEMAPH_NUM_MAX),
- DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, MIPSCPU *),
+ DEFINE_PROP_LINK("cpu[0]", MIPSITUState, cpu0, TYPE_MIPS_CPU, ArchCPU *),
DEFINE_PROP_END_OF_LIST(),
};
--
2.41.0
- [PULL 04/46] MAINTAINERS: Add include/hw/intc/loongson_liointc.h to the Loongson-3 virt section, (continued)
- [PULL 04/46] MAINTAINERS: Add include/hw/intc/loongson_liointc.h to the Loongson-3 virt section, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 05/46] MAINTAINERS: Add include/hw/openrisc/ to the OpenRISC section, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 06/46] cutils: Fix get_relocated_path on Windows, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 07/46] buildsys: Only display Objective-C information when Objective-C is used, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 08/46] memory: drop needless argument, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 09/46] memory: follow Error API guidelines, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 10/46] hw/sd/sdhci: Block Size Register bits [14:12] is lost, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 11/46] hw/mips/malta: Use sdram_type enum from 'hw/i2c/smbus_eeprom.h', Philippe Mathieu-Daudé, 2023/10/19
- [PULL 12/46] hw/mips: Merge 'hw/mips/cpudevs.h' with 'target/mips/cpu.h', Philippe Mathieu-Daudé, 2023/10/19
- [PULL 13/46] hw/misc/mips_itu: Declare itc_reconfigure() in 'hw/misc/mips_itu.h', Philippe Mathieu-Daudé, 2023/10/19
- [PULL 14/46] hw/misc/mips_itu: Make MIPSITUState target agnostic,
Philippe Mathieu-Daudé <=
- [PULL 15/46] hw/pci-host/sh_pcic: Declare CPU QOM types using DEFINE_TYPES() macro, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 16/46] hw/pci-host/sh_pcic: Correct PCI host / devfn#0 function names, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 17/46] hw/pci-host/sh_pcic: Replace magic value by proper definition, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 18/46] hw/sparc64/ebus: Access memory regions via pci_address_space_io(), Philippe Mathieu-Daudé, 2023/10/19
- [PULL 19/46] hw/acpi/pcihp: Clean up global variable shadowing in acpi_pcihp_init(), Philippe Mathieu-Daudé, 2023/10/19
- [PULL 20/46] hw/pci: Clean up global variable shadowing of address_space_io variable, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 21/46] hw/s390x: Clean up global variable shadowing in quiesce_powerdown_req(), Philippe Mathieu-Daudé, 2023/10/19
- [PULL 22/46] hw/intc/apic: Use ERRP_GUARD() in apic_common_realize(), Philippe Mathieu-Daudé, 2023/10/19
- [PULL 23/46] hw/ppc/spapr_vio: Realize SPAPR_VIO_BRIDGE device before accessing it, Philippe Mathieu-Daudé, 2023/10/19
- [PULL 24/46] hw/ppc/pnv_xscom: Rename pnv_xscom_realize(Error **) -> pnv_xscom_init(), Philippe Mathieu-Daudé, 2023/10/19