[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 36/60] target/nios2: Create IRQs *after* accelerator vCPU is reali
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 36/60] target/nios2: Create IRQs *after* accelerator vCPU is realized |
Date: |
Mon, 6 Nov 2023 12:03:08 +0100 |
Architecture specific hardware doesn't have a particular dependency
on the accelerator vCPU (created with cpu_exec_realizefn), and can
be initialized *after* the vCPU is realized. Doing so allows further
generic API simplification (in few commits).
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230918160257.30127-12-philmd@linaro.org>
---
target/nios2/cpu.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c
index 15e499f828..a27732bf2b 100644
--- a/target/nios2/cpu.c
+++ b/target/nios2/cpu.c
@@ -199,14 +199,6 @@ static void nios2_cpu_realizefn(DeviceState *dev, Error
**errp)
Nios2CPUClass *ncc = NIOS2_CPU_GET_CLASS(dev);
Error *local_err = NULL;
-#ifndef CONFIG_USER_ONLY
- if (cpu->eic_present) {
- qdev_init_gpio_in_named(DEVICE(cpu), eic_set_irq, "EIC", 1);
- } else {
- qdev_init_gpio_in_named(DEVICE(cpu), iic_set_irq, "IRQ", 32);
- }
-#endif
-
cpu_exec_realizefn(cs, &local_err);
if (local_err != NULL) {
error_propagate(errp, local_err);
@@ -220,6 +212,14 @@ static void nios2_cpu_realizefn(DeviceState *dev, Error
**errp)
/* We have reserved storage for cpuid; might as well use it. */
cpu->env.ctrl[CR_CPUID] = cs->cpu_index;
+#ifndef CONFIG_USER_ONLY
+ if (cpu->eic_present) {
+ qdev_init_gpio_in_named(DEVICE(cpu), eic_set_irq, "EIC", 1);
+ } else {
+ qdev_init_gpio_in_named(DEVICE(cpu), iic_set_irq, "IRQ", 32);
+ }
+#endif
+
ncc->parent_realize(dev, errp);
}
--
2.41.0
- [PULL 24/60] target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr](), (continued)
- [PULL 24/60] target/i386/hvf: Use env_archcpu() in simulate_[rdmsr/wrmsr](), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 29/60] target/i386/monitor: synchronize cpu state for lapic info, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 28/60] target/i386/kvm: Correct comment in kvm_cpu_realize(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 26/60] target/i386/hvf: Rename 'CPUState *cpu' variable as 'cs', Philippe Mathieu-Daudé, 2023/11/06
- [PULL 31/60] target/mips: Fix TX79 LQ/SQ opcodes, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 30/60] target/mips: Fix MSA BZ/BNZ opcodes displacement, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 32/60] sysemu/kvm: Restrict kvmppc_get_radix_page_info() to ppc targets, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 33/60] hw/ppc/e500: Restrict ppce500_init_mpic_kvm() to KVM, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 34/60] target/ppc: Restrict KVM objects to system emulation, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 35/60] target/ppc: Prohibit target specific KVM prototypes on user emulation, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 36/60] target/nios2: Create IRQs *after* accelerator vCPU is realized,
Philippe Mathieu-Daudé <=
- [PULL 37/60] target/alpha: Tidy up alpha_cpu_class_by_name(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 38/60] hw/cpu: Call object_class_is_abstract() once in cpu_class_by_name(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 39/60] exec/cpu: Have cpu_exec_realize() return a boolean, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 40/60] hw/cpu: Clean up global variable shadowing, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 41/60] hw/loader: Clean up global variable shadowing in rom_add_file(), Philippe Mathieu-Daudé, 2023/11/06
- [PULL 42/60] hw/isa/i82378: Propagate error if PC_SPEAKER device creation failed, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 43/60] hw/i386: Fix comment style in topology.h, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 44/60] tests/unit: Rename test-x86-cpuid.c to test-x86-topo.c, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 45/60] system/cpus: Fix CPUState.nr_cores' calculation, Philippe Mathieu-Daudé, 2023/11/06
- [PULL 46/60] hw/cpu: Update the comments of nr_cores and nr_dies, Philippe Mathieu-Daudé, 2023/11/06