Linux Kernel 之 symbol

来源:互联网 发布:青苹软件 编辑:程序博客网 时间:2024/05/22 14:46

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.

参考:http://blog.chinaunix.net/uid-10747583-id-2920908.html

0 0
原创粉丝点击