函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:software_resume - Resume from a saved hibernation image.* This routine is called as a late initcall, when all devices have been* discovered and initialized already.* The image reading code is called to see if there is a hibernation image

函数原型:static int software_resume(void)

返回类型:int

参数:

804  nr_calls等于0
809  如果noresume或非hibernation_available()则返回:0
822  mutex_lock_nested( & system_transition_mutex, For trivial one-depth nesting of a lock-class, the following* global define can be used. (Subsystems with multiple levels* of nesting should define their own lock-nesting subclasses.))
824  如果swsusp_resume_device则转到:Check_image
827  如果非strlen - Find the length of a string*@s: The string to be sized
828  error等于负ENOENT
829  转到:Unlock
832  pm_pr_dbg("Checking hibernation image partition %s\n", resume_file)
834  如果resume_delay
835  打印信息("Waiting %dsec before reading resume device ...\n", resume_delay)
837  ssleep(resume_delay)
841  swsusp_resume_device等于name_to_dev_t(resume_file)
847  如果是数字resume_wait
849  当非get_gendisk - get partitioning information for a given device*@devt: device to get partitioning information for*@partno: returned partition index* This function gets the structure containing partitioning* information for the given device @devt.循环
850  msleep(10)
853  如果非swsusp_resume_device
858  wait_for_device_probe()
860  如果resume_wait
862  msleep(10)
866  swsusp_resume_device等于name_to_dev_t(resume_file)
867  如果非swsusp_resume_device
868  error等于负ENODEV
869  转到:Unlock
873  Check_image :
874  pm_pr_dbg("Hibernation image partition %d:%d present\n", MAJOR(swsusp_resume_device), MINOR(swsusp_resume_device))
877  pm_pr_dbg("Looking for hibernation image.\n")
878  error等于kernel/power/hibernate.c
879  如果error则转到:Unlock
883  如果非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.
884  error等于负EBUSY
885  swsusp_close(le is open for reading )
886  转到:Unlock
889  打印信息("resume from hibernation\n")
890  pm_prepare_console()
891  error等于__pm_notifier_call_chain(Going to restore a saved image , - 1, & nr_calls)
892  如果error
893  nr_calls自减
894  转到:Close_Finish
897  pm_pr_dbg("Preparing processes for restore.\n")
898  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
899  如果error则转到:Close_Finish
901  error等于load_image_and_restore()
902  thaw_processes()
903  Finish :
904  __pm_notifier_call_chain(Restore failed , nr_calls, NULL)
905  pm_restore_console()
906  打印信息("resume from hibernation failed (%d)\n", error)
907  atomic_inc( & If unset, the snapshot device cannot be open. )
909  Unlock :
910  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
911  pm_pr_dbg("Hibernation image not present or could not be loaded.\n")
912  返回:error
913  Close_Finish :
914  swsusp_close(le is open for reading )
915  转到:Finish
调用者
名称描述
resume_store