Page MenuHomeFreeBSD

cpu: New cpu_get_pcpuid(), retrieves internal CPU ID
ClosedPublic

Authored by olce on Jun 27 2026, 1:44 AM.
Tags
None
Referenced Files
F171430341: D57897.id180801.diff
Fri, Sep 11, 2:38 AM
F171375402: D57897.id180801.diff
Thu, Sep 10, 6:53 PM
Unknown Object (File)
Thu, Sep 10, 3:50 PM
Unknown Object (File)
Tue, Sep 8, 8:35 AM
Unknown Object (File)
Sat, Sep 5, 4:20 AM
Unknown Object (File)
Sat, Sep 5, 3:30 AM
Unknown Object (File)
Fri, Sep 4, 10:07 PM
Unknown Object (File)
Fri, Sep 4, 6:40 PM
Subscribers

Details

Summary

It is a handy shortcut that will be used extensively in
hwpstate_intel(4) and hwpstate_amd(4).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74320
Build 71203: arc lint + arc unit

Event Timeline

olce requested review of this revision.Jun 27 2026, 1:44 AM
jhb added inline comments.
sys/sys/cpu.h
45

This can now use __BUS_ACCESSOR_DEFAULT() to return NULL by default, which will also mean you can start using cpu_has_pcpu in the pstate drivers to check for the ivar being valid vs manually calling BUS_READ_IVAR. It wouldn't be a functional change, just a cosmetic change that spells things more typically. (Unrelated to this commit, just a nice cleanup you can do as a separate commit)

60

This can also now use __BUS_ACCESSOR_DEFAULT() with a default value of -1.

This revision is now accepted and ready to land.Jul 3 2026, 3:06 PM

Thanks, will do some followup next week.