This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] Fix incorrectly named __kernel_get_tbfreq VDSO function
- From: "Ryan S. Arnold" <ryan dot arnold at gmail dot com>
- To: "Ryan S. Arnold" <rsa at us dot ibm dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, Anton Blanchard <anton at samba dot org>
- Date: Fri, 18 Jan 2013 07:49:02 -0600
- Subject: Re: [PATCH 1/2] Fix incorrectly named __kernel_get_tbfreq VDSO function
- References: <20120709112735.22c2e72b@kryten><CAAKybw8XrcTffP6TRXq0qg+5mpmp6NMHQnKpVf_nPPfhibLG9Q@mail.gmail.com><20121129.193503.1047178464074352872.davem@davemloft.net><CAAKybw-kpKmgtOJrxU9QENwea=QU+ZEFzgJviC7TcFEd2dyXMQ@mail.gmail.com><CAAKybw-xQZvaNm7dtQ6zMzK3omZM8C3P+iK6e6f8qzPWb6fvSg@mail.gmail.com><CAAKybw84rXdD1-Xhc+NyM=MRkNg4WNTgnZu3-V7O10C5+t=JLw@mail.gmail.com><1358284234.6715.27.camel@localhost.localdomain>
On Tue, Jan 15, 2013 at 3:10 PM, Ryan Arnold <rsa@us.ibm.com> wrote:
> PowerPC: Rename __kernel_vdso_get_tbfreq to __kernel_get_tbfreq.
>
> In order for the __kernel_get_tbfreq vDSO call to work the
> INTERNAL_VSYSCALL_NCS macro needed to be updated to prevent it from
> assuming an integer return type (since the timebase frequency is a 64-bit
> value) by specifying the type of the return type as a macro parameter. The
> macro then specifically declares the return value as a 'register' (or
> implied pair) of the denoted type. The compiler is then informed that this
> register (or implied pair) is to be used for the return value.
>
> diff --git a/ChangeLog b/ChangeLog
> index 0f5a017..db98cf2 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,25 @@
> +2013-01-15 Anton Blanchard <anton@samba.org>
> + Ryan S. Arnold <rsa@linux.vnet.ibm.com>
> +
> + * sysdeps/unix/sysv/linux/powerpc/init-first.c: Rename
> + __kernel_vdso_get_tbfreq to __kernel_get_tbfreq.
> + * sysdeps/unix/sysv/linux/powerpc/get_clockfreq.c: Add parameter to
> + INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK to specify return type.
> + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h
> + (INTERNAL_VSYSCALL_NCS): Change "=&r" in inline asm output regs list to
> + "+r" and remove output regs list as redundant. Add explicit inline
> + asm to specify register of return val to work around compiler codegen
> + bug. Remove (int) cast on return value. Add return type parameter to
> + use in macro so that this macro does not truncate return value for
> + 64-bit values.
> + (INTERNAL_VSYSCALL_NO_SYSCALL_FALLBACK): Add return type parameter and
> + pass to INTERNAL_VSYSCALL_NCS.
> + (INLINE_VSYSCALL): Add 'long int' as return type to
> + INTERNAL_VSYSCALL_NCS macro invocation.
> + (INTERNAL_VSYSCALL): Add 'long int' as return type to
> + INTERNAL_VSYSCALL_NCS macro invocation.
> + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Likewise.
> +
> 2013-01-14 David S. Miller <davem@davemloft.net>
I tested this on powerpc32 and powerpc64 'default' and with --withcpu=power7.
Pushed upstream with git commit:
commit 471a1672d4d55124de4db8273829f96cc14d424a
Author: Anton Blanchard <anton@samba.org>
Date: Tue Jan 15 12:50:46 2013 -0600
PowerPC: Rename __kernel_vdso_get_tbfreq to __kernel_get_tbfreq.
In order for the __kernel_get_tbfreq vDSO call to work the
INTERNAL_VSYSCALL_NCS macro needed to be updated to prevent it from
assuming an integer return type (since the timebase frequency is a 64-bit
value) by specifying the type of the return type as a macro parameter. The
macro then specifically declares the return value as a 'register' (or
implied pair) of the denoted type. The compiler is then informed that this
register (or implied pair) is to be used for the return value.