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

RDMSR: enhance AMD APUs detection

As suggested in #91
This commit is contained in:
Xorg 2017-05-04 07:32:02 +02:00
parent f8c7ee44e0
commit dd702cd253

View file

@ -640,7 +640,8 @@ static int get_amd_multipliers(struct msr_info_t *info, uint32_t pstate, double
/* Constant values for common families */ /* Constant values for common families */
const int magic_constant = (info->id->ext_family == 0x11) ? 0x8 : 0x10; const int magic_constant = (info->id->ext_family == 0x11) ? 0x8 : 0x10;
const double divisor = ((FUSION_C <= info->internal->code.amd) && (info->internal->code.amd <= FUSION_A)) ? 1.0 : 2.0; const int is_apu = ((FUSION_C <= info->internal->code.amd) && (info->internal->code.amd <= FUSION_A)) || (info->internal->bits & _APU_);
const double divisor = is_apu ? 1.0 : 2.0;
/* Check if P-state is valid */ /* Check if P-state is valid */
if (pstate < MSR_PSTATE_0 || MSR_PSTATE_7 < pstate) if (pstate < MSR_PSTATE_0 || MSR_PSTATE_7 < pstate)