diff options
author | Mike Frysinger <vapier@gentoo.org> | 2009-07-09 15:09:29 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2009-07-09 15:11:46 -0400 |
commit | 763bbf9e9a27426c9be8322dca5ddf2cb4dbc464 (patch) | |
tree | 1bdc0f8f1b01f27fdf9eb5c919d02ce73630d99e /libc/sysdeps/linux/common/bits | |
parent | 5ca445cb7b0e1ed549ff1db454c6a0460e2e0833 (diff) |
syscall: unify part 2: NCS variety
Declare common NCS (non-constant syscall) variants and convert the existing
ports over to this.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc/sysdeps/linux/common/bits')
-rw-r--r-- | libc/sysdeps/linux/common/bits/syscalls-common.h | 18 | ||||
-rw-r--r-- | libc/sysdeps/linux/common/bits/syscalls.h | 2 |
2 files changed, 17 insertions, 3 deletions
diff --git a/libc/sysdeps/linux/common/bits/syscalls-common.h b/libc/sysdeps/linux/common/bits/syscalls-common.h index 81c82c801..2aef89c6e 100644 --- a/libc/sysdeps/linux/common/bits/syscalls-common.h +++ b/libc/sysdeps/linux/common/bits/syscalls-common.h @@ -31,10 +31,15 @@ /* Define a macro which expands into the inline wrapper code for a system call */ #ifndef INLINE_SYSCALL -# define INLINE_SYSCALL(name, nr, args...) \ +# define INLINE_SYSCALL(name, nr, args...) INLINE_SYSCALL_NCS(__NR_##name, nr, args) +#endif + +/* Just like INLINE_SYSCALL(), but take a non-constant syscall (NCS) argument */ +#ifndef INLINE_SYSCALL_NCS +# define INLINE_SYSCALL_NCS(name, nr, args...) \ ({ \ INTERNAL_SYSCALL_DECL(err); \ - long res = INTERNAL_SYSCALL(name, err, nr, args); \ + long res = INTERNAL_SYSCALL_NCS(name, err, nr, args); \ if (unlikely(INTERNAL_SYSCALL_ERROR_P(res, err))) { \ __set_errno(INTERNAL_SYSCALL_ERRNO(res, err)); \ res = -1L; \ @@ -43,6 +48,15 @@ }) #endif +/* No point in forcing people to implement both when they only need one */ +#ifndef INTERNAL_SYSCALL +# define INTERNAL_SYSCALL(name, err, nr, args...) INTERNAL_SYSCALL_NCS(__NR_##name, err, nr, args) +#endif + +#ifndef INTERNAL_SYSCALL_NCS +# error your port needs to define INTERNAL_SYSCALL_NCS in bits/syscalls.h +#endif + #ifndef _syscall0 #define C_DECL_ARGS_0() void diff --git a/libc/sysdeps/linux/common/bits/syscalls.h b/libc/sysdeps/linux/common/bits/syscalls.h index e7c6b035d..03d08d1d3 100644 --- a/libc/sysdeps/linux/common/bits/syscalls.h +++ b/libc/sysdeps/linux/common/bits/syscalls.h @@ -6,4 +6,4 @@ */ #error You have not provided architecture specific bits/syscalls.h -#error You should need to define only INTERNAL_SYSCALL +#error You should need to define only INTERNAL_SYSCALL_NCS |