Whats meaning of “EXPORT_SYMBOL” in Linux kernel code?

EXPORT_SYMBOL的作用是什么?

EXPORT_SYMBOL标签内定义的函数或者符号对全部内核代码公开,不用修改内核代码就可以在您的内核模块中直接调用,即使用EXPORT_SYMBOL可以将一个函数以符号的方式导出给其他模块使用。

struct snd_card *snd_cards[SNDRV_CARDS];

EXPORT_SYMBOL(snd_cards);

It makes a symbol accessible to dynamically loaded modules (provided that said

add an extern declaration).

表示该符号snd_cards可以被其他的模块共享。

原文地址:https://www.cnblogs.com/passion-hzhang/p/4016253.html