__cpuid -- Executes CPUID instruction

Format

#include <builtin.h>
_cpuidinfo *__cpuid(unsigned int type, _cpuidinfo *pInfo)

Language Level: None
__cpuid executes a CPUID instruction using type as the input value. This builtin function will not work on a 386 or 486 processor. Refer to the Intel Programmer's Reference manual for more information about the CPUID instruction.

Return Value
Returns the results of the CPUID instruction results in a structure whose address is pInfo. The actual return value is pInfo.

Example
This example prints out the results of the CPUID instruction when the input value is zero.

#include <stdio.h>
#include <builtin.h>
int main(void)
{
   _cpuidinfo info;
   (void)__cpuid(0, &info);
   printf("CPUID with input value of 0 returns\n"
          "eax:%.8x ebx:%.8x ecx:%.8x edx:%.8x\n",
          info.eax, info.ebx, info.ecx, info.edx);
   /******************************************************
      The output should be similar to:
      CPUID with input value of 0 returns
      eax:00000001 ebx:756e6547 ecx:6c65746e edx:49656e69
   ******************************************************/
   return 0;
}