From e1b5bb6d1236d4ad2084c53aa83dde7cdf6f8eea Mon Sep 17 00:00:00 2001 From: Al Viro Date: Mon, 21 Jan 2013 17:16:07 -0500 Subject: consolidate cond_syscall and SYSCALL_ALIAS declarations take them to asm/linkage.h, with default in linux/linkage.h Signed-off-by: Al Viro --- include/linux/linkage.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'include/linux/linkage.h') diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 807f1e533226..829d66c67fc2 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -2,6 +2,7 @@ #define _LINUX_LINKAGE_H #include +#include #include #ifdef __cplusplus @@ -14,6 +15,26 @@ #define asmlinkage CPP_ASMLINKAGE #endif +#ifndef SYMBOL_NAME +#ifdef CONFIG_SYMBOL_PREFIX +#define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x +#else +#define SYMBOL_NAME(x) x +#endif +#endif +#define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x)) + +#ifndef cond_syscall +#define cond_syscall(x) asm(".weak\t" __SYMBOL_NAME(x) \ + "\n\t.set\t" __SYMBOL_NAME(x) "," __SYMBOL_NAME(sys_ni_syscall)); +#endif + +#ifndef SYSCALL_ALIAS +#define SYSCALL_ALIAS(alias, name) \ + asm ("\t.globl " __SYMBOL_NAME(alias) \ + "\n\t.set\t" __SYMBOL_NAME(alias) "," __SYMBOL_NAME(name)) +#endif + #define __page_aligned_data __section(.data..page_aligned) __aligned(PAGE_SIZE) #define __page_aligned_bss __section(.bss..page_aligned) __aligned(PAGE_SIZE) -- cgit v1.2.2 From 126de6b20bfb82cc19012d5048f11f339ae5a021 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Wed, 1 May 2013 22:04:17 +0100 Subject: linkage.h: fix build breakage due to symbol prefix handling Al's commit e1b5bb6d1236 ("consolidate cond_syscall and SYSCALL_ALIAS declarations") broke the build on blackfin and metag due to the following code: #ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX #define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x #else #define SYMBOL_NAME(x) x #endif #endif #define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x)) __stringify literally stringifies CONFIG_SYMBOL_PREFIX ##x, so you get lines like this in kernel/sys_ni.s: .weak CONFIG_SYMBOL_PREFIXsys_quotactl .set CONFIG_SYMBOL_PREFIXsys_quotactl,CONFIG_SYMBOL_PREFIXsys_ni_syscall The patches in Rusty's modules-next tree such as "CONFIG_SYMBOL_PREFIX: cleanup." cleans up the whole mess around symbol prefixes, so this patch just attempts to fix the build in the meantime. The intermediate definition of SYMBOL_NAME above isn't used and is incorrect when CONFIG_SYMBOL_PREFIX is defined as CONFIG_SYMBOL_PREFIX is a quoted string literal, so define __SYMBOL_NAME directly depending on CONFIG_SYMBOL_PREFIX. Signed-off-by: James Hogan Mea-culpa-by: Al Viro Cc: Rusty Russell Cc: Mike Frysinger Cc: uclinux-dist-devel@blackfin.uclinux.org Signed-off-by: Linus Torvalds --- include/linux/linkage.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'include/linux/linkage.h') diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 829d66c67fc2..de09dec25ec3 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h @@ -15,14 +15,11 @@ #define asmlinkage CPP_ASMLINKAGE #endif -#ifndef SYMBOL_NAME #ifdef CONFIG_SYMBOL_PREFIX -#define SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX ## x +#define __SYMBOL_NAME(x) CONFIG_SYMBOL_PREFIX __stringify(x) #else -#define SYMBOL_NAME(x) x +#define __SYMBOL_NAME(x) __stringify(x) #endif -#endif -#define __SYMBOL_NAME(x) __stringify(SYMBOL_NAME(x)) #ifndef cond_syscall #define cond_syscall(x) asm(".weak\t" __SYMBOL_NAME(x) \ -- cgit v1.2.2