Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:setup_data_data_read

Proto:static ssize_t setup_data_data_read(struct file *fp, struct kobject *kobj, struct bin_attribute *bin_attr, char *buf, loff_t off, size_t count)

Type:ssize_t

Parameter:

TypeParameterName
struct file *fp
struct kobject *kobj
struct bin_attribute *bin_attr
char *buf
loff_toff
size_tcount
152  ret = 0
157  ret = kobj_to_setup_data_nr(kobj, & nr)
158  If ret Then Return ret
161  ret = get_setup_data_paddr(nr, & paddr)
162  If ret Then Return ret
164  data = memremap(paddr, size of data , MEMREMAP_WB)
165  If Not data Then Return -ENOMEM
168  If type == SETUP_INDIRECT && type != SETUP_INDIRECT Then
170  paddr = addr
171  len = len
172  Else
173  paddr += size of data
174  len = len
177  If off > len Then
178  ret = -EINVAL
179  Go to out
182  If count > len - off Then count = len - off
185  If Not count Then Go to out
188  ret = count
189  p = memremap(paddr, len, MEMREMAP_WB)
190  If Not p Then
191  ret = -ENOMEM
192  Go to out
194  memcpy(buf, p + off, count)
195  memunmap(p)
196  out :
197  memunmap(data)
198  Return ret