diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2020-11-27 22:51:27 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2020-12-15 12:04:30 +0000 |
commit | 71b3254dd227f4c5e0a1a4005175a98e0a2cdc19 (patch) | |
tree | ad123d831762600e09163a4a9e3303ef05af4a3f /hw/openrisc/meson.build | |
parent | eaca43a0f7a3548a527e74b7d14d69eeb31dc339 (diff) |
target/openrisc: Move pic_cpu code into CPU object proper
The openrisc code uses an old style of interrupt handling, where a
separate standalone set of qemu_irqs invoke a function
openrisc_pic_cpu_handler() which signals the interrupt to the CPU
proper by directly calling cpu_interrupt() and cpu_reset_interrupt().
Because CPU objects now inherit (indirectly) from TYPE_DEVICE, they
can have GPIO input lines themselves, and the neater modern way to
implement this is to simply have the CPU object itself provide the
input IRQ lines.
Create GPIO inputs to the OpenRISC CPU object, and make the only user
of cpu_openrisc_pic_init() wire up directly to those instead.
This allows us to delete the hw/openrisc/pic_cpu.c file entirely.
This fixes a trivial memory leak reported by Coverity of the IRQs
allocated in cpu_openrisc_pic_init().
Fixes: Coverity CID 1421934
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Stafford Horne <shorne@gmail.com>
Message-id: 20201127225127.14770-4-peter.maydell@linaro.org
Diffstat (limited to 'hw/openrisc/meson.build')
-rw-r--r-- | hw/openrisc/meson.build | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/openrisc/meson.build b/hw/openrisc/meson.build index 57c42558e1..947f63ee08 100644 --- a/hw/openrisc/meson.build +++ b/hw/openrisc/meson.build @@ -1,5 +1,5 @@ openrisc_ss = ss.source_set() -openrisc_ss.add(files('pic_cpu.c', 'cputimer.c')) +openrisc_ss.add(files('cputimer.c')) openrisc_ss.add(when: 'CONFIG_OR1K_SIM', if_true: files('openrisc_sim.c')) hw_arch += {'openrisc': openrisc_ss} |