Skip to content

CPU (Linux): adds SPARC support - #2572

Merged
CarterLi merged 1 commit into
fastfetch-cli:devfrom
shalseth:cpu-sparc-support
Sep 8, 2026
Merged

CPU (Linux): adds SPARC support#2572
CarterLi merged 1 commit into
fastfetch-cli:devfrom
shalseth:cpu-sparc-support

Conversation

@shalseth

@shalseth shalseth commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Summary

/proc/cpuinfo on SPARC has no model name, model, cpu model, hardware or processor
field, so the CPU module prints Unknown. The chip name is in the cpu field, and the clock
frequency is in Cpu<n>ClkTck — in Hz rather than MHz, and in hex on sparc64. SPARC has no
cpufreq sysfs, so that field is the only frequency source.

  # UltraSPARC T4-1 (sun4v)
- CPU: Unknown (64)
+ CPU: UltraSparc T4 (Niagara4) (64) @ 2.85 GHz

  # Sun Fire V240 (sun4u)
- CPU: Unknown (2)
+ CPU: TI UltraSparc IIIi (Jalapeno) (2) @ 1.50 GHz

Related issue

/proc/cpuinfo for both machines is in #1529.

Changes

  • parseCpuInfo(): under __sparc__, read the name from cpu and the clock tick from Cpu0ClkTck.
  • detectCPUOthers(): convert that from Hz to MHz. sparc64 prints it as %016lx and sparc32 as
    %ld; since a 32-bit userland can run on a 64-bit kernel, the base comes from the value's width
    rather 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

  • I have tested my changes locally.

@CarterLi

CarterLi commented Sep 8, 2026

Copy link
Copy Markdown
Member

You should add a new entry UNRELEASED in CHANGELOG since 2.68.1 has been released.

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

shalseth commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, CHANGELOG updated.

@CarterLi
CarterLi merged commit 7d0256f into fastfetch-cli:dev Sep 8, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants