8 if (!cpuid_is_supported()) {
9 printf ("CPUID instruction is not supported by this CPU\n");
13 printf ("Vendor ID: %s\n", cpuid_get_cpu_type_string (cpuid_get_cpu_type ()));
16 cpuid(CPU_PROC_BRAND_STRING, (uint32_t *)buf);
17 printf ("Processor Brand: %s\n", buf);
19 printf ("Highest extended function supported: %#010x\n", cpuid_highest_ext_func_supported());
23 uint32_t phys_bits : 8;
24 uint32_t virt_bits : 8;
25 uint32_t reserved : 16;
29 cpuid(CPU_VIRT_PHYS_ADDR_SIZES, &s.w);
30 printf ("Physical address size: %d\nVirtual: %d\n", s.phys_bits, s.virt_bits);
32 uint32_t extfeatures[2];
33 cpuid(CPU_EXTENDED_PROC_INFO_FEATURE_BITS, extfeatures);
34 printf ("Extended processor info and feature bits: %d %d\n", extfeatures[0], extfeatures[1]);
38 uint32_t line_size : 8;
39 uint32_t reserved : 4;
41 uint32_t cache_size : 16;
47 cpuid(CPU_EXTENDED_L2_CACHE_FEATURES, &l2c.w);
48 printf ("L2 Cache Size: %u KB\tLine Size: %u bytes\tAssociativity: %02xh\n",
49 l2c.cache_size, l2c.line_size, l2c.assoc);
52 cpuid(0x0ffffffUL, &invalid);
53 printf ("Testing invalid: %#010x\n", invalid);