libcpuid  0.2.2
A simple libcpuid introduction

libcpuid.h Veselin Georgiev Oct 2008 0.2.2

Version history:

LibCPUID provides CPU identification and access to the CPUID and RDTSC instructions on the x86.

To execute CPUID, use cpu_exec_cpuid
To execute RDTSC, use cpu_rdtsc
To fetch the CPUID info needed for CPU identification, use cpuid_get_raw_data
To make sense of that data (decode, extract features), use cpu_identify
To detect the CPU speed, use either cpu_clock, cpu_clock_by_os, cpu_tsc_mark + cpu_tsc_unmark + cpu_clock_by_mark, cpu_clock_measure or cpu_clock_by_ic. Read carefully for pros/cons of each method.

To read MSRs, use cpu_msr_driver_open to get a handle, and then cpu_rdmsr for querying abilities. Some MSR decoding is available on recent CPUs, and can be queried through cpu_msrinfo; the various types of queries are described in cpu_msrinfo_request_t.