函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:do_read

函数原型:static ssize_t do_read(struct file *fp, char __user *buf, size_t count, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *fp
char __user *buf
size_tcount
loff_t *ppos
1468  as等于 needed for tty driver, and maybe others
1469  如果check_apm_user(as, "read")则返回:负EIO
1471  如果count小于sizeof(apm_event_t)则返回:负EINVAL
1473  如果queue_empty(as)且f_flags按位与O_NONBLOCK则返回:负EAGAIN
1475  wait_event_interruptible - sleep until a condition gets true*@wq_head: the waitqueue to wait on*@condition: a C expression for the event to wait for* The process is put to sleep (TASK_INTERRUPTIBLE) until the(apm_waitqueue, !queue_empty(as))
1476  i等于count
1477 i大于等于event的长度且非queue_empty(as)循环
1478  event等于get_queued_event(as)
1479  如果copy_to_user(buf, & event, event的长度)则
1480  如果i小于count退出
1482  返回:负EFAULT
1485  :event恒等于APM_SYS_SUSPEND
1486  :event恒等于APM_USER_SUSPEND
1487  suspends_read自加
1488  退出
1491  :event恒等于APM_USER_STANDBY
1492  standbys_read自加
1493  退出
1495  buf加等于event的长度
1496  i减等于event的长度
1498  如果i小于count则返回:counti
1500  如果signal_pending(当前进程)则返回:负These should never be seen by user programs. To return one of ERESTART** codes, signal_pending() MUST be set. Note that ptrace can observe these* at syscall exit tracing, but they will never be left for the debugged user* process to see.
1502  返回:0