[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r15017 - in /fsf/trunk/libc: ./ sysdeps/unix/sysv/linux/x86_64/ sysdeps/unix/sysv/linux/x86_64/bits/



Author: eglibc
Date: Mon Aug 22 00:02:49 2011
New Revision: 15017

Log:
Import glibc-mainline for 2011-08-22

Added:
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.c
Removed:
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.S
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h
    fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Mon Aug 22 00:02:49 2011
@@ -1,3 +1,17 @@
+2011-08-21  Ulrich Drepper  <drepper@xxxxxxxxx>
+
+	* sysdeps/unix/sysv/linux/x86_64/gettimeofday.S: Removed.
+	* sysdeps/unix/sysv/linux/x86_64/time.S: Removed.
+	* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c: New file.
+	* sysdeps/unix/sysv/linux/x86_64/time.c: New file.
+	* sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h: Remove declaration
+	of __vdso_gettimeofday.
+	* sysdeps/unix/sysv/linux/x86_64/init-first.c: Remove definition of
+	__vdso_gettimeofday and __vdso_time.  Define __vdso_getcpu with
+	attribute_hidden.
+	(_libc_vdso_platform_setup): Remove initialization of
+	__vdso_gettimeofday and __vdso_time.
+
 2011-08-20  Ulrich Drepper  <drepper@xxxxxxxxx>
 
 	* nss/nss_files/files-alias.c (get_next_alias): Use feof_unlocked

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h Mon Aug 22 00:02:49 2011
@@ -1,5 +1,5 @@
 /* Resolve function pointers to VDSO functions.
-   Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2005, 2007, 2011 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
@@ -25,9 +25,6 @@
 
 #ifdef SHARED
 
-extern long int (*__vdso_gettimeofday) (struct timeval *, void *)
-  attribute_hidden;
-
 extern long int (*__vdso_clock_gettime) (clockid_t, struct timespec *);
 
 #endif

Removed: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S (removed)
@@ -1,49 +1,0 @@
-/* Copyright (C) 2002, 2003, 2007 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <sysdep.h>
-#define _ERRNO_H	1
-#include <bits/errno.h>
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000
-
-
-ENTRY (__gettimeofday)
-	/* Align stack.  */
-	sub	$0x8, %rsp
-	cfi_adjust_cfa_offset(8)
-#ifdef SHARED
-	movq	__vdso_gettimeofday(%rip), %rax
-	PTR_DEMANGLE (%rax)
-#else
-	movq	$VSYSCALL_ADDR_vgettimeofday, %rax
-#endif
-	callq	*%rax
-	/* Check error return.  */
-	cmpl	$-4095, %eax
-	jae	SYSCALL_ERROR_LABEL
-
-L(pseudo_end):
-	add	$0x8, %rsp
-	cfi_adjust_cfa_offset(-8)
-	ret
-PSEUDO_END(__gettimeofday)
-
-strong_alias (__gettimeofday, __gettimeofday_internal)
-weak_alias (__gettimeofday, gettimeofday)

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c Mon Aug 22 00:02:49 2011
@@ -1,0 +1,49 @@
+/* Copyright (C) 2002, 2003, 2007, 2011 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <dl-vdso.h>
+
+
+#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000ul
+
+
+#ifdef SHARED
+void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
+
+void *
+gettimeofday_ifunc (void)
+{
+  PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
+
+  /* If the vDSO is not available we fall back on the old vsyscall.  */
+  return (_dl_vdso_vsym ("gettimeofday", &linux26)
+	  ?: (void *) VSYSCALL_ADDR_vgettimeofday);
+}
+__asm (".type __gettimeofday, %gnu_indirect_function");
+#else
+# include <sys/time.h>
+
+int
+__gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+  return ((int (*) (struct timeval *, struct timezone *)) VSYSCALL_ADDR_vgettimeofday) (tv, tz);
+}
+#endif
+
+weak_alias (__gettimeofday, gettimeofday)
+strong_alias (__gettimeofday, __gettimeofday_internal)

Modified: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/init-first.c Mon Aug 22 00:02:49 2011
@@ -20,15 +20,11 @@
 # include <dl-vdso.h>
 # include <bits/libc-vdso.h>
 
-long int (*__vdso_gettimeofday) (struct timeval *, void *) attribute_hidden;
-
 long int (*__vdso_clock_gettime) (clockid_t, struct timespec *)
   __attribute__ ((nocommon));
 strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
 
-long int (*__vdso_getcpu) (unsigned *, unsigned *, void *);
-
-long int (*__vdso_time) (time_t *) attribute_hidden;
+long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
 
 
 static inline void
@@ -36,15 +32,7 @@
 {
   PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
 
-  void *p = _dl_vdso_vsym ("gettimeofday", &linux26);
-  /* If the vDSO is not available we fall back on the old vsyscall.  */
-#define VSYSCALL_ADDR_vgettimeofday	0xffffffffff600000ul
-  if (p == NULL)
-    p = (void *) VSYSCALL_ADDR_vgettimeofday;
-  PTR_MANGLE (p);
-  __vdso_gettimeofday = p;
-
-  p = _dl_vdso_vsym ("clock_gettime", &linux26);
+  void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
   PTR_MANGLE (p);
   __GI___vdso_clock_gettime = p;
 
@@ -55,14 +43,6 @@
     p = (void *) VSYSCALL_ADDR_vgetcpu;
   PTR_MANGLE (p);
   __vdso_getcpu = p;
-
-  p = _dl_vdso_vsym ("time", &linux26);
-  /* If the vDSO is not available we fall back on the old vsyscall.  */
-#define VSYSCALL_ADDR_vtime	0xffffffffff600400
-  if (p == NULL)
-    p = (void *) VSYSCALL_ADDR_vtime;
-  PTR_MANGLE (p);
-  __vdso_time = p;
 }
 
 # define VDSO_SETUP _libc_vdso_platform_setup

Removed: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.S
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.S (original)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.S (removed)
@@ -1,47 +1,0 @@
-/* Copyright (C) 2001,02, 2003, 2011 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, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
-
-#include <sysdep.h>
-#define _ERRNO_H	1
-#include <bits/errno.h>
-
-/* For the calculation see asm/vsyscall.h.  */
-#define VSYSCALL_ADDR_vtime	0xffffffffff600400
-
-
-/* Return the current time as a `time_t' and also put it in *T if T is
-   not NULL.  Time is represented as seconds from Jan 1 00:00:00 1970.  */
-
-ENTRY (time)
-	/* Align stack.  */
-	sub	$0x8, %rsp
-	cfi_adjust_cfa_offset(8)
-
-#ifdef SHARED
-	movq	__vdso_time(%rip), %rax
-	PTR_DEMANGLE (%rax)
-#else
-	movq	$VSYSCALL_ADDR_vtime, %rax
-#endif
-	callq	*%rax
-
-	add	$0x8, %rsp
-	cfi_adjust_cfa_offset(-8)
-	ret
-PSEUDO_END_NOERRNO(time)
-libc_hidden_def (time)

Added: fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.c
==============================================================================
--- fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.c (added)
+++ fsf/trunk/libc/sysdeps/unix/sysv/linux/x86_64/time.c Mon Aug 22 00:02:49 2011
@@ -1,0 +1,47 @@
+/* Copyright (C) 2001,02, 2003, 2011 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <dl-vdso.h>
+
+
+#define VSYSCALL_ADDR_vtime	0xffffffffff600400
+
+
+#ifdef SHARED
+void *time_ifunc (void) __asm__ ("time");
+
+void *
+time_ifunc (void)
+{
+  PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
+
+  /* If the vDSO is not available we fall back on the old vsyscall.  */
+  return _dl_vdso_vsym ("time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime;
+}
+__asm (".type time, %gnu_indirect_function");
+#else
+# include <time.h>
+
+time_t
+time (time_t *t)
+{
+  return ((time_t (*) (time_t *)) VSYSCALL_ADDR_vtime) (t);
+}
+#endif
+
+strong_alias (time, __GI_time)