__devexit_p的功能
2024-10-20 03:59:47
看驱动的时候,时常会有如下代码:
.remove = __devexit_p(XX_exit),
这里的__devexit_p有什么作用呢?
我在include/linux/init.h中找到了它的定义:
/* Functions marked as __devexit may be discarded at kernel link time, depending
on config options. Newer versions of binutils detect references from
retained sections to discarded sections and flag an error. Pointers to
__devexit functions must use __devexit_p(function_name), the wrapper will
insert either the function_name or NULL, depending on the config options.
*/
#if defined(MODULE) || defined(CONFIG_HOTPLUG)
#define __devexit_p(x) x
#else
#define __devexit_p(x) NULL
#endif
编译成模块或有热拔插功能时, 就需要exit函数。 否则可以为NULL, 节约空间
最新文章
- CI Weekly #6 | 再谈 Docker / CI / CD 实践经验
- zabbix触发器依赖
- Simple colum formatting in Yii 2 GridView
- tarjan算法+缩点:求强连通分量 POJ 2186
- Watch The Movie
- Storyboard 跳转 和 传值
- 机器学习之神经网络模型-上(Neural Networks: Representation)
- 服务端缓存HttpRuntime.Cache的使用
- 修改win7注册表发挥大容量内存优势
- Ubuntu 16.04 LTS安装搜狗拼音输入法网易云音乐 Remarkable
- 连表查询都用Left Join吧
- Rest API 操作List Items
- rest_famework 增删改查初第二阶段(中级,此阶段是优化初级阶段的代码)的使用
- Ubuntu 安装 VS code
- owa2013配置HTTPS
- Hadoop集群安装-CDH5(3台服务器集群)
- Lock 和 synchronized 的区别
- vue路由组件传参
- 3、shader深度测试(Cull、ZWrite 、ZTest )
- C++语言基础(9)-继承
热门文章
- C# winform 获取当前路径
- fatal error: malformed or corrupted AST file: &;#39;Unable to load module Darwin.pcm 问题解决
- [转]oracle存储过程、声明变量、for循环
- 将android程序中的数据库导出到SD卡
- spring如何引用properties文件里的配置
- js 停止事件冒泡 阻止浏览器的默认行为
- asp.net session的使用与过期实例代码
- Collabration Web Application Screenshot(English Language) Free download now!
- HTML&CSS精选笔记_浮动与定位
- sublime常用插件及配置