static void xen_pv_pre_suspend(void) { xen_mm_pin_all(); xen_start_info->store_mfn = mfn_to_pfn(xen_start_info->store_mfn); xen_start_info->console.domU.mfn = mfn_to_pfn(xen_start_info->console.domU.mfn); BUG_ON(!irqs_disabled()); HYPERVISOR_shared_info = &xen_dummy_shared_info; if (HYPERVISOR_update_va_mapping(fix_to_virt(FIX_PARAVIRT_BOOTMAP), __pte_ma(0), 0)) BUG(); }
static int xen_suspend(void *data) { int *cancelled = data; int err; BUG_ON(!irqs_disabled()); load_cr3(swapper_pg_dir); err = device_power_down(PMSG_SUSPEND); if (err) { printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n", err); return err; } xen_mm_pin_all(); gnttab_suspend(); xen_pre_suspend(); /* * This hypercall returns 1 if suspend was cancelled * or the domain was merely checkpointed, and 0 if it * is resuming in a new domain. */ *cancelled = HYPERVISOR_suspend(virt_to_mfn(xen_start_info)); xen_post_suspend(*cancelled); gnttab_resume(); xen_mm_unpin_all(); device_power_up(PMSG_RESUME); if (!*cancelled) { xen_irq_resume(); xen_console_resume(); xen_timer_resume(); } return 0; }
static void xen_pre_suspend(void) { xen_mm_pin_all(); gnttab_suspend(); xen_arch_pre_suspend(); }