public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Don't assume all future x86-64's will have usable TSC
@ 2004-10-05  8:42 Jakub Jelinek
  0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2004-10-05  8:42 UTC (permalink / raw)
  To: Ulrich Drepper; +Cc: Glibc hackers

Hi!

2004-10-05  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/x86_64/sysconf.c (__sysconf): Return 200112L
	for _SC_CPUTIME or _SC_THREAD_CPUTIME.
nptl/
	* sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
	_POSIX_THREAD_CPUTIME): Define to 0.
linuxthreads/
	* sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h (_POSIX_CPUTIME,
	_POSIX_THREAD_CPUTIME): Define to 0.

--- libc/sysdeps/unix/sysv/linux/x86_64/sysconf.c.jj	2004-03-15 09:13:21.000000000 +0100
+++ libc/sysdeps/unix/sysv/linux/x86_64/sysconf.c	2004-10-05 10:30:17.772272728 +0200
@@ -279,6 +279,12 @@ handle_amd (int name)
 long int
 __sysconf (int name)
 {
+  if (name == _SC_CPUTIME || name == _SC_THREAD_CPUTIME)
+    {
+      /* XXX Test whether TSC is usable.  */
+      return 200112L;
+    }
+
   /* We only handle the cache information here (for now).  */
   if (name < _SC_LEVEL1_ICACHE_SIZE || name > _SC_LEVEL4_CACHE_LINESIZE)
     return linux_sysconf (name);
--- libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h.jj	2004-04-13 10:42:53.000000000 +0200
+++ libc/nptl/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h	2004-10-05 10:30:48.001872870 +0200
@@ -103,10 +103,10 @@
 #define _POSIX_SHARED_MEMORY_OBJECTS	200112L
 
 /* CPU-time clocks supported.  */
-#define _POSIX_CPUTIME 200112L
+#define _POSIX_CPUTIME 0
 
 /* We support the clock also in threads.  */
-#define _POSIX_THREAD_CPUTIME  200112L
+#define _POSIX_THREAD_CPUTIME  0
 
 /* GNU libc provides regular expression handling.  */
 #define _POSIX_REGEXP	1
--- libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h.jj	2004-10-05 09:04:43.000000000 +0200
+++ libc/linuxthreads/sysdeps/unix/sysv/linux/x86_64/bits/posix_opt.h	2004-10-05 10:31:37.919956531 +0200
@@ -106,10 +106,10 @@
 #define _POSIX_SHARED_MEMORY_OBJECTS	200112L
 
 /* CPU-time clocks supported.  */
-#define _POSIX_CPUTIME	200112L
+#define _POSIX_CPUTIME	0
 
 /* We support the clock also in threads.  */
-#define _POSIX_THREAD_CPUTIME	200112L
+#define _POSIX_THREAD_CPUTIME	0
 
 /* GNU libc provides regular expression handling.  */
 #define _POSIX_REGEXP	1

	Jakub

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-10-05  8:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-05  8:42 [PATCH] Don't assume all future x86-64's will have usable TSC Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).