lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Jun 2007 07:12:32 +0300 (EEST)
From:	Miltiadis Margaronis <mmargaron@...il.com>
To:	dmitry.torokhov@...il.com
cc:	linux-kernel@...r.kernel.org, linux-input@...ey.karlin.mff.cuni.cz,
	linux-joystick@...ey.karlin.mff.cuni.cz
Subject: [PATCH] input: make 2 macros in gameport.c TSC-aware


  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@...il.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

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ