Function report |
Source Code:fs\char_dev.c |
Create Date:2022-07-28 20:02:45 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name: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.
Proto:static struct char_device_struct *__register_chrdev_region(unsigned int major, unsigned int baseminor, int minorct, const char *name)
Type:struct char_device_struct
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned int | major | |
unsigned int | baseminor | |
int | minorct | |
const char * | name |
100 | struct char_device_struct * cd, * curr, * prev = NULL |
104 | If major >= s/char_dev.c Then |
105 | pr_err("CHRDEV \"%s\" major requested (%u) is greater than the maximum (%u)\n", name, major, s/char_dev.c - 1) |
116 | cd = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
120 | mutex_lock( & chrdevs_lock) |
122 | If major == 0 Then |
123 | ret = find_dynamic_major() |
124 | If ret < 0 Then |
133 | i = dex in the above |
147 | Go to out |
155 | If Not prev Then |
158 | Else |
164 | Return cd |
165 | out : |
Name | Describe |
---|---|
register_chrdev_region | gister_chrdev_region() - register a range of device numbers*@from: the first in the desired range of device numbers; must include* the major number.*@count: the number of consecutive device numbers required*@name: the name of the device or driver. |
alloc_chrdev_region | alloc_chrdev_region() - register a range of char device numbers*@dev: output parameter for first assigned number*@baseminor: first of the requested range of minor numbers*@count: the number of minor numbers required*@name: the name of the associated |
__register_chrdev | __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 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |