This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v2] Add x86 32 bit vDSO time function support
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Adhemerval Zanella <azanella at linux dot vnet dot ibm dot com>
- Cc: "GNU C. Library" <libc-alpha at sourceware dot org>, Stefani Seibold <stefani at seibold dot net>
- Date: Fri, 27 Jun 2014 14:58:15 -0700 (PDT)
- Subject: Re: [PATCH v2] Add x86 32 bit vDSO time function support
- Authentication-results: sourceware.org; auth=none
- References: <53ADE03D dot 7070300 at linux dot vnet dot ibm dot com>
> * sysdeps/unix/sysv/linux/i386/Makefile [sysdep_routines]: Add dl-vdso
> object.
* sysdeps/unix/sysv/linux/i386/Makefile [$(subdir) = elf]
(sysdep_routines): Add dl-vdso object.
> * sysdeps/unix/sysv/linux/i386/gettimeofday.c: New file: add support
> to vDSO.
"support to use vDSO"?
> --- a/sysdeps/unix/sysv/linux/i386/Makefile
> +++ b/sysdeps/unix/sysv/linux/i386/Makefile
> @@ -21,3 +21,7 @@ endif
> ifeq ($(subdir),stdlib)
> gen-as-const-headers += ucontext_i.sym
> endif
> +
> +ifeq ($(subdir),elf)
> +sysdep_routines += dl-vdso
> +endif
Instead just move that from x86_64/Makefile to x86/Makefile so it's shared.
> +long int (*__vdso_clock_gettime) (clockid_t, struct timespec *)
> + __attribute__ ((nocommon));
> +strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
Use libc_hidden_data_def.
> +static inline void
> +_libc_vdso_platform_setup (void)
Don't use a _libc_ prefix like that on a static symbol.
Just use a descriptive name.
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/i386/time.c
> @@ -0,0 +1,33 @@
> +/* Copyright (C) 2014 Free Software Foundation, Inc.
First line is a descriptive comment.
> +# define TIME_FALLBACK (void*)__time_syscall
# define TIME_FALLBACK ((void *) &__time_syscall)
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/x86/bits/libc-vdso.h
[...]
> +extern long int (*__vdso_clock_gettime) (clockid_t, struct timespec *);
libc_hidden_proto here to go with libc_hidden_def.
Also, this header really should not be in bits/.
That only makes sense for installed headers.
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/x86/clock_gettime.c
> @@ -0,0 +1,20 @@
> +#include "bits/libc-vdso.h"
Missing top comment and license header.
> --- /dev/null
> +++ b/sysdeps/unix/sysv/linux/x86/timespec_get.c
> @@ -0,0 +1,10 @@
> +#include "bits/libc-vdso.h"
Here too.