函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cpuid_read

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

返回类型:ssize_t

参数:

类型参数名称
struct file *file
char __user *buf
size_tcount
loff_t *ppos
65  __usertmp等于buf
67  cpu等于iminor(file_inode(file))
68  pos等于ppos
69  bytes等于0
70  err等于0
72  如果count取模16则返回:负EINVAL
75  init_completion( & done)
76 count循环
77  call_single_data_t csd = {func = cpuid_smp_cpuid, info = & cmd, }
82  eax等于pos
83  ecx等于pos右移32位
85  err等于smp_call_function_single_async(cpu, & csd)
86  如果err退出
88  wait_for_completion( & done)
89  如果copy_to_user(tmp, & regs, 16)则
90  err等于负EFAULT
91  退出
93  tmp加等于16
94  bytes加等于16
95  ppos等于pos先自加
96  _completion - reinitialize a completion structure*@x: pointer to completion structure that is to be reinitialized* This inline function should be used to reinitialize a completion structure so it can* be reused
99  返回:如果bytesbytes否则err