函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\char_dev.c Create Date:2022-07-29 10:32:40
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:__register_chrdev() - create and register a cdev occupying a range of minors*@major: major device number or 0 for dynamic allocation*@baseminor: first of the requested range of minor numbers*@count: the number of minor numbers required*@name: name of this

函数原型:int __register_chrdev(unsigned int major, unsigned int baseminor, unsigned int count, const char *name, const struct file_operations *fops)

返回类型:int

参数:

类型参数名称
unsigned intmajor
unsigned intbaseminor
unsigned intcount
const char *name
const struct file_operations *fops
274  err等于负ENOMEM
276  cd等于Register a single major with a specified minor range.* If major == 0 this function will dynamically allocate an unused major.* If major > 0 this function will attempt to reserve the range of minors* with given major.
277  如果是错误则返回:错误
280  cdev等于dev_alloc() - allocate a cdev structure* Allocates and returns a cdev structure, or NULL on failure.
281  如果非cdev则转到:out2
284  owner等于owner
285  ops等于fops
286  kobject_set_name() - Set the name of a kobject
288  err等于dev_add() - add a char device to the system*@p: the cdev structure for the device*@dev: the first device number for which this device is responsible*@count: the number of consecutive minor numbers corresponding to this* device* cdev_add() adds the device
289  如果err则转到:out
292  will die 等于cdev
294  返回:如果major则0否则major
295  out :
296  递减引用计数对象
297  out2 :
298  释放内存
299  返回:err
调用者
名称描述
cpuid_init
msr_init
register_chrdev