1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-11-10 22:59:13 +00:00
a small C library for x86 CPU detection and feature extraction
Find a file
Xorg 14cfc77b17 Improve/clean code for cpu_msrinfo()
* Add AMD and Intel doc links
* Use 'return' only if there is no error; on error, the end-function 'return CPU_INVALID_VALUE' is used
* Add more comments about MSRs
* Simplify a lot of things
* Avoid cpu_rdmsr_range() to override cpu_rdmsr() error
* Remove int casting in cpu_msrinfo()
2016-06-04 17:51:48 +02:00
contrib/MSR Driver Added support for reading MSRs through dedicated driver on Win32 2009-09-30 11:25:14 +00:00
cpuid_tool Update cpuid_tool to print the new supported MSR info. 2015-10-16 03:07:55 +03:00
debian Address lintian warnings/errors. Fixes issue #16. 2015-04-21 12:23:51 -04:00
libcpuid Improve/clean code for cpu_msrinfo() 2016-06-04 17:51:48 +02:00
tests Support for Skylake. 2016-05-19 01:37:45 +03:00
.gitignore Ignore generated Doxyfile. 2016-05-22 23:22:57 +03:00
AUTHORS Moving the repository one level deeper 2008-11-06 18:17:20 +00:00
ChangeLog Bump the version to 0.2.2 (and briefly describe changes since 2012). 2015-11-04 01:31:22 +02:00
configure.ac Add up to 8 entries for CPUID leaf 04; push version to 0.3.0. 2016-06-03 04:35:01 +03:00
COPYING Moving the repository one level deeper 2008-11-06 18:17:20 +00:00
libcpuid.dsw Ported to Microsoft Visual C 6.0 2012-08-25 23:14:59 +00:00
libcpuid.pc.in Incorrect path in .pc file - fixed; Clarified documentation a bit 2008-11-28 16:17:29 +00:00
libcpuid_vc9.sln Renamed VC project files so that project for versions lower than Visual C++ 2008 can be made. 2009-08-19 21:14:39 +00:00
libcpuid_vc71.sln Added project files for Visual Studio 2003 (VC 71), added an option to build libcpuid as a DLL. 2009-08-19 21:43:56 +00:00
Makefile.am Fix 'make test' failing without any really wrong tests. 2016-03-10 02:44:17 +02:00
NEWS Moving the repository one level deeper 2008-11-06 18:17:20 +00:00
README Convert README to markdown. 2015-11-04 01:31:23 +02:00
Readme.md Update Readme.md with documentation links. 2016-05-22 23:35:30 +03:00

libcpuid

libcpuid provides CPU identification for the x86 (and x86_64). For details about the programming API, you might want to take a look at the project's website on sourceforge (http://libcpuid.sourceforge.net/). There you'd find a short tutorial, as well as the full API reference.

Configuring after checkout

Under linux, where you download the sources, there's no configure script to run. This is because it isn't a good practice to keep such scripts in a source control system. To create it, you need to run the following commands once, after you checkout the libcpuid sources from github:

    1. run "libtoolize"
    2. run "autoreconf --install"

You need to have autoconf, automake and libtool installed.

After that you can run ./configure and make - this will build the library.

make dist will create a tarball (with "configure" inside) with the sources.

Testing

After any change to the detection routines or match tables, it's always a good idea to run make test. If some test fails, and you're confident that the test is wrong and needs fixing, run make fix-tests.

You can also add a new test (which is basically a file containing the raw CPUID data and the expected decoded items) by using tests/create_test.py. The workflow there is as follows:

  1. Run "cpuid_tool" with no arguments. It will tell you that it has written a pair of files, raw.txt and report.txt. Ensure that report.txt contains meaningful data.
  2. Run "tests/create_test.py raw.txt report.txt > «my-cpu».test"
  3. Use a proper descriptive name for the test (look into tests/amd and tests/intel to get an idea) and copy your test file to an appropriate place within the tests directory hierarchy.

For non-developers, who still want to contribute tests for the project, use this page to report misdetections or new CPUs that libcpuid doesn't handle well yet.

Users

So far, I'm aware of the following projects which utilize libcpuid:

We'd love to hear from you if you are also using libcpuid and want your project listed above.