<sect1><title>cpuid</title>
<sect2><title>Acronym definition</title>
<para>
<emphasis>Intel</emphasis> <emphasis>CPU</emphasis> instruction mnemonic.
</para>

<sect2><title>Definition</title>
<para>
The linux <emphasis>kernel</emphasis> for x86 includes support for the cpuid instruction. The following code is used as of 2.5.59:
</para>

<programlisting>
/*
 * Generic CPUID function
 */
static inline void cpuid(int op, int *eax, int *ebx, int *ecx, int *edx)
{
        __asm__("cpuid"
               : "=a" (*eax),
                 "=b" (*ebx),
                 "=c" (*ecx),
                 "=d" (*edx)
               : "0" (op));
}
</programlisting>

<para>
Other architectures implement cpuid functions as well.
</para>

<para>
This <emphasis>inline assembly</emphasis> specifies that output from this <emphasis>instruction</emphasis> will go to the <emphasis>EAX</emphasis>, <emphasis>EBX</emphasis>, <emphasis>ECX</emphasis>, and <emphasis>EDX</emphasis> <emphasis>registers</emphasis>. In input operand is constrained to being the same as the 0th output operand, in other words <emphasis>EAX</emphasis>.
</para>

<para>
The cpuid instruction has three input operand values, each which return a different set of information about the target processor. Refer to the <emphasis>Intel</emphasis> instruction set reference for more information.
</para>

<para>
There is a program by Phil Karn (KA9Q) called cpuid which calls this instruction as well.
</para>
</sect2>

<sect2><title>Implementation source files</title>
<itemizedlist>
<listitem><para>/include/asm-i386/processor.h</para></listitem>
</itemizedlist>
</sect2>

<sect2><title>References</title>
<itemizedlist>
<listitem><para>Intel instruction set manual</para></listitem>
</itemizedlist>
</sect2>

<sect2><title>Entry history</title>
<itemizedlist>
<listitem><para>Entry created: Wed Mar 19 21:26:37 EST 2003</para></listitem>
<listitem><para>Entry owner: <emphasis>Michael Still</emphasis> (mikal@stillhq.com)</para></listitem>
<listitem><para>Status: Unfinalized</para></listitem>
</itemizedlist>
</sect1>