This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] ppc vdso, A working gettimeofday
- From: Benjamin Herrenschmidt <benh at kernel dot crashing dot org>
- To: sjmunroe at vnet dot ibm dot com
- Cc: Roland McGrath <roland at redhat dot com>, libc-alpha at sources dot redhat dot com
- Date: Sun, 01 May 2005 10:23:49 +1000
- Subject: Re: [PATCH] ppc vdso, A working gettimeofday
- References: <4272A935.7030606@us.ibm.com>
On Fri, 2005-04-29 at 16:37 -0500, Steve Munroe wrote:
> This is the working kludge for binding to vdso functions from libc. In
> this case userland gettimeofday for powerpc32/powerpc64. Tested with and
> without (2.6.12 vs earlier kernels for powerpc) vdso and both modes
> (32-/64-bit of powerpc.
.../...
>
> +#ifdef SHARED
> + else
> + {
> + return (*__vdso_gettimeofday)(tv, tz);
> + }
> +#endif
You go through the burden of setting up a descriptor and calling through
it, which means unnecessary TOC loads etc... Best here is probably to
write __gettimeofday() entirely in assembly and to do a simpler pointer
call (or alternatively, just use an inline asm for the call itself, but
that is probably still overkill). The vDSO case doesn't even need a
stackframe to be built
Ben.