[PATCH] ppc vdso, A working gettimeofday

Benjamin Herrenschmidt benh@kernel.crashing.org
Sun May 1 00:25:00 GMT 2005


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.




More information about the Libc-alpha mailing list