staticinlinevoid
cpuid(unsignedint op, unsignedint op2, unsignedint *a, unsignedint *b, unsignedint *c, unsignedint *d)
{ /* * Preserve %ebx/%rbx register by either placing it in %rdi or saving it * on the stack - x86-64 needs to avoid the stack red zone. In PIC * compilations %ebx contains the address of the global offset * table. %rbx is occasionally used to address stack variables in * presence of dynamic allocas.
*/ asm( #ifdefined(__x86_64__) "mov %%rbx, %%rdi\n" "cpuid\n" "xchg %%rdi, %%rbx\n" #else "pushl %%ebx\n" "cpuid\n" "movl %%ebx, %%edi\n" "popl %%ebx\n" #endif
: "=a"(*a), "=D"(*b), "=c"(*c), "=d"(*d)
: "a"(op), "2"(op2));
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.