8 if (!cpuid_is_supported()) {
9 printf ("CPUID instruction is not supported by this CPU\n");
14 cpuid(CPU_VENDORID, buf);
15 printf ("Vendor ID: %s\n", buf);
17 cpuid(CPU_PROC_BRAND_STRING, buf);
18 printf ("Processor Brand: %s\n", buf);
21 cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &addr);
22 printf ("Highest extended function supported: %#010x\n", addr);
26 uint32_t phys_bits : 8;
27 uint32_t virt_bits : 8;
28 uint32_t reserved : 16;
32 cpuid(CPU_VIRT_PHYS_ADDR_SIZES, &s.w);
33 printf ("Physical address size: %d\nVirtual: %d\n", s.phys_bits, s.virt_bits);
36 cpuid(CPU_EXTENDED_PROC_INFO_FEATURE_BITS, extfeatures);
37 printf ("Extended processor info and feature bits: %d %d\n", extfeatures[0], extfeatures[1]);
41 uint32_t line_size : 8;
42 uint32_t reserved : 4;
44 uint32_t cache_size : 16;
50 cpuid(CPU_EXTENDED_L2_CACHE_FEATURES, &l2c.w);
51 printf ("L2 Cache Size: %u KB\tLine Size: %u bytes\tAssociativity: %02xh\n",
52 l2c.cache_size, l2c.line_size, l2c.assoc);
55 cpuid(0x0ffffffUL, &invalid);
56 printf ("Testing invalid: %#010x\n", invalid);