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

535 commits

Author SHA1 Message Date
Veselin Georgiev
6b09bceb66 Implement cpu_msr_driver_open_core() on Mac OS X and Windows (dummies).
On Windows, we don't have the API that Linux provides, which can be used
to query MSRs of particular CPU cores. However, the same behaviour can be
emulated. Say that the driver handle object also stores 'dedicated thread
index'. When you call 'cpu_msr_driver_open()', this index is set to -1,
so further API functions do not force which core should be executing
RDMSR code. I.e. "I don't care on which core I run".
However, if this is non-negative number, the subsequent
functions like cpu_rdmsr() are forced to pass through this core by
using temporary affinity mask.
2015-10-17 03:00:58 +03:00
Veselin Georgiev
3b713ff7a2 Update cpuid_tool to print the new supported MSR info. 2015-10-16 03:07:55 +03:00
Veselin Georgiev
53fe741649 Update errors list; add error messages which had no text description. 2015-10-16 03:07:24 +03:00
Veselin Georgiev
08615d76fe Merge pull request #22 from X0rg/pull_request
Some new features for function cpu_msrinfo()
2015-10-16 02:16:35 +03:00
Xorg
d0bb9f1249 Make some functions private
This commit is to complete commit 7df646a2749f6ef942f9684d66fee14614a74314.
2015-10-15 16:40:16 +02:00
Xorg
b1cff440b7 Remove cpu_vendor() function, replaced by cpuid_get_vendor() function 2015-10-15 16:40:16 +02:00
Xorg
a853fcd25b Split cpuid_basic_identify() function and add cpuid_get_vendor() function
These changes are needed to improve cpu_vendor() function. Discussion about these changes come from here (french forum): https://forums.archlinux.fr/viewtopic.php?f=18&t=15973&e=1&view=unread#p147593
The original patch, written by Benjamin ROBIN, is available here: http://pastebin.com/5BHUiCB1
2015-10-15 16:40:16 +02:00
Xorg
32ddb7d734 Improve code readability since recent changes in function cpu_msrinfo() 2015-10-12 15:58:11 +02:00
Xorg
11b51a105c Implement INFO_TEMPERATURE for Intel in cpu_msrinfo() 2015-10-06 15:39:51 +02:00
Xorg
f11a5b6d16 Modify INFO_MAX_MULTIPLIER for Intel in cpu_msrinfo() 2015-10-06 15:39:51 +02:00
Xorg
ce6ba819f9 Modify INFO_CUR_MULTIPLIER for Intel in cpu_msrinfo() 2015-10-06 15:39:51 +02:00
Xorg
42e8d6f019 Add INFO_BCLK in cpu_msrinfo() 2015-10-06 15:39:51 +02:00
Xorg
fc72fdee74 Add INFO_VOLTAGE in cpu_msrinfo() 2015-10-06 15:39:51 +02:00
Xorg
36f24eae94 Import some functions from i7z
Get_Bits_Value() is renamed in get_bits_value(), imported from
 5023138d7c/helper_functions.c (L48)
get_msr_value() is renamed in cpu_rdmsr_range(), imported from
 5023138d7c/helper_functions.c (L234)
2015-10-06 15:39:23 +02:00
Xorg
6c8dfd306f Add function cpu_vendor() to define vendor-specific code 2015-10-06 15:39:23 +02:00
Xorg
79fcdba98e Add function cpu_msr_driver_open_core()
This function is similar to cpu_msr_driver_open(), but with core number as parameter
For Linux, core number was always 0. To be able to get all core temp/voltage, we need to set the core number.
2015-10-06 15:39:03 +02:00
Veselin Georgiev
4e3b633bee Fix tests due to X0rg's codename changes. 2015-09-13 18:38:59 +03:00
Veselin Georgiev
4a72a734aa Correctly recognize Sandy Bridge-E Xeons.
They have L3 cache, and the detection code incorrectly assumed this is a Xeon
Irwindale variant due to an old and no longer valid classification check.
Correctly handle the XEON_IRWIN subcode and add an entry in the matchtable
to fix Sandy Bridge-E Xeon.
2015-09-13 18:36:23 +03:00
Xorg
f642b79047 Add support for newer Intel CPUs 2015-09-13 18:21:53 +03:00
Xorg
80e6bca100 Some restructuring for Intel Nehalem CPUs and newer 2015-09-13 18:13:43 +03:00
Xorg
505102370b Add support for more AMD CPUs 2015-09-13 18:13:43 +03:00
Veselin Georgiev
153a6a7c7d Add support for detecting Xeon Ivy Bridge.
Based on report #7 from the sourceforge bugtrack page.
2015-09-03 09:33:38 +03:00
Veselin Georgiev
81128e2384 Merge pull request #20 from cosmy1/master
MSVC warning fix
2015-07-31 15:26:43 +03:00
cosmy1
4dbcaaf47d Update libcpuid_util.c 2015-07-31 14:21:41 +02:00
cosmy1
fe63724d53 MSVC warning fix
using _strdup instead of strdup on Visual C++
2015-07-31 14:20:58 +02:00
Veselin Georgiev
01ece12668 Merge pull request #19 from x64architecture/master
Fix maximum extended level check in load_amd_features()
2015-05-18 00:12:40 +03:00
Kurt Cancemi
da68fd8bf8 Fix max extended level check 2015-05-17 17:06:05 -04:00
Veselin Georgiev
2834683640 Fixed issue #18: Win64 issues
- move the INLINE_ASM_SUPPORTED guards outside the body of exec_cpuid, as
  suggested by Genoil;
- copy the asm code of busy_sse_loop to masm-x64.asm. Some fixup was
  required, because the microsoft calling convention doesn't expect
  xmm6 & xmm7 to be clobbered in functions.

Confirmed that --clock-ic from cpuid_tool works with the resulting library.
2015-05-07 17:16:46 +02:00
Veselin Georgiev
2722a10738 Address lintian warnings/errors. Fixes issue #16. 2015-04-21 12:23:51 -04:00
Veselin Georgiev
6b38edcc88 Fixed issue #13: unused substitution variable ${misc:Pre-Depends}
Fixed by adding that dependency to debian/control.
2015-04-21 09:56:07 -04:00
Veselin Georgiev
812b89bcb8 'make test' ported to run on Python 2.5 as well. 2015-04-20 17:22:11 +03:00
Veselin Georgiev
8d738e8ef5 Formatting changes to library description. 2015-04-20 11:00:13 +03:00
Veselin Georgiev
51bb74ad29 Merge pull request #15 from gdbdzgd/debian-jessie
fix lintian errors checking libcpuid.deb
2015-04-20 10:54:14 +03:00
Zhang, Guodong
d0592df57b fix lintian errors checking libcpuid.deb
https://github.com/anrieff/libcpuid/issues/14

	modified:   debian/control
	renamed:    debian/libcpuid-dev.install -> debian/libcpuid11-dev.install
	renamed:    debian/libcpuid.install -> debian/libcpuid11.install

Signed-off-by: Zhang, Guodong <gdzhang@linx-info.com>
2015-04-20 11:27:00 +08:00
Veselin Georgiev
3bcb21a1ba Post-merge: fill in the blanks in the debian directory; some cleanup too.
Remove the two README.* files, as there isn't anything extraordinary with
building this package.
2015-04-20 02:29:53 +03:00
Veselin Georgiev
365f7d25ca Merge pull request #12 from gdbdzgd/debian
add build support for debian jessie
2015-04-20 02:14:08 +03:00
Zhang, Guodong
efe0f6fe03 Merge remote-tracking branch 'remotes/upstream/master'
Signed-off-by: Zhang, Guodong <gdzhang@linx-info.com>
2015-04-18 09:17:53 +08:00
Zhang, Guodong
5d2c66c3b3 add build support for debian jessie
dpkg-buildpackage build debian packages

	new file:   debian/README.Debian
	new file:   debian/README.source
	new file:   debian/changelog
	new file:   debian/compat
	new file:   debian/control
	new file:   debian/copyright
	new file:   debian/docs
	new file:   debian/libcpuid-dev.install
	new file:   debian/libcpuid-doc.docs
	new file:   debian/libcpuid.install
	new file:   debian/rules
	new file:   debian/source/format

Signed-off-by: Zhang, Guodong <gdzhang@linx-info.com>
2015-04-18 08:51:07 +08:00
Veselin Georgiev
94fc6ae36a Modify the table matcher a bit. Put some weights on the different fields.
Priously all fields in the matchtable were treated equal in importance.
With this change, the cache size a taken with half the weight in the decision.

Also add detection entries for some more recent Haswells, and the respective
tests. These are an i5 Haswell from a Mac Book Pro, and a i7 Haswel from
Thinkpad T540.
2015-04-17 01:21:30 +03:00
Veselin Georgiev
55b70cb31b Two more autogenerated files to the ignore list. 2015-04-16 21:19:27 +03:00
Veselin Georgiev
046d2ca2ab Better support for AVX, AVX2, BMI1 and BMI2 instruction set detection.
- Detect AVX and AVX2 on both Intel and AMD CPUs
- Detect BMI1 and BMI2 instruction sets (BMI2 is only on Haswell, BMI1 is
  also present on Bulldozers).
- Fix tests to reflect changes.
2015-04-16 20:54:37 +03:00
Veselin Georgiev
325904f498 Export the new API function, cpuid_get_total_cpus, in win32 DLLs.
To test it, the --total-cpus option to cpuid_tool calls this function
directly. Confirmed to work now on Windows.
2014-09-27 18:14:06 +03:00
Veselin Georgiev
dcbee3517f Fix some line endings (make them consistent on each mixed-EOL file).
Sadly, there's no consistency for the whole project, but I don't
want to mess with it now.
2014-09-27 17:49:23 +03:00
Robert Kausch
f7e6c6b274 Add cpuid_get_total_cpus to allow getting the total number of CPUs on systems without CPUID. 2014-09-27 17:46:19 +03:00
Robert Kausch
400c55dbe3 Allow compilation on non-x86 platforms. 2014-09-27 17:46:19 +03:00
Robert Kausch
72d49bdd6f Add support for get_total_cpus on *BSD and Solaris. 2014-09-27 17:46:19 +03:00
Veselin Georgiev
fa2083a992 Add support for detecting AVX2. Confirmed to detect on Haswell i3. 2014-09-24 00:03:11 +03:00
Veselin Georgiev
ce02f0bc96 Fix broken tests, where rdtscp in recent Intel chips is missing.
As described in previous commit.
2014-09-23 15:21:02 +03:00
Veselin Georgiev
a716585cc0 Add to makefile: "make fix-tests" to fix failing tests.
The last change to flags detection caused a bunch of tests to fail.
The reason is that they are bogus, all recent Intel chips don't have
RDTSCP indicated in the test files, whereas they have it in reality.
I figured it will be easier to add "--fix" option to run_tests.py,
rather than fixing each testfile by hand.

This is also extended in the Makefile:

"make test" runs the tests and reports discrepancies.
"make fix-tests" fixes any offending tests. This blindly assumes that
libcpuid is sane.
2014-09-23 15:20:27 +03:00
Veselin Georgiev
fc4ff90ea8 Recognize presence of RDTSCP on Intel CPUs as well.
Previously the detection only tested this AMD CPUs and the table check was
only present in recog_amd.c

Thanks to Andrew Roberts for reporting this issue!
2014-09-23 15:11:00 +03:00