1 #include <linux/types.h>
2 #include <linux/clockchips.h>
4 #include <xen/interface/xen.h>
5 #include <xen/grant_table.h>
6 #include <xen/events.h>
8 #include <asm/xen/hypercall.h>
9 #include <asm/xen/page.h>
10 #include <asm/fixmap.h>
15 void xen_pre_suspend(void)
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
);
21 BUG_ON(!irqs_disabled());
23 HYPERVISOR_shared_info
= &xen_dummy_shared_info
;
24 if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP
),
29 void xen_post_suspend(int suspend_cancelled
)
31 xen_build_mfn_list_list();
33 xen_setup_shared_info();
35 if (suspend_cancelled
) {
36 xen_start_info
->store_mfn
=
37 pfn_to_mfn(xen_start_info
->store_mfn
);
38 xen_start_info
->console
.domU
.mfn
=
39 pfn_to_mfn(xen_start_info
->console
.domU
.mfn
);
42 BUG_ON(xen_cpu_initialized_map
== NULL
);
43 cpumask_copy(xen_cpu_initialized_map
, cpu_online_mask
);
50 static void xen_vcpu_notify_restore(void *data
)
52 unsigned long reason
= (unsigned long)data
;
54 /* Boot processor notified via generic timekeeping_resume() */
55 if ( smp_processor_id() == 0)
58 clockevents_notify(reason
, NULL
);
61 void xen_arch_resume(void)
63 smp_call_function(xen_vcpu_notify_restore
,
64 (void *)CLOCK_EVT_NOTIFY_RESUME
, 1);