cpuid_leaf(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cpuid_leaf(9) β€” the cpuid_leaf page, bestie edition πŸŽ€

okay so you're in the Kernel API Manual ✨ and this is literally the page for cpuid_leaf πŸ’–


🌸 NAME 🌸

cpuid_leaf β€” access parsed CPUID data, no cap πŸ’«


✨ SYNOPSIS ✨

cpuid_leaf (_cpuinfo , _leaf );

yes that's the whole thing, she's lowkey minimal 😌


🫢 ARGUMENTS 🫢

  • _cpuinfo β€” your CPU capability structure reference, aka a 'struct cpuinfo_x86' πŸ’œ hand her over and she'll do the rest.
  • _leaf β€” the CPUID leaf, and it's gotta be in compile-time 0xN format, mmkay? like e.g. 0x0, 0x2, 0x80000000 🌈

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically she's giving cpuid_subleaf energy, except the CPUID subleaf is pinned to = 0 πŸ’… that's the whole vibe.

Example usage, bestie, copy it exactly πŸ‘‡

const struct leaf_0x0_0 *l0 = cpuid_leaf(c, 0x0);
if (!l0) {
        // Handle error
}

const struct leaf_0x80000000_0 *el0 = cpuid_leaf(c, 0x80000000);
if (!el0) {
        // Handle error
}

like look at that if (!l0) check β€” she said handle your error, periodt πŸ˜­πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, fr fr 🌟 β€” kernel file ./arch/x86/include/asm/cpuid/api.h:


ok that's the page!! now go parse some CPUID data and slay πŸ’–πŸ”₯

and for the credits moment πŸŽ€ β€” this cutie lives in ./arch/x86/include/asm/cpuid, dated October 2026, and the whole thing is cpuid_leaf(9) πŸ’œ bye bestie πŸ¦‹

πŸ“¦ where this page comes from