diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2015-06-08 10:21:32 -0400 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2015-08-12 06:28:24 -0400 |
commit | 32d2d8010cd7080a0f1712f1084b92657858428e (patch) | |
tree | 660faf292f21198a8bde11f78c5f8129bce6436c /include/kvm | |
parent | abdf58438356c7baf34bdd98084b094ca3a6a23f (diff) |
KVM: arm/arm64: vgic: Convert struct vgic_lr to use bitfields
As we're about to cram more information in the vgic_lr structure
(HW interrupt number and additional state information), we switch
to a layout similar to the HW's:
- use bitfields to save space (we don't need more than 10 bits
to represent the irq numbers)
- source CPU and HW interrupt can share the same field, as
a SGI doesn't have a physical line.
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'include/kvm')
-rw-r--r-- | include/kvm/arm_vgic.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index 133ea00aa83b..a881e398d3e5 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
@@ -95,11 +95,15 @@ enum vgic_type { | |||
95 | #define LR_STATE_ACTIVE (1 << 1) | 95 | #define LR_STATE_ACTIVE (1 << 1) |
96 | #define LR_STATE_MASK (3 << 0) | 96 | #define LR_STATE_MASK (3 << 0) |
97 | #define LR_EOI_INT (1 << 2) | 97 | #define LR_EOI_INT (1 << 2) |
98 | #define LR_HW (1 << 3) | ||
98 | 99 | ||
99 | struct vgic_lr { | 100 | struct vgic_lr { |
100 | u16 irq; | 101 | unsigned irq:10; |
101 | u8 source; | 102 | union { |
102 | u8 state; | 103 | unsigned hwirq:10; |
104 | unsigned source:3; | ||
105 | }; | ||
106 | unsigned state:4; | ||
103 | }; | 107 | }; |
104 | 108 | ||
105 | struct vgic_vmcr { | 109 | struct vgic_vmcr { |