Commit 9291c78f authored by Sergey's avatar Sergey Committed by vvaltman

fix build for GCC < 5.0

Workaround for CPUID assembly code in older versions of GCC (<5.0).
parent b0e9c6b4
......@@ -30,10 +30,17 @@ kdb_cpuid_t *kdb_cpuid (void) {
return &cached;
}
int a;
#if ( __GNUC__ < 5 ) && defined( __i386__ ) && defined( __PIC__ )
asm volatile ("cpuid\n\t"
: "=a" (a), "=D" (cached.ebx) , "=c" (cached.ecx), "=d" (cached.edx)
: "0" (1)
);
#else
asm volatile ("cpuid\n\t"
: "=a" (a), "=b" (cached.ebx) , "=c" (cached.ecx), "=d" (cached.edx)
: "0" (1)
);
#endif
cached.magic = CPUID_MAGIC;
return &cached;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment