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

749 commits

Author SHA1 Message Date
The Tumultuous Unicorn Of Darkness
a483748856
Update Readme.md 2024-08-25 12:45:57 +02:00
Pavol Žáčik
9915832b21 Add simple sanity tests of the Python bindings
And include them in the CI together with pylint
and formatting checks.
2024-08-25 12:43:29 +02:00
Pavol Žáčik
ec938b5d42 Document the Python bindings using Sphinx
Additionally, setup the documentation for
deployment to Read The Docs.
2024-08-25 12:43:29 +02:00
Pavol Žáčik
40e2d5fcb6 Add Python bindings
The bindings are implemented via python-cffi and cover all
current functionality of the library. They do not provide
a 1-to-1 mapping of the functionality, but a more "Pythonic"
API instead.

When new functionality is added to the libcpuid library
in the future, the changes must be manually added to the
bindings in order to appear in the Python interface.
However, if only a C enum is extended, the changes will
be automatically reflected in the Python interface.
2024-08-25 12:43:29 +02:00
Pavol Žáčik
6c87edab5a Remove CPU_ prefix from x86 cpu_feature_level_t enum options
This makes the option names of cpu_feature_level_t consistent
and it also makes it easier to list options of the cpu_feature_t
enum just by their prefix (because it now doesn't collide with
the prefix of cpu_feature_level_t options).
2024-08-25 12:43:29 +02:00
The Tumultuous Unicorn Of Darkness
6b87429dc5
Rename error variable in cpu_request_core_type() for consistency 2024-08-04 15:13:45 +02:00
The Tumultuous Unicorn Of Darkness
673f4e45ff
Improve error handling in cpu_identify_all() 2024-08-04 15:13:45 +02:00
The Tumultuous Unicorn Of Darkness
8f6b84d86c
Fix SEGFAULT in debugf() when using --quiet
The `--quiet` option calls `cpuid_set_warn_function(NULL)`, but debugf() was not checking if _warn_fun is defined unlike warnf()
2024-08-04 15:13:26 +02:00
The Tumultuous Unicorn Of Darkness
afbc2e5a4a
Hide a warning
/home/runner/work/libcpuid/libcpuid/libcpuid/cpuid_main.c:450:44: warning: unused parameter 'logical_cpu' [-Wunused-parameter]
static bool set_cpu_affinity(logical_cpu_t logical_cpu)
2024-08-03 12:38:19 +02:00
The Tumultuous Unicorn Of Darkness
ddd5868577
CI: cancel previous jobs in the group
https://stackoverflow.com/a/72408109
2024-08-03 12:34:49 +02:00
The Tumultuous Unicorn Of Darkness
d86097846b
Update status badges with URL in README.md 2024-08-03 12:31:23 +02:00
The Tumultuous Unicorn Of Darkness
ee3543f95b
Improve OS array in README.md 2024-08-03 12:28:08 +02:00
The Tumultuous Unicorn Of Darkness
cec3e8cacc
CI: set run shell for *BSD
/usr/local/bin/bash is a wrapper around 'vagrant ssh' using Bash
2024-08-03 12:25:27 +02:00
The Tumultuous Unicorn Of Darkness
7a03559d3a
CI: add a build job for NetBSD 2024-08-03 12:22:44 +02:00
The Tumultuous Unicorn Of Darkness
f7c8cac3e2
CI: update action for *BSD 2024-08-02 16:52:43 +02:00
The Tumultuous Unicorn Of Darkness
6a189f5245
CI: update workflow filename for release 2024-07-31 19:50:56 +02:00
The Tumultuous Unicorn Of Darkness
50cca6ac1a
CI: add a build job for OpenBSD 2024-07-31 19:50:37 +02:00
The Tumultuous Unicorn Of Darkness
f438aa3b40
CI: add a build job for DragonFly BSD 2024-07-31 19:48:56 +02:00
The Tumultuous Unicorn Of Darkness
fae9ec6b72
CI: update Linux+FreeBSD jobs 2024-07-31 16:39:42 +02:00
The Tumultuous Unicorn Of Darkness
b7940c7029
Fix a regression in cpuid_tool when ident_required=0 for arg
In 2b8023f733, I had to update the behavior of cpuid_tool to loop over all data.cpu_types items.
I did not realize since this change, it was not entering the loop for args with ident_required=0, because data.num_cpu_types was always 0, so print_info() was never called for such args.

In other words, args like --rdmsr or --cpuid did nothing due to this regression. This commit fix this regression.
2024-07-31 16:33:40 +02:00
The Tumultuous Unicorn Of Darkness
d31e2fd73b
CI: split UNIX job 2024-07-31 15:51:56 +02:00
The Tumultuous Unicorn Of Darkness
70559537c9
CI: add a build job for FreeBSD 2024-07-31 15:36:09 +02:00
The Tumultuous Unicorn Of Darkness
55ddd70513
CI: rename some jobs with better names 2024-07-31 15:33:28 +02:00
The Tumultuous Unicorn Of Darkness
543c3ac17d
Fix scanf() format for 'logical_cpu' in cpuid_deserialize_raw_data_internal()
logical_cpu is an uint16_t, so SCNu16 is the correct format. It was providing strange values with SCNi16, like with the Intel® Xeon® Platinum 8280 dump.
2024-07-31 15:12:30 +02:00
The Tumultuous Unicorn Of Darkness
25c83f0d0b
Provide raw for logical CPU 0 in cpuid_get_raw_data_core() even if set_cpu_affinity() is not supported
On OpenBSD, set_cpu_affinity() is not supported, so cpuid_get_raw_data_core() always returns ERR_INVCNB.
This commit allows to provide raw data for at least one CPU core.
2024-07-27 17:45:05 +02:00
The Tumultuous Unicorn Of Darkness
00b7081035
Do not set 'with_affinity' in cpu_raw_data_array_t_constructor() when set_cpu_affinity() is not supported 2024-07-27 17:41:58 +02:00
The Tumultuous Unicorn Of Darkness
508225fe3f
Fix build on OpenBSD
There are declaration conflicts between ctype.h and libcpuid_internal.h. Let's provide a workaround for it.
2024-07-27 17:39:48 +02:00
The Tumultuous Unicorn Of Darkness
c6723aa914
Improve cpuid_tool behavior when cpu_types array is empty
It happens when cpuid_get_all_raw_data() cannot use set_cpu_affinity()
2024-07-27 13:33:55 +02:00
The Tumultuous Unicorn Of Darkness
2133c22052
Improve set_cpu_affinity() on NetBSD
By default, running libcpuid as regular user on NetBSD shows nothing: set_cpu_affinity() fails quietly so cpu_identify_all() is not able to get raw data.
This commit display a warning when an unallowed user try to set CPU affinity.
2024-07-27 13:25:08 +02:00
The Tumultuous Unicorn Of Darkness
3c37492b93
Support get_total_cpus() on DragonFly BSD
Tested on DragonFly BSD 6: it works as expected.
2024-07-27 12:00:23 +02:00
The Tumultuous Unicorn Of Darkness
505c8b5fe6
Improve errors handling in cpuid_get_all_raw_data() and cpuid_get_raw_data_core()
Close #202
2024-07-26 11:57:11 +02:00
The Tumultuous Unicorn Of Darkness
dec92af12f
Add README for CPUID kernel modules for ARM 2024-07-10 22:28:50 +02:00
The Tumultuous Unicorn Of Darkness
af5f267ba3
CI: update CMake option names
Related to 52efefbb7d
2024-07-10 22:02:50 +02:00
The Tumultuous Unicorn Of Darkness
66c4e22162
Ignore files generated by cpuid_tool 2024-07-10 21:57:20 +02:00
The Tumultuous Unicorn Of Darkness
4df61a58b2
Update supported CPU and OS in README.md 2024-07-10 21:56:29 +02:00
The Tumultuous Unicorn Of Darkness
52efefbb7d
CMake: harmonizes options 2024-07-10 20:56:38 +02:00
The Tumultuous Unicorn Of Darkness
4d6cc787fe
rdcpuid: handle errors 2024-07-10 20:18:03 +02:00
The Tumultuous Unicorn Of Darkness
0d71be934e
Add cpuid FreeBSD kernel module for ARM CPUs 2024-07-10 20:17:10 +02:00
The Tumultuous Unicorn Of Darkness
371a9648d6
Add cpuid Linux kernel module for ARM CPUs 2024-07-10 20:16:19 +02:00
The Tumultuous Unicorn Of Darkness
fb4abf78bb
CMake: disable C++ compiler
libcpuid is written in C only, the C++ (CXX) compiler is not required
2024-07-10 16:53:19 +02:00
The Tumultuous Unicorn Of Darkness
ea462f761f
Move Windows MSR driver to a new directory
The idea is to have add new drivers for ARM CPUs
2024-07-09 19:02:39 +02:00
The Tumultuous Unicorn Of Darkness
7b6047c2ac
Extract both AArch32 and AArch64 registers on AArch64 2024-07-09 18:17:54 +02:00
The Tumultuous Unicorn Of Darkness
a4c97cd1e7
Remove ARM64 registers definition
Moved to libcpuid_arm_driver.h in 0f0b1e6060
2024-07-08 21:58:34 +02:00
The Tumultuous Unicorn Of Darkness
9b9f9e2faa
Disable is_aarch64_mode() for now
Function is not used.
2024-07-08 21:53:49 +02:00
The Tumultuous Unicorn Of Darkness
0f0b1e6060
Add rdcpuid interface for kernel drivers on ARM CPUs 2024-07-08 21:53:26 +02:00
The Tumultuous Unicorn Of Darkness
6e6b4bcbf5
Set a dummy cpu_exec_mrs() macro when inline ASM is not supported
Fix #201
2024-07-08 21:44:02 +02:00
The Tumultuous Unicorn Of Darkness
c5d9b387d1
Improve ARM core ID identification and add cpuid_get_raw_data_core() 2024-07-07 17:48:41 +02:00
The Tumultuous Unicorn Of Darkness
ea9ada7118
Add initial support for ARM CPUs running in AArch32 mode
Related to #96
Kernel modules to access AArch32 registers will be added in a separate commit.
2024-07-07 16:47:59 +02:00
The Tumultuous Unicorn Of Darkness
7b0e6ba085
Put back correct fprintf() format in cpuid_serialize_raw_data_internal()
%08 and %016 removed by mistake in 10bac35920
2024-07-03 19:36:56 +02:00
The Tumultuous Unicorn Of Darkness
1bc636e2cf
Print a warning for unsupported CPU architectures
The goal is to warn people trying to build libcpuid on PPC, MIPS, RISC-V and so on.
2024-07-01 15:11:21 +02:00