函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\hibernate.c Create Date:2022-07-27 10:59:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:hibernate - Carry out system hibernation, including saving the image.

函数原型:int hibernate(void)

返回类型:int

参数:

697  nr_calls等于0
698  bool snapshot_test = false
700  如果非hibernation_available()则
701  pm_pr_dbg("Hibernation not available.\n")
702  返回:负EPERM
705  lock_system_sleep()
707  如果非atomic_add_unless - add unless the number is already a given value*@v: pointer of type atomic_t*@a: the amount to add to v...*@u: ...unless v is equal to u.* Atomically adds @a to @v, if @v was not already @u.* Returns true if the addition was done.
708  error等于负EBUSY
709  转到:Unlock
712  打印信息("hibernation entry\n")
713  pm_prepare_console()
714  error等于__pm_notifier_call_chain(Going to hibernate , - 1, & nr_calls)
715  如果error
716  nr_calls自减
717  转到:Exit
720  ksys_sync_helper()
722  error等于ze_processes - Signal user space processes to enter the refrigerator.* The current thread will not be frozen. The same process that calls* freeze_processes must later call thaw_processes.* On success, returns 0
723  如果error则转到:Exit
726  lock_device_hotplug()
728  error等于create_basic_memory_bitmaps()
729  如果error则转到:Thaw
732  error等于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.
733  如果errorfreezer_test_done则转到:Free_bitmaps
736  如果in_suspend
737  flags等于0
739  如果hibernation_mode恒等于HIBERNATION_PLATFORMflags或等于Flags that can be passed from the hibernatig hernel to the "boot" kernel in* the image header.
741  如果nocompressflags或等于SF_NOCOMPRESS_MODE
743  否则flags或等于SF_CRC32_MODE
746  pm_pr_dbg("Writing image.\n")
747  error等于swsusp_write(flags)
748  swsusp_free()
749  如果非error
755  in_suspend等于0
756  pm_restore_gfp_mask()
757  否则
758  pm_pr_dbg("Image restored successfully.\n")
761  Free_bitmaps :
762  free_basic_memory_bitmaps()
763  Thaw :
764  unlock_device_hotplug()
765  如果snapshot_test
766  pm_pr_dbg("Checking hibernation image\n")
767  error等于kernel/power/hibernate.c
768  如果非errorerror等于load_image_and_restore()
771  thaw_processes()
774  freezer_test_done = false
775  Exit :
776  __pm_notifier_call_chain(Hibernation finished , nr_calls, NULL)
777  pm_restore_console()
778  atomic_inc( & If unset, the snapshot device cannot be open. )
779  Unlock :
780  unlock_system_sleep()
781  打印信息("hibernation exit\n")
783  返回:error
调用者
名称描述
try_to_suspend