Skip to content

Commit

Permalink
Fix VS compiler issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaneee committed Sep 11, 2024
1 parent 256e8db commit b3ce3bf
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Library/OcCpuLib/OcCpuLib.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ ScanAmdProcessor (
case AMD_CPU_EXT_FAMILY_1AH:
if (Cpu->CPUFrequencyFromVMT == 0) {
CofVid = AsmReadMsr64 (K10_PSTATE_STATUS);
CoreFrequencyID = (UINT16)BitFieldRead64 (CofVid, 0, 11); // 12-bit field for FID
CoreFrequencyID = (UINT8)BitFieldRead64 (CofVid, 0, 11); // 12-bit field for FID

// On AMD Family 1Ah and later, if the Frequency ID (FID) exceeds 0x0f,
// the core frequency is scaled by a factor of 5. This scaling behavior
Expand Down Expand Up @@ -814,13 +814,10 @@ ScanAmdProcessor (
//
if (MaxBusRatio == 0) {
Cpu->FSBFrequency = 100000000; // 100 MHz like Intel part.
} else if (Cpu->ExtFamily == AMD_CPU_EXT_FAMILY_1AH) {
Cpu->FSBFrequency = DivU64x32 (Cpu->CPUFrequency, CoreFrequencyID); // No divisor for Family 1Ah
} else {
// Special handling for Family 1Ah
if (Cpu->ExtFamily == AMD_CPU_EXT_FAMILY_1AH) {
Cpu->FSBFrequency = DivU64x32 (Cpu->CPUFrequency, CoreFrequencyID); // No divisor for Family 1Ah
} else {
Cpu->FSBFrequency = DivU64x32 (Cpu->CPUFrequency, MaxBusRatio);
}
Cpu->FSBFrequency = DivU64x32 (Cpu->CPUFrequency, MaxBusRatio);
}
}
}
Expand Down

0 comments on commit b3ce3bf

Please sign in to comment.