about summary refs log tree commit diff
path: root/sysdeps/generic
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 /sysdeps/generic
parentb17c0a8e31fe9e99359b6a874008de7aba85d64e (diff)
downloadglibc-5fc48cd78f0c50e889d1c1f3b8f812058db71ecd.tar.gz
glibc-5fc48cd78f0c50e889d1c1f3b8f812058db71ecd.tar.xz
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 'sysdeps/generic')
-rw-r--r--sysdeps/generic/cpuclock-init.h1
-rw-r--r--sysdeps/generic/dl-sysdep.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/sysdeps/generic/cpuclock-init.h b/sysdeps/generic/cpuclock-init.h
new file mode 100644
index 0000000000..085cf179da
--- /dev/null
+++ b/sysdeps/generic/cpuclock-init.h
@@ -0,0 +1 @@
+/* In general there is no CPU clock.  */
diff --git a/sysdeps/generic/dl-sysdep.c b/sysdeps/generic/dl-sysdep.c
index eb70d3de80..024864f72f 100644
--- a/sysdeps/generic/dl-sysdep.c
+++ b/sysdeps/generic/dl-sysdep.c
@@ -35,6 +35,7 @@
 #include <dl-machine.h>
 #include <dl-procinfo.h>
 #include <dl-osinfo.h>
+#include <cpuclock-init.h>
 
 extern int _dl_argc;
 extern char **_dl_argv;
@@ -60,7 +61,9 @@ int __libc_multiple_libcs = 0;	/* Defining this here avoids the inclusion
 void *__libc_stack_end;
 static ElfW(auxv_t) *_dl_auxv;
 unsigned long int _dl_hwcap_mask = HWCAP_IMPORTANT;
-
+#ifdef CPUCLOCK_VARDEF
+CPUCLOCK_VARDEF (_dl_cpuclock_offset);
+#endif
 
 #ifndef DL_FIND_ARG_COMPONENTS
 # define DL_FIND_ARG_COMPONENTS(cookie, argc, argv, envp, auxp)	\
@@ -97,6 +100,10 @@ _dl_sysdep_start (void **start_argptr,
 # define set_seen(tag) seen |= M ((tag)->a_type)
 #endif
 
+#ifdef CPUCLOCK_INIT
+  CPUCLOCK_INIT (_dl_cpuclock_offset);
+#endif
+
   DL_FIND_ARG_COMPONENTS (start_argptr, _dl_argc, _dl_argv, _environ,
 			  _dl_auxv);