MODULE_DEVICE_TABLE
Table module device
2023-09-11 14:19:53 时间
__attribute__((alias(__stringify(A)))) 设置函数、变量的别名
#include <stdio.h> #define __stringify_1(x...) #x #define __stringify(x...) __stringify_1(x) void a(int n) __attribute__((alias(__stringify(A)))); //void sys_socket(int n) __attribute__((alias("SyS_socket"))); void A(int num) { printf("%d\n", num); } int main(void) { a(1); }
驱动程序里经常看到MODULE_DEVICE_TABLE这个宏定义,一般用于动态加载驱动也就是热插拔的时候使用
#define MODULE_DEVICE_TABLE(type, name) \ extern typeof(name) __mod_##type##__##name##_device_table \ __attribute__ ((unused, alias(__stringify(name))))
在编译时,从所有驱动程序中提取此信息,并创建一个设备表。
插入设备时,内核会引用设备表,并且如果找到与添加设备的设备/供应商ID匹配的条目,则将加载驱动
相关文章
- ERROR 1005: Can't create table (errno: 121)
- mysql中参数low_case_table_name的使用?不同参数值的设置有什么影响?
- UVa 10820 - Send a Table
- iOS:NAV+TABLE结合
- 第二十章 SQL命令 CREATE TABLE AS SELECT
- 第十八章 SQL命令 CREATE TABLE(五)
- Vue - 纯前端导出 Table 表格本页数据(Excel)
- pt-online-schema-change 和 oak-online-alter-table功能对比
- table多选
- css- 列表-表格table-轮廓-定位-浮动-盒子模型
- jquery ajax自动生成表格table(一)
- 修改el-table表头颜色
- elementui 更改 el-table 表头样式及修改el-table表格边框的注意事项
- [Oracle]如何观察Table 的各种Lock 之间的冲突
- bootstrap-table中使用bootstrap-switch开关按钮
- MySQL check table/optimize table/analyze table/REPAIR TABLE
- Vue使用ElementUI对table的指定列进行合算