OSDN Git Service

{include/}hw/arm: refactor virt PPI logic
authorLeif Lindholm <quic_llindhol@quicinc.com>
Tue, 19 Sep 2023 09:02:27 +0000 (10:02 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 19 Oct 2023 13:32:12 +0000 (14:32 +0100)
commit9036e917f8357f4e5965ebfecdab5964d40e6a40
tree369abc91b31f979af38e764717ced61e4c21b41d
parentd01448c79d89cfdc86228081b1dd1dfaf85fb4c3
{include/}hw/arm: refactor virt PPI logic

GIC Private Peripheral Interrupts (PPI) are defined as GIC INTID 16-31.
As in, PPI0 is INTID16 .. PPI15 is INTID31.
Arm's Base System Architecture specification (BSA) lists the mandated and
recommended private interrupt IDs by INTID, not by PPI index. But current
definitions in virt define them by PPI index, complicating cross
referencing.

Meanwhile, the PPI(x) macro counterintuitively adds 16 to the input value,
converting a PPI index to an INTID.

Resolve this by redefining the BSA-allocated PPIs by their INTIDs,
and replacing the PPI(x) macro with an INTID_TO_PPI(x) one where required.

Signed-off-by: Leif Lindholm <quic_llindhol@quicinc.com>
Message-id: 20230919090229.188092-2-quic_llindhol@quicinc.com
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/arm/virt-acpi-build.c
hw/arm/virt.c
include/hw/arm/virt.h