mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-06-17 17:36:55 +00:00
cpu: halve octeon bogomips to recover the true core clock
Some checks failed
Rust / Test on aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on armv7-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Test on i686-unknown-linux-gnu (push) Has been cancelled
Rust / Test on loongarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on powerpc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on powerpc64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on powerpc64le-unknown-linux-gnu (push) Has been cancelled
Rust / Test on riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on s390x-unknown-linux-gnu (push) Has been cancelled
Rust / Test on sparc64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on mips-unknown-linux-gnu (push) Has been cancelled
Rust / Test on mips64-unknown-linux-gnuabi64 (push) Has been cancelled
Rust / Test on riscv32gc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on x86_64-unknown-linux-gnu (push) Has been cancelled
Some checks failed
Rust / Test on aarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on armv7-unknown-linux-gnueabihf (push) Has been cancelled
Rust / Test on i686-unknown-linux-gnu (push) Has been cancelled
Rust / Test on loongarch64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on powerpc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on powerpc64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on powerpc64le-unknown-linux-gnu (push) Has been cancelled
Rust / Test on riscv64gc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on s390x-unknown-linux-gnu (push) Has been cancelled
Rust / Test on sparc64-unknown-linux-gnu (push) Has been cancelled
Rust / Test on mips-unknown-linux-gnu (push) Has been cancelled
Rust / Test on mips64-unknown-linux-gnuabi64 (push) Has been cancelled
Rust / Test on riscv32gc-unknown-linux-gnu (push) Has been cancelled
Rust / Test on x86_64-unknown-linux-gnu (push) Has been cancelled
This commit is contained in:
parent
b43d88c749
commit
3a6b6e2d2f
1 changed files with 8 additions and 0 deletions
|
|
@ -204,6 +204,14 @@ fn get_cpu_freq_mhz() -> Option<u32> {
|
||||||
mhz = mhz * 10 + u32::from(b - b'0');
|
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 {
|
if mhz > 0 {
|
||||||
return Some(mhz);
|
return Some(mhz);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue