From 1ce0c9578a3708b19967e6e1a8ccb6771823306f Mon Sep 17 00:00:00 2001 From: James Eder Date: Sat, 20 Oct 2012 18:40:43 -0600 Subject: [PATCH] ntdll: Add support for cpuid on x86_64. --- dlls/ntdll/nt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c index 878c58b3998..972277da60a 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 -- 2.11.4.GIT