Commit a1289643 authored by Andi Kleen's avatar Andi Kleen Committed by Thomas Gleixner

x86: use explicit copy in vdso_gettimeofday()

Jeremy's gcc 3.4 seems to be unable to inline a 8 byte memcpy.  But the
vdso doesn't support external references.  Copy the structure members
of struct timezone explicitely instead.
Signed-off-by: default avatarAndi Kleen <ak@linux.intel.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent 2ddfd20e
...@@ -106,9 +106,9 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz) ...@@ -106,9 +106,9 @@ int __vdso_gettimeofday(struct timeval *tv, struct timezone *tz)
do_realtime((struct timespec *)tv); do_realtime((struct timespec *)tv);
tv->tv_usec /= 1000; tv->tv_usec /= 1000;
if (unlikely(tz != NULL)) { if (unlikely(tz != NULL)) {
/* This relies on gcc inlining the memcpy. We'll notice /* Avoid memcpy. Some old compilers fail to inline it */
if it ever fails to do so. */ tz->tz_minuteswest = gtod->sys_tz.tz_minuteswest;
memcpy(tz, &gtod->sys_tz, sizeof(struct timezone)); tz->tz_dsttime = gtod->sys_tz.tz_dsttime;
} }
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment