This is the mail archive of the glibc-cvs@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]

GNU C Library master sources branch, master, updated. glibc-2.14-233-gef60624


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  ef60624956e93df1da329a48570776ed963b1916 (commit)
      from  6585cb60ee7aafc3301c402dda12d6771dfb7fa3 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ef60624956e93df1da329a48570776ed963b1916

commit ef60624956e93df1da329a48570776ed963b1916
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Tue Sep 6 00:12:18 2011 -0400

    Prefer real syscalls instead of vsyscalls on x86-64 outside libc.so

diff --git a/ChangeLog b/ChangeLog
index 3f8a821..0176dcf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-09-06  Ulrich Drepper  <drepper@gmail.com>
+
+	* sysdeps/unix/sysv/linux/kernel-features.h: Add entry for getcpu
+	syscall on x86-64.
+	* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c [!SHARED]: Use real
+	syscall.
+	* sysdeps/unix/sysv/linux/x86_64/time.c: Likewise.
+	* sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S [!SHARED]: Use real
+	syscall if possible.
+
 2011-09-05  Ulrich Drepper  <drepper@gmail.com>
 
 	* elf/pldd.c (get_process_info): Don't read whole ELF header, just
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index d91f581..58f833e 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -546,3 +546,8 @@
 #if __LINUX_KERNEL_VERSION >= 0x020627
 # define __ASSUME_SENDMMSG	1
 #endif
+
+/* getcpu is a syscall for x86-64 since 3.1.  */
+#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
+# define __ASSUME_GETCPU_SYSCALL	1
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
index 1a773d6..56171bc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
@@ -37,11 +37,12 @@ gettimeofday_ifunc (void)
 __asm (".type __gettimeofday, %gnu_indirect_function");
 #else
 # include <sys/time.h>
+# include <sysdep.h>
 
 int
 __gettimeofday (struct timeval *tv, struct timezone *tz)
 {
-  return ((int (*) (struct timeval *, struct timezone *)) VSYSCALL_ADDR_vgettimeofday) (tv, tz);
+  return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
 }
 #endif
 
diff --git a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
index 8ec7d3f..246c955 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+++ b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
@@ -20,6 +20,7 @@
 #include <tls.h>
 #define _ERRNO_H	1
 #include <bits/errno.h>
+#include <kernel-features.h>
 
 /* For the calculation see asm/vsyscall.h.  */
 #define VSYSCALL_ADDR_vgetcpu	0xffffffffff600800
@@ -38,10 +39,26 @@ ENTRY (sched_getcpu)
 #ifdef SHARED
 	movq	__vdso_getcpu(%rip), %rax
 	PTR_DEMANGLE (%rax)
+	callq	*%rax
 #else
+# ifdef __NR_getcpu
+	movl	$__NR_getcpu, %eax
+	syscall
+#  ifndef __ASSUME_GETCPU_SYSCALL
+	cmpq	$-ENOSYS, %rax
+	jne	1f
+#  endif
+# endif
+# ifndef __ASSUME_GETCPU_SYSCALL
 	movq	$VSYSCALL_ADDR_vgetcpu, %rax
-#endif
 	callq	*%rax
+1:
+# else
+#  ifndef __NR_getcpu
+#   error "cannot happen"
+#  endif
+# endif
+#endif
 
 	cmpq	$-4095, %rax
 	jae	SYSCALL_ERROR_LABEL
diff --git a/sysdeps/unix/sysv/linux/x86_64/time.c b/sysdeps/unix/sysv/linux/x86_64/time.c
index 698d561..c1c1a75 100644
--- a/sysdeps/unix/sysv/linux/x86_64/time.c
+++ b/sysdeps/unix/sysv/linux/x86_64/time.c
@@ -36,11 +36,13 @@ time_ifunc (void)
 __asm (".type time, %gnu_indirect_function");
 #else
 # include <time.h>
+# include <sysdep.h>
 
 time_t
 time (time_t *t)
 {
-  return ((time_t (*) (time_t *)) VSYSCALL_ADDR_vtime) (t);
+  INTERNAL_SYSCALL_DECL (err);
+  return INTERNAL_SYSCALL (time, err, 1, t);
 }
 #endif
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                     |   10 ++++++++++
 sysdeps/unix/sysv/linux/kernel-features.h     |    5 +++++
 sysdeps/unix/sysv/linux/x86_64/gettimeofday.c |    3 ++-
 sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S |   19 ++++++++++++++++++-
 sysdeps/unix/sysv/linux/x86_64/time.c         |    4 +++-
 5 files changed, 38 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


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