intc/arm_gic: Add virtualization extensions helper macros and functions
commit4a37e0e47618533b3792a6a999d156703203b7a8
authorLuc Michel <luc.michel@greensocs.com>
Tue, 14 Aug 2018 16:17:20 +0000 (14 17:17 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Tue, 14 Aug 2018 16:17:20 +0000 (14 17:17 +0100)
tree64e2a67b5a5afa9ec422c161f7db8032c97bac3a
parent7c2fffd282ec48ab852dd56b507abe76c64feea2
intc/arm_gic: Add virtualization extensions helper macros and functions

Add some helper macros and functions related to the virtualization
extensions to gic_internal.h.

The GICH_LR_* macros help extracting specific fields of a list register
value. The only tricky one is the priority field as only the MSB are
stored. The value must be shifted accordingly to obtain the correct
priority value.

gic_is_vcpu() and gic_get_vcpu_real_id() help with (v)CPU id manipulation
to abstract the fact that vCPU id are in the range
[ GIC_NCPU; (GIC_NCPU + num_cpu) [.

gic_lr_* and gic_virq_is_valid() help with the list registers.
gic_get_lr_entry() returns the LR entry for a given (vCPU, irq) pair. It
is meant to be used in contexts where we know for sure that the entry
exists, so we assert that entry is actually found, and the caller can
avoid the NULL check on the returned pointer.

Signed-off-by: Luc Michel <luc.michel@greensocs.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-id: 20180727095421.386-8-luc.michel@greensocs.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/intc/arm_gic.c
hw/intc/gic_internal.h