From: Miltiadis Margaronis <mmargaron@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-kernel@vger.kernel.org,
linux-input@atrey.karlin.mff.cuni.cz,
linux-joystick@atrey.karlin.mff.cuni.cz
Subject: [PATCH] input: make 2 macros in gameport.c TSC-aware
Date: Mon, 11 Jun 2007 07:12:32 +0300 (EEST) [thread overview]
Message-ID: <alpine.BSF.0.99.0706110624150.5014@micmac.localdomain> (raw)
This makes DELTA and GET_TIME in drivers/input/gameport/gameport.c
similar to the ones in drivers/input/joystick/analog.c . Worked on
2.6.22-rc4-git2.
Signed-off-by: Miltiadis Margaronis <mmargaron@gmail.com>
--- a/drivers/input/gameport/gameport.c 2007-06-05 03:57:02.000000000 +0300
+++ b/drivers/input/gameport/gameport.c 2007-06-09 07:20:45.000000000 +0300
@@ -64,8 +64,8 @@ static void gameport_disconnect_port(str
#include <asm/i8253.h>
-#define DELTA(x,y) ((y)-(x)+((y)<(x)?1193182/HZ:0))
-#define GET_TIME(x) do { x = get_time_pit(); } while (0)
+#define DELTA(x,y) (cpu_has_tsc ? ((y) - (x)) : ((y) - (x) +((y) < (x) ? CLOCK_TICK_RATE / HZ : 0)))
+#define GET_TIME(x) do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
static unsigned int get_time_pit(void)
{
--
Miltos
next reply other threads:[~2007-06-11 4:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-11 4:12 Miltiadis Margaronis [this message]
2007-06-12 5:24 ` Dmitry Torokhov
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=alpine.BSF.0.99.0706110624150.5014@micmac.localdomain \
--to=mmargaron@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@atrey.karlin.mff.cuni.cz \
--cc=linux-joystick@atrey.karlin.mff.cuni.cz \
--cc=linux-kernel@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®