pike.git / src / pike_cpulib.c

version» Context lines:

pike.git/src/pike_cpulib.c:10: Inside #if defined(HAVE_X86_ASM)
     #ifdef HAVE_X86_ASM      #if !defined (CL_X86_ASM_STYLE) && !defined (GCC_X86_ASM_STYLE)   #error Dont know how to inline assembler with this compiler   #endif      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   #else /* HAVE_IA32_ASM */    static int cpuid_supported = 0;    if (!cpuid_supported) {    int fbits=0;   #ifdef CL_X86_ASM_STYLE    __asm {    pushf
pike.git/src/pike_cpulib.c: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 */    "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    __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]) +  "=d"(cpuid_ptr[2]), +  "=c"(cpuid_ptr[3])    : "0"(oper)    : "cc");   #endif   #endif    } else {    cpuid_ptr[0] = cpuid_ptr[1] = cpuid_ptr[2] = cpuid_ptr[3] = 0;    }   }      #endif /* HAVE_IA32_ASM */