diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-07-03 16:44:59 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-07-08 21:39:32 -0400 |
commit | b387d762361e6c109c6a60bced003e72447b0a33 (patch) | |
tree | 990642d77fa3f84f1f0a76998ed51d3a07a0ad76 /libc/sysdeps/linux/xtensa | |
parent | ad539e7bc72abfcafeb5c4556a27058fb0d398a9 (diff) |
syscall: unify common syscall defines
Unify all the common syscall defines in syscalls-common.h and scrub all
the duplicated code from relevant ports. This should also make converting
existing ports to INLINE_SYSCALL() much easier as they don't have to get
lost in all the unrelated noise, as well as creating new ports.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/sysdeps/linux/xtensa')
-rw-r--r-- | libc/sysdeps/linux/xtensa/bits/syscalls.h | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/libc/sysdeps/linux/xtensa/bits/syscalls.h b/libc/sysdeps/linux/xtensa/bits/syscalls.h index a59a8052a..6b87acea4 100644 --- a/libc/sysdeps/linux/xtensa/bits/syscalls.h +++ b/libc/sysdeps/linux/xtensa/bits/syscalls.h @@ -9,8 +9,6 @@ glibc .../sysdeps/unix/sysv/linux/xtensa/sysdep.h */ -#define SYS_ify(syscall_name) __NR_##syscall_name - #ifdef __ASSEMBLER__ /* The register layout upon entering the function is: @@ -74,19 +72,6 @@ /* Define a macro which expands into the inline wrapper code for a system call. */ -#undef INLINE_SYSCALL -#define INLINE_SYSCALL(name, nr, args...) \ - ({ unsigned long resultvar = INTERNAL_SYSCALL (name, , nr, args); \ - if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \ - { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \ - resultvar = (unsigned long) -1; \ - } \ - (long) resultvar; }) - -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) do { } while (0) - #define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ ({ LD_ARG(2, name); \ LD_ARGS_##nr(args); \ @@ -96,45 +81,8 @@ : "memory"); \ (long) _a2; }) -#undef INTERNAL_SYSCALL #define INTERNAL_SYSCALL(name, err, nr, args...) \ INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) -#undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) \ - ((unsigned long) (val) >= -4095L) - -#undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) - -#define _syscall0(args...) SYSCALL_FUNC (0, args) -#define _syscall1(args...) SYSCALL_FUNC (1, args) -#define _syscall2(args...) SYSCALL_FUNC (2, args) -#define _syscall3(args...) SYSCALL_FUNC (3, args) -#define _syscall4(args...) SYSCALL_FUNC (4, args) -#define _syscall5(args...) SYSCALL_FUNC (5, args) -#define _syscall6(args...) SYSCALL_FUNC (6, args) - -#define C_DECL_ARGS_0() void -#define C_DECL_ARGS_1(t, v) t v -#define C_DECL_ARGS_2(t, v, args...) t v, C_DECL_ARGS_1(args) -#define C_DECL_ARGS_3(t, v, args...) t v, C_DECL_ARGS_2(args) -#define C_DECL_ARGS_4(t, v, args...) t v, C_DECL_ARGS_3(args) -#define C_DECL_ARGS_5(t, v, args...) t v, C_DECL_ARGS_4(args) -#define C_DECL_ARGS_6(t, v, args...) t v, C_DECL_ARGS_5(args) - -#define C_ARGS_0() -#define C_ARGS_1(t, v) v -#define C_ARGS_2(t, v, args...) v, C_ARGS_1 (args) -#define C_ARGS_3(t, v, args...) v, C_ARGS_2 (args) -#define C_ARGS_4(t, v, args...) v, C_ARGS_3 (args) -#define C_ARGS_5(t, v, args...) v, C_ARGS_4 (args) -#define C_ARGS_6(t, v, args...) v, C_ARGS_5 (args) - -#define SYSCALL_FUNC(nargs, type, name, args...) \ -type name (C_DECL_ARGS_##nargs (args)) { \ - return (type) INLINE_SYSCALL (name, nargs, C_ARGS_##nargs (args)); \ -} - #endif /* not __ASSEMBLER__ */ #endif /* _BITS_SYSCALLS_H */ |