From 986a506481d4edb3b5c50c8245e915e39d248c7d Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 3 Jun 2019 21:07:25 +0000 Subject: powerpc: Simplify vsyscall internal macros This patch simplifies the powerpc internal macros for vDSO calls by: - Removing INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK, used solely on get_timebase_freq. - Adjust INTERNAL_VSYSCALL_CALL_TYPE powerpc32 to follow powerpc64 argument ordering. - Use HAVE_*_VSYSCALL instead of explicit strings. - Make powerpc libc-vdso.h include generic implementation. No semantic change expected, checked on powerpc-linux-gnu-power4, powerpc64-linux-gnu, and powerpc64le-linux-gnu. * sysdeps/unix/sysv/linux/libc-vdso.h (VDSO_IFUNC_RET): Define if not defined. * sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c (__get_timebase_freq): Remove use of INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK. (get_timebase_freq_fallback): New symbol. * sysdeps/unix/sysv/linux/powerpc/gettimeofday.c (time): Use HAVE_GETTIMEOFDAY_VSYSCALL. * sysdeps/unix/sysv/linux/powerpc/time.c (gettimeofday): Use HAVE_TIME_VSYSCALL. * sysdeps/unix/sysv/linux/powerpc/libc-vdso.h: Include generic implementation. * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h (INTERNAL_VSYSCALL_CALL_TYPE): Make calling convention similar to powerpc64. (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Remove macro. * .../sysv/linux/powerpc/powerpc64/sysdep.h (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Likewise. * sysdeps/unix/sysv/linux/powerpc/sysdep.h (HAVE_GETTIMEOFDAY_VSYSCALL): Define. --- sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) (limited to 'sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index 1cbf1596d5..a3bb552254 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -41,7 +41,7 @@ function call, with the exception of LR (which is needed for the "sc; bnslr+" sequence) and CR (where only CR0.SO is clobbered to signal an error return status). */ -# define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, nr, type, args...) \ +# define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...) \ ({ \ register void *r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -69,7 +69,7 @@ }) #define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, nr, long int, args) + INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) # undef INLINE_SYSCALL # define INLINE_SYSCALL(name, nr, args...) \ @@ -131,20 +131,6 @@ # undef INTERNAL_SYSCALL_ERRNO # define INTERNAL_SYSCALL_ERRNO(val, err) (val) -# define INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK(name, err, type, nr, args...) \ - ({ \ - type sc_ret = ENOSYS; \ - \ - __typeof (__vdso_##name) vdsop = __vdso_##name; \ - PTR_DEMANGLE (vdsop); \ - if (vdsop != NULL) \ - sc_ret = \ - INTERNAL_VSYSCALL_CALL_TYPE (vdsop, err, nr, type, ##args); \ - else \ - err = 1 << 28; \ - sc_ret; \ - }) - # define LOADARGS_0(name, dummy) \ r0 = name # define LOADARGS_1(name, __arg1) \ -- cgit 1.4.1