博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
__devexit_p的功能
阅读量:6928 次
发布时间:2019-06-27

本文共 629 字,大约阅读时间需要 2 分钟。

看驱动的时候,时常会有如下代码:

.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, 节约空间

转载地址:http://lbkjl.baihongyu.com/

你可能感兴趣的文章
代码里面执行bat
查看>>
当苹果因为UIDevice、udid、uniqueIdentifier而把我们的应用拒之门外invalid binary的时候,呕心沥血解决方法啊...
查看>>
CSS实现DIV层背景透明而文字不透明
查看>>
培养iOS开发新人的一个思路
查看>>
PI专利网站
查看>>
mongoDB oplog的说明及应用
查看>>
超酷JQuery动画分页按钮,鼠标悬停滑动展开
查看>>
如何修改博客园插入代码的默认代码大小? - 心得小记
查看>>
strcpy和memcpy的区别
查看>>
ios 一个正则表达式测试(只可输入中文、字母和数字)
查看>>
VS调试-添加命令行参数
查看>>
Mac和Windows中常见中文字体的英文名称
查看>>
[ACM_图论] Domino Effect (POJ1135 Dijkstra算法 SSSP 单源最短路算法 中等 模板)
查看>>
使用PHP创建一个REST API(Create a REST API with PHP)
查看>>
牛人一个
查看>>
SharePoint 2013 实现多级审批工作流
查看>>
Java泛型详解
查看>>
原创Java版的Shell
查看>>
windows phone (18) Border元素
查看>>
后端安全验证过程
查看>>