Branch: Tag:

2012-04-29

2012-04-29 16:05:54 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed cpuid code for amd64.

76:    };   #else /* GCC_X86_ASM_STYLE */    + #if SIZEOF_CHAR_P == 4    __asm__ __volatile__("pushl %%ebx \n\t" /* save %ebx */    "cpuid \n\t"    "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */
86:    "=d"(cpuid_ptr[3])    : "0"(oper)    : "cc"); -  + #else +  __asm__ __volatile__("push %%rbx \n\t" /* save %rbx */ +  "cpuid \n\t" +  "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */ +  "pop %%rbx \n\t" /* restore the old %rbx */ +  : "=a"(cpuid_ptr[0]), +  "=r"(cpuid_ptr[1]), +  "=c"(cpuid_ptr[2]), +  "=d"(cpuid_ptr[3]) +  : "0"(oper) +  : "cc");   #endif -  + #endif    } else {    cpuid_ptr[0] = cpuid_ptr[1] = cpuid_ptr[2] = cpuid_ptr[3] = 0;    }