Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:hibernation_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.

Proto:int hibernation_snapshot(int platform_mode)

Type:int

Parameter:

TypeParameterName
intplatform_mode
356  pm_suspend_clear_flags()
357  error = platform_begin - Call platform to start hibernation.*@platform_mode: Whether or not to use the platform driver.
358  If error Then Go to Close
362  error = hibernate_preallocate_memory - Preallocate memory for hibernation image
363  If error Then Go to Close
366  error = ze_kernel_threads - Make freezable kernel threads go to the refrigerator.* On success, returns 0. On failure, -errno and only the kernel threads are* thawed, so as to give a chance to the caller to do additional cleanups
367  If error Then Go to Cleanup
370  If hibernation_test(TEST_FREEZER) Then
376  freezer_test_done = true
377  Go to Thaw
380  error = dpm_prepare(PMSG_FREEZE)
381  If error Then
382  dpm_complete(PMSG_RECOVER)
383  Go to Thaw
386  Suspend and resume console messages over PM events
387  pm_restrict_gfp_mask()
389  error = dpm_suspend(PMSG_FREEZE)
391  If error || hibernation_test(TEST_DEVICES) Then platform_recover - Recover from a failure to suspend devices.*@platform_mode: Whether or not to use the platform driver.
393  Else error = 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.
403  If error || Not in_suspend Then swsusp_free()
406  msg = If in_suspend Then If error Then PMSG_RECOVER Else PMSG_THAW Else PMSG_RESTORE
407  dpm_resume(msg)
409  If error || Not in_suspend Then pm_restore_gfp_mask()
412  resume_console()
413  dpm_complete(msg)
415  Close :
416  platform_end - Call platform to finish transition to the working state.*@platform_mode: Whether or not to use the platform driver.
417  Return error
419  Thaw :
420  thaw_kernel_threads()
421  Cleanup :
422  swsusp_free()
423  Go to Close
Caller
NameDescribe
hibernatehibernate - Carry out system hibernation, including saving the image.
snapshot_ioctl