summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Blanchard <anton@samba.org>2002-04-09 13:58:44 +1000
committerAnton Blanchard <anton@samba.org>2002-04-09 13:58:44 +1000
commit5b1e894e6a0bbefc389933366f6adffbf2e096a0 (patch)
tree3400dc04278052cfea6f7b3ee0b50c03b3646abd
parentcbba4f5ef5c3298451d51aca1b74ad0040ff9c5a (diff)
Make cond_syscall per arch. This is required on some architectures
(eg ppc64) where foo points to a function descriptor and .foo is the address of the actual function.
-rw-r--r--include/asm-alpha/unistd.h8
-rw-r--r--include/asm-arm/unistd.h9
-rw-r--r--include/asm-cris/unistd.h8
-rw-r--r--include/asm-i386/unistd.h8
-rw-r--r--include/asm-ia64/unistd.h9
-rw-r--r--include/asm-m68k/unistd.h8
-rw-r--r--include/asm-mips/unistd.h8
-rw-r--r--include/asm-mips64/unistd.h8
-rw-r--r--include/asm-parisc/unistd.h8
-rw-r--r--include/asm-ppc/unistd.h8
-rw-r--r--include/asm-ppc64/unistd.h8
-rw-r--r--include/asm-s390/unistd.h8
-rw-r--r--include/asm-s390x/unistd.h8
-rw-r--r--include/asm-sh/unistd.h8
-rw-r--r--include/asm-sparc/unistd.h8
-rw-r--r--include/asm-sparc64/unistd.h8
-rw-r--r--include/asm-x86_64/unistd.h8
-rw-r--r--kernel/sys.c9
18 files changed, 139 insertions, 8 deletions
diff --git a/include/asm-alpha/unistd.h b/include/asm-alpha/unistd.h
index 28ced9ae8f48..22dd6de58340 100644
--- a/include/asm-alpha/unistd.h
+++ b/include/asm-alpha/unistd.h
@@ -597,4 +597,12 @@ static inline long delete_module(const char *name)
#endif
+/*
+ * "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");
+
#endif /* _ALPHA_UNISTD_H */
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
index b5146673bde1..efb95cb9fdf1 100644
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -466,4 +466,13 @@ static inline pid_t wait(int * wait_stat)
static inline _syscall3(int,execve,const char *,file,char **,argv,char **,envp);
#endif
+
+/*
+ * "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");
+
#endif /* __ASM_ARM_UNISTD_H */
diff --git a/include/asm-cris/unistd.h b/include/asm-cris/unistd.h
index 80a36c1369ce..b78012d05516 100644
--- a/include/asm-cris/unistd.h
+++ b/include/asm-cris/unistd.h
@@ -395,4 +395,12 @@ static inline pid_t wait(int * wait_stat)
#endif
+/*
+ * "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");
+
#endif /* _ASM_CRIS_UNISTD_H_ */
diff --git a/include/asm-i386/unistd.h b/include/asm-i386/unistd.h
index 84af0bcfdfe3..2cdad510f2b9 100644
--- a/include/asm-i386/unistd.h
+++ b/include/asm-i386/unistd.h
@@ -371,4 +371,12 @@ static inline pid_t wait(int * wait_stat)
#endif
+/*
+ * "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");
+
#endif /* _ASM_I386_UNISTD_H_ */
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index f0dd2bfcc58f..261387c49987 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -325,5 +325,14 @@ wait (int * wait_stat)
}
#endif /* __KERNEL_SYSCALLS__ */
+
+/*
+ * "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");
+
#endif /* !__ASSEMBLY__ */
#endif /* _ASM_IA64_UNISTD_H */
diff --git a/include/asm-m68k/unistd.h b/include/asm-m68k/unistd.h
index c3cf1133d832..f74e7052092d 100644
--- a/include/asm-m68k/unistd.h
+++ b/include/asm-m68k/unistd.h
@@ -357,4 +357,12 @@ static inline pid_t wait(int * wait_stat)
#endif
+/*
+ * "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");
+
#endif /* _ASM_M68K_UNISTD_H_ */
diff --git a/include/asm-mips/unistd.h b/include/asm-mips/unistd.h
index 283831f78768..ce5830d9a56c 100644
--- a/include/asm-mips/unistd.h
+++ b/include/asm-mips/unistd.h
@@ -488,4 +488,12 @@ static inline pid_t wait(int * wait_stat)
#endif /* !defined (__KERNEL_SYSCALLS__) */
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+/*
+ * "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");
+
#endif /* _ASM_UNISTD_H */
diff --git a/include/asm-mips64/unistd.h b/include/asm-mips64/unistd.h
index 5d56eadb3450..e20d851697e3 100644
--- a/include/asm-mips64/unistd.h
+++ b/include/asm-mips64/unistd.h
@@ -814,4 +814,12 @@ static inline pid_t wait(int * wait_stat)
#endif /* !defined (__KERNEL_SYSCALLS__) */
#endif /* !defined (_LANGUAGE_ASSEMBLY) */
+/*
+ * "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");
+
#endif /* _ASM_UNISTD_H */
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index f84502172fa7..594034cec546 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -900,4 +900,12 @@ static inline int execve(char *filename, char * argv [],
#undef STR
+/*
+ * "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");
+
#endif /* _ASM_PARISC_UNISTD_H_ */
diff --git a/include/asm-ppc/unistd.h b/include/asm-ppc/unistd.h
index d881d0ed64c7..711d70ce3285 100644
--- a/include/asm-ppc/unistd.h
+++ b/include/asm-ppc/unistd.h
@@ -437,4 +437,12 @@ static inline pid_t wait(int * wait_stat)
#endif /* __KERNEL_SYSCALLS__ */
+/*
+ * "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");
+
#endif /* _ASM_PPC_UNISTD_H_ */
diff --git a/include/asm-ppc64/unistd.h b/include/asm-ppc64/unistd.h
index 0c206d7f328a..b97619ce0240 100644
--- a/include/asm-ppc64/unistd.h
+++ b/include/asm-ppc64/unistd.h
@@ -442,4 +442,12 @@ static inline pid_t wait(int * wait_stat)
#endif /* __KERNEL_SYSCALLS__ */
+/*
+ * "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");
+
#endif /* _ASM_PPC_UNISTD_H_ */
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h
index 77ff9ccfb2fd..0151c5602849 100644
--- a/include/asm-s390/unistd.h
+++ b/include/asm-s390/unistd.h
@@ -375,4 +375,12 @@ static inline pid_t wait(int * wait_stat)
#endif
+/*
+ * "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");
+
#endif /* _ASM_S390_UNISTD_H_ */
diff --git a/include/asm-s390x/unistd.h b/include/asm-s390x/unistd.h
index 603864584386..242f61e74d41 100644
--- a/include/asm-s390x/unistd.h
+++ b/include/asm-s390x/unistd.h
@@ -345,4 +345,12 @@ static inline pid_t wait(int * wait_stat)
#endif
+/*
+ * "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");
+
#endif /* _ASM_S390_UNISTD_H_ */
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h
index a22a81fb3e3c..9de944fbc321 100644
--- a/include/asm-sh/unistd.h
+++ b/include/asm-sh/unistd.h
@@ -367,4 +367,12 @@ static __inline__ pid_t wait(int * wait_stat)
}
#endif
+/*
+ * "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");
+
#endif /* __ASM_SH_UNISTD_H */
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h
index 5ef9d7c3a70d..3f131fd488e9 100644
--- a/include/asm-sparc/unistd.h
+++ b/include/asm-sparc/unistd.h
@@ -437,4 +437,12 @@ static __inline__ pid_t wait(int * wait_stat)
#endif /* __KERNEL_SYSCALLS__ */
+/*
+ * "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");
+
#endif /* _SPARC_UNISTD_H */
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h
index fe0ac16c56c8..2b35da699b8a 100644
--- a/include/asm-sparc64/unistd.h
+++ b/include/asm-sparc64/unistd.h
@@ -439,4 +439,12 @@ static __inline__ pid_t wait(int * wait_stat)
#define _SC_VERSION 8
#endif
+/*
+ * "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");
+
#endif /* _SPARC64_UNISTD_H */
diff --git a/include/asm-x86_64/unistd.h b/include/asm-x86_64/unistd.h
index 21257ec6452c..7239abba3be6 100644
--- a/include/asm-x86_64/unistd.h
+++ b/include/asm-x86_64/unistd.h
@@ -650,4 +650,12 @@ static inline pid_t wait(int * wait_stat)
#endif /* __NO_STUBS */
+/*
+ * "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");
+
#endif
diff --git a/kernel/sys.c b/kernel/sys.c
index 1642e115d2b0..69d29b4ad273 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -19,6 +19,7 @@
#include <asm/uaccess.h>
#include <asm/io.h>
+#include <asm/unistd.h>
/*
* this is where the system-wide overflow UID and GID are defined, for
@@ -174,14 +175,6 @@ asmlinkage long sys_ni_syscall(void)
return -ENOSYS;
}
-/*
- * "Conditional" syscalls
- *
- * What we want is __attribute__((weak,alias("sys_ni_syscall"))),
- * but it doesn't work on sparc64, so we just do it by hand
- */
-#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
-
cond_syscall(sys_nfsservctl)
cond_syscall(sys_quotactl)
cond_syscall(sys_acct)