Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
suspend.c
Go to the documentation of this file.
1 #include <linux/types.h>
2 #include <linux/clockchips.h>
3 
4 #include <xen/interface/xen.h>
5 #include <xen/grant_table.h>
6 #include <xen/events.h>
7 
8 #include <asm/xen/hypercall.h>
9 #include <asm/xen/page.h>
10 #include <asm/fixmap.h>
11 
12 #include "xen-ops.h"
13 #include "mmu.h"
14 
16 {
17  xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
18  xen_start_info->console.domU.mfn =
19  mfn_to_pfn(xen_start_info->console.domU.mfn);
20 
22 
24  if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
25  __pte_ma(0), 0))
26  BUG();
27 }
28 
29 void xen_arch_hvm_post_suspend(int suspend_cancelled)
30 {
31 #ifdef CONFIG_XEN_PVHVM
32  int cpu;
36  if (xen_feature(XENFEAT_hvm_safe_pvclock)) {
37  for_each_online_cpu(cpu) {
39  }
40  }
41 #endif
42 }
43 
44 void xen_arch_post_suspend(int suspend_cancelled)
45 {
47 
49 
50  if (suspend_cancelled) {
51  xen_start_info->store_mfn =
52  pfn_to_mfn(xen_start_info->store_mfn);
53  xen_start_info->console.domU.mfn =
54  pfn_to_mfn(xen_start_info->console.domU.mfn);
55  } else {
56 #ifdef CONFIG_SMP
59 #endif
61  }
62 
63 }
64 
65 static void xen_vcpu_notify_restore(void *data)
66 {
67  unsigned long reason = (unsigned long)data;
68 
69  /* Boot processor notified via generic timekeeping_resume() */
70  if ( smp_processor_id() == 0)
71  return;
72 
73  clockevents_notify(reason, NULL);
74 }
75 
76 void xen_arch_resume(void)
77 {
78  on_each_cpu(xen_vcpu_notify_restore,
79  (void *)CLOCK_EVT_NOTIFY_RESUME, 1);
80 }