static int xen_suspend(void *data) { struct suspend_info *si = data; int err; BUG_ON(!irqs_disabled()); err = syscore_suspend(); if (err) { pr_err("%s: system core suspend failed: %d\n", __func__, err); return err; } if (si->pre) si->pre(); /* * This hypercall returns 1 if suspend was cancelled * or the domain was merely checkpointed, and 0 if it * is resuming in a new domain. */ si->cancelled = HYPERVISOR_suspend(si->arg); if (si->post) si->post(si->cancelled); if (!si->cancelled) { xen_irq_resume(); xen_timer_resume(); } syscore_resume(); return 0; }
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 int xen_suspend(void *data) { struct suspend_info *si = data; int err; BUG_ON(!irqs_disabled()); err = syscore_suspend(); if (err) { pr_err("%s: system core suspend failed: %d\n", __func__, err); return err; } gnttab_suspend(); xen_arch_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. */ si->cancelled = HYPERVISOR_suspend(xen_pv_domain() ? virt_to_mfn(xen_start_info) : 0); xen_arch_post_suspend(si->cancelled); gnttab_resume(); if (!si->cancelled) { xen_irq_resume(); xen_console_resume(); xen_timer_resume(); } syscore_resume(); return 0; }
static int xen_suspend(void *data) { struct suspend_info *si = data; int err; BUG_ON(!irqs_disabled()); err = sysdev_suspend(PMSG_FREEZE); if (err) { printk(KERN_ERR "xen_suspend: sysdev_suspend failed: %d\n", err); return err; } if (si->pre) si->pre(); /* * This hypercall returns 1 if suspend was cancelled * or the domain was merely checkpointed, and 0 if it * is resuming in a new domain. */ si->cancelled = HYPERVISOR_suspend(si->arg); if (si->post) si->post(si->cancelled); if (!si->cancelled) { xen_irq_resume(); xen_console_resume(); xen_timer_resume(); } sysdev_resume(); return 0; }