linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] input: make 2 macros in gameport.c TSC-aware
@ 2007-06-11  4:12 Miltiadis Margaronis
  2007-06-12  5:24 ` Dmitry Torokhov
  0 siblings, 1 reply; 2+ messages in thread
From: Miltiadis Margaronis @ 2007-06-11  4:12 UTC (permalink / raw)
  To: dmitry.torokhov; +Cc: linux-kernel, linux-input, linux-joystick


  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] input: make 2 macros in gameport.c TSC-aware
  2007-06-11  4:12 [PATCH] input: make 2 macros in gameport.c TSC-aware Miltiadis Margaronis
@ 2007-06-12  5:24 ` Dmitry Torokhov
  0 siblings, 0 replies; 2+ messages in thread
From: Dmitry Torokhov @ 2007-06-12  5:24 UTC (permalink / raw)
  To: linux-joystick; +Cc: Miltiadis Margaronis, linux-kernel, linux-input

Hi,

On Monday 11 June 2007 00:12, Miltiadis Margaronis wrote:
> 
>   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.
> 

I was told with the introduction of tickless kernels and such the best
option is to convert gameport to use hires timers.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-06-12  5:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11  4:12 [PATCH] input: make 2 macros in gameport.c TSC-aware Miltiadis Margaronis
2007-06-12  5:24 ` Dmitry Torokhov

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 NNTP newsgroup(s).