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.13-226-ga8509ca


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  a8509ca540427502bd955f35296ff7b727c7a8a1 (commit)
      from  fdc2fefe46db79f0a19f690531cd775fbbc2740f (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=a8509ca540427502bd955f35296ff7b727c7a8a1

commit a8509ca540427502bd955f35296ff7b727c7a8a1
Author: Ulrich Drepper <drepper@gmail.com>
Date:   Fri May 27 16:09:52 2011 -0400

    Use getcpu definition from vDSO on x86-64

diff --git a/ChangeLog b/ChangeLog
index 34df6ba..5e52617 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2011-05-27  Ulrich Drepper  <drepper@gmail.com>
 
+	[BZ #12813]
+	* sysdeps/unix/sysv/linux/x86_64/init-first.c (__vdso_getcpu):
+	Retrieve getcpu symbol from vDSO.  Substitute with vsyscall if not
+	available.
+	* sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S [SHARED]: Use
+	__vdso_getcpu.
+
 	[BZ #12814]
 	* iconvdata/Makefile (tests): Add bug-iconv9.
 	* iconvdata/bug-iconv9.c: New file.
diff --git a/NEWS b/NEWS
index 2cdb0cc..d899685 100644
--- a/NEWS
+++ b/NEWS
@@ -17,7 +17,7 @@ Version 2.14
   12545, 12551, 12582, 12583, 12587, 12597, 12601, 12611, 12625, 12626,
   12631, 12650, 12653, 12655, 12660, 12671, 12681, 12685, 12711, 12713,
   12714, 12717, 12723, 12724, 12734, 12738, 12746, 12766, 12775, 12777,
-  12782, 12788, 12792, 12795, 12814
+  12782, 12788, 12792, 12795, 12813, 12814
 
 * The RPC implementation in libc is obsoleted.  Old programs keep working
   but new programs cannot be linked with the routines in libc anymore.
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index ead7dbc..23934fc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -26,6 +26,8 @@ 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 *);
+
 
 static inline void
 _libc_vdso_platform_setup (void)
@@ -43,6 +45,14 @@ _libc_vdso_platform_setup (void)
   p = _dl_vdso_vsym ("clock_gettime", &linux26);
   PTR_MANGLE (p);
   __GI___vdso_clock_gettime = p;
+
+  p = _dl_vdso_vsym ("getcpu", &linux26);
+  /* If the vDSO is not available we fall back on the old vsyscall.  */
+#define VSYSCALL_ADDR_vgetcpu	0xffffffffff600800
+  if (p == NULL)
+    p = (void *) VSYSCALL_ADDR_vgetcpu;
+  PTR_MANGLE (p);
+  __vdso_getcpu = p;
 }
 
 # define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
index a950990..8ec7d3f 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+++ b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2007 Free Software Foundation, Inc.
+/* Copyright (C) 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
@@ -35,7 +35,12 @@ ENTRY (sched_getcpu)
 	movl	$VGETCPU_CACHE_OFFSET, %edx
 	addq	%fs:0, %rdx
 
+#ifdef SHARED
+	movq	__vdso_getcpu(%rip), %rax
+	PTR_DEMANGLE (%rax)
+#else
 	movq	$VSYSCALL_ADDR_vgetcpu, %rax
+#endif
 	callq	*%rax
 
 	cmpq	$-4095, %rax

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

Summary of changes:
 ChangeLog                                     |    7 +++++++
 NEWS                                          |    2 +-
 sysdeps/unix/sysv/linux/x86_64/init-first.c   |   12 +++++++++++-
 sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S |    7 ++++++-
 4 files changed, 25 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]