diff mbox series

[17/19] cpus: Replace first_cpu by qemu_get_cpu(0, TYPE_SUPERH_CPU)

Message ID 20231020163643.86105-18-philmd@linaro.org
State New
Headers show
Series cpus: Step toward removing global 'first_cpu' | expand

Commit Message

Philippe Mathieu-Daudé Oct. 20, 2023, 4:36 p.m. UTC
Mechanical change using the following coccinelle script:

  @@ @@
  -   first_cpu
  +   qemu_get_cpu(0, TYPE_SUPERH_CPU)

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 hw/intc/sh_intc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/hw/intc/sh_intc.c b/hw/intc/sh_intc.c
index c9b0b0c1ec..be76a96ebc 100644
--- a/hw/intc/sh_intc.c
+++ b/hw/intc/sh_intc.c
@@ -44,12 +44,14 @@  void sh_intc_toggle_source(struct intc_source *source,
         if (source->pending) {
             source->parent->pending++;
             if (source->parent->pending == 1) {
-                cpu_interrupt(first_cpu, CPU_INTERRUPT_HARD);
+                cpu_interrupt(qemu_get_cpu(0, TYPE_SUPERH_CPU),
+                              CPU_INTERRUPT_HARD);
             }
         } else {
             source->parent->pending--;
             if (source->parent->pending == 0) {
-                cpu_reset_interrupt(first_cpu, CPU_INTERRUPT_HARD);
+                cpu_reset_interrupt(qemu_get_cpu(0, TYPE_SUPERH_CPU),
+                                    CPU_INTERRUPT_HARD);
             }
         }
     }