Skip to content

Commit

Permalink
* sysdeps/unix/sysv/linux/x86_64/libc-start.c
Browse files Browse the repository at this point in the history
	(_libc_vdso_platform_setup): If vDSO is not available point
	__vdso_gettimeofday to the vsyscall.
	* sysdeps/unix/sysv/linux/x86_64/gettimeofday.S [SHARED]: Use
	__vdso_gettimeofday instead of vsyscall.
  • Loading branch information
Ulrich Drepper committed Aug 13, 2007
1 parent f8de505 commit 9c6f695
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2007-08-13 Ulrich Drepper <drepper@redhat.com>

* sysdeps/unix/sysv/linux/x86_64/libc-start.c
(_libc_vdso_platform_setup): If vDSO is not available point
__vdso_gettimeofday to the vsyscall.
* sysdeps/unix/sysv/linux/x86_64/gettimeofday.S [SHARED]: Use
__vdso_gettimeofday instead of vsyscall.

2007-08-13 Jakub Jelinek <jakub@redhat.com>

* nscd/servicescache.c: Include kernel-features.h.
Expand Down
22 changes: 22 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
2007-08-13 Jakub Jelinek <jakub@redhat.com>

* allocatestack.c: Include kernel-features.h.
* pthread_create.c: Likewise.
* pthread_mutex_init.c: Likewise.
* init.c: Likewise.
* pthread_cond_timedwait.c: Likewise.
* sysdeps/unix/sysv/linux/alpha/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/ia64/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_wrlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_rdlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_unlock.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_timedwait.S: Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/i386/i486/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/s390/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sparc/lowlevellock.h: Likewise.
* sysdeps/unix/sysv/linux/sh/pthread_cond_timedwait.S: Likewise.

2007-08-12 Jakub Jelinek <jakub@redhat.com>

* sysdeps/unix/sysv/linux/sparc/bits/pthreadtypes.h
Expand Down
7 changes: 6 additions & 1 deletion sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright (C) 2002, 2003 Free Software Foundation, Inc.
/* Copyright (C) 2002, 2003, 2007 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
Expand Down Expand Up @@ -28,7 +28,12 @@ ENTRY (__gettimeofday)
/* Align stack. */
sub $0x8, %rsp
cfi_adjust_cfa_offset(8)
#ifdef SHARED
movq __vdso_gettimeofday(%rip), %rax
PTR_DEMANGLE (%rax)
#else
movq $VSYSCALL_ADDR_vgettimeofday, %rax
#endif
callq *%rax
/* Check error return. */
cmpl $-4095, %eax
Expand Down
4 changes: 4 additions & 0 deletions sysdeps/unix/sysv/linux/x86_64/libc-start.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ _libc_vdso_platform_setup (void)
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);

void *p = _dl_vdso_vsym ("gettimeofday", &linux26);
/* If the vDSO is not available we fall back on the old vsyscall. */
#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul
if (p == NULL)
p = (void *) VSYSCALL_ADDR_vgettimeofday;
PTR_MANGLE (p);
__vdso_gettimeofday = p;

Expand Down

0 comments on commit 9c6f695

Please sign in to comment.