Merge tag 'chrome-platform-for-linus-4.13' of git://git.kernel.org/pub/scm/linux...
[linux/fpc-iii.git] / arch / x86 / xen / suspend.c
blobd6b1680693a9b7114e7d87e59b52d871e28a6b27
1 #include <linux/types.h>
2 #include <linux/tick.h>
4 #include <xen/xen.h>
5 #include <xen/interface/xen.h>
6 #include <xen/grant_table.h>
7 #include <xen/events.h>
9 #include <asm/xen/hypercall.h>
10 #include <asm/xen/page.h>
11 #include <asm/fixmap.h>
13 #include "xen-ops.h"
14 #include "mmu.h"
15 #include "pmu.h"
17 void xen_arch_pre_suspend(void)
19 if (xen_pv_domain())
20 xen_pv_pre_suspend();
23 void xen_arch_post_suspend(int cancelled)
25 if (xen_pv_domain())
26 xen_pv_post_suspend(cancelled);
27 else
28 xen_hvm_post_suspend(cancelled);
31 static void xen_vcpu_notify_restore(void *data)
33 /* Boot processor notified via generic timekeeping_resume() */
34 if (smp_processor_id() == 0)
35 return;
37 tick_resume_local();
40 static void xen_vcpu_notify_suspend(void *data)
42 tick_suspend_local();
45 void xen_arch_resume(void)
47 int cpu;
49 on_each_cpu(xen_vcpu_notify_restore, NULL, 1);
51 for_each_online_cpu(cpu)
52 xen_pmu_init(cpu);
55 void xen_arch_suspend(void)
57 int cpu;
59 for_each_online_cpu(cpu)
60 xen_pmu_finish(cpu);
62 on_each_cpu(xen_vcpu_notify_suspend, NULL, 1);