lkml.org 
[lkml]   [2003]   [Feb]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] linux-2.5.63_x86-tsc-cleanup_A0
From
Date
Linus, All,
As promised, here is a minor cleanup that removes the usage of
CONFIG_X86_TSC in get_cycles(), replacing it with a runtime conditional
of if(cpu_has_tsc).

Andi: I've already posted this a few times without complaint, but since
you didn't like my playing with get_cycles() last time, let me know if
have any issues with this.

thanks
-john


diff -Nru a/include/asm-i386/timex.h b/include/asm-i386/timex.h
--- a/include/asm-i386/timex.h Mon Feb 24 21:09:32 2003
+++ b/include/asm-i386/timex.h Mon Feb 24 21:09:32 2003
@@ -40,14 +40,10 @@

static inline cycles_t get_cycles (void)
{
-#ifndef CONFIG_X86_TSC
- return 0;
-#else
- unsigned long long ret;
-
- rdtscll(ret);
+ unsigned long long ret = 0;
+ if(cpu_has_tsc)
+ rdtscll(ret);
return ret;
-#endif
}

extern unsigned long cpu_khz;


[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.041 / U:2.828 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site