[PATCH 1/8] ntdll: Add support for cpuid on x86_64

James Eder jimportal at gmail.com
Sat Oct 20 19:40:43 CDT 2012


---
 dlls/ntdll/nt.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 878c58b..9813a45 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -827,6 +827,13 @@ static inline void do_cpuid(unsigned int ax, unsigned int *p)
                 "popl %%ebx"
                 : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3])
                 :  "0" (ax));
+#elif defined(__x86_64__)
+	__asm__("push %%rbx\n\t"
+                "cpuid\n\t"
+                "movq %%rbx, %%rsi\n\t"
+                "pop %%rbx"
+                : "=a" (p[0]), "=S" (p[1]), "=c" (p[2]), "=d" (p[3])
+                :  "0" (ax));
 #endif
 }
 
@@ -848,8 +855,8 @@ static inline int have_cpuid(void)
                 : "=&r" (f1), "=&r" (f2)
                 : "ir" (0x00200000));
 	return ((f1^f2) & 0x00200000) != 0;
-#else
-        return 0;
+#elif defined(__x86_64__)
+        return 1;
 #endif
 }
 
-- 
1.7.12.4




More information about the wine-patches mailing list