aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/module.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2013-03-15 00:34:17 -0400
committerRusty Russell <rusty@rustcorp.com.au>2013-03-15 00:39:43 -0400
commitb92021b09df70c1609e3547f3d6128dd560be97f (patch)
tree0203752a738c71718f5141b84f5143d1dc8b431d /include/linux/module.h
parent4febd95a8a85dd38b1a71fcf9726e19c7fd20039 (diff)
CONFIG_SYMBOL_PREFIX: cleanup.
We have CONFIG_SYMBOL_PREFIX, which three archs define to the string "_". But Al Viro broke this in "consolidate cond_syscall and SYSCALL_ALIAS declarations" (in linux-next), and he's not the first to do so. Using CONFIG_SYMBOL_PREFIX is awkward, since we usually just want to prefix it so something. So various places define helpers which are defined to nothing if CONFIG_SYMBOL_PREFIX isn't set: 1) include/asm-generic/unistd.h defines __SYMBOL_PREFIX. 2) include/asm-generic/vmlinux.lds.h defines VMLINUX_SYMBOL(sym) 3) include/linux/export.h defines MODULE_SYMBOL_PREFIX. 4) include/linux/kernel.h defines SYMBOL_PREFIX (which differs from #7) 5) kernel/modsign_certificate.S defines ASM_SYMBOL(sym) 6) scripts/modpost.c defines MODULE_SYMBOL_PREFIX 7) scripts/Makefile.lib defines SYMBOL_PREFIX on the commandline if CONFIG_SYMBOL_PREFIX is set, so that we have a non-string version for pasting. (arch/h8300/include/asm/linkage.h defines SYMBOL_NAME(), too). Let's solve this properly: 1) No more generic prefix, just CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX. 2) Make linux/export.h usable from asm. 3) Define VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR(). 4) Make everyone use them. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Reviewed-by: James Hogan <james.hogan@imgtec.com> Tested-by: James Hogan <james.hogan@imgtec.com> (metag)
Diffstat (limited to 'include/linux/module.h')
-rw-r--r--include/linux/module.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/module.h b/include/linux/module.h
index ead1b5719a12..46f1ea01e6f6 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -190,7 +190,7 @@ extern int modules_disabled; /* for sysctl */
190/* Get/put a kernel symbol (calls must be symmetric) */ 190/* Get/put a kernel symbol (calls must be symmetric) */
191void *__symbol_get(const char *symbol); 191void *__symbol_get(const char *symbol);
192void *__symbol_get_gpl(const char *symbol); 192void *__symbol_get_gpl(const char *symbol);
193#define symbol_get(x) ((typeof(&x))(__symbol_get(MODULE_SYMBOL_PREFIX #x))) 193#define symbol_get(x) ((typeof(&x))(__symbol_get(VMLINUX_SYMBOL_STR(x))))
194 194
195/* modules using other modules: kdb wants to see this. */ 195/* modules using other modules: kdb wants to see this. */
196struct module_use { 196struct module_use {
@@ -453,7 +453,7 @@ extern void __module_put_and_exit(struct module *mod, long code)
453#ifdef CONFIG_MODULE_UNLOAD 453#ifdef CONFIG_MODULE_UNLOAD
454unsigned long module_refcount(struct module *mod); 454unsigned long module_refcount(struct module *mod);
455void __symbol_put(const char *symbol); 455void __symbol_put(const char *symbol);
456#define symbol_put(x) __symbol_put(MODULE_SYMBOL_PREFIX #x) 456#define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x))
457void symbol_put_addr(void *addr); 457void symbol_put_addr(void *addr);
458 458
459/* Sometimes we know we already have a refcount, and it's easier not 459/* Sometimes we know we already have a refcount, and it's easier not