函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:pm_wake_lock

函数原型:int pm_wake_lock(const char *buf)

返回类型:int

参数:

类型参数名称
const char *buf
208  str等于buf
210  timeout_ns等于0
212  ret等于0
214  如果非操作权限检查则返回:负EPERM
217 str且非Note: isspace() must return false for %NUL-terminator ( * str)循环
218  str自加
220  len等于strbuf
221  如果非len则返回:负EINVAL
224  如果strstr不等于'\n'则
226  ret等于kstrtou64(字符串删除空格, 10, & timeout_ns)
227  如果ret则返回:负EINVAL
231  mutex_lock( & wakelocks_lock)
233  wl等于wakelock_lookup_add(buf, len, true)
234  如果是错误
235  ret等于错误
236  转到:out
238  如果timeout_ns
239  timeout_ms等于timeout_nsNSEC_PER_MSEC减1
241  do_div() is NOT a C function(timeout_ms, NSEC_PER_MSEC)
242  __pm_wakeup_event(ws, timeout_ms)
243  否则
244  __pm_stay_awake(ws)
247  wakelocks_lru_most_recent(wl)
249  out :
250  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.
251  返回:ret