cond_syscall() and new ABI.
David Woodhouse
dwmw2 at infradead.org
Tue Oct 12 23:51:49 EST 2004
This (in linux/asm-ppc64/unistd.h) doesn't work with the new ABI:
/*
* "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
*/
#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall");
Two options -- either we ditch older toolchains (before 2002-03-01
probably), by switching to what we say in the comment, or we introduce
an ifdef to choose whether to include the '.' in the symbol names...
Both attached. Someone who cares can choose one :)
--
dwmw2
-------------- next part --------------
===== include/asm-ppc64/unistd.h 1.34 vs edited =====
--- 1.34/include/asm-ppc64/unistd.h Tue Sep 14 01:23:12 2004
+++ edited/include/asm-ppc64/unistd.h Tue Oct 12 14:49:48 2004
@@ -468,7 +468,11 @@
* 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
*/
+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 3)
+#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
#endif /* __KERNEL__ */
-------------- next part --------------
===== include/asm-ppc64/unistd.h 1.34 vs edited =====
--- 1.34/include/asm-ppc64/unistd.h Tue Sep 14 01:23:12 2004
+++ edited/include/asm-ppc64/unistd.h Tue Oct 12 14:48:08 2004
@@ -468,7 +468,7 @@
* 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
*/
-#define cond_syscall(x) asm(".weak\t." #x "\n\t.set\t." #x ",.sys_ni_syscall");
+#define cond_syscall(x) void x(void) __attribute__((weak,alias("sys_ni_syscall")));
#endif /* __KERNEL__ */
More information about the Linuxppc64-dev
mailing list