Author: tfaber
Date: Sat Nov 12 00:07:42 2011
New Revision: 54354
URL:
http://svn.reactos.org/svn/reactos?rev=54354&view=rev
Log:
[USBDRV]
- Get rid of some inline assembly
Modified:
trunk/reactos/drivers/usb/nt4compat/usbdrv/usb.c
Modified: trunk/reactos/drivers/usb/nt4compat/usbdrv/usb.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/nt4compat/usbd…
==============================================================================
--- trunk/reactos/drivers/usb/nt4compat/usbdrv/usb.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/nt4compat/usbdrv/usb.c [iso-8859-1] Sat Nov 12 00:07:42
2011
@@ -982,31 +982,17 @@
__inline BOOLEAN
usb_query_clicks(PLARGE_INTEGER clicks)
{
- BOOLEAN ret_val;
+ BOOLEAN ret_val = FALSE;
+ int cpu_info[4];
//so we have to use intel's cpu???
- ret_val = FALSE;
-
-#ifdef _MSC_VER
- __asm
- {
- push ebx;
- push eax;
- mov eax, 1; //read version
- cpuid;
- test edx, 0x10; //timer stamp
- jz LBL_OUT;
- // cpuid //serialization
- rdtsc;
- mov ebx, dword ptr[clicks];
- mov dword ptr[ebx], eax;
- mov dword ptr[ebx + 4], edx;
- mov dword ptr[ret_val], TRUE;
-LBL_OUT:
- pop eax;
- pop ebx;
- }
-#else
- ret_val = FALSE;
+
+#if defined(_M_IX86) || defined(_M_AMD64)
+ __cpuid(cpu_info, 1);
+ if (cpu_info[3] & 0x10) // Time Stamp Counter (TSC) bit
+ {
+ clicks->QuadPart = __rdtsc();
+ ret_val = TRUE;
+ }
#endif
return ret_val;
}