1
0
Fork 0
mirror of https://github.com/anrieff/libcpuid synced 2024-11-10 22:59:13 +00:00
Commit graph

617 commits

Author SHA1 Message Date
Veselin Georgiev
dbf9991553 Merge pull request #48 from X0rg/master
MSRs rework and man-pages
2016-06-05 14:39:57 +01:00
Xorg
ec445b0a54 Add load_driver() support for GNU/Linux & FreeBSD in cpu_msr_driver_open_core() 2016-06-05 14:10:19 +02:00
Xorg
023f0307f0 Minor changes for cpu_msrinfo() 2016-06-05 13:16:15 +02:00
Veselin Georgiev
7320ee9f29 Change configure.ac AGE (as per the comments in issue #46).
The new library generated under linux is libcpuid.so.13.0.0, which
makes it clear it's binary incompatible with the old version
(libcpuid.so.11.1.2).
2016-06-05 13:57:06 +03:00
Xorg
462ec75c79 Fix Doxygen warnings, don't warn if undocmented 2016-06-05 12:19:49 +02:00
Xorg
8fda5a74f1 Generate and install man-pages if Doxygen is installed 2016-06-05 12:09:59 +02:00
Xorg
240a862c45 Fix warnings
recog_intel.c:589:22: warning: implicit conversion from enumeration type 'enum _common_codes_t' to different enumeration type 'intel_code_t' (aka 'enum _intel_code_t')
recog_amd.c:449:9: warning: implicit conversion from enumeration type 'enum _common_codes_t' to different enumeration type 'amd_code_t' (aka 'enum _amd_code_t')
2016-06-05 11:07:00 +02:00
Xorg
cba9a1e19a Replace hardcoded addresses by define in cpu_msrinfo() 2016-06-04 20:52:27 +02:00
Xorg
e631e62ce6 Silent rules in configure.ac
Less useless output to easily see warnings
2016-06-04 20:36:58 +02:00
Xorg
9059fb6ff5 Add INFO_BUS_CLOCK in cpu_msrinfo() as a more generic term (same as INFO_BCLK)
BCLK is specific to Intel
2016-06-04 20:31:01 +02:00
Xorg
eeb7a6f3c7 Report CPU minimum multiplier (INFO_MIN_MULTIPLIER) in cpu_msrinfo() 2016-06-04 20:11:09 +02:00
Xorg
24cd11fea9 In cpu_msrinfo(), add experimental support for AMD CPUs for INFO_CUR_MULTIPLIER, INFO_MAX_MULTIPLIER and INFO_BCLK
get_amd_multipliers() allow to share a maximum of code
2016-06-04 19:50:21 +02:00
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
Xorg
8fc0cc0d4a Use internal code for MSR, replace cpuid_get_vendor() by id->vendor 2016-06-04 14:13:24 +02:00
Xorg
1ef4615d8f Use cpu_id_t in cpu_msrinfo()
It can be useful to have more informations on CPU
2016-06-04 13:16:41 +02:00
Veselin Georgiev
5f99a4528c Change version to 0.3.0 throughout the project. Update ChangeLog. 2016-06-03 21:15:37 +03:00
Xorg
5467504680 Use cpu_ident_internal() in cpu_msrinfo() 2016-06-03 15:58:45 +02:00
Xorg
93cdd0de75 Merge upstream changes
Conflicts:
	libcpuid/rdmsr.c
2016-06-03 14:36:24 +02:00
Veselin Georgiev
c31b5c0ae8 Add up to 8 entries for CPUID leaf 04; push version to 0.3.0.
This is a backwards-incompatible binary change, which increases
sizeof(cpu_raw_data_t). Specifically, the cpu_raw_data_t::intel_fn4
array is increased from 4 to 8 elements, because on recent Hasells
(Crystalwell) there is a Level 4 cache, which should be encoded in
CPUID eax=4 ecx=4. However, we were only storing levels for eax=4
for ecx <= 3. Thus the raw data didn't have the relevant info.

There will be further changes to this, specifically to store
and print the level 4 cache in cpuid_tool.
2016-06-03 04:35:01 +03:00
Veselin Georgiev
3f36114b19 Fix a few legit warnings (passing 'int*', where 'uint64*' is expected). 2016-06-03 03:34:08 +03:00
Veselin Georgiev
a2550463a9 Reorganize library a bit.
- Expose intel_code_t and amd_code_t enums - they are no longer
  limited to just recog_{intel,amd}.c.
- Add libcpuid_internal.h lists those enums and provides the,
  cpu_ident_internal() function, which is the same as cpu_identify(),
  but also has a third parameter - a internal_id_info_t structure,
  which holds detection internals.

All of this is intended to be used in rdmsr, which needs to know
specifics on what CPU it is running.
2016-06-03 03:30:36 +03:00
Xorg
77575736dd Move code from cpu_msrinfo() in subfunctions 2016-05-27 14:02:24 +02:00
Veselin Georgiev
86cf1df62c Update Readme.md with documentation links. 2016-05-22 23:35:30 +03:00
Veselin Georgiev
7fd52f01d6 Ignore generated Doxyfile. 2016-05-22 23:22:57 +03:00
Veselin Georgiev
db65e9a6b0 Fix a few Doxygen warnings and errors. Beautify docs a bit.
Also rename Doxyfile to Doxyfile.in, add it in configure and replace
version and pathspec in it with macros.
2016-05-22 23:20:16 +03:00
Veselin Georgiev
8c629d76b4 Fix minor issues with comments/documentation.
Also add a comment about the upcoming version 0.2.3. A date is not
stated, as this will be done when the actual release happens (and
I will collect any further patches up to that moment). I expect the
release to be over the next weekend.
2016-05-22 22:52:58 +03:00
Veselin Georgiev
00f349a7a3 Fix issue #45: OS X compilation error 2016-05-21 16:10:39 +03:00
Veselin Georgiev
7c7a0fea8b Merge pull request #43 from X0rg/master
Changes for MSR
2016-05-19 22:09:51 +01:00
Xorg
b067c68073 Use unsigned type instead of uint8_t as parameter for cpu_msr_driver_open_core() 2016-05-19 08:46:19 +02:00
Veselin Georgiev
14d6a9d875 Fix cpu_clock_by_ic() for Skylake (it was 1.6 times too high).
The reason and fix is similar to what we did previously for Bulldozer.
2016-05-19 01:37:45 +03:00
Veselin Georgiev
7b9fe29cef Support for Skylake.
- Detection of hle, rtm, avx512* and sha-ni instructions
- Detection for Skylake
- Add test with Skylake i5
2016-05-19 01:37:45 +03:00
Veselin Georgiev
3a977a4f99 Add detection support for the AMD TBM instructions. Update Vishera test. 2016-05-19 01:37:45 +03:00
Xorg
c2c32a1a70 Remove unnecessary tests in cpu_rdmsr_range() 2016-05-18 20:51:13 +02:00
Xorg
85bac12db4 Drop get_bits_value() 2016-05-18 20:46:47 +02:00
Xorg
801d4c982a Fix checking of core_num in cpu_msr_driver_open_core() 2016-05-18 18:42:11 +02:00
X0rg
aaa7e155a9 Fix some warnings
rdmsr.c:616:10: warning: comparison of 0 <= unsigned expression is always true [-Wtautological-compare]
                                if(0 <= val && val <= 7) { // Support 8 P-states
                                   ~ ^  ~~~
rdmsr.c:572:8: warning: variable 'val' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                                if(!multiplier)
                                   ^~~~~~~~~~~
rdmsr.c:574:8: note: uninitialized use occurs here
                                if(val > 0) {
                                   ^~~
rdmsr.c:572:5: note: remove the 'if' if its condition is always true
                                if(!multiplier)
                                ^~~~~~~~~~~~~~~
rdmsr.c:541:14: note: initialize the variable 'val' to silence this warning
        uint64_t val;
                    ^
                     = 0
2 warnings generated.
2016-05-18 18:15:39 +02:00
X0rg
5272d9f060 Add MSR support for FreeBSD
Tested on GhostBSD (based on FreeBSD)
It should work on DragonFlyBSD (the cpuctl driver has been ported from FreeBSD)
The situation for OpenBSD and NetBSD is not clear ; not supported
2016-05-18 18:06:23 +02:00
Xorg
6c70d53a18 Do some rearrangements in rdmsr.c file
I need to do that to add support for FreeBSD
2016-05-18 17:18:59 +02:00
Xorg
841c975e95 Make get_bits_value() more robust 2016-05-18 16:51:38 +02:00
Xorg
1d5ac6f23f Set cpu_rdmsr_range() and get_bits_value() as public functions 2016-05-18 16:47:06 +02:00
Xorg
9ce0158b88 Use get_bits_value() inside cpu_rdmsr_range() 2016-05-18 16:32:40 +02:00
Xorg
c9926ab6f7 Imrove cpu_rdmsr_range(), make header similar to cpu_rdmsr() 2016-05-18 14:59:55 +02:00
Xorg
b5e82df407 Add AMD support for INFO_VOLTAGE in cpu_msrinfo() 2016-05-18 14:22:24 +02:00
Veselin Georgiev
1145fdc116 Change signature of cpu_rdmsr: the msr index type changed to uint32. 2016-05-17 17:03:26 +03:00
Veselin Georgiev
f3f92402dc Remove duplication of data in lists intel_code_t / intel_bcode_str, etc. 2016-05-17 13:28:30 +03:00
wdlkmpx
04c01ad7f9 Show intel detected brand code string
So that it's easier to test and debug
2016-05-17 13:08:16 +03:00
wdlkmpx
be254c30ef Add 2 Intel P4 tests / Rename some tests/codenames
Rename some codenames to keep things tidy
2016-05-17 13:08:16 +03:00
Veselin Georgiev
2b5de90fa7 Merge pull request #41 from wdlkmpx/master
Ability to display AMD brand code; Add AMD Champlain mobile CPU to the DB.
2016-05-16 03:16:17 +03:00
wdlkmpx
061bd5986c Ability to display AMD brand code
So that it's easier to test and debug

Also added AMD Champlain mobile
Processor: AMD Athlon(tm) II P320 Dual-Core Processor
2016-05-11 21:21:02 +00:00
Veselin Georgiev
756ef8c469 Merge pull request #38 from wdlkmpx/master
Add Arrandale mobile
2016-05-08 16:24:02 +03:00