码迷,mamicode.com
首页 > 其他好文 > 详细

struct dev_t

时间:2015-04-09 21:40:35      阅读:135      评论:0      收藏:0      [点我收藏+]

标签:

device number(dev_t)

linux driver 2009-08-21 10:08:03 阅读26 评论0 字号:大中小

dev_t

description
    the dev_t type in is used to hold device numbers—both the major and minor

parts.

header: 
    #include

constructor: 
    MKDEV(int major, int minor);

method: 
    MAJOR(dev_t dev);    //obtain the major part of a dev_t 
    MINOR(dev_t dev);    //obtain the minor part of a dev_t 
    register_chrdev_region();    //manually obtain(register) device numbers

from the system 
    alloc_chrdev_region();        //allocate a major number  by kernel 
    unregister_chrdev_region();    //free the device number back to kernel

int print_dev_t(char *buffer, dev_t dev); //encode the device number into the given buffer; 
char *format_dev_t(char *buffer, dev_t dev); //encode the device number into the given buffer;
转载自:http://leewez.blog.163.com/blog/static/2958954620097211083517/

struct dev_t

标签:

原文地址:http://www.cnblogs.com/Ph-one/p/4411606.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!