函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mtrr_ioctl

函数原型:static long mtrr_ioctl(struct file *file, unsigned int cmd, unsigned long __arg)

返回类型:long

参数:

类型参数名称
struct file *file
unsigned intcmd
unsigned long__arg
160  err等于0
166  __userarg等于__arg
168  memset( & gentry, 0, gentry的长度)
171  :cmd恒等于These are the various ioctls
172  :cmd恒等于MTRRIOC_SET_ENTRY
173  :cmd恒等于MTRRIOC_DEL_ENTRY
174  :cmd恒等于MTRRIOC_KILL_ENTRY
175  :cmd恒等于MTRRIOC_ADD_PAGE_ENTRY
176  :cmd恒等于MTRRIOC_SET_PAGE_ENTRY
177  :cmd恒等于MTRRIOC_DEL_PAGE_ENTRY
178  :cmd恒等于MTRRIOC_KILL_PAGE_ENTRY
179  如果copy_from_user( & sentry, arg, sentry的长度)则返回:负EFAULT
181  退出
182  :cmd恒等于MTRRIOC_GET_ENTRY
183  :cmd恒等于MTRRIOC_GET_PAGE_ENTRY
184  如果copy_from_user( & gentry, arg, gentry的长度)则返回:负EFAULT
186  退出
188  :cmd恒等于MTRRIOC32_ADD_ENTRY
189  :cmd恒等于MTRRIOC32_SET_ENTRY
190  :cmd恒等于MTRRIOC32_DEL_ENTRY
191  :cmd恒等于MTRRIOC32_KILL_ENTRY
192  :cmd恒等于MTRRIOC32_ADD_PAGE_ENTRY
193  :cmd恒等于MTRRIOC32_SET_PAGE_ENTRY
194  :cmd恒等于MTRRIOC32_DEL_PAGE_ENTRY
195  :cmd恒等于MTRRIOC32_KILL_PAGE_ENTRY
196  __users32
198  s32等于__arg
199  err等于Careful: we have to cast the result to the type of the pointer* for sign reasons(Base address , & Base address )
200  err或等于Careful: we have to cast the result to the type of the pointer* for sign reasons(Size of region , & Size of region )
201  err或等于Careful: we have to cast the result to the type of the pointer* for sign reasons(Type of region , & Type of region )
202  如果err则返回:err
204  退出
206  :cmd恒等于MTRRIOC32_GET_ENTRY
207  :cmd恒等于MTRRIOC32_GET_PAGE_ENTRY
208  __userg32
210  g32等于__arg
211  err等于Careful: we have to cast the result to the type of the pointer* for sign reasons( Register number , & Register number )
212  err或等于Careful: we have to cast the result to the type of the pointer* for sign reasons( Base address , & Base address )
213  err或等于Careful: we have to cast the result to the type of the pointer* for sign reasons( Size of region , & Size of region )
214  err或等于Careful: we have to cast the result to the type of the pointer* for sign reasons( Type of region , & Type of region )
215  如果err则返回:err
217  退出
223  默认
224  返回:负ENOTTY
225  :cmd恒等于These are the various ioctls
227  :cmd恒等于MTRRIOC32_ADD_ENTRY
229  如果非操作权限检查则返回:负EPERM
234  退出
235  :cmd恒等于MTRRIOC_SET_ENTRY
237  :cmd恒等于MTRRIOC32_SET_ENTRY
239  如果非操作权限检查则返回:负EPERM
242  退出
243  :cmd恒等于MTRRIOC_DEL_ENTRY
245  :cmd恒等于MTRRIOC32_DEL_ENTRY
247  如果非操作权限检查则返回:负EPERM
250  退出
251  :cmd恒等于MTRRIOC_KILL_ENTRY
253  :cmd恒等于MTRRIOC32_KILL_ENTRY
255  如果非操作权限检查则返回:负EPERM
258  退出
259  :cmd恒等于MTRRIOC_GET_ENTRY
261  :cmd恒等于MTRRIOC32_GET_ENTRY
263  如果 Register number 大于等于num_var_ranges则返回:负EINVAL
265  get( Register number , & base, & size, & type)
268  如果basesize减1大于等于1UL左移8乘 Size of region 的长度减PAGE_SHIFT determines the page size 位或size大于等于1UL左移8乘 Size of region 的长度减PAGE_SHIFT determines the page size 位则 Base address 等于 Size of region 等于 Type of region 等于0
271  否则
277  退出
278  :cmd恒等于MTRRIOC_ADD_PAGE_ENTRY
282  如果非操作权限检查则返回:负EPERM
287  退出
288  :cmd恒等于MTRRIOC_SET_PAGE_ENTRY
292  如果非操作权限检查则返回:负EPERM
296  退出
297  :cmd恒等于MTRRIOC_DEL_PAGE_ENTRY
301  如果非操作权限检查则返回:负EPERM
304  退出
305  :cmd恒等于MTRRIOC_KILL_PAGE_ENTRY
309  如果非操作权限检查则返回:负EPERM
312  退出
313  :cmd恒等于MTRRIOC_GET_PAGE_ENTRY
317  如果 Register number 大于等于num_var_ranges则返回:负EINVAL
319  get( Register number , & base, & size, & type)
321  如果size不等于size Base address 等于 Size of region 等于 Type of region 等于0
323  否则
328  退出
331  如果err则返回:err
335  :cmd恒等于MTRRIOC_GET_ENTRY
337  如果copy_to_user(arg, & gentry, gentry的长度)则err等于负EFAULT
339  退出
341  :cmd恒等于MTRRIOC32_GET_ENTRY
343  __userg32
345  g32等于__arg
350  退出
354  返回:err