Skip to contentSkip to conversation

spufs: change ppc_rtas declaration to weak

PATCH In review Geoff Levand 1 participant 1 message Nov 17, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 3/16 spufs: change ppc_rtas declaration to weak

Subject: powerpc: change ppc_rtas declaration to weak

From: Geoff Levand <[email protected]>
Change the definition of powerpc's cond_syscall() to use the standard gcc weak attribute specifier which provides proper support for C linkage as needed by spu_syscall_table[].

Fixes this powerpc build error with CONFIG_SPU_FS=y, CONFIG_PPC_RTAS=n:

arch/powerpc/platforms/built-in.o: undefined reference to `ppc_rtas'

---

 include/asm-powerpc/unistd.h |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
include/asm-powerpc/unistd.h +2 -10
Index: linux-2.6/include/asm-powerpc/unistd.h
===================================================================
@@ -445,7 +445,6 @@ type name(type1 arg1, type2 arg2, type3 
 #include <linux/types.h>
 #include <linux/compiler.h>
 #include <linux/linkage.h>
-#include <asm/syscalls.h>
 
 #define __ARCH_WANT_IPC_PARSE_VERSION
 #define __ARCH_WANT_OLD_READDIR
@@ -480,16 +479,9 @@ type name(type1 arg1, type2 arg2, type3 
 
 /*
  * "Conditional" syscalls
- *
- * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
- * but it doesn't work on all toolchains, so we just do it by hand
  */
-#ifdef CONFIG_PPC32
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
-#else
-#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall")
-#endif
-
+#define cond_syscall(x) \
+	asmlinkage long x (void) __attribute__((weak,alias("sys_ni_syscall")))
 
 #endif		/* __ASSEMBLY__ */
 #endif		/* __KERNEL__ */