Jeremy Fitzhardinge | 0e91398 | 2008-05-26 23:31:27 +0100 | [diff] [blame] | 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> |
Ingo Molnar | 99d0000 | 2009-01-23 11:09:15 +0100 | [diff] [blame] | 9 | #include <asm/fixmap.h> |
Jeremy Fitzhardinge | 0e91398 | 2008-05-26 23:31:27 +0100 | [diff] [blame] | 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 | { |
Jeremy Fitzhardinge | 9c7a794 | 2008-05-31 01:33:02 +0100 | [diff] [blame] | 30 | xen_setup_shared_info(); |
| 31 | |
Jeremy Fitzhardinge | 0e91398 | 2008-05-26 23:31:27 +0100 | [diff] [blame] | 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 |
Mike Travis | b78936e | 2008-12-16 17:33:57 -0800 | [diff] [blame] | 39 | BUG_ON(xen_cpu_initialized_map == NULL); |
| 40 | cpumask_copy(xen_cpu_initialized_map, cpu_online_mask); |
Jeremy Fitzhardinge | 0e91398 | 2008-05-26 23:31:27 +0100 | [diff] [blame] | 41 | #endif |
Jeremy Fitzhardinge | 9c7a794 | 2008-05-31 01:33:02 +0100 | [diff] [blame] | 42 | xen_vcpu_restore(); |
Jeremy Fitzhardinge | 0e91398 | 2008-05-26 23:31:27 +0100 | [diff] [blame] | 43 | } |
| 44 | |
Jeremy Fitzhardinge | 0e91398 | 2008-05-26 23:31:27 +0100 | [diff] [blame] | 45 | } |
| 46 | |
Isaku Yamahata | ad55db9 | 2008-07-08 15:06:32 -0700 | [diff] [blame] | 47 | void xen_arch_resume(void) |
| 48 | { |
| 49 | /* nothing */ |
| 50 | } |