aboutsummaryrefslogtreecommitdiffstats
path: root/include/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2013-06-03 10:55:02 -0400
committerChristoffer Dall <christoffer.dall@linaro.org>2014-07-11 07:57:31 -0400
commit8d5c6b06a5d5f8ebcf40558e566781d572920740 (patch)
treefa9d9631b9336ae2f1c4c061c2bfd6d2b2615f45 /include/kvm
parenteede821dbfd58df89edb072da64e006321eaef58 (diff)
KVM: ARM: vgic: introduce vgic_ops and LR manipulation primitives
In order to split the various register manipulation from the main vgic code, introduce a vgic_ops structure, and start by abstracting the LR manipulation code with a couple of accessors. 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.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h
index f738e5a69ee9..17bbe51b79a1 100644
--- a/include/kvm/arm_vgic.h
+++ b/include/kvm/arm_vgic.h
@@ -68,6 +68,24 @@ struct vgic_bytemap {
68 u32 shared[VGIC_NR_SHARED_IRQS / 4]; 68 u32 shared[VGIC_NR_SHARED_IRQS / 4];
69}; 69};
70 70
71struct kvm_vcpu;
72
73#define LR_STATE_PENDING (1 << 0)
74#define LR_STATE_ACTIVE (1 << 1)
75#define LR_STATE_MASK (3 << 0)
76#define LR_EOI_INT (1 << 2)
77
78struct vgic_lr {
79 u16 irq;
80 u8 source;
81 u8 state;
82};
83
84struct vgic_ops {
85 struct vgic_lr (*get_lr)(const struct kvm_vcpu *, int);
86 void (*set_lr)(struct kvm_vcpu *, int, struct vgic_lr);
87};
88
71struct vgic_dist { 89struct vgic_dist {
72#ifdef CONFIG_KVM_ARM_VGIC 90#ifdef CONFIG_KVM_ARM_VGIC
73 spinlock_t lock; 91 spinlock_t lock;