[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/19] cpus: Filter for target specific CPU (loongarch)
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 04/19] cpus: Filter for target specific CPU (loongarch) |
Date: |
Fri, 20 Oct 2023 18:36:26 +0200 |
Enforce qemu_get_cpu() to return LoongArch CPUs in LoongArch
specific files.
Mechanical change using the following coccinelle script:
@@ expression index; @@
- qemu_get_cpu(index, NULL)
+ qemu_get_cpu(index, TYPE_LOONGARCH_CPU)
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/loongarch/virt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/hw/loongarch/virt.c b/hw/loongarch/virt.c
index 902e32a3e3..83ca7d6b98 100644
--- a/hw/loongarch/virt.c
+++ b/hw/loongarch/virt.c
@@ -560,7 +560,7 @@ static void loongarch_irq_init(LoongArchMachineState *lams)
* +--------+ +---------+ +---------+
*/
for (cpu = 0; cpu < ms->smp.cpus; cpu++) {
- cpu_state = qemu_get_cpu(cpu, NULL);
+ cpu_state = qemu_get_cpu(cpu, TYPE_LOONGARCH_CPU);
cpudev = DEVICE(cpu_state);
lacpu = LOONGARCH_CPU(cpu_state);
env = &(lacpu->env);
@@ -594,7 +594,7 @@ static void loongarch_irq_init(LoongArchMachineState *lams)
* cpu_pin[9:2] <= intc_pin[7:0]
*/
for (cpu = 0; cpu < MIN(ms->smp.cpus, EXTIOI_CPUS); cpu++) {
- cpudev = DEVICE(qemu_get_cpu(cpu, NULL));
+ cpudev = DEVICE(qemu_get_cpu(cpu, TYPE_LOONGARCH_CPU));
for (pin = 0; pin < LS3A_INTC_IP; pin++) {
qdev_connect_gpio_out(extioi, (cpu * 8 + pin),
qdev_get_gpio_in(cpudev, pin + 2));
--
2.41.0
- [RFC PATCH 01/19] cpus: Add argument to qemu_get_cpu() to filter CPUs by QOM type, (continued)
- [PATCH 02/19] cpus: Filter for target specific CPU (generic), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 03/19] cpus: Filter for target specific CPU (arm), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 05/19] cpus: Filter for target specific CPU (mips), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 06/19] cpus: Filter for target specific CPU (s390x), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 04/19] cpus: Filter for target specific CPU (loongarch),
Philippe Mathieu-Daudé <=
- [PATCH 07/19] cpus: Filter for target specific CPU (riscv), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 08/19] cpus: Filter for target specific CPU (ppc), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 09/19] cpus: Filter for target specific CPU (x86), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 10/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_ARM_CPU), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 11/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_POWERPC_CPU), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 12/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_MIPS_CPU), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 13/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_M68K_CPU), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 14/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_S390X_CPU), Philippe Mathieu-Daudé, 2023/10/20
- [PATCH 15/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_RISCV_CPU), Philippe Mathieu-Daudé, 2023/10/20