打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Linux中EXPORT
Linux中EXPORT_SYMBOL的用法
2008-04-16 09:58

Linux中EXPORT_SYMBOL的用法


EXPORT_SYMBOL标签内定义的函数对全部内核代码公开,不用修改内核代码就可以在您的内核模块中直接调用。您还可以手工修改内核源代码来导出另外的函数,用于重新编译并加载新内核后的测试。


Linux symbol export method:

[1] If we want export the symbol in a module, just use the EXPORT_SYMBOL(xxxx) in the C or H file.
    And compile the module by adding the compile flag -DEXPORT_SYMTAB.
    Then we can use the xxxx in the other module.


[2] If we want export some symbol in Kernel that is not in a module such as xxxx in the /arch/ppc/fec.c.
    Firstly, define the xxxx
in the fec.c;
    Secondly, make a new file which contain the "extern" define the
xxxx(for example, extern int xxxx
);
    Lastly, in the ppc_ksyms.c we includes the new file, and add the EXPORT_SYMBOL(
xxxx
).
    Then we can use the
xxxx.


本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
Linux内核模块导出后无法调用问题解决(模块间函数调用通讯)
Linux内核模块的符号导出
模块rmmod/insmod
精华推荐:内核模块编程的详细介绍_HackingYou_SupeSite/X-Space官...
documents:system
Linux内核之旅 ? Blog Archive ? 内核模块编程之入门(二)—必备知识
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服