What is EXPORT_SYMBOL_GPL in Linux kernel code?
Below is a piece of code, which contains EXPORT_SYMBOL_GPL
62 struct resource *platform_get_resource(struct platform_device *dev,
63 unsigned int type, unsigned int num)
64 {
65 int i;
66
67 for (i = 0; i < dev->num_resources; i++) {
68 struct resource *r = &dev->resource[i];
69
70 if (type == resource_type(r) && num-- == 0)
71 return r;
72 }
73 return NULL;
74 }
75 EXPORT_SYMBOL_GPL(platform_get_resource);
That macro appears many a times in kernel code...
It is macro to define some symbol (e.g. function) as exportable (seen from kernel loadable modules). If the symbol has no "EXPORT_SYMBOL", it will be not accessible from modules.
EXPORT_SYMBOL_GPL
will show the symbol only in GPL-licensed modules, andEXPORT_SYMBOL
- in modules with any license.http://lwn.net/Articles/154602/ - On the value of EXPORT_SYMBOL_GPL (2005, corbet)