From: john stultz <johnstul@us.ibm.com>
To: marcelo <marcelo@conectiva.com.br>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: [TRIVIAL][PATCH] tsc-cleanup_A0
Date: 20 Jun 2002 17:20:51 -0700 [thread overview]
Message-ID: <1024618851.5184.186.camel@cog> (raw)
[-- Attachment #1: Type: text/plain, Size: 196 bytes --]
Marcelo
Poking around w/ the tsc-disable patch, I figured I should send out
this trivial cleanup as well. I got these changes from a post Brian
Gerst originally released for 2.5.
thanks
-john
[-- Attachment #2: linux-2.4.19-pre10_tsc-cleanup_A0.patch --]
[-- Type: text/x-patch, Size: 1303 bytes --]
diff -Nru a/drivers/char/joystick/analog.c b/drivers/char/joystick/analog.c
--- a/drivers/char/joystick/analog.c Thu Jun 20 17:11:02 2002
+++ b/drivers/char/joystick/analog.c Thu Jun 20 17:11:02 2002
@@ -137,10 +137,9 @@
*/
#ifdef __i386__
-#define TSC_PRESENT (test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability))
-#define GET_TIME(x) do { if (TSC_PRESENT) rdtscl(x); else { outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } } while (0)
-#define DELTA(x,y) (TSC_PRESENT?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
-#define TIME_NAME (TSC_PRESENT?"TSC":"PIT")
+#define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else { outb(0, 0x43); x = inb(0x40); x |= inb(0x40) << 8; } } while (0)
+#define DELTA(x,y) (cpu_has_tsc?((y)-(x)):((x)-(y)+((x)<(y)?1193180L/HZ:0)))
+#define TIME_NAME (cpu_has_tsc?"TSC":"PIT")
#elif __x86_64__
#define GET_TIME(x) rdtscl(x)
#define DELTA(x,y) ((y)-(x))
diff -Nru a/drivers/char/random.c b/drivers/char/random.c
--- a/drivers/char/random.c Thu Jun 20 17:11:02 2002
+++ b/drivers/char/random.c Thu Jun 20 17:11:02 2002
@@ -735,7 +735,7 @@
int entropy = 0;
#if defined (__i386__)
- if ( test_bit(X86_FEATURE_TSC, &boot_cpu_data.x86_capability) ) {
+ if (cpu_has_tsc) {
__u32 high;
rdtsc(time, high);
num ^= high;
reply other threads:[~2002-06-21 0:27 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1024618851.5184.186.camel@cog \
--to=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.