On Thursday 22 November 2007, Andi Kleen wrote:I think it would be good if you could specify a default namespace per module, that could reduce the amount of necessary changes significantly. For example, you can do #define EXPORT_SYMBOL_GLOBAL(sym) __EXPORT_SYMBOL(sym, "_gpl",,, NULL) #ifdef MODULE_NAMESPACE #define EXPORT_SYMBOL_GPL(sym) EXPORT_SYMBOL_GLOBAL(sym) #else #define EXPORT_SYMBOL_GPL(sym) EXPORT_SYMBOL_NS(sym, MODULE_NAMESPACE) #endif If we go that way, it may be useful to extend the namespace mechanism to non-GPL symbols as well, like #define EXPORT_SYMBOL(sym) __EXPORT_SYMBOL(sym, "",__## MODULE_NAMESPACE, NS_SEPARATOR #MODULE_NAMESPACE, #MODULE_NAMESPACE) Unfortunately, doing this automatic namespace selection requires to set the namespace before #include <linux/module.h>. One way to work around this could be to use Makefile magic so you can list a Makefile as obj-$(CONFIG_COMBINED) += combined.o combined-$(CONFIG_SUBOPTION) += combined_main.o combined_other.o obj-$(CONFIG_SINGLE) += single.o obj-$(CONFIG_OTHER) += other.o obj-$(CONFIG_API) += api.o NAMESPACE = subsys # default, used for other.o NAMESPACE_single.o = single # used only for single.o NAMESPACE_combined.o = combined # all parts of combined.o NAMESPACE_combined_other.o = special # except this one NAMESPACE_api.o = # api.o is put into the global ns The Makefile logic here would basically just follow the rules we have for CFLAGS etc, and then pass -DMODULE_NAMESPACE=$(NAMESPACE_$(obj)) to gcc. Arnd <>< -
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Nigel Cunningham | Re: [PATCH] Remove process freezer from suspend to RAM pathway |
| Paul Mundt | Re: 2.6.22-rc4-mm2 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
git: | |
| Arjan van de Ven | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Natalie Protasevich | [BUG] New Kernel Bugs |
