diff options
author | Marc Zyngier <marc.zyngier@arm.com> | 2014-02-04 13:13:03 -0500 |
---|---|---|
committer | Christoffer Dall <christoffer.dall@linaro.org> | 2014-07-11 07:57:34 -0400 |
commit | 8f186d522c69bb18dd9b93a634da4953228c67d4 (patch) | |
tree | d3ed28a710860943ac7709b512bb35ca2b958955 /include/kvm | |
parent | ca85f623e37d096206e092ef037a145a60fa7f85 (diff) |
KVM: ARM: vgic: split GICv2 backend from the main vgic code
Brutally hack the innocent vgic code, and move the GICv2 specific code
to its own file, using vgic_ops and vgic_params as a way to pass
information between the two blocks.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
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 | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index ce2e14226dbf..d8d52a9ca6a1 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
@@ -32,7 +32,8 @@ | |||
32 | #define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS) | 32 | #define VGIC_NR_PRIVATE_IRQS (VGIC_NR_SGIS + VGIC_NR_PPIS) |
33 | #define VGIC_NR_SHARED_IRQS (VGIC_NR_IRQS - VGIC_NR_PRIVATE_IRQS) | 33 | #define VGIC_NR_SHARED_IRQS (VGIC_NR_IRQS - VGIC_NR_PRIVATE_IRQS) |
34 | #define VGIC_MAX_CPUS KVM_MAX_VCPUS | 34 | #define VGIC_MAX_CPUS KVM_MAX_VCPUS |
35 | #define VGIC_MAX_LRS (1 << 6) | 35 | |
36 | #define VGIC_V2_MAX_LRS (1 << 6) | ||
36 | 37 | ||
37 | /* Sanity checks... */ | 38 | /* Sanity checks... */ |
38 | #if (VGIC_MAX_CPUS > 8) | 39 | #if (VGIC_MAX_CPUS > 8) |
@@ -162,7 +163,7 @@ struct vgic_v2_cpu_if { | |||
162 | u32 vgic_eisr[2]; /* Saved only */ | 163 | u32 vgic_eisr[2]; /* Saved only */ |
163 | u32 vgic_elrsr[2]; /* Saved only */ | 164 | u32 vgic_elrsr[2]; /* Saved only */ |
164 | u32 vgic_apr; | 165 | u32 vgic_apr; |
165 | u32 vgic_lr[VGIC_MAX_LRS]; | 166 | u32 vgic_lr[VGIC_V2_MAX_LRS]; |
166 | }; | 167 | }; |
167 | 168 | ||
168 | struct vgic_cpu { | 169 | struct vgic_cpu { |
@@ -175,7 +176,7 @@ struct vgic_cpu { | |||
175 | DECLARE_BITMAP( pending_shared, VGIC_NR_SHARED_IRQS); | 176 | DECLARE_BITMAP( pending_shared, VGIC_NR_SHARED_IRQS); |
176 | 177 | ||
177 | /* Bitmap of used/free list registers */ | 178 | /* Bitmap of used/free list registers */ |
178 | DECLARE_BITMAP( lr_used, VGIC_MAX_LRS); | 179 | DECLARE_BITMAP( lr_used, VGIC_V2_MAX_LRS); |
179 | 180 | ||
180 | /* Number of list registers on this CPU */ | 181 | /* Number of list registers on this CPU */ |
181 | int nr_lr; | 182 | int nr_lr; |
@@ -214,6 +215,10 @@ bool vgic_handle_mmio(struct kvm_vcpu *vcpu, struct kvm_run *run, | |||
214 | #define irqchip_in_kernel(k) (!!((k)->arch.vgic.vctrl_base)) | 215 | #define irqchip_in_kernel(k) (!!((k)->arch.vgic.vctrl_base)) |
215 | #define vgic_initialized(k) ((k)->arch.vgic.ready) | 216 | #define vgic_initialized(k) ((k)->arch.vgic.ready) |
216 | 217 | ||
218 | int vgic_v2_probe(struct device_node *vgic_node, | ||
219 | const struct vgic_ops **ops, | ||
220 | const struct vgic_params **params); | ||
221 | |||
217 | #else | 222 | #else |
218 | static inline int kvm_vgic_hyp_init(void) | 223 | static inline int kvm_vgic_hyp_init(void) |
219 | { | 224 | { |