mirror of
https://sourceware.org/git/glibc.git
synced 2025-09-04 03:22:14 +03:00
Add support for time syscall in vDSO
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
2011-05-28 Ulrich Drepper <drepper@gmail.com>
|
2011-05-28 Ulrich Drepper <drepper@gmail.com>
|
||||||
|
|
||||||
|
[BZ #12813]
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/init-first.c (__vdso_time): Retrieve
|
||||||
|
time symbol from vDSO. Substitute with vsyscall if not available.
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/time.S [SHARED]: Use
|
||||||
|
__vdso_time.
|
||||||
|
|
||||||
* sysdeps/unix/sysv/linux/internal_sendmmsg.S: New file.
|
* sysdeps/unix/sysv/linux/internal_sendmmsg.S: New file.
|
||||||
* sysdeps/unix/sysv/linux/sendmmsg.c: New file.
|
* sysdeps/unix/sysv/linux/sendmmsg.c: New file.
|
||||||
* sysdeps/unix/sysv/linux/Makefile [subdir=socket] (sysdep_routines):
|
* sysdeps/unix/sysv/linux/Makefile [subdir=socket] (sysdep_routines):
|
||||||
|
@@ -28,6 +28,8 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
|
|||||||
|
|
||||||
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *);
|
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *);
|
||||||
|
|
||||||
|
long int (*__vdso_time) (time_t *) attribute_hidden;
|
||||||
|
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
_libc_vdso_platform_setup (void)
|
_libc_vdso_platform_setup (void)
|
||||||
@@ -53,6 +55,14 @@ _libc_vdso_platform_setup (void)
|
|||||||
p = (void *) VSYSCALL_ADDR_vgetcpu;
|
p = (void *) VSYSCALL_ADDR_vgetcpu;
|
||||||
PTR_MANGLE (p);
|
PTR_MANGLE (p);
|
||||||
__vdso_getcpu = 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
|
# define VDSO_SETUP _libc_vdso_platform_setup
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/* Copyright (C) 2001,02, 2003 Free Software Foundation, Inc.
|
/* Copyright (C) 2001,02, 2003, 2011 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@@ -32,7 +32,12 @@ ENTRY (time)
|
|||||||
sub $0x8, %rsp
|
sub $0x8, %rsp
|
||||||
cfi_adjust_cfa_offset(8)
|
cfi_adjust_cfa_offset(8)
|
||||||
|
|
||||||
|
#ifdef SHARED
|
||||||
|
movq __vdso_time(%rip), %rax
|
||||||
|
PTR_DEMANGLE (%rax)
|
||||||
|
#else
|
||||||
movq $VSYSCALL_ADDR_vtime, %rax
|
movq $VSYSCALL_ADDR_vtime, %rax
|
||||||
|
#endif
|
||||||
callq *%rax
|
callq *%rax
|
||||||
|
|
||||||
add $0x8, %rsp
|
add $0x8, %rsp
|
||||||
|
Reference in New Issue
Block a user