asm-generic/unistd.h: handle symbol prefixes in cond_syscall
authorJames Hogan <james.hogan@imgtec.com>
Fri, 24 Feb 2012 13:47:48 +0000 (13:47 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Sat, 2 Mar 2013 20:09:14 +0000 (20:09 +0000)
Some architectures have symbol prefixes and set CONFIG_SYMBOL_PREFIX,
but this wasn't taken into account by the generic cond_syscall. It's
easy enough to fix in a generic fashion, so add the symbol prefix to
symbol names in cond_syscall when CONFIG_SYMBOL_PREFIX is set.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Mike Frysinger <vapier@gentoo.org>
include/asm-generic/unistd.h

index a36991ab334ef180bfd35128a557a0ea504a3cba..abc925de8ecfdee6bda55e205dc91ecf667f92f4 100644 (file)
  * but it doesn't work on all toolchains, so we just do it by hand
  */
 #ifndef cond_syscall
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall")
+#ifdef CONFIG_SYMBOL_PREFIX
+#define __SYMBOL_PREFIX CONFIG_SYMBOL_PREFIX
+#else
+#define __SYMBOL_PREFIX
+#endif
+#define cond_syscall(x) asm(".weak\t" __SYMBOL_PREFIX #x "\n\t" \
+                           ".set\t" __SYMBOL_PREFIX #x "," \
+                           __SYMBOL_PREFIX "sys_ni_syscall")
 #endif