]> sourceware.org Git - glibc.git/commitdiff
S390: Add support for vdso getcpu symbol.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Mon, 9 May 2016 09:05:45 +0000 (11:05 +0200)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Mon, 9 May 2016 09:05:45 +0000 (11:05 +0200)
This patch adds support for symbol __kernel_getcpu in vDSO,
which is available with kernel 4.5.
Now sched_getcpu is using this symbol if available in mapped vDSO
by defining macro HAVE_GETCPU_VSYSCALL. If not available at runtime,
the former syscall is used.

ChangeLog
sysdeps/unix/sysv/linux/s390/init-first.c
sysdeps/unix/sysv/linux/s390/libc-vdso.h
sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h

index 4677e87194ef263d3814e35a06ef94c2a108e081..1f5261a315d8848a92503053b28f777c8c5cafab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2016-05-09  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * sysdeps/unix/sysv/linux/s390/init-first.c:
+       Add VDSO_SYMBOL(getcpu).
+       (_libc_vdso_platform_setup): Initialize VDSO_SYMBOL(getcpu).
+       * sysdeps/unix/sysv/linux/s390/libc-vdso.h:
+       Add VDSO_SYMBOL(getcpu).
+       * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h:
+       New define HAVE_GETCPU_VSYSCALL.
+       * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h: Likewise.
+
 2016-05-08  H.J. Lu  <hongjiu.lu@intel.com>
 
        * sysdeps/i386/cacheinfo.c: Include <sysdeps/x86/cacheinfo.c>
index d3a20fda30e181b49e4bab903c817a8bc83a3180..7498cbe007349cdc83471a38ff1f4c007d4472bf 100644 (file)
@@ -29,6 +29,8 @@ long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
 long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
   __attribute__ ((nocommon));
 
+long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
+   attribute_hidden;
 
 static inline void
 _libc_vdso_platform_setup (void)
@@ -46,6 +48,10 @@ _libc_vdso_platform_setup (void)
   p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2629);
   PTR_MANGLE (p);
   VDSO_SYMBOL (clock_getres) = p;
+
+  p = _dl_vdso_vsym ("__kernel_getcpu", &linux2629);
+  PTR_MANGLE (p);
+  VDSO_SYMBOL (getcpu) = p;
 }
 
 # define VDSO_SETUP _libc_vdso_platform_setup
index d2a83161bb8a35d9cd6df6882602a025521b0d2c..512b3ba3072e42b37263f2ddfb8f49906538a819 100644 (file)
@@ -31,6 +31,8 @@ extern long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *);
 
 extern long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *);
 
+extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
+   attribute_hidden;
 #endif
 
 #endif /* _LIBC_VDSO_H */
index 3540416e0ee4ef34472a6384af6eafd3d117b9e4..651e1ee40cbc9e40b3eab439293220db68cf0fa1 100644 (file)
 #define HAVE_CLOCK_GETRES_VSYSCALL     1
 #define HAVE_CLOCK_GETTIME_VSYSCALL    1
 #define HAVE_GETTIMEOFDAY_VSYSCALL     1
+#define HAVE_GETCPU_VSYSCALL           1
 
 /* This version is for internal uses when there is no desire
    to set errno */
index 6f390ff626a607e28df312c564983cd65f7a77ab..702b0b6a44964ba8c79f9a20bd98897df2b7db03 100644 (file)
 #define HAVE_CLOCK_GETRES_VSYSCALL     1
 #define HAVE_CLOCK_GETTIME_VSYSCALL    1
 #define HAVE_GETTIMEOFDAY_VSYSCALL     1
+#define HAVE_GETCPU_VSYSCALL           1
 
 /* This version is for internal uses when there is no desire
    to set errno */
This page took 0.180558 seconds and 5 git commands to generate.