This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PowerPC: Add time vDSO support


> 	(VDSO_IFUNC_RET): Fix compiler warning on cast.

"Cast to void *" is what you're doing here, so say that.
You can say, "Cast to void * to silence compiler warning."

>  #if defined(__PPC64__) || defined(__powerpc64__)
> -#define VDSO_IFUNC_RET(value)  &value
> +#define VDSO_IFUNC_RET(value)  (void*)(&value)

Should be: ((void *) &(value))

>  #else
> -#define VDSO_IFUNC_RET(value)  value
> +#define VDSO_IFUNC_RET(value)  (void*)(value)

Should be: ((void *) (value))

> +++ b/sysdeps/unix/sysv/linux/powerpc/time.c
> @@ -0,0 +1,63 @@
> +/* Copyright (C) 2013 Free Software Foundation, Inc.

Top line of each new file is a descriptive comment.

> +#ifdef SHARED
> +
> +# include <time.h>
> +# include <sysdep.h>
> +# include <bits/libc-vdso.h>
> +
> +void *time_ifunc (void) __asm__ ("time");

No need for __ flavors in libc source code.

> +static time_t
> +__time_syscall (time_t *t)

No need for __ prefix on a static.

> +  if (INLINE_VSYSCALL (gettimeofday, 2, &tv, NULL))

Canonical failure test would be "< 0".

> +void *
> +time_ifunc (void)
> +{
> +  /* If the vDSO is not available we fall back syscall.  */

"fall back to the syscall"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]