- int addr;
- cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &addr);
- printf ("Highest extended function supported: %#010x\n", addr);
-
- union {
- struct {
- uint32_t phys_bits : 8;
- uint32_t virt_bits : 8;
- uint32_t reserved : 16;
- };
- uint32_t w;
- } s;
- cpuid(CPU_VIRT_PHYS_ADDR_SIZES, &s.w);
- printf ("Physical address size: %d\nVirtual: %d\n", s.phys_bits, s.virt_bits);
-
- int extfeatures[2];
- cpuid(CPU_EXTENDED_PROC_INFO_FEATURE_BITS, extfeatures);
- printf ("Extended processor info and feature bits: %d %d\n", extfeatures[0], extfeatures[1]);
+ uint32_t procinfo[11];
+ cpuid(CPU_PROCINFO_AND_FEATUREBITS, procinfo);
+ printf("Stepping: %d Model: 0x%X Family: %d extended model: %d extended family: %d\n",
+ procinfo[0], procinfo[1], procinfo[2], procinfo[3], procinfo[4]);
+ printf("Brand Index: %d CL Flush Line Size: %d Logical Processors: %d Initial APICID: %d\n",
+ procinfo[7], procinfo[8], procinfo[9], procinfo[10]);
+
+ printf ("Highest extended function supported: %#010x\n", cpuid_highest_ext_func_supported());