// http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inlin #include void cpuid_array(uint32_t op, uint32_t reg[4]) { asm volatile( "pushl %%ebx \n" /* save %ebx */ "cpuid \n" "movl %%ebx, %1 \n" /* save what cpuid just put in %ebx */ "popl %%ebx \n" /* restore the old %ebx */ : "=a"(reg[0]), "=r"(reg[1]), "=c"(reg[2]), "=d"(reg[3]) : "a"(op) : "cc"); }