Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1021287
  • 博文数量: 297
  • 博客积分: 11721
  • 博客等级: 上将
  • 技术积分: 3431
  • 用 户 组: 普通用户
  • 注册时间: 2009-05-25 10:21
文章分类

全部博文(297)

文章存档

2016年(9)

2011年(71)

2010年(137)

2009年(80)

分类: 嵌入式

2009-07-24 15:50:17

register_chrdev_region(dev_t first,unsigned int count,char *name)
First :要分配的设备编号范围的初始值(次设备号常设为0);
Count:连续编号范围. 不是被使用只是一个要请求的范围,最终只能分配给你一个号码。分配的号码你可以利用 cat    /proc/devices  看到。
Name:编号相关联的设备名称. (/proc/devices);
动态分配:
Int alloc_chrdev_region(dev_t *dev,unsigned int firstminor,unsigned int count,char *name);
Firstminor : 通常为0;
*dev:存放返回的设备号;
释放:
Void unregist_chrdev_region(dev_t first,unsigned int count);
调用Documentation/devices.txt中能够找到已分配的设备号.
阅读(929) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~