浅析struct device结构体
device结构体:设备驱动模型中的基础结构体之一
struct device {
/*设备所依附的父设备
大多数情况下,这样的设备是某种总线或主控制器
如果该成员变量的值为NULL,表示当前设备是一个最顶端设备,通常这样的设备都不是你想得到的那个*/
struct device *parent;
struct device_private *p;
struct kobject kobj;
const char *init_name; /* initial name of the device */
const struct device_type *type;
struct mutex mutex; /* mutex to synchronize calls to its driver.*/
struct bus_type *bus; /* type of bus device is on */
struct device_driver *driver; /* which driver has allocated this device */
void *platform_data; /* Platform specific data, device core doesn't touch it */
struct dev_pm_info power;
struct dev_pm_domain *pm_domain;
#ifdef CONFIG_NUMA
int numa_node; /* NUMA node this device is close to */
#endif
u64 *dma_mask; /* dma mask (if dma'able device) */
u64 coherent_dma_mask;/* Like dma_mask, but for alloc_coherent mappings as not all hardware supports
64 bit addresses for consistent allocations such descriptors. */
struct device_dma_parameters *dma_parms;
struct list_head dma_pools; /* dma pools (if dma'ble) */
struct dma_coherent_mem *dma_mem; /* internal for coherent mem override */
/* arch specific additions */
struct dev_archdata archdata;
struct device_node *of_node; /* associated device tree node */
dev_t devt; /* dev_t, creates the sysfs "dev" */
u32 id; /* device instance */
spinlock_t devres_lock;
struct list_head devres_head;
struct klist_node knode_class;
struct class *class;
const struct attribute_group **groups; /* optional groups */
void (*release)(struct device *dev);
};
浅析struct device结构体的更多相关文章
- Linux内核device结构体分析
1.前言 Linux内核中的设备驱动模型,是建立在sysfs设备文件系统和kobject上的,由总线(bus).设备(device).驱动(driver)和类(class)所组成的关系结构,在底层,L ...
- struct ifreq结构体与ip,子网掩码,网关等信息
总结一下,今天学习的关于通过socket,ioctl来获得ip,netmask等信息,其中很多内容参照了很多网上的信息,我会一一列出的 我用的这个函数,就是下面这个函数,其中的有一些全局变量,很好懂, ...
- Windows驱动开发-Device结构体
每个驱动程序会创建一个或多个设备对象,每个设备对象都会有一个指针指向下一个设备对象 Device结构体源码 typedef struct DECLSPEC_ALIGN(MEMORY_ALLOCATIO ...
- Golang面向对象编程-struct(结构体)
Golang面向对象编程-struct(结构体) 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.什么是面向对象编程 面向对象编程(Object Oriented Program ...
- struct timeval结构体 以及 gettimeofday()函数(转)
struct timeval结构体 转载地址:http://blog.chinaunix.net/uid-20548989-id-2533161.html 该结构体是Linux系统中定义,struct ...
- struct in_addr 结构体
struct in_addr 结构体: struct in_addr { in_addr_t s_addr; }; 表示一个32位的IPv4地址. in_addr_t一般为32位的unsigned i ...
- typedef struct与struct定义结构体
今天在定义结构体的时候发现typedef struct与struct定义结构体有一些不同之处: 结构也是一种数据类型, 能够使用结构变量, 因此, 象其他 类型的变量一样, 在使用结构变量时要先对其 ...
- struct socket结构体详解
原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 .作者信息和本声明.否则将追究法律责任.http://weiguozhihui.blog.51cto.com/3060615/15852 ...
- struct stat结构体简介
在使用这个结构体和方法时,需要引入: <sys/types.h> <sys/stat.h> struct stat这个结构体是用来描述一个linux系统文件系统中的文件属性的结 ...
随机推荐
- c# 第36节 接口的声明
本节内容: 1:字面理解接口 2:计算机的接口是什么呢 3:接口的声明 4:接口的注意点 1:字面理解接口 大家现在手机上,可能有很多app软件,比如天气预报的软件,有很多种,什么墨迹天气啊之类的等等 ...
- Vue props中Object和Array设置默认值
Vue中,在props中设置Object和Array的默认值 seller: { type: Object, default() { return {} } } seller: { type: Obj ...
- web之ics-06
打开网址,四处点击,点到报表中心,跳转新页面 查看源码也没有什么特别的,发现URL栏有?id=1 以为是sql注入,但是并不是,查看大佬的wp 发现这题采用brupsuite爆破 先将抓到的包放到In ...
- layUI学习第一日:myeclipse中使用layUI
第一步:下载layUI,网址:https://www.layui.com/ 第二步:查看layUI解压后的内容,和官网解释各个文件夹的内容 第三部:在myeclipse中新建一个web project ...
- Koa 中间件的执行顺序
中间件工作原理 初始化koa实例后,我们会用use方法来加载中间件(middleware),会有一个数组来存储中间件,use调用顺序会决定中间件的执行顺序. 每个中间件都是一个函数(不是函数将报错), ...
- Winform重写键盘按键事件
/// <summary> /// 重写键盘处理事件,处理退出和回车按钮 /// </summary> protected override bool ProcessCmdKe ...
- CF-1175 B.Catch Overflow!
题目大意:有一个初始变量,值为0,三种操作 for x 一个循环的开始,循环x次 end 一个循环的结束 add 将变量值加一 问最后变量的值是否超过2^32-1,若超过,输出一串字符,不超过则输出变 ...
- Paper | A Pseudo-Blind Convolutional Neural Network for the Reduction of Compression Artifacts
目录 非盲增强网络结构 训练目标 压缩系数预测子网络 网络结构 根据块QP判决结果得到帧QP预测结果 保持时序连续性 实验 发表在2019年TCSVT. 本文提出了一个兼具 预测压缩系数 和 非盲去压 ...
- 微信小程序跳转页面时参数过长导致参数丢失
问题描述: 微信小程序:跳转页面时传参,参数过长导致参数丢失 跳转到文章详情页时,使用的文章链接e.currentTarget.dataset.id过长导致参数丢失 handleClickArticl ...
- flink solt,并行度
转自:https://www.jianshu.com/p/3598f23031e6 简介 Flink运行时主要角色有两个:JobManager和TaskManager,无论是standalone集群, ...