James Eder : ntdll: Add support for cpuid on x86_64.
Alexandre Julliard
julliard at winehq.org
Mon Oct 22 13:42:44 CDT 2012
Module: wine
Branch: master
Commit: 1ce0c9578a3708b19967e6e1a8ccb6771823306f
URL: http://source.winehq.org/git/wine.git/?a=commit;h=1ce0c9578a3708b19967e6e1a8ccb6771823306f
Author: James Eder <jimportal at gmail.com>
Date: Sat Oct 20 18:40:43 2012 -0600
ntdll: Add support for cpuid on x86_64.
---
dlls/ntdll/nt.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 878c58b..972277d 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,6 +855,8 @@ static inline int have_cpuid(void)
: "=&r" (f1), "=&r" (f2)
: "ir" (0x00200000));
return ((f1^f2) & 0x00200000) != 0;
+#elif defined(__x86_64__)
+ return 1;
#else
return 0;
#endif
More information about the wine-cvs
mailing list