hw/intc/aplic: refine the APLIC realize
authorYong-Xuan Wang <yongxuan.wang@sifive.com>
Mon, 24 Feb 2025 02:57:19 +0000 (10:57 +0800)
committerAlistair Francis <alistair.francis@wdc.com>
Tue, 4 Mar 2025 05:42:54 +0000 (15:42 +1000)
commit489840a012866440b7fe33e421b77cd234f83583
tree102ff19233adf8d33cef46ba3863c7c9805461e1
parentafd4f4aa7f605caf8efa2f3c590e1f2572f1ea50
hw/intc/aplic: refine the APLIC realize

When the APLIC is emulated in the kernel, the GPIO output lines to CPUs
can be remove. In this case the APLIC trigger CPU interrupts by KVM APIs.

This patch also move the code that claim the CPU interrupts to the
beginning of APLIC realization. This can avoid the unnecessary resource
allocation before checking failed.

Signed-off-by: Yong-Xuan Wang <yongxuan.wang@sifive.com>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20250224025722.3999-3-yongxuan.wang@sifive.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
hw/intc/riscv_aplic.c