Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/lib/src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ fn get_cpu_freq_mhz() -> Option<u32> {
mhz = mhz * 10 + u32::from(b - b'0');
}
}

// Octeon presets loops_per_jiffy to clock_rate/HZ, so its BogoMIPS is
// exactly 2x the core clock, unlike the 1:1 of other MIPS.
// https://github.com/torvalds/linux/blob/v6.19/arch/mips/cavium-octeon/csrc-octeon.c#L40
if *key == b"BogoMIPS" && data.windows(6).any(|w| w == b"Octeon") {
mhz /= 2;
}

if mhz > 0 {
return Some(mhz);
}
Expand Down
Loading