mirror of
https://github.com/anrieff/libcpuid
synced 2024-11-10 22:59:13 +00:00
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.
This commit is contained in:
parent
00b7081035
commit
25c83f0d0b
1 changed files with 6 additions and 3 deletions
|
@ -1320,9 +1320,12 @@ int cpuid_get_raw_data_core(struct cpu_raw_data_t* data, logical_cpu_t logical_c
|
|||
|
||||
if (logical_cpu != (logical_cpu_t) -1) {
|
||||
debugf(2, "Getting raw dump for logical CPU %u\n", logical_cpu);
|
||||
if (!set_cpu_affinity(logical_cpu))
|
||||
return cpuid_set_error(ERR_INVCNB);
|
||||
affinity_saved = save_cpu_affinity();
|
||||
if (set_cpu_affinity(logical_cpu))
|
||||
affinity_saved = save_cpu_affinity();
|
||||
else
|
||||
/* Never return ERR_INVCNB for logical CPU 0 (in case set_cpu_affinity() is not supported) */
|
||||
if (logical_cpu > 0)
|
||||
return cpuid_set_error(ERR_INVCNB);
|
||||
}
|
||||
|
||||
#if defined(PLATFORM_X86) || defined(PLATFORM_X64)
|
||||
|
|
Loading…
Reference in a new issue