CPU (Linux): adds SPARC support - #2572
Merged
Merged
Conversation
shalseth
force-pushed
the
cpu-sparc-support
branch
from
September 8, 2026 09:31
ca8e014 to
193b6a5
Compare
Member
|
You should add a new entry Other changes LGTM. |
/proc/cpuinfo on sparc has none of the fields the generic fallback looks for, so the module printed "Unknown (64)". The name is in "cpu", and the frequency in "Cpu<n>ClkTck" -- in Hz, hex on sparc64, decimal on sparc32.
shalseth
force-pushed
the
cpu-sparc-support
branch
from
September 8, 2026 10:22
193b6a5 to
818ab6c
Compare
Contributor
Author
|
Thanks, CHANGELOG updated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/proc/cpuinfoon SPARC has nomodel name,model,cpu model,hardwareorprocessorfield, so the CPU module prints
Unknown. The chip name is in thecpufield, and the clockfrequency is in
Cpu<n>ClkTck— in Hz rather than MHz, and in hex on sparc64. SPARC has nocpufreqsysfs, so that field is the only frequency source.Related issue
/proc/cpuinfofor both machines is in #1529.Changes
parseCpuInfo(): under__sparc__, read the name fromcpuand the clock tick fromCpu0ClkTck.detectCPUOthers(): convert that from Hz to MHz. sparc64 prints it as%016lxand sparc32 as%ld; since a 32-bit userland can run on a 64-bit kernel, the base comes from the value's widthrather than from the build's bitness.
Core counts already work and are unchanged (8/64 on the T4-1, 2/2 on the V240). sparc32 is untested.
Checklist