Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3203726
  • 博文数量: 1805
  • 博客积分: 135
  • 博客等级: 入伍新兵
  • 技术积分: 3345
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-19 20:01
文章分类

全部博文(1805)

文章存档

2017年(19)

2016年(80)

2015年(341)

2014年(438)

2013年(349)

2012年(332)

2011年(248)

分类: LINUX

2014-07-10 14:41:13

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.
其中第二条指明:在编译内核的同时编译模块,若出现内核中某符号在模块中未定义的错误,则需要做以下事情(实践经验步骤):
(1)找到该符号在内核代码中定义的文件
(2)在符号定义文件内#include 文件
(3)在符号定义文件内EXPORT_SYMBOL(XXX) 导出该符号XXX供模块代码使用;
 
阅读(772) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~