本文整理汇总了C++中dpm_resume_end函数的典型用法代码示例。如果您正苦于以下问题:C++ dpm_resume_end函数的具体用法?C++ dpm_resume_end怎么用?C++ dpm_resume_end使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dpm_resume_end函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: suspend_devices_and_enter
/**
* suspend_devices_and_enter - suspend devices and enter the desired system
* sleep state.
* @state: state to enter
*/
int suspend_devices_and_enter(suspend_state_t state)
{
int error;
if (!suspend_ops)
return -ENOSYS;
if (suspend_ops->begin) {
error = suspend_ops->begin(state);
if (error)
goto Close;
}
/*
suspend_console();
*/
suspend_test_start();
error = dpm_suspend_start(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to suspend\n");
goto Recover_platform;
}
suspend_test_finish("suspend devices");
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
suspend_enter(state);
Resume_devices:
suspend_test_start();
dpm_resume_end(PMSG_RESUME);
#ifdef CONFIG_WMT_SPITS2_SUPPORT
/*Disable TS interrupt*/
wmt_ts_pre_suspend(PMSG_SUSPEND);
#endif
suspend_test_finish("resume devices");
resume_console();
printk("WMT wake up event %x\n",WMT_WAKE_UP_EVENT);
WMT_WAKE_UP_EVENT = 0;
Close:
if (suspend_ops->end)
suspend_ops->end();
return error;
Recover_platform:
if (suspend_ops->recover)
suspend_ops->recover();
goto Resume_devices;
}
开发者ID:AvengerMoJo,项目名称:apc-8750,代码行数:53,代码来源:suspend.c
示例2: suspend_devices_and_enter
int suspend_devices_and_enter(suspend_state_t state)
{
int error;
bool wakeup = false;
if (need_suspend_ops(state) && !suspend_ops)
return -ENOSYS;
trace_machine_suspend(state);
if (need_suspend_ops(state) && suspend_ops->begin) {
error = suspend_ops->begin(state);
if (error)
goto Close;
}
suspend_console();
ftrace_stop();
suspend_test_start();
error = dpm_suspend_start(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to suspend\n");
goto Recover_platform;
}
suspend_test_finish("suspend devices");
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
do {
error = suspend_enter(state, &wakeup);
} while (!error && !wakeup && need_suspend_ops(state)
&& suspend_ops->suspend_again && suspend_ops->suspend_again());
Resume_devices:
suspend_test_start();
dpm_resume_end(PMSG_RESUME);
suspend_test_finish("resume devices");
ftrace_start();
resume_console();
Close:
if (need_suspend_ops(state) && suspend_ops->end)
suspend_ops->end();
trace_machine_suspend(PWR_EVENT_EXIT);
return error;
Recover_platform:
if (need_suspend_ops(state) && suspend_ops->recover)
suspend_ops->recover();
goto Resume_devices;
}
开发者ID:anticline,项目名称:android_kernel_htc_msm8939,代码行数:48,代码来源:suspend.c
示例3: hibernation_snapshot
int hibernation_snapshot(int platform_mode)
{
int error;
error = platform_begin(platform_mode);
if (error)
goto Close;
/* Preallocate image memory before shutting down devices. */
error = hibernate_preallocate_memory();
if (error)
goto Close;
suspend_console();
pm_restrict_gfp_mask();
error = dpm_suspend_start(PMSG_FREEZE);
if (error)
goto Recover_platform;
if (hibernation_test(TEST_DEVICES))
goto Recover_platform;
error = create_image(platform_mode);
/*
* Control returns here (1) after the image has been created or the
* image creation has failed and (2) after a successful restore.
*/
Resume_devices:
/* We may need to release the preallocated image pages here. */
if (error || !in_suspend)
swsusp_free();
dpm_resume_end(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
if (error || !in_suspend)
pm_restore_gfp_mask();
resume_console();
Close:
platform_end(platform_mode);
return error;
Recover_platform:
platform_recover(platform_mode);
goto Resume_devices;
}
开发者ID:AbheekG,项目名称:XIA-for-Linux,代码行数:48,代码来源:hibernate.c
示例4: suspend_devices_and_enter
/**
* suspend_devices_and_enter - Suspend devices and enter system sleep state.
* @state: System sleep state to enter.
*/
int suspend_devices_and_enter(suspend_state_t state)
{
int error;
bool wakeup = false;
if (!sleep_state_supported(state))
return -ENOSYS;
pm_suspend_target_state = state;
error = platform_suspend_begin(state);
if (error)
goto Close;
suspend_console();
suspend_test_start();
error = dpm_suspend_start(PMSG_SUSPEND);
if (error) {
pr_err("Some devices failed to suspend, or early wake event detected\n");
goto Recover_platform;
}
suspend_test_finish("suspend devices");
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
do {
error = suspend_enter(state, &wakeup);
} while (!error && !wakeup && platform_suspend_again(state));
Resume_devices:
suspend_test_start();
dpm_resume_end(PMSG_RESUME);
suspend_test_finish("resume devices");
trace_suspend_resume(TPS("resume_console"), state, true);
resume_console();
trace_suspend_resume(TPS("resume_console"), state, false);
Close:
platform_resume_end(state);
pm_suspend_target_state = PM_SUSPEND_ON;
return error;
Recover_platform:
platform_recover(state);
goto Resume_devices;
}
开发者ID:guribe94,项目名称:linux,代码行数:50,代码来源:suspend.c
示例5: suspend_devices_and_enter
/**
* suspend_devices_and_enter - suspend devices and enter the desired system
* sleep state.
* @state: state to enter
*/
int suspend_devices_and_enter(suspend_state_t state)
{
int error;
if (!suspend_ops)
return -ENOSYS;
trace_machine_suspend(state);
if (suspend_ops->begin) {
error = suspend_ops->begin(state);
if (error)
goto Close;
}
suspend_console();
suspend_test_start();
suspend_expire_start();
error = dpm_suspend_start(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to suspend\n");
goto Recover_platform;
}
suspend_expire_finish("suspend devices");
suspend_test_finish("suspend devices");
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
suspend_enter(state);
Resume_devices:
suspend_test_start();
suspend_expire_start();
dpm_resume_end(PMSG_RESUME);
suspend_expire_finish("resume devices");
suspend_test_finish("resume devices");
resume_console();
Close:
if (suspend_ops->end)
suspend_ops->end();
trace_machine_suspend(PWR_EVENT_EXIT);
return error;
Recover_platform:
if (suspend_ops->recover)
suspend_ops->recover();
goto Resume_devices;
}
开发者ID:AndroidRoot,项目名称:android_kernel_asus_tf201,代码行数:51,代码来源:suspend.c
示例6: hibernation_restore
/**
* hibernation_restore - Quiesce devices and restore from a hibernation image.
* @platform_mode: If set, use platform driver to prepare for the transition.
*
* This routine must be called with pm_mutex held. If it is successful, control
* reappears in the restored target kernel in hibernation_snapshot().
*/
int hibernation_restore(int platform_mode)
{
int error;
pm_prepare_console();
suspend_console();
pm_restrict_gfp_mask();
error = dpm_suspend_start(PMSG_QUIESCE);
if (!error) {
error = resume_target_kernel(platform_mode);
dpm_resume_end(PMSG_RECOVER);
}
pm_restore_gfp_mask();
resume_console();
pm_restore_console();
return error;
}
开发者ID:OneOfMany07,项目名称:fjord-kernel,代码行数:24,代码来源:hibernate.c
示例7: suspend_devices_and_enter
/**
* suspend_devices_and_enter - suspend devices and enter the desired system
* sleep state.
* @state: state to enter
*/
int suspend_devices_and_enter(suspend_state_t state)
{
int error;
if (!suspend_ops)
return -ENOSYS;
if (suspend_ops->begin) {
error = suspend_ops->begin(state);
if (error)
goto Close;
}
suspend_console();
pm_restrict_gfp_mask();
suspend_test_start();
error = dpm_suspend_start(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to suspend\n");
goto Recover_platform;
}
suspend_test_finish("suspend devices");
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
suspend_enter(state);
Resume_devices:
suspend_test_start();
dpm_resume_end(PMSG_RESUME);
ktime_resume_endtime=ktime_get();
printk(KERN_ERR "<POWER>resume6[peripheral resume]take %llu ns\n",ktime_to_ns(ktime_sub(ktime_resume_endtime, ktime_resume_fromtime)));
ktime_resume_fromtime=ktime_resume_endtime;
suspend_test_finish("resume devices");
pm_restore_gfp_mask();
resume_console();
Close:
if (suspend_ops->end)
suspend_ops->end();
return error;
Recover_platform:
if (suspend_ops->recover)
suspend_ops->recover();
goto Resume_devices;
}
开发者ID:Stepanowegor,项目名称:kernel_dell_streak7,代码行数:50,代码来源:suspend.c
示例8: hibernation_restore
int hibernation_restore(int platform_mode)
{
int error;
gfp_t saved_mask;
pm_prepare_console();
suspend_console();
saved_mask = clear_gfp_allowed_mask(GFP_IOFS);
error = dpm_suspend_start(PMSG_QUIESCE);
if (!error) {
error = resume_target_kernel(platform_mode);
dpm_resume_end(PMSG_RECOVER);
}
set_gfp_allowed_mask(saved_mask);
resume_console();
pm_restore_console();
return error;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:18,代码来源:hibernate.c
示例9: suspend_again
static bool suspend_again(bool *drivers_resumed)
{
const struct list_head *irqs;
struct list_head unfinished;
*drivers_resumed = false;
/* If a platform suspend_again handler is defined, when it decides to
* not suspend again, this takes precedence over drivers. If a
* platform's suspend_again callback returns true, then we proceed to
* check the drivers as well.
*/
if (suspend_ops->suspend_again && !suspend_ops->suspend_again())
return false;
/* TODO: resume only the drivers associated with the wakeup interrupts!
*/
dpm_resume_end(PMSG_RESUME);
*drivers_resumed = true;
/* Thaw kernel threads opportunistically, to allow get_wakeup_reasons
* to block while the wakeup interrupt list is being assembled. Calls
* schedule() internally.
*/
thaw_kernel_threads();
/* Look for a match between the wakeup reasons and the registered
* callbacks. Don't bother thawing the kernel threads if a match is
* not found.
*/
irqs = get_wakeup_reasons(msecs_to_jiffies(100), &unfinished);
if (!suspend_again_match(irqs, &unfinished))
return false;
if (suspend_again_consensus() &&
!freeze_kernel_threads()) {
clear_wakeup_reasons();
dpm_suspend_start(PMSG_SUSPEND);
*drivers_resumed = false;
return true;
}
return false;
}
开发者ID:benschhold,项目名称:android_kernel_oneplus_msm8994_custom,代码行数:44,代码来源:suspend.c
示例10: hibernation_snapshot
int hibernation_snapshot(int platform_mode)
{
int error;
gfp_t saved_mask;
error = platform_begin(platform_mode);
if (error)
return error;
/* Preallocate image memory before shutting down devices. */
error = hibernate_preallocate_memory();
if (error)
goto Close;
suspend_console();
saved_mask = clear_gfp_allowed_mask(GFP_IOFS);
error = dpm_suspend_start(PMSG_FREEZE);
if (error)
goto Recover_platform;
if (hibernation_test(TEST_DEVICES))
goto Recover_platform;
error = create_image(platform_mode);
/* Control returns here after successful restore */
Resume_devices:
/* We may need to release the preallocated image pages here. */
if (error || !in_suspend)
swsusp_free();
dpm_resume_end(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
set_gfp_allowed_mask(saved_mask);
resume_console();
Close:
platform_end(platform_mode);
return error;
Recover_platform:
platform_recover(platform_mode);
goto Resume_devices;
}
开发者ID:12rafael,项目名称:jellytimekernel,代码行数:43,代码来源:hibernate.c
示例11: hibernation_restore
/**
* hibernation_restore - Quiesce devices and restore from a hibernation image.
* @platform_mode: If set, use platform driver to prepare for the transition.
*
* This routine must be called with pm_mutex held. If it is successful, control
* reappears in the restored target kernel in hibernation_snapshot().
*/
int hibernation_restore(int platform_mode)
{
int error;
pm_prepare_console();
suspend_console();
pm_restrict_gfp_mask();
error = dpm_suspend_start(PMSG_QUIESCE);
if (!error) {
error = resume_target_kernel(platform_mode);
/*
* The above should either succeed and jump to the new kernel,
* or return with an error. Otherwise things are just
* undefined, so let's be paranoid.
*/
BUG_ON(!error);
}
dpm_resume_end(PMSG_RECOVER);
pm_restore_gfp_mask();
resume_console();
pm_restore_console();
return error;
}
开发者ID:mdamt,项目名称:linux,代码行数:30,代码来源:hibernate.c
示例12: hibernation_snapshot
int hibernation_snapshot(int platform_mode)
{
int error;
error = platform_begin(platform_mode);
if (error)
return error;
/* Free memory before shutting down devices. */
error = swsusp_shrink_memory();
if (error)
goto Close;
suspend_console();
error = dpm_suspend_start(PMSG_FREEZE);
if (error)
goto Recover_platform;
if (hibernation_test(TEST_DEVICES))
goto Recover_platform;
error = create_image(platform_mode);
/* Control returns here after successful restore */
Resume_devices:
dpm_resume_end(in_suspend ?
(error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
resume_console();
Close:
platform_end(platform_mode);
return error;
Recover_platform:
platform_recover(platform_mode);
goto Resume_devices;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:36,代码来源:hibernate.c
示例13: hibernation_platform_enter
/**
* hibernation_platform_enter - Power off the system using the platform driver.
*/
int hibernation_platform_enter(void)
{
int error;
if (!hibernation_ops)
return -ENOSYS;
/*
* We have cancelled the power transition by running
* hibernation_ops->finish() before saving the image, so we should let
* the firmware know that we're going to enter the sleep state after all
*/
error = hibernation_ops->begin();
if (error)
goto Close;
entering_platform_hibernation = true;
suspend_console();
error = dpm_suspend_start(PMSG_HIBERNATE);
if (error) {
if (hibernation_ops->recover)
hibernation_ops->recover();
goto Resume_devices;
}
error = dpm_suspend_end(PMSG_HIBERNATE);
if (error)
goto Resume_devices;
error = hibernation_ops->prepare();
if (error)
goto Platform_finish;
error = disable_nonboot_cpus();
if (error)
goto Enable_cpus;
local_irq_disable();
syscore_suspend();
if (pm_wakeup_pending()) {
error = -EAGAIN;
goto Power_up;
}
hibernation_ops->enter();
/* We should never get here */
while (1);
Power_up:
syscore_resume();
local_irq_enable();
Enable_cpus:
enable_nonboot_cpus();
Platform_finish:
hibernation_ops->finish();
dpm_resume_start(PMSG_RESTORE);
Resume_devices:
entering_platform_hibernation = false;
dpm_resume_end(PMSG_RESTORE);
resume_console();
Close:
hibernation_ops->end();
return error;
}
开发者ID:mdamt,项目名称:linux,代码行数:73,代码来源:hibernate.c
示例14: do_suspend
static void do_suspend(void)
{
int err;
struct suspend_info si;
shutting_down = SHUTDOWN_SUSPEND;
#ifdef CONFIG_PREEMPT
/* If the kernel is preemptible, we need to freeze all the processes
to prevent them from being in the middle of a pagetable update
during suspend. */
err = freeze_processes();
if (err) {
printk(KERN_ERR "xen suspend: freeze failed %d\n", err);
goto out;
}
#endif
err = dpm_suspend_start(PMSG_FREEZE);
if (err) {
printk(KERN_ERR "xen suspend: dpm_suspend_start %d\n", err);
goto out_thaw;
}
printk(KERN_DEBUG "suspending xenstore...\n");
xs_suspend();
err = dpm_suspend_noirq(PMSG_FREEZE);
if (err) {
printk(KERN_ERR "dpm_suspend_noirq failed: %d\n", err);
goto out_resume;
}
si.cancelled = 1;
if (xen_hvm_domain()) {
si.arg = 0UL;
si.pre = NULL;
si.post = &xen_hvm_post_suspend;
} else {
si.arg = virt_to_mfn(xen_start_info);
si.pre = &xen_pre_suspend;
si.post = &xen_post_suspend;
}
err = stop_machine(xen_suspend, &si, cpumask_of(0));
dpm_resume_noirq(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
if (err) {
printk(KERN_ERR "failed to start xen_suspend: %d\n", err);
si.cancelled = 1;
}
out_resume:
if (!si.cancelled) {
xen_arch_resume();
xs_resume();
} else
xs_suspend_cancel();
dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
/* Make sure timer events get retriggered on all CPUs */
clock_was_set();
out_thaw:
#ifdef CONFIG_PREEMPT
thaw_processes();
out:
#endif
shutting_down = SHUTDOWN_INVALID;
}
开发者ID:LittleForker,项目名称:linux-2.6,代码行数:73,代码来源:manage.c
示例15: do_suspend
static void do_suspend(void)
{
int err;
struct suspend_info si;
shutting_down = SHUTDOWN_SUSPEND;
err = freeze_processes();
if (err) {
pr_err("%s: freeze failed %d\n", __func__, err);
goto out;
}
err = dpm_suspend_start(PMSG_FREEZE);
if (err) {
pr_err("%s: dpm_suspend_start %d\n", __func__, err);
goto out_thaw;
}
printk(KERN_DEBUG "suspending xenstore...\n");
xs_suspend();
err = dpm_suspend_end(PMSG_FREEZE);
if (err) {
pr_err("dpm_suspend_end failed: %d\n", err);
si.cancelled = 0;
goto out_resume;
}
si.cancelled = 1;
if (xen_hvm_domain()) {
si.arg = 0UL;
si.pre = NULL;
si.post = &xen_hvm_post_suspend;
} else {
si.arg = virt_to_mfn(xen_start_info);
si.pre = &xen_pre_suspend;
si.post = &xen_post_suspend;
}
err = stop_machine(xen_suspend, &si, cpumask_of(0));
dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
if (err) {
pr_err("failed to start xen_suspend: %d\n", err);
si.cancelled = 1;
}
out_resume:
if (!si.cancelled) {
xen_arch_resume();
xs_resume();
} else
xs_suspend_cancel();
dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
out_thaw:
thaw_processes();
out:
shutting_down = SHUTDOWN_INVALID;
}
开发者ID:ExtremeGTX,项目名称:Devkit8500_Linux_BSP,代码行数:64,代码来源:manage.c
示例16: hibernation_platform_enter
int hibernation_platform_enter(void)
{
int error;
if (!hibernation_ops)
return -ENOSYS;
/*
* We have cancelled the power transition by running
* hibernation_ops->finish() before saving the image, so we should let
* the firmware know that we're going to enter the sleep state after all
*/
error = hibernation_ops->begin();
if (error)
goto Close;
entering_platform_hibernation = true;
suspend_console();
error = dpm_suspend_start(PMSG_HIBERNATE);
if (error) {
if (hibernation_ops->recover)
hibernation_ops->recover();
goto Resume_devices;
}
error = dpm_suspend_noirq(PMSG_HIBERNATE);
if (error)
goto Resume_devices;
error = hibernation_ops->prepare();
if (error)
goto Platofrm_finish;
error = disable_nonboot_cpus();
if (error)
goto Platofrm_finish;
local_irq_disable();
sysdev_suspend(PMSG_HIBERNATE);
hibernation_ops->enter();
/* We should never get here */
while (1);
/*
* We don't need to reenable the nonboot CPUs or resume consoles, since
* the system is going to be halted anyway.
*/
Platofrm_finish:
hibernation_ops->finish();
dpm_suspend_noirq(PMSG_RESTORE);
Resume_devices:
entering_platform_hibernation = false;
dpm_resume_end(PMSG_RESTORE);
resume_console();
Close:
hibernation_ops->end();
return error;
}
开发者ID:AppEngine,项目名称:linux-2.6,代码行数:62,代码来源:hibernate.c
示例17: do_suspend
static void do_suspend(void)
{
int err;
struct suspend_info si;
shutting_down = SHUTDOWN_SUSPEND;
err = freeze_processes();
if (err) {
pr_err("%s: freeze processes failed %d\n", __func__, err);
goto out;
}
err = freeze_kernel_threads();
if (err) {
pr_err("%s: freeze kernel threads failed %d\n", __func__, err);
goto out_thaw;
}
err = dpm_suspend_start(PMSG_FREEZE);
if (err) {
pr_err("%s: dpm_suspend_start %d\n", __func__, err);
goto out_thaw;
}
printk(KERN_DEBUG "suspending xenstore...\n");
xs_suspend();
err = dpm_suspend_end(PMSG_FREEZE);
if (err) {
pr_err("dpm_suspend_end failed: %d\n", err);
si.cancelled = 0;
goto out_resume;
}
xen_arch_suspend();
si.cancelled = 1;
err = stop_machine(xen_suspend, &si, cpumask_of(0));
/* Resume console as early as possible. */
if (!si.cancelled)
xen_console_resume();
raw_notifier_call_chain(&xen_resume_notifier, 0, NULL);
dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
if (err) {
pr_err("failed to start xen_suspend: %d\n", err);
si.cancelled = 1;
}
xen_arch_resume();
out_resume:
if (!si.cancelled)
xs_resume();
else
xs_suspend_cancel();
dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
out_thaw:
thaw_processes();
out:
shutting_down = SHUTDOWN_INVALID;
}
开发者ID:mdamt,项目名称:linux,代码行数:69,代码来源:manage.c
示例18: suspend_devices_and_enter
int suspend_devices_and_enter(suspend_state_t state)
{
int error;
if (!suspend_ops)
return -ENOSYS;
trace_machine_suspend(state);
var_wakeup_sts = 0;
var_during_suspend = 1;
pmc_disable_save_wakeup_events();
if (suspend_ops->begin) {
error = suspend_ops->begin(state);
if (error)
goto Close;
}
/*
suspend_console();
*/
suspend_test_start();
error = dpm_suspend_start(PMSG_SUSPEND);
if (error) {
printk(KERN_ERR "PM: Some devices failed to suspend\n");
goto Recover_platform;
}
suspend_test_finish("suspend devices");
if (suspend_test(TEST_DEVICES))
goto Recover_platform;
error = suspend_enter(state);
Resume_devices:
if (wmt_trigger_resume_kpad){
wmt_trigger_resume_kpad=0;
wmt_resume_kpad();
}
if (wmt_trigger_resume_notify){
wmt_trigger_resume_notify=0;
wmt_resume_notify();
}
suspend_test_start();
dpm_resume_end(PMSG_RESUME);
suspend_test_finish("resume devices");
resume_console();
printk("WMT wake up event %x\n",WMT_WAKE_UP_EVENT);
WMT_WAKE_UP_EVENT = 0;
Close:
if (suspend_ops->end)
suspend_ops->end();
pmc_enable_wakeup_restore_events();
var_during_suspend = 0;
trace_machine_suspend(PWR_EVENT_EXIT);
return error;
Recover_platform:
if (suspend_ops->recover)
suspend_ops->recover();
goto Resume_devices;
}
开发者ID:buddyspike,项目名称:springboard-kernel-bsp,代码行数:62,代码来源:suspend.c
示例19: do_suspend
static void do_suspend(void)
{
int err;
struct suspend_info si;
shutting_down = SHUTDOWN_SUSPEND;
#ifdef CONFIG_PREEMPT
/* If the kernel is preemptible, we need to freeze all the processes
to prevent them from being in the middle of a pagetable update
during suspend. */
err = freeze_processes();
if (err) {
pr_err("%s: freeze failed %d\n", __func__, err);
goto out;
}
#endif
err = dpm_suspend_start(PMSG_FREEZE);
if (err) {
pr_err("%s: dpm_suspend_start %d\n", __func__, err);
goto out_thaw;
}
printk(KERN_DEBUG "suspending xenstore...\n");
xs_suspend();
err = dpm_suspend_end(PMSG_FREEZE);
if (err) {
pr_err("dpm_suspend_end failed: %d\n", err);
si.cancelled = 0;
goto out_resume;
}
si.cancelled = 1;
err = stop_machine(xen_suspend, &si, cpumask_of(0));
/* Resume console as early as possible. */
if (!si.cancelled)
xen_console_resume();
raw_notifier_call_chain(&xen_resume_notifier, 0, NULL);
dpm_resume_start(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
if (err) {
pr_err("failed to start xen_suspend: %d\n", err);
si.cancelled = 1;
}
out_resume:
if (!si.cancelled) {
xen_arch_resume();
xs_resume();
} else
xs_suspend_cancel();
dpm_resume_end(si.cancelled ? PMSG_THAW : PMSG_RESTORE);
out_thaw:
#ifdef CONFIG_PREEMPT
thaw_processes();
out:
#endif
shutting_down = SHUTDOWN_INVALID;
}
开发者ID:AkyZero,项目名称:wrapfs-latest,代码行数:67,代码来源:manage.c
示例20: hibernation_on_memory_enter
/**
* hom_freeze_devices_and_enter -
* freeze devices and enter in hibernation on memory
*/
static int hibernation_on_memory_enter(void)
{
int error = 0;
unsigned long pe_counter;
if (!hom_ops)
return -ENOSYS;
pr_debug("[STM]:[PM]: platform_begin\n");
error = platform_begin();
if (error)
goto Close;
suspend_console();
pr_debug("[STM]:[PM]: Suspend devices\n");
error = dpm_suspend_start(PMSG_FREEZE);
if (error)
goto Resume_devices;
pr_debug("[STM]:[PM]: Suspend devices (noirq)\n");
error = dpm_suspend_noirq(PMSG_FREEZE);
if (error)
goto Resume_devices_noirq;
error = disable_nonboot_cpus();
if (error)
goto Enable_cpus;
local_irq_disable();
pr_debug("[STM]:[PM]: Suspend sysdevices\n");
error = sysdev_suspend(PMSG_FREEZE);
if (error)
goto Enable_irqs;
pr_debug("[STM]:[PM]: platform_prepare\n");
error = platform_prepare();
if (error) {
pr_err("[STM]:[PM]: platform_prepare has refused the HoM\n");
goto Skip_enter;
}
pr_debug("[STM]:[PM]: platform_enter\n");
pe_counter = preempt_count();
platform_enter();
BUG_ON(pe_counter != preempt_count());
Skip_enter:
pr_debug("[STM]:[PM]: platform_complete\n");
platform_complete();
pr_debug("[STM]:[PM]: Resumed sysdevices\n");
sysdev_resume();
Enable_irqs:
local_irq_enable();
Enable_cpus:
enable_nonboot_cpus();
Resume_devices_noirq:
pr_debug("[STM]:[PM]: Resume devices (noirq)\n");
dpm_resume_noirq(PMSG_RESTORE);
Resume_devices:
pr_debug("[STM]:[PM]: Resume devices\n");
dpm_resume_end(PMSG_RESTORE);
resume_console();
Close:
pr_debug("[STM]:[PM]: platform_end\n");
platform_end();
pr_debug("[STM]:[PM]: exit\n");
return error;
}
开发者ID:highzeth,项目名称:satip-axe,代码行数:88,代码来源:hom.c
注:本文中的dpm_resume_end函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论