Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\suspend.c Create Date:2022-07-28 09:58:16
Last Modify:2020-03-17 14:47:48 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:suspend_prepare - Prepare for entering system sleep state.* Common code run for every system sleep state that can be entered (except for* hibernation). Run suspend notifiers, allocate the "suspend" console and* freeze processes.

Proto:static int suspend_prepare(suspend_state_t state)

Type:int

Parameter:

TypeParameterName
suspend_state_tstate
345  nr_calls = 0
347  If Not sleep_state_supported(state) Then Return -EPERM
350  pm_prepare_console()
352  error = __pm_notifier_call_chain(Going to suspend the system , - 1, & nr_calls)
353  If error Then
354  nr_calls--
355  Go to Finish
358  trace_suspend_resume(TPS("freeze_processes"), 0, true)
359  error = suspend_freeze_processes()
360  trace_suspend_resume(TPS("freeze_processes"), 0, false)
361  If Not error Then Return 0
364  failed_freeze++
365  dpm_save_failed_step(SUSPEND_FREEZE)
366  Finish :
367  __pm_notifier_call_chain(Suspend finished , nr_calls, NULL)
368  pm_restore_console()
369  Return error
Caller
NameDescribe
enter_stater_state - Do common work needed to enter system sleep state.*@state: System sleep state to enter.* Make sure that no one else is trying to put the system into a sleep state.* Fail if that's not the case. Otherwise, prepare for system suspend, make the