Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:arch\x86\kernel\msr.c Create Date:2022-07-28 08:18:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:msr_read

Proto:static ssize_t msr_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
struct file *file
char __user *buf
size_tcount
loff_t *ppos
48  __user * tmp = buf
50  reg = ppos
51  cpu = iminor(file_inode(file))
52  err = 0
53  bytes = 0
55  If count % 8 Then Return -EINVAL
58  When count cycle
59  err = rdmsr_safe_on_cpu(cpu, reg, & data[0], & data[1])
60  If err Then Break
62  If copy_to_user(tmp, & data, 8) Then
63  err = -EFAULT
64  Break
66  tmp += 2
67  bytes += 8
70  Return If bytes Then bytes Else err