summaryrefslogtreecommitdiff
path: root/include/linux/syscalls.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2014-03-01 13:45:03 +0100
committerHeiko Carstens <heiko.carstens@de.ibm.com>2014-03-04 09:12:24 +0100
commitab4f8bba19323eb78b7473df42b225eb14090fcc (patch)
tree2bda879b8d746516dec33d6a12e1c0953b0fa21d /include/linux/syscalls.h
parent2c81fc4fb41f589454861bbdb90ffde73840b8f8 (diff)
downloadlwn-ab4f8bba19323eb78b7473df42b225eb14090fcc.tar.gz
lwn-ab4f8bba19323eb78b7473df42b225eb14090fcc.zip
s390/compat: automatic zero, sign and pointer conversion of syscalls
Instead of explicitly changing compat system call parameters from e.g. unsigned long to compat_ulong_t let the COMPAT_SYSCALL_WRAP macros automatically detect (unsigned) long parameters and zero and sign extend them automatically. The resulting binary is completely identical. In addition add a sys_[system call name] prototype for each system call wrapper. This will cause compile errors if the prototype does not match the prototype in include/linux/syscall.h. Therefore we should now always get the correct zero and sign extension of system call parameters. Pointers are handled like before. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'include/linux/syscalls.h')
-rw-r--r--include/linux/syscalls.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index a747a77ea584..1e67b7a5968c 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -98,6 +98,8 @@ struct sigaltstack;
#define __MAP(n,...) __MAP##n(__VA_ARGS__)
#define __SC_DECL(t, a) t a
+#define __TYPE_IS_L(t) (__same_type((t)0, 0L))
+#define __TYPE_IS_UL(t) (__same_type((t)0, 0UL))
#define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL))
#define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a
#define __SC_CAST(t, a) (t) a