Created
October 19, 2010 20:39
-
-
Save scottmac/635060 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static __inline void do_cpuid(u_int ax, u_int *p) { | |
__asm __volatile("pushl %%ebx\n\t" | |
"cpuid\n\t" | |
"movl %%ebx, %%esi\n\t" | |
"popl %%ebx\n\t" | |
: "=a" (p[0]), "=r" (p[1]), "=c" (p[2]), "=d" (p[3]) | |
: "a" (ax)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment