Message ID | 20190613151145.22243-5-raoni@linux.ibm.com |
---|---|
State | New |
Headers | show |
Series | Fix, refactor and cleanup of __ppc_get_timebase_freq related code | expand |
On 13/06/2019 12:11, Raoni Fassina Firmino wrote: > Macros INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK and > INTERNAL_VSYSCALL_CALL_TYPE were only used for __get_timebase_freq. > After its refactoring they are not needed anymore. > > Also, INTERNAL_VSYSCALL_CALL, that had become a wrapper over > INTERNAL_VSYSCALL_CALL_TYPE, can be itself the whole implementation > again. > > ChangeLog: > > 2019-06-13 Raoni Fassina Firmino <raoni@linux.ibm.com> > > * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h > (INTERNAL_VSYSCALL_CALL): Move implementation. > (INTERNAL_VSYSCALL_CALL_TYPE): Remove macro. > (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Likewise. > * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h > (INTERNAL_VSYSCALL_CALL): Move implementation. > (INTERNAL_VSYSCALL_CALL_TYPE): Remove macro. > (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Likewise. LGTM, although as a side note I plan to submit a patchset to just remove all this internal macros to mimic a powerpc function call due vDSO not supplying ODP entries not required on powerpc64 elfv1. > --- > .../sysv/linux/powerpc/powerpc32/sysdep.h | 21 ++--------------- > .../sysv/linux/powerpc/powerpc64/sysdep.h | 23 ++----------------- > 2 files changed, 4 insertions(+), 40 deletions(-) > > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h > index bdbab8e41b..d493ec6222 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h > @@ -43,7 +43,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(funcptr, err, nr, args...) \ > ({ \ > register void *r0 __asm__ ("r0"); \ > register long int r3 __asm__ ("r3"); \ > @@ -56,7 +56,7 @@ > register long int r10 __asm__ ("r10"); \ > register long int r11 __asm__ ("r11"); \ > register long int r12 __asm__ ("r12"); \ > - register type rval __asm__ ("r3"); \ > + register long int rval __asm__ ("r3"); \ > LOADARGS_##nr (funcptr, args); \ > __asm__ __volatile__ \ > ("mtctr %0\n\t" \ > @@ -70,9 +70,6 @@ > rval; \ > }) > > -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ > - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, nr, long int, args) > - > # undef INLINE_SYSCALL > # define INLINE_SYSCALL(name, nr, args...) \ > ({ \ > @@ -133,20 +130,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; \ > - }) > - > /* List of system calls which are supported as vsyscalls. */ > # define HAVE_CLOCK_GETRES_VSYSCALL 1 > # define HAVE_CLOCK_GETTIME_VSYSCALL 1 > diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h > index 294517e3f3..454554061b 100644 > --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h > +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h > @@ -47,22 +47,6 @@ > > #endif /* __ASSEMBLER__ */ > > -/* This version is for internal uses when there is no desire > - to set errno */ > -#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, type, nr, ##args); \ > - else \ > - err = 1 << 28; \ > - sc_ret; \ > - }) > - > /* List of system calls which are supported as vsyscalls. */ > #define HAVE_CLOCK_GETRES_VSYSCALL 1 > #define HAVE_CLOCK_GETTIME_VSYSCALL 1 > @@ -74,7 +58,7 @@ > gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) > the negation of the return value in the kernel gets reverted. */ > > -#define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...) \ > +#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ > ({ \ > register void *r0 __asm__ ("r0"); \ > register long int r3 __asm__ ("r3"); \ > @@ -83,7 +67,7 @@ > register long int r6 __asm__ ("r6"); \ > register long int r7 __asm__ ("r7"); \ > register long int r8 __asm__ ("r8"); \ > - register type rval __asm__ ("r3"); \ > + register long int rval __asm__ ("r3"); \ > LOADARGS_##nr (funcptr, args); \ > __asm__ __volatile__ \ > ("mtctr %0\n\t" \ > @@ -98,9 +82,6 @@ > rval; \ > }) > > -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ > - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) > - > #undef INLINE_SYSCALL > > /* This version is for kernels that implement system calls that >
diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index bdbab8e41b..d493ec6222 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -43,7 +43,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(funcptr, err, nr, args...) \ ({ \ register void *r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -56,7 +56,7 @@ register long int r10 __asm__ ("r10"); \ register long int r11 __asm__ ("r11"); \ register long int r12 __asm__ ("r12"); \ - register type rval __asm__ ("r3"); \ + register long int rval __asm__ ("r3"); \ LOADARGS_##nr (funcptr, args); \ __asm__ __volatile__ \ ("mtctr %0\n\t" \ @@ -70,9 +70,6 @@ rval; \ }) -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, nr, long int, args) - # undef INLINE_SYSCALL # define INLINE_SYSCALL(name, nr, args...) \ ({ \ @@ -133,20 +130,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; \ - }) - /* List of system calls which are supported as vsyscalls. */ # define HAVE_CLOCK_GETRES_VSYSCALL 1 # define HAVE_CLOCK_GETTIME_VSYSCALL 1 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index 294517e3f3..454554061b 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -47,22 +47,6 @@ #endif /* __ASSEMBLER__ */ -/* This version is for internal uses when there is no desire - to set errno */ -#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, type, nr, ##args); \ - else \ - err = 1 << 28; \ - sc_ret; \ - }) - /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETRES_VSYSCALL 1 #define HAVE_CLOCK_GETTIME_VSYSCALL 1 @@ -74,7 +58,7 @@ gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) the negation of the return value in the kernel gets reverted. */ -#define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...) \ +#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ ({ \ register void *r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -83,7 +67,7 @@ register long int r6 __asm__ ("r6"); \ register long int r7 __asm__ ("r7"); \ register long int r8 __asm__ ("r8"); \ - register type rval __asm__ ("r3"); \ + register long int rval __asm__ ("r3"); \ LOADARGS_##nr (funcptr, args); \ __asm__ __volatile__ \ ("mtctr %0\n\t" \ @@ -98,9 +82,6 @@ rval; \ }) -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) - #undef INLINE_SYSCALL /* This version is for kernels that implement system calls that