qemu/hw/openrisc
Peter Maydell 71b3254dd2 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
2020-12-15 12:04:30 +00:00
..
Kconfig hw/openrisc/openrisc_sim: Use IRQ splitter when connecting IRQ to multiple CPUs 2020-12-15 12:04:29 +00:00
cputimer.c Include hw/hw.h exactly where needed 2019-08-16 13:31:52 +02:00
meson.build target/openrisc: Move pic_cpu code into CPU object proper 2020-12-15 12:04:30 +00:00
openrisc_sim.c target/openrisc: Move pic_cpu code into CPU object proper 2020-12-15 12:04:30 +00:00