aboutsummaryrefslogtreecommitdiff
path: root/elf/dl-support.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-21 07:55:01 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-21 07:55:01 +0000
commit5fc48cd78f0c50e889d1c1f3b8f812058db71ecd (patch)
tree97c81fc8d9405b4f9228f2a76282017e887d8b13 /elf/dl-support.c
parentb17c0a8e31fe9e99359b6a874008de7aba85d64e (diff)
downloadglibc-5fc48cd78f0c50e889d1c1f3b8f812058db71ecd.tar
glibc-5fc48cd78f0c50e889d1c1f3b8f812058db71ecd.tar.gz
glibc-5fc48cd78f0c50e889d1c1f3b8f812058db71ecd.tar.bz2
glibc-5fc48cd78f0c50e889d1c1f3b8f812058db71ecd.zip
Update.
2001-04-21 Ulrich Drepper <drepper@redhat.com> * elf/dl-support.c: Include cpuclock-init.h. Use CPUCLOCK_VARDEF and CPUCLOCK_INIT if defined. * sysdeps/generic/dl-sysdep.c: Likewise. * sysdeps/generic/cpuclock-init.h: New file. * sysdeps/unix/i386/i586/cpuclock-init.h: New file. * sysdeps/unix/i386/i586/Versions: New file. * sysdeps/unix/i386/i586/clock_settime.c: New file. * sysdeps/unix/i386/i586/clock_gettime.c: Handle thread CPU clock separately by calling __pthread_clock_gettime if this function is available. Subtract offset from tsc value before computing time value.
Diffstat (limited to 'elf/dl-support.c')
-rw-r--r--elf/dl-support.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/elf/dl-support.c b/elf/dl-support.c
index 8c10180e26..fa1b1874e7 100644
--- a/elf/dl-support.c
+++ b/elf/dl-support.c
@@ -29,6 +29,7 @@
#include <bits/libc-lock.h>
#include <dl-librecon.h>
#include <unsecvars.h>
+#include <cpuclock-init.h>
extern char *__progname;
char **_dl_argv = &__progname; /* This is checked for some error messages. */
@@ -92,6 +93,11 @@ struct r_scope_elem *_dl_main_searchlist = &_dl_initial_searchlist;
/* Nonzero during startup. */
int _dl_starting_up = 1;
+/* Initial value of the CPU clock. */
+#ifdef CPUCLOCK_VARDEF
+CPUCLOCK_VARDEF (_dl_cpuclock_offset);
+#endif
+
/* During the program run we must not modify the global data of
loaded shared object simultanously in two threads. Therefore we
protect `_dl_open' and `_dl_close' in dl-close.c.
@@ -127,6 +133,10 @@ static void non_dynamic_init (void) __attribute__ ((unused));
static void
non_dynamic_init (void)
{
+#ifdef CPUCLOCK_INIT
+ CPUCLOCK_INIT (_dl_cpuclock_offset);
+#endif
+
if (!_dl_pagesize)
_dl_pagesize = __getpagesize ();