函数逻辑报告 |
Source Code:fs\char_dev.c |
Create Date:2022-07-29 10:32:39 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: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.
函数原型:static struct char_device_struct *__register_chrdev_region(unsigned int major, unsigned int baseminor, int minorct, const char *name)
返回类型:struct char_device_struct
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| unsigned int | major | |
| unsigned int | baseminor | |
| int | minorct | |
| const char * | name |
| 100 | struct char_device_struct * cd, * curr, * prev = NULL |
| 104 | 如果major大于等于s/char_dev.c 则 |
| 105 | 打印错误信息("CHRDEV \"%s\" major requested (%u) is greater than the maximum (%u)\n", name, major, s/char_dev.c - 1) |
| 107 | 返回:错误号 |
| 111 | 打印错误信息("CHRDEV \"%s\" minor range requested (%u-%u) is out of range of maximum range (%u-%u) for a single major\n", name, baseminor, baseminor + minorct - 1, 0, MINORMASK) |
| 113 | 返回:错误号 |
| 120 | mutex_lock( & chrdevs_lock) |
| 122 | 如果major恒等于0则 |
| 123 | ret等于find_dynamic_major() |
| 124 | 如果ret小于0则 |
| 133 | i等于dex in the above |
| 147 | 转到:out |
| 153 | 长字符串复制 |
| 155 | 如果非prev则 |
| 158 | 否则 |
| 164 | 返回:cd |
| 165 | out : |
| 167 | 释放内存 |
| 168 | 返回:错误号 |
| 名称 | 描述 |
|---|---|
| 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 |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |