diff options
| author | Mark Rutland <mark.rutland@arm.com> | 2013-03-27 11:56:11 -0400 |
|---|---|---|
| committer | Christoffer Dall <cdall@cs.columbia.edu> | 2013-04-29 01:22:57 -0400 |
| commit | 372b7c1bc80510225ca91cba75bc0850a6e16c39 (patch) | |
| tree | d01fcead359a4dc2c4da3d00f9cf064c96182e50 | |
| parent | 210552c1bfe83122a480673660d5ca9821c944ae (diff) | |
ARM: KVM: arch_timer: use symbolic constants
In clocksource/arm_arch_timer.h we define useful symbolic constants.
Let's use them to make the KVM arch_timer code clearer.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Marc Zyngier <marc.zyngier@arm.com>
Cc: Christoffer Dall <cdall@cs.columbia.edu>
Signed-off-by: Christoffer Dall <cdall@cs.columbia.edu>
| -rw-r--r-- | arch/arm/kvm/arch_timer.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/arch/arm/kvm/arch_timer.c b/arch/arm/kvm/arch_timer.c index 6ac938d46297..c55b6089e923 100644 --- a/arch/arm/kvm/arch_timer.c +++ b/arch/arm/kvm/arch_timer.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <linux/kvm_host.h> | 22 | #include <linux/kvm_host.h> |
| 23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
| 24 | 24 | ||
| 25 | #include <clocksource/arm_arch_timer.h> | ||
| 25 | #include <asm/arch_timer.h> | 26 | #include <asm/arch_timer.h> |
| 26 | 27 | ||
| 27 | #include <asm/kvm_vgic.h> | 28 | #include <asm/kvm_vgic.h> |
| @@ -64,7 +65,7 @@ static void kvm_timer_inject_irq(struct kvm_vcpu *vcpu) | |||
| 64 | { | 65 | { |
| 65 | struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; | 66 | struct arch_timer_cpu *timer = &vcpu->arch.timer_cpu; |
| 66 | 67 | ||
| 67 | timer->cntv_ctl |= 1 << 1; /* Mask the interrupt in the guest */ | 68 | timer->cntv_ctl |= ARCH_TIMER_CTRL_IT_MASK; |
| 68 | kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, | 69 | kvm_vgic_inject_irq(vcpu->kvm, vcpu->vcpu_id, |
| 69 | vcpu->arch.timer_cpu.irq->irq, | 70 | vcpu->arch.timer_cpu.irq->irq, |
| 70 | vcpu->arch.timer_cpu.irq->level); | 71 | vcpu->arch.timer_cpu.irq->level); |
| @@ -133,8 +134,8 @@ void kvm_timer_sync_hwstate(struct kvm_vcpu *vcpu) | |||
| 133 | cycle_t cval, now; | 134 | cycle_t cval, now; |
| 134 | u64 ns; | 135 | u64 ns; |
| 135 | 136 | ||
| 136 | /* Check if the timer is enabled and unmasked first */ | 137 | if ((timer->cntv_ctl & ARCH_TIMER_CTRL_IT_MASK) || |
| 137 | if ((timer->cntv_ctl & 3) != 1) | 138 | !(timer->cntv_ctl & ARCH_TIMER_CTRL_ENABLE)) |
| 138 | return; | 139 | return; |
| 139 | 140 | ||
| 140 | cval = timer->cntv_cval; | 141 | cval = timer->cntv_cval; |
