1 #include <linux/types.h> 2 3 #include <xen/interface/xen.h> 4 #include <xen/grant_table.h> 5 #include <xen/events.h> 6 7 #include <asm/xen/hypercall.h> 8 #include <asm/xen/page.h> 9 #include <asm/fixmap.h> 10 11 #include "xen-ops.h" 12 #include "mmu.h" 13 14 void xen_pre_suspend(void) 15 { 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); 19 20 BUG_ON(!irqs_disabled()); 21 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(); 26 } 27 28 void xen_post_suspend(int suspend_cancelled) 29 { 30 xen_setup_shared_info(); 31 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(); 43 } 44 45 } 46 47 void xen_arch_resume(void) 48 { 49 /* nothing */ 50 } 51