SHARE
TWEET

Untitled

a guest Mar 9th, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. static int create_image(int platform_mode)
  2. {
  3.     int error;
  4.     error = dpm_suspend_end(PMSG_FREEZE);
  5.     if (error) {
  6.         pr_err("Some devices failed to power down, aborting hibernation\n");
  7.         return error;
  8.     }
  9.     error = platform_pre_snapshot(platform_mode);
  10.     if (!(error || hibernation_test(TEST_PLATFORM))) {
  11.         error = disable_nonboot_cpus();
  12.         if (!(error || hibernation_test(TEST_CPUS))) {
  13.             local_irq_disable();
  14.             error = syscore_suspend();
  15.             if (error) {
  16.                 pr_err("Some system devices failed to power down, aborting hibernation\n");
  17.             } else {
  18.                 if (!(hibernation_test(TEST_CORE) || pm_wakeup_pending())) {
  19.                     in_suspend = 1;
  20.                     save_processor_state();
  21.                     trace_suspend_resume(TPS("machine_suspend"), PM_EVENT_HIBERNATE, true);
  22.                     error = swsusp_arch_suspend();
  23.                     /* Restore control flow magically appears here */
  24.                     restore_processor_state();
  25.                     trace_suspend_resume(TPS("machine_suspend"), PM_EVENT_HIBERNATE, false);
  26.                     if (error)
  27.                         pr_err("Error %d creating hibernation image\n", error);
  28.  
  29.                     if (!in_suspend) {
  30.                         events_check_enabled = false;
  31.                         clear_free_pages();
  32.                     }
  33.  
  34.                     platform_leave(platform_mode);
  35.                 }
  36.                 syscore_resume();
  37.             }
  38.             local_irq_enable();
  39.         }
  40.         enable_nonboot_cpus();
  41.     }
  42.     platform_finish(platform_mode);
  43.     dpm_resume_start(in_suspend ?
  44.         (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE);
  45.     return error;
  46. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top