函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:To test system suspend, we need a hands-off mechanism to resume the* system. RTCs wake alarms are a common self-contained mechanism.

函数原型:static void __init test_wakealarm(struct rtc_device *rtc, suspend_state_t state)

返回类型:void

参数:

类型参数名称
struct rtc_device *rtc
suspend_state_tstate
64  static char err_readtime[] __initdata = r conditions  "PM: can't read %s time, err %d\n"
66  static char err_wakealarm[] __initdata = r conditions  "PM: can't set %s wakealarm, err %d\n"
68  static char err_suspend[] __initdata = r conditions  "PM: suspend test failed, error %d\n"
70  static char info_test[] __initdata = formational  "PM: test RTC wakeup from '%s' suspend\n"
78  repeat :
79  status等于rtc_read_time(rtc, & ime the alarm is set to )
80  如果status小于0则
81  printk(err_readtime, dev_name( & dev), status)
82  返回
84  rtc_tm_to_time( & ime the alarm is set to , & now)
86  memset( & alm, 0, sizeofalm)
87  rtc_time_to_tm(now + We test the system suspend code by setting an RTC wakealarm a short* time in the future, then suspending, & ime the alarm is set to )
88  0 = alarm disabled, 1 = alarm enabled = true
90  status等于rtc_set_alarm(rtc, & alm)
91  如果status小于0则
92  printk(err_wakealarm, dev_name( & dev), status)
93  返回
96  如果state恒等于PM_SUSPEND_MEM
97  printk(info_test, pm_states[state])
98  status等于pm_suspend - Externally visible function for suspending the system.*@state: System sleep state to enter.* Check if the value of @state represents one of the supported states,* execute enter_state() and update system suspend statistics.
99  如果status恒等于负ENODEVstate等于PM_SUSPEND_STANDBY
102  如果state恒等于PM_SUSPEND_STANDBY
103  printk(info_test, pm_states[state])
104  status等于pm_suspend - Externally visible function for suspending the system.*@state: System sleep state to enter.* Check if the value of @state represents one of the supported states,* execute enter_state() and update system suspend statistics.
105  如果status小于0则state等于PM_SUSPEND_TO_IDLE
108  如果state恒等于PM_SUSPEND_TO_IDLE
109  printk(info_test, pm_states[state])
110  status等于pm_suspend - Externally visible function for suspending the system.*@state: System sleep state to enter.* Check if the value of @state represents one of the supported states,* execute enter_state() and update system suspend statistics.
113  如果status小于0则printk(err_suspend, status)
116  test_repeat_count_current自加
117  如果test_repeat_count_current小于test_repeat_count_max则转到:repeat
124  0 = alarm disabled, 1 = alarm enabled = false
125  rtc_set_alarm(rtc, & alm)
调用者
名称描述
test_suspend