]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Consolidate gettimeofday across aarch64/s390/tile
authorAdhemerval Zanella <adhemerval.zanella@linaro.com>
Fri, 17 Apr 2015 14:48:51 +0000 (11:48 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 26 May 2015 20:03:35 +0000 (17:03 -0300)
This patch removes the architecture specific gettimeofday implementation
to use the vDSO symbol and consolidate it on a common Linux one.
Similar to clock_gettime and clock_getres vDSO implementation, each port
that supports gettimeofday through vDSO should just implement INLINE_VSYSCALL
to access the symbol and define HAVE_{GETTIME,GETRES}_VSYSCAL as 1.

ChangeLog
sysdeps/unix/sysv/linux/aarch64/init-first.c
sysdeps/unix/sysv/linux/aarch64/sysdep.h
sysdeps/unix/sysv/linux/gettimeofday.c [moved from sysdeps/unix/sysv/linux/aarch64/gettimeofday.c with 86% similarity]
sysdeps/unix/sysv/linux/powerpc/init-first.c
sysdeps/unix/sysv/linux/s390/gettimeofday.c [deleted file]
sysdeps/unix/sysv/linux/s390/init-first.c
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
sysdeps/unix/sysv/linux/tile/gettimeofday.c [deleted file]
sysdeps/unix/sysv/linux/tile/sysdep.h

index 81ce22e61b2f5c6e9ae181cf38142fddc9f0d2d9..93ea276ed951bf49dbcda5f7b0d28957c30b87c7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2015-05-26  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c: Remove file.
+       * sysdeps/unix/sysv/linux/s390/gettimeofday.c: Likewise.
+       * sysdeps/unix/sysv/linux/tile/gettimeofday.c: Likewise.
+       * sysdeps/unix/sysv/linux/aarch64/sysdep.h
+       (HAVE_GETTIMEOFDAY_VSYSCALL): Define.
+       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
+       (HAVE_GETTIMEOFDAY_VSYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h
+       (HAVE_GETTIMEOFDAY_VSYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/tile/sysdep.h
+       (HAVE_GETTIMEOFDAY_VSYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/gettimeofday.c: New file: gettimeofday
+       using vDSO syscall macro.
+
 2015-05-26  Andriy Rysin  <arysin@gmail.com>
 
        [BZ #17293]
index 854189a79345a0cbaccf525a81a8e9c16a7c833c..9cf6c258c40345c4ef0cf0188990fc5476c00e23 100644 (file)
@@ -18,9 +18,6 @@
 
 #ifdef SHARED
 # include <dl-vdso.h>
-# undef __gettimeofday
-# undef __clock_gettime
-# undef __clock_getres
 # include <libc-vdso.h>
 
 int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *) attribute_hidden;
index e69622a24b5436051cae2d6a4d77bb247974f41d..fe94a50d47c8f28e5b5ab4c50cc56ea8d1e2b47f 100644 (file)
 /* List of system calls which are supported as vsyscalls.  */
 # define HAVE_CLOCK_GETRES_VSYSCALL    1
 # define HAVE_CLOCK_GETTIME_VSYSCALL   1
+# define HAVE_GETTIMEOFDAY_VSYSCALL    1
 
 /* Define a macro which expands into the inline wrapper code for a system
    call.  */
similarity index 86%
rename from sysdeps/unix/sysv/linux/aarch64/gettimeofday.c
rename to sysdeps/unix/sysv/linux/gettimeofday.c
index daa6538a68970b5d6d1bd5af135cdaf86d1eb0ae..d88c39f40571f4303105f535fb3edcbdfeeb564c 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005-2015 Free Software Foundation, Inc.
+/* Copyright (C) 2015 Free Software Foundation, Inc.
 
    This file is part of the GNU C Library.
 
 
 #undef __gettimeofday
 
-#define HAVE_VSYSCALL
+#ifdef HAVE_GETTIMEOFDAY_VSYSCALL
+# define HAVE_VSYSCALL
+#endif
 #include <sysdep-vdso.h>
 
 /* Get the current time of day and timezone information,
    putting it into *tv and *tz.  If tz is null, *tz is not filled.
    Returns 0 on success, -1 on errors.  */
 int
-__gettimeofday (tv, tz)
-     struct timeval *tv;
-     struct timezone *tz;
+__gettimeofday (struct timeval *tv, struct timezone *tz)
 {
   return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
 }
index ee91c0bf9e4877e4d1b9c1252cf22eaddb44faf9..287e84459a780993573617a9acde5ef61188b888 100644 (file)
@@ -18,9 +18,6 @@
 
 #ifdef SHARED
 # include <dl-vdso.h>
-# undef __gettimeofday
-# undef __clock_gettime
-# undef __clock_getres
 # include <libc-vdso.h>
 
 int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
diff --git a/sysdeps/unix/sysv/linux/s390/gettimeofday.c b/sysdeps/unix/sysv/linux/s390/gettimeofday.c
deleted file mode 100644 (file)
index 9f98f29..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Copyright (C) 2008-2015 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <stddef.h>
-#include <sys/time.h>
-#include <time.h>
-#include <hp-timing.h>
-
-#define HAVE_VSYSCALL
-#include <sysdep-vdso.h>
-
-/* Get the current time of day and timezone information,
-   putting it into *TV and *TZ.  If TZ is NULL, *TZ is not filled.
-   Returns 0 on success, -1 on errors.  */
-
-int
-__gettimeofday (tv, tz)
-     struct timeval *tv;
-     struct timezone *tz;
-{
-  return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
-}
-libc_hidden_def (__gettimeofday)
-weak_alias (__gettimeofday, gettimeofday)
-libc_hidden_weak (gettimeofday)
index 8129967ba5f026b3280784e8945687d7f53610b1..552dbd1aa67e6847a5b7efdcaaa9df574a5ab022 100644 (file)
@@ -18,9 +18,6 @@
 
 #ifdef SHARED
 # include <dl-vdso.h>
-# undef __gettimeofday
-# undef __clock_gettime
-# undef __clock_getres
 # include <libc-vdso.h>
 
 long int (*VDSO_SYMBOL(gettimeofday)) (struct timeval *, void *)
index a773a2856dbb4875109194c5f5940bf7e84c33bc..c768df1743c1100c9223dda8746e2a1c561dc65a 100644 (file)
 /* List of system calls which are supported as vsyscalls.  */
 #define HAVE_CLOCK_GETRES_VSYSCALL     1
 #define HAVE_CLOCK_GETTIME_VSYSCALL    1
+#define HAVE_GETTIMEOFDAY_VSYSCALL     1
 
 /* This version is for internal uses when there is no desire
    to set errno */
index c944634cdeac7c57cb894b6667ee52f2f98d6ddb..c041153b3a89213b17c9ba78c7fa29b15cb52468 100644 (file)
 /* List of system calls which are supported as vsyscalls.  */
 #define HAVE_CLOCK_GETRES_VSYSCALL     1
 #define HAVE_CLOCK_GETTIME_VSYSCALL    1
+#define HAVE_GETTIMEOFDAY_VSYSCALL     1
 
 /* This version is for internal uses when there is no desire
    to set errno */
diff --git a/sysdeps/unix/sysv/linux/tile/gettimeofday.c b/sysdeps/unix/sysv/linux/tile/gettimeofday.c
deleted file mode 100644 (file)
index 13382ab..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Copyright (C) 2012-2015 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <sysdep.h>
-#include <stddef.h>
-#include <sys/time.h>
-#include <time.h>
-
-#define HAVE_VSYSCALL
-#include <sysdep-vdso.h>
-
-int
-__gettimeofday (struct timeval *tv, struct timezone *tz)
-{
-  return INLINE_VSYSCALL (gettimeofday, 2, tv, tz);
-}
-
-libc_hidden_def (__gettimeofday)
-weak_alias (__gettimeofday, gettimeofday)
-libc_hidden_weak (gettimeofday)
index 30d52e32c9a70b1844475d87225c02029de6a3b2..1f4122c46b27b34cf2ccee3940a0d6e946bf4524 100644 (file)
 
 /* List of system calls which are supported as vsyscalls.  */
 #define HAVE_CLOCK_GETTIME_VSYSCALL    1
+#define HAVE_GETTIMEOFDAY_VSYSCALL     1
 
 #endif /* __ASSEMBLER__  */