Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\hibernate.c Create Date:2022-07-28 09:59:11
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:reate_image - Create a hibernation image.*@platform_mode: Whether or not to use the platform driver.* Execute device drivers' "late" and "noirq" freeze callbacks, create a* hibernation image and run the drivers' "noirq" and "early" thaw callbacks.

Proto:static int create_image(int platform_mode)

Type:int

Parameter:

TypeParameterName
intplatform_mode
278  error = dpm_suspend_end(PMSG_FREEZE)
279  If error Then
280  pr_err("Some devices failed to power down, aborting hibernation\n")
281  Return error
284  error = platform_pre_snapshot - Call platform to prepare the machine for hibernation.*@platform_mode: Whether or not to use the platform driver.* Use the platform driver to prepare the system for creating a hibernate image,
285  If error || hibernation_test(TEST_PLATFORM) Then Go to Platform_finish
288  error = suspend_disable_secondary_cpus()
289  If error || hibernation_test(TEST_CPUS) Then Go to Enable_cpus
292  local_irq_disable()
294  Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. = SYSTEM_SUSPEND
296  error = syscore_suspend()
297  If error Then
298  pr_err("Some system devices failed to power down, aborting hibernation\n")
299  Go to Enable_irqs
302  If hibernation_test(TEST_CORE) || pm_wakeup_pending() Then Go to Power_up
305  in_suspend = 1
306  save_processor_state()
307  trace_suspend_resume(TPS("machine_suspend"), Hibernation image has been saved, true)
308  error = swsusp_arch_suspend()
310  restore_processor_state()
311  trace_suspend_resume(TPS("machine_suspend"), Hibernation image has been saved, false)
312  If error Then pr_err("Error %d creating hibernation image\n", error)
315  If Not in_suspend Then
316  events_check_enabled = false
317  clear_free_pages()
320  platform_leave - Call platform to prepare a transition to the working state.*@platform_mode: Whether or not to use the platform driver.* Use the platform driver prepare to prepare the machine for switching to the* normal mode of operation.
322  Power_up :
323  syscore_resume()
325  Enable_irqs :
326  Values used for system_state. Ordering of the states must not be changed* as code checks for <, <=, >, >= STATE. = SYSTEM_RUNNING
327  The local_irq_*() APIs are equal to the raw_local_irq*()* if !TRACE_IRQFLAGS.()
329  Enable_cpus :
330  suspend_enable_secondary_cpus()
333  If Not in_suspend Then error = arch_resume_nosmt()
336  Platform_finish :
337  platform_finish - Call platform to switch the system to the working state.*@platform_mode: Whether or not to use the platform driver.* Use the platform driver to switch the machine to the normal mode of* operation.
339  dpm_resume_start(in_suspend ? (error ? PMSG_RECOVER : PMSG_THAW) : PMSG_RESTORE)
342  Return error
Caller
NameDescribe
hibernation_snapshothibernation_snapshot - Quiesce devices and create a hibernation image.*@platform_mode: If set, use platform driver to prepare for the transition.* This routine must be called with system_transition_mutex held.