xen/arm: implement vcpu_timer_destroy
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 5 Feb 2013 11:31:09 +0000 (11:31 +0000)
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>
Tue, 5 Feb 2013 11:31:09 +0000 (11:31 +0000)
Implement a function to destroy the per-vcpu phys and virt timers, call
it from vcpu_destroy.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
xen/arch/arm/domain.c
xen/arch/arm/vtimer.c
xen/arch/arm/vtimer.h

index 0836c1692ecef22f8967dbfb60d37be1371d8ca6..0aa261abde6b43ee552c3a5d929f2b5ba3b89f88 100644 (file)
@@ -399,6 +399,7 @@ int vcpu_initialise(struct vcpu *v)
 
 void vcpu_destroy(struct vcpu *v)
 {
+    vcpu_timer_destroy(v);
     free_xenheap_pages(v->arch.stack, STACK_ORDER);
 }
 
index 361687918f4113798e5fb0d36d28455760044b67..85201b5b05e287f142211d247b4b60575f24d6fe 100644 (file)
@@ -65,6 +65,12 @@ int vcpu_vtimer_init(struct vcpu *v)
     return 0;
 }
 
+void vcpu_timer_destroy(struct vcpu *v)
+{
+    kill_timer(&v->arch.virt_timer.timer);
+    kill_timer(&v->arch.phys_timer.timer);
+}
+
 int virt_timer_save(struct vcpu *v)
 {
     v->arch.virt_timer.ctl = READ_CP32(CNTV_CTL);
index faebd6889d1fc64ad59f7681cbc6fc24de79eab2..43eef698d065b2ca710f876b6f06369a658e50da 100644 (file)
@@ -24,6 +24,7 @@ extern int vcpu_vtimer_init(struct vcpu *v);
 extern int vtimer_emulate(struct cpu_user_regs *regs, union hsr hsr);
 extern int virt_timer_save(struct vcpu *v);
 extern int virt_timer_restore(struct vcpu *v);
+extern void vcpu_timer_destroy(struct vcpu *v);
 
 #endif