First Support on Ginger and OMAP TI
[linux-ginger.git] / arch / x86 / xen / suspend.c
blob95be7b434724c5067214dc416367633c522a69bb
1 #include <linux/types.h>
3 #include <xen/interface/xen.h>
4 #include <xen/grant_table.h>
5 #include <xen/events.h>
7 #include <asm/xen/hypercall.h>
8 #include <asm/xen/page.h>
9 #include <asm/fixmap.h>
11 #include "xen-ops.h"
12 #include "mmu.h"
14 void xen_pre_suspend(void)
16 xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn);
17 xen_start_info->console.domU.mfn =
18 mfn_to_pfn(xen_start_info->console.domU.mfn);
20 BUG_ON(!irqs_disabled());
22 HYPERVISOR_shared_info = &xen_dummy_shared_info;
23 if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP),
24 __pte_ma(0), 0))
25 BUG();
28 void xen_post_suspend(int suspend_cancelled)
30 xen_setup_shared_info();
32 if (suspend_cancelled) {
33 xen_start_info->store_mfn =
34 pfn_to_mfn(xen_start_info->store_mfn);
35 xen_start_info->console.domU.mfn =
36 pfn_to_mfn(xen_start_info->console.domU.mfn);
37 } else {
38 #ifdef CONFIG_SMP
39 BUG_ON(xen_cpu_initialized_map == NULL);
40 cpumask_copy(xen_cpu_initialized_map, cpu_online_mask);
41 #endif
42 xen_vcpu_restore();
47 void xen_arch_resume(void)
49 /* nothing */