Branch: Tag:

2015-09-28

2015-09-28 14:35:35 by Martin Nilsson <nilsson@fastmail.com>

Set x86_get_cpuid response order to eax,ebx,edx,ecx in all cases.

17:   PMOD_EXPORT void x86_get_cpuid(int oper, INT32 *cpuid_ptr)   /* eax -> cpuid_ptr[0]    * ebx -> cpuid_ptr[1] -  * ecx -> cpuid_ptr[2] -  * edx -> cpuid_ptr[3] */ +  * edx -> cpuid_ptr[2] +  * ecx -> cpuid_ptr[3] */   {   #ifdef HAVE_X86_64_ASM   #define cpuid_supported 1
83: Inside #if SIZEOF_CHAR_P == 4
   "popl %%ebx \n\t" /* restore the old %ebx */    : "=a"(cpuid_ptr[0]),    "=r"(cpuid_ptr[1]), -  "=c"(cpuid_ptr[2]), -  "=d"(cpuid_ptr[3]) +  "=d"(cpuid_ptr[2]), +  "=c"(cpuid_ptr[3])    : "0"(oper)    : "cc");   #else
94:    "pop %%rbx \n\t" /* restore the old %rbx */    : "=a"(cpuid_ptr[0]),    "=r"(cpuid_ptr[1]), -  "=c"(cpuid_ptr[2]), -  "=d"(cpuid_ptr[3]) +  "=d"(cpuid_ptr[2]), +  "=c"(cpuid_ptr[3])    : "0"(oper)    : "cc");   #endif