Using inline assembly with serialization instructions
问题 We consider that we are using GCC (or GCC -compatible) compiler on a X86_64 architecture, and that eax , ebx , ecx , edx and level are variables ( unsigned int or unsigned int* ) for input and output of the instruction (like here). asm("CPUID":::); asm volatile("CPUID":::); asm volatile("CPUID":::"memory"); asm volatile("CPUID":"=a"(eax),"=b"(ebx),"=c"(ecx),"=d"(edx)::"memory"); asm volatile("CPUID":"=a"(eax):"0"(level):"memory"); asm volatile("CPUID"::"a"(level):"memory"); // Not sure of