aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/sysdep.h
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-03-21 14:03:00 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2025-03-21 14:03:00 +0000
commit3b17937e6437fe16e799e61d7e6ee99352741209 (patch)
tree2ba5f35ce55d7b8c2dd086337621d9ea4cef80df /sysdeps/unix/sysdep.h
parent3e2be87832781a29ed67f38f87c1ce3dd4c1b866 (diff)
downloadglibc-azanella/cancel-wrappers-inline.zip
glibc-azanella/cancel-wrappers-inline.tar.gz
glibc-azanella/cancel-wrappers-inline.tar.bz2
linux: Inline __syscall_internal_cancel and __syscall_cancelazanella/cancel-wrappers-inline
It improves some interception tools such as valgrind, however on multithread the __syscall_cancel_arch is called. The result libc.so has a slight larger code size: ABI master patched diff increase aarch64 1658673 1669121 10448 0.63% x86_64 1976656 1985744 9088 0.46% i686 2233622 2251130 17508 0.78% powerpc64le 2382448 2396768 14320 0.60% It mimics internally how cancellable entrypoints were implemented before 89b53077d2a58f00e7debdfe58afabe953dac60d, where cancellation handlign were done inline in the syscall wraper.
Diffstat (limited to 'sysdeps/unix/sysdep.h')
-rw-r--r--sysdeps/unix/sysdep.h81
1 files changed, 35 insertions, 46 deletions
diff --git a/sysdeps/unix/sysdep.h b/sysdeps/unix/sysdep.h
index 2cc9872..8c1642f 100644
--- a/sysdeps/unix/sysdep.h
+++ b/sysdeps/unix/sysdep.h
@@ -154,42 +154,31 @@
# define __SYSCALL_CANCEL7_ARG7
# define __SYSCALL_CANCEL7_ARCH_ARG7
#endif
-long int __internal_syscall_cancel (__syscall_arg_t a1, __syscall_arg_t a2,
- __syscall_arg_t a3, __syscall_arg_t a4,
- __syscall_arg_t a5, __syscall_arg_t a6,
- __SYSCALL_CANCEL7_ARG_DEF
- __syscall_arg_t nr) attribute_hidden;
-
-long int __syscall_cancel (__syscall_arg_t arg1, __syscall_arg_t arg2,
- __syscall_arg_t arg3, __syscall_arg_t arg4,
- __syscall_arg_t arg5, __syscall_arg_t arg6,
- __SYSCALL_CANCEL7_ARG_DEF
- __syscall_arg_t nr) attribute_hidden;
#define __SYSCALL_CANCEL0(name) \
- __syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
+ syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
#define __SYSCALL_CANCEL1(name, a1) \
- __syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __SYSCALL_CANCEL2(name, a1, a2) \
- __syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __SYSCALL_CANCEL3(name, a1, a2, a3) \
- __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, 0, 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, 0, 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __SYSCALL_CANCEL4(name, a1, a2, a3, a4) \
- __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
- __SSC(a4), 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
+ syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
+ __SSC(a4), 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
#define __SYSCALL_CANCEL5(name, a1, a2, a3, a4, a5) \
- __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC(a4), \
- __SSC (a5), 0, __SYSCALL_CANCEL7_ARG __NR_##name)
+ syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC(a4), \
+ __SSC (a5), 0, __SYSCALL_CANCEL7_ARG __NR_##name)
#define __SYSCALL_CANCEL6(name, a1, a2, a3, a4, a5, a6) \
- __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \
- __SSC (a5), __SSC (a6), __SYSCALL_CANCEL7_ARG \
- __NR_##name)
+ syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \
+ __SSC (a5), __SSC (a6), __SYSCALL_CANCEL7_ARG \
+ __NR_##name)
#define __SYSCALL_CANCEL7(name, a1, a2, a3, a4, a5, a6, a7) \
- __syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \
- __SSC (a5), __SSC (a6), __SSC (a7), __NR_##name)
+ syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), __SSC (a4), \
+ __SSC (a5), __SSC (a6), __SSC (a7), __NR_##name)
#define __SYSCALL_CANCEL_NARGS_X(a,b,c,d,e,f,g,h,n,...) n
#define __SYSCALL_CANCEL_NARGS(...) \
@@ -206,33 +195,33 @@ long int __syscall_cancel (__syscall_arg_t arg1, __syscall_arg_t arg2,
__SYSCALL_CANCEL_DISP (__SYSCALL_CANCEL, __VA_ARGS__)
#define __INTERNAL_SYSCALL_CANCEL0(name) \
- __internal_syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG \
+ internal_syscall_cancel (0, 0, 0, 0, 0, 0, __SYSCALL_CANCEL7_ARG \
__NR_##name)
#define __INTERNAL_SYSCALL_CANCEL1(name, a1) \
- __internal_syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ internal_syscall_cancel (__SSC (a1), 0, 0, 0, 0, 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __INTERNAL_SYSCALL_CANCEL2(name, a1, a2) \
- __internal_syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ internal_syscall_cancel (__SSC (a1), __SSC (a2), 0, 0, 0, 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __INTERNAL_SYSCALL_CANCEL3(name, a1, a2, a3) \
- __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, \
- 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
+ internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), 0, \
+ 0, 0, __SYSCALL_CANCEL7_ARG __NR_##name)
#define __INTERNAL_SYSCALL_CANCEL4(name, a1, a2, a3, a4) \
- __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
- __SSC(a4), 0, 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
+ __SSC(a4), 0, 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __INTERNAL_SYSCALL_CANCEL5(name, a1, a2, a3, a4, a5) \
- __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
- __SSC(a4), __SSC (a5), 0, \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
+ __SSC(a4), __SSC (a5), 0, \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __INTERNAL_SYSCALL_CANCEL6(name, a1, a2, a3, a4, a5, a6) \
- __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
- __SSC (a4), __SSC (a5), __SSC (a6), \
- __SYSCALL_CANCEL7_ARG __NR_##name)
+ internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
+ __SSC (a4), __SSC (a5), __SSC (a6), \
+ __SYSCALL_CANCEL7_ARG __NR_##name)
#define __INTERNAL_SYSCALL_CANCEL7(name, a1, a2, a3, a4, a5, a6, a7) \
- __internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
- __SSC (a4), __SSC (a5), __SSC (a6), \
- __SSC (a7), __NR_##name)
+ internal_syscall_cancel (__SSC (a1), __SSC (a2), __SSC (a3), \
+ __SSC (a4), __SSC (a5), __SSC (a6), \
+ __SSC (a7), __NR_##name)
/* Issue a cancellable syscall defined by syscall number NAME plus any other
argument required. If an error occurs its value is returned as an negative