]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/intc/arm_gicv3_its: Factor out "find ITE given devid, eventid"
authorPeter Maydell <peter.maydell@linaro.org>
Fri, 8 Apr 2022 14:15:20 +0000 (15:15 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 22 Apr 2022 08:24:43 +0000 (09:24 +0100)
commitf0175135e74bc979573f170e83abfc536aed03de
treed85b1a4cfaa4334af69d96d91506b556d9fde7d8
parent93f4fdcd4d98c0de8e056e08016bce7d71a91100
hw/intc/arm_gicv3_its: Factor out "find ITE given devid, eventid"

The operation of finding an interrupt table entry given a (DeviceID,
EventID) pair is necessary in multiple different ITS commands.  The
process requires first using the DeviceID as an index into the device
table to find the DTE, and then useng the EventID as an index into
the interrupt table specified by that DTE to find the ITE.  We also
need to handle all the possible error cases: indexes out of range,
table memory not readable, table entries not valid.

Factor this out into a separate lookup_ite() function which we
can then call from the places where we were previously open-coding
this sequence. We'll also need this for some of the new GICv4.0
commands.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-id: 20220408141550.1271295-12-peter.maydell@linaro.org
hw/intc/arm_gicv3_its.c