HomeFreeBSD

cpu: New cpu_get_pcpuid(), retrieves internal CPU ID

Description

cpu: New cpu_get_pcpuid(), retrieves internal CPU ID

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

Warn users that it panics if the parent bus does not provide the
CPU_IVAR_PCPU instance variable. That condition should be tested by
callers (doing so once is enough). Suggest to do that in driver's
attach method.

Reviewed by: jhb (code)
Event: Halifax Hackathon 202606
Location: Seat 36K in AC667, waiting for a gate at Montréal-Trudeau
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D57897

Details

Provenance
olceAuthored on Jun 26 2026, 10:17 PM
Reviewer
jhb
Differential Revision
D57897: cpu: New cpu_get_pcpuid(), retrieves internal CPU ID
Parents
rG465a3b7adc00: newvers.sh: Avoid spurious -dirty in git revision
Branches
Unknown
Tags
Unknown