mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
S390: Add support for vdso getcpu symbol.
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.
This commit is contained in:
11
ChangeLog
11
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>
|
2016-05-08 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* sysdeps/i386/cacheinfo.c: Include <sysdeps/x86/cacheinfo.c>
|
* sysdeps/i386/cacheinfo.c: Include <sysdeps/x86/cacheinfo.c>
|
||||||
|
@ -29,6 +29,8 @@ long int (*VDSO_SYMBOL(clock_gettime)) (clockid_t, struct timespec *)
|
|||||||
long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
|
long int (*VDSO_SYMBOL(clock_getres)) (clockid_t, struct timespec *)
|
||||||
__attribute__ ((nocommon));
|
__attribute__ ((nocommon));
|
||||||
|
|
||||||
|
long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
|
||||||
|
attribute_hidden;
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
_libc_vdso_platform_setup (void)
|
_libc_vdso_platform_setup (void)
|
||||||
@ -46,6 +48,10 @@ _libc_vdso_platform_setup (void)
|
|||||||
p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2629);
|
p = _dl_vdso_vsym ("__kernel_clock_getres", &linux2629);
|
||||||
PTR_MANGLE (p);
|
PTR_MANGLE (p);
|
||||||
VDSO_SYMBOL (clock_getres) = 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
|
# define VDSO_SETUP _libc_vdso_platform_setup
|
||||||
|
@ -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(clock_getres)) (clockid_t, struct timespec *);
|
||||||
|
|
||||||
|
extern long int (*VDSO_SYMBOL(getcpu)) (unsigned *, unsigned *, void *)
|
||||||
|
attribute_hidden;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* _LIBC_VDSO_H */
|
#endif /* _LIBC_VDSO_H */
|
||||||
|
@ -283,6 +283,7 @@
|
|||||||
#define HAVE_CLOCK_GETRES_VSYSCALL 1
|
#define HAVE_CLOCK_GETRES_VSYSCALL 1
|
||||||
#define HAVE_CLOCK_GETTIME_VSYSCALL 1
|
#define HAVE_CLOCK_GETTIME_VSYSCALL 1
|
||||||
#define HAVE_GETTIMEOFDAY_VSYSCALL 1
|
#define HAVE_GETTIMEOFDAY_VSYSCALL 1
|
||||||
|
#define HAVE_GETCPU_VSYSCALL 1
|
||||||
|
|
||||||
/* This version is for internal uses when there is no desire
|
/* This version is for internal uses when there is no desire
|
||||||
to set errno */
|
to set errno */
|
||||||
|
@ -289,6 +289,7 @@
|
|||||||
#define HAVE_CLOCK_GETRES_VSYSCALL 1
|
#define HAVE_CLOCK_GETRES_VSYSCALL 1
|
||||||
#define HAVE_CLOCK_GETTIME_VSYSCALL 1
|
#define HAVE_CLOCK_GETTIME_VSYSCALL 1
|
||||||
#define HAVE_GETTIMEOFDAY_VSYSCALL 1
|
#define HAVE_GETTIMEOFDAY_VSYSCALL 1
|
||||||
|
#define HAVE_GETCPU_VSYSCALL 1
|
||||||
|
|
||||||
/* This version is for internal uses when there is no desire
|
/* This version is for internal uses when there is no desire
|
||||||
to set errno */
|
to set errno */
|
||||||
|
Reference in New Issue
Block a user